Merge pull request #16035 from demeritcowboy/ang-crmcasetype-list-boolean
[civicrm-core.git] / CRM / Contact / Page / Inline / Website.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
TO
9 +--------------------------------------------------------------------+
10 */
11
12/**
13 *
14 * @package CRM
ca5cec67 15 * @copyright CiviCRM LLC https://civicrm.org/licensing
6a488035
TO
16 */
17
18/**
95cdcc0f 19 * Dummy page for details of website.
6a488035
TO
20 */
21class CRM_Contact_Page_Inline_Website extends CRM_Core_Page {
22
23 /**
24 * Run the page.
25 *
26 * This method is called after the page is created.
f7ad2038 27 *
28 * @throws \CRM_Core_Exception
6a488035 29 */
00be9182 30 public function run() {
6a488035 31 // get the emails for this contact
f7ad2038 32 $contactId = CRM_Utils_Request::retrieveValue('cid', 'Positive');
6a488035 33
cbf48754 34 $websiteTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Website', 'website_type_id');
6a488035 35
be2fb01f 36 $params = ['contact_id' => $contactId];
db62d3a5 37 $websites = CRM_Core_BAO_Website::getValues($params);
6a488035
TO
38 if (!empty($websites)) {
39 foreach ($websites as $key => & $value) {
40 $value['website_type'] = $websiteTypes[$value['website_type_id']];
41 }
42 }
43
44 $this->assign('contactId', $contactId);
45 $this->assign('website', $websites);
46
47 // check logged in user permission
48 CRM_Contact_Page_View::checkUserPermission($this, $contactId);
8ef12e64 49
50 // finally call parent
6a488035
TO
51 parent::run();
52 }
96025800 53
6a488035 54}