Class template

Description

This class contains methods that prints out to the template system, the template system is what the user see when using your application.

This means everything that is supposed to echo to the users browser is done with this class. This class resides in the global variable $template and these methods can be called by $template->call_any_method().

  • author: Jason Schoeman
  • since: 2007/01/03

Located in /includes/template.class.php (line 23)


	
			
Variable Summary
Method Summary
 void alt_color (mixed $alt)
 string busy (string $busy_note, [boolean $return = false])
 string critical (string $critical, [boolean $return = false], [boolean $log = true])
 void error_handler (integer $errno, string $errstr, string $errfile, integer $errline)
 integer extend_menu_loop (integer $extended_menu_id)
 string heading (string $heading, [boolean $return = false])
 void hook (integer $hook_point_id)
 string html_entity_decode (string $string_to_decode)
 void icon (string $icons)
 string info (string $information, [boolean $return = false])
 void info_mark (string $info_mark, [boolean $print = false])
 void login_template (string $goto, [integer $redirect = false], [boolean $return = false])
 string message (string $message_note, [boolean $return = false])
 string note (string $note, [boolean $return = false])
 string notice (string $notice, [boolean $return = false])
 string ok (string $ok, [boolean $return = false], [boolean $log = true])
 void out (string $variable)
 void output_charset ([ $return = false])
 void output_footer ()
 void output_language ([ $return = false])
 void output_logo ()
 void output_menu ()
 void output_script ()
 void output_title ()
 void queries_used (string $count_queries)
 void random_color (int $id)
 void result ( $RESULT, [integer $colspan = 0], string $RESULTS)
 void run_template ()
 string scripthead (string $scripthead, [boolean $return = false])
 void script_logo (string $menu_link, string $active_plugin)
 string warning (string $warning, [boolean $return = false], [boolean $log = true])
Variables
string $active_language (line 50)

Contains active language identifier being used.

  • access: public
string $cron_output (line 43)

When this variable is assigned, the cronjob will output to his template system if it is enabled in the config.

  • access: public
string $debug = false (line 102)

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 116)

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

  • access: public
array $hook_array (line 109)

Contains array with existing registered hook points for active script.

  • access: public
string $hook_request (line 133)

The hook position id (head, foot, aaa, etc...) that is being required in main script.

This helps the developer split its code to only a specific hook area.

Example:

  1.  if ($template->hook_request 'head')
  2.  {
  3.          // Do head code here.
  4.  }

  • access: public
string $modify_output_active_info = false (line 66)

Use this variable to modify the output templates active info.

  • access: public
string $modify_output_breadcrumbs = false (line 73)

Use this variable to modify the output templates breadcrumbs.

  • access: public
string $modify_output_footer = false (line 94)

Use this variable to modify the output templates footer.

  • access: public
string $modify_output_menu = false (line 80)

Use this variable to modify the output templates menu.

  • access: public
string $modify_output_script = false (line 87)

Use this variable to modify the output templates script.

  • access: public
string $modify_output_title = false (line 59)

Use this variable to modify the output templates title.

  • access: public
string $stop_script (line 36)

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->stop_script "The script stopped cause I wanted it to.";

  • access: public
Methods
alt_color (line 1274)

Does the alternating colors of rows when there is more then 1 result. Intended to be used by the developer.

  • author: Jason Schoeman
  • access: public
void alt_color (mixed $alt)
  • mixed $alt: The value of the previous row.
busy (line 1101)

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

  • return: Note string.
  • author: Jason Schoeman
  • access: public
string busy (string $busy_note, [boolean $return = false])
  • string $busy_note: This is the message that will be displayed as the busy note.
  • boolean $return: default is false, if set true, the heading will return instead of print.
critical (line 1012)

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, [boolean $return = false], [boolean $log = true])
  • string $critical: This is the message that will be displayed as the critical message.
  • boolean $return: default is false, if set true, the heading will return instead of print.
  • boolean $log: default is true, if set false, no logs will be collected.
error_handler (line 1332)

Error handler function and logging system, it only catches errors in custom scripts and will most likely not catch errors from PHPDevShell.

It does not catch fatal errors as PHP always handles this. Method takes most PHP errors on to itself and logs it to the database. This is done for easier debugging.

  • author: Jason Schoeman
  • access: public
void error_handler (integer $errno, string $errstr, string $errfile, integer $errline)
  • integer $errno
  • string $errstr
  • string $errfile
  • integer $errline
extend_menu_loop (line 347)

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 extend_menu_loop (integer $extended_menu_id)
  • integer $extended_menu_id
heading (line 889)

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

  • return: Heading string.
  • author: Jason Schoeman
  • access: public
string heading (string $heading, [boolean $return = false])
  • string $heading: This is the message that will be displayed as the heading.
  • boolean $return: Default is false, if set true, the heading will return instead of print.
hook (line 807)

The exact location where hook should be applied.

  • access: public
void hook (integer $hook_point_id)
  • integer $hook_point_id: The unique id given to a hook.
html_entity_decode (line 1555)

Convert all HTML entities to their applicable characters.

  • access: public
string html_entity_decode (string $string_to_decode)
  • string $string_to_decode
icon (line 1218)

This prints an icon to the script being executed (header area). Intended to be used by the developer.

  • author: Jason Schoeman
  • access: public
void icon (string $icons)
  • string $icons: The url of the image icon to display.
info (line 915)

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

  • return: Info string.
  • author: Jason Schoeman
  • access: public
string info (string $information, [boolean $return = false])
  • string $information: This is the message that will be displayed as the info.
  • boolean $return: Default is false, if set true, the heading will return instead of print.
info_mark (line 1238)

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 info_mark (string $info_mark, [boolean $print = false])
  • string $info_mark: The message to diplay when mouse goes over the [i].
  • boolean $print: Sets to print out confirm link instead of return.
login_template (line 1442)

Loads the username & password html template form.

  • access: public
void login_template (string $goto, [integer $redirect = false], [boolean $return = false])
  • string $goto
  • integer $redirect
  • boolean $return
message (line 1127)

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

  • return: Note string.
  • author: Jason Schoeman
  • access: public
string message (string $message_note, [boolean $return = false])
  • string $message_note: This is the message that will be displayed as the message note.
  • boolean $return: default is false, if set true, the heading will return instead of print.
note (line 1153)

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, [boolean $return = false])
  • string $note: This is the message that will be displayed as the note.
  • boolean $return: default is false, if set true, the heading will return instead of print.
notice (line 1074)

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, [boolean $return = false])
  • string $notice: This is the message that will be displayed as the notice.
  • boolean $return: default is false, if set true, the heading will return instead of print.
ok (line 1180)

This returns/prints an 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, [boolean $return = false], [boolean $log = true])
  • string $ok: This is the message that will be displayed as the ok message.
  • boolean $return: default is false, if set true, the heading will return instead of print.
  • boolean $log: default is true, if set false, no logs will be collected.
out (line 1263)

Print out any message given to it (instead of return). Intended to be used by the developer.

  • author: Jason Schoeman
  • access: public
void out (string $variable)
  • string $variable: Message to print out.
output_active_info (line 258)

Returns "users version number" and some other detail to the template system. Intended to be used by the engine.

  • author: Jason Schoeman
  • access: public
void output_active_info ()
output_breadcrumbs (line 306)

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

  • author: Jason Schoeman
  • access: public
void output_breadcrumbs ()
output_charset (line 163)

Outputs charset.

  • author: Jason Schoeman
  • access: public
void output_charset ([ $return = false])
  • $return
output_footer (line 866)

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

  • author: Jason Schoeman
  • access: public
void output_footer ()
output_language (line 142)

Outputs current language identifier being used.

  • author: Jason Schoeman
  • access: public
void output_language ([ $return = false])
  • $return
output_logo (line 211)

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 output_logo ()
output_menu (line 326)

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

  • author: Jason Schoeman
  • access: public
void output_menu ()
output_script (line 387)

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

  • author: Jason Schoeman
  • access: public
void output_script ()
output_title (line 184)

Outputs the active scripts title.

  • author: Jason Schoeman
  • access: public
void output_title ()
queries_used (line 1505)

Prints the number of queries used to the gui.

  • access: public
void queries_used (string $count_queries)
  • string $count_queries
random_color (line 1292)

Creates a random color by group. Intended to be used by the developer.

  • author: Jason Schoeman
  • access: public
void random_color (int $id)
  • int $id: Unique id of the group which needs a color.
result (line 1381)

Output "no results found" if no results are found in a paging script.

  • since: 2007/04/16
  • access: public
void result ( $RESULT, [integer $colspan = 0], string $RESULTS)
  • string $RESULTS
  • integer $colspan
  • $RESULT
run_template (line 1400)

Run default, custom or no template.

  • author: Jason Schoeman
  • access: public
void run_template ()
scripthead (line 945)

This returns/prints a short heading on active script. Intended to be used by the developer.

  • return: Scripthead string.
  • author: Jason Schoeman
  • access: public
string scripthead (string $scripthead, [boolean $return = false])
  • string $scripthead: This is the message that will be displayed as the head.
  • boolean $return: default is false, if set true, the heading will return instead of print.
script_logo (line 1518)

Acquire script identification image or logo.

  • access: public
void script_logo (string $menu_link, string $active_plugin)
  • string $menu_link
  • string $active_plugin
template_cron_output (line 1367)

Outputs data to the cron template if cron debug is enabled in the configuration.

  • author: Jason Schoeman
  • access: public
void template_cron_output ()
warning (line 971)

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, [boolean $return = false], [boolean $log = true])
  • string $warning: This is the message that will be displayed as the warning.
  • boolean $return: default is false, if set true, the heading will return instead of print.
  • boolean $log: default is true, if set false, no logs will be collected.

Documentation generated on Thu, 23 Oct 2008 13:58:34 +0200 by phpDocumentor 1.4.0