예제 #1
0
 /**
  * getCommonAttributes
  *
  * @return array
  */
 protected function getCommonAttributes()
 {
     $list = parent::getCommonAttributes();
     if ($this->getParam(static::PARAM_PLACEHOLDER)) {
         $list['placeholder'] = $this->getParam(static::PARAM_PLACEHOLDER);
     }
     return array_merge($list, array('type' => $this->getFieldType(), 'value' => $this->getValue()));
 }
예제 #2
0
파일: ATextarea.php 프로젝트: kingsj/core
 /**
  * Define widget params
  *
  * @return void
  */
 protected function defineWidgetParams()
 {
     parent::defineWidgetParams();
     $this->widgetParams += array(static::PARAM_ROWS => new \XLite\Model\WidgetParam\Int('Rows', $this->getDefaultRows()), static::PARAM_COLS => new \XLite\Model\WidgetParam\Int('Cols', $this->getDefaultCols()));
 }
예제 #3
0
 /**
  * Define widget params
  *
  * @return void
  */
 protected function defineWidgetParams()
 {
     parent::defineWidgetParams();
     $this->widgetParams += array(self::PARAM_LIST_CLASS => new \XLite\Model\WidgetParam\String('List class', ''));
 }
예제 #4
0
파일: AModel.php 프로젝트: kewaunited/xcart
 /**
  * Define widget params
  *
  * @return void
  */
 protected function defineWidgetParams()
 {
     parent::defineWidgetParams();
     $this->widgetParams += array(static::PARAM_MIN_COUNT => new \XLite\Model\WidgetParam\Int('Minimum symbols count after which the search will be permitted', $this->getDefaultMinCount(), false), static::PARAM_EMPTY_PHRASE => new \XLite\Model\WidgetParam\String('Text for the empty list', $this->getDefaultEmptyPhrase(), false), static::PARAM_EMPTY_MODEL_DEFINITION => new \XLite\Model\WidgetParam\String('Text when no model is selected', $this->getDefaultEmptyModelDefinition(), false), static::PARAM_GETTER => new \XLite\Model\WidgetParam\String('URL which will be the getter of the search objects', $this->getDefaultGetter(), false), static::PARAM_PLACEHOLDER => new \XLite\Model\WidgetParam\String('Text for the placeholder', '', false), static::PARAM_IS_MODEL_REQUIRED => new \XLite\Model\WidgetParam\Bool('Flag if the model required to be selected', true, false));
 }
예제 #5
0
 /**
  * Get item class
  *
  * @param integer                          $index  Item index
  * @param integer                          $length Items list length
  * @param \XLite\View\FormField\AFormField $field  Current item
  *
  * @return string
  */
 protected function getItemClass($index, $length, \XLite\View\FormField\AFormField $field)
 {
     $data = $this->getCountryStateSelectorFields();
     foreach ($data as $countryField => $stateFields) {
         if ($stateFields[1] === $field->getName()) {
             $this->rowIndexDelta++;
         }
     }
     $index += $this->rowIndexDelta;
     $classes = parent::getItemClass($index, $length, $field);
     return $classes;
 }
예제 #6
0
파일: Image.php 프로젝트: kirkbauer2/kirkxc
 /**
  * Get default wrapper class
  *
  * @return string
  */
 protected function getDefaultWrapperClass()
 {
     return trim(parent::getDefaultWrapperClass() . ' image-selector');
 }
예제 #7
0
파일: ASeparator.php 프로젝트: kingsj/core
 /**
  * Return name of the folder with templates
  *
  * @return string
  */
 protected function getDir()
 {
     return parent::getDir() . '/separator';
 }
예제 #8
0
 /**
  * Register files from common repository
  *
  * @return array
  */
 public function getCommonFiles()
 {
     $list = parent::getCommonFiles();
     $list[static::RESOURCE_JS][] = 'js/jquery.blockUI.js';
     return $list;
 }
예제 #9
0
 /**
  * Define widget params
  *
  * @return void
  */
 protected function defineWidgetParams()
 {
     parent::defineWidgetParams();
     $this->widgetParams += array(self::PARAM_OPTIONS => new \XLite\Model\WidgetParam\Collection('Options', $this->getDefaultOptions(), false), self::PARAM_LABEL_FROM => new \XLite\Model\WidgetParam\String('Label FROM', $this->getDefaultLabelFrom(), false), self::PARAM_LABEL_TO => new \XLite\Model\WidgetParam\String('Label TO', $this->getDefaultLabelTo(), false));
 }
예제 #10
0
 /**
  * Get value container class
  *
  * @return string
  */
 protected function getValueContainerClass()
 {
     return parent::getValueContainerClass() . $this->getCommonClass();
 }
예제 #11
0
 /**
  * getCommonAttributes
  *
  * @return array
  */
 protected function getCommonAttributes()
 {
     $list = parent::getCommonAttributes();
     if ($this->getParam(static::PARAM_MULTIPLE)) {
         $list['multiple'] = $this->getParam(static::PARAM_MULTIPLE);
     }
     $list['max_width'] = $this->getParam(static::PARAM_MAX_WIDTH);
     $list['max_height'] = $this->getParam(static::PARAM_MAX_HEIGHT);
     return $list;
 }
예제 #12
0
파일: AInput.php 프로젝트: kingsj/core
 /**
  * getCommonAttributes
  *
  * @return array
  */
 protected function getCommonAttributes()
 {
     return parent::getCommonAttributes() + array('type' => $this->getFieldType(), 'value' => $this->getValue());
 }
예제 #13
0
 /**
  * getDefaultValue
  *
  * @return string
  */
 protected function getDefaultValue()
 {
     $value = parent::getDefaultValue();
     if (is_object($value) && $value instanceof \XLite\Model\AEntity) {
         $value = $value->getUniqueIdentifier();
     }
     return $value;
 }
예제 #14
0
 /**
  * Define widget params
  *
  * @return void
  */
 protected function defineWidgetParams()
 {
     parent::defineWidgetParams();
     $this->widgetParams += array(static::PARAM_UNESCAPE => new \XLite\Model\WidgetParam\Bool('Un-escape value', false));
 }
예제 #15
0
파일: ASelect.php 프로젝트: kingsj/core
 /**
  * Define widget params
  *
  * @return void
  */
 protected function defineWidgetParams()
 {
     parent::defineWidgetParams();
     $this->widgetParams += array(self::PARAM_OPTIONS => new \XLite\Model\WidgetParam\Collection('Options', $this->getDefaultOptions(), false));
 }
예제 #16
0
 /**
  * Check dependency
  *
  * @param \XLite\View\FormField\AFormField $field Field
  *
  * @return boolean
  */
 protected function checkDependency($field)
 {
     $dependency = $field->getParam(\XLite\View\FormField\AFormField::PARAM_DEPENDENCY);
     $result = true;
     foreach ($dependency as $depType => $dependencies) {
         foreach ($dependencies as $depField => $depValue) {
             if (static::DEPENDENCY_SHOW == $depType) {
                 if ($this->checkRequestHasExpectedValue($depField, $depValue)) {
                     if (false !== $result) {
                         $result = true;
                     }
                 } else {
                     $result = false;
                 }
             } else {
                 if ($this->checkRequestHasExpectedValue($depField, $depValue)) {
                     $result = false;
                 } else {
                     if (false !== $result) {
                         $result = true;
                     }
                 }
             }
         }
     }
     return $result;
 }
예제 #17
0
파일: AModel.php 프로젝트: kingsj/core
 /**
  * Get item class
  *
  * @param integer                          $index  Item index
  * @param integer                          $length items list length
  * @param \XLite\View\FormField\AFormField $field  Current item
  *
  * @return string
  */
 protected function getItemClass($index, $length, \XLite\View\FormField\AFormField $field)
 {
     $classes = preg_grep('/.+/Ss', array_map('trim', explode(' ', $field->getWrapperClass())));
     if (0 === $index % 2) {
         $classes[] = 'even';
     }
     if (1 === $index) {
         $classes[] = 'first';
     }
     if ($length == $index) {
         $classes[] = 'last';
     }
     return implode(' ', $classes);
 }