includes/template.php
changeset 30 7e8fd44b36b0
parent 29 e5484a9e0818
child 36 425261984266
equal deleted inserted replaced
29:e5484a9e0818 30:7e8fd44b36b0
    12  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
    12  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
    13  */
    13  */
    14  
    14  
    15 class template {
    15 class template {
    16   var $tpl_strings, $tpl_bool, $theme, $style, $no_headers, $additional_headers, $sidebar_extra, $sidebar_widgets, $toolbar_menu, $theme_list, $named_theme_list, $default_theme, $default_style, $plugin_blocks, $namespace_string, $style_list, $theme_loaded;
    16   var $tpl_strings, $tpl_bool, $theme, $style, $no_headers, $additional_headers, $sidebar_extra, $sidebar_widgets, $toolbar_menu, $theme_list, $named_theme_list, $default_theme, $default_style, $plugin_blocks, $namespace_string, $style_list, $theme_loaded;
       
    17   
       
    18   /**
       
    19    * Set to true if the site is disabled and thus a message needs to be shown. This should ONLY be changed by common.php.
       
    20    * @var bool
       
    21    * @access private
       
    22    */
       
    23   
       
    24   var $site_disabled = false;
       
    25   
    17   function __construct()
    26   function __construct()
    18   {
    27   {
    19     global $db, $session, $paths, $template, $plugins; // Common objects
    28     global $db, $session, $paths, $template, $plugins; // Common objects
    20     dc_here('template: initializing all class variables');
    29     dc_here('template: initializing all class variables');
    21     $this->tpl_bool    = Array();
    30     $this->tpl_bool    = Array();
   753     {
   762     {
   754       $login_link = makeUrlNS('Special', 'Login/' . $paths->fullpage, 'level=' . $session->user_level, true);
   763       $login_link = makeUrlNS('Special', 'Login/' . $paths->fullpage, 'level=' . $session->user_level, true);
   755       echo '<div class="usermessage">';
   764       echo '<div class="usermessage">';
   756       echo '<b>Your administrative session has timed out.</b> <a href="' . $login_link . '">Log in again</a>';
   765       echo '<b>Your administrative session has timed out.</b> <a href="' . $login_link . '">Log in again</a>';
   757       echo '</div>';
   766       echo '</div>';
       
   767     }
       
   768     if ( $this->site_disabled && $session->user_level >= USER_LEVEL_ADMIN && ( $paths->page != $paths->nslist['Special'] . 'Administration' ) )
       
   769     {
       
   770       $admin_link = makeUrlNS('Special', 'Administration', 'module=' . $paths->nslist['Admin'] . 'GeneralConfig', true);
       
   771       echo '<div class="usermessage"><b>The site is currently disabled and thus is only accessible to administrators.</b><br />
       
   772             You can re-enable the site through the <a href="' . $admin_link . '">administration panel</a>.
       
   773             </div>';
   758     }
   774     }
   759   }
   775   }
   760   function footer($simple = false)
   776   function footer($simple = false)
   761   {
   777   {
   762     global $db, $session, $paths, $template, $plugins; // Common objects
   778     global $db, $session, $paths, $template, $plugins; // Common objects