plugins/SpecialAdmin.php
changeset 597 c4ae0d8e260f
parent 593 4f9bec0d65c1
child 605 d2d4e40ecd29
equal deleted inserted replaced
596:82320949a3b5 597:c4ae0d8e260f
    46 
    46 
    47 $plugins->attachHook('common_post', 'SpecialAdmin_include();');
    47 $plugins->attachHook('common_post', 'SpecialAdmin_include();');
    48 
    48 
    49 function SpecialAdmin_include()
    49 function SpecialAdmin_include()
    50 {
    50 {
    51   global $paths;
    51   global $db, $session, $paths, $template, $plugins; // Common objects
    52   
    52   
    53   // Admin pages that were too enormous to be in this file were split off into the plugins/admin/ directory in 1.0.1.
    53   // Admin pages that were too enormous to be in this file were split off into the plugins/admin/ directory in 1.0.1.
    54   // Only load these files if we're looking to load the admin panel
    54   // Only load these files if we're looking to load the admin panel
    55   list($pid, $ns) = RenderMan::strToPageID($paths->get_pageid_from_url());
    55   list($pid, $ns) = RenderMan::strToPageID($paths->get_pageid_from_url());
    56   if ( $ns == 'Admin' )
    56   if ( $ns == 'Admin' || ( $pid == 'Administration' && $ns == 'Special' ) )
    57   {
    57   {
    58     require(ENANO_ROOT . '/plugins/admin/PageManager.php');
    58     require(ENANO_ROOT . '/plugins/admin/PageManager.php');
    59     require(ENANO_ROOT . '/plugins/admin/PageEditor.php');
    59     require(ENANO_ROOT . '/plugins/admin/PageEditor.php');
    60     require(ENANO_ROOT . '/plugins/admin/PageGroups.php');
    60     require(ENANO_ROOT . '/plugins/admin/PageGroups.php');
    61     require(ENANO_ROOT . '/plugins/admin/GroupManager.php');
    61     require(ENANO_ROOT . '/plugins/admin/GroupManager.php');
    63     require(ENANO_ROOT . '/plugins/admin/UserManager.php');
    63     require(ENANO_ROOT . '/plugins/admin/UserManager.php');
    64     require(ENANO_ROOT . '/plugins/admin/UserRanks.php');
    64     require(ENANO_ROOT . '/plugins/admin/UserRanks.php');
    65     require(ENANO_ROOT . '/plugins/admin/LangManager.php');
    65     require(ENANO_ROOT . '/plugins/admin/LangManager.php');
    66     require(ENANO_ROOT . '/plugins/admin/ThemeManager.php');
    66     require(ENANO_ROOT . '/plugins/admin/ThemeManager.php');
    67     require(ENANO_ROOT . '/plugins/admin/PluginManager.php');
    67     require(ENANO_ROOT . '/plugins/admin/PluginManager.php');
       
    68     // require(ENANO_ROOT . '/plugins/admin/CacheManager.php');
       
    69     
       
    70     // Set the theme
       
    71     $session->theme = 'admin';
       
    72     $session->style = 'default';
    68   }
    73   }
    69 }
    74 }
    70 
    75 
    71 // For convenience and nothing more.
    76 // For convenience and nothing more.
    72 function acp_start_form()
    77 function acp_start_form()
  1966     exit;
  1971     exit;
  1967   }
  1972   }
  1968   else
  1973   else
  1969   {
  1974   {
  1970     $template->add_header('<script type="text/javascript" src="' . scriptPath . '/includes/clientside/static/admin-menu.js"></script>');
  1975     $template->add_header('<script type="text/javascript" src="' . scriptPath . '/includes/clientside/static/admin-menu.js"></script>');
  1971     $template->load_theme('admin', 'default');
       
  1972     $template->init_vars();
       
  1973     if( !isset( $_GET['noheaders'] ) ) 
  1976     if( !isset( $_GET['noheaders'] ) ) 
  1974     {
  1977     {
  1975       $template->header();
  1978       $template->header();
  1976     }
  1979     }
  1977     echo $lang->get('adm_page_tagline');
  1980     echo $lang->get('adm_page_tagline');
  2549               break;
  2552               break;
  2550             case BLOCK_PLUGIN:
  2553             case BLOCK_PLUGIN:
  2551               $c = ($template->fetch_block($row['block_content'])) ? $template->fetch_block($row['block_content']) : $lang->get('sbedit_msg_plugin_not_loaded');
  2554               $c = ($template->fetch_block($row['block_content'])) ? $template->fetch_block($row['block_content']) : $lang->get('sbedit_msg_plugin_not_loaded');
  2552               break;
  2555               break;
  2553           }
  2556           }
       
  2557           $c = preg_replace('/\{(restrict|hideif) ([a-z0-9_\(\)\|&! ]+)\}/', '', $c);
  2554           die('var status = \'GOOD\'; var content = unescape(\''.hexencode($c).'\');');
  2558           die('var status = \'GOOD\'; var content = unescape(\''.hexencode($c).'\');');
  2555           break;
  2559           break;
  2556       }
  2560       }
  2557     }
  2561     }
  2558     
  2562     
  2629         case BLOCK_PLUGIN:
  2633         case BLOCK_PLUGIN:
  2630           $parser = $template->makeParserText($vars['sidebar_section_raw']);
  2634           $parser = $template->makeParserText($vars['sidebar_section_raw']);
  2631           $c = ($template->fetch_block($row['block_content'])) ? $template->fetch_block($row['block_content']) : $lang->get('sbedit_msg_plugin_not_loaded');
  2635           $c = ($template->fetch_block($row['block_content'])) ? $template->fetch_block($row['block_content']) : $lang->get('sbedit_msg_plugin_not_loaded');
  2632           break;
  2636           break;
  2633       }
  2637       }
       
  2638       $c = preg_replace('/\{(restrict|hideif) ([a-z0-9_\(\)\|&! ]+)\}/', '', $c);
  2634       $block_name = $row['block_name']; // $template->tplWikiFormat($row['block_name']);
  2639       $block_name = $row['block_name']; // $template->tplWikiFormat($row['block_name']);
  2635       if ( empty($block_name) )
  2640       if ( empty($block_name) )
  2636         $block_name = '&lt;' . $lang->get('sbedit_note_block_unnamed') . '&gt;';
  2641         $block_name = '&lt;' . $lang->get('sbedit_note_block_unnamed') . '&gt;';
  2637       $t = '<span title="' . $lang->get('sbedit_hint_rename') . '" id="sbrename_' . $row['item_id'] . '" ondblclick="ajaxRenameSidebarStage1(this, \''.$row['item_id'].'\'); return false;">' . $block_name . '</span>';
  2642       $t = '<span title="' . $lang->get('sbedit_hint_rename') . '" id="sbrename_' . $row['item_id'] . '" ondblclick="ajaxRenameSidebarStage1(this, \''.$row['item_id'].'\'); return false;">' . $block_name . '</span>';
  2638       if($row['item_enabled'] == 0) $t .= ' <span id="disabled_'.$row['item_id'].'" style="color: red;">' . $lang->get('sbedit_note_block_disabled') . '</span>';
  2643       if($row['item_enabled'] == 0) $t .= ' <span id="disabled_'.$row['item_id'].'" style="color: red;">' . $lang->get('sbedit_note_block_disabled') . '</span>';