本文整理汇总了PHP中ZurmoConfigurationUtil::getByUserAndModuleName方法的典型用法代码示例。如果您正苦于以下问题:PHP ZurmoConfigurationUtil::getByUserAndModuleName方法的具体用法?PHP ZurmoConfigurationUtil::getByUserAndModuleName怎么用?PHP ZurmoConfigurationUtil::getByUserAndModuleName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZurmoConfigurationUtil
的用法示例。
在下文中一共展示了ZurmoConfigurationUtil::getByUserAndModuleName方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: resolveAndGetBackgroundTextureValue
public function resolveAndGetBackgroundTextureValue(User $user)
{
assert('$user instanceOf User && $user->id > 0');
if (null != ($themeColor = ZurmoConfigurationUtil::getByUserAndModuleName($user, 'ZurmoModule', 'backgroundTexture'))) {
return $themeColor;
} else {
return null;
}
}
示例2: getForCurrentUserByModuleName
/**
* For the current user, retrieve a configuration value by module name and key.
* @return configuration value of specified key
*/
public static function getForCurrentUserByModuleName($moduleName, $key)
{
assert('is_string($moduleName)');
assert('is_string($key)');
assert('Yii::app()->user->userModel == null || Yii::app()->user->userModel->id > 0');
if (!Yii::app()->user->userModel instanceof User) {
return null;
}
return ZurmoConfigurationUtil::getByUserAndModuleName(Yii::app()->user->userModel, $moduleName, $key);
}
示例3: getRecentlyViewedByUser
/**
* Given an user, get the recently viewed moduleClassName and modelId limited by count
* @param User $user
* @param integer $count
* @return array($moduleClassName, $modelId)
*/
protected static function getRecentlyViewedByUser(User $user, $count)
{
assert('is_int($count)');
$recentlyViewed = unserialize(ZurmoConfigurationUtil::getByUserAndModuleName($user, 'ZurmoModule', 'recentlyViewed'));
if (!is_array($recentlyViewed)) {
return array();
}
return array_slice($recentlyViewed, 0, $count);
}
示例4: resolveAndGetDefaultPermissionSetting
/**
* @param User $user
* @return configuration
*/
public static function resolveAndGetDefaultPermissionSetting(User $user)
{
assert('$user instanceOf User && $user->id > 0');
if (null != ($defaultPermission = ZurmoConfigurationUtil::getByUserAndModuleName($user, 'ZurmoModule', 'defaultPermissionSetting'))) {
return $defaultPermission;
} else {
return UserConfigurationForm::DEFAULT_PERMISSIONS_SETTING_EVERYONE;
}
}
示例5: getCustomVisibleAndOrderedTabMenuItemsByUser
/**
* @param $user
* @return array
*/
public static function getCustomVisibleAndOrderedTabMenuItemsByUser($user)
{
$tabMenuItems = array();
if (!null == ZurmoConfigurationUtil::getByUserAndModuleName($user, 'ZurmoModule', 'VisibleAndOrderedTabMenuItems')) {
$customOrderedTabMenuItems = unserialize(ZurmoConfigurationUtil::getByUserAndModuleName($user, 'ZurmoModule', 'VisibleAndOrderedTabMenuItems'));
foreach ($customOrderedTabMenuItems as $moduleId) {
$tabMenuItems[$moduleId] = "";
}
}
return $tabMenuItems;
}
示例6: getByUserAndType
/**
* Get the pagination value for the specified user by pagination type.
* @param $user - user model
* @param $type - pagination type
* @param $moduleName - optional. Module class name.
* @return $pageSize - integer.
*/
public function getByUserAndType($user, $type, $moduleName = null)
{
assert('$user instanceOf User && $user->id > 0');
assert('in_array($type, static::getAvailablePageSizeNames()) == true');
assert('$moduleName == null || is_string($moduleName)');
$keyName = $this->getKeyByTypeAndModuleName($type);
if (null != ($pageSize = ZurmoConfigurationUtil::getByUserAndModuleName($user, 'ZurmoModule', $keyName))) {
return $pageSize;
}
return $this->{'_' . $type};
}
示例7: getCalendarItemsDataProvider
/**
* Get calendar items data provider.
* @param User $user
* @return CalendarItemsDataProvider
*/
public static function getCalendarItemsDataProvider(User $user)
{
$mySavedCalendarIds = ZurmoConfigurationUtil::getByUserAndModuleName($user, 'CalendarsModule', 'myCalendarSelections');
$mySubscribedCalendarIds = ZurmoConfigurationUtil::getByUserAndModuleName($user, 'CalendarsModule', 'mySubscribedCalendarSelections');
$dateRangeType = ZurmoConfigurationUtil::getByUserAndModuleName($user, 'CalendarsModule', 'myCalendarDateRangeType');
$startDate = ZurmoConfigurationUtil::getByUserAndModuleName($user, 'CalendarsModule', 'myCalendarStartDate');
$endDate = ZurmoConfigurationUtil::getByUserAndModuleName($user, 'CalendarsModule', 'myCalendarEndDate');
return CalendarUtil::processUserCalendarsAndMakeDataProviderForCombinedView($mySavedCalendarIds, $mySubscribedCalendarIds, $dateRangeType, $startDate, $endDate);
}
示例8: resolveAndGetSelectedTheme
/**
* @return configuration|null
* if selected theme exists in database, return that, else return default theme
*/
protected function resolveAndGetSelectedTheme()
{
$user = Yii::app()->user->userModel;
$modelName = get_class($this->model);
$key = $this->getSelectedThemeKeyByModelName($modelName);
if (null != ($theme = ZurmoConfigurationUtil::getByUserAndModuleName($user, 'ZurmoModule', $key))) {
$this->selectedTheme = $theme;
} else {
$this->selectedTheme = $this->getDefaultTheme();
}
return $this->selectedTheme;
}
示例9: resolveAndGetValue
public static function resolveAndGetValue(User $user, $key, $returnBoolean = true)
{
assert('$user instanceOf User && $user->id > 0');
assert('is_string($key)');
assert('is_bool($returnBoolean)');
$value = ZurmoConfigurationUtil::getByUserAndModuleName($user, 'ZurmoModule', $key);
return $returnBoolean ? (bool) $value : $value;
}