Class PHPDS_template

Description

PHPDevShell is a RAD Framework aimed at developing administrative applications.

  • author: Jason Schoeman
  • version: 1.0.2 (greg)
  • copyright: Copyright (C) 2007 Jason Schoeman, All rights reserved.
  • link: http://www.phpdevshell.org
  • license: GNU/LGPL,

Located in /PHPDS_template.class.php (line 14)

PHPDS_dependant
   |
   --template
      |
      --PHPDS_template
Variable Summary
Method Summary
void addCssFileToHead ([string $cssRelativePath = ''], [ $media = 'screen, projection'])
void addCSSToHead ([string $css = ''])
void addJsFileToHead ([string $jsRelativePath = ''])
void addJsToHead ([string $js = ''])
void addToHead ([string $extraHead = ''])
string busy (string $busy, [mixed $return = 'print'])
string critical (string $critical, [mixed $return = 'print'], [mixed $log = 'log'], [ $mail = 'mailadmin'])
void debugInfo (string $count_queries)
string error (string $error, [mixed $return = 'print'], [mixed $log = 'log'])
integer extendMenuLoop (integer $extended_menu_id)
void getPiece ($name $name, [$module $module = false])
string getTemplate ()
void getTpl ([string $load_view = false], [string $plugin_override = false])
nothing heading (string $heading, [ $return = 'print'])
string htmlEntityDecode (string $string_to_decode)
void icon (string $name, [Title $title = false], [int $size = 16], [string $class = 'icon'], [string $type = '.png'], [boolean $return = true])
nothing info (string $information, [ $return = 'print'])
void loadControllerFile (int $menu_id, [ $include_model = false])
void loginForm ([ $return = false])
void loginFormHeading ([ $return = false])
string message (string $message, [mixed $return = 'print'])
void modPrint (string $moduleName, string $string)
string note (string $note, [mixed $return = 'print'])
string notice (string $notice, [mixed $return = 'print'])
string ok (string $ok, [mixed $return = 'print'], [mixed $log = 'log'])
string outputAbsoluteURL ([mixed $return = 'print'])
void outputCharset ([ $return = false])
void outputFooter ()
void outputGroup ()
string outputHead ([boolean $return = false])
void outputLanguage ([ $return = false])
void outputLoginLink ()
void outputLogo ()
void outputMenu ()
string outputMetaDescription ([mixed $return = 'print'])
string outputMetaKeywords ([mixed $return = 'print'])
void outputRole ()
void outputScript ()
string outputScriptIcon ([boolean $return = false])
string outputSkin ([mixed $return = 'print'])
void outputTextLogo ()
void outputTime ()
void outputTitle ()
void runTemplate ()
string scripthead (string $scripthead, [mixed $return = 'print'])
void scriptLogo (string $menu_link, string $active_plugin, [ $alias = null])
void setPiece ($name $name, [$data $data = null])
void startBuffering ()
void tip (string $text, [boolean $print = false])
string warning (string $warning, [mixed $return = 'print'], [mixed $log = 'log'])
Variables
string $CDN (line 151)

Content Distribution Network.

If you are running a very large site, you might want to consider running a dedicated light http server (httpdlight, nginx) that only serves static content like images and static files, call it a CDN if you like. By adding a host here 'http://192.34.22.33/project/cdn', all images etc, of PHPDevShell will be loaded from this address.

  • access: protected
string $controller (line 85)

Modify Output Controller content.

  • access: public
string $debugStr = false (line 104)

Assign this variable if you would like to debug your script, it will show on critical errors as well.

It will parse anything that is assigned to it.

  • access: public
array $global (line 110)

Use this to have global available variables throughout scripts. For instance in hooks.

  • access: public
string $loginMessage (line 135)

Sends a message to login form.

  • access: public
string $modifyHead = '' (line 20)

Adds content to head of page.

  • access: public
mixed $modifyOutputBreadcrumbs = false (line 70)

Modify Output Breadcrumbs.

  • access: public
mixed $modifyOutputController = false (line 80)

Modify Output Controller.

  • access: public
mixed $modifyOutputFooter = false (line 75)

Modify Output Footer.

  • access: public
mixed $modifyOutputGroup = false (line 55)

Modify Output Group.

  • access: public
mixed $modifyOutputLoginLink = false (line 40)

Modify Output Login Link.

  • access: public
mixed $modifyOutputLogo = false (line 30)

Modify Output Logo

  • access: public
mixed $modifyOutputMenu = false (line 65)

Modify Output Menu.

  • access: public
mixed $modifyOutputRole = false (line 50)

Modify Output Role.

  • access: public
mixed $modifyOutputTextLogo = false (line 25)

Modify Output Text Logo

  • access: public
mixed $modifyOutputTime = false (line 35)

Modify Output Time

  • access: public
mixed $modifyOutputTitle = false (line 60)

Modify Output Title.

  • access: public
mixed $modifyOutputUser = false (line 45)

Modify Output User.

  • access: public
array $module = array() (line 122)

Contains module html sniplets.

  • access: public
array $pieces (line 142)

Repository of data pieces to be used by the actual Theme code

  • since: v3.1.0
  • access: protected
array $skipLogin = false (line 116)

Use this to have global available variables throughout scripts. For instance in hooks.

  • access: public
array $stopScript (line 97)

This variable is used to activate a stop script command, it will be used to end a script immediately while still finishing compiling the template.

Usage Example :

  1.  // This wil make the script stop (not PHPDevShell) while still finishing the template to the end.
  2.  $template->stopScript array('type'=>'auth','message'=>'The script stopped cause I wanted it to.');

  • access: public
string $templateName (line 129)

Name of the Theme to use (previously known as template)

  • since: v3.1.0
  • access: public

Inherited Variables

Inherited from template

template::$active_language
template::$cron_output
template::$HOOK
template::$hook_array
template::$hook_request
template::$HTML
template::$modify_output_active_info
template::$modify_output_breadcrumbs
template::$modify_output_footer
template::$modify_output_menu
template::$modify_output_script
template::$modify_output_title
template::$view

Inherited from PHPDS_dependant

PHPDS_dependant::$dependance
PHPDS_dependant::$parent
Methods
addCssFileToHead (line 260)

Will add any css path to the <head></head> tags of your document.

  • access: public
void addCssFileToHead ([string $cssRelativePath = ''], [ $media = 'screen, projection'])
  • string $cssRelativePath
  • $media
addCSSToHead (line 296)

Will add any css to the <head></head> tags of your document adding script tags.

  • access: public
void addCSSToHead ([string $css = ''])
  • string $css
addJsFileToHead (line 269)

Will add any js path to the <head></head> tags of your document.

  • access: public
void addJsFileToHead ([string $jsRelativePath = ''])
  • string $jsRelativePath
addJsToHead (line 287)

Will add any js to the <head></head> tags of your document adding script tags.

  • access: public
void addJsToHead ([string $js = ''])
  • string $js
addToHead (line 278)

Will add any content to the <head></head> tags of your document.

  • access: public
void addToHead ([string $extraHead = ''])
  • string $extraHead
busy (line 971)

This returns/prints a busy of the script being executed. Intended to be used by the developer.

  • return: Busy string.
  • author: Jason Schoeman
  • access: public
string busy (string $busy, [mixed $return = 'print'])
  • string $busy: This is the message that will be displayed.
  • mixed $return: default is print, can be set true, print, return.
critical (line 901)

This returns/prints a critical message regarding the active script. Intended to be used by the developer.

  • return: Critical string.
  • author: Jason Schoeman
  • access: public
string critical (string $critical, [mixed $return = 'print'], [mixed $log = 'log'], [ $mail = 'mailadmin'])
  • string $critical: This is the message that will be displayed.
  • mixed $return: default is print, can be set true, print, return.
  • mixed $log: default is log, can be set true, print, return.
  • $mail
debugInfo (line 1503)

Prints the number of queries used to the gui.

  • access: public
void debugInfo (string $count_queries)
  • string $count_queries
error (line 867)

This returns/prints a error message regarding the active script. Intended to be used by the developer where exceptions are caught.

  • return: Error string.
  • author: Jason Schoeman
  • access: public
string error (string $error, [mixed $return = 'print'], [mixed $log = 'log'])
  • string $error: This is the message that will be displayed.
  • mixed $return: default is print, can be set true, print, return.
  • mixed $log: default is log, can be set true, print, return.
executeController (line 1100)

Executes the controller.

  • author: Jason Schoeman
  • access: public
void executeController ()
extendMenuLoop (line 1072)

This function support output_script by looking deeper into menu structure to find last linked menu item that is not linked to another.

  • access: public
integer extendMenuLoop (integer $extended_menu_id)
  • integer $extended_menu_id
getPiece (line 1542)

returns a piece from the repository, optionnaly throught a module

  • author: greg <greg@phpdevshell.org>
  • version: 1.0
  • since: v3.1.0
  • date: 20110309 (v1.0) (greg) added
  • access: public
void getPiece ($name $name, [$module $module = false])
  • $name $name: string, the name of the piece to fetch
  • $module $module: string or boolean, (optionnal) the name of the module to use, true to use a module with the piece name, false not to use a module
getTemplate (line 1425)

Get and return the supposed to run template.

  • return: if not found, return default.
  • author: Jason Schoeman
  • access: public
string getTemplate ()
getTpl (line 1445)

Gets the correct location of a tpl file, will return full path, can be a view.tpl or view.tpl.php files.

  • access: public
void getTpl ([string $load_view = false], [string $plugin_override = false])
  • string $load_view
  • string $plugin_override: If another plugin is to be used in the directory.
heading (line 729)

This returns/prints a heading discription of the script being executed. Intended to be used by the developer.

  • author: Jason Schoeman
  • version: 1.1
  • date: 20110309 (v1.1) (greg) changed to use the pieces repository
  • date: 20110309 (v1.2) (jason) good idea but it wont work as heading is not mandatory in controllers.
  • access: public
nothing heading (string $heading, [ $return = 'print'])
  • string $heading: This is the message that will be displayed as the heading.
  • $return
htmlEntityDecode (line 1525)

Convert all HTML entities to their applicable characters.

  • access: public
string htmlEntityDecode (string $string_to_decode)
  • string $string_to_decode
icon (line 774)

This method will load given png icon from icon database,

  • access: public
void icon (string $name, [Title $title = false], [int $size = 16], [string $class = 'icon'], [string $type = '.png'], [boolean $return = true])
  • string $name: Icon name without extention.
  • Title $title: of given image.
  • int $size: The size folder to look within.
  • string $class: If an alternative class must be added to image.
  • string $type: File type.
  • boolean $return: Default is false, if set true, the heading will return instead of print.
info (line 752)

This returns/prints info of the script being executed. Intended to be used by the developer.

  • author: Jason Schoeman
  • version: 1.1
  • date: 20110309 (v1.1) (greg) changed to use the pieces repository
  • date: 20110309 (v1.2) (jason) good idea but it wont work as info is not mandatory in controllers.
  • access: public
nothing info (string $information, [ $return = 'print'])
  • string $information: This is the message that will be displayed as the info.
  • $return

Redefinition of:
PHPDS_dependant::info()
DEPRECATED: alias for _log()
loadControllerFile (line 1339)

Will attempt to load controller file from various locations.

  • author: Jason Schoeman
  • version: 1.0.1
  • date: 20100917 (v1.0) (Jason)
  • date: 20110308 (v1.0.1) (greg) loadFile returns an exact false when the file is not found
  • access: public
void loadControllerFile (int $menu_id, [ $include_model = false])
  • int $menu_id
  • $include_model
loginForm (line 1408)

Executes the login.

  • author: Jason Schoeman
  • access: public
void loginForm ([ $return = false])
  • $return
loginFormHeading (line 1369)

Login heading messages.

  • author: Jason Schoeman
  • access: public
void loginFormHeading ([ $return = false])
  • $return
message (line 992)

This returns/prints a message of the script being executed. Intended to be used by the developer.

  • return: Message string.
  • author: Jason Schoeman
  • access: public
string message (string $message, [mixed $return = 'print'])
  • string $message: This is the message that will be displayed.
  • mixed $return: default is print, can be set true, print, return.
modPrint (line 454)

Print a string via a module and returns the result

  • author: greg
  • version: 1.0
  • date: 20100920 (v1.0) (greg) created
  • access: public
void modPrint (string $moduleName, string $string)
  • string $moduleName: the module to use
  • string $string: the string to print (several strings can be provided)
note (line 1013)

This returns/prints a note of the script being executed. Intended to be used by the developer.

  • return: Note string.
  • author: Jason Schoeman
  • access: public
string note (string $note, [mixed $return = 'print'])
  • string $note: This is the message that will be displayed.
  • mixed $return: default is print, can be set true, print, return.
notice (line 950)

This returns/prints a notice of the script being executed. Intended to be used by the developer.

  • return: Notice string.
  • author: Jason Schoeman
  • access: public
string notice (string $notice, [mixed $return = 'print'])
  • string $notice: This is the message that will be displayed.
  • mixed $return: default is print, can be set true, print, return.
ok (line 834)

This returns/prints a ok message regarding the active script. Intended to be used by the developer.

  • return: Ok string.
  • author: Jason Schoeman
  • access: public
string ok (string $ok, [mixed $return = 'print'], [mixed $log = 'log'])
  • string $ok: This is the message that will be displayed.
  • mixed $return: default is print, can be set true, print, return.
  • mixed $log: default is log, can be set true, print, return.
outputAbsoluteURL (line 394)

This returns/prints the absolute url for inside theme usage.

  • return: Absolute url.
  • author: Jason Schoeman
  • access: public
string outputAbsoluteURL ([mixed $return = 'print'])
  • mixed $return: default is print, can be set true, print, return.
outputBreadcrumbs (line 637)

Returns "breadcrumbs" to the template system. Intended to be used by the engine.

  • author: Jason Schoeman
  • access: public
void outputBreadcrumbs ()
outputCharset (line 336)

Outputs charset.

  • author: Jason Schoeman
  • access: public
void outputCharset ([ $return = false])
  • $return
outputController (line 677)

Returns "output script" to the template system. Intended to be used by the engine.

  • author: Jason Schoeman
  • access: public
void outputController ()
outputFooter (line 707)

Returns the last footer string to the template system. Intended to be used by the engine.

  • author: Jason Schoeman
  • access: public
void outputFooter ()
outputGroup (line 589)

Sets template group.

  • author: Jason Schoeman
  • access: public
void outputGroup ()
outputHead (line 305)

Changes head output.

  • access: public
string outputHead ([boolean $return = false])
  • boolean $return
outputLanguage (line 320)

Outputs current language identifier being used.

  • author: Jason Schoeman
  • access: public
void outputLanguage ([ $return = false])
  • $return
outputLoginLink (line 543)

Sets template login link.

  • author: Jason Schoeman
  • access: public
void outputLoginLink ()
outputLogo (line 467)

Gets the desired logo and displays it. This method will try its best to deliver a logo, whatever the case.

  • author: Jason Schoeman
  • access: public
void outputLogo ()
outputMenu (line 652)

Returns "menus" to the template system. Intended to be used by the engine.

  • author: Jason Schoeman
  • access: public
void outputMenu ()
outputMetaDescription (line 431)

This returns/prints the meta description for inside theme usage.

  • return: Meta Description.
  • author: Jason Schoeman
  • access: public
string outputMetaDescription ([mixed $return = 'print'])
  • mixed $return: default is print, can be set true, print, return.
outputMetaKeywords (line 411)

This returns/prints the meta keywords for inside theme usage.

  • return: Meta Keywords.
  • author: Jason Schoeman
  • access: public
string outputMetaKeywords ([mixed $return = 'print'])
  • mixed $return: default is print, can be set true, print, return.
outputNotifications (line 1579)

Ability to call and display notifications pushed to the notification system.

  • version: 1.0
  • date: 20110706 (v1.0) (greg) added
  • since: v3.0.5
  • access: public
void outputNotifications ()
outputRole (line 569)

Sets template role.

  • author: Jason Schoeman
  • access: public
void outputRole ()
outputScript (line 667)

Returns "output script" to the template system. Intended to be used by the engine.

  • author: Jason Schoeman
  • access: public
void outputScript ()
outputScriptIcon (line 611)

This returns/prints an image of the current script running.

  • return: Returns image tag with image url.
  • author: Jason Schoeman
  • access: public
string outputScriptIcon ([boolean $return = false])
  • boolean $return: Default is false, if set true, the heading will return instead of print.
outputSkin (line 374)

This returns/prints the skin for inside theme usage.

  • return: Skin.
  • author: Jason Schoeman
  • access: public
string outputSkin ([mixed $return = 'print'])
  • mixed $return: default is print, can be set true, print, return.
outputTextLogo (line 691)

Sets template system logo or name.

  • author: Jason Schoeman
  • access: public
void outputTextLogo ()
outputTime (line 527)

Sets template time.

  • author: Jason Schoeman
  • access: public
void outputTime ()
outputTitle (line 352)

Outputs the active scripts title.

  • author: Jason Schoeman
  • access: public
void outputTitle ()
runTemplate (line 161)

Run default, custom or no template.

  • author: Jason Schoeman
  • version: 1.2
  • date: 20100520 (v1.1) (greg) added merging with modules from the configuration array
  • date: 20110308 (v1.2) greg) allows the new style controller to alter the current template to be used
  • access: public
void runTemplate ()
scripthead (line 1034)

This returns/prints a heading of the script being executed. Intended to be used by the developer.

  • return: Heading string.
  • author: Jason Schoeman
  • access: public
string scripthead (string $scripthead, [mixed $return = 'print'])
  • string $scripthead: This is the message that will be displayed.
  • mixed $return: default is print, can be set true, print, return.
scriptLogo (line 499)

Acquire script identification image or logo.

  • access: public
void scriptLogo (string $menu_link, string $active_plugin, [ $alias = null])
  • string $menu_link
  • string $active_plugin
  • $alias
setPiece (line 1566)

insert a piece into the repository

  • author: greg <greg@phpdevshell.org>
  • version: 1.0
  • since: v3.1.0
  • date: 20110309 (v1.0) (greg) added
  • access: public
void setPiece ($name $name, [$data $data = null])
  • $name $name: string, the name of the piece to add
  • $data $data: string, the raw content of the piece
startBuffering (line 246)
  • access: protected
void startBuffering ()
tip (line 1054)

This creates an the [i] when over with mouse a popup with a message appears, this can be placed anywhere. Intended to be used by the developer.

  • author: Jason Schoeman
  • access: public
void tip (string $text, [boolean $print = false])
  • string $text: The message to diplay when mouse goes over the [i].
  • boolean $print: Sets to print out confirm link instead of return.
warning (line 801)

This returns/prints a warning message regarding the active script. Intended to be used by the developer.

  • return: Warning string.
  • author: Jason Schoeman
  • access: public
string warning (string $warning, [mixed $return = 'print'], [mixed $log = 'log'])
  • string $warning: This is the message that will be displayed.
  • mixed $return: default is print, can be set true, print, return.
  • mixed $log: default is log, can be set true, print, return.

Inherited Methods

Inherited From template

template::alt_color()
template::assign()
template::display()
template::dofetch()
template::extend_menu_loop()
template::fetch()
template::get_template()
template::hook()
template::html_entity_decode()
template::iconize()
template::info_mark()
template::load_icons()
template::login_emplate()
template::out()
template::output_active_info()
template::output_breadcrumbs()
template::output_charset()
template::output_footer()
template::output_language()
template::output_logo()
template::output_menu()
template::output_script()
template::output_title()
template::random_color()
template::result()
template::script_logo()
template::set()
template::show()
template::template_cron_output()

Inherited From PHPDS_dependant

PHPDS_dependant::__construct()
PHPDS_dependant::construct()
PHPDS_dependant::debugInstance()
PHPDS_dependant::factory()
PHPDS_dependant::factoryWith()
PHPDS_dependant::info()
PHPDS_dependant::log()
PHPDS_dependant::PHPDS_dependance()
PHPDS_dependant::_log()
PHPDS_dependant::__call()
PHPDS_dependant::__get()
PHPDS_dependant::__set()

Documentation generated on Tue, 09 Aug 2011 09:05:23 +0200 by phpDocumentor 1.4.3