select_theme.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. // $Id: $
  3. /*
  4. ==============================================================================
  5. Dokeos - elearning and course management software
  6. Copyright (c) 2004-2008 Dokeos SPRL
  7. Copyright (c) Bart Mollet, Hogeschool Gent
  8. For a full list of contributors, see "credits.txt".
  9. The full license can be read in "license.txt".
  10. This program is free software; you can redistribute it and/or
  11. modify it under the terms of the GNU General Public License
  12. as published by the Free Software Foundation; either version 2
  13. of the License, or (at your option) any later version.
  14. See the GNU General Public License for more details.
  15. Contact address: Dokeos, rue du Corbeau, 108, B-1030 Brussels, Belgium
  16. Mail: info@dokeos.com
  17. ==============================================================================
  18. */
  19. require_once ('HTML/QuickForm/select.php');
  20. /**
  21. * A dropdownlist with all themes to use with QuickForm
  22. */
  23. class HTML_QuickForm_Select_Theme extends HTML_QuickForm_select
  24. {
  25. /**
  26. * Class constructor
  27. */
  28. function HTML_QuickForm_Select_Theme($elementName=null, $elementLabel=null, $options=null, $attributes=null)
  29. {
  30. parent::HTML_QuickForm_Select($elementName, $elementLabel, $options, $attributes);
  31. // Get all languages
  32. $themes = api_get_themes();
  33. $this->_options = array();
  34. $this->_values = array();
  35. $this->addOption('--',''); // no theme select
  36. for ($i=0; $i< count($themes[0]);$i++)
  37. {
  38. $this->addOption($themes[1][$i],$themes[0][$i]);
  39. }
  40. /*foreach ($themes as $theme)
  41. {
  42. $this->addOption((empty($theme)?'--':$theme),$theme);
  43. }*/
  44. }
  45. }
  46. ?>