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

Class: Template

Source Location: /qp_inc/templates/model/_template.class.php

Class Template

Descendants
Child Class Description
asevo_Template template class
basic_Template template class
custom_Template template class
evocamp_Template template class
evopress_Template template class
glossyblue_Template template class
intense_Template template class
miami_blue_Template template class
natural_pink_Template template class
nifty_corners_Template template class
photoblog_Template template class
pixelgreen_Template template class
pluralism_Template template class
terrafirma_Template template class
vastitude_Template template class
_atom_Template template class
_rdf_Template template class
_rss_Template template class
_rss2_Template template class
_sitemap_Template template class

[ Top ]
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
array   $container_list   Lazy filled.
mixed   $folder  
mixed   $name  
array   $poweredby_linkback   Our own application credits (lazy filled by constructor).
mixed   $type  
array   $_trans   The translations keyed by locale. They get loaded through include() of _global.php.

[ Top ]
Method Summary
static void   disp_screenshot()   Display screenshot for template folder in various places.
Template   Template()   Constructor
void   container()   Display a container
void   CreateDefaultWidgets()   Create default widgets for requested blog
boolean   dbinsert()   Insert object into DB based on previously recorded changes.
boolean   dbupdate()   Update the DB based on previously recorded changes
void   dbupdate_settings()   Save template specific settings for current blgo to DB
void   db_save_containers()   Save containers
void   discover_containers()   Discover containers included in template file
void   display_init()   Get ready for displaying the template.
array   get_containers()  
void   get_default_name()   Get default name for the template.
void   get_default_type()   Get default type for the template.
array   get_default_widgets()   Get default widgets for new blog
void   get_name()   Get the customized name for the template.
void   get_param_definitions()   Get definitions for editable params
void   get_setting()   Get a template specific param value from current Blog
array   get_template_credits()   Get credits for linkback on credits page.
boolean   install()   Install current template to DB
boolean   load_from_Request()   Load data from Request form fields.
void   load_params_from_Request()   Load params
void   set_setting()   Set a template specific param value for current Blog
string   TS_()   Translate and escape single quotes.
string   T_()   Translate a given string, in the Template's context.

[ Top ]
Properties
array   $container_list = NULL [line 43]

Lazy filled.


[ Top ]
mixed   $folder [line 36]

[ Top ]
mixed   $name [line 35]

[ Top ]
array   $poweredby_linkback [line 59]

Our own application credits (lazy filled by constructor).

These are displayed by the "credits" display handler.


[ Top ]
mixed   $type [line 37]

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

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

API Tags:
See:  Template::T_()


[ Top ]
Methods
static method disp_screenshot  [line 650]

  static void disp_screenshot( $template_folder, $template_name, [ $function = NULL], [ $selected = false], [ $select_url = NULL], [ $function_url = NULL]  )

Display screenshot for template folder in various places.

Including for NON installed templates.

Parameters:
   $template_folder: 
   $template_name: 
   $function: 
   $selected: 
   $select_url: 
   $function_url: 


[ Top ]
Constructor Template  [line 67]

  Template Template( [table $db_row = NULL], [ $template_folder = NULL]  )

Constructor

Parameters:
table   $db_row:  Database row
   $template_folder: 


[ Top ]
container  [line 435]

  void container( string $sco_name, [array $params = array()]  )

Display a container

  1.  $params array_mergearray// stop annoying validation errors when container is <ul> and empty
  2.    'container_start' => '<div id="%sco_name%" class="container">',
  3.    'container_end' => '</div>',
  4.  )$params );

Parameters:
string   $sco_name: 
array   $params: 

API Tags:
Usedby:  template_container()
Uses:  ComponentWidget::init_display()
Uses:  ComponentWidget::display()


[ Top ]
CreateDefaultWidgets  [line 132]

  void CreateDefaultWidgets( obj &$edited_Blog  )

Create default widgets for requested blog

Parameters:
obj   &$edited_Blog:  Blog $edited_Blog

Information Tags:
Todo:  yabs > change this to param array

[ Top ]
dbinsert  [line 599]

  boolean dbinsert( )

Insert object into DB based on previously recorded changes.


API Tags:
Return:  true


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

[ Top ]
dbupdate  [line 577]

  boolean dbupdate( )

Update the DB based on previously recorded changes


API Tags:
Return:  true


Redefinition of:
DataObject::dbupdate()
Update the DB based on previously recorded changes

[ Top ]
dbupdate_settings  [line 792]

  void dbupdate_settings( )

Save template specific settings for current blgo to DB



[ Top ]
db_save_containers  [line 621]

  void db_save_containers( )

Save containers

to be called by dbinsert / dbupdate



[ Top ]
discover_containers  [line 474]

  void discover_containers( )

Discover containers included in template file



[ Top ]
display_init  [line 808]

  void display_init( )

Get ready for displaying the template.

This may register some CSS or JS...



Redefined in descendants as:

[ Top ]
get_containers  [line 554]

  array get_containers( )



[ Top ]
get_default_name  [line 320]

  void get_default_name( )

Get default name for the template.

Note: the admin can customize it.



Redefined in descendants as:

[ Top ]
get_default_type  [line 329]

  void get_default_type( )

Get default type for the template.



Redefined in descendants as:

[ Top ]
get_default_widgets  [line 211]

  array get_default_widgets( [ $params = array()]  )

Get default widgets for new blog

The new blog's template can suggest/select a list of widgets. If it does not a default list is used.

A template can suggest/select any widget by identifying the container, and each widget's code and type. The code can be 'widget' or 'plugin'. If 'plugin' and the plugin is not installed nothing bad happens. I think.

  1.  $default_widgets array(
  2.    'Header' => array(),
  3.    'Menu' => array(),
  4.    'Sidebar' => array(),
  5.  );
  6.  $default_widgets['Header'][array(
  7.    'title' => array(
  8.      'type' => 'widget',
  9.    ),
  10.  );
  11.  $default_widgets['Menu'][array(
  12.    'menu_link' => array(
  13.      'type' => 'widget',
  14.      'params' => array(
  15.        'link_type'=>'ownercontact',
  16.      ),
  17.    ),
  18.  );
  19.  $default_widgets['Sidebar'][array(
  20.    'calendar' => array(
  21.      'type' => 'plugin',
  22.    ),
  23.  );

A widget installed with only code and type will have default values for any parameters it may have.

Parameters:
   $params: 

API Tags:
Return:  widgets for each container

Information Tags:
Todo:  (EdB/7618): verify/ensure each widget needs to identify it's own param possibilities

Redefined in descendants as:

[ Top ]
get_name  [line 338]

  void get_name( )

Get the customized name for the template.



[ Top ]
get_param_definitions  [line 729]

  void get_param_definitions( local $params  )

Get definitions for editable params

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

API Tags:
See:  Plugin::GetDefaultSettings()

Information Tags:
Todo:  this is destined to be overridden by derived Template classes

Redefined in descendants as:

[ Top ]
get_setting  [line 741]

  void get_setting( $parname  )

Get a template specific param value from current Blog

Parameters:
   $parname: 


[ Top ]
get_template_credits  [line 375]

  array get_template_credits( )

Get credits for linkback on credits page.

Each template can and should provide an array for credits for domains/authors who created the original design, inspired your design, or ported the template in the following format:

  1.  $template_linkbacks array(
  2.    'designer' => array(
  3.      'pre' => T_('Design by'),
  4.      'text' => 'linked text',
  5.      'post' => T_('A reasonably brief summary of the template. A sentence or two should be enough?'),
  6.      'url' => 'http://yourdomain.tld/',
  7.      'title' => T_('insert creative link title'),
  8.    ),
  9.  );
  10.  return $template_linkbacks;

Consider "designer" or "inspired" or "ported" as usual and customary types, and please limit the amount of linkbacks provided in the array. More than 3 will give a warning to the installer that your template might be spam!

'pre' => T_('Design by') or T_('Inspired by') or T_('Ported by') 'text' => the linked text - your name or domain name for example 'post' => can be '' (empty), and can hold HTML if you want. Please keep it reasonably short! 'url' => REQUIRED (of course). Without a URL there is no linkback! 'title' => can be whatever you like, but should never be empty. Use the URL if nothing else.


API Tags:
Return:  The credits array (see above).


Redefined in descendants as:

[ Top ]
install  [line 111]

  boolean install( )

Install current template to DB


API Tags:
Return:  True on success, false on failure.


[ Top ]
load_from_Request  [line 390]

  boolean load_from_Request( )

Load data from Request form fields.


API Tags:
Return:  true if loaded data seems valid.


[ Top ]
load_params_from_Request  [line 407]

  void load_params_from_Request( )

Load params



[ Top ]
set_setting  [line 775]

  void set_setting( string $parname, mixed $parvalue  )

Set a template specific param value for current Blog

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


[ Top ]
TS_  [line 857]

  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:  Template::T_()

Information Tags:
Since:  3.2.0 (after beta)

[ Top ]
T_  [line 829]

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

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

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

It uses the global/regular T_() function as a fallback.

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:  Template::TS_()
Usedby:  Template::T_()
Uses:  Template::T_()

Information Tags:
Since:  3.2.0 (after beta)

[ Top ]