Version 2.2.0 RC-1
This commit is contained in:
1 parent
f73f8bff6d
commit
22f1b963ee
1034 files changed
+178610
-70897
No files matched your search
@@ -2,27 +2,18 @@
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Power Board 2.1.7
|
||||
| Invision Power Board
|
||||
| =============================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001 - 2005 Invision Power Services, Inc.
|
||||
| (c) 2001 - 2006 Invision Power Services, Inc.
|
||||
| http://www.invisionpower.com
|
||||
| =============================================
|
||||
| Web: http://www.invisionboard.com
|
||||
| http://www.ibresource.ru/products/invisionpowerboard/
|
||||
| Time: Tuesday 18th of July 2006 05:56:00 PM
|
||||
| Release: 52f408a29988b02f45b5e6f4ba5af0ae
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
| http://www.ibresource.ru/license
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD IS NOT FREE / OPEN SOURCE!
|
||||
+---------------------------------------------------------------------------
|
||||
| INVISION POWER BOARD ÍÅ ßÂËßÅÒÑß ÁÅÑÏËÀÒÍÛÌ ÏÐÎÃÐÀÌÌÍÛÌ ÎÁÅÑÏÅ×ÅÍÈÅÌ!
|
||||
| Ïðàâà íà ÏÎ ïðèíàäëåæàò Invision Power Services
|
||||
+---------------------------------------------------------------------------
|
||||
| > $Date: 2005-12-08 16:32:40 +0000 (Thu, 08 Dec 2005) $
|
||||
| > $Revision: 96 $
|
||||
| > $Author: bfarber $
|
||||
| > $Date: 2006-09-22 11:28:54 +0100 (Fri, 22 Sep 2006) $
|
||||
| > $Revision: 567 $
|
||||
| > $Author: matt $
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > Skin -> Templates functions
|
||||
@@ -36,7 +27,7 @@
|
||||
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
{
|
||||
print "<h1>Íåâåðíûé âõîä</h1> Ó Âàñ íåò äîñòóïà ê äèðåêòèâå ýòîãî ôàéëà. Åñëè Âû ïðîâîäèëè îáíîâëåíèÿ, óáåäèòåñü, ÷òî íå çàáûëè îáíîâèòü 'admin.php'.";
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
@@ -47,6 +38,8 @@ class ad_skin_template_bits
|
||||
var $template = "";
|
||||
var $functions = "";
|
||||
|
||||
var $search_bits;
|
||||
|
||||
/**
|
||||
* Section title name
|
||||
*
|
||||
@@ -69,26 +62,11 @@ class ad_skin_template_bits
|
||||
|
||||
function auto_run()
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Kill globals - globals bad, Homer good.
|
||||
//-----------------------------------------
|
||||
|
||||
$tmp_in = array_merge( $_GET, $_POST, $_COOKIE );
|
||||
|
||||
foreach ( $tmp_in as $k => $v )
|
||||
{
|
||||
unset($$k);
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Get the libraries
|
||||
//-----------------------------------------
|
||||
|
||||
require_once( KERNEL_PATH.'class_template.php' );
|
||||
|
||||
$this->template = new class_template();
|
||||
|
||||
$this->template->root_path = ROOT_PATH;
|
||||
$this->template =& $this->ipsclass->cache_func->template;
|
||||
|
||||
//-----------------------------------------
|
||||
// LOAD HTML
|
||||
@@ -105,9 +83,9 @@ class ad_skin_template_bits
|
||||
|
||||
//-----------------------------------------
|
||||
|
||||
$this->unaltered = "<img src='{$this->ipsclass->skin_url}/images/skin_item_unaltered.gif' border='0' alt='-' title='Íå èçìåíåí îò íà÷àëüíîãî âàðèàíòà øàáëîíà' /> ";
|
||||
$this->altered = "<img src='{$this->ipsclass->skin_url}/images/skin_item_altered.gif' border='0' alt='+' title='Èçìåíåí îò íà÷àëüíîãî âàðèàíòà øàáëîíà' /> ";
|
||||
$this->inherited = "<img src='{$this->ipsclass->skin_url}/images/skin_item_inherited.gif' border='0' alt='|' title='Óíàñëåäîâàííûé îò íà÷àëüíîãî âàðèàíòà øàáëîíà' /> ";
|
||||
$this->unaltered = "<img src='{$this->ipsclass->skin_acp_url}/images/skin_item_unaltered.gif' border='0' alt='-' title='Unaltered from parent skin set' /> ";
|
||||
$this->altered = "<img src='{$this->ipsclass->skin_acp_url}/images/skin_item_altered.gif' border='0' alt='+' title='Altered from parent skin set' /> ";
|
||||
$this->inherited = "<img src='{$this->ipsclass->skin_acp_url}/images/skin_item_inherited.gif' border='0' alt='|' title='Inherited from parent skin set' /> ";
|
||||
|
||||
//-----------------------------------------
|
||||
|
||||
@@ -177,7 +155,7 @@ class ad_skin_template_bits
|
||||
$group_name = trim( $this->ipsclass->input['group_name'] );
|
||||
$id = intval( $this->ipsclass->input['id'] );
|
||||
$p = intval( $this->ipsclass->input['p'] );
|
||||
$type = $type != '' ? $type : trim( $this->ipsclass->input['type'] );
|
||||
$type = $type != '' ? $type : ( isset($this->ipsclass->input['type']) ? trim( $this->ipsclass->input['type'] ) : '' );
|
||||
|
||||
//-----------------------------------------
|
||||
// Get $skin_names stuff
|
||||
@@ -197,7 +175,7 @@ class ad_skin_template_bits
|
||||
|
||||
if ( ! $id )
|
||||
{
|
||||
$this->ipsclass->admin->error("Âû äîëæíû óêàçàòü ID øàáëîíà, âåðíèòåñü íàçàä è ïîïðîáóéòå åùå ðàç");
|
||||
$this->ipsclass->admin->error("You must specify an existing template set ID, go back and try again");
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -242,8 +220,8 @@ class ad_skin_template_bits
|
||||
|
||||
$group_bits = $this->ipsclass->cache_func->_get_templates($id, $p, 'groups', $group_name );
|
||||
|
||||
$add_button = "<div class='realbutton' style='padding:4px;width:105px'>
|
||||
<a style='text-decoration:none' href='#' onclick=\"parent.template_add_bit('{$this->ipsclass->base_url}&{$this->ipsclass->form_code}&code=addbit&id={$this->ipsclass->input['id']}&p={$this->ipsclass->input['p']}&expand={$group['group_name']}', event)\">Äîáàâèòü øàáëîí</a>
|
||||
$add_button = "<div class='realbutton' style='padding:4px;width:100px'>
|
||||
<a style='text-decoration:none' href='#' onclick=\"parent.template_add_bit('{$this->ipsclass->base_url}&{$this->ipsclass->form_code}&code=addbit&id={$this->ipsclass->input['id']}&p={$this->ipsclass->input['p']}&expand={$group['group_name']}', event)\">Add Template Bit</a>
|
||||
</div>";
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -257,7 +235,7 @@ class ad_skin_template_bits
|
||||
// Stuff array to sort on name
|
||||
//-----------------------------------------
|
||||
|
||||
foreach( $group_bits as $eye => $i )
|
||||
foreach( $group_bits as $i )
|
||||
{
|
||||
$sec_arry[ $i['suid'] ] = $i;
|
||||
$sec_arry[ $i['suid'] ]['easy_name'] = $i['func_name'];
|
||||
@@ -273,7 +251,7 @@ class ad_skin_template_bits
|
||||
// Loop and print main display
|
||||
//-----------------------------------------
|
||||
|
||||
foreach( $sec_arry as $i => $sec )
|
||||
foreach( $sec_arry as $sec )
|
||||
{
|
||||
$custom_bit = "";
|
||||
|
||||
@@ -297,18 +275,18 @@ class ad_skin_template_bits
|
||||
$altered_image = $this->html->template_bits_bit_row_image( $sec['suid'], 'skin_item_inherited.gif' );
|
||||
}
|
||||
|
||||
$remove_button = "<a id='link-remove-{$sec['suid']}' title='Âåðíóòü ïðåæíåå ñîñòîÿíèå' href=\"javascript:confirm_action('{$this->ipsclass->base_url}&{$this->ipsclass->form_code}&code=template_remove_bit&bitname={$sec['func_name']}&id={$this->ipsclass->input['id']}&p={$this->ipsclass->input['p']}&group_name={$sec['group_name']}&type=frame')\"><img id='img-remove-{$sec['suid']}' src='{$this->ipsclass->skin_url}/images/blank.gif' alt='' border='0' width='1' height='1' /></a> ";
|
||||
$remove_button = "<a id='link-remove-{$sec['suid']}' title='Revert Customization' href=\"javascript:confirm_action('{$this->ipsclass->base_url}&{$this->ipsclass->form_code}&code=template_remove_bit&bitname={$sec['func_name']}&id={$this->ipsclass->input['id']}&p={$this->ipsclass->input['p']}&group_name={$sec['group_name']}&type=frame')\"><img id='img-remove-{$sec['suid']}' src='{$this->ipsclass->skin_acp_url}/images/blank.gif' alt='' border='0' width='1' height='1' /></a> ";
|
||||
|
||||
if ( $sec['set_id'] == $id )
|
||||
{
|
||||
if ( $master_names[ $sec['func_name'] ] )
|
||||
{
|
||||
$remove_button = "<a id='link-remove-{$sec['suid']}' title='Âåðíóòü ïðåæíåå ñîñòîÿíèå' href=\"javascript:confirm_action('{$this->ipsclass->base_url}&{$this->ipsclass->form_code}&code=template_remove_bit&bitname={$sec['func_name']}&id={$this->ipsclass->input['id']}&p={$this->ipsclass->input['p']}&group_name={$sec['group_name']}&type=frame')\"><img id='img-remove-{$sec['suid']}'src='{$this->ipsclass->skin_url}/images/te_revert.gif' alt='X' border='0' /></a> ";
|
||||
$remove_button = "<a id='link-remove-{$sec['suid']}' title='Revert Customization' href=\"javascript:confirm_action('{$this->ipsclass->base_url}&{$this->ipsclass->form_code}&code=template_remove_bit&bitname={$sec['func_name']}&id={$this->ipsclass->input['id']}&p={$this->ipsclass->input['p']}&group_name={$sec['group_name']}&type=frame')\"><img id='img-remove-{$sec['suid']}'src='{$this->ipsclass->skin_acp_url}/images/te_revert.gif' alt='X' border='0' /></a> ";
|
||||
}
|
||||
else
|
||||
{
|
||||
$custom_bit = ' (custom bit)';
|
||||
$remove_button = "<a id='link-remove-{$sec['suid']}' title='Óäàëèòü âûáðàííûå ÷àñòè' href=\"javascript:confirm_action('{$this->ipsclass->base_url}&{$this->ipsclass->form_code}&code=template_remove_bit&bitname={$sec['func_name']}&id={$this->ipsclass->input['id']}&p={$this->ipsclass->input['p']}&group_name={$sec['group_name']}&type=frame&custombit=1')\"><img id='img-remove-{$sec['suid']}' src='{$this->ipsclass->skin_url}/images/te_remove.gif' alt='X' border='0' /></a> ";
|
||||
$remove_button = "<a id='link-remove-{$sec['suid']}' title='Remove Custom Bit' href=\"javascript:confirm_action('{$this->ipsclass->base_url}&{$this->ipsclass->form_code}&code=template_remove_bit&bitname={$sec['func_name']}&id={$this->ipsclass->input['id']}&p={$this->ipsclass->input['p']}&group_name={$sec['group_name']}&type=frame&custombit=1')\"><img id='img-remove-{$sec['suid']}' src='{$this->ipsclass->skin_acp_url}/images/te_remove.gif' alt='X' border='0' /></a> ";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -372,7 +350,7 @@ class ad_skin_template_bits
|
||||
|
||||
if ( $this->ipsclass->input['id'] == "")
|
||||
{
|
||||
$this->ipsclass->admin->error("Âû äîëæíû óêàçàòü ID øàáëîíà, âåðíèòåñü íàçàä è ïîïðîáóéòå åùå ðàç");
|
||||
$this->ipsclass->admin->error("You must specify an existing template set ID, go back and try again");
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -392,8 +370,8 @@ class ad_skin_template_bits
|
||||
$in = ','.$this->ipsclass->input['p'];
|
||||
}
|
||||
|
||||
$this->ipsclass->admin->page_detail = "Â ýòîé ñåêöèè âû ìîæåòå äîáàâèòü íîâûé ôðàãìåíò øàáëîíà.";
|
||||
$this->ipsclass->admin->page_title = "Èçìåíåíèå øàáëîíà";
|
||||
$this->ipsclass->admin->page_detail = "Please choose which section you wish to edit below.";
|
||||
$this->ipsclass->admin->page_title = "Edit Template sets";
|
||||
|
||||
//-----------------------------------------
|
||||
// Generate inline JS
|
||||
@@ -406,7 +384,7 @@ class ad_skin_template_bits
|
||||
$js_matches .= "\t'$group' : ". count( $this->search_bits[ $group ] ).",\n";
|
||||
$js_groups .= "\t'$group' : 1,\n";
|
||||
|
||||
foreach( $this->search_bits[ $group ] as $idx2 => $data )
|
||||
foreach( $this->search_bits[ $group ] as $data )
|
||||
{
|
||||
$js_bits .= "\t'{$group}_{$data['func_name']}' : 1,\n";
|
||||
}
|
||||
@@ -437,7 +415,7 @@ class ad_skin_template_bits
|
||||
|
||||
$group_titles = $this->ipsclass->cache_func->_get_templates($this->ipsclass->input['id'], $this->ipsclass->input['p'], 'groups');
|
||||
|
||||
foreach( $group_titles as $title => $g )
|
||||
foreach( $group_titles as $g )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Fix up names
|
||||
@@ -457,17 +435,17 @@ class ad_skin_template_bits
|
||||
}
|
||||
else
|
||||
{
|
||||
$g['easy_name'] = "<b>".$g['group_name']."</b> (Ãðóïïà íå ïî óìîë÷àíèþ)";
|
||||
$g['easy_desc'] = "Ýòà ãðóïïà íå ÿâëÿåòñÿ ÷àñòüþ ñòàíäàðòíîé èíñòàëëÿöèè IPB è íå èìååò äîñòóïíîãî îïèñàíèÿ";
|
||||
$g['easy_name'] = "<b>".$g['group_name']."</b> (Non-Default Group)";
|
||||
$g['easy_desc'] = "This group is not part of the standard Invision Power Board installation and no description is available";
|
||||
}
|
||||
|
||||
if ( $skin_names[ $g['group_name'] ][2] )
|
||||
if ( isset($skin_names[ $g['group_name'] ][2]) )
|
||||
{
|
||||
$g['easy_preview'] = "<a title='Íîâîå îêíî: Ïîêàçàòü âàæíóþ IPB-ñòðàíèöó' href='{$this->ipsclass->vars['board_url']}/index.{$this->ipsclass->vars['php_ext']}?{$skin_names[ $g['group_name'] ][2]}' target='_blank'><img src='{$this->ipsclass->skin_url}/images/te_previewon.gif' alt='Ïðåäïðîñìîòð' border='0' /></a>";
|
||||
$g['easy_preview'] = "<a title='New window: Show relevant IPB page' href='{$this->ipsclass->vars['board_url']}/index.{$this->ipsclass->vars['php_ext']}?{$skin_names[ $g['group_name'] ][2]}' target='_blank'><img src='{$this->ipsclass->skin_acp_url}/images/te_previewon.gif' alt='Preview' border='0' /></a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$g['easy_preview'] = "<img src='{$this->ipsclass->skin_url}/images/te_previewoff.gif' alt='Íåò äîñòóïíûõ ïðåäïðîñìîòðîâ' border='0' title='Íåò äîñòóïíûõ ïðåäïðîñìîòðîâ' />";
|
||||
$g['easy_preview'] = "<img src='{$this->ipsclass->skin_acp_url}/images/te_previewoff.gif' alt='No preview available' border='0' title='No preview available' />";
|
||||
}
|
||||
|
||||
$groups[] = $g;
|
||||
@@ -488,6 +466,14 @@ class ad_skin_template_bits
|
||||
$eid = $group['suid'];
|
||||
$exp_content = "";
|
||||
|
||||
$this->ipsclass->cache_func->template_count[$this->ipsclass->input['p']][ $group['group_name'] ]['count'] =
|
||||
isset($this->ipsclass->cache_func->template_count[$this->ipsclass->input['p']][ $group['group_name'] ]['count']) ?
|
||||
$this->ipsclass->cache_func->template_count[$this->ipsclass->input['p']][ $group['group_name'] ]['count'] : 0;
|
||||
|
||||
$this->ipsclass->cache_func->template_count[$this->ipsclass->input['id']][ $group['group_name'] ]['count'] =
|
||||
isset($this->ipsclass->cache_func->template_count[$this->ipsclass->input['id']][ $group['group_name'] ]['count']) ?
|
||||
$this->ipsclass->cache_func->template_count[$this->ipsclass->input['id']][ $group['group_name'] ]['count'] : 0;
|
||||
|
||||
$altered = sprintf( '%02d', intval($this->ipsclass->cache_func->template_count[$this->ipsclass->input['id']][ $group['group_name'] ]['count']) );
|
||||
$original = sprintf( '%02d', intval($this->ipsclass->cache_func->template_count[1][ $group['group_name'] ]['count']) );
|
||||
$inherited = sprintf( '%02d', intval($this->ipsclass->cache_func->template_count[$this->ipsclass->input['p']][ $group['group_name'] ]['count']) );
|
||||
@@ -533,8 +519,8 @@ class ad_skin_template_bits
|
||||
|
||||
$this->ipsclass->html .= $this->ipsclass->adskin->skin_jump_menu_wrap();
|
||||
|
||||
$this->ipsclass->admin->nav[] = array( 'section='.$this->ipsclass->section_code.'&act=sets' ,'Óïðàâëåíèå ñòèëÿìè' );
|
||||
$this->ipsclass->admin->nav[] = array( '' ,'Óïðàâëåíèå øàáëîíîì "'.$this_set['set_name'].'"' );
|
||||
$this->ipsclass->admin->nav[] = array( 'section='.$this->ipsclass->section_code.'&act=sets' ,'Skin Manager Home' );
|
||||
$this->ipsclass->admin->nav[] = array( '' ,'Managing Template Set "'.$this_set['set_name'].'"' );
|
||||
|
||||
$this->ipsclass->admin->output();
|
||||
}
|
||||
@@ -585,12 +571,12 @@ class ad_skin_template_bits
|
||||
|
||||
function add_bit()
|
||||
{
|
||||
$this->ipsclass->admin->page_detail = "Â ýòîé ñåêöèè âû ìîæåòå äîáàâèòü íîâûé ôðàãìåíò øàáëîíà.";
|
||||
$this->ipsclass->admin->page_title = "Èçìåíåíèå øàáëîíà";
|
||||
$this->ipsclass->admin->page_detail = "You may add a template bit using this section.";
|
||||
$this->ipsclass->admin->page_title = "Template Editing";
|
||||
|
||||
$groupname = $this->ipsclass->input['expand'];
|
||||
|
||||
$this_set = $this->ipsclass->DB->simple_exec_query( array( 'select' => '*', 'from' => 'skin_sets', 'where' => "set_skin_set_id=".$this->ipsclass->input['id'] ) );
|
||||
$this_set = $this->ipsclass->DB->simple_exec_query( array( 'select' => '*', 'from' => 'skin_sets', 'where' => "set_skin_set_id=".intval($this->ipsclass->input['id']) ) );
|
||||
|
||||
//-----------------------------------------
|
||||
// Sort out group titles
|
||||
@@ -600,7 +586,7 @@ class ad_skin_template_bits
|
||||
|
||||
$formatted_groups = array();
|
||||
|
||||
foreach ( $group_titles as $name => $d )
|
||||
foreach ( $group_titles as $d )
|
||||
{
|
||||
$formatted_groups[] = array( $d['group_name'], $d['group_name'] );
|
||||
}
|
||||
@@ -623,28 +609,28 @@ class ad_skin_template_bits
|
||||
|
||||
|
||||
|
||||
$options .= "<div class='maintitle'>Íàñòðîéêè íîâîãî ôðàãìåíòà øàáëîíà</div>
|
||||
<div class='tdrow1'>
|
||||
$options .= "<div class='tableheaderalt'>New Template Bit Specifics</div>
|
||||
<div class='tablerow1'>
|
||||
<table width='100%' cellpadding='5' cellspacing='0' border='0'>
|
||||
<tr>
|
||||
<td width='40%' class='tdrow1'>Íàçâàíèå ôðàãìåíòà øàáëîíà<br /><span style='color:gray'>Äîïóñêàþòñÿ òîëüêî ëàòèíñêèå ñèìâîëû, öèôðû è çíàêè ïîä÷åðêèâàíèÿ, áåç ïðîáåëîâ.</span></td>
|
||||
<td width='60%' class='tdrow1'>".$this->ipsclass->adskin->form_input('func_name', $this->ipsclass->txt_stripslashes($_POST['func_name']))."</td>
|
||||
<td width='40%' class='tablerow1'>New Template Bit Name<br /><span style='color:gray'>Alphanumerics and underscores only, no spaces.</span></td>
|
||||
<td width='60%' class='tablerow1'>".$this->ipsclass->adskin->form_input('func_name', $this->ipsclass->txt_stripslashes($_POST['func_name']))."</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width='40%' class='tdrow1'>Âõîäÿùèå ïåðåìåííûå<br /><span style='color:gray'>Îïðåäåëåíèå ïåðåìåííûõ îáðàáàòûâàåìûõ â ýòîì ôðàãìåíòå øàáëîíà.</span></td>
|
||||
<td width='60%' class='tdrow1'>".$this->ipsclass->adskin->form_input('func_data', str_replace( "'", ''', $this->ipsclass->txt_stripslashes($_POST['func_data']) ) )."</td>
|
||||
<td width='40%' class='tablerow1'>New Template Bit Incoming Data Variables<br /><span style='color:gray'>Define the variables passed to this template bit.</span></td>
|
||||
<td width='60%' class='tablerow1'>".$this->ipsclass->adskin->form_input('func_data', str_replace( "'", ''', $this->ipsclass->txt_stripslashes($_POST['func_data']) ) )."</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width='40%' class='tdrow1'>Ãðóïïà äëÿ ôðàãìåíòà...</td>
|
||||
<td width='60%' class='tdrow1'>".$this->ipsclass->adskin->form_dropdown('group_name', $formatted_groups, $this->ipsclass->input['group_name'] ? $this->ipsclass->input['group_name'] : $this->ipsclass->input['expand'] )."</td>
|
||||
<td width='40%' class='tablerow1'>New Template Bit Group...</td>
|
||||
<td width='60%' class='tablerow1'>".$this->ipsclass->adskin->form_dropdown('group_name', $formatted_groups, $this->ipsclass->input['group_name'] ? $this->ipsclass->input['group_name'] : $this->ipsclass->input['expand'] )."</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width='40%' class='tdrow1'>Èëè ñîçäàéòå íîâóþ ãðóïïó...<br /><span style='color:gray'>Îñòàâüòå ïóñòûì äëÿ èñïîëüçîâàíèÿ ñóùåñòâóþùåé ãðóïïû.<br />Äîïóñêàþòñÿ òîëüêî ëàòèíñêèå ñèìâîëû, öèôðû è çíàêè ïîä÷åðêèâàíèÿ, áåç ïðîáåëîâ</span></td>
|
||||
<td width='60%' class='tdrow1'>skin_".$this->ipsclass->adskin->form_input('new_group_name', $this->ipsclass->txt_stripslashes($_POST['new_group_name']))."</td>
|
||||
<td width='40%' class='tablerow1'>Or Create New Group...<br /><span style='color:gray'>Leave empty to use above group. Alphanumerics and underscores only, no spaces</span></td>
|
||||
<td width='60%' class='tablerow1'>skin_".$this->ipsclass->adskin->form_input('new_group_name', $this->ipsclass->txt_stripslashes($_POST['new_group_name']))."</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class='pformstrip' align='center' style='padding:4px'><input type='submit' name='submit' value='Ïðîäîëæèòü...' class='realdarkbutton'></div>
|
||||
<div class='tablesubheader' align='center' style='padding:4px'><input type='submit' name='submit' value='Continue...' class='realdarkbutton'></div>
|
||||
</form>";
|
||||
|
||||
$this->ipsclass->html .= $options;
|
||||
@@ -662,27 +648,27 @@ class ad_skin_template_bits
|
||||
// Check incoming
|
||||
//-----------------------------------------
|
||||
|
||||
$this_set = $this->ipsclass->DB->simple_exec_query( array( 'select' => '*', 'from' => 'skin_sets', 'where' => "set_skin_set_id=".$this->ipsclass->input['id'] ) );
|
||||
$this_set = $this->ipsclass->DB->simple_exec_query( array( 'select' => '*', 'from' => 'skin_sets', 'where' => "set_skin_set_id=".intval($this->ipsclass->input['id']) ) );
|
||||
|
||||
if ( $_POST['new_group_name'] )
|
||||
{
|
||||
if ( preg_match( "#[^\w_]#s", $_POST['new_group_name'] ) )
|
||||
{
|
||||
$this->ipsclass->main_msg = 'Íàçâàíèå ãðóïïû ôðàãìåíòîâ øàáëîíà ìîæåò ñîñòîÿòü òîëüêî èç ëàòèíñêèõ ñèìâîëîâ, öèôð è çíàêîâ ïîä÷åðêèâàíèÿ.';
|
||||
$this->ipsclass->main_msg = 'The new template bit group name must only contain alphanumerics and underscores.';
|
||||
$this->add_bit();
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $_POST['func_name'] )
|
||||
{
|
||||
$this->ipsclass->main_msg = 'Íàçâàíèå ôðàãìåíòà øàáëîíà íå ìîæåò áûòü ïóñòûì.';
|
||||
$this->ipsclass->main_msg = 'The new template bit name cannot be empty.';
|
||||
$this->add_bit();
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( preg_match( "#[^\w_]#s", $_POST['func_name'] ) )
|
||||
{
|
||||
$this->ipsclass->main_msg = 'Íàçâàíèå ôðàãìåíòà øàáëîíà ìîæåò ñîñòîÿòü òîëüêî èç ëàòèíñêèõ ñèìâîëîâ, öèôð è çíàêîâ ïîä÷åðêèâàíèÿ.';
|
||||
$this->ipsclass->main_msg = 'The new template bit name must only contain alphanumerics and underscores.';
|
||||
$this->add_bit();
|
||||
}
|
||||
}
|
||||
@@ -694,13 +680,26 @@ class ad_skin_template_bits
|
||||
$func_data = preg_replace( "#,$#", "", str_replace( ''', "'", trim($this->ipsclass->txt_stripslashes($_POST['func_data'])) ) );
|
||||
$text = '';
|
||||
|
||||
//-----------------------------------------
|
||||
// Is parent master template set?
|
||||
//-----------------------------------------
|
||||
|
||||
if( $this_set['set_skin_set_parent'] == "-1" )
|
||||
{
|
||||
$parent_set = "1";
|
||||
}
|
||||
else
|
||||
{
|
||||
$parent_set = $this_set['set_skin_set_parent'];
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
// Make sure bit doesn't exist
|
||||
//-----------------------------------------
|
||||
|
||||
if ( $row = $this->ipsclass->DB->simple_exec_query( array( 'select' => 'suid', 'from' => 'skin_templates', 'where' => "set_id={$this->ipsclass->input['id']} AND group_name='$group_name' AND func_name='$func_name'" ) ) )
|
||||
if ( $row = $this->ipsclass->DB->simple_exec_query( array( 'select' => 'suid', 'from' => 'skin_templates', 'where' => "(set_id=".intval($this->ipsclass->input['id'])." OR set_id='{$parent_set}') AND group_name='$group_name' AND func_name='$func_name'" ) ) )
|
||||
{
|
||||
$this->ipsclass->main_msg = "Ôðàãìåíò '$func_name' óæå ñóùåñòâóåò â ãðóïïå '$group_name'.";
|
||||
$this->ipsclass->main_msg = "The new template bit '$func_name' already exists in group '$group_name'.";
|
||||
$this->add_bit();
|
||||
}
|
||||
|
||||
@@ -710,7 +709,7 @@ class ad_skin_template_bits
|
||||
|
||||
if ( strtolower($func_name) == 'end' )
|
||||
{
|
||||
$this->ipsclass->main_msg = "Èìÿ ôðàãìåíòà íå ìîæåò áûòü 'end'";
|
||||
$this->ipsclass->main_msg = "You cannot name a template bit 'end'";
|
||||
$this->add_bit();
|
||||
}
|
||||
|
||||
@@ -719,7 +718,7 @@ class ad_skin_template_bits
|
||||
//-----------------------------------------
|
||||
|
||||
$this->ipsclass->DB->do_insert( 'skin_templates', array (
|
||||
'set_id' => $this->ipsclass->input['id'],
|
||||
'set_id' => intval($this->ipsclass->input['id']),
|
||||
'group_name' => $group_name,
|
||||
'section_content' => $text,
|
||||
'func_name' => $func_name,
|
||||
@@ -733,7 +732,7 @@ class ad_skin_template_bits
|
||||
// Rebuild the PHP file
|
||||
//-----------------------------------------
|
||||
|
||||
$this->ipsclass->cache_func->_recache_templates( $this->ipsclass->input['id'], $this->ipsclass->input['p'], $real_name );
|
||||
$this->ipsclass->cache_func->_recache_templates( $this->ipsclass->input['id'], $this->ipsclass->input['p'] );
|
||||
|
||||
//-----------------------------------------
|
||||
// Back we go...
|
||||
@@ -755,12 +754,12 @@ class ad_skin_template_bits
|
||||
// INIT
|
||||
//-----------------------------------------
|
||||
|
||||
$suid = intval( $this->ipsclass->input['suid'] );
|
||||
$type = trim( $this->ipsclass->input['type'] );
|
||||
$id = intval( $this->ipsclass->input['id'] );
|
||||
$p = intval( $this->ipsclass->input['p'] );
|
||||
$bitname = $this->ipsclass->parse_clean_value( urldecode( $_REQUEST['bitname'] ) );
|
||||
$group_name = trim( $this->ipsclass->input['group_name'] );
|
||||
$suid = isset($this->ipsclass->input['suid']) ? intval( $this->ipsclass->input['suid'] ) : 0;
|
||||
$type = isset($this->ipsclass->input['type']) ? trim( $this->ipsclass->input['type'] ) : '';
|
||||
$id = isset($this->ipsclass->input['id']) ? intval( $this->ipsclass->input['id'] ) : 0;
|
||||
$p = isset($this->ipsclass->input['p']) ? intval( $this->ipsclass->input['p'] ) : 0;
|
||||
$bitname = isset($_REQUEST['bitname']) ? $this->ipsclass->parse_clean_value( urldecode( $_REQUEST['bitname'] ) ) : '';
|
||||
$group_name = isset($this->ipsclass->input['group_name']) ? trim( $this->ipsclass->input['group_name'] ) : '';
|
||||
|
||||
$template_bit_ids = array();
|
||||
$ids = array();
|
||||
@@ -769,8 +768,8 @@ class ad_skin_template_bits
|
||||
// PAGE HEADER
|
||||
//-----------------------------------------
|
||||
|
||||
$this->ipsclass->admin->page_detail = "Âû ìîæåòå ðåäàêòèðîâàòü HTML êîä ýòîãî øàáëîíà.";
|
||||
$this->ipsclass->admin->page_title = "Óïðàâëåíèå ñòèëÿìè";
|
||||
$this->ipsclass->admin->page_detail = "You may edit the HTML of this template.";
|
||||
$this->ipsclass->admin->page_title = "Template Editing";
|
||||
|
||||
//-----------------------------------------
|
||||
// Get $skin_names stuff
|
||||
@@ -800,10 +799,10 @@ class ad_skin_template_bits
|
||||
|
||||
if ( $bitname == "" )
|
||||
{
|
||||
$this->ipsclass->admin->error("Íå âûáðàíû ID ôðàãìåíòîâ, ïîæàëóéñòà, âåðíèòåñü íàçàä è âûáåðèòå ÷òî-íèáóäü");
|
||||
$this->ipsclass->admin->error("You must specify an existing template set ID, go back and try again");
|
||||
}
|
||||
|
||||
foreach( $group_bits as $eye => $i )
|
||||
foreach( $group_bits as $i )
|
||||
{
|
||||
if ( $bitname == $i['func_name'] )
|
||||
{
|
||||
@@ -824,7 +823,7 @@ class ad_skin_template_bits
|
||||
{
|
||||
foreach( explode( '|', $bitname ) as $name )
|
||||
{
|
||||
foreach( $group_bits as $eye => $i )
|
||||
foreach( $group_bits as $i )
|
||||
{
|
||||
if ( $name == $i['func_name'] )
|
||||
{
|
||||
@@ -848,9 +847,11 @@ class ad_skin_template_bits
|
||||
}
|
||||
}
|
||||
|
||||
$ids = $this->ipsclass->clean_int_array( $ids );
|
||||
|
||||
if ( count($ids) < 1 )
|
||||
{
|
||||
$this->ipsclass->admin->error("Íè îäíîãî ID íå âûáðàíî, ïîæàëóéñòà, âåðíèòåñü íàçàä è çàïîëíèòå âñå, ÷òî íåîáõîäèìî ïåðåä ïîäòâåðæäåíèåì ôîðìû");
|
||||
$this->ipsclass->admin->error("No ids selected, please go back and select some before submitting the form");
|
||||
}
|
||||
|
||||
//-----------------------------------------
|
||||
@@ -875,6 +876,7 @@ class ad_skin_template_bits
|
||||
// Get template bits
|
||||
//-----------------------------------------
|
||||
|
||||
$sec_arry = array();
|
||||
$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'skin_templates', 'where' => "suid IN (".implode(",",$ids).")" ) );
|
||||
$this->ipsclass->DB->simple_exec();
|
||||
|
||||
@@ -887,7 +889,7 @@ class ad_skin_template_bits
|
||||
// If easy name is available, use it
|
||||
//-----------------------------------------
|
||||
|
||||
if ($bit_names[ $i['group_name'] ][ $i['func_name'] ] != "")
|
||||
if ( isset($bit_names[ $i['group_name'] ][ $i['func_name'] ]) AND $bit_names[ $i['group_name'] ][ $i['func_name'] ] != "" )
|
||||
{
|
||||
$sec_arry[ $i['suid'] ]['easy_name'] = $bit_names[ $i['group_name'] ][ $i['func_name'] ];
|
||||
}
|
||||
@@ -909,7 +911,7 @@ class ad_skin_template_bits
|
||||
// Loop and print
|
||||
//-----------------------------------------
|
||||
|
||||
foreach( $sec_arry as $idx => $template )
|
||||
foreach( $sec_arry as $template )
|
||||
{
|
||||
//-----------------------------------------
|
||||
// Swop < and > into ascii entities
|
||||
@@ -919,7 +921,7 @@ class ad_skin_template_bits
|
||||
$setid = $template['set_id'];
|
||||
$groupname = $template['group_name'];
|
||||
|
||||
if ( ! $this->ipsclass->input['error_raw_'.$template['suid']] )
|
||||
if ( !isset($this->ipsclass->input['error_raw_'.$template['suid']]) OR !$this->ipsclass->input['error_raw_'.$template['suid']] )
|
||||
{
|
||||
$templ = $template['section_content'];
|
||||
}
|
||||
@@ -959,9 +961,9 @@ class ad_skin_template_bits
|
||||
|
||||
if ( $type != 'single' AND $type != 'multiple' )
|
||||
{
|
||||
$formbuttons = "<div align='center' class='pformstrip'>
|
||||
<input type='submit' name='submit' value='Ñîõðàíèòü ôðàãìåíò(û) øàáëîíà' class='realdarkbutton'>
|
||||
<input type='submit' name='savereload' value='Ñîõðàíèòü è ïåðåçàãðóçèòü ôðàãìåíò(û) øàáëîíà(îâ)' class='realdarkbutton'>
|
||||
$formbuttons = "<div align='center' class='tablesubheader'>
|
||||
<input type='submit' name='submit' value='Save Template Bit(s)' class='realdarkbutton'>
|
||||
<input type='submit' name='savereload' value='Save and Reload Template Bit(s)' class='realdarkbutton'>
|
||||
</div>\n";
|
||||
|
||||
$this->ipsclass->html = str_replace( '<!--IPB.EDITORBOTTOM-->', $formbuttons, $this->ipsclass->html );
|
||||
@@ -1073,12 +1075,14 @@ class ad_skin_template_bits
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$ids = $this->ipsclass->clean_int_array( $ids );
|
||||
|
||||
if ( count($ids) < 1 )
|
||||
{
|
||||
$this->ipsclass->main_msg = "Íå÷åãî ñîõðàíÿòü";
|
||||
$this->ipsclass->main_msg = "Nothing to save";
|
||||
|
||||
foreach( $cb_ids as $i => $cb )
|
||||
foreach( $cb_ids as $cb )
|
||||
{
|
||||
$this->ipsclass->input[ $cb ] = 1;
|
||||
}
|
||||
@@ -1111,9 +1115,9 @@ class ad_skin_template_bits
|
||||
// Sw(o|a)p back < & >
|
||||
//-----------------------------------------
|
||||
|
||||
$text = preg_replace("/</", "<", $text);
|
||||
$text = preg_replace("/>/", ">", $text);
|
||||
$text = preg_replace("/&/", "&", $text);
|
||||
$text = str_replace("<", "<", $text);
|
||||
$text = str_replace(">", ">", $text);
|
||||
$text = str_replace("&", "&", $text);
|
||||
$text = str_replace( '\n', '\n',$text );
|
||||
$text = str_replace( '\\n' , '\\\\\\n', $text );
|
||||
|
||||
@@ -1123,7 +1127,7 @@ class ad_skin_template_bits
|
||||
// Convert \r to nowt
|
||||
//-----------------------------------------
|
||||
|
||||
$text = preg_replace("/\r/", "", $text);
|
||||
$text = str_replace("\r", "", $text);
|
||||
|
||||
$func = preg_replace( "#,$#", "", str_replace( ''', "'", trim($this->ipsclass->txt_stripslashes($_POST['funcdata_'.$id])) ) );
|
||||
|
||||
@@ -1187,7 +1191,7 @@ class ad_skin_template_bits
|
||||
//-----------------------------------------
|
||||
|
||||
$this->ipsclass->cache_func->_recache_templates( $this->ipsclass->input['id'], $this->ipsclass->input['p'], $real_name );
|
||||
|
||||
|
||||
//-----------------------------------------
|
||||
// Back we go...
|
||||
//-----------------------------------------
|
||||
@@ -1198,7 +1202,7 @@ class ad_skin_template_bits
|
||||
{
|
||||
$this->ipsclass->input['cb_'.$id ] = 1;
|
||||
$this->ipsclass->input['error_raw_'.$id] = $this->ipsclass->txt_stripslashes($_POST['txt'.$id]);
|
||||
$this->ipsclass->main_msg = "Ýòè ôðàãìåíòû øàáëîíà íå ìîãóò áûòü ñîõðàíåíû, òàê êàê íàéäåíà îøèáêà ïðè ïàðñèíãå. Ïðîâåðüòå ââåäåííûé HTML-êîä è âñå âõîäÿùèå ïåðåìåííûå.";
|
||||
$this->ipsclass->main_msg = "These template bits could not be saved because they cause an error when parsed. Please check the data including any HTML logic used and any input data variables.";
|
||||
|
||||
$this->template_edit_bit();
|
||||
}
|
||||
@@ -1208,7 +1212,7 @@ class ad_skin_template_bits
|
||||
if ( ( $type != 'single' AND $type != 'multiple' ) AND ( ! $this->ipsclass->input['savereload'] ) )
|
||||
{
|
||||
$this->ipsclass->admin->nav[] = array( $this->ipsclass->form_code ,'Skin Manager Home' );
|
||||
$this->ipsclass->admin->redirect( "{$this->ipsclass->form_code}&code=template-edit-bit&id={$this->ipsclass->input['id']}&group_name={$real_name}", "Ôðàãìåíò(û) øàáëîíà îáíîâëåíû, âîçâðàùåíèå ê îêíó âûáîðà ôðàãìåíòîâ øàáëîíà" );
|
||||
$this->ipsclass->admin->redirect( "{$this->ipsclass->form_code}&code=template-edit-bit&id={$this->ipsclass->input['id']}&group_name={$real_name}", "Template bit(s) updated, returning to template selection screen" );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1216,9 +1220,20 @@ class ad_skin_template_bits
|
||||
// Reload edit window
|
||||
//-----------------------------------------
|
||||
|
||||
$this->ipsclass->main_msg = "Ôðàãìåíò(û) øàáëîíà îáíîâëåíû";
|
||||
if( count($this->ipsclass->cache_func->messages) )
|
||||
{
|
||||
array_pop($this->ipsclass->cache_func->messages);
|
||||
|
||||
$this->ipsclass->cache_func->messages[] = "Template bit(s) saved to database";
|
||||
|
||||
$this->ipsclass->main_msg = implode( "<br />", $this->ipsclass->cache_func->messages );
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->ipsclass->main_msg = "Template bit(s) updated";
|
||||
}
|
||||
|
||||
foreach( $cb_ids as $i => $cb )
|
||||
foreach( $cb_ids as $cb )
|
||||
{
|
||||
$this->ipsclass->input[ $cb ] = 1;
|
||||
}
|
||||
@@ -1253,12 +1268,12 @@ class ad_skin_template_bits
|
||||
{
|
||||
if ( $bitname == "" )
|
||||
{
|
||||
$this->ipsclass->admin->error("Âû äîëæíû ââåñòè ïðàâèëüíûé ID ôðàãìåíòà øàáëîíà");
|
||||
$this->ipsclass->admin->error("You must enter a corrent template bit ID");
|
||||
}
|
||||
|
||||
$group_bits = $this->ipsclass->cache_func->_get_templates($id, $p, 'groups', $group_name );
|
||||
|
||||
foreach( $group_bits as $eye => $i )
|
||||
foreach( $group_bits as $i )
|
||||
{
|
||||
if ( $bitname == $i['func_name'] )
|
||||
{
|
||||
@@ -1267,11 +1282,16 @@ class ad_skin_template_bits
|
||||
}
|
||||
}
|
||||
|
||||
if( !$suid AND $type=='frame' )
|
||||
{
|
||||
$this->template_bits_list();
|
||||
}
|
||||
|
||||
$row = $this->ipsclass->DB->simple_exec_query( array( 'select' => '*', 'from' => 'skin_templates', 'where' => 'suid='.$suid ) );
|
||||
|
||||
if ( $row['set_id'] == 1 )
|
||||
{
|
||||
$this->ipsclass->admin->error("û íå ìîæåòå óäàëèòü ôðàãìåíò øàáëîíà èç îñíîâíîãî øàáëîíà.");
|
||||
$this->ipsclass->admin->error("You cannot remove a template bit from the master set.");
|
||||
}
|
||||
|
||||
$this->ipsclass->DB->simple_exec_query( array( 'delete' => 'skin_templates', 'where' => 'suid='.$suid ) );
|
||||
@@ -1298,7 +1318,7 @@ class ad_skin_template_bits
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->ipsclass->admin->redirect( "{$this->ipsclass->form_code}&code=edit&id={$row['set_id']}&p={$this->ipsclass->input['p']}&group_name={$row['group_name']}&#{$row['group_name']}", "Ôðàãìåíò(û) øàáëîíà âîçâðàùåíû ê íà÷àëüíîìó ñîñòîÿíèþ, âîçâðàùåíèå ê îêíó âûáîðà ôðàãìåíòîâ øàáëîíà" );
|
||||
$this->ipsclass->admin->redirect( "{$this->ipsclass->form_code}&code=edit&id={$row['set_id']}&p={$this->ipsclass->input['p']}&group_name={$row['group_name']}&#{$row['group_name']}", "Template bit(s) reverted, returning to template selection screen" );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user