Skip to content

Commit

Permalink
Fix menu editor
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Jul 30, 2017
1 parent 837afa0 commit bb8d458
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 16 deletions.
11 changes: 6 additions & 5 deletions htdocs/admin/menus/index.php
Expand Up @@ -296,7 +296,7 @@

//puis tous les elements enfants

$sql = "SELECT m.rowid, m.titre, m.langs, m.mainmenu, m.leftmenu, m.fk_menu, m.fk_mainmenu, m.fk_leftmenu, m.module";
$sql = "SELECT m.rowid, m.titre, m.langs, m.mainmenu, m.leftmenu, m.fk_menu, m.fk_mainmenu, m.fk_leftmenu, m.position, m.module";
$sql.= " FROM ".MAIN_DB_PREFIX."menu as m";
$sql.= " WHERE menu_handler = '".$db->escape($menu_handler_to_search)."'";
$sql.= " AND entity = ".$conf->entity;
Expand All @@ -323,6 +323,7 @@
'leftmenu'=>$menu['leftmenu'],
'fk_mainmenu'=>$menu['fk_mainmenu'],
'fk_leftmenu'=>$menu['fk_leftmenu'],
'position'=>$menu['position'],
'entry'=>'<table class="nobordernopadding centpercent"><tr><td>'.
'<strong> &nbsp; <a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=edit&menuId='.$menu['rowid'].'">'.$titre.'</a></strong>'.
'</td><td align="right">'.
Expand All @@ -344,10 +345,11 @@

global $tree_recur_alreadyadded; // This var was def into tree_recur

// Appelle de la fonction recursive (ammorce)
// avec recherche depuis la racine.
//var_dump($data);
tree_recur($data, $data[0], 0, 'iddivjstree'); // $data[0] is virtual record 'racine'

// Appelle de la fonction recursive (ammorce) avec recherche depuis la racine.
//tree_recur($data, $data[0], 0, 'iddivjstree', 0, 1); // use this to get info on name and foreign keys of menu entry
tree_recur($data, $data[0], 0, 'iddivjstree', 0, 0); // $data[0] is virtual record 'racine'


print '</td>';
Expand Down Expand Up @@ -376,7 +378,6 @@

print '<tr>';
print '<td colspan="2">';

foreach($remainingdata as $datar)
{
$father = array('rowid'=>$datar['rowid'],'title'=>"???",'mainmenu'=>$datar['fk_mainmenu'],'leftmenu'=>$datar['fk_leftmenu'],'fk_mainmenu'=>'','fk_leftmenu'=>'');
Expand Down
6 changes: 3 additions & 3 deletions htdocs/core/lib/treeview.lib.php
Expand Up @@ -182,7 +182,7 @@ function tree_recur($tab, $pere, $rang, $iddivjstree='iddivjstree', $donoresetal
//print ' -> A '.$tab[$x]['rowid'].' mainmenu='.$tab[$x]['mainmenu'].' leftmenu='.$tab[$x]['leftmenu'].' fk_mainmenu='.$tab[$x]['fk_mainmenu'].' fk_leftmenu='.$tab[$x]['fk_leftmenu'].'<br>'."\n";
$tree_recur_alreadyadded[$tab[$x]['rowid']]=($rang + 1);
// And now we search all its sons of lower level
tree_recur($tab,$tab[$x],$rang+1);
tree_recur($tab, $tab[$x], $rang+1, 'iddivjstree', 0, $showfk);
print '</li>';
}
elseif (! empty($tab[$x]['rowid']) && $tab[$x]['fk_menu'] == -1 && $tab[$x]['fk_mainmenu'] == $pere['mainmenu'] && $tab[$x]['fk_leftmenu'] == $pere['leftmenu'])
Expand All @@ -206,7 +206,7 @@ function tree_recur($tab, $pere, $rang, $iddivjstree='iddivjstree', $donoresetal
print '<strong> &nbsp; <a href="edit.php?menu_handler='.$menu_handler_to_search.'&action=edit&menuId='.$menu['rowid'].'">';
print $tab[$x]['title'];
print '</a></strong>';
print '&nbsp; (fk_mainmenu='.$tab[$x]['fk_mainmenu'].' fk_leftmenu='.$tab[$x]['fk_leftmenu'].')';
print '&nbsp; (mainmenu='.$tab[$x]['mainmenu'].' leftmenu='.$tab[$x]['leftmenu'].' - fk_mainmenu='.$tab[$x]['fk_mainmenu'].' fk_leftmenu='.$tab[$x]['fk_leftmenu'].')';
print '</td><td align="right">';
print $tab[$x]['buttons'];
print '</td></tr></table>';
Expand All @@ -219,7 +219,7 @@ function tree_recur($tab, $pere, $rang, $iddivjstree='iddivjstree', $donoresetal
$tree_recur_alreadyadded[$tab[$x]['rowid']]=($rang + 1);
// And now we search all its sons of lower level
//print 'Call tree_recur for x='.$x.' rowid='.$tab[$x]['rowid']." fk_mainmenu pere = ".$tab[$x]['fk_mainmenu']." fk_leftmenu pere = ".$tab[$x]['fk_leftmenu']."<br>\n";
tree_recur($tab,$tab[$x],$rang+1);
tree_recur($tab, $tab[$x], $rang+1, 'iddivjstree', 0, $showfk);
print '</li>';
}
}
Expand Down
Expand Up @@ -235,7 +235,7 @@ public function __construct($db)
'leftmenu'=>'',
'url'=>'/mymodule/mymoduleindex.php',
'langs'=>'mymodule@mymodule', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>1000,
'position'=>1000+$r,
'enabled'=>'$conf->mymodule->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled.
'perms'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
'target'=>'',
Expand All @@ -252,7 +252,7 @@ public function __construct($db)
'leftmenu'=>'mymodule',
'url'=>'/mymodule/myobject_list.php',
'langs'=>'mymodule@mymodule', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>1100,
'position'=>1000+$r,
'enabled'=>'$conf->mymodule->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
'perms'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
'target'=>'',
Expand All @@ -264,7 +264,7 @@ public function __construct($db)
'leftmenu'=>'mymodule',
'url'=>'/mymodule/myobject_page.php?action=create',
'langs'=>'mymodule@mymodule', // Lang file to use (without .lang) by module. File must be in langs/code_CODE/ directory.
'position'=>1101,
'position'=>1000+$r,
'enabled'=>'$conf->mymodule->enabled', // Define condition to show or hide menu entry. Use '$conf->mymodule->enabled' if entry must be visible if module is enabled. Use '$leftmenu==\'system\'' to show if leftmenu system is selected.
'perms'=>'1', // Use 'perms'=>'$user->rights->mymodule->level1->level2' if you want your menu with a permission rules
'target'=>'',
Expand Down
8 changes: 7 additions & 1 deletion htdocs/theme/eldy/style.css.php
Expand Up @@ -2653,7 +2653,6 @@
}
tr.liste_titre th, tr.liste_titre td, th.liste_titre
{
/* border-bottom: 1px solid #<?php echo ($colorbacktitle1 == '255,255,255'?'BBBBBB':'ddd'); ?>; */
border-bottom: 1px solid #888;
}
tr.liste_titre:first-child th, tr:first-child th.liste_titre {
Expand Down Expand Up @@ -2779,6 +2778,13 @@
border-bottom: 1px solid #ddd;
}

ul.noborder li:nth-child(even):not(.liste_titre) {
background-color: rgb(<?php echo $colorbacklinepair2; ?>) !important;
background-color: rgb(<?php echo $colorbacklinepair2; ?>) !important;
background-color: rgb(<?php echo $colorbacklinepair2; ?>) !important;
background-color: rgb(<?php echo $colorbacklinepair2; ?>) !important;
background-color: rgb(<?php echo $colorbacklinepair2; ?>) !important;
}


/*
Expand Down
17 changes: 13 additions & 4 deletions htdocs/theme/md/style.css.php
Expand Up @@ -2623,6 +2623,15 @@
}
*/

ul.noborder li:nth-child(odd):not(.liste_titre) {
background-color: rgb(<?php echo $colorbacklinepair2; ?>) !important;
background-color: rgb(<?php echo $colorbacklinepair2; ?>) !important;
background-color: rgb(<?php echo $colorbacklinepair2; ?>) !important;
background-color: rgb(<?php echo $colorbacklinepair2; ?>) !important;
background-color: rgb(<?php echo $colorbacklinepair2; ?>) !important;
}


/* Set the color for hover lines */
.oddeven:hover, .evenodd:hover, .impair:hover, .pair:hover
{
Expand Down Expand Up @@ -2723,19 +2732,19 @@
{
height: 26px !important;
}
div.liste_titre, tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel, table.dataTable thead tr
div.liste_titre_bydiv, .liste_titre div.tagtr, tr.liste_titre, tr.liste_titre_sel, form.liste_titre, form.liste_titre_sel, table.dataTable thead tr
{
background: rgb(<?php echo $colorbacktitle1; ?>);
font-weight: <?php echo $useboldtitle?'bold':'normal'; ?>;
border-bottom: 1px solid #FDFFFF;

color: rgb(<?php echo $colortexttitle; ?>);
font-family: <?php print $fontlist ?>;
border-bottom: 1px solid #FDFFFF;
text-align: <?php echo $left; ?>;
}
tr.liste_titre th, tr.liste_titre td, th.liste_titre, form.liste_titre div, div.liste_titre
tr.liste_titre th, tr.liste_titre td, th.liste_titre
{
border-bottom: 1px solid #<?php echo ($colorbacktitle1 == '255,255,255'?'BBBBBB':'FDFFFF'); ?>;
border-bottom: 1px solid #aaa;
}
/* TODO Once title line is moved under title search, make border bottom of all th black and force to whit when it's first tr */
tr:first-child th.liste_titre {
Expand Down

0 comments on commit bb8d458

Please sign in to comment.