Support Joomla!

Joomla! 1.5 Documentation

Packages

Package: Joomla-Framework

License

Content on this site is copyright © 2005 - 2008 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution- NonCommercial- ShareAlike 2.5. Some parts of this website may be subject to other licenses.

Abstract Class JApplication

Description

Base class for a Joomla! application.

Acts as a Factory class for application specific objects and provides many supporting API functions. Derived clases should supply the route(), dispatch() and render() functions.

Located in /joomla/application/application.php (line 31)

Class JObject   (Subpackage Base)

Abstract class JApplication   (Subpackage Application)
Variable Summary
Variable string $scope
Variable integer $_clientId
Variable array $_name
Method Summary
Static method static void registerEvent (string $event, mixed $handler)
Static method static array triggerEvent (string $event, [array $args = null])
Constructor JApplication __construct ([integer $config = array()])
Method void addCustomHeadTag (string $html)
Method void addMetaTag (string $name, string $content, [string $prepend = ''], [string $append = ''])
Method void appendMetaTag (string $name, string $content)
Method void appendPathWay ( $name, [ $link = null])
Method void close ([int $code = 0])
Abstract method void dispatch ( $component)
Method void enqueueMessage (string $msg, [string $type = 'message'])
Method void getBasePath ([ $client = 0], [ $addTrailingSlash = true])
Method mixed getCfg (string $varname)
Method int getClientId ()
Method void getHead ()
Method JApplication &getInstance ( $client, [array $config = array()], [ $prefix = 'J'], mixed $id)
Method void getItemid ( $id)
Method object JMenu. &getMenu ([ $name = null], [array $options = array()])
Method string getName ()
Method void getPageTitle ()
Method void getPath ( $varname, [ $user_option = null])
Method object JPathway. &getPathway ([ $name = null], [array $options = array()])
Method JRouter. &getRouter ([ $name = null], [array $options = array()])
Method string getTemplate ()
Method void &getUser ()
Method mixed getUserState (string $key)
Method The getUserStateFromRequest (string $key, string $request, [string $default = null], [string $type = 'none'])
Method void initialise ([array $options = array()])
Method boolean isAdmin ()
Method boolean isSite ()
Method boolean login (array $credentials, [array $options = array()])
Method void logout ([int $userid = null], [array $options = array()])
Method void prependMetaTag (string $name, string $content)
Method none; redirect (string $url, [string $msg = ''], [string $msgType = 'message'])
Abstract method void render ()
Abstract method void route ()
Method void setPageTitle ([ $title = null])
Method mixed setUserState (string $key, string $value)
Variables
string $scope = null (line 64)

The scope of the application

  • access: public
integer $_clientId = null (line 40)

The client identifier.

  • since: 1.5
  • access: protected
array $_messageQueue = array() (line 48)

The application message queue.

  • access: protected
array $_name = null (line 56)

The name of the application

  • access: protected

Inherited Variables

Inherited from JObject

Variable JObject::$_errors
Methods
Constructor __construct (line 71)

Class constructor.

JApplication __construct ([integer $config = array()])
  • integer $config: A client identifier.

Redefinition of:
JObject::__construct()
Class constructor, overridden in descendant classes.
addCustomHeadTag (line 915)

Deprecated, use JDocument->addCustomTag instead (only when document type is HTML).

void addCustomHeadTag (string $html)
  • string $html: Valid HTML
addMetaTag (line 873)

Deprecated, use JDocument->setMetaData instead.

void addMetaTag (string $name, string $content, [string $prepend = ''], [string $append = ''])
  • string $name: Name of the metadata tag
  • string $content: Content of the metadata tag
  • string $prepend: Deprecated, ignored
  • string $append: Deprecated, ignored
appendMetaTag (line 888)

Deprecated, use JDocument->setMetaData instead.

void appendMetaTag (string $name, string $content)
  • string $name: Name of the metadata tag
  • string $content: Content of the metadata tag
appendPathWay (line 798)

Deprecated, use JPathWay->addItem() method instead.

  • see: JPathWay::addItem()
  • deprecated: As of version 1.5
  • since: 1.0
void appendPathWay ( $name, [ $link = null])
  • $name
  • $link
close (line 250)

Exit the application.

  • access: public
void close (int $code)
  • int $code: Exit code
dispatch (line 210)

Dispatch the applicaiton.

Dispatching is the process of pulling the option from the request object and mapping them to a component. If the component does not exist, it handles determining a default component to dispatch.

  • access: public
  • abstract:
void dispatch ( $component)
  • $component
enqueueMessage (line 317)

Enqueue a system message.

  • since: 1.5
  • access: public
void enqueueMessage (string $msg, [string $type = 'message'])
  • string $msg: The message to enqueue.
  • string $type: The message type.
getBasePath (line 1003)

Deprecated, use JURI::base() instead.

  • see: JURI::base()
  • deprecated: As of version 1.5
  • since: 1.0
void getBasePath ( $client, [ $addTrailingSlash = true])
  • $client
  • $addTrailingSlash
getBlogCategoryCount (line 941)

Deprecated.

  • deprecated: As of version 1.5
  • since: 1.0
void getBlogCategoryCount ()
getBlogSectionCount (line 929)

Deprecated.

  • deprecated: As of version 1.5
  • since: 1.0
void getBlogSectionCount ()
getCfg (line 363)

Gets a configuration value.

  • return: The user state.
  • example: example not found
  • access: public
mixed getCfg (string $varname)
  • string $varname: The name of the value to get.
getClientId (line 758)

Gets the client id of the current running application.

  • return: A client identifier.
  • since: 1.5
  • access: public
int getClientId ()
getContentItemLinkCount (line 977)

Deprecated.

  • deprecated: As of version 1.5
  • since: 1.0
void getContentItemLinkCount ()
getCustomPathWay (line 842)

Deprecated, use JPathway->getPathWayNames() method instead.

  • see: JPathWay::getPathWayNames()
  • deprecated: As of version 1.5
  • since: 1.0
void getCustomPathWay ()
getGlobalBlogSectionCount (line 953)

Deprecated.

  • deprecated: As of version 1.5
  • since: 1.0
void getGlobalBlogSectionCount ()
getHead (line 856)

Deprecated, use JDocument->get( 'head' ) instead.

void getHead ()
getInstance (line 118)

Returns a reference to the global JApplication object, only creating it if it doesn't already exist.

This method must be invoked as:

  $menu = &JApplication::getInstance();

  • return: The appliction object.
  • since: 1.5
  • access: public
JApplication &getInstance ( $client, [array $config = array()], [ $prefix = 'J'], mixed $id)
  • mixed $id: A client identifier or name.
  • array $config: An optional associative array of configuration settings.
  • $client
  • $prefix
getItemid (line 1028)

Deprecated, use ContentHelper::getItemid instead.

  • see: ContentHelperRoute::getArticleRoute()
  • deprecated: As of version 1.5
  • since: 1.0
void getItemid ( $id)
  • $id
getMenu (line 669)

Return a reference to the application JPathway object.

  • since: 1.5
  • access: public
object JMenu. &getMenu ([ $name = null], [array $options = array()])
  • array $options: An optional associative array of configuration settings.
  • $name
getMessageQueue (line 340)

Get the system message queue.

  • return: system message queue.
  • since: 1.5
  • access: public
The getMessageQueue ()
getName (line 379)

Method to get the application name

The dispatcher name by default parsed using the classname, or it can be set by passing a $config['name'] in the class constructor

  • return: The name of the dispatcher
  • since: 1.5
  • access: public
string getName ()
getPageTitle (line 1068)

Deprecated, use JDocument::getTitle instead.

void getPageTitle ()
getPath (line 990)

Deprecated, use JApplicationHelper::getPath instead.

void getPath ( $varname, [ $user_option = null])
  • $varname
  • $user_option
getPathway (line 646)

Return a reference to the application JPathway object.

  • since: 1.5
  • access: public
object JPathway. &getPathway ([ $name = null], [array $options = array()])
  • array $options: An optional associative array of configuration settings.
  • $name
getRouter (line 623)

Return a reference to the application JRouter object.

  • since: 1.5
  • access: public
JRouter. &getRouter ([ $name = null], [array $options = array()])
  • array $options: An optional associative array of configuration settings.
  • $name
getStaticContentCount (line 965)

Deprecated.

  • deprecated: As of version 1.5
  • since: 1.0
void getStaticContentCount ()
getTemplate (line 610)

Gets the name of the current template.

string getTemplate ()
getUser (line 1015)

Deprecated, use JFactory::getUser instead.

void &getUser ()
getUserState (line 402)

Gets a user state.

  • return: The user state.
  • access: public
mixed getUserState (string $key)
  • string $key: The path of the state.
getUserStateFromRequest (line 440)

Gets the value of a user state variable.

  • return: request user state.
  • access: public
The getUserStateFromRequest (string $key, string $request, [string $default = null], [string $type = 'none'])
  • string $key: The key of the user state variable.
  • string $request: The name of the variable passed in a request.
  • string $default: The default value for the variable if not found. Optional.
  • string $type: Filter for the variable, for valid values see JFilterInput::clean(). Optional.
initialise (line 159)

Initialise the application.

  • access: public
void initialise ([array $options = array()])
  • array $options: An optional associative array of configuration settings.
isAdmin (line 770)

Is admin interface?

  • return: True if this application is administrator.
  • since: 1.0.2
  • access: public
boolean isAdmin ()
isSite (line 782)

Is site interface?

  • return: True if this application is site.
  • since: 1.5
  • access: public
boolean isSite ()
login (line 504)

Login authentication function.

Username and encoded password are passed the the onLoginUser event which is responsible for the user validation. A successful validation updates the current session record with the users details.

Username and encoded password are sent as credentials (along with other possibilities) to each observer (authentication plugin) for user validation. Successful validation will update the current session with the user details.

  • return: True on success.
  • since: 1.5
  • access: public
boolean login (array $credentials, [array $options = array()])
  • array $credentials: Array( 'username' => string, 'password' => string )
  • array $options: Array( 'remember' => boolean )
logout (line 565)

Logout authentication function.

Passed the current user information to the onLogoutUser event and reverts the current session record back to 'anonymous' parameters.

  • access: public
void logout ([int $userid = null], [array $options = array()])
  • int $userid: The user to load - Can be an integer or string - If string, it is converted to ID automatically
  • array $options: Array( 'clientid' => array of client id's )
prependMetaTag (line 902)

Deprecated, use JDocument->setMetaData instead

void prependMetaTag (string $name, string $content)
  • string $name: Name of the metadata tag
  • string $content: Content of the metadata tag
redirect (line 271)

Redirect to another URL.

Optionally enqueues a message in the system message queue (which will be displayed the next time a page is loaded) using the enqueueMessage method. If the headers have not been sent the redirect will be accomplished using a "301 Moved Permanently" code in the header pointing to the new location. If the headers have already been sent this will be accomplished using a JavaScript statement.

none; redirect (string $url, [string $msg = ''], [string $msgType = 'message'])
  • string $url: The URL to redirect to.
  • string $msg: An optional message to display on redirect.
  • string $msgType: An optional message type.
registerEvent (line 465)

Registers a handler to a particular event group.

  • since: 1.5
void registerEvent (string $event, mixed $handler)
  • string $event: The event name.
  • mixed $handler: The handler, a function or an instance of a event object.
render (line 231)

Render the application.

Rendering is the process of pushing the document buffers into the template placeholders, retrieving data from the document and pushing it into the JResponse buffer.

  • access: public
  • abstract:
void render ()
route (line 189)

Route the application.

Routing is the process of examining the request environment to determine which component should receive the request. The component optional parameters are then set in the request object to be processed when the application is being dispatched.

  • access: public
  • abstract:
void route ()
setPageTitle (line 1055)

Deprecated, use JDocument::setTitle instead.

void setPageTitle ([ $title = null])
  • $title
setUserState (line 420)

Sets the value of a user state variable.

  • return: The previous state, if one existed.
  • access: public
mixed setUserState (string $key, string $value)
  • string $key: The path of the state.
  • string $value: The value of the variable.
triggerEvent (line 480)

Calls all handlers associated with an event group.

  • return: An array of results from each function call.
  • since: 1.5
array triggerEvent (string $event, [array $args = null])
  • string $event: The event name.
  • array $args: An array of arguments.

Inherited Methods

Inherited From JObject

 JObject::JObject()
 JObject::__construct()
 JObject::get()
 JObject::getError()
 JObject::getErrors()
 JObject::getProperties()
 JObject::getPublicProperties()
 JObject::set()
 JObject::setError()
 JObject::setProperties()
 JObject::toString()

Documentation generated on Tue, 29 Jan 2008 18:44:14 +0000 by phpDocumentor 1.3.1