Source for file author.php

Documentation is available at author.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Libraries
  4.  * @subpackage  Form
  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
  8.  */
  9.  
  10. defined('JPATH_PLATFORM'or die;
  11.  
  12.  
  13. /**
  14.  * Form Field to load a list of content authors
  15.  *
  16.  * @package     Joomla.Libraries
  17.  * @subpackage  Form
  18.  * @since       3.2
  19.  */
  20. {
  21.     /**
  22.      * The form field type.
  23.      *
  24.      * @var    string 
  25.      * @since  3.2
  26.      */
  27.     public $type = 'Author';
  28.  
  29.     /**
  30.      * Cached array of the category items.
  31.      *
  32.      * @var    array 
  33.      * @since  3.2
  34.      */
  35.     protected static $options array();
  36.  
  37.     /**
  38.      * Method to get the options to populate list
  39.      *
  40.      * @return  array  The field option objects.
  41.      *
  42.      * @since   3.2
  43.      */
  44.     protected function getOptions()
  45.     {
  46.         // Accepted modifiers
  47.         $hash md5($this->element);
  48.  
  49.         if (!isset(static::$options[$hash]))
  50.         {
  51.             static::$options[$hashparent::getOptions();
  52.  
  53.             $options array();
  54.  
  55.             $db JFactory::getDbo();
  56.  
  57.             // Construct the query
  58.             $query $db->getQuery(true)
  59.                 ->select('u.id AS value, u.name AS text')
  60.                 ->from('#__users AS u')
  61.                 ->join('INNER''#__content AS c ON c.created_by = u.id')
  62.                 ->group('u.id, u.name')
  63.                 ->order('u.name');
  64.  
  65.             // Setup the query
  66.             $db->setQuery($query);
  67.  
  68.             // Return the result
  69.             if ($options $db->loadObjectList())
  70.             {
  71.                 static::$options[$hasharray_merge(static::$options[$hash]$options);
  72.             }
  73.         }
  74.  
  75.         return static::$options[$hash];
  76.     }
  77. }

Documentation generated on Tue, 19 Nov 2013 14:54:11 +0100 by phpDocumentor 1.4.3