コード例 #1
0
ファイル: DateTimePicker.php プロジェクト: RAPOS/baron-nt
 /**
  * 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()");
     }
 }
コード例 #2
0
ファイル: DateTimePicker.php プロジェクト: ICHydro/anaconda
 /**
  * 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'] . '")');
     }
 }