/** * Behavior constructor * @param Backend\Classes\Controller $controller */ public function __construct($controller) { parent::__construct($controller); /* * Build configuration */ $this->config = $this->makeConfig($controller->importExportConfig, $this->requiredConfig); /* * Process config */ if ($exportFileName = $this->getConfig('export[fileName]')) { $this->exportFileName = $exportFileName; } /* * Import form widgets */ if ($this->importUploadFormWidget = $this->makeImportUploadFormWidget()) { $this->importUploadFormWidget->bindToController(); } if ($this->importOptionsFormWidget = $this->makeImportOptionsFormWidget()) { $this->importOptionsFormWidget->bindToController(); } /* * Export form widgets */ if ($this->exportFormatFormWidget = $this->makeExportFormatFormWidget()) { $this->exportFormatFormWidget->bindToController(); } if ($this->exportOptionsFormWidget = $this->makeExportOptionsFormWidget()) { $this->exportOptionsFormWidget->bindToController(); } }
/** * Behavior constructor * @param Backend\Classes\Controller $controller * @return void */ public function __construct($controller) { parent::__construct($controller); /* * Build configuration */ $this->config = $this->makeConfig($controller->formConfig, $this->requiredConfig); $this->config->modelClass = Str::normalizeClassName($this->config->modelClass); }
/** * Behavior constructor * @param Backend\Classes\Controller $controller * @return void */ public function __construct($controller) { parent::__construct($controller); /* * Extract list definitions */ if (is_array($controller->listConfig)) { $this->listDefinitions = $controller->listConfig; $this->primaryDefinition = key($this->listDefinitions); } else { $this->listDefinitions = ['list' => $controller->listConfig]; $this->primaryDefinition = 'list'; } /* * Build configuration */ $this->setConfig($this->listDefinitions[$this->primaryDefinition], $this->requiredConfig); }
/** * Behavior constructor * @param Backend\Classes\Controller $controller */ public function __construct($controller) { parent::__construct($controller); /* * Build configuration */ $this->config = $this->makeConfig($controller->reorderConfig, $this->requiredConfig); /* * Widgets */ if ($this->toolbarWidget = $this->makeToolbarWidget()) { $this->toolbarWidget->bindToController(); } /* * Populate from config */ $this->nameFrom = $this->getConfig('nameFrom', $this->nameFrom); }
/** * Behavior constructor * @param Backend\Classes\Controller $controller * @return void */ public function __construct($controller) { parent::__construct($controller); $this->addJs('js/october.relation.js', 'core'); $this->addCss('css/relation.css', 'core'); /* * Build configuration */ $this->config = $this->originalConfig = $this->makeConfig($controller->relationConfig, $this->requiredConfig); }
/** * Behavior constructor * * @param Controller $controller */ public function __construct($controller) { parent::__construct($controller); $this->controller = $controller; $this->setConfig($controller->listConfig, ['modelClass']); }