includes/template.php
changeset 655 b2c51a68209b
parent 650 e45183014778
child 669 9243d01c0716
equal deleted inserted replaced
654:18dbf386d356 655:b2c51a68209b
    54     $this->toolbar_menu = '';
    54     $this->toolbar_menu = '';
    55     $this->additional_headers = '';
    55     $this->additional_headers = '';
    56     $this->plugin_blocks = Array();
    56     $this->plugin_blocks = Array();
    57     $this->theme_loaded = false;
    57     $this->theme_loaded = false;
    58     
    58     
    59     $this->fading_button = '<div style="background-image: url('.cdnPath.'/images/about-powered-enano-hover.png); background-repeat: no-repeat; width: 88px; height: 31px; margin: 0 auto 5px auto;">
       
    60                               <a style="background-image: none; padding-right: 0;" href="http://enanocms.org/" onclick="window.open(this.href); return false;"><img style="border-width: 0;" alt=" " src="'.cdnPath.'/images/about-powered-enano.png" onmouseover="domOpacity(this, 100, 0, 500);" onmouseout="domOpacity(this, 0, 100, 500);" /></a>
       
    61                             </div>';
       
    62     
       
    63     $this->theme_list = Array();
    59     $this->theme_list = Array();
    64     $this->named_theme_list = Array();
    60     $this->named_theme_list = Array();
    65     
    61     
    66     $this->vars_assign_history = array(
    62     $this->vars_assign_history = array(
    67         'strings' => array(),
    63         'strings' => array(),
   193    */
   189    */
   194   
   190   
   195   function process_theme_acls()
   191   function process_theme_acls()
   196   {
   192   {
   197     global $db, $session, $paths, $template, $plugins; // Common objects
   193     global $db, $session, $paths, $template, $plugins; // Common objects
       
   194     global $lang;
       
   195     
       
   196     // generate the fading button - needs to be done after sessions are started
       
   197     $admintitle = ( $session->user_level >= USER_LEVEL_ADMIN ) ? ' title="' . $lang->get('sidebar_btn_enanopowered_admin_tip') . '"' : '';
       
   198     $this->fading_button = '<div style="background-image: url('.cdnPath.'/images/about-powered-enano-hover.png); background-repeat: no-repeat; width: 88px; height: 31px; margin: 0 auto 5px auto;">
       
   199                               <a style="background-image: none; padding-right: 0;" href="http://enanocms.org/" onclick="window.open(this.href); return false;"' . $admintitle . '><img style="border-width: 0;" alt=" " src="'.cdnPath.'/images/about-powered-enano.png" onmouseover="domOpacity(this, 100, 0, 500);" onmouseout="domOpacity(this, 0, 100, 500);" /></a>
       
   200                             </div>';
   198     
   201     
   199     // For each theme, check ACLs and delete from RAM if not authorized
   202     // For each theme, check ACLs and delete from RAM if not authorized
   200     foreach ( $this->theme_list as $i => $theme )
   203     foreach ( $this->theme_list as $i => $theme )
   201     {
   204     {
   202       if ( !@$theme['group_list'] )
   205       if ( !@$theme['group_list'] )
   557         break;
   560         break;
   558       case "Category":
   561       case "Category":
   559         $ns = $lang->get('onpage_lbl_page_category');
   562         $ns = $lang->get('onpage_lbl_page_category');
   560         break;
   563         break;
   561       case "Anonymous":
   564       case "Anonymous":
   562         $ns = 'external page';
   565         $ns = $lang->get('onpage_lbl_page_external');
   563         break;
   566         break;
   564     }
   567     }
   565     $this->namespace_string = $ns;
   568     $this->namespace_string = $ns;
   566     unset($ns);
   569     unset($ns);
   567     $code = $plugins->setHook('page_type_string_set');
   570     $code = $plugins->setHook('page_type_string_set');
   976     {
   979     {
   977       $asq = '';
   980       $asq = '';
   978       $asa = '';
   981       $asa = '';
   979       $as2 = '';
   982       $as2 = '';
   980       $ash = '';
   983       $ash = '';
   981     }
       
   982     
       
   983     $code = $plugins->setHook('compile_template');
       
   984     foreach ( $code as $cmd )
       
   985     {
       
   986       eval($cmd);
       
   987     }
   984     }
   988     
   985     
   989     // Set up javascript includes
   986     // Set up javascript includes
   990     // these depend heavily on whether we have a CDN to work with or not
   987     // these depend heavily on whether we have a CDN to work with or not
   991     if ( getConfig('cdn_path') )
   988     if ( getConfig('cdn_path') )
  1030         enano_init();
  1027         enano_init();
  1031         window.onload = function(e) {  };
  1028         window.onload = function(e) {  };
  1032       }
  1029       }
  1033     </script>
  1030     </script>
  1034 JSEOF;
  1031 JSEOF;
       
  1032     }
       
  1033     
       
  1034     $code = $plugins->setHook('compile_template');
       
  1035     foreach ( $code as $cmd )
       
  1036     {
       
  1037       eval($cmd);
  1035     }
  1038     }
  1036     
  1039     
  1037     // Some additional sidebar processing
  1040     // Some additional sidebar processing
  1038     if ( $this->sidebar_extra != '' )
  1041     if ( $this->sidebar_extra != '' )
  1039     {
  1042     {
  2187   }
  2190   }
  2188   
  2191   
  2189   function initLinksWidget()
  2192   function initLinksWidget()
  2190   {
  2193   {
  2191     global $db, $session, $paths, $template, $plugins; // Common objects
  2194     global $db, $session, $paths, $template, $plugins; // Common objects
       
  2195     
  2192     // SourceForge/W3C buttons
  2196     // SourceForge/W3C buttons
  2193     $ob = Array();
  2197     $ob = Array();
  2194     // FIXME: l10n
       
  2195     $admintitle = ( $session->user_level >= USER_LEVEL_ADMIN ) ? 'title="You may disable this button in the admin panel under General Configuration."' : '';
       
  2196     if(getConfig('sflogo_enabled')=='1')
  2198     if(getConfig('sflogo_enabled')=='1')
  2197     {
  2199     {
  2198       $sflogo_secure = ( isset($_SERVER['HTTPS']) ) ? 'https' : 'http';
  2200       $sflogo_secure = ( isset($_SERVER['HTTPS']) ) ? 'https' : 'http';
  2199       $ob[] = '<a style="text-align: center;" href="http://sourceforge.net/" onclick="if ( !KILL_SWITCH ) { window.open(this.href);return false; }"><img style="border-width: 0px;" alt="SourceForge.net Logo" src="' . $sflogo_secure . '://sflogo.sourceforge.net/sflogo.php?group_id='.getConfig('sflogo_groupid').'&amp;type='.getConfig('sflogo_type').'" /></a>';
  2201       $ob[] = '<a style="text-align: center;" href="http://sourceforge.net/" onclick="if ( !KILL_SWITCH ) { window.open(this.href);return false; }"><img style="border-width: 0px;" alt="SourceForge.net Logo" src="' . $sflogo_secure . '://sflogo.sourceforge.net/sflogo.php?group_id='.getConfig('sflogo_groupid').'&amp;type='.getConfig('sflogo_type').'" /></a>';
  2200     }
  2202     }
  2637       'USERNAME'=>'admin',
  2639       'USERNAME'=>'admin',
  2638       'SITE_DESC' => $site_desc_final,
  2640       'SITE_DESC' => $site_desc_final,
  2639       'TOOLBAR'=>$tb,
  2641       'TOOLBAR'=>$tb,
  2640       'SCRIPTPATH'=>scriptPath,
  2642       'SCRIPTPATH'=>scriptPath,
  2641       'CONTENTPATH'=>contentPath,
  2643       'CONTENTPATH'=>contentPath,
       
  2644       'CDNPATH' => scriptPath,
       
  2645       'JS_HEADER' => '<script type="text/javascript" src="' . scriptPath . '/includes/clientside/static/enano-lib-basic.js"></script>',
       
  2646       'JS_FOOTER' => '',
  2642       'ADMIN_SID_QUES'=>$asq,
  2647       'ADMIN_SID_QUES'=>$asq,
  2643       'ADMIN_SID_AMP'=>$asa,
  2648       'ADMIN_SID_AMP'=>$asa,
  2644       'ADMIN_SID_AMP_HTML'=>'',
  2649       'ADMIN_SID_AMP_HTML'=>'',
  2645       'ADDITIONAL_HEADERS'=>$this->additional_headers,
  2650       'ADDITIONAL_HEADERS'=>$this->additional_headers,
  2646       'SIDEBAR_EXTRA'=>'',
  2651       'SIDEBAR_EXTRA'=>'',