Fixed unused $admintitle variable in $template->fading_button code generation; fixed missing CDNPATH, JS_HEADER, and JS_FOOTER in template_nodb; localized onpage_lbl_page_external
authorDan
Tue, 22 Jul 2008 17:03:53 -0500
changeset 655 b2c51a68209b
parent 654 18dbf386d356
child 656 24de7d08b7ea
Fixed unused $admintitle variable in $template->fading_button code generation; fixed missing CDNPATH, JS_HEADER, and JS_FOOTER in template_nodb; localized onpage_lbl_page_external
includes/template.php
language/english/core.json
--- a/includes/template.php	Tue Jul 22 17:01:42 2008 -0500
+++ b/includes/template.php	Tue Jul 22 17:03:53 2008 -0500
@@ -56,10 +56,6 @@
     $this->plugin_blocks = Array();
     $this->theme_loaded = false;
     
-    $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;">
-                              <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>
-                            </div>';
-    
     $this->theme_list = Array();
     $this->named_theme_list = Array();
     
@@ -195,6 +191,13 @@
   function process_theme_acls()
   {
     global $db, $session, $paths, $template, $plugins; // Common objects
+    global $lang;
+    
+    // generate the fading button - needs to be done after sessions are started
+    $admintitle = ( $session->user_level >= USER_LEVEL_ADMIN ) ? ' title="' . $lang->get('sidebar_btn_enanopowered_admin_tip') . '"' : '';
+    $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;">
+                              <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>
+                            </div>';
     
     // For each theme, check ACLs and delete from RAM if not authorized
     foreach ( $this->theme_list as $i => $theme )
@@ -559,7 +562,7 @@
         $ns = $lang->get('onpage_lbl_page_category');
         break;
       case "Anonymous":
-        $ns = 'external page';
+        $ns = $lang->get('onpage_lbl_page_external');
         break;
     }
     $this->namespace_string = $ns;
@@ -980,12 +983,6 @@
       $ash = '';
     }
     
-    $code = $plugins->setHook('compile_template');
-    foreach ( $code as $cmd )
-    {
-      eval($cmd);
-    }
-    
     // Set up javascript includes
     // these depend heavily on whether we have a CDN to work with or not
     if ( getConfig('cdn_path') )
@@ -1034,6 +1031,12 @@
 JSEOF;
     }
     
+    $code = $plugins->setHook('compile_template');
+    foreach ( $code as $cmd )
+    {
+      eval($cmd);
+    }
+    
     // Some additional sidebar processing
     if ( $this->sidebar_extra != '' )
     {
@@ -2189,10 +2192,9 @@
   function initLinksWidget()
   {
     global $db, $session, $paths, $template, $plugins; // Common objects
+    
     // SourceForge/W3C buttons
     $ob = Array();
-    // FIXME: l10n
-    $admintitle = ( $session->user_level >= USER_LEVEL_ADMIN ) ? 'title="You may disable this button in the admin panel under General Configuration."' : '';
     if(getConfig('sflogo_enabled')=='1')
     {
       $sflogo_secure = ( isset($_SERVER['HTTPS']) ) ? 'https' : 'http';
@@ -2639,6 +2641,9 @@
       'TOOLBAR'=>$tb,
       'SCRIPTPATH'=>scriptPath,
       'CONTENTPATH'=>contentPath,
+      'CDNPATH' => scriptPath,
+      'JS_HEADER' => '<script type="text/javascript" src="' . scriptPath . '/includes/clientside/static/enano-lib-basic.js"></script>',
+      'JS_FOOTER' => '',
       'ADMIN_SID_QUES'=>$asq,
       'ADMIN_SID_AMP'=>$asa,
       'ADMIN_SID_AMP_HTML'=>'',
--- a/language/english/core.json	Tue Jul 22 17:01:42 2008 -0500
+++ b/language/english/core.json	Tue Jul 22 17:03:53 2008 -0500
@@ -244,6 +244,7 @@
       lbl_page_template: 'template',
       lbl_page_project: 'project page',
       lbl_page_category: 'category',
+      lbl_page_external: 'external page',
       
       btn_discussion: 'discussion (%num_comments%)',
       btn_discussion_unapp: 'discussion (%num_comments% total, %num_unapp% unapp.)',
@@ -497,6 +498,7 @@
       btn_administration: 'Administration',
       btn_editsidebar: 'Edit the sidebar',
       btn_search_go: 'Go',
+      btn_enanopowered_admin_tip: 'You may disable this button in the admin panel under General Configuration.',
       
       btn_userpage: 'User page',
       btn_mycontribs: 'My contributions',