Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
FriendsModule.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  * This module manage by friends functionality.
11  */
12 class FriendsModule extends CWebModule
13 {
14  public $hashSalt = '012rj';
15 
16  public $notificationsEmail;
17 
18  private $_assetsUrl;
19 
20 
21  public function init()
22  {
23  parent::init();
24 
25  $this->setImport(array(
26  'friends.models.*'
27  ));
28  }
29 
30  /**
31  * Publish module assets and return url
32  *
33  * @return string
34  */
35  public function getAssetsUrl()
36  {
37  if (!$this->_assetsUrl) {
38  $this->_assetsUrl = Yii::app()->assetManager->publish(Yii::getPathOfAlias('friends.assets'), true);
39  }
40  return $this->_assetsUrl;
41  }
42 
43  /**
44  * Translates a message to the specified language.
45  *
46  * @param string $str message
47  * @param array $params params
48  * @param string $dic dictionary
49  *
50  * @return string
51  */
52  public static function t($str = '', $params = array(), $dic = 'core')
53  {
54  return Yii::t("FriendsModule." . $dic, $str, $params);
55  }
56 
57  /**
58  * Encrypt string
59  *
60  * @param string $string string
61  *
62  * @return string
63  */
64  public static function encrypting($string = "")
65  {
66  return md5($string . Yii::app()->getModule('friends')->hashSalt);
67  }
68 }