PHP Class Template

Since: 1.0.0
Author: Damjan
Afficher le fichier Open project: sourcefabric/newscoop Class Usage Examples

Méthodes publiques

Свойство Type Description
$m_columnNames
$m_dbTableName
$m_keyColumnNames
$m_keyIsAutoIncrement

Méthodes publiques

Méthode Description
ChangeCharset ( $p_oFile, $p_dFile, $p_type, $p_charset )
GetAllFolders ( array $p_folders ) : array Returns an array containing the directories tree for the given path.
GetAllTemplates ( array $p_sqlOptions = null, boolean $p_update = true, boolean $p_useFilter = false, boolean $p_strict = false ) : array
GetContents ( string $p_path ) : string
GetFullPath ( string $p_path, string $p_filename ) : string Return the full path to the file.
GetPath ( $p_path, $p_filename ) : string Get the relative path to the given file in the template directory.
GetTemplateFilterRegex ( boolean $p_sql = false ) : string Return an regular expression to filter template lists
InUse ( $p_templateName ) : boolean Returns TRUE if the template is being used in an Issue or Section.
IsValidPath ( string $p_path, boolenan $p_checkIfExists = true ) : boolean Returns true if the template path is valid.
OnUpload ( $f_fileVarName, string $p_baseUpload, string $p_desiredName = null, string $p_charset = null ) : mixed Call this to upload a template file. Note: Template::UpdateStatus() will be called automatically for you if this is successful.
ProcessFile ( $p_tmpFile, $p_newFile, $p_charset = null )
Template ( $p_templateIdOrName = null ) A template is an HTML file with Campsite parser tags inside.
UpdateOnChange ( string $p_tplOrig, string $p_tplNew ) : mixed Update the Name field for a template on Renaming/Moving.
UpdateStatus ( ) : void Sync the database with the filesystem.
delete ( ) : mixed Deletes a template file.
fileExists ( ) : boolean Return TRUE if the file exists.
getAbsoluteUrl ( ) : string
getCacheLifetime ( ) : integer
getLevel ( ) : integer
getName ( ) : string
getTemplateId ( ) : integer
getType ( ) : integer
move ( string $p_current_folder, string $p_destination_folder ) : boolean Moves a template from current folder to destination folder.
setCacheLifetime ( $p_lifetime ) : boolean
setProperty ( $p_dbColumnName, $p_value, $p_commit = true, $p_isSql = false ) Wrapper around DatabaseObject::setProperty

Method Details

ChangeCharset() public static méthode

public static ChangeCharset ( $p_oFile, $p_dFile, $p_type, $p_charset )

GetAllFolders() public static méthode

Returns an array containing the directories tree for the given path.
public static GetAllFolders ( array $p_folders ) : array
$p_folders array
Résultat array $p_folders

GetAllTemplates() public static méthode

public static GetAllTemplates ( array $p_sqlOptions = null, boolean $p_update = true, boolean $p_useFilter = false, boolean $p_strict = false ) : array
$p_sqlOptions array
$p_update boolean
$p_useFilter boolean filter templates matching setting in SystemPreferences
$p_strict boolean if true, retrieves only template (tpl) files
Résultat array

GetContents() public static méthode

public static GetContents ( string $p_path ) : string
$p_path string
Résultat string

GetFullPath() public static méthode

Return the full path to the file.
public static GetFullPath ( string $p_path, string $p_filename ) : string
$p_path string Path of the file starting from the base template directory.
$p_filename string
Résultat string

GetPath() public static méthode

Get the relative path to the given file in the template directory.
public static GetPath ( $p_path, $p_filename ) : string
Résultat string

GetTemplateFilterRegex() public static méthode

Return an regular expression to filter template lists
public static GetTemplateFilterRegex ( boolean $p_sql = false ) : string
$p_sql boolean indicates usage for sql query
Résultat string

InUse() public static méthode

Returns TRUE if the template is being used in an Issue or Section.
public static InUse ( $p_templateName ) : boolean
Résultat boolean

IsValidPath() public static méthode

Returns true if the template path is valid.
public static IsValidPath ( string $p_path, boolenan $p_checkIfExists = true ) : boolean
$p_path string
$p_checkIfExists boolenan
Résultat boolean

OnUpload() public static méthode

Call this to upload a template file. Note: Template::UpdateStatus() will be called automatically for you if this is successful.
public static OnUpload ( $f_fileVarName, string $p_baseUpload, string $p_desiredName = null, string $p_charset = null ) : mixed
$p_baseUpload string Directory path to add to the base template directory.
$p_desiredName string Desired name of the file.
$p_charset string Desired character set of the file.
Résultat mixed TRUE on success, PEAR_Error on failure.

ProcessFile() public static méthode

public static ProcessFile ( $p_tmpFile, $p_newFile, $p_charset = null )

Template() public méthode

A template is an HTML file with Campsite parser tags inside.
public Template ( $p_templateIdOrName = null )

UpdateOnChange() public static méthode

It is called before any UpdateStatus() when renaming/moving a template to avoid a new Id is set for the changed template.
public static UpdateOnChange ( string $p_tplOrig, string $p_tplNew ) : mixed
$p_tplOrig string The original template Name
$p_tplNew string The new template Name
Résultat mixed

UpdateStatus() public static méthode

Sync the database with the filesystem.
public static UpdateStatus ( ) : void
Résultat void

delete() public méthode

It does not take care on database info upgrade because it trusts of the cool Template::UpdateStatus() function.
public delete ( ) : mixed
Résultat mixed

fileExists() public méthode

Return TRUE if the file exists.
public fileExists ( ) : boolean
Résultat boolean

getAbsoluteUrl() public méthode

public getAbsoluteUrl ( ) : string
Résultat string

getCacheLifetime() public méthode

public getCacheLifetime ( ) : integer
Résultat integer

getLevel() public méthode

public getLevel ( ) : integer
Résultat integer

getName() public méthode

public getName ( ) : string
Résultat string

getTemplateId() public méthode

public getTemplateId ( ) : integer
Résultat integer

getType() public méthode

public getType ( ) : integer
Résultat integer

move() public méthode

It does not take care on database info upgrade because it trusts of the cool Template::UpdateStatus() function.
public move ( string $p_current_folder, string $p_destination_folder ) : boolean
$p_current_folder string
$p_destination_folder string
Résultat boolean true on succes or false on failure

setCacheLifetime() public méthode

public setCacheLifetime ( $p_lifetime ) : boolean
Résultat boolean

setProperty() public méthode

Wrapper around DatabaseObject::setProperty
public setProperty ( $p_dbColumnName, $p_value, $p_commit = true, $p_isSql = false )

Property Details

$m_columnNames public_oe property

public $m_columnNames

$m_dbTableName public_oe property

public $m_dbTableName

$m_keyColumnNames public_oe property

public $m_keyColumnNames

$m_keyIsAutoIncrement public_oe property

public $m_keyIsAutoIncrement