PHP Class Chora, horde

Copyright 2000-2016 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.
Author: Anil Madhavapeddy ([email protected])
Author: Michael Slusarz ([email protected])
Mostra file Open project: horde/horde Class Usage Examples

Public Properties

Property Type Description
$fdcache string Cached data for formatDate().
$restricted array Cached data for isRestricted().
$rtcache array Cached data for readableTime().

Public Methods

Method Description
checkPerms ( $key ) TODO
fatal ( string $message, string $code = null ) Output an error page.
formInputs ( ) : string Generates hidden form fields with all required parameters.
formatDate ( integer $date ) : string Return formatted date information.
formatLogMessage ( string $log ) : string Formats a log message.
getAuthorEmail ( $name )
getFileViews ( string $where, string $rev ) : array Generate the link used for various file views.
getHistoryViews ( string $where ) : array Generate the link used for various history views.
getTags ( Horde_Vcs_Log $lg, string $where ) : array Return a list of tags for a given log entry.
header ( string $title ) Generates and prints the page header.
isRestricted ( string $where ) : boolean Check if the given item is restricted from being shown.
pretty ( string $mime_type, resource $fp ) : mixed Pretty-print the checked out copy, using Horde_Mime_Viewer.
readableTime ( integer $date, boolean $long = false ) : string Return a text description of how long its been since the file has been last modified.
showAuthorName ( string $name, $fullname = false ) : string Convert a commit-name into whatever the user wants.
sourceroots ( ) : array Returns the entries of $sourceroots that the current user has access to.
url ( string $script, string $uri = '', array $args = [], string $anchor = '' ) : string Generate a URL that links into Chora.
whereMenu ( string $where, string $onb = null ) : string Create the breadcrumb directory listing.

Protected Methods

Method Description
_getArgList ( $acts, $defaultActs, $args ) TODO

Method Details

_getArgList() protected static method

TODO
protected static _getArgList ( $acts, $defaultActs, $args )

checkPerms() public static method

TODO
public static checkPerms ( $key )

fatal() public static method

Output an error page.
public static fatal ( string $message, string $code = null )
$message string The verbose error message to be displayed.
$code string The HTTP error number (and optional text), for sending 404s or other codes if appropriate.

formInputs() public static method

Generates hidden form fields with all required parameters.
public static formInputs ( ) : string
return string The form fields, with session information if necessary.

formatDate() public static method

Return formatted date information.
public static formatDate ( integer $date ) : string
$date integer Number of seconds since epoch we wish to display.
return string The date formatted pursuant to Horde prefs.

formatLogMessage() public static method

Formats a log message.
public static formatLogMessage ( string $log ) : string
$log string The log message text.
return string The formatted message.

getAuthorEmail() public static method

public static getAuthorEmail ( $name )

getFileViews() public static method

Generate the link used for various file views.
public static getFileViews ( string $where, string $rev ) : array
$where string The current file path.
$rev string The current revision.
return array An array of file view links.

getHistoryViews() public static method

Generate the link used for various history views.
public static getHistoryViews ( string $where ) : array
$where string The current file path.
return array An array of file view links.

getTags() public static method

Return a list of tags for a given log entry.
public static getTags ( Horde_Vcs_Log $lg, string $where ) : array
$lg Horde_Vcs_Log The Horde_Vcs_Log object.
$where string The current filepath.
return array An array of linked tags.

header() public static method

Generates and prints the page header.
public static header ( string $title )
$title string The page title.

isRestricted() public static method

Check if the given item is restricted from being shown.
public static isRestricted ( string $where ) : boolean
$where string The current file path.
return boolean Is item allowed to be displayed?

pretty() public static method

Pretty-print the checked out copy, using Horde_Mime_Viewer.
public static pretty ( string $mime_type, resource $fp ) : mixed
$mime_type string File extension of the checked out file.
$fp resource File pointer to the head of the checked out copy.
return mixed The Horde_Mime_Viewer object which can be rendered or false on failure.

readableTime() public static method

Return a text description of how long its been since the file has been last modified.
public static readableTime ( integer $date, boolean $long = false ) : string
$date integer Number of seconds since epoch we wish to display.
$long boolean If true, display a more verbose date.
return string The human-readable date.

showAuthorName() public static method

Convert a commit-name into whatever the user wants.
public static showAuthorName ( string $name, $fullname = false ) : string
$name string Account name.
return string The transformed name.

sourceroots() public static method

Returns the entries of $sourceroots that the current user has access to.
public static sourceroots ( ) : array
return array The sourceroots that the current user has access to.

url() public static method

Generate a URL that links into Chora.
public static url ( string $script, string $uri = '', array $args = [], string $anchor = '' ) : string
$script string Name of the Chora script to link into.
$uri string The path being browsed.
$args array Key/value pair of any GET parameters to append.
$anchor string Anchor entity name.
return string The URL, with session information if necessary.

whereMenu() public static method

Create the breadcrumb directory listing.
public static whereMenu ( string $where, string $onb = null ) : string
$where string The current filepath.
$onb string If not null, the branch to add to the generated URLs.
return string The directory string.

Property Details

$fdcache public_oe static_oe property

Cached data for formatDate().
public static string $fdcache
return string

$restricted public_oe static_oe property

Cached data for isRestricted().
public static array $restricted
return array

$rtcache public_oe static_oe property

Cached data for readableTime().
public static array $rtcache
return array