10 define(
'CH_WSB_PG_DEFAULT',
'1');
11 define(
'CH_WSB_PG_NOBODY',
'2');
12 define(
'CH_WSB_PG_ALL',
'3');
13 define(
'CH_WSB_PG_MEMBERS',
'4');
14 define(
'CH_WSB_PG_FRIENDS',
'5');
15 define(
'CH_WSB_PG_FAVES',
'6');
16 define(
'CH_WSB_PG_CONTACTS',
'7');
17 define(
'CH_WSB_PG_HIDDEN',
'8');
66 function __construct($sTable =
'', $sFieldId =
'', $sFieldOwnerId =
'')
83 if(
empty($sActionName))
86 $sValue = $this->_oDb->getDefaultValue($iOwnerId, $sModuleUri, $sActionName);
89 $sValue = $this->_oDb->getDefaultValueModule($sModuleUri, $sActionName);
92 $aGroups = $this->_oDb->getGroupsBy(array(
'type' =>
'owner',
'owner_id' => $iOwnerId,
'full' =>
true));
93 foreach($aGroups
as $aGroup) {
94 if((
int)$aGroup[
'owner_id'] == 0 && $this->_oDb->getParam(
'sys_ps_enabled_group_' . $aGroup[
'id']) !=
'on')
97 $aValues[] = array(
'key' => $aGroup[
'id'],
'value' => ((
int)$aGroup[
'owner_id'] == 0 ?
_t(
'_ps_group_' . $aGroup[
'id'] .
'_title') : $aGroup[
'title']));
99 $aValues = array_merge($aValues, $aDynamicGroups);
102 $sCaption = $this->_oDb->getFieldActionTitle($sModuleUri, $sActionName);
108 'values' => $aValues,
111 'error' =>
_t(
'_ps_ferr_incorrect_select')
129 if(
empty($iViewerId))
133 if(
empty($aObject) || !is_array($aObject))
139 if(
isAdmin() || $iViewerId == $aObject[
'owner_id'])
142 if($this->_oDb->isGroupMember($aObject[
'group_id'], $aObject[
'owner_id'], $iViewerId))
145 return $this->
isDynamicGroupMember($aObject[
'group_id'], $aObject[
'owner_id'], $iViewerId, $iObjectId);
156 return 'allow_' . strtolower(str_replace(
' ',
'-',
$sAction)) .
'_to';
178 return getParam(
'sys_ps_enable_create_group') ==
'on' ||
getParam(
'sys_ps_enable_default_values') ==
'on' ||
getParam(
'sys_ps_enabled_group_1') ==
'on';