phpMv  -UI toolkit 2.4.12
jQuery, jQuery UI, Twitter Bootstrap and Semantic-UI library for php & php MVC Frameworks
Accordion.php
Go to the documentation of this file.
1 <?php
3 
4 use Ajax\JsUtils;
8 
15 class Accordion extends SimpleComponent {
16 
17  public function __construct(JsUtils $js) {
18  parent::__construct($js);
19  $this->params = array(
20  "active" => 0
21  );
22  $this->uiName = "accordion";
23  }
24 
37  public function setActive($value) {
38  return $this->setParam("active", $value);
39  }
40 
55  public function setAnimate($value) {
56  if ($value instanceof Animation)
57  $value = $value->getParams();
58  else if (is_string($value)) {
59  $animation = new Animation();
60  $animation->setEasing($value);
61  }
62  $this->setParam("animate", $value);
63  return $this;
64  }
65 
74  public function setCollapsible($value) {
75  return $this->setParamCtrl("collapsible", $value, "is_bool");
76  }
77 
85  public function setDisabled($value) {
86  return $this->setParamCtrl("disabled", $value, "is_bool");
87  }
88 
97  public function setEvent($value) {
98  $this->setParam("event", $value);
99  return $this;
100  }
101 
113  public function setHeader($value) {
114  return $this->setParam("header", $value);
115  }
116 
128  public function setHeightStyle($value) {
129  return $this->setParamCtrl("heightStyle", $value, array(
130  "auto",
131  "fill",
132  "content"
133  ));
134  }
135 
146  public function setIcons($value) {
147  if (is_string($value)) {
148  if (JString::startsWith($value, "{"));
149  $value = "%" . $value . "%";
150  }
151  $this->setParam("icons", $value);
152  return $this;
153  }
154 
163  public function onActivate($jsCode) {
164  return $this->addEvent("activate", $jsCode);
165  }
166 
176  public function onBeforeActivate($jsCode) {
177  return $this->addEvent("beforeActivate", $jsCode);
178  }
179 
187  public function onCreate($jsCode) {
188  return $this->addEvent("create", $jsCode);
189  }
190 }
Composant JQuery UI Accordion.
Definition: Accordion.php:15
onCreate($jsCode)
Triggered when the accordion is created.
Definition: Accordion.php:187
onBeforeActivate($jsCode)
Triggered directly before a panel is activated.
Definition: Accordion.php:176
Base component for JQuery UI visuals components.
setDisabled($value)
Disables the accordion if set to true.
Definition: Accordion.php:85
setCollapsible($value)
Whether all the sections can be closed at once.
Definition: Accordion.php:74
setHeader($value)
Selector for the header element, applied via .
Definition: Accordion.php:113
setAnimate($value)
If and how to animate changing panels.
Definition: Accordion.php:55
onActivate($jsCode)
Triggered after a panel has been activated (after animation completes).
Definition: Accordion.php:163
Composant JQuery UI Animation property.
Definition: Animation.php:12
setHeightStyle($value)
Controls the height of the accordion and each panel.
Definition: Accordion.php:128
JQuery PHP library.
Definition: JsUtils.php:23
setEvent($value)
The event that accordion headers will react to in order to activate the associated panel...
Definition: Accordion.php:97
setIcons($value)
Icons to use for headers, matching an icon provided by the jQuery UI CSS Framework.
Definition: Accordion.php:146
setActive($value)
Which panel is currently open.
Definition: Accordion.php:37
setParamCtrl($key, $value, $typeCtrl)