diff options
| author | Max Kremmel <xing@synapse.plus.com> | 2007-06-21 17:12:37 +0000 |
|---|---|---|
| committer | Max Kremmel <xing@synapse.plus.com> | 2007-06-21 17:12:37 +0000 |
| commit | 5c18945f3fff6d7f922b888e4b00848bc4fff077 (patch) | |
| tree | addb698d52a1eeedeba2d9f4e66d6cd52ccb7f22 | |
| parent | 481cd177af73dd5f8968d642cfc2b829de45a987 (diff) | |
| download | nexus-5c18945f3fff6d7f922b888e4b00848bc4fff077.tar.gz nexus-5c18945f3fff6d7f922b888e4b00848bc4fff077.tar.bz2 nexus-5c18945f3fff6d7f922b888e4b00848bc4fff077.zip | |
since we can have modules all around the content - also above the content, i've changed the way you assign a nexus menu to the top menu bar. this should be more logical and flexible as it's possible to assign any menu type or even multiple menus to the top bar
| -rw-r--r-- | menus.php | 7 | ||||
| -rw-r--r-- | plugins/menu.suckerfish.php | 35 | ||||
| -rw-r--r-- | templates/menus.tpl | 22 |
3 files changed, 12 insertions, 52 deletions
@@ -1,7 +1,7 @@ <?php /** * @author xing <xing@synapse.plus.com> - * @version $Revision: 1.12 $ + * @version $Revision: 1.13 $ * @package nexus * @subpackage functions */ @@ -91,11 +91,6 @@ if( is_file( TEMP_PKG_PATH.'nexus/modules/top_bar_inc.tpl' ) ) { if( !empty( $nuke_top_bar ) ) { unlink( TEMP_PKG_PATH.'nexus/modules/top_bar_inc.tpl' ); } - - if( !empty( $_REQUEST['store_pos'] ) ) { - $gBitSmarty->assign( 'use_custom_top_bar', TRUE ); - $gBitSystem->storeConfig( 'nexus_top_bar', !empty( $_REQUEST['nexus_top_bar'] ) ? $_REQUEST['nexus_top_bar'] : NULL, NEXUS_PKG_NAME ); - } } $gBitSystem->setBrowserTitle( 'Nexus Menus' ); diff --git a/plugins/menu.suckerfish.php b/plugins/menu.suckerfish.php index db9383e..0e239c5 100644 --- a/plugins/menu.suckerfish.php +++ b/plugins/menu.suckerfish.php @@ -5,7 +5,7 @@ * * @abstract creates a simple <ul> and <li> based list of items * @author xing@synapse.plus.com - * @version $Revision: 1.11 $ + * @version $Revision: 1.12 $ * @package nexus * @subpackage plugins */ @@ -45,14 +45,10 @@ function write_suckerfish_cache( $pMenuHash ) { $menu_name = preg_replace( "/ +/", "_", trim( $pMenuHash->mInfo['title'] ) ); $menu_name = strtolower( $menu_name ); - if( $pMenuHash->mInfo['menu_type'] != 'hor' ) { - $menu_file = $pMenuHash->mInfo['cache']['file']; - $data = '{bitmodule title="{tr}'.$pMenuHash->mInfo['title'].'{/tr}" name="'.$menu_name.'"}'; - $data .= '<div class="suckerfish">'; - } else { - $data = ''; - $menu_file = 'top_bar_inc.tpl'; - } + $menu_file = $pMenuHash->mInfo['cache']['file']; + $data = '{bitmodule title="{tr}'.$pMenuHash->mInfo['title'].'{/tr}" name="'.$menu_name.'"}'; + $data .= '<div class="suckerfish">'; + // if a permission has been set, we need to work out when to close the {if} clause $permCloseIds = array(); $perm_close = FALSE; @@ -61,10 +57,7 @@ function write_suckerfish_cache( $pMenuHash ) { foreach( $pMenuHash->mInfo['tree'] as $key => $item ) { if( $item['first'] ) { if( $key == 0 ) { - // don't print the first ul if it's a horizontal menu - needed to insert in top bar - if( $pMenuHash->mInfo['menu_type'] != 'hor' ) { - $data .= '<ul id="nexus'.$pMenuHash->mInfo['menu_id'].'" class="menu '.$pMenuHash->mInfo['menu_type'].'">'; - } + $data .= '<ul id="nexus'.$pMenuHash->mInfo['menu_id'].'" class="menu '.$pMenuHash->mInfo['menu_type'].'">'; } else { $data .= '<ul>'; } @@ -106,19 +99,9 @@ function write_suckerfish_cache( $pMenuHash ) { } } - // remove last </ul> - if( $pMenuHash->mInfo['menu_type'] == 'hor' ) { - $data = preg_replace( "/<\/ul>$/", '', $data ); - } - - if( $pMenuHash->mInfo['menu_type'] == 'ver' ) { - $data .= '<div class="clear"></div>'; - } - - if( $pMenuHash->mInfo['menu_type'] != 'hor' ) { - $data .= '</div>'; - $data .= '{/bitmodule}'; - } + $data .= '<div class="clear"></div>'; + $data .= '</div>'; + $data .= '{/bitmodule}'; $ret[$menu_file] = $data; diff --git a/templates/menus.tpl b/templates/menus.tpl index 22d05b0..3ecc28e 100644 --- a/templates/menus.tpl +++ b/templates/menus.tpl @@ -91,27 +91,9 @@ <div class="row submit"> <input type="submit" name="store_menu" value="Save Settings" /> </div> - {/form} - - {if $use_custom_top_bar and $editMenu.menu_type eq 'hor'} - {form legend="Top Bar Menu Position"} - <div class="row"> - {formlabel label="Position" for="nexus_top_bar"} - {forminput} - <select name="nexus_top_bar" id="nexus_top_bar"> - <option value="right" {if $gBitSystem->getConfig('nexus_top_bar') eq 'right' }selected="selected"{/if}>{tr}To the right of the bitweaver menu{/tr}</option> - <option value="left" {if $gBitSystem->getConfig('nexus_top_bar') eq 'left' }selected="selected"{/if}>{tr}To the left of the bitweaver menu{/tr}</option> - <option value="replace" {if $gBitSystem->getConfig('nexus_top_bar') eq 'replace'}selected="selected"{/if}>{tr}Replace the bitweaver menu{/tr}</option> - </select> - {formhelp note="Here you can set the position of where your custom top bar menu should be. This setting is only used when you are using a horizontal suckerfish menu."} - {/forminput} - </div> - <div class="row submit"> - <input type="submit" name="store_pos" value="Save Settings" /> - </div> - {/form} - {/if} + {formhelp note="If you want to insert a menu in the top bar, please create the menu and then assign it to the top bar in the <em>Manage Layouts</em> screen. We recommend the <em>horizontal suckerfish</em> menu for top bar menus." link="kernel/admin/index.php?page=layout/Manage Layouts"} + {/form} <table class="data" summary="{tr}List of menus that can be used on this site{/tr}"> <caption>{tr}Existing menus{/tr}</caption> |
