Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
NavigationModule.php
1 <?php
2 /**
3  * Gentics Portal.Node PHP
4  * Author & Copyright (c) by Gentics Software GmbH
5  * sales@gentics.com
6  * http://www.gentics.com
7  * Licenses can be found in the LICENSE.txt file in the root-folder of this installation
8  * You must not use this software without a valid license agreement.
9  *
10  * Navigation module class file.
11  */
12 class NavigationModule extends CWebModule
13 {
14  /**
15  * @var int the number of seconds in which the cached value will expire. 0 means never expire.
16  */
17  public $cacheTime = 60;
18 
19  /**
20  * @var int the number of seconds in which the cached value will expire. 0 means never expire. Used for caching updatetimestamps
21  */
22  public $timestampCacheTime = 20;
23 
24  /**
25  * @var string path to module assets
26  */
27  private $_assetsUrl;
28 
29  /**
30  * @var array that contains list of URLs that should not be shown in navigation trees
31  */
32  public $excludeURLs = array();
33  /**
34  * @var string the default start page url
35  */
36  public $startpage_url = '';
37  /**
38  * @var string the default sort order
39  */
40  public $sortorder;
41  /**
42  * @var string the default branch name
43  */
44  public $branch_name;
45  /**
46  * @var string the default branch name
47  */
48  public $startpage_url_prefix;
49  /**
50  * @var string the default branch name
51  */
52  public $name_prefix;
53 
54  /**
55  * Import dependent classes
56  *
57  * @return void
58  */
59  public function init()
60  {
61  // import the module-level components
62  $this->setImport(
63  array(
64  'navigation.components.*',
65  )
66  );
67  }
68 
69  /**
70  * Translates a message to the specified language.
71  *
72  * @param string $str message
73  * @param array $params params
74  * @param string $dic dictionary
75  *
76  * @return string
77  */
78  public static function t($str = '', $params = array(), $dic = 'Navigation')
79  {
80  return Yii::t("NavigationModule." . $dic, $str, $params);
81  }
82 
83 
84  /**
85  * Returns path to assets for current module
86  *
87  * @return string
88  */
89  public function getAssetsUrl()
90  {
91  if (!$this->_assetsUrl) {
92  $this->_assetsUrl = Yii::app()->assetManager->publish(Yii::getPathOfAlias('navigation.views.asset'), true);
93  }
94  return $this->_assetsUrl;
95  }
96 }