Source for file usermessages.php

Documentation is available at usermessages.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Administrator
  4.  * @subpackage  com_messages
  5.  *
  6.  * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
  7.  * @license     GNU General Public License version 2 or later; see LICENSE.txt
  8.  */
  9.  
  10. defined('_JEXEC'or die;
  11.  
  12.  
  13. /**
  14.  * Supports an modal select of user that have access to com_messages
  15.  *
  16.  * @package     Joomla.Administrator
  17.  * @subpackage  com_messages
  18.  * @since       1.6
  19.  */
  20. {
  21.     /**
  22.      * The form field type.
  23.      *
  24.      * @var        string 
  25.      * @since   1.6
  26.      */
  27.     public $type = 'UserMessages';
  28.  
  29.     /**
  30.      * Method to get the filtering groups (null means no filtering)
  31.      *
  32.      * @return  array|null   array of filtering groups or null.
  33.      * @since   1.6
  34.      */
  35.     protected function getGroups()
  36.     {
  37.         // Compute usergroups
  38.         $db JFactory::getDbo();
  39.         $query $db->getQuery(true)
  40.             ->select('id')
  41.             ->from('#__usergroups');
  42.         $db->setQuery($query);
  43.  
  44.         try
  45.         {
  46.             $groups $db->loadColumn();
  47.         }
  48.         catch (RuntimeException $e)
  49.         {
  50.             JError::raiseNotice(500$e->getMessage());
  51.             return null;
  52.         }
  53.  
  54.         foreach ($groups as $i => $group)
  55.         {
  56.             if (JAccess::checkGroup($group'core.admin'))
  57.             {
  58.                 continue;
  59.             }
  60.             if (!JAccess::checkGroup($group'core.manage''com_messages'))
  61.             {
  62.                 unset($groups[$i]);
  63.                 continue;
  64.             }
  65.             if (!JAccess::checkGroup($group'core.login.admin'))
  66.             {
  67.                 unset($groups[$i]);
  68.                 continue;
  69.             }
  70.         }
  71.         return array_values($groups);
  72.     }
  73.  
  74.     /**
  75.      * Method to get the users to exclude from the list of users
  76.      *
  77.      * @return  array|nullarray of users to exclude or null to to not exclude them
  78.      * @since   1.6
  79.      */
  80.     protected function getExcluded()
  81.     {
  82.         return array(JFactory::getUser()->id);
  83.     }
  84. }

Documentation generated on Tue, 19 Nov 2013 15:16:35 +0100 by phpDocumentor 1.4.3