Merge in 5.48
[civicrm-core.git] / CRM / Contact / Page / View / Tag.php
CommitLineData
6a488035
TO
1<?php
2/*
3 +--------------------------------------------------------------------+
bc77d7c0 4 | Copyright CiviCRM LLC. All rights reserved. |
6a488035 5 | |
bc77d7c0
TO
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
6a488035 9 +--------------------------------------------------------------------+
d25dd0ee 10 */
6a488035
TO
11
12/**
13 *
14 * @package CRM
ca5cec67 15 * @copyright CiviCRM LLC https://civicrm.org/licensing
6a488035
TO
16 */
17class CRM_Contact_Page_View_Tag extends CRM_Core_Page {
18
19 /**
95cdcc0f 20 * Called when action is browse.
6a488035 21 */
00be9182 22 public function browse() {
6a488035
TO
23 $controller = new CRM_Core_Controller_Simple('CRM_Tag_Form_Tag', ts('Contact Tags'), $this->_action);
24 $controller->setEmbedded(TRUE);
25
26 // set the userContext stack
27 $session = CRM_Core_Session::singleton();
28
29 $session->pushUserContext(CRM_Utils_System::url('civicrm/contact/view', 'action=browse&selectedChild=tag'), FALSE);
30 $controller->reset();
31 $controller->set('contactId', $this->_contactId);
32 $controller->process();
33 $controller->run();
34 }
35
00be9182 36 public function preProcess() {
6a488035
TO
37 $this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE);
38 $this->assign('contactId', $this->_contactId);
39
40 // check logged in url permission
41 CRM_Contact_Page_View::checkUserPermission($this);
42
43 $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse');
44 $this->assign('action', $this->_action);
45 }
46
47 /**
dc195289 48 * the main function that is called when the page loads
6a488035
TO
49 * it decides the which action has to be taken for the page.
50 *
76e7a76c 51 * @return null
6a488035 52 */
00be9182 53 public function run() {
6a488035
TO
54 $this->preProcess();
55
56 $this->browse();
57
58 return parent::run();
59 }
96025800 60
6a488035 61}