AntonLV 7 лет назад
Родитель
Сommit
fd473ca247

+ 45 - 0
modules/base/profile/classes/BxBaseModProfilePrivacyContact.php

@@ -0,0 +1,45 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    BaseProfile Base classes for profile modules
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxBaseModProfilePrivacyContact extends BxTemplPrivacy
+{
+    protected $_sModule;
+    protected $_oModule;
+
+    public function __construct($aOptions, $oTemplate = false)
+    {
+        parent::__construct($aOptions, $oTemplate);
+
+        $this->_oModule = BxDolModule::getInstance($this->_sModule);
+    }
+
+    protected function getObjectInfo($sAction, $iObjectId)
+    {
+        $oProfile = BxDolProfile::getInstanceByContentAndType($iObjectId, $this->_sModule);
+        if(!$oProfile)
+            return false;
+
+        $a = $this->_oDb->getObjectInfo($sAction, $iObjectId);
+        $a['owner_id'] = $oProfile->id();
+
+        return $a;
+    }
+
+    protected function isSelectGroupCustom($aParams)
+    {
+        if($this->_oModule->serviceActAsProfile() && empty($aParams['content_id']))
+            return _t('_sys_ps_ferr_incorrect_gc_not_allowed');
+
+        return true;
+    }
+}
+
+/** @} */

+ 22 - 0
modules/boonex/organizations/classes/BxOrgsPrivacyContact.php

@@ -0,0 +1,22 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Organizations Organizations
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxOrgsPrivacyContact extends BxBaseModProfilePrivacyContact
+{
+    function __construct($aOptions, $oTemplate = false)
+    {
+    	$this->_sModule = 'bx_organizations';
+
+        parent::__construct($aOptions, $oTemplate);
+    }
+}
+
+/** @} */

+ 22 - 0
modules/boonex/persons/classes/BxPersonsPrivacyContact.php

@@ -0,0 +1,22 @@
+<?php defined('BX_DOL') or die('hack attempt');
+/**
+ * Copyright (c) UNA, Inc - https://una.io
+ * MIT License - https://opensource.org/licenses/MIT
+ *
+ * @defgroup    Persons Persons
+ * @ingroup     UnaModules
+ *
+ * @{
+ */
+
+class BxPersonsPrivacyContact extends BxBaseModProfilePrivacyContact
+{
+    function __construct($aOptions, $oTemplate = false)
+    {
+    	$this->_sModule = 'bx_persons';
+
+        parent::__construct($aOptions, $oTemplate);
+    }
+}
+
+/** @} */