_id; } /** * Get the context we are working in * * @return string */ public function getContext() { return $this->_context; } /** * Get the contact ID * * @return int */ public function getContactId() { return $this->_contactID; } /** * Set the contact ID * * @param $contactId */ public function setContactId($contactId) { $this->_contactID = $contactId; $this->_contactId = $contactId; } public function getAction() { return $this->_action; } /** * Explicitly declare the form context. * * @return string|null */ public function getDefaultContext() { return NULL; } /** * @return string */ protected function getDefaultAction() { return 'browse'; } public function preProcessQuickEntityPage() { $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, $this->getDefaultAction()); $this->assign('action', $this->getAction()); $this->_id = CRM_Utils_Request::retrieve('id', 'Positive', $this); $this->setContactId(CRM_Utils_Request::retrieve('cid', 'Positive', $this, FALSE, CRM_Core_Session::getLoggedInContactID())); $this->assign('contactId', $this->getContactId()); $this->_context = CRM_Utils_Request::retrieve('context', 'Alphanumeric', $this, FALSE, $this->getDefaultContext()); $this->assign('context', $this->_context); // check logged in url permission CRM_Contact_Page_View::checkUserPermission($this); $this->assign('entityInClassFormat', strtolower(str_replace('_', '-', $this->getDefaultEntity()))); } /** * Is the form being used in the context of a deletion. * * (For some reason rather than having separate forms Civi overloads one form). * * @return bool */ protected function isDeleteContext() { return ($this->getAction() & CRM_Core_Action::DELETE); } /** * Is the form being used in the context of a view. * * @return bool */ protected function isViewContext() { return ($this->getAction() & CRM_Core_Action::VIEW); } /** * Is the form being used in the context of a edit. * * @return bool */ protected function isEditContext() { return ($this->getAction() & (CRM_Core_Action::UPDATE | CRM_Core_Action::ADD)); } }