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  /**
35  * Import dependent classes
36  *
37  * @return void
38  */
39  public function init()
40  {
41  // import the module-level components
42  $this->setImport(
43  array(
44  'navigation.components.*',
45  )
46  );
47  }
48 
49  /**
50  * Translates a message to the specified language.
51  *
52  * @param string $str message
53  * @param array $params params
54  * @param string $dic dictionary
55  *
56  * @return string
57  */
58  public static function t($str = '', $params = array(), $dic = 'Navigation')
59  {
60  return Yii::t("NavigationModule." . $dic, $str, $params);
61  }
62 
63 
64  /**
65  * Returns path to assets for current module
66  *
67  * @return string
68  */
69  public function getAssetsUrl()
70  {
71  if (!$this->_assetsUrl) {
72  $this->_assetsUrl = Yii::app()->assetManager->publish(Yii::getPathOfAlias('navigation.views.asset'), true);
73  }
74  return $this->_assetsUrl;
75  }
76 }