Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
BaseJuiWidget.php
1 <?php
2 /**
3  *
4  */
5 class BaseJuiWidget extends CJuiWidget
6 {
7 
8  /**
9  * Overridden function for using widget views from custom section
10  *
11  * @param string $viewName view name
12  *
13  * @return mixed|string
14  */
15  public function getViewFile($viewName)
16  {
17  $viewFile = parent::getViewFile($viewName);
18  if (isset(Yii::app()->params['customViews']) && Yii::app()->params['customViews'] == true) {
19  $customSection = realpath(Yii::getPathOfAlias('site.custom'));
20  $commonSection = realpath(Yii::getPathOfAlias('site.common'));
21  $frontendSection = realpath(Yii::getPathOfAlias('site.frontend'));
22  $customView = str_replace(array($commonSection, $frontendSection), $customSection, $viewFile);
23  if (file_exists($customView)) {
24  return $customView;
25  }
26  }
27  return $viewFile;
28  }
29 }