Class PageTemplate

(line 38)

Description

Object
   |
   --Persistent
      |
      --Component
         |
         --PageTemplate

Located in File: /templateplugins.inc.php

Base class for template engines.

Inherit from it and override initialize(), assignComponents() and dumpTemplate()



Classes extended from PageTemplate:
SmartyTemplate
This class is used by the template engine to work with Smarty templates.

Properties

Summary:
FileName Template filename

Defined in class Component

Name Specifies the name for the component. The name is used as an identifier and should be unique.
Tag A versatile property of every Component that can be used in any way you want
ComponentCount Indicates the number of components owned by the component.
Components Lists all the components owned by this component.
ControlState A flag to know the state of the control, csLoading, csDesigning
DataFieldValue This property returns the value of the datafield if any.
NamePath Specifies the path to uniquely identify a component, qualified by the owner when required.
Owner Indicates the component that is responsible for streaming and freeing this component.

Defined in class Persistent

NamePath Used to serialize/unserialize. It returns the full path to identify this component.
Owner Owner of the component.

property FileName (line 50)

string FileName

Template filename

Use this property to specify the filename in your system that has the template to use when rendering the page.


property Name

Specifies the name for the component. The name is used as an identifier and should be unique.
This property is implemented in Component::Name

property Tag

A versatile property of every Component that can be used in any way you want
This property is implemented in Component::Tag

property ComponentCount

Indicates the number of components owned by the component.
This property is implemented in Component::ComponentCount

property Components

Lists all the components owned by this component.
This property is implemented in Component::Components

property ControlState

A flag to know the state of the control, csLoading, csDesigning
This property is implemented in Component::ControlState

property DataFieldValue

This property returns the value of the datafield if any.
This property is implemented in Component::DataFieldValue

property NamePath

Specifies the path to uniquely identify a component, qualified by the owner when required.
This property is implemented in Component::NamePath

property Owner

Indicates the component that is responsible for streaming and freeing this component.
This property is implemented in Component::Owner

property NamePath

Used to serialize/unserialize. It returns the full path to identify this component.
This property is implemented in Persistent::NamePath

property Owner

Owner of the component.
This property is implemented in Persistent::Owner

Methods

Summary:
__construct Component constructor [Overrides Component::__construct()]
assignComponents Called to assign component code to template holes
dumpTemplate Called to dump the parsed Template to the output stream
initialize Called to initialize the template system

Defined in class Component

dumpChildrenJavascript Dumps the javascript code for all the children
dumpFormItems Dumps code just after the form tag, useful to dump hidden fields for state retrieving for non visible components
dumpHeaderCode Dumps header code required
dumpJavascript Dumps the javascript code needed by this component
hasValidDataField Returns true if a valid data field is attached to the component
init Initializes a component
loaded Initializes the component after the form file has been read into memory.
loadedChildren Calls childrens loaded
preinit Method called before init()
serializeChildren Serializes all children
unserializeChildren Unserializes all children by calling unserialize for all the components

Defined in class Persistent

serialize Stores this object into the session.
unserialize This method uses PHP reflection to iterate through published properties (the ones starting with get) and retrieve the properties stored by a previous serialize() call.

Defined in class Object

__construct Constructs an object and initializes its data before the object is first used.
className Returns a string indicating the type of the object instance (as opposed to the type of the variable passed as an argument).
classParent Returns the type of the immediate ancestor of a class.

Constructor __construct (line 136)

PageTemplate __construct( [ $aowner = null])

Overrides : Component::__construct() Component constructor


Method assignComponents (line 118)

void assignComponents( )

Called to assign component code to template holes

Override this method to iterate through all components in the form and place the code in the holes of your template.

  1.  <?php
  2.       function assignComponents()
  3.       {
  4.               $form=$this->owner;
  5.               ob_start();
  6.               $form->callEvent('onshowheader',array());
  7.               $contents=ob_get_contents();
  8.               ob_end_clean();
  9.               $this->_smarty->assign('HeaderCode'$contents.$form->dumpChildrenHeaderCode(true).$form->dumpHeaderJavascript(true));
  10.               $this->_smarty->assign('StartForm'$form->readStartForm());
  11.               $this->_smarty->assign('EndForm'$form->readEndForm());
  12.               reset($form->controls->items);
  13.               while (list($k,$v)=each($form->controls->items))
  14.               {
  15.                       $dump = false;
  16.                       if$v->Visible && !$v->IsLayer )
  17.                       {
  18.                           if$v->Parent->methodExists('getActiveLayer') )
  19.                           {
  20.                               $dump (string)$v->Layer == (string)$v->Parent->Activelayer );
  21.                           }
  22.                           else
  23.                           {
  24.                               $dump = true;
  25.                           }
  26.                       }
  27.                       if ($dump)
  28.                       {
  29.                           $code="<div id=\"".$v->Name."_outer\">\n";
  30.                           $code.=$v->show(true);
  31.                           $code.="\n</div>\n";
  32.                           $this->_smarty->assign($v->Name$code);
  33.                       }
  34.               }
  35.       }
  36.  ?>


Method dumpTemplate (line 134)

void dumpTemplate( )

Called to dump the parsed Template to the output stream

Override this method to dump the template with all the contents to the output.

  1.  <?php
  2.       function dumpTemplate()
  3.       {
  4.               $this->_smarty->display($this->FileName);
  5.       }
  6.  ?>


Method initialize (line 71)

void initialize( )

Called to initialize the template system

Override this method to provide initialization code for your template system, this process is usually create the template object

  1.  <?php
  2.       function initialize()
  3.       {
  4.               require_once("smarty/libs/Smarty.class.php");
  5.               $this->_smarty = new Smarty;
  6.               $this->_smarty->template_dir = '';
  7.       }
  8.  ?>


Events

Summary:

[none]

Javascript Events

Summary:

[none]

Documentation generated on Fri, 26 Dec 2008 11:46:48 +0100 by phpDocumentor 1.4.0a2