# HG changeset patch # User Dan # Date 1200958424 18000 # Node ID cc6bf4d636842f43a49d1da9a433dedab00b191b # Parent 390eb356cd499d75b14823544b849396d1b0eff9 Localized Special:EditSidebar diff -r 390eb356cd49 -r cc6bf4d63684 includes/clientside/sbedit.js --- a/includes/clientside/sbedit.js Mon Jan 21 17:38:57 2008 -0500 +++ b/includes/clientside/sbedit.js Mon Jan 21 18:33:44 2008 -0500 @@ -71,7 +71,7 @@ thediv.style.margin = '0'; if(ajax.responseText == 'HOUSTON_WE_HAVE_A_PLUGIN') { - thediv.innerHTML = '
This is a plugin block, and cannot be edited.
'; + thediv.innerHTML = '' + $lang.get('sbedit_msg_cant_edit_plugin_body', { close_link: 'a href="#" onclick="this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode); return false;"' }) + '
'; } else { @@ -82,7 +82,7 @@ thediv.appendChild(ta); b = document.createElement('br'); thediv.appendChild(b); - thediv.innerHTML += 'save | cancel'; + thediv.innerHTML += '' + $lang.get('sbedit_btn_edit_save') + ' | ' + $lang.get('sbedit_btn_edit_cancel') + ''; } body = document.getElementsByTagName('body'); body = body[0]; diff -r 390eb356cd49 -r cc6bf4d63684 language/english/admin.json --- a/language/english/admin.json Mon Jan 21 17:38:57 2008 -0500 +++ b/language/english/admin.json Mon Jan 21 18:33:44 2008 -0500 @@ -14,7 +14,7 @@ categories: [ 'adm', 'acl', 'adminusers', 'acphome', 'acpgc', 'acpup', 'acpft', 'acppl', 'acppm', 'acped', 'acpdb', 'acppg', 'acpum', 'acpug', 'acpcp', 'acpmm', 'acpsl', 'acpbc', - 'acplo', + 'acplo', 'sbedit', ], strings: { meta: { @@ -36,6 +36,7 @@ acpsl: 'ACP: Security log', acpbc: 'ACP: Ban control', acplo: 'ACP: Logout page', + sbedit: 'Sidebar editor', }, adm: { cat_general: 'General', @@ -762,6 +763,67 @@ acplo: { heading_main: 'You have now been logged out of the administration panel.', msg_logout_complete: 'You will continue to be logged into the website, but you will need to re-authenticate before you can access the administration panel again.Return to the Main Page.', + }, + sbedit: { + msg_order_update_success: 'The sidebar order information was updated successfully.', + err_demo_php_disable: 'Adding PHP code blocks in the Enano administration demo has been disabled for security reasons.', + msg_item_added: 'The item was added.', + + create_intro: 'What type of block should this be?', + block_type_wiki: 'Wiki-formatted block', + block_type_tpl: 'Template-formatted block (old pre-beta 3 behavior)', + block_type_html: 'Raw HTML block', + block_type_php: 'PHP code block (danger, Will Robinson!)', + block_type_plugin: 'Use code from a plugin', + field_block_title: 'Block title:', + field_block_sidebar: 'Which sidebar:', + field_block_sidebar_left: 'Left', + field_block_sidebar_right: 'Right', + field_wikitext: 'Wikitext:', + field_tplcode: 'Template code:', + field_html: 'HTML to place inside the sidebar:', + field_php_disabled: 'Creating PHP blocks in demo mode is disabled for security reasons.', + field_php: '
+ 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: +
', + field_plugin: 'Plugin:', + btn_create_block: 'Create new block', + + msg_block_moved: 'Item moved.', + msg_block_deleted: 'Item deleted.', + msg_plugin_not_loaded: 'Plugin isn\'t loaded', + note_block_unnamed: 'Unnamed', + hint_rename: 'Double-click to rename this block', + note_block_disabled: '(disabled)', + tip_disenable: 'Enable or disable this block', + tip_edit: 'Edit the contents of this block', + tip_delete: 'Permanently delete this block', + tip_move: 'Move this block to the other sidebar', + msg_delete_confirm: 'Do you really want to delete this block?', + btn_revert: 'Revert', + btn_create_new_stage1: 'Create new block', + btn_main_page: 'Main Page', + msg_cant_edit_plugin_title: 'This block cannot be edited.', + msg_cant_edit_plugin_body: 'This is a plugin block, and cannot be edited. <%close_link%>Close', + btn_edit_save: 'save', + btn_edit_cancel: 'cancel', + msg_discard_confirm: 'Do you really want to discard your changes?', + msg_discard_order_confirm: 'Do you really want to revert your changes?\nNote: this does not revert edits or deletions, those are saved as soon as you confirm the action.', } } }; 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 '