Merge pull request #19463 from colemanw/removeCampaignPseudoconstant
[civicrm-core.git] / CRM / Mailing / Page / Component.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 */
17
18/**
19 * Page to display / edit the header / footer of a mailing
20 *
21 */
22class CRM_Mailing_Page_Component extends CRM_Core_Page_Basic {
23
24 /**
fe482240 25 * The action links that we need to display for the browse screen.
6a488035
TO
26 *
27 * @var array
6a488035 28 */
7e8c8317 29 public static $_links = NULL;
6a488035
TO
30
31 /**
fe482240 32 * Get BAO Name.
6a488035 33 *
a6c01b45
CW
34 * @return string
35 * Classname of BAO.
6a488035 36 */
00be9182 37 public function getBAOName() {
4825de4a 38 return 'CRM_Mailing_BAO_MailingComponent';
6a488035
TO
39 }
40
41 /**
fe482240 42 * Get action Links.
6a488035 43 *
a6c01b45
CW
44 * @return array
45 * (reference) of action links
6a488035 46 */
00be9182 47 public function &links() {
6a488035 48 if (!(self::$_links)) {
be2fb01f
CW
49 self::$_links = [
50 CRM_Core_Action::UPDATE => [
6a488035
TO
51 'name' => ts('Edit'),
52 'url' => CRM_Utils_System::currentPath(),
53 'qs' => 'action=update&id=%%id%%',
54 'title' => ts('Edit Mailing Component'),
be2fb01f
CW
55 ],
56 CRM_Core_Action::DISABLE => [
6a488035 57 'name' => ts('Disable'),
4d17a233 58 'ref' => 'crm-enable-disable',
6a488035 59 'title' => ts('Disable Mailing Component'),
be2fb01f
CW
60 ],
61 CRM_Core_Action::ENABLE => [
6a488035 62 'name' => ts('Enable'),
4d17a233 63 'ref' => 'crm-enable-disable',
6a488035 64 'title' => ts('Enable Mailing Component'),
be2fb01f
CW
65 ],
66 ];
6a488035
TO
67 }
68 return self::$_links;
69 }
70
71 /**
fe482240 72 * Get name of edit form.
6a488035 73 *
a6c01b45
CW
74 * @return string
75 * Classname of edit form.
6a488035 76 */
00be9182 77 public function editForm() {
6a488035
TO
78 return 'CRM_Mailing_Form_Component';
79 }
80
81 /**
fe482240 82 * Get edit form name.
6a488035 83 *
a6c01b45
CW
84 * @return string
85 * name of this page.
6a488035 86 */
00be9182 87 public function editName() {
6a488035
TO
88 return 'Mailing Components';
89 }
90
91 /**
92 * Get user context.
93 *
dd244018
EM
94 * @param null $mode
95 *
a6c01b45
CW
96 * @return string
97 * user context.
6a488035 98 */
00be9182 99 public function userContext($mode = NULL) {
6a488035
TO
100 return CRM_Utils_System::currentPath();
101 }
102
e0ef6999
EM
103 /**
104 * @param null $args
105 * @param null $pageArgs
106 * @param null $sort
107 */
00be9182 108 public function run($args = NULL, $pageArgs = NULL, $sort = NULL) {
6a488035
TO
109 return parent::run($args, $pageArgs, "component_type, is_default desc, name");
110 }
96025800 111
6a488035 112}