Merge pull request #22255 from MegaphoneJon/membership-14-2021
[civicrm-core.git] / CRM / Admin / Page / Navigation.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 displaying list of location types.
20 */
21 class CRM_Admin_Page_Navigation 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_Core_BAO_Navigation';
38 }
39
40 /**
41 * Get action Links.
42 *
43 * @return array|NULL
44 * (reference) of action links
45 */
46 public function &links() {
47 return NULL;
48 }
49
50 /**
51 * Get name of edit form.
52 *
53 * @return string
54 * Classname of edit form.
55 */
56 public function editForm() {
57 return 'CRM_Admin_Form_Navigation';
58 }
59
60 /**
61 * Get edit form name.
62 *
63 * @return string
64 * name of this page.
65 */
66 public function editName() {
67 return 'CiviCRM Navigation';
68 }
69
70 /**
71 * Get user context.
72 *
73 * @param null $mode
74 *
75 * @return string
76 * user context.
77 */
78 public function userContext($mode = NULL) {
79 return 'civicrm/admin/menu';
80 }
81
82 /**
83 * Browse all menus.
84 */
85 public function browse() {
86 // assign home id to the template
87 $homeMenuId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_Navigation', 'Home', 'id', 'name');
88 $this->assign('homeMenuId', $homeMenuId);
89
90 // Add jstree support
91 CRM_Core_Resources::singleton()
92 ->addScriptFile('civicrm', 'bower_components/jstree/dist/jstree.min.js', 0, 'html-header')
93 ->addStyleFile('civicrm', 'bower_components/jstree/dist/themes/default/style.min.css');
94 }
95
96 }