Exemple #1
0
 /**
  * Creates the object instance.
  * @param \Cms\Classes\Page $page Specifies the CMS page.
  * @param \Cms\Classes\Layout $layout Specifies the CMS layout.
  * @param \Cms\Classes\Controller $controller Specifies the CMS controller.
  */
 public function __construct($page, $layout, $controller)
 {
     $this->page = $page;
     $this->layout = $layout;
     $this->controller = $controller;
     parent::__construct();
 }
Exemple #2
0
 /**
  * Constructor
  * @param \Backend\Classes\Controller $controller
  * @param array $configuration Proactive configuration definition.
  */
 public function __construct($controller, $configuration = [])
 {
     $this->controller = $controller;
     $this->viewPath = $this->configPath = $this->guessViewPath('/partials');
     $this->assetPath = $this->guessViewPath('/assets', true);
     /*
      * Apply configuration values to a new config object, if a parent
      * consutrctor hasn't done it already.
      */
     if ($this->config === null) {
         $this->config = $this->makeConfig($configuration);
     }
     /*
      * If no alias is set by the configuration.
      */
     if (!isset($this->alias)) {
         $this->alias = isset($this->config->alias) ? $this->config->alias : $this->defaultAlias;
     }
     /*
      * Prepare assets used by this widget.
      */
     $this->loadAssets();
     parent::__construct();
     /*
      * Initialize the widget.
      */
     if (!$this->getConfig('noInit', false)) {
         $this->init();
     }
 }
 /**
  * Component constructor. Takes in the page or layout code section object
  * and properties set by the page or layout.
  */
 public function __construct(CodeBase $cmsObject = null, $properties = [])
 {
     if ($cmsObject !== null) {
         $this->controller = $cmsObject->controller;
         $this->page = $cmsObject;
     }
     $this->properties = $this->validateProperties($properties);
     $className = Str::normalizeClassName(get_called_class());
     $this->dirName = strtolower(str_replace('\\', '/', $className));
     $this->assetPath = Config::get('cms.pluginsPath', '/plugins') . dirname(dirname($this->dirName));
     parent::__construct();
 }
Exemple #4
0
 /**
  * Constructor.
  */
 public function __construct()
 {
     /*
      * Allow early access to route data.
      */
     $this->action = BackendController::$action;
     $this->params = BackendController::$params;
     /*
      * Apply $guarded methods to hidden actions
      */
     $this->hiddenActions = array_merge($this->hiddenActions, $this->guarded);
     /*
      * Define layout and view paths
      */
     $this->layout = $this->layout ?: 'default';
     $this->layoutPath = Skin::getActive()->getLayoutPaths();
     $this->viewPath = $this->configPath = $this->guessViewPath();
     /*
      * Add layout paths from the plugin / module context
      */
     $relativePath = dirname(dirname(strtolower(str_replace('\\', '/', get_called_class()))));
     $this->layoutPath[] = '~/modules/' . $relativePath . '/layouts';
     $this->layoutPath[] = '~/plugins/' . $relativePath . '/layouts';
     parent::__construct();
     /*
      * Media Manager widget is available on all back-end pages
      */
     $manager = new MediaManager($this, 'ocmediamanager');
     $manager->bindToController();
 }
Exemple #5
0
 /**
  * Constructor.
  */
 public function __construct()
 {
     /*
      * Allow early access to route data.
      */
     $this->action = BackendController::$action;
     $this->params = BackendController::$params;
     /*
      * Apply $guarded methods to hidden actions
      */
     $this->hiddenActions = array_merge($this->hiddenActions, $this->guarded);
     /*
      * Define layout and view paths
      */
     $this->layout = 'default';
     $this->layoutPath = Skin::getActive()->getLayoutPaths();
     // Option A: (@todo Determine which is faster by benchmark)
     // $relativePath = strtolower(str_replace('\\', '/', get_called_class()));
     // $this->viewPath = $this->configPath = ['modules/' . $relativePath, 'plugins/' . $relativePath];
     // Option B:
     $this->viewPath = $this->configPath = $this->guessViewPath();
     parent::__construct();
 }
Exemple #6
0
 /**
  * Creates an instance of the object and associates it with a CMS theme.
  * @param \Cms\Classes\Theme $theme Specifies the theme the object belongs to.
  */
 public function __construct(Theme $theme)
 {
     $this->theme = $theme;
     $this->allowedExtensions = self::getEditableExtensions();
     parent::__construct();
 }
Exemple #7
0
 /**
  * Create a new Halcyon model instance.
  *
  * @param  array  $attributes
  * @return void
  */
 public function __construct(array $attributes = [])
 {
     $this->bootIfNotBooted();
     $this->bootNicerEvents();
     parent::__construct();
     $this->syncOriginal();
     $this->fill($attributes);
 }
 /**
  * Creates an instance of the object and associates it with a CMS component.
  * @param \Cms\Classes\ComponentBase $component Specifies the component the object belongs to.
  */
 public function __construct(ComponentBase $component)
 {
     $this->component = $component;
     parent::__construct();
 }