|
@@ -397,6 +397,25 @@ class BxDolPrivacy extends BxDolFactory implements iBxDolFactoryObject
|
|
|
return $this->_oDb->getGroupCustom($aParams);
|
|
return $this->_oDb->getGroupCustom($aParams);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Checks if this privacy object allows to add content in specified context.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param type $sContext - context module name
|
|
|
|
|
+ * @return boolean
|
|
|
|
|
+ */
|
|
|
|
|
+ public function isAllowedAddInContext($sContext)
|
|
|
|
|
+ {
|
|
|
|
|
+ $bSpaces = !empty($this->_aObject['spaces']);
|
|
|
|
|
+
|
|
|
|
|
+ if($bSpaces && $this->_aObject['spaces'] == 'all')
|
|
|
|
|
+ return true;
|
|
|
|
|
+
|
|
|
|
|
+ if($bSpaces && in_array($sContext, explode(',', $this->_aObject['spaces'])))
|
|
|
|
|
+ return true;
|
|
|
|
|
+
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Note. Is used when privacy group is processing after the main form submit.
|
|
* Note. Is used when privacy group is processing after the main form submit.
|
|
|
*/
|
|
*/
|
|
@@ -587,7 +606,7 @@ class BxDolPrivacy extends BxDolFactory implements iBxDolFactoryObject
|
|
|
|
|
|
|
|
return $aValues;
|
|
return $aValues;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Get database field name for action.
|
|
* Get database field name for action.
|
|
|
*
|
|
*
|
|
@@ -597,12 +616,12 @@ class BxDolPrivacy extends BxDolFactory implements iBxDolFactoryObject
|
|
|
*/
|
|
*/
|
|
|
public static function getFieldName($sObject, $sAction = '')
|
|
public static function getFieldName($sObject, $sAction = '')
|
|
|
{
|
|
{
|
|
|
- $oPrivacy = BxDolPrivacy::getObjectInstance($sObject);
|
|
|
|
|
|
|
+ $oPrivacy = BxDolPrivacy::getObjectInstance($sObject);
|
|
|
if(empty($oPrivacy))
|
|
if(empty($oPrivacy))
|
|
|
return '';
|
|
return '';
|
|
|
|
|
|
|
|
- if(empty($sAction))
|
|
|
|
|
- $sAction = $oPrivacy->_aObject['action'];
|
|
|
|
|
|
|
+ if(empty($sAction))
|
|
|
|
|
+ $sAction = $oPrivacy->_aObject['action'];
|
|
|
|
|
|
|
|
return $oPrivacy->convertActionToField($sAction);
|
|
return $oPrivacy->convertActionToField($sAction);
|
|
|
}
|
|
}
|
|
@@ -842,9 +861,9 @@ class BxDolPrivacy extends BxDolFactory implements iBxDolFactoryObject
|
|
|
return $this->_oDb->getObjectInfo($sAction, $iObjectId);
|
|
return $this->_oDb->getObjectInfo($sAction, $iObjectId);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- protected function getPrivacyGroupsForContentPublic($iProfileIdOwner = 0, $aCustomGroups = array())
|
|
|
|
|
|
|
+ protected function getPrivacyGroupsForContentPublic($iProfileIdOwner = 0, $aCustomGroups = array())
|
|
|
{
|
|
{
|
|
|
- $aGroups = array(BX_DOL_PG_ALL);
|
|
|
|
|
|
|
+ $aGroups = array(BX_DOL_PG_ALL);
|
|
|
if(isLogged()) {
|
|
if(isLogged()) {
|
|
|
$iProfileIdLogged = bx_get_logged_profile_id();
|
|
$iProfileIdLogged = bx_get_logged_profile_id();
|
|
|
if($iProfileIdLogged == $iProfileIdOwner)
|
|
if($iProfileIdLogged == $iProfileIdOwner)
|