Esempio n. 1
0
 public function registerPlugin()
 {
     $settings = false;
     $view = $this->getView();
     UIAsset::register($view);
     if ($this->enableTableSort) {
         $settings = true;
         TableSortAsset::register($view);
     }
     $js = "ui.semantic.initTableSort({$settings});";
     $view->registerJs($js);
 }
Esempio n. 2
0
 public function renderToggleButton()
 {
     $tag = ArrayHelper::remove($this->toggleButton, 'tag', 'div');
     $label = ArrayHelper::remove($this->toggleButton, 'label', Html::tag('i', '', ['class' => 'content icon']));
     UI::addCssClasses($this->toggleButton, ['ui', $this->buttonIcon, 'icon', 'button', 'fixed', 'attached']);
     if ($this->position === static::POS_LEFT) {
         $position = static::POS_RIGHT;
     } else {
         $position = static::POS_LEFT;
     }
     UI::addCssClasses($this->toggleButton, [$position]);
     $view = $this->getView();
     UIAsset::register($view);
     $view->registerJs("ui.semantic.init();");
     return Html::tag($tag, $label, $this->toggleButton);
 }
Esempio n. 3
0
 public function registerJs()
 {
     $view = $this->getView();
     UIAsset::register($view);
     $id = $this->getId();
     $js = "ui.semantic.initTabs('#" . $this->getId() . "');";
     $view->registerJs($js);
 }
Esempio n. 4
0
 protected function renderToggleButton()
 {
     if ($this->toggleButton !== false) {
         $tag = ArrayHelper::remove($this->toggleButton, 'tag', 'div');
         $label = ArrayHelper::remove($this->toggleButton, 'label', 'Show');
         if ($tag === 'button' && !isset($this->toggleButton['type'])) {
             $this->toggleButton['type'] = 'button';
         }
         if ($tag === 'div') {
             UI::addCssClasses($this->toggleButton, ['ui', 'button']);
         }
         $view = $this->getView();
         UIAsset::register($view);
         $view->registerJs('ui.semantic.init();');
         return Html::tag($tag, $label, $this->toggleButton);
     } else {
         return null;
     }
 }
Esempio n. 5
0
 public function renderCloseButton()
 {
     $view = $this->getView();
     UIAsset::register($view);
     $options['id'] = $this->getId() . '-close-button';
     $js = "ui.semantic.initMessageCloseButtons('#" . $options['id'] . "','{$this->closeTransition}');";
     $view->registerJs($js);
     return UI::i('close', $options);
 }