Arbit - project tracking

Arbit - project tracking

API documentation :: Docs For Class arbitViewTemplateFunctions

Core::View::arbitViewTemplateFunctions

Class arbitViewTemplateFunctions

Custom template helper functions used by the xhtml view handler.

Custom template helper functions used by the xhtml view handler.

Author(s):
Version:   $Revision: 1605 $
License:   GPL

Member Variables

protected static arbitDateTimeFormatter $dateFormatter
Instance of arbit date formatter used to format given timestamps

Instance of arbit date formatter used to format given timestamps

protected static array $overridePaths
Template override paths

Template override paths

protected static arbitTranslationManager $translationManager
Cached translation manager object

Cached translation manager object

Method Summary

public static string formatDate( $timestamp , [ $format = 'full'] )
Get formatted date
public static mixed getArrayElement( $array , $element )
Get element from array Get on element from array, specified by its index position. either use positive number to get the nth element, or negitive numbers to get the nth element from the end of the array, where -1 means the last element in the array.
public static ezcTemplateCustomFunctionDefinition getCustomFunctionDefinition( $name )
Return function definition for function name
public static array getDiff( $old , $new , [ $type = 'text'] )
Calculate and return diff Calculate and return the diff of the given type for the given input.
public static array getFormValues( $definition )
Get form values Receive all form values for the current form from the prior request. be used to maintain form values in case of an error.
public static void getPathsFromArray( $array )
getRecursiveIteratorIterator
public static arbitViewProjectModel getProjectData( )
Get project data Return the project data for the currently selected project.
public static arbitTemplateRecursiveIteratorIterator getRecursiveIteratorIterator( $array )
Return RecursiveIteratorIterator for recursive array Build and return a RecursiveIteratorIterator to iterate over recursive arrays in templates.
public static string getTemplatePath( $file )
Get correct template file from path
public static string getUrl( $controller , [ $action = 'index'] , [ $subaction = null] , [ $parameters = array()] )
Get a absolute URL from request configuration Builds an absolute URL for inclusion in your tempaltes mapping the given request configuration.
public static string showTranslateable( $object )
Show a translateable object Display a translateable object, which usually means it should be translated accordingly to the currently set language, which is not yet implemented.
public static string stripNonPrintable( $string )
Strip non printable characters from string Returns a string with all non-printable characters stripped from the string.
public static string tabsToSpaces( $string , [ $tabWidth = 8] )
Converts tabs to spaces
public static string translate( $text , [ $params = array()] , [ $context = null] , [ $comment = null] )
Translate a string Translates a given string with replaced values, just like the tr template block. possible. to statically extract translation strings. whenever possible.
public static array varDump( $var )
Variable dumper Simple wrapper around PHPs var_dump(), which implements recursion detection, as opposed to the default template debug function.

Methods

formatDate

static string formatDate( int $timestamp , [string $format = 'full'] )

Get formatted date

Get formatted date Format given timestamp based on users timezone and a given date format string. The string may either be "user" for the user configured format, or one of the formats, which can be understand by the arbitDateTimeFormatter, which currently are:

  • full, long, medium, short
  • fullDate, longDate, mediumDate, shortDate
  • fullTime, longTime, mediumTime, shortTime

Parameters:
Name Type Description
$timestamp int
$format string

getArrayElement

static mixed getArrayElement( $array , int $element )

Get element from array Get on element from array, specified by its index position. either use positive number to get the nth element, or negitive numbers to get the nth element from the end of the array, where -1 means the last element in the array.

Get element from array Get on element from array, specified by its index position. You may either use positive number to get the nth element, or negitive numbers to get the nth element from the end of the array, where -1 means the last element in the array.

Parameters:
Name Type Description
$array array
$element int

getCustomFunctionDefinition

static ezcTemplateCustomFunctionDefinition getCustomFunctionDefinition( string $name )

Return function definition for function name

Return function definition for function name

Parameters:
Name Type Description
$name string

getDiff

static array getDiff( mixed $old , mixed $new , [string $type = 'text'] )

Calculate and return diff Calculate and return the diff of the given type for the given input.

Calculate and return diff Calculate and return the diff of the given type for the given input. Type may be either 'line', 'array', or 'text', while the method defaults to text diff. The returned array is documented at the repsective diff algorithm implementation and may be slightly different depending on the used algorithm.

Parameters:
Name Type Description
$old mixed
$new mixed
$type string

getFormValues

static array getFormValues( $definition )

Get form values Receive all form values for the current form from the prior request. be used to maintain form values in case of an error.

Get form values Receive all form values for the current form from the prior request. Can be used to maintain form values in case of an error. Receives an array with the form value definition, which should look like:

  1.   array(
  2.       'name' => 'string',
  3.       'mail' => 'string',
  4.       ...
  5.   )
Available types are "string", "number" and "array".

Parameters:
Name Type Description
$definition array

getPathsFromArray

static void getPathsFromArray( $array )

getRecursiveIteratorIterator

getRecursiveIteratorIterator

Parameters:
Name Type Description
$array array

getProjectData

static arbitViewProjectModel getProjectData( )

Get project data Return the project data for the currently selected project.

Get project data Return the project data for the currently selected project.

getRecursiveIteratorIterator

static arbitTemplateRecursiveIteratorIterator getRecursiveIteratorIterator( $array )

Return RecursiveIteratorIterator for recursive array Build and return a RecursiveIteratorIterator to iterate over recursive arrays in templates.

Return RecursiveIteratorIterator for recursive array Build and return a RecursiveIteratorIterator to iterate over recursive arrays in templates.

Parameters:
Name Type Description
$array array

getTemplatePath

static string getTemplatePath( string $file )

Get correct template file from path

Get correct template file from path

Parameters:
Name Type Description
$file string

getUrl

static string getUrl( string $controller , [string $action = 'index'] , [string $subaction = null] , [ $parameters = array()] )

Get a absolute URL from request configuration Builds an absolute URL for inclusion in your tempaltes mapping the given request configuration.

Get a absolute URL from request configuration Builds an absolute URL for inclusion in your tempaltes mapping the given request configuration.

Parameters:
Name Type Description
$controller string
$action string
$subaction string
$parameters array

showTranslateable

static string showTranslateable( arbitTranslateable $object )

Show a translateable object Display a translateable object, which usually means it should be translated accordingly to the currently set language, which is not yet implemented.

Show a translateable object Display a translateable object, which usually means it should be translated accordingly to the currently set language, which is not yet implemented.

Parameters:
Name Type Description
$object arbitTranslateable

stripNonPrintable

static string stripNonPrintable( string $string )

Strip non printable characters from string Returns a string with all non-printable characters stripped from the string.

Strip non printable characters from string Returns a string with all non-printable characters stripped from the string.

Parameters:
Name Type Description
$string string

tabsToSpaces

static string tabsToSpaces( string $string , [int $tabWidth = 8] )

Converts tabs to spaces

Converts tabs to spaces Returns a string with all leading tabs characters converted to $tabWidth spaces and other tab chars converted to one space

Parameters:
Name Type Description
$string string
$tabWidth int

translate

static string translate( string $text , [ $params = array()] , [string $context = null] , [string $comment = null] )

Translate a string Translates a given string with replaced values, just like the tr template block. possible. to statically extract translation strings. whenever possible.

Translate a string Translates a given string with replaced values, just like the tr template block. This template function should be used as seldom as possible. Its results are not cached statically and it is not possible to statically extract translation strings. Use the template block whenever possible.

Parameters:
Name Type Description
$text string
$params array
$context string
$comment string

varDump

static array varDump( mixed $var )

Variable dumper Simple wrapper around PHPs var_dump(), which implements recursion detection, as opposed to the default template debug function.

Variable dumper Simple wrapper around PHPs var_dump(), which implements recursion detection, as opposed to the default template debug function.

Parameters:
Name Type Description
$var mixed
Documentation generated on Mon, 05 Apr 2010 14:01:56 +0200 by phpDocumentor 1.4.3