TIP_Application

Introduction

The main module

Source file
/Type/module/application.php
Extends
TIP_Module

This module manages the generation of the "page" (the most dynamic part of a TIP site). This is done by using the "content" property as a text buffer.

When the tagPage() is called, usually throught a tag in the main template, the TIP_Application module will call the callbacks stored in the queue in sequential order. The page is the output of these callbacks.

After a TIP_Application instantiation, the global variable $GLOBALS[TIP_MAIN] will contain a reference to this TIP_Application instantiated object. Your index.php, if the TIP system is properly configured, will usually be as the following one:

 <?php
 require_once './logic/TIP.php';

 TIP_Type::getInstance('main');
 $GLOBALS[TIP_MAIN]->go();
 ?>

Properties

incipit : string

Page begin string (incipit)

access
protected

explicit : string

Page end string (explicit)

access
protected

namespace : string

Namespace

access
protected

json : boolean

Flag to enable global JSON infrastructure for unobtrusive javascript

access
protected

title : string

Page title

access
protected

description : string

Page description

access
protected

robots : string

Robots metatag

access
protected

keywords : string

Page keywords

access
protected

additional : string

Additional code to add at the end of the <head> section

access
protected

data_engine : TIP_Data_Engine

The default data engine to use: required

access
protected

data_root : string

The data root path

access
protected

icon_root : string

The icon root path

access
protected

shared_modules : array

The shared modules interface

access
protected

The associative array of shared modules, organized by "job". The job is the key, while the instance id is the value.

data_prefix : string

A prefix to prepend to all data ids

access
protected

fatal_uri : string

The uri to redirect the browse on fatal errors

access
protected

head_template : string

The template to run to generate the <head>

access
protected

body_template : string

The template to run to generate the <body>

access
protected

default_template : string

The template to run to generate the default page content

access
protected

error_template : string

The file to run to notify errors

access
protected

warning_template : string

The file to run to notify warnings

access
protected

info_template : string

The file to run to notify informations

access
protected

content : string

The page content

access
protected

Methods

checkOptions (&$options) : bool

Check the options

&$options
array
Properties values
lines
205 - 224
static
yes
access
protected

Overridable static method that checks $options for missing or invalid values and eventually corrects its content.

__construct ($options)

Constructor

$options
array
Properties values
lines
233 - 237
access
protected

Initializes a TIP_Application instance.

postConstructor ()

lines
239 - 281
access
protected

getGlobal ($property) : &mixed

Get a global property

$property
string
The property name
lines
294 - 297
static
yes
access
public

Returns a reference to a property in the current application instance.

getGlobalItem ($id) : mixed

Get a global item

$id
string
The item id
lines
305 - 308
static
yes
access
public

getSharedModule ($job) : &TIP_Type|null

Get a shared module

$job
string
The job identifier
lines
324 - 333
static
yes
access
public

Some special modules are shared between the application. A common example is the logger or the notify modules. To provide maximum flexibility, this method will get a reference to these kind of modules accessing them by $job, not by id. $job is an arbitrary string identifying the type of work the module must do: maybe in the future, when TIP will be more stable, the jobs will be standardized with a bounch of constant values.

getSharedTemplate ($name) : &TIP_Template|null

Get a shared template

$name
string
The template name
lines
345 - 357
static
yes
access
public

Shared templates reside in the application directory and do not depend on any particular module.

notify ($severity, $id) : bool

Generic message notification

$severity
TIP_SEVERITY_...
Severity level
$id
mixed
The id of the message, without the "notify.$severity." prefix
lines
371 - 416
static
yes
access
public

Outputs a generic notification message running the specified template program with the current template engine. The output will be inserted at the beginning of the page content.

go ()

The "main" function

lines
424 - 474
access
public

The starting point of the TIP system. This must be called somewhere from your index.php.

setRobots ($index, $follow)

$index
$follow
lines
476 - 512
static
yes
access
public

tagPage ($params) : string|null

Output the page content

$params
string
Parameters of the tag
lines
525 - 537
access
protected

tagDebug ($params) : string|null

Output some debug information

$params
string
Parameters of the tag
lines
546 - 585
access
protected

Echoes some output and profiler information, useful in the developement process. This works only if the current user has some privilege on the application module.

runManagerAction ($action)

$action
lines
592 - 616
access
protected

runUntrustedAction ($action)

$action
lines
618 - 648
access
protected

runAction ($action)

$action
lines
650 - 659
access
protected
TIP_Application was last modified by TiP on Mon 25 May 2009 06:22:25 PM CEST
Hosted by BerliOS Developer Logo