PHP Класс Template

С версии: 1.0.0
Автор: Damjan
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$m_columnNames
$m_dbTableName
$m_keyColumnNames
$m_keyIsAutoIncrement

Открытые методы

Метод Описание
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

Описание методов

ChangeCharset() публичный статический Метод

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

GetAllFolders() публичный статический Метод

Returns an array containing the directories tree for the given path.
public static GetAllFolders ( array $p_folders ) : array
$p_folders array
Результат array $p_folders

GetAllTemplates() публичный статический Метод

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
Результат array

GetContents() публичный статический Метод

public static GetContents ( string $p_path ) : string
$p_path string
Результат string

GetFullPath() публичный статический Метод

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
Результат string

GetPath() публичный статический Метод

Get the relative path to the given file in the template directory.
public static GetPath ( $p_path, $p_filename ) : string
Результат string

GetTemplateFilterRegex() публичный статический Метод

Return an regular expression to filter template lists
public static GetTemplateFilterRegex ( boolean $p_sql = false ) : string
$p_sql boolean indicates usage for sql query
Результат string

InUse() публичный статический Метод

Returns TRUE if the template is being used in an Issue or Section.
public static InUse ( $p_templateName ) : boolean
Результат boolean

IsValidPath() публичный статический Метод

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
Результат boolean

OnUpload() публичный статический Метод

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.
Результат mixed TRUE on success, PEAR_Error on failure.

ProcessFile() публичный статический Метод

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

Template() публичный Метод

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

UpdateOnChange() публичный статический Метод

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
Результат mixed

UpdateStatus() публичный статический Метод

Sync the database with the filesystem.
public static UpdateStatus ( ) : void
Результат void

delete() публичный Метод

It does not take care on database info upgrade because it trusts of the cool Template::UpdateStatus() function.
public delete ( ) : mixed
Результат mixed

fileExists() публичный Метод

Return TRUE if the file exists.
public fileExists ( ) : boolean
Результат boolean

getAbsoluteUrl() публичный Метод

public getAbsoluteUrl ( ) : string
Результат string

getCacheLifetime() публичный Метод

public getCacheLifetime ( ) : integer
Результат integer

getLevel() публичный Метод

public getLevel ( ) : integer
Результат integer

getName() публичный Метод

public getName ( ) : string
Результат string

getTemplateId() публичный Метод

public getTemplateId ( ) : integer
Результат integer

getType() публичный Метод

public getType ( ) : integer
Результат integer

move() публичный Метод

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
Результат boolean true on succes or false on failure

setCacheLifetime() публичный Метод

public setCacheLifetime ( $p_lifetime ) : boolean
Результат boolean

setProperty() публичный Метод

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

Описание свойств

$m_columnNames публичное свойство

public $m_columnNames

$m_dbTableName публичное свойство

public $m_dbTableName

$m_keyColumnNames публичное свойство

public $m_keyColumnNames

$m_keyIsAutoIncrement публичное свойство

public $m_keyIsAutoIncrement