/[drupal]/contributions/modules/views_ui_perm/README.txt
ViewVC logotype

Contents of /contributions/modules/views_ui_perm/README.txt

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.4 - (show annotations) (download)
Tue Sep 2 16:19:47 2008 UTC (14 months, 3 weeks ago) by swentel
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-5
Changes since 1.3: +2 -1 lines
File MIME type: text/plain
Readme update
1 $Id$
2
3 Access control
4 --------------
5 Important: If you give someone the 'restricted ui' permission, DO NOT give him
6 administer views permissions.
7
8 Theming override
9 ----------------
10 You need to copy following php code to your template.php to override theme_fieldset.
11 If you allready have a fieldset override, you only need to copy the first 9 lines
12 and add them at the top of the function.
13
14 /**
15 * Override theme_fieldset.
16 */
17 function phptemplate_fieldset($element) {
18 // If we are editing a view, check if fieldset is enabled.
19 if ($GLOBALS['views_ui_edit_page']) {
20 $available_fields = views_ui_perm_available_fields();
21 $ui_permissions = variable_get('views_ui_permissions', views_ui_perm_default_values($available_fields));
22 // Return nothing if it isn't enabled
23 if (in_array($element['#title'], $GLOBALS['views_fieldsets'])) {
24 if ($ui_permissions[$element['#title']] == '0') return;
25 }
26 }
27
28 // render normal fieldset
29 if ($element['#collapsible']) {
30 drupal_add_js('misc/collapse.js');
31
32 if (!isset($element['#attributes']['class'])) {
33 $element['#attributes']['class'] = '';
34 }
35
36 $element['#attributes']['class'] .= ' collapsible';
37 if ($element['#collapsed']) {
38 $element['#attributes']['class'] .= ' collapsed';
39 }
40 }
41
42 return '<fieldset' . drupal_attributes($element['#attributes']) .'>' . ($element['#title'] ? '<legend>'. $element['#title'] .'</legend>' : '') . ($element['#description'] ? '<div class="description">'. $element['#description'] .'</div>' : '') . $element['#children'] . $element['#value'] . "</fieldset>\n";
43 }

  ViewVC Help
Powered by ViewVC 1.1.2