[ Index ]

PHP Cross Reference of Joomla 2.5.4 DE

title

Body

[close]

/administrator/components/com_newsfeeds/models/fields/ -> newsfeeds.php (source)

   1  <?php
   2  /**
   3   * @copyright    Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
   4   * @license        GNU General Public License version 2 or later; see LICENSE.txt
   5   */
   6  
   7  defined('JPATH_BASE') or die;
   8  
   9  JFormHelper::loadFieldClass('list');
  10  
  11  /**
  12   * Form Field class for the Joomla Framework.
  13   *
  14   * @package        Joomla.Administrator
  15   * @subpackage    com_newsfeeds
  16   * @since        1.6
  17   */
  18   class JFormFieldNewsfeeds extends JFormFieldList
  19  {
  20      /**
  21       * The form field type.
  22       *
  23       * @var        string
  24       * @since    1.6
  25       */
  26      protected $type = 'Newsfeeds';
  27  
  28      /**
  29       * Method to get the field options.
  30       *
  31       * @return    array    The field option objects.
  32       * @since    1.6
  33       */
  34  	protected function getOptions()
  35      {
  36          // Initialize variables.
  37          $options = array();
  38  
  39          $db        = JFactory::getDbo();
  40          $query    = $db->getQuery(true);
  41  
  42          $query->select('id As value, name As text');
  43          $query->from('#__newsfeeds AS a');
  44          $query->order('a.name');
  45  
  46          // Get the options.
  47          $db->setQuery($query);
  48  
  49          $options = $db->loadObjectList();
  50  
  51          // Check for a database error.
  52          if ($db->getErrorNum()) {
  53              JError::raiseWarning(500, $db->getErrorMsg());
  54          }
  55  
  56          // Merge any additional options in the XML definition.
  57          $options = array_merge(parent::getOptions(), $options);
  58  
  59          return $options;
  60      }
  61  }


Generated: Tue Apr 3 11:40:28 2012 Cross-referenced by PHPXref 0.7.1