includes/template.php
changeset 313 854eecfada20
parent 304 e2cb5f1432c8
parent 312 6c7060d36a23
child 314 474f8be55943
--- a/includes/template.php	Sun Dec 02 16:00:56 2007 -0500
+++ b/includes/template.php	Fri Dec 07 16:42:22 2007 -0500
@@ -33,7 +33,6 @@
   function __construct()
   {
     global $db, $session, $paths, $template, $plugins; // Common objects
-    dc_here('template: initializing all class variables');
     $this->tpl_bool    = Array();
     $this->tpl_strings = Array();
     $this->sidebar_extra = '';
@@ -137,8 +136,6 @@
     global $email;
     global $lang;
     
-    dc_here("template: initializing all variables");
-    
     if(!$this->theme || !$this->style)
     {
       $this->load_theme();
@@ -146,7 +143,6 @@
     
     if(defined('ENANO_TEMPLATE_LOADED'))
     {
-      dc_here('template: access denied to call template::init_vars(), bailing out');
       die_semicritical('Illegal call', '<p>$template->load_theme was called multiple times, this is not supposed to happen. Exiting with fatal error.</p>');
     }
     
@@ -154,8 +150,6 @@
     
     $tplvars = $this->extract_vars('elements.tpl');
     
-    dc_here('template: setting all template vars');
-    
     if(isset($_SERVER['HTTP_USER_AGENT']) && strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE'))
     {
       $this->add_header('
@@ -227,6 +221,9 @@
       case "Category":
         $ns = $lang->get('onpage_lbl_page_category');
         break;
+      case "Anonymous":
+        $ns = 'external page';
+        break;
     }
     $this->namespace_string = $ns;
     unset($ns);
@@ -245,14 +242,17 @@
     $btn_selected = ( isset($tplvars['toolbar_button_selected'])) ? $tplvars['toolbar_button_selected'] : $tplvars['toolbar_button'];
     $parser = $this->makeParserText($btn_selected);
     
-    $parser->assign_vars(array(
-        'FLAGS' => 'onclick="if ( !KILL_SWITCH ) { void(ajaxReset()); return false; }" title="' . $lang->get('onpage_tip_article') . '" accesskey="a"',
-        'PARENTFLAGS' => 'id="mdgToolbar_article"',
-        'HREF' => makeUrl($paths->page, null, true),
-        'TEXT' => $this->namespace_string
-      ));
-    
-    $tb .= $parser->run();
+    if ( true || !$paths->anonymous_page )
+    {
+      $parser->assign_vars(array(
+          'FLAGS' => 'onclick="if ( !KILL_SWITCH ) { void(ajaxReset()); return false; }" title="' . $lang->get('onpage_tip_article') . '" accesskey="a"',
+          'PARENTFLAGS' => 'id="mdgToolbar_article"',
+          'HREF' => makeUrl($paths->page, null, true),
+          'TEXT' => $this->namespace_string
+        ));
+      
+      $tb .= $parser->run();
+    }
     
     $button = $this->makeParserText($tplvars['toolbar_button']);
     
@@ -577,7 +577,7 @@
     }
     
     // Manage ACLs button
-    if($session->get_permissions('edit_acl') || $session->user_level >= USER_LEVEL_ADMIN)
+    if ( !$paths->anonymous_page && ( $session->get_permissions('edit_acl') || $session->user_level >= USER_LEVEL_ADMIN ) )
     {
       $menubtn->assign_vars(array(
           'FLAGS' => 'onclick="if ( !KILL_SWITCH ) { return ajaxOpenACLManager(); }" title="' . $lang->get('onpage_tip_aclmanager') . '" accesskey="m"',
@@ -810,7 +810,6 @@
     }
     
     $headers_sent = true;
-    dc_here('template: generating and sending the page header');
     if(!defined('ENANO_HEADERS_SENT'))
       define('ENANO_HEADERS_SENT', '');
     if ( !$this->no_headers )
@@ -842,7 +841,6 @@
   function footer($simple = false)
   {
     global $db, $session, $paths, $template, $plugins; // Common objects
-    dc_here('template: generating and sending the page footer');
     if(!$this->no_headers) {
       
       if(!defined('ENANO_HEADERS_SENT'))
@@ -873,7 +871,6 @@
   function getHeader()
   {
     $headers_sent = true;
-    dc_here('template: generating and sending the page header');
     if(!defined('ENANO_HEADERS_SENT'))
       define('ENANO_HEADERS_SENT', '');
     if(!$this->no_headers) return $this->process_template('header.tpl');
@@ -881,7 +878,6 @@
   function getFooter()
   {
     global $db, $session, $paths, $template, $plugins; // Common objects
-    dc_here('template: generating and sending the page footer');
     if(!$this->no_headers) {
       global $_starttime;
       $t = '';