[ Index ]

PHP Cross Reference of Joomla 1.5.26 DE

title

Body

[close]

/administrator/modules/mod_status/ -> mod_status.php (source)

   1  <?php
   2  /**
   3  * @version        $Id: mod_status.php 14401 2010-01-26 14:10:00Z louis $
   4  * @package        Joomla
   5  * @copyright    Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
   6  * @license        GNU/GPL, see LICENSE.php
   7  * Joomla! is free software. This version may have been modified pursuant
   8  * to the GNU General Public License, and as distributed it includes or
   9  * is derivative of works licensed under the GNU General Public License or
  10  * other free or open source software licenses.
  11  * See COPYRIGHT.php for copyright notices and details.
  12  */
  13  
  14  // no direct access
  15  defined( '_JEXEC' ) or die( 'Restricted access' );
  16  
  17  global $task;
  18  
  19  // Initialize some variables
  20  $config        =& JFactory::getConfig();
  21  $user        =& JFactory::getUser();
  22  $db            =& JFactory::getDBO();
  23  $lang        =& JFactory::getLanguage();
  24  $session    =& JFactory::getSession();
  25  
  26  $sid    = $session->getId();
  27  $output = array();
  28  
  29  // Legacy Mode
  30  if (defined('_JLEGACY')) {
  31      $output[] = '<span class="legacy-mode">'.JText::_('Legacy').': '._JLEGACY.'</span>';
  32  }
  33  
  34  // Print the preview button
  35  $output[] = "<span class=\"preview\"><a href=\"".JURI::root()."\" target=\"_blank\">".JText::_('Preview')."</a></span>";
  36  
  37  // Get the number of unread messages in your inbox
  38  $query = 'SELECT COUNT(*)'
  39  . ' FROM #__messages'
  40  . ' WHERE state = 0'
  41  . ' AND user_id_to = '.(int) $user->get('id');
  42  $db->setQuery( $query );
  43  $unread = $db->loadResult();
  44  
  45  if (JRequest::getInt('hidemainmenu')) {
  46      $inboxLink = '<a>';
  47  } else {
  48      $inboxLink = '<a href="index.php?option=com_messages">';
  49  }
  50  
  51  // Print the inbox message
  52  if ($unread) {
  53      $output[] = $inboxLink.'<span class="unread-messages">'.$unread.'</span></a>';
  54  } else {
  55      $output[] = $inboxLink.'<span class="no-unread-messages">'.$unread.'</span></a>';
  56  }
  57  
  58  // Get the number of logged in users
  59  $query = 'SELECT COUNT( session_id )'
  60  . ' FROM #__session'
  61  . ' WHERE guest <> 1'
  62  ;
  63  $db->setQuery($query);
  64  $online_num = intval( $db->loadResult() );
  65  
  66  //Print the logged in users message
  67  $output[] = "<span class=\"loggedin-users\">".$online_num."</span>";
  68  
  69  if ($task == 'edit' || $task == 'editA' || JRequest::getInt('hidemainmenu') ) {
  70       // Print the logout message
  71       $output[] = "<span class=\"logout\">".JText::_('Logout')."</span>";
  72  } else {
  73      // Print the logout message
  74      $output[] = "<span class=\"logout\"><a href=\"index.php?option=com_login&amp;task=logout\">".JText::_('Logout')."</a></span>";
  75  }
  76  
  77  // reverse rendering order for rtl display
  78  if ( $lang->isRTL() ) {
  79      $output = array_reverse( $output );
  80  }
  81  
  82  // output the module
  83  foreach ($output as $item){
  84      echo $item;
  85  }


Generated: Wed Mar 28 15:54:07 2012 Cross-referenced by PHPXref 0.7.1