select_theme.php 905 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. require_once 'HTML/QuickForm/select.php';
  4. /**
  5. * A dropdownlist with all themes to use with QuickForm
  6. */
  7. class HTML_QuickForm_Select_Theme extends HTML_QuickForm_select
  8. {
  9. /**
  10. * Class constructor
  11. */
  12. function HTML_QuickForm_Select_Theme($elementName=null, $elementLabel=null, $options=null, $attributes=null) {
  13. if (!isset($attributes['class'])) {
  14. //todo this was comment due a bug in infocours.php with jquery-ui
  15. //$attributes['class'] = 'chzn-select';
  16. }
  17. parent::HTML_QuickForm_Select($elementName, $elementLabel, $options, $attributes);
  18. // Get all languages
  19. $themes = api_get_themes();
  20. $this->_options = array();
  21. $this->_values = array();
  22. $this->addOption('--',''); // no theme select
  23. for ($i=0; $i< count($themes[0]);$i++) {
  24. $this->addOption($themes[1][$i],$themes[0][$i]);
  25. }
  26. }
  27. }