Class rcmail_output_html

Description

Class to create HTML page output using a skin template

Located in /include/rcmail_output_html.php (line 29)

rcube_output
   |
   --rcmail_output
      |
      --rcmail_output_html
Direct descendents
Class Description
 class rcmail_html_page Class to create an empty HTML page with some default styles
Variable Summary
 mixed $base_path
 mixed $body
 mixed $css_files
 mixed $footer
 mixed $header
 mixed $js_commands
 mixed $js_env
 mixed $js_labels
 mixed $message
 mixed $scripts
 mixed $skin_paths
 mixed $type
Method Summary
 rcmail_output_html __construct ([ $task = null], [ $framed = false])
 void about_content ( $attrib)
 string abs_url (string $str, [boolean $search_path = false])
 void add_footer (string $str)
 void add_gui_object (string $obj, string $id)
 void add_header (string $str)
 void add_label ()
 void add_script (string $script, [string $position = 'head'])
 void alter_form_tag ( $matches)
 string button (array $attrib)
 string charset_selector (array $attrib)
 boolean check_condition (string $condition)
 void command (string 0, ... 1)
 string current_username (array $attrib)
 mixed eval_expression (string $expression)
 string file_callback ( $matches)
 void fix_paths ( $output)
 string form_tag (array $attrib, [ $content = null])
 string frame (array $attrib, [boolean $is_contentframe = false])
 string get_js_commands ()
 string get_pagetitle ()
 mixed get_skin_file (string $file, [string &$skin_path = null], [string $add_path = null])
 void globals_callback ( $matches)
 void include_css (string $file)
 string include_php (string $file)
 void include_script (string $file, [string $position = 'head'])
 string just_parse (string $input)
 string login_form (array $attrib)
 string message_container (array $attrib)
 void parse ([string $name = 'main'], [boolean $exit = true], [boolean $write = true])
 string parse_conditions (string $input)
 void parse_with_globals ( $input)
 string parse_xml (string $input)
 void preloader (array $attrib)
 void raise_error (int $code, string $message)
 void redirect ([mixed $p = array()], [int $delay = 1])
 string request_form (array $attrib, [string $content = ''])
 void reset ([bool $all = false])
 string search_form (array $attrib)
 void send ([string $templ = null], [boolean $exit = true])
 void set_env (string $name, mixed $value, [boolean $addtojs = true])
 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 = ''])
 string xml_command (array $matches)
 void _write ([string $templ = ''], [string $base_path = ''])
Variables
mixed $base_path = '' (line 47)
  • access: protected
mixed $body = '' (line 46)
  • access: protected
mixed $css_files = array() (line 41)
  • access: protected
mixed $default_template = "<html>\n<head><title></title></head>\n<body></body>\n</html>" (line 43)
  • access: protected
mixed $deprecated_templates = array(
'contact' => 'showcontact',
'contactadd' => 'addcontact',
'contactedit' => 'editcontact',
'identityedit' => 'editidentity',
'messageprint' => 'printmessage',
)
(line 50)
  • access: protected
mixed $footer = '' (line 45)
  • access: protected
mixed $header = '' (line 44)
  • access: protected
mixed $js_commands = array() (line 36)
  • access: protected
mixed $js_env = array() (line 34)
  • access: protected
mixed $js_labels = array() (line 35)
  • access: protected
mixed $message = null (line 33)
  • access: protected
mixed $scripts = array() (line 42)
  • access: protected
mixed $scripts_path = '' (line 39)
  • access: protected
mixed $script_files = array() (line 40)
  • access: protected
mixed $skin_paths = array() (line 37)
  • access: protected
mixed $template_name (line 38)
  • access: protected
mixed $type = 'html' (line 31)
  • access: public

Redefinition of:
rcmail_output::$type

Inherited Variables

Inherited from rcmail_output

rcmail_output::$ajax_call
rcmail_output::$framed
rcmail_output::$object_handlers
rcmail_output::$pagetitle

Inherited from rcube_output

rcube_output::$app
rcube_output::$browser
rcube_output::$charset
rcube_output::$config
rcube_output::$env
Methods
Constructor __construct (line 63)

Constructor

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

Redefinition of:
rcmail_output::__construct()
Object constructor
about_content (line 1789)

Include content from config/about.<LANG>.html if available

  • access: protected
void about_content ( $attrib)
  • $attrib
abs_url (line 581)

Make URLs starting with a slash point to skin directory

  • access: public
string abs_url (string $str, [boolean $search_path = false])
  • string $str: Input string
  • boolean $search_path: True if URL should be resolved using the current skin path stack
add_footer (line 1281)

Add HTML code to the page footer To be added right befor </body>

  • access: public
void add_footer (string $str)
  • string $str: HTML code
add_gui_object (line 244)

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_header (line 1269)

Add HTML code to the page header

  • access: public
void add_header (string $str)
  • string $str: HTML code
add_label (line 269)

Add a localized label to the client environment

  • access: public
void add_label ()

Redefinition of:
rcmail_output::add_label()
Add a localized label to the client environment
add_script (line 1242)

Add inline javascript code

  • access: public
void add_script (string $script, [string $position = 'head'])
  • string $script: JS code snippet
  • string $position: Target position [head|head_top|foot]
alter_form_tag (line 747)

Inserts hidden field with CSRF-prevention-token into POST forms

  • access: protected
void alter_form_tag ( $matches)
  • $matches
button (line 1057)

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

GUI object 'charsetselector'

  • return: HTML code for the gui object
  • access: public
string charset_selector (array $attrib)
  • array $attrib: Named parameters for the select tag
check_condition (line 738)

Determines if a given condition is met

  • return: True if condition is met, False if not
  • todo: Extend this to allow real conditions, not just "set"
  • access: protected
boolean check_condition (string $condition)
  • string $condition: Condition statement
command (line 256)

Call a client method

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

Redefinition of:
rcmail_output::command()
Call a client method
current_username (line 1508)

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)
eval_expression (line 768)

Parse & evaluate a given expression and return its result.

  • return: Expression result
  • access: protected
mixed eval_expression (string $expression)
  • string $expression: Expression statement
file_callback (line 655)

Callback function for preg_replace_callback in write()

  • return: Parsed string
  • access: protected
string file_callback ( $matches)
  • $matches
fix_paths (line 642)

Correct absolute paths in images and other tags

add timestamp to .js and .css filename

  • access: protected
void fix_paths ( $output)
  • $output
form_tag (line 1449)

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
frame (line 1419)

Returns iframe object, registers some related env variables

  • return: IFRAME element
  • access: public
string frame (array $attrib, [boolean $is_contentframe = false])
  • array $attrib: HTML attributes
  • boolean $is_contentframe: Register this iframe as the 'contentframe' gui object
get_js_commands (line 547)

Return executable javascript code for all registered commands

  • access: protected
string get_js_commands ()
get_pagetitle (line 130)

Getter for the current page title

  • return: The page title
  • access: protected
string get_pagetitle ()
get_skin_file (line 220)

Find the given file in the current skin path stack

  • return: Relative path to the requested file or False if not found
  • access: public
mixed get_skin_file (string $file, [string &$skin_path = null], [string $add_path = null])
  • string $file: File name/path to resolve (starting with /)
  • string &$skin_path: Reference to the base path of the matching skin
  • string $add_path: Additional path to search in
globals_callback (line 632)

Callback funtion for preg_replace_callback() in parse_with_globals()

  • access: protected
void globals_callback ( $matches)
  • $matches
include_css (line 1258)

Link an external css file

  • access: public
void include_css (string $file)
  • string $file: File URL
include_php (line 1038)

Include a specific file and return it's contents

  • return: Contents of the processed file
  • access: protected
string include_php (string $file)
  • string $file: File path
include_script (line 1211)

Link an external script file

  • access: public
void include_script (string $file, [string $position = 'head'])
  • string $file: File URL
  • string $position: Target position [head|foot]
just_parse (line 684)

Public wrapper to dipp into template parsing.

string just_parse (string $input)
  • string $input
login_form (line 1540)

GUI object 'loginform' Returns code for the webmail login form

  • return: HTML code for the gui object
  • access: protected
string login_form (array $attrib)
  • array $attrib: Named parameters
message_container (line 1701)

Builder for GUI object 'message'

  • return: HTML code for the gui object
  • access: protected
string message_container (array $attrib)
  • array $attrib: Named tag parameters
parse (line 426)

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
parse_conditions (line 699)

Parse for conditional tags

  • access: protected
string parse_conditions (string $input)
  • string $input
parse_with_globals (line 618)

Replace all strings ($varname) with the content of the according global variable.

  • access: protected
void parse_with_globals ( $input)
  • $input
parse_xml (line 817)

Search for special tags in input and replace them with the appropriate content

string parse_xml (string $input)
  • string $input: Input string to parse
preloader (line 1640)

GUI object 'preloader' Loads javascript code for images preloading

  • access: protected
void preloader (array $attrib)
  • array $attrib: Named parameters
raise_error (line 600)

Show error page and terminate script execution

  • access: public
void raise_error (int $code, string $message)
  • int $code: Error code
  • string $message: Error message

Redefinition of:
rcube_output::raise_error()
Show error page and terminate script execution
redirect (line 337)

Redirect to a certain url

  • access: public
void redirect ([mixed $p = array()], [int $delay = 1])
  • mixed $p: Either a string with the action or url parameters as key-value pairs
  • int $delay: Delay in seconds

Redefinition of:
rcube_output::redirect()
Redirect to a certain url.
request_form (line 1477)

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

Delete all stored env variables and commands

  • access: public
void reset ([bool $all = false])
  • bool $all: Reset all env variables (including internal)

Redefinition of:
rcmail_output::reset()
Delete all stored env variables and commands
search_form (line 1663)

GUI object 'searchform' Returns code for search function

  • return: HTML code for the gui object
  • access: protected
string search_form (array $attrib)
  • array $attrib: Named parameters
send (line 354)

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)

Redefinition of:
rcube_output::send()
Send output to the client.
set_env (line 116)

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

Redefinition of:
rcube_output::set_env()
Set environment variable
set_skin (line 152)

Set skin

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

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

Redefinition of:
rcube_output::show_message()
Invoke display_message command
template_exists (line 199)

Check if a specific template exists

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

Process template and write to stdOut

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

Redefined in descendants as:
xml_command (line 830)

Callback function for parsing an xml command tag and turn it into real html content

  • return: Tag/Object content
  • access: protected
string xml_command (array $matches)
  • array $matches: Matches array of preg_replace_callback
_write (line 1293)

Process template and write to stdOut

  • access: public
void _write ([string $templ = ''], [string $base_path = ''])
  • string $templ: HTML template
  • string $base_path: Base for absolute paths

Inherited Methods

Inherited From rcmail_output

 rcmail_output::__construct()
 rcmail_output::add_handler()
 rcmail_output::add_handlers()
 rcmail_output::add_label()
 rcmail_output::command()
 rcmail_output::get_skin_path()
 rcmail_output::reset()
 rcmail_output::set_pagetitle()

Inherited From rcube_output

 rcube_output::__construct()
 rcube_output::future_expire_header()
 rcube_output::get_charset()
 rcube_output::get_edit_field()
 rcube_output::get_env()
 rcube_output::json_serialize()
 rcube_output::nocacheing_headers()
 rcube_output::raise_error()
 rcube_output::redirect()
 rcube_output::reset()
 rcube_output::send()
 rcube_output::set_charset()
 rcube_output::set_env()
 rcube_output::show_message()
 rcube_output::__get()
Class Constants

Inherited Constants

Inherited from rcmail_output

rcmail_output::JS_OBJECT_NAME

Documentation generated on Fri, 03 May 2013 12:44:56 +0200 by phpDocumentor 1.4.4