diff -r d6c7b310295d -r a86a69394a95 plugins/SpecialAdmin.php --- a/plugins/SpecialAdmin.php Sun Mar 22 00:46:44 2009 -0400 +++ b/plugins/SpecialAdmin.php Sun Mar 22 00:55:06 2009 -0400 @@ -2458,14 +2458,41 @@ } else { + if ( isset($_GET['update_order']) ) + { + header('Content-type: text/javascript'); + $order = @$_POST['order']; + try + { + $order = enano_json_decode($order); + } + catch ( Zend_Json_Exception $e ) + { + return print enano_json_encode(array( + 'mode' => 'error', + 'error' => 'bad order' + )); + } + + foreach ( $order as $sidebar_id => $blocks ) + { + foreach ( $blocks as $order => $block_id ) + { + $sbid = intval($sidebar_id); + $order = intval($order); + $block_id = intval($block_id); + $q = $db->sql_query('UPDATE ' . table_prefix . "sidebar SET sidebar_id = $sbid, item_order = $order WHERE item_id = $block_id;"); + if ( !$q ) + $db->die_json(); + } + } + + return print enano_json_encode(array( + 'mode' => 'success' + )); + } - $template->add_header(''); - $template->add_header(''); $template->add_header(''); - $template->add_header(''); - - $template->load_theme('oxygen', 'bleu'); - $template->init_vars(); $template->header(); @@ -2624,27 +2651,21 @@

-

- get('sbedit_field_wikitext'); ?> -

+ get('sbedit_field_wikitext'); ?>

-

- get('sbedit_field_tplcode'); ?> -

+ get('sbedit_field_tplcode'); ?>

-

- get('sbedit_field_html'); ?> -

+ get('sbedit_field_html'); ?>

@@ -2663,9 +2684,7 @@
-

- get('sbedit_field_plugin'); ?> -

+ get('sbedit_field_plugin'); ?>

+

'; + ?> +
+ extract_vars('toolbar.tpl'); + $parser_start = $template->makeParserText($toolbarvars['toolbar_vert_start']); + echo $parser_start->run(); + + $button = $template->makeParserText($toolbarvars['toolbar_vert_button']); + $label = $template->makeParserText($toolbarvars['toolbar_vert_label']); + + $type = ''; + switch($row['block_type']) + { + case BLOCK_WIKIFORMAT: $type .= $lang->get('sbedit_block_type_wiki'); break; + case BLOCK_TEMPLATEFORMAT: $type .= $lang->get('sbedit_block_type_tpl'); break; + case BLOCK_HTML: $type .= $lang->get('sbedit_block_type_html'); break; + case BLOCK_PHP: $type .= $lang->get('sbedit_block_type_php'); break; + case BLOCK_PLUGIN: $type .= $lang->get('sbedit_block_type_plugin'); break; + default: $type .= '$&#@'; break; + } + $type .= ''; + if ( $row['block_type'] == BLOCK_PLUGIN ) + { + $type .= ': ' . $lang->get($row['block_content']); + } + + $label->assign_vars(array( + 'TITLE' => $type + )); + echo $label->run(); + + // edit + if ( $row['block_type'] != BLOCK_PLUGIN ) + { + $button->assign_vars(array( + 'TITLE' => $lang->get('sbedit_tip_edit'), + 'FLAGS' => 'href="#" onclick="sbedit_open_editor(this); return false;"', + 'IMAGE' => cdnPath . '/images/edit.png' + )); + echo $button->run(); + } + + // delete + $button->assign_vars(array( + 'TITLE' => $lang->get('sbedit_tip_delete'), + 'FLAGS' => 'href="#" onclick="sbedit_delete_block(this); return false;"', + 'IMAGE' => cdnPath . '/images/delete.png' + )); + echo $button->run(); + + // rename + $button->assign_vars(array( + 'TITLE' => $lang->get('sbedit_tip_rename'), + 'FLAGS' => 'href="#" onclick="sbedit_rename_block(this); return false;"', + 'IMAGE' => cdnPath . '/images/rename.png' + )); + echo $button->run(); + + // disenable + $button->assign_vars(array( + 'TITLE' => $lang->get('sbedit_tip_disenable'), + 'FLAGS' => 'href="#" onclick="sbedit_disenable_block(this); return false;"', + 'IMAGE' => cdnPath . '/images/disenable.png' + )); + echo $button->run(); + + $parser_end = $template->makeParserText($toolbarvars['toolbar_vert_end']); + echo $parser_end->run(); + ?> +
+ '; } - $db->free_result(); - //if(isset($vars['sidebar_top'])) echo $template->parse($vars['sidebar_bottom']); - echo ''; - echo '
'; - $order = implode(',', $n1); - echo ""; - $order = implode(',', $n2); - echo ""; - echo ' -
- - -
- ' . $lang->get('sbedit_btn_create_new_stage1') . ' | ' . $lang->get('sbedit_btn_main_page') . ' -
-
- '; + + if ( !$switched_to_right ) + echo ''; + + echo ''; } $template->footer();