includes/pageprocess.php
changeset 24 9ecc94c4c7f5
parent 22 d0314575e2f0
child 25 08d027882993
equal deleted inserted replaced
23:320acf077276 24:9ecc94c4c7f5
   132     if ( !$this->perms->get_permissions('read') )
   132     if ( !$this->perms->get_permissions('read') )
   133     {
   133     {
   134       $this->err_access_denied();
   134       $this->err_access_denied();
   135       return false;
   135       return false;
   136     }
   136     }
       
   137     $pathskey = $paths->nslist[ $this->namespace ] . $this->page_id;
       
   138     $strict_no_headers = false;
       
   139     if ( isset($paths->pages[$pathskey]) )
       
   140     {
       
   141       if ( $paths->pages[$pathskey]['special'] == 1 )
       
   142       {
       
   143         $this->send_headers = false;
       
   144         $strict_no_headers = true;
       
   145       }
       
   146     }
   137     if ( $this->namespace == 'Special' || $this->namespace == 'Admin' )
   147     if ( $this->namespace == 'Special' || $this->namespace == 'Admin' )
   138     {
   148     {
   139       if ( !$this->page_exists )
   149       if ( !$this->page_exists )
   140       {
   150       {
   141         redirect( makeUrl(getConfig('main_page')), 'Can\'t find special page', 'The special or administration page you requested does not exist. You will now be transferred to the main page.', 2 );
   151         redirect( makeUrl(getConfig('main_page')), 'Can\'t find special page', 'The special or administration page you requested does not exist. You will now be transferred to the main page.', 2 );
   215         $this->err_no_rows();
   225         $this->err_no_rows();
   216         return false;
   226         return false;
   217       }
   227       }
   218       else
   228       else
   219       {
   229       {
   220         $this->render();
   230         $this->render( (!$strict_no_headers) );
   221       }
   231       }
   222     }
   232     }
   223   }
   233   }
   224   
   234   
   225   /**
   235   /**
   285   /**
   295   /**
   286    * Renders it all in one go, and echoes it out. This assumes that the text is in the DB.
   296    * Renders it all in one go, and echoes it out. This assumes that the text is in the DB.
   287    * @access private
   297    * @access private
   288    */
   298    */
   289   
   299   
   290   function render()
   300   function render($incl_inner_headers = true)
   291   {
   301   {
   292     $text = $this->fetch_text();
   302     $text = $this->fetch_text();
   293     
   303     
   294     $this->header();
   304     $this->header();
   295     // if ( $this->send_headers )
   305     if ( $incl_inner_headers )
   296     // {
   306     {
   297       display_page_headers();
   307       display_page_headers();
   298     // }
   308     }
   299     
   309     
   300     if ( $this->revision_id )
   310     if ( $this->revision_id )
   301     {
   311     {
   302       echo '<div class="info-box" style="margin-left: 0; margin-top: 5px;"><b>Notice:</b><br />The page you are viewing was archived on '.date('F d, Y \a\t h:i a', $this->revision_id).'.<br /><a href="'.makeUrlNS($this->namespace, $this->page_id).'" onclick="ajaxReset(); return false;">View current version</a>  |  <a href="'.makeUrlNS($this->namespace, $this->pageid, 'do=rollback&amp;id='.$this->revision_id).'" onclick="ajaxRollback(\''.$this->revision_id.'\')">Restore this version</a></div><br />';
   312       echo '<div class="info-box" style="margin-left: 0; margin-top: 5px;"><b>Notice:</b><br />The page you are viewing was archived on '.date('F d, Y \a\t h:i a', $this->revision_id).'.<br /><a href="'.makeUrlNS($this->namespace, $this->page_id).'" onclick="ajaxReset(); return false;">View current version</a>  |  <a href="'.makeUrlNS($this->namespace, $this->pageid, 'do=rollback&amp;id='.$this->revision_id).'" onclick="ajaxRollback(\''.$this->revision_id.'\')">Restore this version</a></div><br />';
   303     }
   313     }
   304     
   314     
   305     $text = '?>' . RenderMan::render($text);
   315     $text = '?>' . RenderMan::render($text);
   306     // echo('<pre>'.htmlspecialchars($text).'</pre>');
   316     // echo('<pre>'.htmlspecialchars($text).'</pre>');
   307     eval ( $text );
   317     eval ( $text );
   308     
   318     
   309     // if ( $this->send_headers )
   319     if ( $incl_inner_headers )
   310     // {
   320     {
   311       display_page_footers();
   321       display_page_footers();
   312     // }
   322     }
   313     
   323     
   314     $this->footer();
   324     $this->footer();
   315   }
   325   }
   316   
   326   
   317   /**
   327   /**