SelectTheme.php 806 B

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