diff options
| author | Max Kremmel <xing@synapse.plus.com> | 2006-09-10 21:16:39 +0000 |
|---|---|---|
| committer | Max Kremmel <xing@synapse.plus.com> | 2006-09-10 21:16:39 +0000 |
| commit | 2f5f99e0b32f042aba7bd6b540ffef84230e7d03 (patch) | |
| tree | 06fa7b90f74e737d35ab46c946443c497d309ca3 | |
| parent | d64452c57ba2163ac454a3259e3ae9f8959abed1 (diff) | |
| download | themes-2f5f99e0b32f042aba7bd6b540ffef84230e7d03.tar.gz themes-2f5f99e0b32f042aba7bd6b540ffef84230e7d03.tar.bz2 themes-2f5f99e0b32f042aba7bd6b540ffef84230e7d03.zip | |
clean up, move around and consolidate tonnes of crappy and complicated core admin pages
| -rw-r--r-- | admin/admin_themes_inc.php | 43 | ||||
| -rw-r--r-- | admin/admin_themes_manager.php | 36 | ||||
| -rw-r--r-- | templates/admin_themes.tpl | 27 | ||||
| -rw-r--r-- | templates/admin_themes_manager.tpl | 58 | ||||
| -rw-r--r-- | templates/menu_themes_admin.tpl | 1 |
5 files changed, 71 insertions, 94 deletions
diff --git a/admin/admin_themes_inc.php b/admin/admin_themes_inc.php new file mode 100644 index 0000000..8d4f59f --- /dev/null +++ b/admin/admin_themes_inc.php @@ -0,0 +1,43 @@ +<?php +$themeSettings = array( + 'feature_jscalendar' => array( + 'label' => 'Enable JSCalendar', + 'note' => 'JSCalendar is a javascript calendar popup that allows you to easily select a date using an easy to use and appealing interface.', + ), + 'themes_edit_css' => array( + 'label' => 'Edit Css', + 'note' => 'Enables you to edit CSS files from within your browser to customise your site style according to your desires.', + ), + 'site_disable_fat' => array( + 'label' => "Disable Fading", + 'note' => "Disable the fading effect used when displaying any success, warning or error messages.", + ), + 'site_disable_jstabs' => array( + 'label' => "Disable Javascript Tabs", + 'note' =>"If you have difficulties with the javascript tabs, of you don't like them, you can disable them here.", + ), +); +$gBitSmarty->assign( 'themeSettings', $themeSettings ); + +if( !empty( $_REQUEST['change_prefs'] ) ) { + $pref_simple_values = array( + "site_biticon_display_style", + ); + + foreach( $pref_simple_values as $svitem ) { + simple_set_value( $svitem, THEMES_PKG_NAME ); + } + + foreach( $themeSettings as $toggle ) { + simple_set_toggle( key( $toggle ), THEMES_PKG_NAME ); + } +} + +// set the options biticon takes +$biticon_display_options = array( + 'icon' => tra( 'icon' ), + 'text' => tra( 'text' ), + 'icon_text' => tra( 'icon and text' ) +); +$gBitSmarty->assign( "biticon_display_options", $biticon_display_options ); +?> diff --git a/admin/admin_themes_manager.php b/admin/admin_themes_manager.php index 2272c90..2f9e660 100644 --- a/admin/admin_themes_manager.php +++ b/admin/admin_themes_manager.php @@ -4,33 +4,6 @@ require_once( KERNEL_PKG_PATH.'simple_form_functions_lib.php' ); $gBitSystem->verifyPermission( 'p_admin' ); -// Handle Update -$processForm = set_tab(); - -if( $processForm ) { - $pref_simple_values = array( - "site_slide_style", - "site_biticon_display_style", - ); - - foreach ($pref_simple_values as $svitem) { - simple_set_value ($svitem, THEMES_PKG_NAME); - } - - $pref_toggles = array( - "site_disable_jstabs", - "site_disable_fat", - ); - - foreach ($pref_toggles as $toggle) { - simple_set_toggle ($toggle, THEMES_PKG_NAME); - } - - if( isset( $_REQUEST['fRemoveTheme'] ) ) { - $gBitThemes->expunge_dir( THEMES_PKG_PATH.'styles/'.$_REQUEST['fRemoveTheme'] ); - } -} - // apply the icon theme if( !empty( $_REQUEST["site_icon_style"] ) ) { $gBitSystem->storeConfig( 'site_icon_style', $_REQUEST["site_icon_style"], THEMES_PKG_NAME ); @@ -80,19 +53,10 @@ $sampleIcons = array( 'go-next', 'go-up', 'help-browser', - 'folder-open', 'folder', ); $gBitSmarty->assign( "sampleIcons", $sampleIcons ); -// set the options biticon takes -$biticon_display_options = array( - 'icon' => tra( 'icon' ), - 'text' => tra( 'text' ), - 'icon_text' => tra( 'icon and text' ) -); -$gBitSmarty->assign( "biticon_display_options", $biticon_display_options ); - // crude method of loading css styling but we can fix this later $gBitSmarty->assign( "loadLayoutGalaCss", TRUE ); diff --git a/templates/admin_themes.tpl b/templates/admin_themes.tpl new file mode 100644 index 0000000..ed110aa --- /dev/null +++ b/templates/admin_themes.tpl @@ -0,0 +1,27 @@ +{* $Header: /cvsroot/bitweaver/_bit_themes/templates/admin_themes.tpl,v 1.1 2006/09/10 21:16:39 squareing Exp $ *} +{strip} +{form legend="Theme Settings"} + <input type="hidden" name="page" value="{$page}" /> + <div class="row"> + {formlabel label="Display action links as" for="site_biticon_display_style"} + {forminput} + {html_options name="site_biticon_display_style" id="site_biticon_display_style" options=$biticon_display_options selected=$gBitSystem->mConfig.site_biticon_display_style} + {formhelp note="Changing this setting will modify the way all action icons are displayed on your site. Icons in menus are not affected."} + {/forminput} + </div> + + {foreach from=$themeSettings key=feature item=output} + <div class="row"> + {formlabel label=`$output.label` for=$feature} + {forminput} + {html_checkboxes name="$feature" values="y" checked=$gBitSystem->getConfig($feature) labels=false id=$feature} + {formhelp note=`$output.note` page=`$output.page`} + {/forminput} + </div> + {/foreach} + + <div class="row submit"> + <input type="submit" name="change_prefs" value="{tr}Apply Settings{/tr}" /> + </div> +{/form} +{/strip} diff --git a/templates/admin_themes_manager.tpl b/templates/admin_themes_manager.tpl index 6e90533..68fac44 100644 --- a/templates/admin_themes_manager.tpl +++ b/templates/admin_themes_manager.tpl @@ -116,64 +116,6 @@ </ul> {/legend} {/jstab} - - {jstab title="Miscellaneous"} - {form legend="Miscellaneous Settings"} - {* - <div class="row"> - {formlabel label="Slideshows theme" for="site_slide_style"} - {forminput} - {html_options name="site_slide_style" id="site_slide_style" output=$styles values=$styles selected=$gBitSystem->mConfig.site_slide_style} - {formhelp note="This theme will be used when viewing a wikipage as a slideshow."} - {/forminput} - </div> - *} - - <div class="row"> - {formlabel label="Display action links as" for="site_biticon_display_style"} - {forminput} - {html_options name="site_biticon_display_style" id="site_biticon_display_style" options=$biticon_display_options selected=$gBitSystem->mConfig.site_biticon_display_style} - {formhelp note="Changing this setting will modify the way all action icons are displayed on your site. Icons in menus are not affected."} - {/forminput} - </div> - - <div class="row"> - {formlabel label="Disable Javascript Tabs" for="site_disable_jstabs"} - {forminput} - <input type="checkbox" name="site_disable_jstabs" value='y' id="site_disable_jstabs"{if $gBitSystem->isFeatureActive( 'site_disable_jstabs' )} checked="checked"{/if} /> - {formhelp note="If you have difficulties with the javascript tabs, of you don't like them, you can disable them here."} - {/forminput} - </div> - - <div class="row"> - {formlabel label="Disable Fading" for="site_disable_fat"} - {forminput} - <input type="checkbox" name="site_disable_fat" value='y' id="site_disable_fat"{if $gBitSystem->isFeatureActive( 'site_disable_fat' )} checked="checked"{/if} /> - {formhelp note="Disable the fading effect used when displaying any success, warning or error messages."} - {/forminput} - </div> - - <div class="row submit"> - <input type="submit" name="themeTabSubmit" value="{tr}Apply Settings{/tr}" /> - </div> - {/form} - {/jstab} - - {*jstab title="Delete Theme"} - {form legend="Delete Theme"} - <div class="row"> - {formlabel label="Delete theme" for="fRemoveTheme"} - {forminput} - {html_options name="fRemoveTheme" id="fRemoveTheme" output=$styles values=$styles} - {formhelp note="This theme will physically be removed from your server and you will not be able to retrieve it."} - {/forminput} - </div> - - <div class="row submit"> - <input type="submit" name="deleteTabSubmit" value="{tr}Delete{/tr}" onclick="return confirm('Are you sure you want to delete the theme {$styles[ix]|escape}? you will not be able to retrieve them!');" /> - </div> - {/form} - {/jstab*} {/jstabs} </div> <!-- end .body --> </div> <!-- end .themes --> diff --git a/templates/menu_themes_admin.tpl b/templates/menu_themes_admin.tpl index 329f260..c149dae 100644 --- a/templates/menu_themes_admin.tpl +++ b/templates/menu_themes_admin.tpl @@ -1,5 +1,6 @@ {strip} <ul> + <li><a class="item" href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page=themes" >{tr}Theme Settings{/tr}</a></li> <li><a class="item" href="{$smarty.const.THEMES_PKG_URL}admin/admin_themes_manager.php">{tr}Themes Manager{/tr}</a></li> <li><a class="item" href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page=layout" >{tr}Layout{/tr}</a></li> <li><a class="item" href="{$smarty.const.THEMES_PKG_URL}admin/menus.php">{tr}Menus{/tr}</a></li> |
