| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- <?php
- namespace ThurData\Servers\KerioEmail\Core\UI;
- use ThurData\Servers\KerioEmail\Core\DependencyInjection;
- /**
- * Description of Conteiner
- *
- * @autor ThurData <info@thrudata.ch>
- */
- class DatatableTabsContainer extends Container
- {
- protected $name = 'datatableTabsContainer';
- protected $data = [];
- protected $topLine = [];
- protected $internalLine = [];
- protected $defaultTemplateName = 'tabContainerRight';
- public function setName($name)
- {
- $this->name = $name;
- return $this;
- }
- public function addElement($element)
- {
- if (is_string($element))
- {
- $element = DependencyInjection::get($element);
- }
- $id = $element->getId();
- if (!isset($this->elements[$id]))
- {
- $this->elements[$id] = $element;
- if ($element instanceof \ThurData\Servers\KerioEmail\Core\UI\Interfaces\AjaxElementInterface)
- {
- $this->mainContainer->addAjaxElement($this->elements[$id]);
- }
- }
- return $this;
- }
- /**
- * @param array $data
- * @return $this
- */
- public function setData(array $data = [])
- {
- $this->data = $data;
- $this->updateData();
- return $this;
- }
- protected function updateData()
- {
- foreach ($this->data as $key => $value)
- {
- if (property_exists($this, $key))
- {
- $this->$key = $value;
- }
- }
- $this->data = [];
- return $this;
- }
- public function getHtml()
- {
- $this->runInitContentProcess();
- if ($this->html === '')
- {
- $this->buildHtml();
- }
- return $this->html;
- }
- }
|