diff options
| author | lsces <lester@lsces.co.uk> | 2012-08-06 01:51:18 +0100 |
|---|---|---|
| committer | lsces <lester@lsces.co.uk> | 2012-08-06 01:51:18 +0100 |
| commit | de2def8aa568cef824e37fdf7eb6c169355923ee (patch) | |
| tree | 276a11dffb306fc0b7c06e0c7bf1123b616a2260 /admin | |
| parent | f72b6709b1dfc820cb4f1a35d3faf5f691d601bc (diff) | |
| download | themes-de2def8aa568cef824e37fdf7eb6c169355923ee.tar.gz themes-de2def8aa568cef824e37fdf7eb6c169355923ee.tar.bz2 themes-de2def8aa568cef824e37fdf7eb6c169355923ee.zip | |
Parallel the role model data as required, using ROLE_MODEL to enable
themes_layout needs a little tidy to remove the unnecessary extra field.
Diffstat (limited to 'admin')
| -rw-r--r-- | admin/admin_layout_inc.php | 33 | ||||
| -rw-r--r-- | admin/admin_layout_overview_inc.php | 9 | ||||
| -rw-r--r-- | admin/admin_modules_inc.php | 2 | ||||
| -rw-r--r-- | admin/admin_themes_inc.php | 2 | ||||
| -rw-r--r-- | admin/schema_inc.php | 1 |
5 files changed, 35 insertions, 12 deletions
diff --git a/admin/admin_layout_inc.php b/admin/admin_layout_inc.php index 8d4f446..f8b47c5 100644 --- a/admin/admin_layout_inc.php +++ b/admin/admin_layout_inc.php @@ -4,8 +4,14 @@ // Initialization require_once( '../../kernel/setup_inc.php' ); -if( !isset($_REQUEST["groups"] ) ) { - $_REQUEST["groups"] = array(); +if( defined( 'ROLE_MODEL' )) { + if( !isset($_REQUEST["roles"] ) ) { + $_REQUEST["roles"] = array(); + } +} else { + if( !isset($_REQUEST["groups"] ) ) { + $_REQUEST["groups"] = array(); + } } if( empty( $_REQUEST['module_package'] ) ) { @@ -64,15 +70,21 @@ if( isset( $_REQUEST['module_id'] ) && !empty( $_REQUEST['move_module'] )) { } elseif( $processForm == 'Center' || $processForm == 'Column' ) { $fAssign = &$_REQUEST['fAssign']; - if( !empty( $_REQUEST['groups'] ) ) { - $fAssign['groups'] = $_REQUEST['groups']; + if( defined( 'ROLE_MODEL' )) { + if( !empty( $_REQUEST['roles'] ) ) { + $fAssign['roles'] = $_REQUEST['roles']; + } + } else { + if( !empty( $_REQUEST['groups'] ) ) { + $fAssign['groups'] = $_REQUEST['groups']; + } } // either add the module to all available layouts or just the active one - + $fAssign['layout'] = $_REQUEST['module_package']; $gBitThemes->storeModule( $fAssign ); - unset( $fAssign['store'] ); + unset( $fAssign['store'] ); if( !empty( $fAssign['add_to_all'] )) { foreach( array_keys( $cloneLayouts ) as $pkg ) { if( $pkg != $_REQUEST['module_package'] ){ @@ -139,9 +151,14 @@ for( $i = 1; $i < 50; $i++ ) { } $gBitSmarty->assign_by_ref( 'orders', $orders ); -$groups = $gBitUser->getAllUserGroups( ROOT_USER_ID ); -$gBitSmarty->assign_by_ref( "groups", $groups ); +if( defined( 'ROLE_MODEL' )) { + $roles = $gBitUser->getAllUserRoles( ROOT_USER_ID ); + $gBitSmarty->assign_by_ref( "roles", $roles ); +} else { + $groups = $gBitUser->getAllUserGroups( ROOT_USER_ID ); + $gBitSmarty->assign_by_ref( "groups", $groups ); +} // we need gBitThemes as well $gBitSmarty->assign_by_ref( "gBitThemes", $gBitThemes ); diff --git a/admin/admin_layout_overview_inc.php b/admin/admin_layout_overview_inc.php index 88e2fa8..2e52660 100644 --- a/admin/admin_layout_overview_inc.php +++ b/admin/admin_layout_overview_inc.php @@ -59,6 +59,11 @@ ksort( $allModulesHelp ); $gBitSmarty->assign_by_ref( 'allModulesHelp', $allModulesHelp ); $gBitSmarty->assign( 'pageName', 'Layout Options' ); -$groups = $gBitUser->getAllUserGroups( ROOT_USER_ID ); -$gBitSmarty->assign_by_ref( "groups", $groups ); +if( defined( 'ROLE_MODEL' )) { + $roles = $gBitUser->getAllUserRoles( ROOT_USER_ID ); + $gBitSmarty->assign_by_ref( "roles", $roles ); +} else { + $groups = $gBitUser->getAllUserGroups( ROOT_USER_ID ); + $gBitSmarty->assign_by_ref( "groups", $groups ); +} ?> diff --git a/admin/admin_modules_inc.php b/admin/admin_modules_inc.php index 4312cca..abfd050 100644 --- a/admin/admin_modules_inc.php +++ b/admin/admin_modules_inc.php @@ -9,7 +9,7 @@ $formModuleFeatures = array( // 'note' => 'This allows users to collapse modules by clicking on their titles. Can be useful if you use many modules.', // ), // 'site_show_all_modules_always' => array( -// 'label' => 'Display modules to all groups always', +// 'label' => 'Display modules to all teams always', // 'note' => 'If you activate this, any modules you assign will be visible to all users, regardless of the settings on the layout page.<br />Hint: If you lose your login module, use /users/login.php to login!', // ), // 'site_module_controls' => array( diff --git a/admin/admin_themes_inc.php b/admin/admin_themes_inc.php index 82bd269..8fe2284 100644 --- a/admin/admin_themes_inc.php +++ b/admin/admin_themes_inc.php @@ -26,7 +26,7 @@ $themeSettings = array( ), 'site_mods_req_admn_grp' => array( 'label' => 'Modules require membership', - 'note' => 'If enabled, modules with group restrictions require the administrator to be member of the group. If disabled, all modules are always visible to administrators.', + 'note' => 'If enabled, modules with group/role restrictions require the administrator to be member of the group/role. If disabled, all modules are always visible to administrators.', ), 'themes_joined_js_css' => array( 'label' => 'Joined CSS and JS', diff --git a/admin/schema_inc.php b/admin/schema_inc.php index 23052d9..a7dfed3 100644 --- a/admin/schema_inc.php +++ b/admin/schema_inc.php @@ -21,6 +21,7 @@ $tables = array( params C(255), cache_time I8, groups C(255), + roles C(255), pos I4 NOTNULL DEFAULT '1' ", |
