Enhancement in ecm module

This commit is contained in:
Laurent Destailleur 2008-10-26 00:28:11 +00:00
parent d4fdb23618
commit f67962a049
2 changed files with 19 additions and 9 deletions

View File

@ -480,19 +480,23 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action) || $
if (in_array($val['id'],$expandedsectionarray)) $option='indexexpanded';
else $option='indexnotexpanded';
//print $option;
print '<tr>';
// Show tree graph pictos
print '<td align="left">';
print '<table class="nobordernopadding"><tr class="nobordernopadding"><td>';
tree_showpad($fulltree,$key);
$resarray=tree_showpad($fulltree,$key);
$a=$resarray[0];
$b=$resarray[1];
print '</td>';
// Show picto
print '<td valign="top">';
//print $val['fullpath']."(".$showline.")";
if (! in_array($val['id'],$expandedsectionarray)) $ref=img_picto('',DOL_URL_ROOT.'/theme/common/treemenu/plustop2.gif','',1);
else $ref=img_picto('',DOL_URL_ROOT.'/theme/common/treemenu/minustop2.gif','',1);
$n='2';
if ($b == 0 || ! in_array($val['id'],$expandedsectionarray)) $n='3';
if (! in_array($val['id'],$expandedsectionarray)) $ref=img_picto('',DOL_URL_ROOT.'/theme/common/treemenu/plustop'.$n.'.gif','',1);
else $ref=img_picto('',DOL_URL_ROOT.'/theme/common/treemenu/minustop'.$n.'.gif','',1);
$oldref=$ecmdirstatic->ref;
$ecmdirstatic->ref=$ref;
print $ecmdirstatic->getNomUrl(0,$option);

View File

@ -78,28 +78,34 @@ function is_in_subtree($fulltree,$parentid,$childid)
*
* @param fulltree Array of entries in correct order
* @param key Key of value to show picto
* @return int 1
* @return array (0 or 1 if at least one of this level after, 0 or 1 if at least one of higher level after)
*/
function tree_showpad(&$fulltree,$key,$selected=0)
{
$pos=1;
// Loop on each pos, because we will output an img for each pos
while ($pos <= $fulltree[$key]['level'] && $fulltree[$key]['level'] > 0)
{
// Process picto for column $pos
$atleastonofthislevelafter=0;
$nbofhigherlevelafter=0;
$found=0;
//print 'x'.$key;
foreach($fulltree as $key2 => $val2)
{
if ($found == 1)
if ($found == 1) // We are after the entry to show
{
if ($fulltree[$key2]['level'] > $pos)
{
$nbofhigherlevelafter++;
}
if ($fulltree[$key2]['level'] == $pos)
{
$atleastonofthislevelafter=1;
break;
}
if ($fulltree[$key2]['level'] < $pos)
if ($fulltree[$key2]['level'] <= $pos)
{
break;
}
@ -121,7 +127,7 @@ function tree_showpad(&$fulltree,$key,$selected=0)
$pos++;
}
return 1;
return array($atleastonofthislevelafter,$nbofhigherlevelafter);
}