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

Class: ComponentWidget

Source Location: /qp_inc/widgets/model/_widget.class.php

Class ComponentWidget

Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From DataObject

DataObject::$delete_cascades
DataObject::$delete_restrictions
DataObject::$ID

Inherited From DataObject

DataObject::DataObject()
Constructor
DataObject::check_delete()
Check relations for restrictions before deleting
DataObject::check_relations()
Check relations for restrictions or cascades
DataObject::confirm_delete()
Displays form to confirm deletion of this object
DataObject::dbchange()
Records a change that will need to be updated in the db
DataObject::dbdelete()
Delete object from DB.
DataObject::dbinsert()
Insert object into DB based on previously recorded changes.
DataObject::dbsave()
Inserts or Updates depending on object state.
DataObject::dbupdate()
Update the DB based on previously recorded changes
DataObject::dget()
Get a ready-to-display member param by its name
DataObject::disp()
Display a member param by its name
DataObject::get()
Get a member param by its name
DataObject::history_info_icon()
Create icon with dataobject history
DataObject::ID()
Template function: Displays object ID.
DataObject::set()
Set param value
DataObject::set_from_Request()
Set a parameter from a Request form value.
DataObject::set_param()
Set param value.

[ Top ]
Property Summary
mixed   $code  
mixed   $coll_ID  
mixed   $disp_params   Array of params used during display()
boolean   $enabled   Indicates whether the widget is enabled.
mixed   $order  
mixed   $params  
mixed   $param_array   Array of params which have been customized for this widget instance
Plugin   $Plugin   Lazy instantiated
mixed   $sco_name   Container name
string   $type  
mixed   $widget_name  
mixed   $widget_title  
array   $_trans   The translations keyed by locale. They get loaded through include() of _global.php.
boolean   $_trans_loaded_global   Has the global po/php/_global.php file (where translation for all languages can be put into) been loaded?

[ Top ]
Method Summary
ComponentWidget   ComponentWidget()   Constructor
boolean   dbinsert()   Insert object into DB based on previously recorded changes.
void   display()   Display the widget!
void   disp_title()   Note: a container can prevent display of titles with 'block_display_title' This is useful for the lists in the headers fp> I'm not sur if this param should be overridable by widgets themselves (priority problem) Maybe an "auto" setting.
void   get_desc()   Get desc of widget
void   get_desc_for_list()   Get a clean description to display in the widget list
void   get_name()   Get name of widget
void   get_param()   param value
void   get_param_definitions()   Get definitions for editable params
Plugin   &get_Plugin()   Get ref to Plugin handling this Widget
void   get_short_desc()   Get a very short desc. Used in the widget list.
void   init_display()   Prepare display params
void   load_from_Request()   Load params
void   load_param_array()   Load param array
boolean   set()   Set param value
string   TS_()   Translate and escape single quotes.
string   T_()   Translate a given string, in the Widget's context.

[ Top ]
Properties
mixed   $code [line 46]

[ Top ]
mixed   $coll_ID [line 36]

[ Top ]
mixed   $disp_params [line 69]

Array of params used during display()


[ Top ]
boolean   $enabled [line 57]

Indicates whether the widget is enabled.


[ Top ]
mixed   $order [line 41]

[ Top ]
mixed   $params [line 47]

[ Top ]
mixed   $param_array = NULL [line 64]

Array of params which have been customized for this widget instance

This is saved to the DB as a serialized string ($params)


[ Top ]
Plugin   $Plugin [line 77]

Lazy instantiated

(false if this Widget is not handled by a Plugin)

API Tags:
See:  ComponentWidget::get_Plugin()


[ Top ]
mixed   $sco_name [line 40]

Container name


[ Top ]
string   $type [line 45]

[ Top ]
mixed   $widget_name [line 49]

[ Top ]
mixed   $widget_title [line 50]

[ Top ]
array   $_trans = array() [line 85]

The translations keyed by locale. They get loaded through include() of _global.php.

API Tags:
See:  ComponentWidget::T_()


[ Top ]
boolean   $_trans_loaded_global = false [line 93]

Has the global po/php/_global.php file (where translation for all languages can be put into) been loaded?


[ Top ]
Methods
Constructor ComponentWidget  [line 101]

  ComponentWidget ComponentWidget( [object data $db_row = NULL], [ $type = 'widget'], [ $code = NULL]  )

Constructor

Parameters:
object data   $db_row:  row from db
   $type: 
   $code: 


[ Top ]
dbinsert  [line 570]

  boolean dbinsert( )

Insert object into DB based on previously recorded changes.


API Tags:
Return:  true on success


Redefinition of:
DataObject::dbinsert()
Insert object into DB based on previously recorded changes.

[ Top ]
display  [line 517]

  void display( array $params  )

Display the widget!

Should be overriden by core widgets

Parameters:
array   $params:  MUST contain at least the basic display params

API Tags:
Usedby:  template_container()
Usedby:  template_widget()
Usedby:  Template::container()
Uses:  ComponentWidget::init_display()

Information Tags:
Todo:  (legacy): fp> handle custom params for each widget

Redefined in descendants as:

[ Top ]
disp_title  [line 549]

  void disp_title( [ $title = NULL]  )

Note: a container can prevent display of titles with 'block_display_title' This is useful for the lists in the headers fp> I'm not sur if this param should be overridable by widgets themselves (priority problem) Maybe an "auto" setting.

Parameters:
   $title: 


[ Top ]
get_desc  [line 245]

  void get_desc( )

Get desc of widget

Should be overriden by core widgets



Redefined in descendants as:

[ Top ]
get_desc_for_list  [line 220]

  void get_desc_for_list( )

Get a clean description to display in the widget list



[ Top ]
get_name  [line 171]

  void get_name( )

Get name of widget

Should be overriden by core widgets



[ Top ]
get_param  [line 327]

  void get_param( $parname  )

param value

Parameters:
   $parname: 


[ Top ]
get_param_definitions  [line 267]

  void get_param_definitions( local $params  )

Get definitions for editable params

Parameters:
local   $params:  params like 'for_editing' => true

API Tags:
See:  Plugin::GetDefaultSettings()


Redefined in descendants as:

[ Top ]
get_Plugin  [line 131]

  Plugin &get_Plugin( )

Get ref to Plugin handling this Widget



[ Top ]
get_short_desc  [line 211]

  void get_short_desc( )

Get a very short desc. Used in the widget list.

MAY be overriden by core widgets. Example: menu link widget.



Redefined in descendants as:

[ Top ]
init_display  [line 425]

  void init_display( array $params  )

Prepare display params

Merge basic defaults < widget defaults < container params < DB params
When called with template_widget it falls back to:
basic defaults < widget defaults < calltime params < array()

  1.  $params array_mergearray(
  2.          // block-level params...
  3.          'block_start' => '<div class="$wi_class$">',
  4.          'block_end' => '</div>',
  5.          'block_display_title' => true,
  6.          'block_title_start' => '<h3>',
  7.          'block_title_end' => '</h3>',
  8.          // is this maybe sub-block params?
  9.          'coll_start' => '<h4>',
  10.          'coll_end' => '</h4>',
  11.          'collist_start' => '',
  12.          'collist_end' => '',
  13.          // group and list params...
  14.          'group_start' => '<ul>',
  15.          'group_end' => '</ul>',
  16.          'list_start' => '<ul>',
  17.          'list_end' => '</ul>',
  18.          // way too many item params...
  19.          'item_start' => '<li>',
  20.          'item_end' => '</li>',
  21.          'item_text_start' => '',
  22.          'item_text' => '%s',
  23.          'item_text_end' => '',
  24.          'item_selected_start' => '<li class="selected">',
  25.          'item_selected_text' => '%s',
  26.          'item_selected_end' => '</li>',
  27.          'item_selected_text_start' => '',
  28.          'item_selected_text_end' => '',
  29.          // link params...
  30.          'link_default_class' => 'default',
  31.          'link_selected_class' => 'selected',
  32.          'link_type' => 'canonic',        // 'canonic' | 'context' (context will regenrate URL injecting/replacing a single filter)
  33.          // notes params...
  34.          'notes_start' => '<div class="notes">',
  35.          'notes_end' => '</div>',
  36.          // thumb_size might be only with grid params but we need more image defaults
  37.          'thumb_size' => 'crop-80x80',
  38.          // this is probably a tag cloud param disguised as a real one
  39.          'limit' => 100,
  40.      )$widget_defaults$params$this->param_array );

Parameters:
array   $params: 

API Tags:
Usedby:  template_container()
Usedby:  template_widget()
Usedby:  ComponentWidget::display()
Usedby:  Template::container()


[ Top ]
load_from_Request  [line 154]

  void load_from_Request( )

Load params



Redefined in descendants as:

[ Top ]
load_param_array  [line 309]

  void load_param_array( )

Load param array



[ Top ]
set  [line 353]

  boolean set( string $parname, mixed $parvalue  )

Set param value

Parameters:
string   $parname:  parameter name
mixed   $parvalue:  parameter value

API Tags:
Return:  true, if a value has been set; false if it has not changed


Redefinition of:
DataObject::set()
Set param value

[ Top ]
TS_  [line 659]

  string TS_( string $string, [string $req_locale = '']  )

Translate and escape single quotes.

This is to be used mainly for Javascript strings.

Parameters:
string   $string:  String to translate
string   $req_locale:  Locale to use

API Tags:
Return:  The translated and escaped string.
Uses:  ComponentWidget::T_()


[ Top ]
T_  [line 610]

  string T_( string $string, [string $req_locale = '']  )

Translate a given string, in the Widget's context.

This means, that the translation is obtained from the Widget's "po/php" folder.

Parameters:
string   $string:  The string (english), that should be translated
string   $req_locale:  Requested locale ($current_locale gets used by default)

API Tags:
Return:  The translated string.
Usedby:  ComponentWidget::T_()
Uses:  ComponentWidget::T_()
Usedby:  ComponentWidget::TS_()

Information Tags:
Link:  [doclink]

[ Top ]