Found 1 or 59 records in table Classes
Now Showing 1 of 1
Current Record: Dataface_SkinTool
Dataface_SkinTool
Handles the display of content in Dataface using templates. Abstracts all templating.
Description
Usage example
$tool =& Dataface_SkinTool::getInstance();
$context = array('var1'=>'value1', 'var2'=>'value2');
// context to provide information to the template.
// var1 will be available as {$var1} in the template, etc...
$template = 'MyTemplate.html';
// The name of the template to use. Location of templates directory stored in
// $GLOBALS['Dataface_Globals_Templates']
$tool->display($context, $template);
// prints the template
Templates can use any of the standard smarty markup in addition to new
markup that is added by the Skin Tool. Dataface-specific variables are
available via the $ENV variable, which is an associative array of values
relating to Dataface and the current context.
Some useful variables include:
- $ENV.DATAFACE_PATH
- The file path (not the URL path) to the current Dataface installation directory. e.g. /var/www/dataface
- $ENV.DATAFACE_URL
- The URL to the Dataface installation directory. Useful for including resources such as images in your templates. e.g. http://yourdomain.com/path/to/dataface
- $ENV.DATAFACE_SITE_PATH
- The file path (not the URL path) to your application's directory. e.g. /var/www/your/app
- $ENV.DATAFACE_SITE_URL
- The URL to your application's directory. e.g. http://yourdomain.com/path/to/your/app
- $ENV.DATAFACE_SITE_HREF
- The URL to your application's entry point script. e.g. http://yourdomain.com/path/to/your/app/index.php
- $ENV.APPLICATION
- The application's configuration array.
This includes any settings that you added to your conf.ini file. e.g. {ENV.APPLICATION._database.host}
will display the host name of the mysql database as specified in the conf.ini file.
- $ENV.APPLICATION_OBJECT
- A reference to the application object (Dataface_Application).
- $ENV.action
- The name of the action that is currently being performed. e.g. view, edit, new_related_record, etc..
- $ENV.table
- The name of the current database table.
- $ENV.relationship
- If there is a relationship currently specified in the request, this is the name of it.
- $ENV.limit
- The maximum number of records to show per page.
- $ENV.start
- The start position in the current result set.
- $ENV.resultSet
- A reference to the current record result set. This is a Dataface_QueryTool object.
- $ENV.record
- A reference to the current record. (if in browse mode).
- $ENV.mode
- The current application mode. e.g. browse, list, find
- $ENV.language
- The 2-digit language code of the currently selected language.
- $ENV.prefs
- The user's preferences array which decides which parts of the interface should be visible (among other settings).
- $ENV.search
- The current search term if a search has been performed in the search box.
Methods
- actions
- Returns an associative array of actions matching the criteria.
- actions_menu
- block
- bread_crumbs
- Dataface_SkinTool
- define_slot
- display
- Displays a template.
- fill_slot
- getInstance
- Returns a singleton instance to the skin tool.
- getResultController
- Obtains a reference to the result controller for this request. The result
controller is the control that allows users to navigate between records of
the current result set.
- group
- Groups an array of Records (or associative arrays) together based on a specific field.
- if_allowed
- Checks to see if the current user has a particular permission on a given record.
- img
- Prints an 'img' tag that will show a thumbnail of the requested image using
phpThumb. This function is registered with smarty so that it can be used
in the form of an {img} tag.
- jump_menu
- language_selector
- limit_field
- load_record
- Loads a record from the database and assigns it to a template variable.
- next_link
- prev_link
- record_actions
- record_tabs
- register_skin
- Registers a skin to be used as the default skin. This skin is added to
the top of the stack so it has the highest priority. If a template is
requested and this skin does not contain that template, then the SkinTool
will check the next skin in the stack. And so on...
- related_list
- result_controller
- result_index
- result_list
- search_form
- translate
- use_macro
- _get_compile_path
- Get the compile path for this resource.
Comments
Add comment