Beispiel #1
0
 /**
  * shows the current page
  *
  * @access public
  * @return void
  **/
 public function show()
 {
     // ----- keep old modules happy -----
     global $wb, $admin, $database, $page_id, $section_id;
     global $TEXT;
     $admin =& $wb;
     if ($page_id == '') {
         $page_id = $this->_page_id;
     }
     // ----- keep old modules happy -----
     $this->log()->LogDebug(sprintf('showing page with ID [%s]', $page_id));
     // send appropriate header
     if (CAT_Helper_Page::isMaintenance() || CAT_Registry::get('MAINTENANCE_PAGE') == $page_id) {
         header('HTTP/1.1 503 Service Temporarily Unavailable');
         header('Status: 503 Service Temporarily Unavailable');
         header('Retry-After: 7200');
         // in seconds
     }
     // template engine
     global $parser;
     // page of type menu_link
     if (CAT_Sections::isMenuLink($this->_page_id)) {
         $this->showMenuLink();
     } else {
         $do_filter = false;
         // use output filter (if any)
         if (file_exists(CAT_Helper_Directory::sanitizePath(CAT_PATH . '/modules/blackcatFilter/filter.php'))) {
             include_once CAT_Helper_Directory::sanitizePath(CAT_PATH . '/modules/blackcatFilter/filter.php');
             if (function_exists('executeFilters')) {
                 $this->log()->LogDebug('enabling output filters');
                 $do_filter = true;
             }
         }
         $this->setTemplate();
         // including the template; it may calls different functions
         // like page_content() etc.
         ob_start();
         require CAT_TEMPLATE_DIR . '/index.php';
         $output = ob_get_contents();
         ob_clean();
         // droplets
         CAT_Helper_Droplet::process($output);
         // output filtering
         if ($do_filter) {
             $this->log()->LogDebug('executing output filters');
             executeFilters($output);
         }
         // use HTMLPurifier to clean up the output
         if (defined('ENABLE_HTMLPURIFIER') && true === ENABLE_HTMLPURIFIER) {
             $this->log()->LogDebug('executing HTML Purifier');
             $output = CAT_Helper_Protect::purify($output);
         }
         $this->log()->LogDebug('print output');
         if (!headers_sent()) {
             $properties = self::properties($page_id);
             echo header('content-type:text/html; charset=' . (isset($properties['default_charset']) ? $properties['default_charset'] : 'utf-8'));
         }
         echo $output;
     }
 }