diff options
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); + ?> |
