includes/template.php
changeset 832 7152ca0a0ce9
parent 825 9d5c04c1414f
child 843 4415e50e4e84
equal deleted inserted replaced
831:45e887f23282 832:7152ca0a0ce9
   434         'style' => $this->style
   434         'style' => $this->style
   435       );
   435       );
   436     
   436     
   437     require(ENANO_ROOT . "/themes/{$this->theme}/theme.cfg");
   437     require(ENANO_ROOT . "/themes/{$this->theme}/theme.cfg");
   438     
   438     
   439     if ( $local_page_exists && isset($paths->pages[$local_page]) )
   439     if ( $local_page_exists && isPage($local_page) )
   440     {
   440     {
   441       $local_cdata =& $paths->pages[$local_page];
   441       $local_cdata =& $paths->pages[$local_page];
   442     }
   442     }
   443     else
   443     else
   444     {
   444     {
   601     
   601     
   602     $button = $this->makeParserText($tplvars['toolbar_button']);
   602     $button = $this->makeParserText($tplvars['toolbar_button']);
   603     
   603     
   604     // Page toolbar
   604     // Page toolbar
   605     // Comments button
   605     // Comments button
   606     if ( $perms->get_permissions('read') && getConfig('enable_comments')=='1' && $local_cdata['comments_on'] == 1 )
   606     if ( $perms->get_permissions('read') && getConfig('enable_comments', '1')=='1' && $local_cdata['comments_on'] == 1 )
   607     {
   607     {
   608       
   608       
   609       $e = $db->sql_query('SELECT approved FROM '.table_prefix.'comments WHERE page_id=\''.$local_page_id.'\' AND namespace=\''.$local_namespace.'\';');
   609       $e = $db->sql_query('SELECT approved FROM '.table_prefix.'comments WHERE page_id=\''.$local_page_id.'\' AND namespace=\''.$local_namespace.'\';');
   610       if ( !$e )
   610       if ( !$e )
   611       {
   611       {
  1149       var USER_LEVEL_MOD = ' . USER_LEVEL_MOD . ';
  1149       var USER_LEVEL_MOD = ' . USER_LEVEL_MOD . ';
  1150       var USER_LEVEL_ADMIN = ' . USER_LEVEL_ADMIN . ';
  1150       var USER_LEVEL_ADMIN = ' . USER_LEVEL_ADMIN . ';
  1151       var disable_redirect = ' . ( isset($_GET['redirect']) && $_GET['redirect'] == 'no' ? 'true' : 'false' ) . ';
  1151       var disable_redirect = ' . ( isset($_GET['redirect']) && $_GET['redirect'] == 'no' ? 'true' : 'false' ) . ';
  1152       var pref_disable_js_fx = ' . ( @$session->user_extra['disable_js_fx'] == 1 ? 'true' : 'false' ) . ';
  1152       var pref_disable_js_fx = ' . ( @$session->user_extra['disable_js_fx'] == 1 ? 'true' : 'false' ) . ';
  1153       var csrf_token = "' . $session->csrf_token . '";
  1153       var csrf_token = "' . $session->csrf_token . '";
  1154       var editNotice = \'' . ( (getConfig('wiki_edit_notice')=='1') ? str_replace("\n", "\\\n", RenderMan::render(getConfig('wiki_edit_notice_text'))) : '' ) . '\';
  1154       var editNotice = \'' . ( (getConfig('wiki_edit_notice', '0')=='1') ? str_replace("\n", "\\\n", RenderMan::render(getConfig('wiki_edit_notice_text'))) : '' ) . '\';
  1155       var prot = ' . ( ($protected) ? 'true' : 'false' ) .'; // No, hacking this var won\'t work, it\'s re-checked on the server
  1155       var prot = ' . ( ($protected) ? 'true' : 'false' ) .'; // No, hacking this var won\'t work, it\'s re-checked on the server
  1156       var ENANO_SPECIAL_CREATEPAGE = \''. makeUrl($paths->nslist['Special'].'CreatePage') .'\';
  1156       var ENANO_SPECIAL_CREATEPAGE = \''. makeUrl($paths->nslist['Special'].'CreatePage') .'\';
  1157       var ENANO_CREATEPAGE_PARAMS = \'_do=&pagename='. $urlname_clean .'&namespace=' . $local_namespace . '\';
  1157       var ENANO_CREATEPAGE_PARAMS = \'_do=&pagename='. $urlname_clean .'&namespace=' . $local_namespace . '\';
  1158       var ENANO_SPECIAL_CHANGESTYLE = \''. makeUrlNS('Special', 'ChangeStyle') .'\';
  1158       var ENANO_SPECIAL_CHANGESTYLE = \''. makeUrlNS('Special', 'ChangeStyle') .'\';
  1159       var namespace_list = new Array();
  1159       var namespace_list = new Array();
  2403     foreach ( $code as $cmd )
  2403     foreach ( $code as $cmd )
  2404     {
  2404     {
  2405       eval($cmd);
  2405       eval($cmd);
  2406     }
  2406     }
  2407     
  2407     
  2408     if(count($ob) > 0 || getConfig('powered_btn') == '1') $sb_links = '<div style="text-align: center; padding: 5px 0;">'. ( ( getConfig('powered_btn') == '1' ) ? $this->fading_button : '' ) . implode('<br />', $ob).'</div>';
  2408     if(count($ob) > 0 || getConfig('powered_btn', '1') == '1') $sb_links = '<div style="text-align: center; padding: 5px 0;">'. ( ( getConfig('powered_btn', '1') == '1' ) ? $this->fading_button : '' ) . implode('<br />', $ob).'</div>';
  2409     else $sb_links = '';
  2409     else $sb_links = '';
  2410     
  2410     
  2411     $this->sidebar_widget('Links', $sb_links);
  2411     $this->sidebar_widget('Links', $sb_links);
  2412   }
  2412   }
  2413   
  2413