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 /edit_pigeonholes.php | |
| parent | 1163a5dfe4d46961da632ab08d8a78163a6401b6 (diff) | |
| download | pigeonholes-cbe559474ad73396743d84afdd036ea9755c16a5.tar.gz pigeonholes-cbe559474ad73396743d84afdd036ea9755c16a5.tar.bz2 pigeonholes-cbe559474ad73396743d84afdd036ea9755c16a5.zip | |
Make Theme/Permissions/Group optional in pigeonholes
Diffstat (limited to 'edit_pigeonholes.php')
| -rw-r--r-- | edit_pigeonholes.php | 42 |
1 files changed, 25 insertions, 17 deletions
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' ) ); |
