/**
  * Initializes the widget.
  */
 public function init()
 {
     parent::init();
     if (empty($this->data) && $this->asDropDownList === true) {
         throw new \CException(Yii::t('wheels', '"data" attribute cannot be blank'));
     }
 }
Example #2
0
 /**
  * Renders the field if no selector has been provided
  */
 public function renderField()
 {
     if (null === $this->selector) {
         parent::renderField();
         $this->setLocaleSettings();
     }
 }
Example #3
0
 /**
  * Widget's initialization method
  * @throws \CException
  */
 public function init()
 {
     parent::init();
     if ($this->route === null) {
         throw new \CException(\Yii::t('wheels', '"route" attribute cannot be blank'));
     }
     $this->options['data-url'] = \CHtml::normalizeUrl($this->route);
 }
Example #4
0
 /**
  * Widget's init function
  */
 public function init()
 {
     parent::init();
     $this->options['style'] = ArrayHelper::getValue($this->options, 'style', '');
     $width = ArrayHelper::getValue($this->options, 'width', '100%');
     $height = ArrayHelper::remove($this->options, 'height', '450px');
     $this->options['style'] = "width:{$width};height:{$height};" . $this->options['style'];
 }
Example #5
0
 /**
  * Initializes the widget.
  */
 public function init()
 {
     parent::init();
     if (empty($this->theme)) {
         throw new \CException(\Yii::t('wheels', '"{attribute}" cannot be empty.', array('{attribute}' => 'theme')));
     }
     if (empty($this->mode)) {
         throw new \CException(\Yii::t('zii', '"{attribute}" cannot be empty.', array('{attribute}' => 'mode')));
     }
 }
 /**
  * Widget's initialization method
  * @throws \CException
  */
 public function init()
 {
     parent::init();
     if ($this->route === null) {
         throw new \CException(\Yii::t('wheels', '"route" attribute cannot be blank'));
     }
     if ($this->noScriptText === null) {
         $this->noScriptText = \Yii::t('wheels', "Please enable JavaScript to use file uploader.");
     }
     $this->clientOptions = ArrayHelper::merge(array('request' => array('endpoint' => \CHtml::normalizeUrl($this->route), 'inputName' => ArrayHelper::getValue($this->options, 'name')), 'validation' => $this->getValidator(), 'messages' => array('typeError' => \Yii::t('wheels', '{file} has an invalid extension. Valid extension(s): {extensions}.'), 'sizeError' => \Yii::t('wheels', '{file} is too large, maximum file size is {sizeLimit}.'), 'minSizeError' => \Yii::t('wheels', '{file} is too small, minimum file size is {minSizeLimit}.'), 'emptyError:' => \Yii::t('wheels', '{file} is empty, please select files again without it.'), 'noFilesError' => \Yii::t('wheels', 'No files to upload.'), 'onLeave' => \Yii::t('zii', 'The files are being uploaded, if you leave now the upload will be cancelled.'))), $this->clientOptions);
 }
Example #7
0
 /**
  * Initializes the widget.
  */
 public function init()
 {
     parent::init();
     $this->addCssClass($this->options, 'grd-white');
     $this->initOptions();
 }
 /**
  * Widget's initialization
  */
 public function init()
 {
     parent::init();
     $this->checkOptionAttribute($this->type, array('range', 'editRange', 'dateRange'), 'type');
     $this->checkOptionAttribute($this->inputType, array('text', 'number'), 'inputType');
     $this->checkOptionAttribute($this->valueLabels, array('shown', 'hidden'), 'valueLabels');
     $this->checkOptionAttribute($this->theme, array('iThing', 'classic'), 'theme');
     if ($this->wheelMode) {
         $this->checkOptionAttribute($this->wheelMode, array('zoom', 'scroll'), 'wheelMode');
     }
     $this->buildOptions();
 }
 /**
  * Widget's initialization method
  */
 public function init()
 {
     parent::init();
     $this->buildOptions();
 }