SelectTheme.php 637 B

123456789101112131415161718192021222324
  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. public function __construct($elementName=null, $elementLabel=null, $options=null, $attributes=null)
  12. {
  13. parent::__construct($elementName, $elementLabel, $options, $attributes);
  14. // Get all languages
  15. $themes = api_get_themes();
  16. $this->_options = array();
  17. $this->_values = array();
  18. $this->addOption('--',''); // no theme select
  19. for ($i=0; $i< count($themes[0]); $i++) {
  20. $this->addOption($themes[1][$i],$themes[0][$i]);
  21. }
  22. }
  23. }