![]() |
Xataface 2.0
Xataface Application Framework
|
Public Member Functions | |
Dataface_SkinTool () | |
& | getResultController () |
_get_compile_path ($resource_name) | |
display ($context, $template=null, $compile_id=null) | |
register_skin ($name, $template_dir) | |
load_record ($params, &$smarty) | |
record_view ($params, &$smarty) | |
group ($params, &$smarty) | |
img ($params, &$smarty) | |
actions ($params, &$smarty) | |
actions_menu ($params, &$smarty) | |
record_actions ($params, &$smarty) | |
record_tabs ($params, &$smarty) | |
summary_list ($params, &$smarty) | |
glance_list ($params, &$smarty) | |
sort_controller ($params, &$smarty) | |
use_macro ($params, $content, &$smarty) | |
editable ($params, $content, &$smarty) | |
define_slot ($params, $content, &$smarty, &$repeat) | |
fill_slot ($params, $content, &$smarty) | |
translate ($params, $content, &$smarty) | |
result_controller ($params, &$smarty) | |
next_link ($params, &$smarty) | |
prev_link ($params, &$smarty) | |
jump_menu ($params, &$smarty) | |
limit_field ($params, &$smarty) | |
result_index ($params, &$smarty) | |
result_list ($params, &$smarty) | |
filters ($params, &$smarty) | |
records ($params, &$smarty) | |
related_list ($params, &$smarty) | |
bread_crumbs ($params, &$smarty) | |
search_form ($params, &$smarty) | |
if_allowed ($params, $content, &$smarty) | |
language_selector ($params, &$smarty) | |
block ($params, &$smarty) | |
feed ($params, &$smarty) | |
abs ($params, $url, &$smarty) | |
Static Public Member Functions | |
static & | getInstance () |
Data Fields | |
$compile_dir | |
$ENV | |
$skins = array() | |
$locals = array() | |
$languageTool | |
$app | |
$resultController = null |
Handles the display of content in Dataface using templates. Abstracts all templating.
$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:
http://smarty.php.net The Smarty website. Contains extensive documentation about smarty.
Definition at line 81 of file SkinTool.php.
_get_compile_path | ( | $ | resource_name | ) |
Get the compile path for this resource.
This method is used internally by SkinTool to find out where the compiled version of a particular template is located.
string | $resource_name |
Definition at line 260 of file SkinTool.php.
abs | ( | $ | params, |
$ | url, | ||
&$ | smarty | ||
) |
Definition at line 1065 of file SkinTool.php.
actions | ( | $ | params, |
&$ | smarty | ||
) |
Returns an associative array of actions matching the criteria.
var | The name of the variable to store the actions in. |
record | A Dataface record object. |
table | The name of a table |
category | The category of actions. |
Definition at line 557 of file SkinTool.php.
actions_menu | ( | $ | params, |
&$ | smarty | ||
) |
Definition at line 573 of file SkinTool.php.
block | ( | $ | params, |
&$ | smarty | ||
) |
Definition at line 1017 of file SkinTool.php.
bread_crumbs | ( | $ | params, |
&$ | smarty | ||
) |
Definition at line 925 of file SkinTool.php.
Definition at line 92 of file SkinTool.php.
define_slot | ( | $ | params, |
$ | content, | ||
&$ | smarty, | ||
&$ | repeat | ||
) |
Definition at line 754 of file SkinTool.php.
display | ( | $ | context, |
$ | template = null , |
||
$ | compile_id = null |
||
) |
Displays a template.
array | &$context | An associative array of variables that can be used in the template. |
string | $template | The name of the template to be displayed. It will look inside any registered template directory. By default it will check the application's templates directory, then look in the Dataface/templates directory to find the template. |
Definition at line 318 of file SkinTool.php.
editable | ( | $ | params, |
$ | content, | ||
&$ | smarty | ||
) |
Definition at line 739 of file SkinTool.php.
feed | ( | $ | params, |
&$ | smarty | ||
) |
Definition at line 1026 of file SkinTool.php.
fill_slot | ( | $ | params, |
$ | content, | ||
&$ | smarty | ||
) |
Definition at line 793 of file SkinTool.php.
filters | ( | $ | params, |
&$ | smarty | ||
) |
Definition at line 870 of file SkinTool.php.
static& getInstance | ( | ) | [static] |
Returns a singleton instance to the skin tool.
Definition at line 336 of file SkinTool.php.
& 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.
Definition at line 239 of file SkinTool.php.
glance_list | ( | $ | params, |
&$ | smarty | ||
) |
Definition at line 697 of file SkinTool.php.
group | ( | $ | params, |
&$ | smarty | ||
) |
Groups an array of Records (or associative arrays) together based on a specific field.
array | $params | Array of parameters |
Dataface_SkinTool | &$smarty | Reference to Smarty template engine. |
array | $params,[from] | The array that is to be grouped. |
string | $params,[var] | The name of the variable to assign the grouped structure to. |
string | $params,[on] | The name of the field on which to group the records. |
string | $params,[order] | A comma-delimited string of order directives to specify the order in which the records should be displayed. |
string | $params,[titles] | Titles for the groups in a format similar to css attributes. |
Definition at line 456 of file SkinTool.php.
if_allowed | ( | $ | params, |
$ | content, | ||
&$ | smarty | ||
) |
Checks to see if the current user has a particular permission on a given record.
array | $params | Associative array of parameters. |
string | $content | Since this method acts as a block tag, the second time it is called, it is passed the content of the block in this parameter. |
Smarty | &$smarty | Reference to the SkinTool object. -block boolean if_allowed -param string permission The name of the permission that is being checked. e.g. 'edit', or 'view'. -param Dataface_Record record The record to check the permission against. |
Definition at line 990 of file SkinTool.php.
img | ( | $ | params, |
&$ | smarty | ||
) |
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.
$params | = { "src" -> The url to the image (required) "width" -> The max width of the thumbnail (optional) "height" -> The max height of the thumbnail. (optional) """ Any other parameters that are appropriate for the img tag. } |
Definition at line 504 of file SkinTool.php.
jump_menu | ( | $ | params, |
&$ | smarty | ||
) |
Definition at line 841 of file SkinTool.php.
language_selector | ( | $ | params, |
&$ | smarty | ||
) |
Definition at line 1012 of file SkinTool.php.
limit_field | ( | $ | params, |
&$ | smarty | ||
) |
Definition at line 846 of file SkinTool.php.
load_record | ( | $ | params, |
&$ | smarty | ||
) |
Loads a record from the database and assigns it to a template variable.
{load_record var=myrecord} {*loads current record as specified by request's found set & query parameters.*} {$myrecord->val('FirstName')} {*Displays the value of the loaded record's 'FirstName' field. *}
array | $params | Associative array of parameters. |
Smarty | &$smarty | Reference to the SkinTool object context. |
-function load_record -param string table The name of the table from which to load the record. (Optional - will default to current table). -param string var The name of the variable into which the record should be loaded. -param % Optional key-value pairs of field names / values to find a particular record. If none are provided, the current record will be returned.
Definition at line 397 of file SkinTool.php.
next_link | ( | $ | params, |
&$ | smarty | ||
) |
Definition at line 830 of file SkinTool.php.
prev_link | ( | $ | params, |
&$ | smarty | ||
) |
Definition at line 836 of file SkinTool.php.
record_actions | ( | $ | params, |
&$ | smarty | ||
) |
Definition at line 672 of file SkinTool.php.
record_tabs | ( | $ | params, |
&$ | smarty | ||
) |
Definition at line 677 of file SkinTool.php.
record_view | ( | $ | params, |
&$ | smarty | ||
) |
Definition at line 433 of file SkinTool.php.
records | ( | $ | params, |
&$ | smarty | ||
) |
Definition at line 883 of file SkinTool.php.
register_skin | ( | $ | name, |
$ | template_dir | ||
) |
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...
string | $template_dir | The directory to the templates for this skin. |
string | $compile_dir | The directory where the compiled templates should be stored. |
Definition at line 358 of file SkinTool.php.
related_list | ( | $ | params, |
&$ | smarty | ||
) |
Definition at line 903 of file SkinTool.php.
result_controller | ( | $ | params, |
&$ | smarty | ||
) |
Definition at line 813 of file SkinTool.php.
result_index | ( | $ | params, |
&$ | smarty | ||
) |
Definition at line 851 of file SkinTool.php.
result_list | ( | $ | params, |
&$ | smarty | ||
) |
Definition at line 855 of file SkinTool.php.
search_form | ( | $ | params, |
&$ | smarty | ||
) |
Definition at line 967 of file SkinTool.php.
sort_controller | ( | $ | params, |
&$ | smarty | ||
) |
Definition at line 703 of file SkinTool.php.
summary_list | ( | $ | params, |
&$ | smarty | ||
) |
Definition at line 691 of file SkinTool.php.
translate | ( | $ | params, |
$ | content, | ||
&$ | smarty | ||
) |
Definition at line 804 of file SkinTool.php.
use_macro | ( | $ | params, |
$ | content, | ||
&$ | smarty | ||
) |
Definition at line 719 of file SkinTool.php.
$app |
Definition at line 89 of file SkinTool.php.
$compile_dir |
Definition at line 84 of file SkinTool.php.
$ENV |
Definition at line 85 of file SkinTool.php.
$languageTool |
Definition at line 88 of file SkinTool.php.
$locals = array() |
Definition at line 87 of file SkinTool.php.
$resultController = null |
Definition at line 90 of file SkinTool.php.
$skins = array() |
Definition at line 86 of file SkinTool.php.