advanced_settings.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /**
  3. * Class HTML_QuickForm_advanced_settings
  4. */
  5. class HTML_QuickForm_advanced_settings extends HTML_QuickForm_static
  6. {
  7. /**
  8. * Class constructor
  9. *
  10. * @param string $text raw HTML to add
  11. * @access public
  12. * @return void
  13. */
  14. public function __construct($name = '', $label = '')
  15. {
  16. if (empty($label)) {
  17. $label = get_lang('AdvancedParameters');
  18. }
  19. $this->updateAttributes(
  20. array(
  21. 'label' => $label,
  22. 'name' => $name
  23. )
  24. );
  25. $this->_type = 'html';
  26. }
  27. /**
  28. * Accepts a renderer
  29. *
  30. * @param HTML_QuickForm_Renderer renderer object (only works with Default renderer!)
  31. * @access public
  32. * @return void
  33. */
  34. function accept(&$renderer, $required = false, $error = null)
  35. {
  36. $renderer->renderHtml($this);
  37. }
  38. /**
  39. * @return string
  40. */
  41. public function toHtml()
  42. {
  43. $name = $this->getAttribute('name');
  44. $text = $this->getAttribute('label');
  45. return '<div class="form-group">
  46. <label class="col-sm-2 control-label"></label>
  47. <div class="col-sm-10">
  48. <a id="'.$name.'" class="btn btn-default advanced_options" href="#">
  49. <i class="fa fa-bars"></i> '.$text.'
  50. </a>
  51. </div>
  52. </div>';
  53. }
  54. }