Manual and Documentation

NOTE: This manual describes HammerKit version 3.5. To view documentation for the current release of HammerKit Studio, please go to http://manual.hammerkit.com/
search
Index / D. Object API / Global Variables

A. Introduction
B. Installation and Configuration
C. Using HammerKit tools
D. Object API
Classes
Interfaces
Object Choosers
Global Variables
Modules
Tools
Converters
Using the API
E. HammerScript
F. Access Rights
Global Variables


Global variables are named with two leading and trailing underscores in the variable name, like $__global_variable__. For historical reasons many of the global variables are not named according to this rule. All new globals must be named like this.

New global variables should be introduced only when it is absolutely necessary. Cluttering the global namespace should be avoided at all times. Global variables should only exist in order to enable communication between objects and different separate parts of the HammerKit code.



Variables

array __fetched__
Description: Contains all the raw database row objects of fetched objects' data. The first level key is the name of the class, like Button, Color, Component, File, Keyword, Style, User and Usergroup. The second level key is the id of an object. In the case of objects fetched from the users database, i.e. Keyword, User and Usergroup, the id key is a combination of the users database name, unique attribute name and attribute value like "[users_database]:username:[username]" or "[users_database]:id:[id]" for User objects. This variable serves as a cache for the objects' data and is rarely needed outside of the classes.
Example: $GLOBALS["__fetched__"]["File"][34] or $GLOBALS["__fetched__"]["User"]["hammerkit_users:id:34"]

array __lang__
Description: A list of all the interface texts. The first level key is either class, admin, button or tool.
Example: $GLOBALS["__lang__"]["class"]["File"]["deny_modify"]

object:Page __page__
Description:

object:Site __site__ [NOT YET IMPLEMENTED]
Description: The Site object of the current site, i.e. the object from "new Site($GLOBALS["cfg"]->shopname)".

object:Config cfg
Description: Contains all the configuration settings of the site.
Example: $GLOBALS["cfg"]->shopname

object:stdClass cgi
Description: Contains all the variables provided via HTTP POST and HTTP GET.
Example: $GLOBALS["cgi"]->some_cgi_variable


� HammerKit Oy 2008 UPDATED: 28.04.2008 19:35