[dev] Gollem :: Folders navigation

Michael M Slusarz slusarz at bigworm.colorado.edu
Wed Apr 7 15:31:24 PDT 2004


Quoting Joel Vandal <jvandal at infoteck.qc.ca>:

> Hi,
>
> Normally, the folder name is displayed on the header but when the 
> folder deep is big, you have to click a lot of time on "Up to 
> parent", w/ this patch (rought), you can click on each "Parent" 
> folders.
>
> Check this patch if it can be useful for others. Thanks Sylvain for 
> the suggestion.
>
> Index: header.inc
> ===================================================================
> RCS file: /repository/gollem/templates/manager/header.inc,v
> retrieving revision 1.28
> diff -r1.28 header.inc
> 21c21,36
> <     <b><?php echo $_SESSION['gollem'][$backend_key]['label'] ?></b>
> ---
>> <?php
>>
>> $parts = explode(DIRECTORY_SEPARATOR, Gollem::getDir($backend_key));
>>
>> $label = array();
>> for ($i = 1; $i <= count($parts); $i++) {
>>   $part = array_slice($parts, 0, $i);
>>   $dir = join(DIRECTORY_SEPARATOR, $part);
>>
>>   $up_link = 
>> Util::addParameter(Horde::applicationUrl('manager.php'), 
>> 'backend_key', $backend_key);
>>   $up_link = Util::addParameter($up_link, 'dir', $dir);
>>
>>   $label[] = Horde::link($up_link, _("Up to parent"), 'header') . 
>> $parts[$i-1] . '</a>';
>> }
>> ?>
>>     <b><?php echo join(DIRECTORY_SEPARATOR, $label) ; ?></b>

Very cool - I've gone ahead and implemented with the following changes:

1) The current directory should never be clickable (will refresh to the same
page)
2) Before there was no way of clicking to the base directory - i've 
added a link
titled '[Home]' to allow clicking to a user's base directory.
3) The parent icon was removed since it was unnecessary (clicking on 
the name of
the parent directory now does the same thing)

michael

______________________________________________
Michael Slusarz [slusarz at bigworm.colorado.edu]
The University of Colorado at Boulder


More information about the dev mailing list