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
This commit is contained in:
plegall
2016-12-22 11:10:40 +01:00
parent 8212257dc0
commit 222cd8c5b6
4 changed files with 31 additions and 19 deletions
+5
View File
@@ -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');
+14 -15
View File
@@ -43,11 +43,22 @@ function make_consecutive( &$orders, $step=50 )
}
}
global $template;
include_once(PHPWG_ROOT_PATH.'include/block.class.php');
// +-----------------------------------------------------------------------+
// | 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();
$menu = new BlockManager('menubar');
$menu->load_registered_blocks();
$reg_blocks = $menu->get_registered_blocks();
@@ -64,18 +75,6 @@ foreach ($mb_conf as $id => $pos)
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)
{
+12 -3
View File
@@ -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>
-1
View File
@@ -207,7 +207,6 @@ UL.menuUl {
LI.menuLi {
width: 100%;
border: 1px solid #666;
padding: 12px 0;
margin-bottom: 5px;
}