Ejemplo n.º 1
0
 /**
  * Initialize widget (set attributes)
  *
  * @param array $params Widget params
  *
  * @return void
  */
 public function setWidgetParams(array $params)
 {
     parent::setWidgetParams($params);
     if (!isset($params[static::PARAM_ICON_MAX_WIDTH]) && !isset($params[static::PARAM_ICON_MAX_HEIGHT]) && 0 == $this->getParam(static::PARAM_ICON_MAX_WIDTH) && 0 == $this->getParam(static::PARAM_ICON_MAX_HEIGHT)) {
         $key = \XLite\View\ItemsList\Product\Customer\ACustomer::WIDGET_TYPE_CENTER . '.' . \XLite\View\ItemsList\Product\Customer\ACustomer::DISPLAY_MODE_GRID;
         $sizes = \XLite\View\ItemsList\Product\Customer\ACustomer::getIconSizes();
         $size = isset($sizes[$key]) ? $sizes[$key] : $sizes['other'];
         $this->widgetParams[static::PARAM_ICON_MAX_WIDTH]->setValue($size[0]);
         $this->widgetParams[static::PARAM_ICON_MAX_HEIGHT]->setValue($size[1]);
     }
 }