Chora Base Class.
Copyright 2000-2012 Horde LLC (http://www.horde.org/)
See the enclosed file COPYING for license information (GPL). If you
did not receive this file, see http://www.horde.org/licenses/gpl.
Methods summary
public static
|
#
fatal( string $message, string $code = null )
Output an error page.
Parameters
- $message
- The verbose error message to be displayed.
- $code
- <p>The HTTP error number (and optional text), for
sending 404s or other codes if appropriate.</p>
|
public static
string
|
#
url( string $script, string $uri = '', array $args = array(), string $anchor = '' )
Generate a URL that links into Chora.
Generate a URL that links into Chora.
Parameters
- $script
- Name of the Chora script to link into.
- $uri
- The path being browsed.
- $args
- Key/value pair of any GET parameters to append.
- $anchor
- Anchor entity name.
Returns
string The URL, with session information if necessary.
|
public static
string
|
#
formInputs( )
Generates hidden form fields with all required parameters.
Generates hidden form fields with all required parameters.
Returns
string The form fields, with session information if necessary.
|
public static
|
|
public static
array
|
#
sourceroots( )
Returns the entries of $sourceroots that the current user has access
to.
Returns the entries of $sourceroots that the current user has access
to.
Returns
array The sourceroots that the current user has access to.
|
public static
string
|
#
repositories( )
Generate a list of repositories available from this installation of
Chora.
Generate a list of repositories available from this installation of
Chora.
Returns
string XHTML code representing links to the repositories.
|
public static
mixed
|
#
pretty( string $mime_type, resource $fp )
Pretty-print the checked out copy, using Horde_Mime_Viewer.
Pretty-print the checked out copy, using Horde_Mime_Viewer.
Parameters
- $mime_type
- File extension of the checked out file.
- $fp
- <p>File pointer to the head of the checked out
copy.</p>
Returns
mixed The Horde_Mime_Viewer object which can be rendered or
false on failure.
|
public static
boolean
|
#
isRestricted( string $where )
Check if the given item is restricted from being shown.
Check if the given item is restricted from being shown.
Parameters
- $where
- The current file path.
Returns
boolean Is item allowed to be displayed?
|
public static
array
|
#
getFileViews( string $where, string $current )
Generate the link used for various file-based views.
Generate the link used for various file-based views.
Parameters
- $where
- The current file path.
- $current
- <p>The current view ('browsefile', 'patchsets',
'history', 'cvsgraph', or 'stats').</p>
Returns
array An array of file view links.
|
public static
array
|
#
getTags( Horde_Vcs_Log $lg, string $where )
Return a list of tags for a given log entry.
Return a list of tags for a given log entry.
Parameters
- $lg
- The Horde_Vcs_Log object.
- $where
- The current filepath.
Returns
array An array of linked tags.
|
public static
string
|
#
readableTime( integer $date, boolean $long = false )
Return a text description of how long its been since the file
has been last modified.
Return a text description of how long its been since the file
has been last modified.
Parameters
- $date
- Number of seconds since epoch we wish to display.
- $long
- If true, display a more verbose date.
Returns
string The human-readable date.
|
public static
string
|
#
showAuthorName( string $name, mixed $fullname = false )
Convert a commit-name into whatever the user wants.
Convert a commit-name into whatever the user wants.
Parameters
- $name
- Account name.
- $fullname
-
Returns
string The transformed name.
|
public static
|
|
public static
string
|
#
formatDate( integer $date )
Return formatted date information.
Return formatted date information.
Parameters
- $date
- Number of seconds since epoch we wish to display.
Returns
string The date formatted pursuant to Horde prefs.
|
public static
string
|
#
formatLogMessage( string $log )
Formats a log message.
Parameters
- $log
- The log message text.
Returns
string The formatted message.
|