advanced_settings.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. /**
  3. * HTML class for static data
  4. * @example $form->addElement('advanced_settings', '<a href="#">advanced settings</a>');
  5. */
  6. //require_once 'HTML/QuickForm/static.php';
  7. /**
  8. * A pseudo-element used for adding raw HTML to form
  9. *
  10. * Intended for use with the default renderer only, template-based
  11. * ones may (and probably will) completely ignore this
  12. *
  13. * @category HTML
  14. * @package HTML_QuickForm
  15. * @author Alexey Borzov <avb@php.net>
  16. * @version Release: 3.2.11
  17. * @since 3.0
  18. * @deprecated Please use the templates rather than add raw HTML via this element
  19. */
  20. class HTML_QuickForm_advanced_settings extends HTML_QuickForm_element
  21. {
  22. /**
  23. * @param string $name
  24. * @param string $label
  25. * @param array $attributes
  26. */
  27. function HTML_QuickForm_advanced_settings($name = null, $label = null)
  28. {
  29. if (empty($label)) {
  30. $label = get_lang('AdvancedParameters');
  31. }
  32. $this->updateAttributes(
  33. array(
  34. 'label' => $label,
  35. 'name' => $name
  36. )
  37. );
  38. $this->_type = 'html';
  39. }
  40. /**
  41. * Accepts a renderer
  42. *
  43. * @param HTML_QuickForm_Renderer renderer object (only works with Default renderer!)
  44. * @access public
  45. * @return void
  46. */
  47. function accept(&$renderer, $required = false, $error = null)
  48. {
  49. $renderer->renderHtml($this);
  50. }
  51. function toHtml()
  52. {
  53. $name = $this->getAttribute('name');
  54. $text = $this->getAttribute('label');
  55. return '<div class="form-group">
  56. <label class="col-sm-2 control-label"></label>
  57. <div class="col-sm-10">
  58. <a id="'.$name.'" class="btn btn-default advanced_options" href="#">
  59. <i class="fa fa-bars"></i> '.$text.'
  60. </a>
  61. </div>
  62. </div>';
  63. }
  64. }