コード例 #1
0
 public function __construct($controller, $alias)
 {
     $this->alias = $alias;
     $this->theme = Theme::getEditTheme();
     parent::__construct($controller, []);
     $this->bindToController();
     $this->checkUploadPostback();
 }
コード例 #2
0
ファイル: PageList.php プロジェクト: rainlab/pages-plugin
 public function __construct($controller, $alias)
 {
     $this->alias = $alias;
     $this->theme = Theme::getEditTheme();
     $this->dataIdPrefix = 'page-' . $this->theme->getDirName();
     parent::__construct($controller, []);
     $this->bindToController();
 }
コード例 #3
0
ファイル: FormWidgetBase.php プロジェクト: GoldBest/october
 /**
  * Constructor
  * @param $controller Controller Active controller object.
  * @param $model Model The relevant model to reference.
  * @param $formField FormField Object containing general form field information.
  * @param $configuration array Configuration the relates to this widget.
  */
 public function __construct($controller, $formField, $configuration = [])
 {
     $this->formField = $formField;
     $this->fieldName = $formField->fieldName;
     $this->valueFrom = $formField->valueFrom;
     $this->config = $this->makeConfig($configuration);
     $this->fillFromConfig(['model', 'data', 'sessionKey', 'previewMode', 'showLabels']);
     parent::__construct($controller, $configuration);
 }
コード例 #4
0
ファイル: Search.php プロジェクト: tamboer/LaravelOctober
 /**
  * Constructor.
  */
 public function __construct($controller, $configuration = [])
 {
     parent::__construct($controller, $configuration);
     /*
      * Process configuration
      */
     if (isset($this->config->prompt)) {
         $this->placeholder = trans($this->config->prompt);
     }
     if (isset($this->config->partial)) {
         $this->customPartial = $this->config->partial;
     }
 }
コード例 #5
0
ファイル: ReportContainer.php プロジェクト: idxos/portfolio
 /**
  * Constructor.
  */
 public function __construct($controller)
 {
     $configFile = 'config_' . snake_case($this->alias) . '.yaml';
     $path = $controller->getConfigPath($configFile);
     if (File::isFile($path)) {
         $config = $this->makeConfig($configFile);
     } else {
         $config = [];
     }
     parent::__construct($controller, $config);
     $this->bindToController();
     $this->fillFromConfig();
 }
コード例 #6
0
 /**
  * Constructor
  * @param $controller Controller Active controller object.
  * @param $model Model The relevant model to reference.
  * @param $formField FormField Object containing general form field information.
  * @param $configuration array Configuration the relates to this widget.
  */
 public function __construct($controller, $model, $formField, $configuration = [])
 {
     $this->formField = $formField;
     $this->fieldName = $formField->fieldName;
     $this->valueFrom = $formField->valueFrom;
     $this->model = $model;
     if (isset($configuration->sessionKey)) {
         $this->sessionKey = $configuration->sessionKey;
     }
     if (isset($configuration->previewMode)) {
         $this->previewMode = $configuration->previewMode;
     }
     parent::__construct($controller, $configuration);
 }
コード例 #7
0
 public function __construct($controller)
 {
     parent::__construct($controller, []);
     $this->bindToController();
     $configFile = 'config_' . snake_case($this->alias) . '.yaml';
     $path = $controller->getConfigPath($configFile);
     if (File::isFile($path)) {
         $config = $this->makeConfig($configFile);
         foreach ($config as $field => $value) {
             if (property_exists($this, $field)) {
                 $this->{$field} = $value;
             }
         }
     }
 }
コード例 #8
0
ファイル: Toolbar.php プロジェクト: 360weboy/october
 /**
  * Constructor.
  */
 public function __construct($controller, $configuration = [])
 {
     parent::__construct($controller, $configuration);
     /*
      * Prepare the search widget (optional)
      */
     if (isset($this->config->search)) {
         if (is_string($this->config->search)) {
             $searchConfig = $this->makeConfig(['partial' => $this->config->search]);
         } else {
             $searchConfig = $this->makeConfig($this->config->search);
         }
         $searchConfig->alias = $this->alias . 'Search';
         $this->searchWidget = $this->makeWidget('Backend\\Widgets\\Search', $searchConfig);
         $this->searchWidget->bindToController();
     }
 }
コード例 #9
0
 /**
  * Constructor.
  */
 public function __construct($controller, $configuration = null)
 {
     if (!$configuration) {
         $configuration = 'config_report_container.yaml';
     }
     if (!is_array($configuration)) {
         $path = $controller->getConfigPath($configuration);
         if (File::isFile($path)) {
             $configuration = $this->makeConfig($path);
         } else {
             $configuration = [];
         }
     }
     parent::__construct($controller, $configuration);
     $this->bindToController();
     $this->fillFromConfig();
 }
コード例 #10
0
ファイル: TemplateList.php プロジェクト: nnmer/october
 public function __construct($controller, $alias, callable $dataSource)
 {
     $this->alias = $alias;
     $this->dataSource = $dataSource;
     $this->theme = Theme::getEditTheme();
     parent::__construct($controller, []);
     if (!Request::isXmlHttpRequest()) {
         $this->resetSelection();
     }
     $configFile = 'config_' . snake_case($alias) . '.yaml';
     $config = $this->makeConfig($configFile);
     foreach ($config as $field => $value) {
         if (property_exists($this, $field)) {
             $this->{$field} = $value;
         }
     }
     $this->bindToController();
 }
コード例 #11
0
ファイル: FormWidgetBase.php プロジェクト: coderkid/october
 /**
  * Constructor
  * @param $controller Controller Active controller object.
  * @param $model Model The relevant model to reference.
  * @param $formField FormField Object containing general form field information.
  * @param $configuration array Configuration the relates to this widget.
  */
 public function __construct($controller, $model, $formField, $configuration = [])
 {
     $this->formField = $formField;
     $this->columnName = $formField->columnName;
     $this->model = $model;
     if (isset($configuration->sessionKey)) {
         $this->sessionKey = $configuration->sessionKey;
     }
     if (isset($configuration->previewMode)) {
         $this->previewMode = $configuration->previewMode;
     }
     /*
      * Form fields originally passed their configuration via the options index.
      * This step should be removed if year >= 2015.
      */
     if (isset($configuration->options)) {
         $configuration = array_merge($configuration->options, (array) $configuration);
     }
     parent::__construct($controller, $configuration);
 }
コード例 #12
0
ファイル: Search.php プロジェクト: nnmer/october
 /**
  * Constructor.
  */
 public function __construct($controller, $configuration = [])
 {
     parent::__construct($controller, $configuration);
     /*
      * Process configuration
      */
     if (isset($this->config->prompt)) {
         $this->placeholder = trans($this->config->prompt);
     }
     if (isset($this->config->partial)) {
         $this->customPartial = $this->config->partial;
     }
     if (isset($this->config->growable)) {
         $this->growable = $this->config->growable;
     }
     /*
      * Add CSS class styles
      */
     $this->cssClasses[] = 'icon search';
     if ($this->growable) {
         $this->cssClasses[] = 'growable';
     }
 }
コード例 #13
0
 public function __construct($controller, $alias)
 {
     $this->alias = $alias;
     parent::__construct($controller, []);
     $this->bindToController();
 }
コード例 #14
0
ファイル: MediaManager.php プロジェクト: GoldBest/october
 public function __construct($controller, $alias)
 {
     $this->alias = $alias;
     parent::__construct($controller, []);
     $this->checkUploadPostback();
 }