Merge pull request #15800 from eileenmcnaughton/anet_valid
[civicrm-core.git] / CRM / Badge / Page / Layout.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
5 | |
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 |
9 +--------------------------------------------------------------------+
10 */
11
12 /**
13 *
14 * @package CRM
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
16 */
17
18 /**
19 * Page for list page badges.
20 */
21 class CRM_Badge_Page_Layout extends CRM_Core_Page_Basic {
22
23 /**
24 * The action links that we need to display for the browse screen.
25 *
26 * @var array
27 */
28 public static $_links = NULL;
29
30 /**
31 * Get BAO Name.
32 *
33 * @return string
34 * Classname of BAO.
35 */
36 public function getBAOName() {
37 return 'CRM_Badge_BAO_Layout';
38 }
39
40 /**
41 * Get action Links.
42 *
43 * @return array
44 * (reference) of action links
45 */
46 public function &links() {
47 if (!(self::$_links)) {
48 self::$_links = [
49 CRM_Core_Action::UPDATE => [
50 'name' => ts('Edit'),
51 'url' => 'civicrm/admin/badgelayout',
52 'qs' => 'action=update&id=%%id%%&reset=1',
53 'title' => ts('Edit Badge Layout'),
54 ],
55 CRM_Core_Action::DISABLE => [
56 'name' => ts('Disable'),
57 'ref' => 'crm-enable-disable',
58 'title' => ts('Disable Badge Layout'),
59 ],
60 CRM_Core_Action::ENABLE => [
61 'name' => ts('Enable'),
62 'ref' => 'crm-enable-disable',
63 'title' => ts('Enable Badge Layout'),
64 ],
65 CRM_Core_Action::DELETE => [
66 'name' => ts('Delete'),
67 'url' => 'civicrm/admin/badgelayout',
68 'qs' => 'action=delete&id=%%id%%',
69 'title' => ts('Delete Badge Layout'),
70 ],
71 ];
72 }
73 return self::$_links;
74 }
75
76 /**
77 * Get name of edit form.
78 *
79 * @return string
80 * Classname of edit form.
81 */
82 public function editForm() {
83 return 'CRM_Badge_Form_Layout';
84 }
85
86 /**
87 * Get edit form name.
88 *
89 * @return string
90 * name of this page.
91 */
92 public function editName() {
93 return 'Badge Layout';
94 }
95
96 /**
97 * Get user context.
98 *
99 * @param null $mode
100 *
101 * @return string
102 * user context.
103 */
104 public function userContext($mode = NULL) {
105 return 'civicrm/admin/badgelayout';
106 }
107
108 }