Enhancement in ecm file navigation
This commit is contained in:
parent
c0aba753ef
commit
481e10a18d
@ -377,7 +377,7 @@ class EcmDirectory // extends CommonObject
|
|||||||
$result='';
|
$result='';
|
||||||
|
|
||||||
$lien = '<a href="'.DOL_URL_ROOT.'/ecm/docmine.php?section='.$this->id.'">';
|
$lien = '<a href="'.DOL_URL_ROOT.'/ecm/docmine.php?section='.$this->id.'">';
|
||||||
if ($option == 'index') $lien = '<a href="'.DOL_URL_ROOT.'/ecm/index.php?section='.$this->id.'">';
|
if ($option == 'index') $lien = '<a href="'.DOL_URL_ROOT.'/ecm/index.php?section='.$this->id.'&sectionexpand=true">';
|
||||||
if ($option == 'indexexpanded') $lien = '<a href="'.DOL_URL_ROOT.'/ecm/index.php?section='.$this->id.'&sectionexpand=false">';
|
if ($option == 'indexexpanded') $lien = '<a href="'.DOL_URL_ROOT.'/ecm/index.php?section='.$this->id.'&sectionexpand=false">';
|
||||||
if ($option == 'indexnotexpanded') $lien = '<a href="'.DOL_URL_ROOT.'/ecm/index.php?section='.$this->id.'&sectionexpand=true">';
|
if ($option == 'indexnotexpanded') $lien = '<a href="'.DOL_URL_ROOT.'/ecm/index.php?section='.$this->id.'&sectionexpand=true">';
|
||||||
$lienfin='</a>';
|
$lienfin='</a>';
|
||||||
|
|||||||
@ -342,7 +342,7 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action) || $
|
|||||||
// Section
|
// Section
|
||||||
print '<td align="left">';
|
print '<td align="left">';
|
||||||
print '<table class="nobordernopadding"><tr class="nobordernopadding"><td>';
|
print '<table class="nobordernopadding"><tr class="nobordernopadding"><td>';
|
||||||
print tree_showpad($sectionauto,$key);
|
tree_showpad($sectionauto,$key);
|
||||||
print '</td><td valign="top">';
|
print '</td><td valign="top">';
|
||||||
print img_picto('','object_dir');
|
print img_picto('','object_dir');
|
||||||
print '</td><td valign="middle"> ';
|
print '</td><td valign="middle"> ';
|
||||||
@ -486,7 +486,7 @@ if (empty($action) || $action == 'file_manager' || eregi('refresh',$action) || $
|
|||||||
// Show tree graph pictos
|
// Show tree graph pictos
|
||||||
print '<td align="left">';
|
print '<td align="left">';
|
||||||
print '<table class="nobordernopadding"><tr class="nobordernopadding"><td>';
|
print '<table class="nobordernopadding"><tr class="nobordernopadding"><td>';
|
||||||
print tree_showpad($fulltree,$key);
|
tree_showpad($fulltree,$key);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
// Show picto
|
// Show picto
|
||||||
print '<td valign="top">';
|
print '<td valign="top">';
|
||||||
|
|||||||
@ -76,29 +76,52 @@ function is_in_subtree($fulltree,$parentid,$childid)
|
|||||||
/**
|
/**
|
||||||
* Show picto of a tree view
|
* Show picto of a tree view
|
||||||
*
|
*
|
||||||
* @param unknown_type $tab Array of entries in correct order
|
* @param fulltree Array of entries in correct order
|
||||||
* @param unknown_type $key Key of value to show picto
|
* @param key Key of value to show picto
|
||||||
|
* @return int 1
|
||||||
*/
|
*/
|
||||||
function tree_showpad(&$tab,$key,$selected=0)
|
function tree_showpad(&$fulltree,$key,$selected=0)
|
||||||
{
|
{
|
||||||
$pos=1;
|
$pos=1;
|
||||||
while ($pos <= $tab[$key]['level'] && $tab[$key]['level'] > 0)
|
while ($pos <= $fulltree[$key]['level'] && $fulltree[$key]['level'] > 0)
|
||||||
{
|
{
|
||||||
// Process picto for column $pos
|
// Process picto for column $pos
|
||||||
// \TODO If at least one of this level
|
|
||||||
$atleastonofthislevelafter=1;
|
$atleastonofthislevelafter=0;
|
||||||
|
$found=0;
|
||||||
|
//print 'x'.$key;
|
||||||
|
foreach($fulltree as $key2 => $val2)
|
||||||
|
{
|
||||||
|
if ($found == 1)
|
||||||
|
{
|
||||||
|
if ($fulltree[$key2]['level'] == $pos)
|
||||||
|
{
|
||||||
|
$atleastonofthislevelafter=1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if ($fulltree[$key2]['level'] < $pos)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($key2 == $key) $found=1;
|
||||||
|
}
|
||||||
|
//print $atleastonofthislevelafter;
|
||||||
|
|
||||||
if ($atleastonofthislevelafter)
|
if ($atleastonofthislevelafter)
|
||||||
{
|
{
|
||||||
if ($tab[$key]['level'] == $pos) print img_picto_common('','treemenu/branch.gif');
|
if ($fulltree[$key]['level'] == $pos) print img_picto_common('','treemenu/branch.gif');
|
||||||
else print img_picto_common('','treemenu/line.gif');
|
else print img_picto_common('','treemenu/line.gif');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($tab[$key]['level'] == $pos) print img_picto_common('','treemenu/branchbottom.gif');
|
if ($fulltree[$key]['level'] == $pos) print img_picto_common('','treemenu/branchbottom.gif');
|
||||||
else print img_picto_common('','treemenu/linebottom.gif');
|
else print img_picto_common('','treemenu/linebottom.gif');
|
||||||
}
|
}
|
||||||
$pos++;
|
$pos++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user