當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ZurmoConfigurationUtil::getForCurrentUserByModuleName方法代碼示例

本文整理匯總了PHP中ZurmoConfigurationUtil::getForCurrentUserByModuleName方法的典型用法代碼示例。如果您正苦於以下問題:PHP ZurmoConfigurationUtil::getForCurrentUserByModuleName方法的具體用法?PHP ZurmoConfigurationUtil::getForCurrentUserByModuleName怎麽用?PHP ZurmoConfigurationUtil::getForCurrentUserByModuleName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ZurmoConfigurationUtil的用法示例。


在下文中一共展示了ZurmoConfigurationUtil::getForCurrentUserByModuleName方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getForCurrentUserByPortletIdAndKey

 /**
  * Get a persistent config value for current user against portletId and keyName.
  * @param $portletId integer Id of the portlet or string representation of the unique id of the portlet to get value against
  * @param $keyName string Name of the key that should be returned
  * @param bool $returnBoolean bool Force return value to be boolean (explicit type casting)
  * @return bool|null|string
  */
 public static function getForCurrentUserByPortletIdAndKey($portletId, $keyName, $returnBoolean = false)
 {
     assert('is_int($portletId) || is_string($portletId)');
     assert('is_string($keyName)');
     $moduleName = static::getModuleName();
     $keyName = static::resolveKeyNameByPortletId($portletId, $keyName);
     $value = ZurmoConfigurationUtil::getForCurrentUserByModuleName($moduleName, $keyName);
     if ($returnBoolean) {
         $value = (bool) $value;
     }
     return $value;
 }
開發者ID:youprofit,項目名稱:Zurmo,代碼行數:19,代碼來源:PortletPersistentConfigUtil.php

示例2: testGetAndSetByCurrentUserByModuleName

 public function testGetAndSetByCurrentUserByModuleName()
 {
     Yii::app()->user->userModel = User::getByUsername('super');
     $this->assertNull(ZurmoConfigurationUtil::getForCurrentUserByModuleName('ZurmoModule', 'aKey'));
     ZurmoConfigurationUtil::setForCurrentUserByModuleName('ZurmoModule', 'aKey', 'aValue');
     Yii::app()->user->userModel = User::getByUsername('billy');
     $this->assertNull(ZurmoConfigurationUtil::getForCurrentUserByModuleName('ZurmoModule', 'aKey'));
     ZurmoConfigurationUtil::setForCurrentUserByModuleName('ZurmoModule', 'aKey', 'bValue');
     Yii::app()->user->userModel = User::getByUsername('sally');
     $this->assertNull(ZurmoConfigurationUtil::getForCurrentUserByModuleName('ZurmoModule', 'aKey'));
     ZurmoConfigurationUtil::setForCurrentUserByModuleName('ZurmoModule', 'aKey', 'cValue');
     //now retrieve again.
     Yii::app()->user->userModel = User::getByUsername('super');
     $this->assertEquals('aValue', ZurmoConfigurationUtil::getForCurrentUserByModuleName('ZurmoModule', 'aKey'));
     Yii::app()->user->userModel = User::getByUsername('billy');
     $this->assertEquals('bValue', ZurmoConfigurationUtil::getForCurrentUserByModuleName('ZurmoModule', 'aKey'));
     Yii::app()->user->userModel = User::getByUsername('sally');
     $this->assertEquals('cValue', ZurmoConfigurationUtil::getForCurrentUserByModuleName('ZurmoModule', 'aKey'));
     //Test retrieving a generic value that is set globally on ZurmoModule. The value returned should be the
     //same for all users.
     $metadata = ZurmoModule::getMetadata();
     $this->assertTrue(!isset($metadata['global']['bKey']));
     $metadata['global']['bKey'] = 'GlobalValue';
     ZurmoModule::setMetadata($metadata);
     Yii::app()->user->userModel = User::getByUsername('super');
     $this->assertEquals('GlobalValue', ZurmoConfigurationUtil::getForCurrentUserByModuleName('ZurmoModule', 'bKey'));
     Yii::app()->user->userModel = User::getByUsername('billy');
     $this->assertEquals('GlobalValue', ZurmoConfigurationUtil::getForCurrentUserByModuleName('ZurmoModule', 'bKey'));
     Yii::app()->user->userModel = User::getByUsername('sally');
     $this->assertEquals('GlobalValue', ZurmoConfigurationUtil::getForCurrentUserByModuleName('ZurmoModule', 'bKey'));
     //Now change the bKey value, just for billy and retrieve again for all users. Only billy's bKey value
     //should be different.
     ZurmoConfigurationUtil::setByUserAndModuleName(User::getByUsername('billy'), 'ZurmoModule', 'bKey', 'BillyBKey');
     Yii::app()->user->userModel = User::getByUsername('super');
     $this->assertEquals('GlobalValue', ZurmoConfigurationUtil::getForCurrentUserByModuleName('ZurmoModule', 'bKey'));
     Yii::app()->user->userModel = User::getByUsername('billy');
     $this->assertEquals('BillyBKey', ZurmoConfigurationUtil::getForCurrentUserByModuleName('ZurmoModule', 'bKey'));
     Yii::app()->user->userModel = User::getByUsername('sally');
     $this->assertEquals('GlobalValue', ZurmoConfigurationUtil::getForCurrentUserByModuleName('ZurmoModule', 'bKey'));
 }
開發者ID:RamaKavanan,項目名稱:InitialVersion,代碼行數:40,代碼來源:ZurmoConfigurationUtilTest.php

示例3: isCurrentUsersTimeZoneConfirmed

 public function isCurrentUsersTimeZoneConfirmed()
 {
     $keyName = 'timeZoneConfirmed';
     if (false != ZurmoConfigurationUtil::getForCurrentUserByModuleName('UsersModule', $keyName)) {
         return true;
     }
     return false;
 }
開發者ID:sandeep1027,項目名稱:zurmo_,代碼行數:8,代碼來源:ZurmoTimeZoneHelper.php

示例4: deleteModelFromRecentlyViewed

 /**
  * @param $moduleName
  * @param RedBeanModel $model
  */
 public static function deleteModelFromRecentlyViewed($moduleName, RedBeanModel $model)
 {
     if (!isset($model) || !isset($moduleName)) {
         return;
     }
     $newItem = array($moduleName, $model->id, strval($model));
     $recentlyViewed = unserialize(ZurmoConfigurationUtil::getForCurrentUserByModuleName('ZurmoModule', 'recentlyViewed'));
     if (!is_array($recentlyViewed)) {
         return;
     }
     if (in_array($newItem, $recentlyViewed)) {
         $key = array_search($newItem, $recentlyViewed);
         unset($recentlyViewed[$key]);
         array_keys($recentlyViewed);
     }
     ZurmoConfigurationUtil::setForCurrentUserByModuleName('ZurmoModule', 'recentlyViewed', serialize($recentlyViewed));
 }
開發者ID:RamaKavanan,項目名稱:InitialVersion,代碼行數:21,代碼來源:AuditEventsRecentlyViewedUtil.php

示例5: testResolveNewRecentlyViewedModelAfterChangingName

 public function testResolveNewRecentlyViewedModelAfterChangingName()
 {
     Yii::app()->user->userModel = User::getByUsername('super');
     ZurmoConfigurationUtil::setForCurrentUserByModuleName('ZurmoModule', 'recentlyViewed', null);
     $account1 = new Account();
     $account1->name = 'For test recently viewed';
     $this->assertTrue($account1->save());
     AuditEventsRecentlyViewedUtil::resolveNewRecentlyViewedModel('AccountsModule', $account1, 2);
     $this->assertEquals(serialize(array(array('AccountsModule', $account1->id, strval($account1)))), ZurmoConfigurationUtil::getForCurrentUserByModuleName('ZurmoModule', 'recentlyViewed'));
     $account1->name = 'new name for same account';
     $this->assertTrue($account1->save());
     AuditEventsRecentlyViewedUtil::resolveNewRecentlyViewedModel('AccountsModule', $account1, 2);
     $this->assertEquals(serialize(array(array('AccountsModule', $account1->id, strval($account1)))), ZurmoConfigurationUtil::getForCurrentUserByModuleName('ZurmoModule', 'recentlyViewed'));
     AuditEventsRecentlyViewedUtil::resolveNewRecentlyViewedModel('ContactsModule', $account1, 2);
     $this->assertEquals(serialize(array(array('ContactsModule', $account1->id, strval($account1)), array('AccountsModule', $account1->id, strval($account1)))), ZurmoConfigurationUtil::getForCurrentUserByModuleName('ZurmoModule', 'recentlyViewed'));
 }
開發者ID:youprofit,項目名稱:Zurmo,代碼行數:16,代碼來源:AuditEventsRecentlyViewedUtilTest.php

示例6: getForCurrentUserByType

 /**
  * Get the pagination value for the current user by pagination type.
  * @param $type - pagination type
  * @param $moduleName - optional. Module class name.
  * @return $pageSize - integer.
  */
 public function getForCurrentUserByType($type, $moduleName = null)
 {
     assert('in_array($type, static::getAvailablePageSizeNames()) == true');
     assert('$moduleName == null || is_string($moduleName)');
     $keyName = $this->getKeyByTypeAndModuleName($type);
     if (null != ($pageSize = ZurmoConfigurationUtil::getForCurrentUserByModuleName('ZurmoModule', $keyName))) {
         return $pageSize;
     }
     return $this->{'_' . $type};
 }
開發者ID:RamaKavanan,項目名稱:InitialVersion,代碼行數:16,代碼來源:ZurmoPaginationHelper.php

示例7: actionToggleDismissIntroView

 public function actionToggleDismissIntroView($moduleName, $panelId)
 {
     $value = (bool) ZurmoConfigurationUtil::getForCurrentUserByModuleName($moduleName, $panelId);
     ZurmoConfigurationUtil::setForCurrentUserByModuleName($moduleName, $panelId, !$value);
 }
開發者ID:RamaKavanan,項目名稱:InitialVersion,代碼行數:5,代碼來源:DefaultController.php

示例8: isIntroViewDismissed

 public function isIntroViewDismissed()
 {
     if (ZurmoConfigurationUtil::getForCurrentUserByModuleName($this->moduleName, $this->getPanelId())) {
         return true;
     }
     return false;
 }
開發者ID:youprofit,項目名稱:Zurmo,代碼行數:7,代碼來源:IntroView.php

示例9: isMenuCollapsed

 public function isMenuCollapsed()
 {
     return (bool) ZurmoConfigurationUtil::getForCurrentUserByModuleName('ZurmoModule', static::TOGGLE_COLLAPSE_KEY);
 }
開發者ID:RamaKavanan,項目名稱:InitialVersion,代碼行數:4,代碼來源:UserInterface.php


注:本文中的ZurmoConfigurationUtil::getForCurrentUserByModuleName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。