includes/template.php
changeset 304 e2cb5f1432c8
parent 279 8acd77a6c19d
parent 287 f6d144cba8a9
child 313 854eecfada20
equal deleted inserted replaced
280:dc08c70ca550 304:e2cb5f1432c8
   773       'TEMPLATE_DIR'=>scriptPath.'/themes/'.$this->theme,
   773       'TEMPLATE_DIR'=>scriptPath.'/themes/'.$this->theme,
   774       'THEME_ID'=>$this->theme,
   774       'THEME_ID'=>$this->theme,
   775       'STYLE_ID'=>$this->style,
   775       'STYLE_ID'=>$this->style,
   776       'JS_DYNAMIC_VARS'=>$js_dynamic,
   776       'JS_DYNAMIC_VARS'=>$js_dynamic,
   777       'UNREAD_PMS'=>$session->unread_pms,
   777       'UNREAD_PMS'=>$session->unread_pms,
   778       'URL_ABOUT_ENANO' => makeUrlNS('Special', 'About_Enano', '', true)
   778       'URL_ABOUT_ENANO' => makeUrlNS('Special', 'About_Enano', '', true),
       
   779       'REPORT_URI' => makeUrl($paths->page, 'do=sql_report', true)
   779       );
   780       );
   780     
   781     
   781     foreach ( $paths->nslist as $ns_id => $ns_prefix )
   782     foreach ( $paths->nslist as $ns_id => $ns_prefix )
   782     {
   783     {
   783       $tpl_strings[ 'NS_' . strtoupper($ns_id) ] = $ns_prefix;
   784       $tpl_strings[ 'NS_' . strtoupper($ns_id) ] = $ns_prefix;
  1074         
  1075         
  1075         if ( !isset($cond) || ( isset($cond) && !is_string($cond) ) )
  1076         if ( !isset($cond) || ( isset($cond) && !is_string($cond) ) )
  1076           continue;
  1077           continue;
  1077         
  1078         
  1078         $tag_complete = <<<TPLCODE
  1079         $tag_complete = <<<TPLCODE
  1079         ';
  1080 ';
  1080         /* START OF CONDITION: $type ($test) */
  1081         /* START OF CONDITION: $type ($test) */
  1081         if ( $cond )
  1082         if ( $cond )
  1082         {
  1083         {
  1083           echo '$particle_true';
  1084           echo '$particle_true';
  1084         /* ELSE OF CONDITION: $type ($test) */
  1085         /* ELSE OF CONDITION: $type ($test) */
  1664     $right = '';
  1665     $right = '';
  1665     
  1666     
  1666     if ( !$this->fetch_block('Links') )
  1667     if ( !$this->fetch_block('Links') )
  1667       $this->initLinksWidget();
  1668       $this->initLinksWidget();
  1668     
  1669     
  1669     $q = $db->sql_query('SELECT item_id,sidebar_id,block_name,block_type,block_content FROM '.table_prefix.'sidebar WHERE item_enabled=1 ORDER BY sidebar_id ASC, item_order ASC;');
  1670     $q = $db->sql_query('SELECT item_id,sidebar_id,block_name,block_type,block_content FROM '.table_prefix.'sidebar' . "\n"
       
  1671                            . '  WHERE item_enabled=1 ORDER BY sidebar_id ASC, item_order ASC;');
  1670     if(!$q) $db->_die('The sidebar text data could not be selected.');
  1672     if(!$q) $db->_die('The sidebar text data could not be selected.');
  1671     
  1673     
  1672     $vars = $this->extract_vars('elements.tpl');
  1674     $vars = $this->extract_vars('elements.tpl');
  1673     
  1675     
  1674     if(isset($vars['sidebar_top'])) 
  1676     if(isset($vars['sidebar_top'])) 
  1853 /**
  1855 /**
  1854  * A version of the template compiler that does not rely at all on the other parts of Enano. Used during installation and for showing
  1856  * A version of the template compiler that does not rely at all on the other parts of Enano. Used during installation and for showing
  1855  * "critical error" messages. ** REQUIRES ** the Oxygen theme.
  1857  * "critical error" messages. ** REQUIRES ** the Oxygen theme.
  1856  */
  1858  */
  1857 
  1859 
  1858 class template_nodb {
  1860 class template_nodb
       
  1861 {
  1859   var $fading_button, $tpl_strings, $tpl_bool, $theme, $style, $no_headers, $additional_headers, $sidebar_extra, $sidebar_widgets, $toolbar_menu, $theme_list;
  1862   var $fading_button, $tpl_strings, $tpl_bool, $theme, $style, $no_headers, $additional_headers, $sidebar_extra, $sidebar_widgets, $toolbar_menu, $theme_list;
  1860   function __construct() {
  1863   function __construct() {
  1861     
  1864     
  1862     $this->tpl_bool    = Array();
  1865     $this->tpl_bool    = Array();
  1863     $this->tpl_strings = Array();
  1866     $this->tpl_strings = Array();
  1965       'TEMPLATE_DIR'=>scriptPath.'/themes/'.$this->theme,
  1968       'TEMPLATE_DIR'=>scriptPath.'/themes/'.$this->theme,
  1966       'THEME_ID'=>$this->theme,
  1969       'THEME_ID'=>$this->theme,
  1967       'STYLE_ID'=>$this->style,
  1970       'STYLE_ID'=>$this->style,
  1968       'JS_DYNAMIC_VARS'=>$js_dynamic,
  1971       'JS_DYNAMIC_VARS'=>$js_dynamic,
  1969       'SIDEBAR_RIGHT'=>'',
  1972       'SIDEBAR_RIGHT'=>'',
       
  1973       'REPORT_URI' => ''
  1970       );
  1974       );
  1971     $this->tpl_strings = array_merge($tpl_strings, $this->tpl_strings);
  1975     $this->tpl_strings = array_merge($tpl_strings, $this->tpl_strings);
  1972     
  1976     
  1973     $sidebar = ( gettype($sideinfo) == 'string' ) ? $sideinfo : '';
  1977     $sidebar = ( gettype($sideinfo) == 'string' ) ? $sideinfo : '';
  1974     if($sidebar != '')
  1978     if($sidebar != '')