/libraries/joomla/html/parameter/element/contentlanguages.php

https://bitbucket.org/kraymitchell/fcd · PHP · 71 lines · 25 code · 10 blank · 36 comment · 1 complexity · e5e6efec737ffa618b428eb5cce1385c MD5 · raw file

  1. <?php
  2. /**
  3. * @package Joomla.Platform
  4. * @subpackage HTML
  5. *
  6. * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
  7. * @license GNU General Public License version 2 or later; see LICENSE
  8. */
  9. defined('JPATH_PLATFORM') or die;
  10. require_once dirname(__FILE__) . '/list.php';
  11. /**
  12. * Renders a select list of Asset Groups
  13. *
  14. * @package Joomla.Platform
  15. * @subpackage Parameter
  16. * @since 11.1
  17. * @deprecated Use JFormFieldContentLanguage instead.
  18. * @note Be careful in replacing to note that JFormFieldConentLanguage does not end in s.
  19. */
  20. class JElementContentLanguages extends JElementList
  21. {
  22. /**
  23. * Element name
  24. *
  25. * @var string
  26. */
  27. protected $_name = 'ContentLanguages';
  28. /**
  29. * Get the options for the element
  30. *
  31. * @param JXMLElement &$node JXMLElement node object containing the settings for the element
  32. *
  33. * @return array
  34. *
  35. * @since 11.1
  36. *
  37. * @deprecated 12.1 Use JFormFieldContentLanguage::getOptions instead
  38. */
  39. protected function _getOptions(&$node)
  40. {
  41. // Deprecation warning.
  42. JLog::add('JElementContentLanguages::_getOptions() is deprecated.', JLog::WARNING, 'deprecated');
  43. $db = JFactory::getDbo();
  44. $query = $db->getQuery(true);
  45. $query->select('a.lang_code AS value, a.title AS text, a.title_native');
  46. $query->from('#__languages AS a');
  47. $query->where('a.published >= 0');
  48. $query->order('a.title');
  49. // Get the options.
  50. $db->setQuery($query);
  51. $options = $db->loadObjectList();
  52. // Check for a database error.
  53. if ($db->getErrorNum())
  54. {
  55. JError::raiseWarning(500, $db->getErrorMsg());
  56. }
  57. // Merge any additional options in the XML definition.
  58. $options = array_merge(parent::_getOptions($node), $options);
  59. return $options;
  60. }
  61. }