Пример #1
0
 /**
  * Return default options list
  *
  * @return array
  */
 protected function getDefaultOptions()
 {
     $list = \XLite\Module\XC\CanadaPost\Model\ProductsReturn::getAllowedStatuses();
     foreach ($list as $k => $v) {
         $list[$k] = static::t($v);
     }
     return $list;
 }
Пример #2
0
 /**
  * Get view value
  *
  * @param array $field Field
  *
  * @return mixed
  */
 protected function getViewValue(array $field)
 {
     $list = \XLite\Module\XC\CanadaPost\Model\ProductsReturn::getAllowedStatuses();
     $code = $field['widget']->getValue();
     return isset($list[$code]) ? static::t($list[$code]) : static::t(array_shift($list));
 }
Пример #3
0
 /**
  * Define widget parameters
  *
  * @return void
  */
 protected function defineWidgetParams()
 {
     parent::defineWidgetParams();
     $this->widgetParams += array(static::PARAM_STATUS => new \XLite\Model\WidgetParam\Set('Status', null, array_keys(\XLite\Module\XC\CanadaPost\Model\ProductsReturn::getAllowedStatuses())), static::PARAM_DATE_RANGE => new \XLite\Model\WidgetParam\String('Date range', ''), static::PARAM_SUBSTRING => new \XLite\Model\WidgetParam\String('Substring', ''));
 }