本文整理汇总了PHP中CRM_Core_Page::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_Page::__construct方法的具体用法?PHP CRM_Core_Page::__construct怎么用?PHP CRM_Core_Page::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_Page
的用法示例。
在下文中一共展示了CRM_Core_Page::__construct方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
function __construct()
{
parent::__construct();
$check = CRM_Core_Permission::check('access Contact Dashboard');
if (!$check) {
CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/dashboard', 'reset=1'));
break;
}
$this->_contactId = CRM_Utils_Request::retrieve('id', 'Positive', $this);
$session =& CRM_Core_Session::singleton();
$userID = $session->get('userID');
if (!$this->_contactId) {
$this->_contactId = $userID;
} else {
if ($this->_contactId != $userID) {
require_once 'CRM/Contact/BAO/Contact/Permission.php';
if (!CRM_Contact_BAO_Contact_Permission::allow($this->_contactId, CRM_Core_Permission::VIEW)) {
CRM_Core_Error::fatal(ts('You do not have permission to view this contact'));
}
if (!CRM_Contact_BAO_Contact_Permission::allow($this->_contactId, CRM_Core_Permission::EDIT)) {
$this->_edit = false;
}
}
}
}
示例2: __construct
/**
* @param string $title
* Title of the page.
* @param int $mode
* Mode of the page.
* @param \CRM_Core_Resources|null $res
* Resource manager.
*/
public function __construct($title = NULL, $mode = NULL, $res = NULL)
{
parent::__construct($title, $mode);
$this->res = \CRM_Core_Resources::singleton();
$this->angular = \Civi\Core\Container::singleton()->get('angular');
$this->region = \CRM_Utils_Request::retrieve('snippet', 'String') ? 'ajax-snippet' : 'html-header';
}
示例3: elseif
/**
* @throws Exception
*/
function __construct()
{
parent::__construct();
$this->_contactId = CRM_Utils_Request::retrieve('id', 'Positive', $this);
$session = CRM_Core_Session::singleton();
$userID = $session->get('userID');
if (!$this->_contactId) {
$this->_contactId = $userID;
} elseif ($this->_contactId != $userID) {
if (!CRM_Contact_BAO_Contact_Permission::allow($this->_contactId, CRM_Core_Permission::VIEW)) {
CRM_Core_Error::fatal(ts('You do not have permission to view this contact'));
}
if (!CRM_Contact_BAO_Contact_Permission::allow($this->_contactId, CRM_Core_Permission::EDIT)) {
$this->_edit = FALSE;
}
}
}
示例4: __construct
/**
* Class constructor.
*
* @param string $title
* Title of the page.
* @param int $mode
* Mode of the page.
*
* @return \CRM_Core_Page_Basic
*/
public function __construct($title = NULL, $mode = NULL)
{
parent::__construct($title, $mode);
}
示例5: __construct
/**
* Class constructor.
*
* @param int $id
* The contact id.
* @param int $gid
* The group id.
*
* @param $restrict
* @param bool $skipPermission
* @param null $profileIds
*
* @return \CRM_Profile_Page_Dynamic
*/
public function __construct($id, $gid, $restrict, $skipPermission = FALSE, $profileIds = NULL)
{
parent::__construct();
$this->_id = $id;
$this->_gid = $gid;
$this->_restrict = $restrict;
$this->_skipPermission = $skipPermission;
if (!array_key_exists('multiRecord', $_GET)) {
$this->set('multiRecord', NULL);
}
if (!array_key_exists('recordId', $_GET)) {
$this->set('recordId', NULL);
}
if (!array_key_exists('allFields', $_GET)) {
$this->set('allFields', NULL);
}
//specifies the action being done on a multi record field
$multiRecordAction = CRM_Utils_Request::retrieve('multiRecord', 'String', $this);
$this->_multiRecord = !is_numeric($multiRecordAction) ? CRM_Core_Action::resolve($multiRecordAction) : $multiRecordAction;
if ($this->_multiRecord) {
$this->set('multiRecord', $this->_multiRecord);
}
if ($this->_multiRecord & CRM_Core_Action::VIEW) {
$this->_recordId = CRM_Utils_Request::retrieve('recordId', 'Positive', $this);
$this->_allFields = CRM_Utils_Request::retrieve('allFields', 'Integer', $this);
}
if ($profileIds) {
$this->_profileIds = $profileIds;
} else {
$this->_profileIds = array($gid);
}
$this->_activityId = CRM_Utils_Request::retrieve('aid', 'Positive', $this, FALSE, 0, 'GET');
if (is_numeric($this->_activityId)) {
$latestRevisionId = CRM_Activity_BAO_Activity::getLatestActivityId($this->_activityId);
if ($latestRevisionId) {
$this->_activityId = $latestRevisionId;
}
}
$this->_isContactActivityProfile = CRM_Core_BAO_UFField::checkContactActivityProfileType($this->_gid);
}
示例6: __construct
/**
* class constructor
*
* @return CRM_Contact_Page_View_CustomData
*/
public function __construct()
{
parent::__construct();
}
示例7:
/**
* class constructor
*
* @param int $id the contact id
* @param int $gid the group id
*
* @return void
* @access public
*/
function __construct($id, $gid, $restrict, $skipPermission = false)
{
$this->_id = $id;
$this->_gid = $gid;
$this->_restrict = $restrict;
$this->_skipPermission = $skipPermission;
parent::__construct();
}
示例8: array
/**
* class constructor
*
* @param int $id the contact id
* @param int $gid the group id
*
* @return void
* @access public
*/
function __construct($id, $gid, $restrict, $skipPermission = false, $profileIds = null)
{
$this->_id = $id;
$this->_gid = $gid;
$this->_restrict = $restrict;
$this->_skipPermission = $skipPermission;
if ($profileIds) {
$this->_profileIds = $profileIds;
} else {
$this->_profileIds = array($gid);
}
parent::__construct();
}
示例9:
/**
* class constructor
*
* @param string $title title of the page
* @param int $mode mode of the page
*
* @return CRM_Core_Page
*/
function __construct($title = null, $mode = null)
{
parent::__construct($title, $mode);
}
示例10: __construct
/**
* @param string $title
* Title of the page.
* @param int $mode
* Mode of the page.
* @param \CRM_Core_Resources|null $res
* Resource manager.
*/
public function __construct($title = NULL, $mode = NULL, $res = NULL)
{
parent::__construct($title, $mode);
$this->res = \CRM_Core_Resources::singleton();
$this->angular = \Civi\Core\Container::singleton()->get('angular');
}
示例11: array
/**
* class constructor
*
* @param int $id the contact id
* @param int $gid the group id
*
* @return void
* @access public
*/
function __construct($id, $gid, $restrict, $skipPermission = FALSE, $profileIds = NULL)
{
parent::__construct();
$this->_id = $id;
$this->_gid = $gid;
$this->_restrict = $restrict;
$this->_skipPermission = $skipPermission;
if ($profileIds) {
$this->_profileIds = $profileIds;
} else {
$this->_profileIds = array($gid);
}
$this->_activityId = CRM_Utils_Request::retrieve('aid', 'Positive', $this, FALSE, 0, 'GET');
if (is_numeric($this->_activityId)) {
$latestRevisionId = CRM_Activity_BAO_Activity::getLatestActivityId($this->_activityId);
if ($latestRevisionId) {
$this->_activityId = $latestRevisionId;
}
}
$this->_isContactActivityProfile = CRM_Core_BAO_UFField::checkContactActivityProfileType($this->_gid);
}