ZenMagick 0.9.6


org.zenmagick.service.ZMTemplateManager

Class ZMTemplateManager

ZMObject
|
+--ZMTemplateManager

public class ZMTemplateManager
extends ZMObject

Template stuff.

This is a collection of things to make templating easier.

Author:
DerManoMann
Version:
$Id: ZMTemplateManager.php 2117 2009-03-29 23:34:14Z dermanomann $

Field Summary
final mixed

PAGE_BOTTOM

final mixed

PAGE_NOW

final mixed

PAGE_TOP

Fields inherited from org.zenmagick.ZMObject
properties_
Constructor Summary

ZMTemplateManager()

Create new instance.

Method Summary
void

cssFile(string filename, array attr)

Add the given CSS file to the final contents.

int

getFieldLength(string table, string field)

Get the field length of a particular column.

array

getLeftColBoxNames()

Get the box names for the left column.

string

getProductTemplate(int productId)

Find the product template for a given product.

array

getRightColBoxNames()

Get the box names for the right column.

static void

instance()

Get instance.

boolean

isLeftColEnabled()

Checks if the left column is active.

boolean

isRightColEnabled()

Checks if the right column is active.

void

jsFile(string filename, string position)

Add the given JavaScript file to the final contents.

void

onZMFinaliseContents(mixed args)

Event handler to inject JavaScript and CSS resources.

void

setLeftColBoxes(array boxes)

Set the boxes for the left column.

void

setLeftColEnabled(boolean bool)

Enable/disable the left column.

void

setRightColBoxes(array boxes)

Set the boxes for the right column.

void

setRightColEnabled(boolean bool)

Enable/disable the right column.

Methods inherited from org.zenmagick.ZMObject
attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton

Field Detail

PAGE_BOTTOM

public final mixed PAGE_BOTTOM = 'bottom'

PAGE_NOW

public final mixed PAGE_NOW = 'now'

PAGE_TOP

public final mixed PAGE_TOP = 'top'

Constructor Detail

ZMTemplateManager

public ZMTemplateManager()

Create new instance. /


Method Detail

cssFile

public void cssFile(string filename, array attr)

Add the given CSS file to the final contents.

Parameters:
filename - A relative CSS filename.
attr - Optional attribute map.

getFieldLength

public int getFieldLength(string table, string field)

Get the field length of a particular column.

Parameters:
table - The database table name.
field - The field/column name.
Returns:
The field length.

getLeftColBoxNames

public array getLeftColBoxNames()

Get the box names for the left column.

Returns:
Name of all boxes to be displayed.

getProductTemplate

public string getProductTemplate(int productId)

Find the product template for a given product.

Parameters:
productId - The product id.
Returns:
The template name to be used to display product details.

getRightColBoxNames

public array getRightColBoxNames()

Get the box names for the right column.

Returns:
Name of all boxes to be displayed.

instance

public static void instance()

Get instance. /


isLeftColEnabled

public boolean isLeftColEnabled()

Checks if the left column is active.

Returns:
true if the column is active, false if not.

isRightColEnabled

public boolean isRightColEnabled()

Checks if the right column is active.

Returns:
true if the column is active, false if not.

jsFile

public void jsFile(string filename, string position)

Add the given JavaScript file to the final contents.

Parameters:
filename - A relative JavaScript filename.
position - Optional position; either PAGE_TOP (default), or PAGE_BOTTOM.

onZMFinaliseContents

public void onZMFinaliseContents(mixed args)

Event handler to inject JavaScript and CSS resources. /


setLeftColBoxes

public void setLeftColBoxes(array boxes)

Set the boxes for the left column.

Parameters:
boxes - List of box names to be displayed in the left column.

setLeftColEnabled

public void setLeftColEnabled(boolean bool)

Enable/disable the left column.

Parameters:
bool - If true the left column will be displayed.

setRightColBoxes

public void setRightColBoxes(array boxes)

Set the boxes for the right column.

Parameters:
boxes - List of box names to be displayed in the right column.

setRightColEnabled

public void setRightColEnabled(boolean bool)

Enable/disable the right column.

Parameters:
bool - If true the right column will be displayed.

ZenMagick 0.9.6