Beispiel #1
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();
 }
 /**
  * Returns a URL in context of the active Backend skin
  */
 public function skinUrl($path = null)
 {
     $path = RouterHelper::normalizeUrl($path);
     $skinPath = Skin::getActive()->skinPath;
     return URL::to($skinPath . $path);
 }
Beispiel #3
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();
 }
Beispiel #4
0
 /**
  * Returns a URL in context of the active Backend skin
  */
 public function skinAsset($path = null)
 {
     $skinPath = Skin::getActive()->getPath($path, true);
     return Url::asset($skinPath);
 }