| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- namespace ThurData\Servers\KerioEmail\Core\UI\Traits;
- trait Buttons
- {
- protected $buttons = [];
- public function addButton($button)
- {
- $this->addElement($button, 'buttons');
- return $this;
- }
- public function insertButton($buttonId)
- {
- if (!$this->buttons[$buttonId])
- {
- //add exception
- }
- else
- {
- $button = $this->buttons[$buttonId];
- return $button->getHtml();
- }
- return '';
- }
-
- public function getButtons()
- {
- return $this->buttons;
- }
- public function getButtonsCount()
- {
- return count($this->buttons);
- }
- }
|