phpDocumentor pond
[ class tree: pond ] [ index: pond ] [ all elements ]

Class: Widget

Source Location: /qp_inc/_core/ui/_uiwidget.class.php

Class Widget

Class Overview

Widget class which provides an interface to widget methods for other classes.

It provides a method replace_vars() that can be used to replace object properties in given strings. You can also register global action icons.

Located in /qp_inc/_core/ui/_uiwidget.class.php [line 46]



		
				Author(s):
		
API Tags:
Abstract:  

Properties

Methods

[ Top ]
Descendants
Child Class Description
Form Form class
Menu Menu class
Table Class Table

[ Top ]
Property Summary
mixed   $global_icons   List of registered global action icons that get substituted through '$global_icons$'.
array   $params   Display parameters.
mixed   $title   Title of the widget (to be displayed)

[ Top ]
Method Summary
Widget   Widget()   Constructor
void   disp_template_raw()   Display a template param without replacing variables
void   disp_template_replaced()   Display a template param with its variables replaced
void   gen_global_icons()   Generate img tags for registered icons, through global_icon().
void   global_icon()   Registers a global action icon
string   replace_callback()   Callback function used to replace only necessary values in template.
string   replace_callback_wrapper()   This is an additional wrapper to replace_vars() that allows to react on the return value of it.
string   replace_vars()   Replaces $vars$ with appropriate values.

[ Top ]
Properties
mixed   $global_icons = array() [line 66]

List of registered global action icons that get substituted through '$global_icons$'.

API Tags:
See:  Widget::global_icon()


[ Top ]
array   $params = NULL [line 55]

Display parameters.

Example params would be 'block_start' and 'block_end'. Params may contain special variables that will be replaced by replace_vars() Different types of Widgets will expect different parameters.


[ Top ]
mixed   $title [line 60]

Title of the widget (to be displayed)


Redefined in descendants as:

[ Top ]
Methods
Constructor Widget  [line 74]

  Widget Widget( [string $ui_template = NULL]  )

Constructor

Parameters:
string   $ui_template:  template name to get from $AdminUI


[ Top ]
disp_template_raw  [line 111]

  void disp_template_raw( $param_name  )

Display a template param without replacing variables

Parameters:
   $param_name: 


[ Top ]
disp_template_replaced  [line 120]

  void disp_template_replaced( $param_name  )

Display a template param with its variables replaced

Parameters:
   $param_name: 


[ Top ]
gen_global_icons  [line 214]

  void gen_global_icons( )

Generate img tags for registered icons, through global_icon().

This is used by the default callback to replace '$global_icons$'.



[ Top ]
global_icon  [line 95]

  void global_icon( string $title, string $icon, string $url, [integer $word = ''], [integer $icon_weight = 3], [array $word_weight = 2], [ $link_attribs = array( 'class'=>'action_icon' )]  )

Registers a global action icon

Parameters:
string   $title:  TITLE text (IMG and A link)
string   $icon:  icon code for get_icon()
string   $url:  URL to link to
integer   $word:  1-5: weight of the icon. the icon will be displayed only if its weight is >= than the user setting threshold
integer   $icon_weight:  1-5: weight of the word. the word will be displayed only if its weight is >= than the user setting threshold
array   $word_weight:  Additional attributes to the A tag. See action_icon().
   $link_attribs: 


[ Top ]
replace_callback  [line 187]

  string replace_callback( array $matches  )

Callback function used to replace only necessary values in template.

This gets used by replace_vars() to replace $vars$.

Parameters:
array   $matches:  preg match. Index 1 is the template variable.

API Tags:
Return:  to be substituted


Redefined in descendants as:

[ Top ]
replace_callback_wrapper  [line 161]

  string replace_callback_wrapper( array $match  )

This is an additional wrapper to replace_vars() that allows to react on the return value of it.

Used by replace_callback()

Parameters:
array   $match:  preg match


[ Top ]
replace_vars  [line 138]

  string replace_vars( string $template, [array $params = NULL]  )

Replaces $vars$ with appropriate values.

You can give an alternative string to display, if the substituted variable is empty, like:

  1. $vars "Display if empty"$

Parameters:
string   $template:  template
array   $params:  optional params that are put into $this->params to be accessible by derived replace_callback() methods

API Tags:
Return:  The substituted string


[ Top ]