(NFC) (dev/core#878) Simplify copyright header (templates/*)
[civicrm-core.git] / CRM / Contact / Page / View / Tag.php
CommitLineData
6a488035
TO
1<?php
2/*
3 +--------------------------------------------------------------------+
fee14197 4 | CiviCRM version 5 |
6a488035 5 +--------------------------------------------------------------------+
f299f7db 6 | Copyright CiviCRM LLC (c) 2004-2020 |
6a488035
TO
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13 | |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
18 | |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
d25dd0ee 26 */
6a488035
TO
27
28/**
29 *
30 * @package CRM
ca5cec67 31 * @copyright CiviCRM LLC https://civicrm.org/licensing
6a488035
TO
32 */
33class CRM_Contact_Page_View_Tag extends CRM_Core_Page {
34
35 /**
95cdcc0f 36 * Called when action is browse.
6a488035 37 */
00be9182 38 public function browse() {
6a488035
TO
39 $controller = new CRM_Core_Controller_Simple('CRM_Tag_Form_Tag', ts('Contact Tags'), $this->_action);
40 $controller->setEmbedded(TRUE);
41
42 // set the userContext stack
43 $session = CRM_Core_Session::singleton();
44
45 $session->pushUserContext(CRM_Utils_System::url('civicrm/contact/view', 'action=browse&selectedChild=tag'), FALSE);
46 $controller->reset();
47 $controller->set('contactId', $this->_contactId);
48 $controller->process();
49 $controller->run();
50 }
51
00be9182 52 public function preProcess() {
6a488035
TO
53 $this->_contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $this, TRUE);
54 $this->assign('contactId', $this->_contactId);
55
56 // check logged in url permission
57 CRM_Contact_Page_View::checkUserPermission($this);
58
59 $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse');
60 $this->assign('action', $this->_action);
61 }
62
63 /**
dc195289 64 * the main function that is called when the page loads
6a488035
TO
65 * it decides the which action has to be taken for the page.
66 *
76e7a76c 67 * @return null
6a488035 68 */
00be9182 69 public function run() {
6a488035
TO
70 $this->preProcess();
71
72 $this->browse();
73
74 return parent::run();
75 }
96025800 76
6a488035 77}