Permalink
Browse files

fixes #587 modernize menubar manager

- #567 add icon on button
- font-icon checkboxes
- #554 add tab
- #528 remove borders
- remove action "reset" which was actually "restore default settings" and was not really useful, so let's simplify
  • Loading branch information...
1 parent 8212257 commit 222cd8c5b6a36964c8fc370eeddb687371a59402 @plegall plegall committed Dec 22, 2016
@@ -114,6 +114,11 @@ function add_core_tabs($sheets, $tab_id)
$sheets['new'] = array('caption' => '<span class="icon-plus-circled"></span>'.l10n('Add New Language'), 'url' => $my_base_url.'&amp;tab=new');
break;
+ case 'menus':
+ global $my_base_url;
+ $sheets[''] = array('caption' => '<span class="icon-menu"></span>'.l10n('Menu Management'), 'url' => $my_base_url.'menubar');
+ break;
+
case 'nbm':
global $base_url;
$sheets['param'] = array('caption' => l10n('Parameter'), 'url' => $base_url.'?page=notification_by_mail&amp;mode=param');
View
@@ -43,10 +43,21 @@ function make_consecutive( &$orders, $step=50 )
}
}
+include_once(PHPWG_ROOT_PATH.'include/block.class.php');
-global $template;
+// +-----------------------------------------------------------------------+
+// | tabs |
+// +-----------------------------------------------------------------------+
+
+include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
+
+$my_base_url = get_root_url().'admin.php?page=';
+
+$tabsheet = new tabsheet();
+$tabsheet->set_id('menus');
+$tabsheet->select('');
+$tabsheet->assign();
-include_once(PHPWG_ROOT_PATH.'include/block.class.php');
$menu = new BlockManager('menubar');
$menu->load_registered_blocks();
@@ -64,18 +75,6 @@ function make_consecutive( &$orders, $step=50 )
unset($mb_conf[$id]);
}
-if ( isset($_POST['reset']))
-{
- $mb_conf = array();
- $query = '
-UPDATE '.CONFIG_TABLE.'
- SET value=\'\'
- WHERE param=\'blk_'.addslashes($menu->get_id()).'\'
- LIMIT 1';
- pwg_query($query);
-}
-
-
$idx=1;
foreach ($reg_blocks as $id => $block)
{
@@ -1,3 +1,5 @@
+{combine_script id='common' load='footer' path='admin/themes/default/js/common.js'}
+
{footer_script require='jquery.ui.sortable'}{literal}
jQuery(document).ready(function(){
jQuery(".menuPos").hide();
@@ -25,6 +27,12 @@ jQuery(document).ready(function(){
});
{/literal}{/footer_script}
+{html_style}
+.font-checkbox i {
+ margin-left:5px;
+}
+{/html_style}
+
<div class="titrePage">
<h2>{'Menu Management'|@translate}</h2>
</div>
@@ -35,7 +43,7 @@ jQuery(document).ready(function(){
<li class="menuLi {if $block.pos<0}menuLi_hidden{/if}" id="menu_{$block.reg->get_id()}">
<p>
<span>
- <strong>{'Hide'|@translate} <input type="checkbox" name="hide_{$block.reg->get_id()}" {if $block.pos<0}checked="checked"{/if}></strong>
+ <label class="font-checkbox"><strong>{'Hide'|@translate}</strong><i class="icon-check"></i><input type="checkbox" name="hide_{$block.reg->get_id()}" {if $block.pos<0}checked="checked"{/if}></label>
</span>
<img src="{$themeconf.admin_icon_dir}/cat_move.png" class="drag_button" style="display:none;" alt="{'Drag to re-order'|@translate}" title="{'Drag to re-order'|@translate}">
@@ -58,8 +66,9 @@ jQuery(document).ready(function(){
{/foreach}
</ul>
<p class="menuSubmit">
- <input type="submit" name="submit" value="{'Submit'|@translate}">
- <input type="submit" name="reset" value="{'Reset'|@translate}">
+ <button name="submit" type="submit" class="buttonLike">
+ <i class="icon-floppy"></i> {'Save Settings'|@translate}
+ </button>
</p>
</form>
@@ -207,7 +207,6 @@ UL.menuUl {
LI.menuLi {
width: 100%;
- border: 1px solid #666;
padding: 12px 0;
margin-bottom: 5px;
}

0 comments on commit 222cd8c

Please sign in to comment.