diff options
| author | Lester Caine <lester@lsces.co.uk> | 2006-02-08 13:17:41 +0000 |
|---|---|---|
| committer | Lester Caine <lester@lsces.co.uk> | 2006-02-08 13:17:41 +0000 |
| commit | cbe559474ad73396743d84afdd036ea9755c16a5 (patch) | |
| tree | af1fe8af7b7ceab7d6974892da9f3e708460c6f5 | |
| parent | 1163a5dfe4d46961da632ab08d8a78163a6401b6 (diff) | |
| download | pigeonholes-cbe559474ad73396743d84afdd036ea9755c16a5.tar.gz pigeonholes-cbe559474ad73396743d84afdd036ea9755c16a5.tar.bz2 pigeonholes-cbe559474ad73396743d84afdd036ea9755c16a5.zip | |
Make Theme/Permissions/Group optional in pigeonholes
| -rw-r--r-- | admin/admin_pigeonholes_inc.php | 14 | ||||
| -rw-r--r-- | admin/schema_inc.php | 3 | ||||
| -rw-r--r-- | edit_pigeonholes.php | 42 | ||||
| -rw-r--r-- | templates/edit_pigeonholes.tpl | 48 |
4 files changed, 68 insertions, 39 deletions
diff --git a/admin/admin_pigeonholes_inc.php b/admin/admin_pigeonholes_inc.php index 26c1054..c900844 100644 --- a/admin/admin_pigeonholes_inc.php +++ b/admin/admin_pigeonholes_inc.php @@ -1,5 +1,5 @@ <?php -// $Header: /cvsroot/bitweaver/_bit_pigeonholes/admin/admin_pigeonholes_inc.php,v 1.4 2006/01/24 10:21:23 squareing Exp $ +// $Header: /cvsroot/bitweaver/_bit_pigeonholes/admin/admin_pigeonholes_inc.php,v 1.5 2006/02/08 13:17:41 lsces Exp $ $pigeonholeSettings = array( 'display_pigeonhole_path' => array( @@ -14,6 +14,18 @@ $pigeonholeSettings = array( 'label' => 'Display Description', 'note' => 'When showing the category members, you can display the category description as well.', ), + 'pigeonholes_themes' => array( + 'label' => 'Enable variable theme selection', + 'note' => 'Allow the selection of a different theme to use for a category.', + ), + 'pigeonholes_permissions' => array( + 'label' => 'Enable variable permission selection', + 'note' => 'Allow the selection of different permissions to use for each category.', + ), + 'pigeonholes_groups' => array( + 'label' => 'Enable group management selection', + 'note' => 'Allow the selection of a different group to use for a category.', + ), ); $gBitSmarty->assign( 'pigeonholeSettings', $pigeonholeSettings ); diff --git a/admin/schema_inc.php b/admin/schema_inc.php index 4bc4d76..b9214ec 100644 --- a/admin/schema_inc.php +++ b/admin/schema_inc.php @@ -49,6 +49,9 @@ $gBitInstaller->registerPreferences( PIGEONHOLES_PKG_NAME, array( array( PIGEONHOLES_PKG_NAME, 'display_pigeonhole_members','y' ), array( PIGEONHOLES_PKG_NAME, 'limit_member_number','100' ), array( PIGEONHOLES_PKG_NAME, 'pigeonholes_list_style','table' ), + array( PIGEONHOLES_PKG_NAME, 'pigeonholes_themes','y' ), + array( PIGEONHOLES_PKG_NAME, 'pigeonholes_permissions','y' ), + array( PIGEONHOLES_PKG_NAME, 'pigeonholes_groups','y' ), ) ); // ### Default UserPermissions diff --git a/edit_pigeonholes.php b/edit_pigeonholes.php index ed1a47c..0e5a347 100644 --- a/edit_pigeonholes.php +++ b/edit_pigeonholes.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_pigeonholes/edit_pigeonholes.php,v 1.14 2006/02/08 08:53:15 lsces Exp $ + * $Header: /cvsroot/bitweaver/_bit_pigeonholes/edit_pigeonholes.php,v 1.15 2006/02/08 13:17:41 lsces Exp $ * * Copyright ( c ) 2004 bitweaver.org * Copyright ( c ) 2003 tikwiki.org @@ -8,7 +8,7 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: edit_pigeonholes.php,v 1.14 2006/02/08 08:53:15 lsces Exp $ + * $Id: edit_pigeonholes.php,v 1.15 2006/02/08 13:17:41 lsces Exp $ * @package pigeonholes * @subpackage functions */ @@ -125,23 +125,28 @@ if( !empty( $_REQUEST['success'] ) ) { } // get all available perms only when the admin is visiting here. -if( $gBitUser->isAdmin() ) { - $tmpPerms = $gBitUser->getGroupPermissions(); -} else { - $tmpPerms = $gBitUser->mPerms; -} -$perms[''] = tra( 'None' ); -foreach( $tmpPerms as $perm => $info ) { - $perms[$info['package']][$perm] = $perm; +if ( $gBitSystem->isFeatureActive( 'pigeonholes_permissions' ) ) { + if( $gBitUser->isAdmin() ) { + $tmpPerms = $gBitUser->getGroupPermissions(); + } else { + $tmpPerms = $gBitUser->mPerms; + } + + $perms[''] = tra( 'None' ); + foreach( $tmpPerms as $perm => $info ) { + $perms[$info['package']][$perm] = $perm; + } + $gBitSmarty->assign( 'perms', $perms ); } -$gBitSmarty->assign( 'perms', $perms ); // get available groups ready that we can assign the pigoenhole to one of them -$groups[''] = tra( 'None' ); -foreach( $gBitUser->mGroups as $group_id => $group ) { - $groups[$group_id] = $group['group_name']; +if ( $gBitSystem->isFeatureActive( 'pigeonholes_groups' ) ) { + $groups[''] = tra( 'None' ); + foreach( $gBitUser->mGroups as $group_id => $group ) { + $groups[$group_id] = $group['group_name']; + } + $gBitSmarty->assign( 'groups', $groups ); } -$gBitSmarty->assign( 'groups', $groups ); // get content include_once( LIBERTY_PKG_PATH.'get_content_list_inc.php' ); @@ -159,8 +164,11 @@ $gBitSmarty->assign( 'pigeonList', $pigeonList ); $gBitSmarty->assign( 'feedback', !empty( $feedback ) ? $feedback : NULL ); // Get list of available styles -$styles = $gBitThemes->getStyles( NULL, TRUE ); -$gBitSmarty->assign( 'styles', $styles ); +if ( $gBitSystem->isFeatureActive( 'pigeonholes_themes' ) ) { + $styles = $gBitThemes->getStyles( NULL, TRUE ); + $gBitSmarty->assign( 'styles', $styles ); +} + // Display the template if ( !empty( $gStructure ) ) { $gBitSystem->display( 'bitpackage:pigeonholes/edit_pigeonholes.tpl', !empty( $gStructure->mInfo['title'] ) ? tra( 'Edit Pigeonhole' ).': '.$gStructure->mInfo["title"] : tra( 'Create Pigeonhole' ) ); diff --git a/templates/edit_pigeonholes.tpl b/templates/edit_pigeonholes.tpl index 89d8046..f788d61 100644 --- a/templates/edit_pigeonholes.tpl +++ b/templates/edit_pigeonholes.tpl @@ -42,29 +42,35 @@ {/forminput} </div> - <div class="row"> - {formlabel label="Theme" for="pigeonhole-style"} - {forminput} - {html_options id="pigeonhole-style" name="pigeonhole[prefs][style]" output=$styles values=$styles selected=$gContent->mPrefs.style} - {formhelp note="This theme will be applied when viewing any page belonging to this category." warning="Setting is inherited from parent category."} - {/forminput} - </div> + {if $gBitSystem->isFeatureActive( 'pigeonholes_themes' )} + <div class="row"> + {formlabel label="Theme" for="pigeonhole-style"} + {forminput} + {html_options id="pigeonhole-style" name="pigeonhole[prefs][style]" output=$styles values=$styles selected=$gContent->mPrefs.style} + {formhelp note="This theme will be applied when viewing any page belonging to this category." warning="Setting is inherited from parent category."} + {/forminput} + </div> + {/if} - <div class="row"> - {formlabel label="Permission" for="perm"} - {forminput} - {html_options name="pigeonhole[prefs][permission]" id="perm" options=$perms selected=`$gContent->mPrefs.permission`} - {formhelp note="Permission required to view any page in this category." warning="Setting is inherited from parent category."} - {/forminput} - </div> + {if $gBitSystem->isFeatureActive( 'pigeonholes_permissions' )} + <div class="row"> + {formlabel label="Permission" for="perm"} + {forminput} + {html_options name="pigeonhole[prefs][permission]" id="perm" options=$perms selected=`$gContent->mPrefs.permission`} + {formhelp note="Permission required to view any page in this category." warning="Setting is inherited from parent category."} + {/forminput} + </div> + {/if} - <div class="row"> - {formlabel label="Group" for="group"} - {forminput} - {html_options name="pigeonhole[prefs][group_id]" id="group" options=$groups selected=`$gContent->mPrefs.group_id`} - {formhelp note="Users of only this group can view the content of this category." warning="Setting is inherited from parent category."} - {/forminput} - </div> + {if $gBitSystem->isFeatureActive( 'pigeonholes_groups' )} + <div class="row"> + {formlabel label="Group" for="group"} + {forminput} + {html_options name="pigeonhole[prefs][group]" id="group" options=$groups selected=`$gContent->mPrefs.group_id`} + {formhelp note="Users of only this group can view the content of this category." warning="Setting is inherited from parent category."} + {/forminput} + </div> + {/if} <div class="row"> {formlabel label="Content" for="pigeonhole-content"} |
