diff -r 390eb356cd49 -r cc6bf4d63684 plugins/SpecialAdmin.php --- a/plugins/SpecialAdmin.php Mon Jan 21 17:38:57 2008 -0500 +++ b/plugins/SpecialAdmin.php Mon Jan 21 18:33:44 2008 -0500 @@ -2296,10 +2296,6 @@ $template->add_header(''); $template->add_header(''); - // Knock the sidebars dead to keep javascript in plugins from interfering - $template->tpl_strings['SIDEBAR_LEFT'] = ''; - $template->tpl_strings['SIDEBAR_RIGHT'] = ''; - $template->load_theme('oxygen', 'bleu'); $template->init_vars(); @@ -2334,7 +2330,7 @@ $queries = Array(); foreach($orders as $k => $v) { - $queries[] = 'UPDATE '.table_prefix.'sidebar SET item_order='.$om[$k].' WHERE item_id='.$v[1].';'; + $queries[] = 'UPDATE '.table_prefix.'sidebar SET item_order='.intval($om[$k]).' WHERE item_id='.intval($v[1]).';'; } foreach($queries as $sql) { @@ -2347,7 +2343,7 @@ exit; } } - echo '
The sidebar order information was updated successfully.
'; + echo '
' . $lang->get('sbedit_msg_order_update_success') . '
'; } elseif(isset($_POST['create'])) { @@ -2378,14 +2374,14 @@ if ( defined('ENANO_DEMO_MODE') && intval($_POST['type']) == BLOCK_PHP ) { - echo '
Adding PHP code blocks in the Enano administration demo has been disabled for security reasons.
'; + echo '
' . $lang->get('sbedit_err_demo_php_disable') . '
'; $_POST['php_content'] = '?><Nulled>'; $content = $_POST['php_content']; } // Get the value of item_order - $q = $db->sql_query('SELECT * FROM '.table_prefix.'sidebar WHERE sidebar_id='.$db->escape($_POST['sidebar_id']).';'); + $q = $db->sql_query('SELECT * FROM '.table_prefix.'sidebar WHERE sidebar_id='.intval($_POST['sidebar_id']).';'); if(!$q) $db->_die('The order number could not be selected'); $io = $db->numrows(); @@ -2400,7 +2396,7 @@ exit; } - echo '
The item was added.
'; + echo '
' . $lang->get('sbedit_msg_item_added') . '
'; } @@ -2434,28 +2430,32 @@

- What type of block should this be? + get('sbedit_create_intro'); ?>

- Block title:
- Which sidebar: + get('sbedit_field_block_title'); ?>
+ get('sbedit_field_block_sidebar'); ?> +

- Wikitext: + get('sbedit_field_wikitext'); ?>

@@ -2464,7 +2464,7 @@

- Template code: + get('sbedit_field_tplcode'); ?>

@@ -2473,7 +2473,7 @@

- HTML to place inside the sidebar: + get('sbedit_field_html'); ?>

@@ -2482,26 +2482,10 @@

-

Creating PHP blocks in demo mode is disabled for security reasons.

+

get('sbedit_field_php_disabled'); ?>

-

- WARNING: If you don't know what you're doing, or if you are not fluent in PHP, stop now and choose a different block type. You will brick your Enano installation if you are not careful here. - ALWAYS remember to write secure code! The Enano team is not responsible if someone drops all your tables because of an SQL injection vulnerability in your sidebar code. You are probably better off using the template-formatted block type. -

-

- - It is especially important to note that this code is NOT checked for errors! If there is a syntax error in your code here, it will prevent any pages from loading AT ALL. So you need to use an external PHP editor (like jEdit) to check your syntax before you hit save. - You have been warned. -

-

- Also, you should avoid using output buffering functions (ob_[start|end|get_contents|clean]) here, because Enano uses those to track output from this script. -

-

- The standard <?php and ?> tags work here. Don't use an initial "<?php" or it will cause a parse error. -

-

- PHP code: -

+ get('sbedit_field_php'); ?> +

@@ -2510,7 +2494,7 @@

- Plugin: + get('sbedit_field_plugin'); ?>

  - +   +

@@ -2558,7 +2542,7 @@ $template->footer(); exit; } - echo '
Item moved.
'; + echo '
' . $lang->get('sbedit_msg_block_moved') . '
'; break; case 'delete': $query = $db->sql_query('DELETE FROM '.table_prefix.'sidebar WHERE item_id=' . intval($_GET['id']) . ';'); // Already checked for injection attempts ;-) @@ -2573,7 +2557,7 @@ ob_end_clean(); die('GOOD'); } - echo '
Item deleted.
'; + echo '
' . $lang->get('sbedit_msg_block_deleted') . '
'; break; case 'disenable'; $q = $db->sql_query('SELECT item_enabled FROM '.table_prefix.'sidebar WHERE item_id=' . intval($_GET['id']) . ';'); @@ -2683,7 +2667,7 @@ $c = preg_replace('#(.*?)#is', '\\2', $c); break; case BLOCK_PLUGIN: - $c = ($template->fetch_block($row['block_content'])) ? $template->fetch_block($row['block_content']) : 'Can\'t find plugin block'; + $c = ($template->fetch_block($row['block_content'])) ? $template->fetch_block($row['block_content']) : $lang->get('sbedit_msg_plugin_not_loaded'); break; } die('var status = \'GOOD\'; var content = unescape(\''.hexencode($c).'\');'); @@ -2700,11 +2684,11 @@ $parser->assign_vars(Array( 'HREF'=>'#', 'FLAGS'=>'onclick="return false;"', - 'TEXT'=>'Change theme' + 'TEXT' => $lang->get('sidebar_btn_changestyle') )); $template->tpl_strings['THEME_LINK'] = $parser->run(); $parser->assign_vars(Array( - 'TEXT'=>'Log out', + 'TEXT' => $lang->get('sidebar_btn_logout'), )); $template->tpl_strings['LOGOUT_LINK'] = $parser->run(); @@ -2763,20 +2747,20 @@ break; case BLOCK_PLUGIN: $parser = $template->makeParserText($vars['sidebar_section_raw']); - $c = ($template->fetch_block($row['block_content'])) ? $template->fetch_block($row['block_content']) : 'Can\'t find plugin block'; + $c = ($template->fetch_block($row['block_content'])) ? $template->fetch_block($row['block_content']) : $lang->get('sbedit_msg_plugin_not_loaded'); break; } $block_name = $row['block_name']; // $template->tplWikiFormat($row['block_name']); if ( empty($block_name) ) - $block_name = '<Unnamed>'; - $t = '' . $block_name . ''; - if($row['item_enabled'] == 0) $t .= ' (disabled)'; - else $t .= ' '; + $block_name = '<' . $lang->get('sbedit_note_block_unnamed') . '>'; + $t = '' . $block_name . ''; + if($row['item_enabled'] == 0) $t .= ' ' . $lang->get('sbedit_note_block_disabled') . ''; + else $t .= ' '; $side = ( $row['sidebar_id'] == SIDEBAR_LEFT ) ? SIDEBAR_RIGHT : SIDEBAR_LEFT; - $tb = 'Enable/disable this block - Edit this block - Delete this block - Move this block'; + $tb = '' . $lang->get('sbedit_tip_disenable') . ' + ' . $lang->get('sbedit_tip_edit') . ' + ' . $lang->get('sbedit_tip_delete') . ' + ' . $lang->get('sbedit_tip_move') . ''; $as = ''; $ae = '  '.$tb; $parser->assign_vars(Array('CONTENT'=>$c,'TITLE'=>$t,'ADMIN_START'=>$as,'ADMIN_END'=>$ae)); @@ -2794,10 +2778,10 @@ echo ""; echo ' ';