PageRenderTime 65ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/content/code/trunk/administrator/components/com_artofcontent/libraries/jxtended/form/fields/editors.php

https://bitbucket.org/eddieajau/the-art-of-joomla-archive
PHP | 55 lines | 21 code | 8 blank | 26 comment | 0 complexity | 522fd1ec630ede918298a09121cb5f96 MD5 | raw file
  1. <?php
  2. /**
  3. * @version $Id: editors.php 484 2010-12-20 23:40:27Z eddieajau $
  4. * @copyright Copyright 2005 - 2010 New Life in IT Pty Ltd. All rights reserved.
  5. * @license GNU General Public License
  6. * @link http://www.theartofjoomla.com
  7. */
  8. defined('JPATH_BASE') or die;
  9. jimport('joomla.html.html');
  10. require_once dirname(__FILE__).'/list.php';
  11. /**
  12. * Form Field class for the Joomla Framework.
  13. *
  14. * @package JXtended.Libraries
  15. * @subpackage Form
  16. * @since 1.1
  17. */
  18. class JFormFieldEditors extends JFormFieldList
  19. {
  20. /**
  21. * The field type.
  22. *
  23. * @var string
  24. */
  25. public $type = 'Editors';
  26. /**
  27. * Method to get a list of options for a list input.
  28. *
  29. * @return array An array of JHtml options.
  30. */
  31. protected function _getOptions()
  32. {
  33. // compile list of the editors
  34. $query = 'SELECT element AS value, name AS text'
  35. . ' FROM #__plugins'
  36. . ' WHERE folder = "editors"'
  37. . ' AND published = 1'
  38. . ' ORDER BY ordering, name';
  39. $db = & JFactory::getDbo();
  40. $db->setQuery($query);
  41. $options = $db->loadObjectList();
  42. // @todo: Check for an error msg.
  43. // Merge any additional options in the XML definition.
  44. $options = array_merge(parent::_getOptions(), $options);
  45. return $options;
  46. }
  47. }