Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
fee14197 | 4 | | CiviCRM version 5 | |
6a488035 | 5 | +--------------------------------------------------------------------+ |
8c9251b3 | 6 | | Copyright CiviCRM LLC (c) 2004-2018 | |
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 | |
8c9251b3 | 31 | * @copyright CiviCRM LLC (c) 2004-2018 |
6a488035 TO |
32 | */ |
33 | ||
34 | /** | |
35 | * Page to display / edit the header / footer of a mailing | |
36 | * | |
37 | */ | |
38 | class CRM_Mailing_Page_Component extends CRM_Core_Page_Basic { | |
39 | ||
40 | /** | |
fe482240 | 41 | * The action links that we need to display for the browse screen. |
6a488035 TO |
42 | * |
43 | * @var array | |
6a488035 TO |
44 | */ |
45 | static $_links = NULL; | |
46 | ||
47 | /** | |
fe482240 | 48 | * Get BAO Name. |
6a488035 | 49 | * |
a6c01b45 CW |
50 | * @return string |
51 | * Classname of BAO. | |
6a488035 | 52 | */ |
00be9182 | 53 | public function getBAOName() { |
4825de4a | 54 | return 'CRM_Mailing_BAO_MailingComponent'; |
6a488035 TO |
55 | } |
56 | ||
57 | /** | |
fe482240 | 58 | * Get action Links. |
6a488035 | 59 | * |
a6c01b45 CW |
60 | * @return array |
61 | * (reference) of action links | |
6a488035 | 62 | */ |
00be9182 | 63 | public function &links() { |
6a488035 TO |
64 | if (!(self::$_links)) { |
65 | self::$_links = array( | |
66 | CRM_Core_Action::UPDATE => array( | |
67 | 'name' => ts('Edit'), | |
68 | 'url' => CRM_Utils_System::currentPath(), | |
69 | 'qs' => 'action=update&id=%%id%%', | |
70 | 'title' => ts('Edit Mailing Component'), | |
71 | ), | |
72 | CRM_Core_Action::DISABLE => array( | |
73 | 'name' => ts('Disable'), | |
4d17a233 | 74 | 'ref' => 'crm-enable-disable', |
6a488035 TO |
75 | 'title' => ts('Disable Mailing Component'), |
76 | ), | |
77 | CRM_Core_Action::ENABLE => array( | |
78 | 'name' => ts('Enable'), | |
4d17a233 | 79 | 'ref' => 'crm-enable-disable', |
6a488035 TO |
80 | 'title' => ts('Enable Mailing Component'), |
81 | ), | |
82 | ); | |
83 | } | |
84 | return self::$_links; | |
85 | } | |
86 | ||
87 | /** | |
fe482240 | 88 | * Get name of edit form. |
6a488035 | 89 | * |
a6c01b45 CW |
90 | * @return string |
91 | * Classname of edit form. | |
6a488035 | 92 | */ |
00be9182 | 93 | public function editForm() { |
6a488035 TO |
94 | return 'CRM_Mailing_Form_Component'; |
95 | } | |
96 | ||
97 | /** | |
fe482240 | 98 | * Get edit form name. |
6a488035 | 99 | * |
a6c01b45 CW |
100 | * @return string |
101 | * name of this page. | |
6a488035 | 102 | */ |
00be9182 | 103 | public function editName() { |
6a488035 TO |
104 | return 'Mailing Components'; |
105 | } | |
106 | ||
107 | /** | |
108 | * Get user context. | |
109 | * | |
dd244018 EM |
110 | * @param null $mode |
111 | * | |
a6c01b45 CW |
112 | * @return string |
113 | * user context. | |
6a488035 | 114 | */ |
00be9182 | 115 | public function userContext($mode = NULL) { |
6a488035 TO |
116 | return CRM_Utils_System::currentPath(); |
117 | } | |
118 | ||
e0ef6999 EM |
119 | /** |
120 | * @param null $args | |
121 | * @param null $pageArgs | |
122 | * @param null $sort | |
123 | */ | |
00be9182 | 124 | public function run($args = NULL, $pageArgs = NULL, $sort = NULL) { |
6a488035 TO |
125 | return parent::run($args, $pageArgs, "component_type, is_default desc, name"); |
126 | } | |
96025800 | 127 | |
6a488035 | 128 | } |