1 |
85ad3d82
|
Assos Assos
|
<?php
|
2 |
|
|
|
3 |
|
|
/**
|
4 |
|
|
* @file
|
5 |
|
|
* Display Suite UI.
|
6 |
|
|
*/
|
7 |
|
|
|
8 |
|
|
/**
|
9 |
|
|
* Implements hook_permission().
|
10 |
|
|
*/
|
11 |
|
|
function ds_ui_permission() {
|
12 |
|
|
return array(
|
13 |
|
|
'admin_view_modes' => array(
|
14 |
|
|
'title' => t('Administer view modes'),
|
15 |
|
|
'description' => t('Manage custom view modes for every entity.')
|
16 |
|
|
),
|
17 |
|
|
'admin_fields' => array(
|
18 |
|
|
'title' => t('Administer fields'),
|
19 |
|
|
'description' => t('Manage fields for every entity.')
|
20 |
|
|
),
|
21 |
|
|
'admin_classes' => array(
|
22 |
|
|
'title' => t('Administer classes'),
|
23 |
|
|
'description' => t('Manage classes.')
|
24 |
|
|
),
|
25 |
|
|
);
|
26 |
|
|
}
|
27 |
|
|
|
28 |
|
|
/**
|
29 |
|
|
* Implements hook_menu().
|
30 |
|
|
*/
|
31 |
|
|
function ds_ui_menu() {
|
32 |
|
|
$items = array();
|
33 |
|
|
|
34 |
|
|
// Custom CSS classes.
|
35 |
|
|
$items['admin/structure/ds/classes'] = array(
|
36 |
|
|
'title' => 'CSS classes',
|
37 |
|
|
'description' => 'Define extra CSS class names for regions and fields.',
|
38 |
|
|
'page callback' => 'drupal_get_form',
|
39 |
|
|
'page arguments' => array('ds_classes_form'),
|
40 |
|
|
'file' => 'includes/ds.classes.inc',
|
41 |
|
|
'access arguments' => array('admin_classes'),
|
42 |
|
|
'type' => MENU_LOCAL_TASK,
|
43 |
|
|
);
|
44 |
|
|
|
45 |
|
|
// View modes.
|
46 |
|
|
$items['admin/structure/ds/view_modes'] = array(
|
47 |
|
|
'title' => 'View modes',
|
48 |
|
|
'description' => 'Manage view modes for all content.',
|
49 |
|
|
'page callback' => 'ds_view_modes_list',
|
50 |
|
|
'file' => 'includes/ds.view_modes.inc',
|
51 |
|
|
'access arguments' => array('admin_view_modes'),
|
52 |
|
|
'weight' => -9,
|
53 |
|
|
'type' => MENU_LOCAL_TASK,
|
54 |
|
|
);
|
55 |
|
|
$items['admin/structure/ds/view_modes/manage'] = array(
|
56 |
|
|
'title' => 'Add a view mode',
|
57 |
|
|
'description' => 'Manage a view mode',
|
58 |
|
|
'page callback' => 'drupal_get_form',
|
59 |
|
|
'page arguments' => array('ds_edit_view_mode_form'),
|
60 |
|
|
'file' => 'includes/ds.view_modes.inc',
|
61 |
|
|
'access arguments' => array('admin_view_modes'),
|
62 |
|
|
'type' => MENU_LOCAL_ACTION,
|
63 |
|
|
);
|
64 |
|
|
$items['admin/structure/ds/view_modes/delete'] = array(
|
65 |
|
|
'title' => 'Delete a view mode',
|
66 |
|
|
'description' => 'Delete a custom view mode.',
|
67 |
|
|
'page callback' => 'drupal_get_form',
|
68 |
|
|
'page arguments' => array('ds_delete_view_mode_confirm'),
|
69 |
|
|
'file' => 'includes/ds.view_modes.inc',
|
70 |
|
|
'access arguments' => array('admin_view_modes'),
|
71 |
|
|
'type' => MENU_VISIBLE_IN_BREADCRUMB,
|
72 |
|
|
);
|
73 |
|
|
$items['admin/structure/ds/view_modes/revert'] = array(
|
74 |
|
|
'title' => 'Revert a view mode',
|
75 |
|
|
'description' => 'Revert a view mode.',
|
76 |
|
|
'page callback' => 'drupal_get_form',
|
77 |
|
|
'page arguments' => array('ds_revert_view_mode_confirm'),
|
78 |
|
|
'file' => 'includes/ds.view_modes.inc',
|
79 |
|
|
'access arguments' => array('admin_view_modes'),
|
80 |
|
|
'type' => MENU_VISIBLE_IN_BREADCRUMB,
|
81 |
|
|
);
|
82 |
|
|
|
83 |
|
|
// Fields.
|
84 |
|
|
$items['admin/structure/ds/fields'] = array(
|
85 |
|
|
'title' => 'Fields',
|
86 |
|
|
'description' => 'Manage fields for all content.',
|
87 |
|
|
'page callback' => 'ds_custom_fields_list',
|
88 |
|
|
'file' => 'includes/ds.fields.inc',
|
89 |
|
|
'access arguments' => array('admin_fields'),
|
90 |
|
|
'weight' => -8,
|
91 |
|
|
'type' => MENU_LOCAL_TASK,
|
92 |
|
|
);
|
93 |
|
|
$items['admin/structure/ds/fields/manage'] = array(
|
94 |
|
|
'title' => 'Fields edit',
|
95 |
|
|
'page callback' => 'ds_custom_manage',
|
96 |
|
|
'file' => 'includes/ds.fields.inc',
|
97 |
|
|
'access arguments' => array('admin_fields'),
|
98 |
|
|
'type' => MENU_CALLBACK,
|
99 |
|
|
);
|
100 |
|
|
$items['admin/structure/ds/fields/manage_custom'] = array(
|
101 |
|
|
'title' => 'Add a code field',
|
102 |
|
|
'description' => 'Manage a field',
|
103 |
|
|
'page callback' => 'drupal_get_form',
|
104 |
|
|
'page arguments' => array('ds_edit_custom_field_form'),
|
105 |
|
|
'file' => 'includes/ds.fields.inc',
|
106 |
|
|
'access arguments' => array('admin_fields'),
|
107 |
|
|
'type' => MENU_LOCAL_ACTION,
|
108 |
|
|
'weight' => 0,
|
109 |
|
|
);
|
110 |
|
|
$items['admin/structure/ds/fields/manage_ctools'] = array(
|
111 |
|
|
'title' => 'Add a dynamic field',
|
112 |
|
|
'description' => 'Manage a dynamic field',
|
113 |
|
|
'page callback' => 'drupal_get_form',
|
114 |
|
|
'page arguments' => array('ds_edit_ctools_field_form'),
|
115 |
|
|
'file' => 'includes/ds.fields.inc',
|
116 |
|
|
'access arguments' => array('admin_fields'),
|
117 |
|
|
'type' => MENU_LOCAL_ACTION,
|
118 |
|
|
'weight' => 1,
|
119 |
|
|
);
|
120 |
|
|
$items['admin/structure/ds/fields/manage_preprocess'] = array(
|
121 |
|
|
'title' => 'Add a preprocess field',
|
122 |
|
|
'description' => 'Manage a preprocess field',
|
123 |
|
|
'page callback' => 'drupal_get_form',
|
124 |
|
|
'page arguments' => array('ds_edit_preprocess_field_form'),
|
125 |
|
|
'file' => 'includes/ds.fields.inc',
|
126 |
|
|
'access arguments' => array('admin_fields'),
|
127 |
|
|
'type' => MENU_LOCAL_ACTION,
|
128 |
|
|
'weight' => 3,
|
129 |
|
|
);
|
130 |
|
|
$items['admin/structure/ds/fields/delete'] = array(
|
131 |
|
|
'title' => 'Delete a field',
|
132 |
|
|
'description' => 'Delete a field.',
|
133 |
|
|
'page callback' => 'drupal_get_form',
|
134 |
|
|
'page arguments' => array('ds_delete_field_confirm'),
|
135 |
|
|
'file' => 'includes/ds.fields.inc',
|
136 |
|
|
'access arguments' => array('admin_fields'),
|
137 |
|
|
'type' => MENU_VISIBLE_IN_BREADCRUMB,
|
138 |
|
|
);
|
139 |
|
|
$items['admin/structure/ds/fields/revert'] = array(
|
140 |
|
|
'title' => 'Revert a custom field',
|
141 |
|
|
'description' => 'Revert a custom field.',
|
142 |
|
|
'page callback' => 'drupal_get_form',
|
143 |
|
|
'page arguments' => array('ds_revert_field_confirm'),
|
144 |
|
|
'file' => 'includes/ds.fields.inc',
|
145 |
|
|
'access arguments' => array('admin_fields'),
|
146 |
|
|
'type' => MENU_VISIBLE_IN_BREADCRUMB,
|
147 |
|
|
);
|
148 |
3dfa8105
|
Assos Assos
|
$items['admin/structure/ds/fields/manage_block'] = array(
|
149 |
|
|
'title' => 'Add a block field',
|
150 |
|
|
'description' => 'Manage a block field',
|
151 |
|
|
'page callback' => 'drupal_get_form',
|
152 |
|
|
'page arguments' => array('ds_edit_block_field_form'),
|
153 |
|
|
'file' => 'includes/ds.fields.inc',
|
154 |
|
|
'access arguments' => array('admin_fields'),
|
155 |
|
|
'type' => MENU_LOCAL_ACTION,
|
156 |
|
|
'weight' => 2,
|
157 |
|
|
);
|
158 |
85ad3d82
|
Assos Assos
|
|
159 |
|
|
// CTools Modal add field.
|
160 |
|
|
$items['admin/structure/ds/%ctools_js/add_field/%'] = array(
|
161 |
|
|
'title' => 'Add field',
|
162 |
|
|
'page callback' => 'ds_ajax_add_field',
|
163 |
|
|
'page arguments' => array(3, 5),
|
164 |
|
|
'access arguments' => array('admin_fields'),
|
165 |
|
|
'file' => 'includes/ds.fields.inc',
|
166 |
|
|
'type' => MENU_CALLBACK,
|
167 |
|
|
);
|
168 |
|
|
|
169 |
|
|
return $items;
|
170 |
|
|
} |