SelectTheme.php 750 B

12345678910111213141516171819202122232425262728
  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(
  12. $elementName = null,
  13. $elementLabel = null,
  14. $options = null,
  15. $attributes = null
  16. ) {
  17. parent::__construct($elementName, $elementLabel, $options, $attributes);
  18. // Get all languages
  19. $themes = api_get_themes();
  20. $this->_options = [];
  21. $this->_values = [];
  22. $this->addOption('--', ''); // no theme select
  23. foreach ($themes as $themeValue => $themeName) {
  24. $this->addOption($themeName, $themeValue);
  25. }
  26. }
  27. }