addButton(new CreateConfigurableOptionsBaseModalButton()); } /** * @return array * @throws \Exception */ public function getOptions() { /** * product id */ $productId = $this->getRequestValue('id'); /** * product manager */ $productManager = new ProductManager(); $productManager ->loadById($productId); /** * config options strategy */ $options = new ConfigOptionsType(); $options->setType($productManager->get(ProductParams::CLASS_OF_SERVICE_NAME)); $options->setProductId($productId); $options->load(); ; /** * config option model */ $configurableOptions = new \ThurData\Servers\KerioEmail\App\Services\ConfigurableOptions\ConfigurableOptions($productId); /** * build co to show */ ConfigurableOptionsBuilder::buildAll($configurableOptions, $options->getConfigurableOptions()); /** * */ $fields = $configurableOptions->show(); /** * * add additional elements, * resolve none full line issue (#156) */ $limit = count($fields) % 3; if($limit > 0) { while($limit < 3) { $fields['emptyFields'.$limit] = '-1'; $limit++; } } return $fields; } }