Global Namespace
Elentra ME
Elentra has many moving parts, and understanding what's available to you as a developer will go a long way to learning Elentra.
Objects
Arrays
Variables
$db (Object)
Available: All Elentra versions
The $db
object allows you to access the active Elentra database connection. Elentra uses the ADOdb library to accomplish this.
While it is possible to use SQL directly in your code, it is currently considered best practice to access the database through the appropriate model (e.g. Model_Events::get($id)
).
Example Usage (Select):
Example Usage (Insert):
Example Usage (Update):
$ENTRADA_ACL (Object)
Available: Elentra 1.2+
The $ENTRADA_ACL
object allows you to check whether or not a user has access to do something. The [Elentra ACL] is fairly complex, so time should be taken to properly understand how it works.
Example Usage:
Entrada 1.6.1: www-root/core/library/Entrada/authentication/entrada_acl.inc.php
Entrada 1.7.0: www-root/core/library/Entrada/Acl.php
$ENTRADA_CACHE (Object)
Available: Elentra 1.2+
Using $ENTRADA_CACHE
allows you to easily save and load contents from cache. It extends Zend_Cache.
Example Usage:
$ENTRADA_ROUTER (Object)
$ENTRADA_ROUTER
$ENTRADA_SETTINGS (Object)
$ENTRADA_SETTINGS
$ENTRADA_TEMPLATE (Object)
$ENTRADA_TEMPLATE
$ENTRADA_USER (Object)
Available: Unknown
The $ENTRADA_USER object provides details for the currently logged in user.
Example Usage:
Entrada 1.6.1: www-root/core/library/Models/users/User.class.php
$translate (Object)
Available: Elentra 1.3+
Whenever you need to output text on a page you should do so like $translate->_("Your String");
. Elentra uses Zend_Translate to support multiple front-end languages, and when you wrap your language strings with the magic _()
method your text can be replaced with the correct language.
Example Usage:
$ONLOAD (Array)
Available: All Elentra versions
The $ONLOAD
array allows you to record JavaScript that you would like to run after the DOM load is complete. The elements added to this array during run-time are dynamically added to the bottom of your HTML document within a jQuery(document).ready(function() { ... });
block.
Example Usage:
$JQUERY (Array)
Available: All Elentra versions
The $JQUERY
array allows you to manually include additional jQuery libraries in the correct location (i.e. after the main jQuery library, but before other dependencies) between the current page's <head></head>
tags. The elements added to this array during run-time replace the %JQUERY%
placeholder from the active template's header.tpl.php
file.
Example Usage:
$HEAD (Array)
Available: All Elentra versions
The $HEAD
array allows you to include additional content between the current page's <head></head>
tags. The elements added to this array during run-time replace the %HEAD%
placeholder from the active template's header.tpl.php
file.
Example Usage:
$BREADCRUMB (Array)
Available: All Elentra versions
The $BREADCRUMB
array is a multidimensional array that is used to automatically generate a page's breadcrumb trail. You simply add arrays to the $BREADCRUMB
array that contain a url
and title
key.
Example Usage:
Result:
$AGENT_CONTACTS (Array)
$AGENT_CONTACTS
$MODULES (Array)
$MODULES
$ADMINISTRATION (Array)
$ADMINISTRATION
$SECTION (Variable)
$SECTION
$ACTION (Variable)
$ACTION
$MODULE (Variable)
$MODULE
Elentra CPD
@todo
Communities
Elentra has many moving parts, and understanding what's available to you as a developer will go a long way to learning Elentra. This page covers the global namespace for the Community system.
Variables
$COMMUNITY_ID (Variable)
Available: All Entrada versions
The $COMMUNITY_ID
variable will return the communities.community_id
of the community that is currently being accessed by the user.
Example Usage:
$COMMUNITY_URL (Variable)
Available: All Entrada versions
The $COMMUNITY_URL
variable will return the full URL of this community.
$COMMUNITY_TEMPLATE (Variable)
Available: All Entrada versions
$COMMUNITY_THEME (Variable)
Available: All Entrada versions
$LOGGED_IN (Variable)
Available: All Entrada versions
$COMMUNITY_MEMBER_SINCE (Variable)
Available: All Entrada versions
$COMMUNITY_MEMBER (Variable)
Available: All Entrada versions
$COMMUNITY_ADMIN (Variable)
Available: All Entrada versions
Last updated