VCL
[ class tree: VCL ] [ index: VCL ] [ all elements ]

Class: Application

Source Location: /forms.inc.php

Class Overview

Object
   |
   --Persistent
      |
      --Component
         |
         --Application

A class to reference all the forms created on your application.


Variables

Methods


Inherited Variables

Inherited Methods

Class: Component

Component::__construct()
Component constructor
Component::ajaxCall()
Dumps the javascript code to make an ajax call to the server.
Component::callEvent()
Calls a server event.
Component::defaultName()
Component::defaultTag()
Component::dumpChildrenFormItems()
This method is called by the page just after dumping the starting form tag.
Component::dumpChildrenHeaderCode()
Dumps the header code for all the children
Component::dumpChildrenJavascript()
Dumps the javascript code for all the children
Component::dumpFormItems()
Dumps code just after the form tag, useful to dump hidden fields for state retrieving for non visible components
Component::dumpHeaderCode()
Dumps header code required
Component::dumpHiddenKeyFields()
Dumps hidden field values for the key record
Component::dumpJavascript()
Dumps the javascript code needed by this component
Component::dumpJSEvent()
Dumps javascript code for an event
Component::fixupProperty()
Resolves the right reference to an object property
Component::generateAjaxEvent()
Returns the javascript code to generate an ajax call.
Component::getName()
Specifies the name for the component. The name is used as an identifier and should be unique.
Component::getTag()
A versatile property of every Component that can be used in any way you want
Component::hasValidDataField()
Returns true if a valid data field is attached to the component
Component::init()
Initializes a component
Component::insertComponent()
Inserts a component into the component's collection
Component::loaded()
Initializes the component after the form file has been read into memory.
Component::loadedChildren()
Calls childrens loaded
Component::loadResource()
Loads this component from a string
Component::preinit()
Method called before init()
Component::readAccessibility()
Provides accessibility info to the embedded RPC engine.
Component::readComponentCount()
Indicates the number of components owned by the component.
Component::readComponents()
Lists all the components owned by this component.
Component::readControlState()
A flag to know the state of the control, csLoading, csDesigning
Component::readDataFieldValue()
This property returns the value of the datafield if any.
Component::readFromResource()
Reads a component from a resource file
Component::readNamePath()
Specifies the path to uniquely identify a component, qualified by the owner when required.
Component::readOwner()
Indicates the component that is responsible for streaming and freeing this component.
Component::removeComponent()
Removes a component from the component's collection
Component::serializeChildren()
Serializes all children
Component::setName()
Component::setTag()
Component::unserializeChildren()
Unserializes all children by calling unserialize for all the components
Component::updateDataField()
Updates the field on the dataset attached, if any
Component::writeControlState()

Class: Persistent

Persistent::allowserialize()
This method provides an opportunity for the component developer to prevent the serialization/unserialization of a property.
Persistent::assign()
Assigns the source properties to this object.
Persistent::assignError()
Raises an assignation error.
Persistent::assignTo()
Assigns this object to another object.
Persistent::inSession()
This method determines if this object exists in the current session.
Persistent::readNamePath()
Used to serialize/unserialize. It returns the full path to identify this component.
Persistent::readOwner()
Owner of the component.
Persistent::serialize()
Stores this object into the session.
Persistent::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.

Class: Object

Object::__construct()
Constructs an object and initializes its data before the object is first used.
Object::className()
Returns a string indicating the type of the object instance (as opposed to the type of the variable passed as an argument).
Object::classNameIs()
Determines whether an object is of a specific type.
Object::classParent()
Returns the type of the immediate ancestor of a class.
Object::inheritsFrom()
Determines the relationship of two object types.
Object::methodExists()
Check if a method exists declared on this object instance.
Object::readProperty()
Reads a property from the streams
Object::__get()
To virtualize properties
Object::__set()
To virtualize properties

Class Details

[line 86]
A class to reference all the forms created on your application.

The Application class holds a reference to all the forms created in your application because the Owner for them is always the global Application object. This class is also used to switch the language for the whole application by using the Language property.

This class is also responsible for session management, if you include a restore_session=1 in your request, the object, when created, will destroy the existing session and will create a new one, so your application will start fresh.




[ Top ]


Class Variables

$_language =

[line 88]



Tags:

access:  protected

Type:   mixed


[ Top ]



Class Methods


constructor __construct [line 117]

Application __construct( [ $aowner = null])



Overrides Component::__construct() (Component constructor)

Parameters:

   $aowner  

[ Top ]

method autoDetectLanguage [line 178]

void autoDetectLanguage( )

Performs an auto detection of the language used by the user browser and set the Language property accordingly.

This method performs a detection operation trying to guess which language is used by the user depending on the browser headers and information is sent.

Can be used to accomodate automatically your application to the right language the user want to get without prompting for it.

Valid languages can be found on language/php_language_detection.php on the function called languages() and you can get such list as an array calling that function in your software

  1.  <?php
  2.       function Button1Click($sender$params)
  3.       {
  4.        global $application;
  5.  
  6.        $application->autoDetectLanguage();
  7.        echo $application->Language;
  8.        //This echoes in the browser "Spanish (Traditional Sort)"
  9.       }
  10.  ?>




Tags:

see:  languages()


[ Top ]

method getLanguage [line 114]

string getLanguage( )

Sets the application language, so all forms in the application will share this setting.

If you want to change the Language property for all your forms at once, you can use this property, as forms take this setting into account when switching language.

This property is of string type and you can set it to anything you want, provided your language files share the same value and your locale resources also share that setting.

  1.  <?php
  2.  global $application;
  3.  $application->Language="English";
  4.  //Now, your forms must have a unit.English.xml.php resource file with your translated strings
  5.  //and also a locale/English/messages.mo to be used for runtime strings
  6.  ?>




Tags:



[ Top ]

method setLanguage [line 115]

void setLanguage( $value)



Parameters:

   $value  

[ Top ]


Documentation generated on Sat, 13 Jun 2009 10:51:38 -0700 by phpDocumentor 1.4.1