diff options
| author | Nick Palmer <nick@sluggardy.net> | 2007-04-06 12:38:44 +0000 |
|---|---|---|
| committer | Nick Palmer <nick@sluggardy.net> | 2007-04-06 12:38:44 +0000 |
| commit | f8166e1b03217658c9b87556c8525684719b0795 (patch) | |
| tree | d23cb13f98c78ff3ace4acbdfb6660f2ef1f6d82 /admin | |
| parent | c86f1ecd6a6b690b105cf9a67a0c40e6c027577b (diff) | |
| download | calendar-f8166e1b03217658c9b87556c8525684719b0795.tar.gz calendar-f8166e1b03217658c9b87556c8525684719b0795.tar.bz2 calendar-f8166e1b03217658c9b87556c8525684719b0795.zip | |
Add ability to set default content types to show.
Make ajax popups sticky with a nice close icon.
Diffstat (limited to 'admin')
| -rw-r--r-- | admin/admin_calendar_inc.php | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/admin/admin_calendar_inc.php b/admin/admin_calendar_inc.php index 88fda10..50155e0 100644 --- a/admin/admin_calendar_inc.php +++ b/admin/admin_calendar_inc.php @@ -19,17 +19,44 @@ $calendarValues = array( 'calendar_hour_fraction', 'calendar_day_start', 'calendar_day_end', +); +$calendarChecks = array( 'calendar_user_prefs', 'calendar_ajax_popups', ); + +// This has to come after the set since we are loading what is selected. +$contentDefaults = array(); +$calendarTypeDefaults = array(); +$calendarTypesSelected = array(); +global $gLibertySystem; +foreach( $gLibertySystem->mContentTypes as $cType ) { + $option = 'calendar_default_'.$cType['content_type_guid']; + $calendarChecks[] = $option; + $calendarTypeDefaults[$option] = $cType['content_description']; +} +$gBitSmarty->assign('calendarTypeDefaults', $calendarTypeDefaults); + // this function only exists if it's been included by the index.php page. if // it's been included from anywhere else, we don't execute this section if( function_exists( 'simple_set_value' ) && $gBitUser->isAdmin() && !empty( $_REQUEST['calendar_submit'] ) ) { foreach( $calendarValues as $item ) { - if ( $item != 'calendar_user_prefs' && $item != 'calendar_ajax_popups') - simple_set_value( $item, CALENDAR_PKG_NAME ); - else - simple_set_toggle( $item, CALENDAR_PKG_NAME ); + simple_set_value( $item, CALENDAR_PKG_NAME ); + } + foreach( $calendarChecks as $item ) { + simple_set_toggle( $item, CALENDAR_PKG_NAME ); } + foreach( $calendarTypeDefaults as $key => $val ) { + simple_set_toggle_array( 'defaultTypes', $key, CALENDAR_PKG_NAME); + } } + +// Build the list of what is selected. Has to come AFTER the set. +foreach( $calendarTypeDefaults as $key => $val) { + if ($gBitSystem->isFeatureActive($key) ){ + $calendarTypesSelected[] = $key; + } +} +$gBitSmarty->assign('calendarTypesSelected', $calendarTypesSelected); + ?> |
