Class rcube_template

Description

Class to create HTML page output using a skin template

Located in /rcube_template.php (line 34)

rcube_html_page
   |
   --rcube_template
Variable Summary
 mixed $ajax_call
 mixed $browser
 mixed $env
 mixed $framed
 mixed $type
Method Summary
 rcube_template __construct ( $task, [ $framed = false])
 string abs_url (string $str)
 void add_gui_object (string $obj, string $id)
 void add_handler (string $obj, string $func)
 void add_handlers (array $arr)
 void add_label ()
 string button (array $attrib)
 string charset_selector (array $attrib)
 void command (string 0, ... 1)
 string current_username (array $attrib)
 string form_tag (array $attrib, [ $content = null])
 string get_pagetitle ()
 void get_skin_path ()
 string just_parse (string $input)
 void parse ([string $name = 'main'], [boolean $exit = true], [boolean $write = true])
 void redirect ([mixed $p = array()])
 string request_form (array $attrib, [string $content = ''])
 void reset ()
 void send ([string $templ = null], [boolean $exit = true])
 void set_env (string $name, mixed $value, [boolean $addtojs = true])
 void set_pagetitle ( $title)
 void set_skin ( $skin)
 void show_message (string $message, [string $type = 'notice'], [array $vars = null], [boolean $override = true], [int $timeout = 0])
 boolean template_exists (string $name)
 void write ([string $template = ''])
Variables
mixed $ajax_call = false (line 51)
  • access: public
mixed $browser (line 47)
  • access: public
mixed $env = array() (line 49)
  • access: public
mixed $framed = false (line 48)
  • access: public
mixed $type = 'html' (line 50)
  • access: public

Inherited Variables

Inherited from rcube_html_page

rcube_html_page::$base_path
rcube_html_page::$body
rcube_html_page::$charset
rcube_html_page::$css_files
rcube_html_page::$default_template
rcube_html_page::$footer
rcube_html_page::$header
rcube_html_page::$scripts
rcube_html_page::$scripts_path
rcube_html_page::$script_files
rcube_html_page::$title
Methods
Constructor __construct (line 67)

Constructor

  • todo: Replace $this->config with the real rcube_config object
  • access: public
rcube_template __construct ( $task, [ $framed = false])
  • $task
  • $framed

Redefinition of:
rcube_html_page::__construct()
Constructor
abs_url (line 520)

Make URLs starting with a slash point to skin directory

  • access: public
string abs_url (string $str)
  • string $str: Input string
add_gui_object (line 219)

Register a GUI object to the client script

  • access: public
void add_gui_object (string $obj, string $id)
  • string $obj: Object name
  • string $id: Object ID
add_handler (line 196)

Register a template object handler

  • access: public
void add_handler (string $obj, string $func)
  • string $obj: Object name
  • string $func: Function name to call
add_handlers (line 207)

Register a list of template object handlers

  • access: public
void add_handlers (array $arr)
  • array $arr: Hash array with object=>handler pairs
add_label (line 242)

Add a localized label to the client environment

  • access: public
void add_label ()
button (line 878)

Create and register a button

  • return: HTML button
  • todo: Remove all sprintf()'s - they are pretty, but also slow.
  • todo: Remove all inline JS calls and use jQuery instead.
  • access: public
string button (array $attrib)
  • array $attrib: Named button attributes
charset_selector (line 1292)

GUI object 'charsetselector'

  • return: HTML code for the gui object
string charset_selector (array $attrib)
  • array $attrib: Named parameters for the select tag
command (line 230)

Call a client method

  • access: public
void command (string 0, ... 1)
  • string 0: Method to call
  • ... 1: Additional arguments
current_username (line 1086)

GUI object 'username' Showing IMAP username of the current session

  • return: HTML code for the gui object
  • access: public
string current_username (array $attrib)
  • array $attrib: Named tag parameters (currently not used)
form_tag (line 1031)

Create a form tag with the necessary hidden fields

  • return: HTML code for the form
  • access: public
string form_tag (array $attrib, [ $content = null])
  • array $attrib: Named tag parameters
  • $content
get_pagetitle (line 132)

Getter for the current page title

  • return: The page title
  • access: public
string get_pagetitle ()
get_skin_path (line 172)

Getter for the current skin path property

  • access: public
void get_skin_path ()
just_parse (line 560)

Public wrapper to dipp into template parsing.

  • since: 0.1-rc1
  • access: public
  • uses: rcube_template::parse_xml()
string just_parse (string $input)
  • string $input
parse (line 389)

Parse a specific skin template and deliver to stdout (or return)

void parse ([string $name = 'main'], [boolean $exit = true], [boolean $write = true])
  • string $name: Template name
  • boolean $exit: Exit script
  • boolean $write: Don't write to stdout, return parsed content instead
redirect (line 305)

Redirect to a certain url

void redirect ([mixed $p = array()])
  • mixed $p: Either a string with the action or url parameters as key-value pairs
request_form (line 1055)

Build a form tag with a unique request token

  • return: HTML code for the form
  • access: public
string request_form (array $attrib, [string $content = ''])
  • array $attrib: Named tag parameters including 'action' and 'task' values which will be put into hidden fields
  • string $content: Form content
reset (line 289)

Delete all stored env variables and commands

  • access: public
  • uses: self::$object_handlers
  • uses: self::$js_env
  • uses: self::$js_commands
  • uses: self::$env
  • uses: rcube_html::reset()
void reset ()

Redefinition of:
rcube_html_page::reset()
Reset all saved properties
send (line 319)

Send the request output to the client.

This will either parse a skin tempalte or send an AJAX response

  • access: public
void send ([string $templ = null], [boolean $exit = true])
  • string $templ: Template name
  • boolean $exit: True if script should terminate (default)
set_env (line 111)

Set environment variable

  • access: public
void set_env (string $name, mixed $value, [boolean $addtojs = true])
  • string $name: Property name
  • mixed $value: Property value
  • boolean $addtojs: True if this property should be added to client environment
set_pagetitle (line 122)

Set page title variable

  • access: public
void set_pagetitle ( $title)
  • $title
set_skin (line 150)

Set skin

  • access: public
void set_skin ( $skin)
  • $skin
show_message (line 263)

Invoke display_message command

  • access: public
  • uses: self::command()
void show_message (string $message, [string $type = 'notice'], [array $vars = null], [boolean $override = true], [int $timeout = 0])
  • string $message: Message to display
  • string $type: Message type [notice|confirm|error]
  • array $vars: Key-value pairs to be replaced in localized text
  • boolean $override: Override last set message
  • int $timeout: Message display time in seconds
template_exists (line 183)

Check if a specific template exists

  • return: True if template exists
  • access: public
boolean template_exists (string $name)
  • string $name: Template name
write (line 352)

Process template and write to stdOut

void write ([string $template = ''])
  • string $template: HTML template

Redefinition of:
rcube_html_page::write()
Process template and write to stdOut

Inherited Methods

Inherited From rcube_html_page

 rcube_html_page::__construct()
 rcube_html_page::add_footer()
 rcube_html_page::add_header()
 rcube_html_page::add_script()
 rcube_html_page::get_charset()
 rcube_html_page::include_css()
 rcube_html_page::include_script()
 rcube_html_page::reset()
 rcube_html_page::set_charset()
 rcube_html_page::set_title()
 rcube_html_page::write()

Documentation generated on Wed, 23 May 2012 16:40:54 +0200 by phpDocumentor 1.4.4