Exemplo n.º 1
0
 /**
  * Registers the needed assets
  */
 public function registerAssets()
 {
     if ($this->disabled) {
         return;
     }
     $view = $this->getView();
     if (!empty($this->_langFile)) {
         DateTimePickerAsset::register($view)->js[] = $this->_langFile;
     } else {
         DateTimePickerAsset::register($view);
     }
     $id = "jQuery('#" . $this->options['id'] . "')";
     if ($this->type == self::TYPE_INLINE) {
         $this->pluginOptions['linkField'] = $this->options['id'];
         if (!empty($this->pluginOptions['format'])) {
             $this->pluginOptions['linkFormat'] = $this->pluginOptions['format'];
         }
     }
     if ($this->type === self::TYPE_INPUT) {
         $this->registerPlugin('datetimepicker');
     } else {
         $this->registerPlugin('datetimepicker', "{$id}.parent()");
     }
 }
Exemplo n.º 2
0
 /**
  * Registers the needed assets
  */
 public function registerAssets()
 {
     if ($this->disabled) {
         return;
     }
     $view = $this->getView();
     if (!empty($this->_langFile)) {
         DateTimePickerAsset::register($view)->js[] = $this->_langFile;
     } else {
         DateTimePickerAsset::register($view);
     }
     if ($this->type == self::TYPE_INLINE) {
         $this->pluginOptions['linkField'] = $this->options['id'];
         if (!empty($this->pluginOptions['format'])) {
             $this->pluginOptions['linkFormat'] = $this->pluginOptions['format'];
         }
     }
     if ($this->type == self::TYPE_INPUT) {
         $this->registerPlugin($this->pluginName);
     } else {
         $this->registerPlugin($this->pluginName, 'jQuery("#' . $this->_container['id'] . '")');
     }
 }