Look: enhancement in look
This commit is contained in:
parent
0dfb276348
commit
d4c492bbca
@ -34,6 +34,7 @@ require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php");
|
||||
$langs->load("companies");
|
||||
$langs->load("products");
|
||||
$langs->load("admin");
|
||||
$langs->load("users");
|
||||
|
||||
// Security check
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
@ -61,6 +61,9 @@ function printBookmarksList ($aDb, $aLangs)
|
||||
}
|
||||
$ret.= '</td></tr></table>';
|
||||
$ret.= '</div>';
|
||||
|
||||
$ret.= '<div class="menu_top"></div>'."\n";
|
||||
|
||||
// Menu with all bookmarks
|
||||
if (! empty($conf->global->BOOKMARKS_SHOW_IN_MENU))
|
||||
{
|
||||
|
||||
@ -115,7 +115,6 @@ function print_left_auguria_menu($db,$menu_array)
|
||||
$alt=0;
|
||||
if (is_array($menu_array))
|
||||
{
|
||||
$contenu = 0;
|
||||
for ($i = 0 ; $i < sizeof($menu_array) ; $i++)
|
||||
{
|
||||
$alt++;
|
||||
@ -152,9 +151,8 @@ function print_left_auguria_menu($db,$menu_array)
|
||||
}
|
||||
|
||||
// Menu niveau 0
|
||||
if ($menu_array[$i]['level']==0)
|
||||
if ($menu_array[$i]['level'] == 0)
|
||||
{
|
||||
if ($contenu == 1) print '<div class="menu_end"></div>'."\n";
|
||||
if ($menu_array[$i]['enabled'])
|
||||
{
|
||||
|
||||
@ -164,13 +162,11 @@ function print_left_auguria_menu($db,$menu_array)
|
||||
{
|
||||
print '<div class="menu_titre">'.$tabstring.'<font class="vmenudisabled">'.$menu_array[$i]['titre'].'</font></div>';
|
||||
}
|
||||
$contenu = 0;
|
||||
print '<div class="menu_top"></div>'."\n";
|
||||
}
|
||||
// Menu niveau > 0
|
||||
if ($menu_array[$i]['level'] > 0)
|
||||
{
|
||||
if ($menu_array[$i]['level']==1) $contenu = 1;
|
||||
|
||||
if ($menu_array[$i]['enabled'])
|
||||
{
|
||||
print '<div class="menu_contenu">'.$tabstring.'<a class="vsmenu" href="'.$url.'"'.($menu_array[$i]['target']?' target="'.$menu_array[$i]['target'].'"':'').'>'.$menu_array[$i]['titre'].'</a></div>';
|
||||
|
||||
@ -872,7 +872,6 @@ function print_left_eldy_menu($db,$menu_array)
|
||||
$alt=0;
|
||||
if (is_array($menu_array))
|
||||
{
|
||||
$contenu = 0;
|
||||
for ($i = 0 ; $i < sizeof($menu_array) ; $i++)
|
||||
{
|
||||
$alt++;
|
||||
@ -910,27 +909,26 @@ function print_left_eldy_menu($db,$menu_array)
|
||||
{
|
||||
print '<div class="menu_titre">'.$tabstring.'<font class="vmenudisabled">'.$menu_array[$i]['titre'].'</font></div>'."\n";
|
||||
}
|
||||
print '<div class="menu_top"></div>'."\n";
|
||||
}
|
||||
// Menu niveau > 0
|
||||
if ($menu_array[$i]['level'] > 0)
|
||||
{
|
||||
print '<div class="menu_contenu">';
|
||||
if ($menu_array[$i]['enabled'])
|
||||
{
|
||||
print '<div class="menu_contenu">';
|
||||
print $tabstring;
|
||||
if ($menu_array[$i]['url']) print '<a class="vsmenu" href="'.$menu_array[$i]['url'].'"'.($menu_array[$i]['target']?' target="'.$menu_array[$i]['target'].'"':'').'>';
|
||||
print $menu_array[$i]['titre'];
|
||||
if ($menu_array[$i]['url']) print '</a>';
|
||||
// If title is not pure text and contains a table, no carriage return added
|
||||
if (! strstr($menu_array[$i]['titre'],'<table')) print '<br>';
|
||||
print '</div>'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<div class="menu_contenu">';
|
||||
print $tabstring.'<font class="vsmenudisabled">'.$menu_array[$i]['titre'].'</font><br>';
|
||||
print '</div>'."\n";
|
||||
}
|
||||
print '</div>'."\n";
|
||||
}
|
||||
|
||||
// If next is a new block or end
|
||||
|
||||
@ -55,7 +55,7 @@ class MenuLeft {
|
||||
// ***** START *****
|
||||
|
||||
$langs->load("admin"); // Load translation file admin.lang
|
||||
$newmenu->add(DOL_URL_ROOT."/admin/index.php?leftmenu=setup", $langs->trans("Setup"));
|
||||
$newmenu->add(DOL_URL_ROOT."/admin/index.php?leftmenu=setup", $langs->trans("Setup"),0);
|
||||
$newmenu->add(DOL_URL_ROOT."/admin/company.php", $langs->trans("MenuCompanySetup"),1);
|
||||
$newmenu->add(DOL_URL_ROOT."/admin/modules.php", $langs->trans("Modules"),1);
|
||||
$newmenu->add(DOL_URL_ROOT."/admin/menus.php", $langs->trans("Menus"),1);
|
||||
@ -79,7 +79,7 @@ class MenuLeft {
|
||||
for ($i = 0 ; $i < sizeof($this->menu_array) ; $i++)
|
||||
{
|
||||
$alt++;
|
||||
if (empty($menu_array[$i]['level']))
|
||||
if (empty($this->menu_array[$i]['level']))
|
||||
{
|
||||
if (($alt%2==0))
|
||||
{
|
||||
@ -91,33 +91,42 @@ class MenuLeft {
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->menu_array[$i]['level']==0) {
|
||||
if ($this->menu_array[$i]['enabled'])
|
||||
print '<a class="vmenu" href="'.$this->menu_array[$i]['url'].'">'.$this->menu_array[$i]['titre'].'</a><br>';
|
||||
else
|
||||
print '<font class="vmenudisabled">'.$this->menu_array[$i]['titre'].'</font><br>';
|
||||
// Place tabulation
|
||||
$tabstring='';
|
||||
$tabul=($this->menu_array[$i]['level'] - 1);
|
||||
if ($tabul > 0)
|
||||
{
|
||||
for ($j=0; $j < $tabul; $j++)
|
||||
{
|
||||
$tabstring.=' ';
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->menu_array[$i]['level'] == 0) {
|
||||
if ($this->menu_array[$i]['enabled'])
|
||||
{
|
||||
print '<div class="menu_titre">'.$tabstring.'<a class="vmenu" href="'.$this->menu_array[$i]['url'].'"'.($this->menu_array[$i]['target']?' target="'.$this->menu_array[$i]['target'].'"':'').'>'.$this->menu_array[$i]['titre'].'</a></div>'."\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<div class="menu_titre">'.$tabstring.'<font class="vmenudisabled">'.$this->menu_array[$i]['titre'].'</font></div>'."\n";
|
||||
}
|
||||
print '<div class="menu_top"></div>'."\n";
|
||||
}
|
||||
if ($this->menu_array[$i]['level']==1) {
|
||||
if ($this->menu_array[$i]['enabled'])
|
||||
print '<a class="vsmenu" href="'.$this->menu_array[$i]['url'].'">'.$this->menu_array[$i]['titre'].'</a><br>';
|
||||
|
||||
if ($this->menu_array[$i]['level'] > 0) {
|
||||
print '<div class="menu_contenu">';
|
||||
|
||||
if ($this->menu_array[$i]['enabled'])
|
||||
print $tabstring.'<a class="vsmenu" href="'.$this->menu_array[$i]['url'].'">'.$this->menu_array[$i]['titre'].'</a><br>';
|
||||
else
|
||||
print '<font class="vsmenudisabled">'.$this->menu_array[$i]['titre'].'</font><br>';
|
||||
}
|
||||
if ($this->menu_array[$i]['level']==2) {
|
||||
if ($this->menu_array[$i]['enabled'])
|
||||
print ' <a class="vsmenu" href="'.$this->menu_array[$i]['url'].'">'.$this->menu_array[$i]['titre'].'</a><br>';
|
||||
else
|
||||
print ' <font class="vsmenudisabled">'.$this->menu_array[$i]['titre'].'</font><br>';
|
||||
}
|
||||
if ($this->menu_array[$i]['level']==3) {
|
||||
if ($this->menu_array[$i]['enabled'])
|
||||
print ' <a class="vsmenu" href="'.$this->menu_array[$i]['url'].'">'.$this->menu_array[$i]['titre'].'</a><br>';
|
||||
else
|
||||
print ' <font class="vsmenudisabled">'.$this->menu_array[$i]['titre'].'</font><br>';
|
||||
print $tabstring.'<font class="vsmenudisabled">'.$this->menu_array[$i]['titre'].'</font><br>';
|
||||
|
||||
print '</div>'."\n";
|
||||
}
|
||||
|
||||
// If next is a new block or end
|
||||
if (empty($menu_array[$i+1]['level']))
|
||||
if (empty($this->menu_array[$i+1]['level']))
|
||||
{
|
||||
print '<div class="menu_end"></div>'."\n";
|
||||
print "</div>\n";
|
||||
|
||||
@ -51,69 +51,60 @@ class MenuTop {
|
||||
{
|
||||
global $user,$conf,$langs,$dolibarr_main_db_name;;
|
||||
|
||||
print '<table class="tmenu" summary="topmenu"><tr class="tmenu">';
|
||||
print_start_menu_array();
|
||||
|
||||
// Menu Home
|
||||
print '<td class="tmenu">';
|
||||
print '<a href="'.DOL_URL_ROOT.'/index.php?mainmenu=home"'.($this->atarget?" target=$this->atarget":"").'>'.$langs->trans("Home").'</a>';
|
||||
print '</td>';
|
||||
$idsel='none';
|
||||
$classname='class="tmenu"';
|
||||
|
||||
// Put here top menu entries
|
||||
// ***** START *****
|
||||
print_start_menu_entry($idsel);
|
||||
print '<div class="mainmenu '.$idsel.'"><span class="mainmenu_'.$idsel.'" id="mainmenuspan_'.$idsel.'"></span></div>';
|
||||
print '<a '.$classname.' id="mainmenua_'.$idsel.'" href="'.$url.'"'.($tabMenu[$i]['atarget']?" target='".$tabMenu[$i]['atarget']."'":($atarget?" target=$atarget":"")).'>';
|
||||
print_text_menu_entry($langs->trans("Home"));
|
||||
print '</a>';
|
||||
print_end_menu_entry();
|
||||
|
||||
// print '<td class="tmenu">';
|
||||
// print '<a '.$classname.' href="'.DOL_URL_ROOT.'/thepage1.php>My menu entry 1</a>';
|
||||
// print '</td>';
|
||||
// print '<td class="tmenu">';
|
||||
// print '<a '.$classname.' href="'.DOL_URL_ROOT.'/thepage2.php>My menu entry 2</a>';
|
||||
// print '</td>';
|
||||
// ...
|
||||
|
||||
// ***** END *****
|
||||
|
||||
/*
|
||||
// Code to show personalized menus
|
||||
require_once(DOL_DOCUMENT_ROOT."/core/class/menubase.class.php");
|
||||
|
||||
$menuArbo = new Menubase($this->db,'empty','top');
|
||||
$tabMenu = $menuArbo->menuTopCharger(2,$_SESSION['mainmenu'],'empty');
|
||||
|
||||
for($i=0; $i<count($tabMenu); $i++)
|
||||
{
|
||||
if ($tabMenu[$i]['enabled'] == true)
|
||||
{
|
||||
$idsel=(empty($tabMenu[$i]['mainmenu'])?'id="none" ':'id="'.$tabMenu[$i]['mainmenu'].'" ');
|
||||
if ($tabMenu[$i]['right'] == true)
|
||||
{
|
||||
$url=DOL_URL_ROOT.$tabMenu[$i]['url'];
|
||||
if (! preg_match('/\?/',DOL_URL_ROOT.$tabMenu[$i]['url'])) $url.='?';
|
||||
else $url.='&';
|
||||
$url.='mainmenu='.$tabMenu[$i]['mainmenu'].'&leftmenu=';
|
||||
$url.="&idmenu=".$tabMenu[$i]['rowid'];
|
||||
if (! empty($_SESSION['idmenu']) && $tabMenu[$i]['rowid'] == $_SESSION['idmenu']) $classname='class="tmenusel"';
|
||||
else $classname='class="tmenu"';
|
||||
print '<td class="tmenu">';
|
||||
print '<a '.$classname.' '.$idsel.'href="'.$url.'"'.($this->atarget?" target=$this->atarget":($this->atarget?" target=$this->atarget":"")).'>';
|
||||
print $tabMenu[$i]['titre'];
|
||||
print '</a>';
|
||||
print '</td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! $this->hideifnotallowed)
|
||||
{
|
||||
print '<td class="tmenu">';
|
||||
print '<a class="tmenudisabled" '.$idsel.'href="#">'.$tabMenu[$i]['titre'].'</a>';
|
||||
print '</td>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
print '</tr></table>';
|
||||
print_end_menu_array();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function print_start_menu_array()
|
||||
{
|
||||
global $conf;
|
||||
if (preg_match('/bluelagoon|eldy|freelug|rodolphe|yellow|dev/',$conf->css)) print '<table class="tmenu" summary="topmenu"><tr class="tmenu">';
|
||||
else print '<ul class="tmenu">';
|
||||
}
|
||||
|
||||
function print_start_menu_entry($idsel)
|
||||
{
|
||||
global $conf;
|
||||
if (preg_match('/bluelagoon|eldy|freelug|rodolphe|yellow|dev/',$conf->css)) print '<td class="tmenu" id="mainmenutd_'.$idsel.'">';
|
||||
else print '<li class="tmenu" id="mainmenutd_'.$idsel.'">';
|
||||
}
|
||||
|
||||
function print_text_menu_entry($text)
|
||||
{
|
||||
global $conf;
|
||||
print '<span class="mainmenuaspan">';
|
||||
print $text;
|
||||
print '</span>';
|
||||
}
|
||||
|
||||
function print_end_menu_entry()
|
||||
{
|
||||
global $conf;
|
||||
if (preg_match('/bluelagoon|eldy|freelug|rodolphe|yellow|dev/',$conf->css)) print '</td>';
|
||||
else print '</li>';
|
||||
print "\n";
|
||||
}
|
||||
|
||||
function print_end_menu_array()
|
||||
{
|
||||
global $conf;
|
||||
if (preg_match('/bluelagoon|eldy|freelug|rodolphe|yellow|dev/',$conf->css)) print '</tr></table>';
|
||||
else print '</ul>';
|
||||
print "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
Loading…
Reference in New Issue
Block a user