iconlink ($html_elt, $path)
diricon ($templ, $node, $dir)
dirname ($templ, $node, $dir)
fileicon ($templ, $node, $dir)
filename ($templ, $node, $dir)
filesize ($templ, $node, $dir)
modtime ($templ, $node, $dir)
indextime ($templ, $node, $dir)
descexpand ($templ, $node, $dir, $releaseid)
rowclass ($templ, $line)
direxpand ($templ, $dir)
printdir ($dir)
next_annot ($currev, $r, $bg)
printfile ($raw)
This script manages navigation across the source-tree and individual file display.
iconlink ($html_elt, $path)
Internal function iconlink
is a support routine for diricon
and fileicon
. It works around the protection implemented in fileref
which prevents from inserting HTML elements in the "description".
$templ
a string containing the HTML element without delimiters
$path
a string containing the path of the icon file
Custom delimiters are added to the HTML element which is transformed into a file link by fileref
. The custom delimiters are replaced by standard HTML delimiters in the returned link which is then sent back to caller.
diricon ($templ, $node, $dir)
Function diricon
is a "$variable" substitution function. It returns an HTML-string containing an < A >
block surrounding an < IMG >
tag for a folder icon. The link allows to jump to the directory.
$templ
a string containing the template (empty for a "variable")
$node
a string containing the name of the directory
$dir
a string containing the name of the parent directory
If parameters 'iconfolder'
and 'diricon'
have been defined, use the designated icon; otherwise revert to the default Apache icon.
dirname ($templ, $node, $dir)
Function dirname
is a "$variable" substitution function. It returns an HTML-string containing an < A >
tag linking to the directory.
$templ
a string containing the template (empty for a "variable")
$node
a string containing the name of the directory
$dir
a string containing the name of the parent directory
fileicon ($templ, $node, $dir)
Function fileicon
is a "$variable" substitution function. It returns an HTML-string containing an < A >
block surrounding an < IMG >
tag for a file icon. The link allows to jump to the file.
$templ
a string containing the template (empty for a "variable")
$node
a string containing the name of the file
$dir
a string containing the name of the parent directory
If parameters 'iconfolder'
and various icon descriptors have been defined, use the designated icon; otherwise revert to the default Apache icon.
filename ($templ, $node, $dir)
Function filename
is a "$variable" substitution function. It returns a HTML-string containing an < A >
tag linking to the file.
$templ
a string containing the template (empty for a "variable")
$node
a string containing the name of the file
$dir
a string containing the name of the parent directory
filesize ($templ, $node, $dir)
Function filesize
is a "$function" substitution function. It returns its expanded argument, inserting the file size where appropriate.
$templ
a string containing the template (i.e. the function argument)
$node
a string containing the name of the file
$dir
a string containing the name of the parent directory
In the present implementation, specifying a size unit in the argument makes no difference. The size is "scaled" according to its textual length.
modtime ($templ, $node, $dir)
Function modtime
is a "$variable" substitution function. It returns a human-readable date/time string for the file last-modification date.
$templ
a string containing the template (empty for a "variable")
$node
a string containing the name of the file
$dir
a string containing the name of the parent directory
The last-modification date is extracted from the database.
indextime ($templ, $node, $dir)
Function indextime
is a "$variable" substitution function. It returns a human-readable date/time string for the file indexation date by genxref.
$templ
a string containing the template (empty for a "variable")
$node
a string containing the name of the file
$dir
a string containing the name of the parent directory
The indexation date is extracted from the database.
If it does not exist (file was never indexed or modified since indexation), a single dash is return.
descexpand ($templ, $node, $dir, $releaseid)
Function descexpand
is a "$function" substitution function. It returns a short description for a file or a subdirectory in a directory listing. If no description can be extracted, the called support routines MUST return the string " " to keep the table looking pretty.
$templ
a string containing the template (empty for a "variable")
$node
a string containing the name of the file
$dir
a string containing the name of the parent directory
$releaseid
a string containing the version name
Presently, not used.
Control is passed to custom function located in Local.pm.
rowclass ($templ, $line)
Function indextime
is a "$variable" substitution function. It returns a CSS class name depending on line parity.
$templ
a string containing the template (empty for a "variable")
$line
an integer containing the line number of the display
direxpand ($templ, $dir)
Function direxpand
is a "$function" substitution function. It returns its template argument expanded for every node in the directory.
$templ
a string containing the template
$dir
a string containing the directory name
The directory content is obtained from the storage engine.
The template is expanded depending on the nature of the node, file or directory, because processing of the nested substitutions is slightly different in each case.
printdir ($dir)
Procedure printdir
retrieves the 'htmldir'
template and launches template expansion.
$dir
a string containing the directory name
The procedure dispatches to dirdesc
(located in Local.pm) for a description of the directory and to direxpand
for content edition.
next_annot ($currev, $r, $bg)
Function next_annot
returns an HTML < SPAN >
block containing revision and author information for the next file line.
$currev
a string containing the requested version for the file
$r
a reference to a string containing the revision of the previous line
$bg
a reference to a flag toggling between 0 and 1
References allow to keep values between calls.
It returns an empty string if the repository manager has no annotation (either by design, e.g. plain files, or disabled by configuration parameters).
The returned block is a blank string if the line is part of the same change set as the previous line (to have a cleaner screen).
Revision information is checked for space overflow and eventually truncated as per repository rule.
Finally, a CSS class is computed (latest revision or alternating styles).
printfile ($raw)
Procedure printfile
is the main driver for node display.
$raw
a "boolean" requesting raw mode if non zero
It checks first for a directory described by global variable $pathname
to be handled by printdir
.
In raw mode, source file is output "as is", without any editing or highlighting.
Various information related to the source file are retrieved (last indexation time, VCS annotations, ...). They are checked and/or prepared for mixed output with source lines.
If possible, links with other development tools are created and placed in the resulting HTML page.
Selects the correct header and footer and launches printfile
for the real job.