The actions.ini file stores information about the various action?s that can be performed by your application. An action may be manifested in two ways:
As a web page
As a menu item
And there is no reason why an action cannot serve in both capacities simultaneously. All menu items and functions that Xataface performs are defined in the Xataface actions.ini file (in the root of the Xataface installation dirctory). You can also create an actions.ini file in your application's root directory to override existing Xataface actions, or to create your own. If you want to modify an existing action instead of overriding it, you can use this syntax.
[browse > browse]
label = Browse
The > symbol simply means to inherit from the existing browse action. All the attributes are the same, and we just override the label to Browse (originally was Details)
Additionally, for actions that pertain only to a single table, an actions.ini file may be placed in any table configuration directory?.
Syntax
As with the fields.ini file and the valuelists.ini file, the actions.ini file uses the simple INI file syntax? to define its actions. Each action is defined in its own section, and can have a number of directives to specify the action's behavior.
Here is a snippet from the Xataface actions.ini file to give you an idea:
;; Show the details of the current record
[browse]
label = Details
category = table_tabs
url = "{$this->url('-action=view')}"
accessKey = "b"
mode = browse
permission = view
order=0
;; Show a list of the records in the current found set
[list]
label = List
category = table_tabs
url = "{$this->url('-action=list')}"
accessKey = "l"
mode = list
template = Dataface_List_View.html
permission = list
order=0.5
;; Show a "Find Record Form"
[find]
label = Find
category = table_tabs
url = "{$this->url('-action=find')}"
accessKey = "f"
mode = find
permission = find
template = Dataface_Find_View.html
order=0.75
This snippet shows the definition of the browse, list, and find actions - three of the most central actions in a Xataface application. Notice how each action has its own section (according to INI file syntax?) with a number of directives which specify how the action behaves. For instance, each action has a "category" value of "table_tabs", which tells Xataface to display the actions as part of the table tabs in the user interface.
An optional directive to indicate that this action can be overridden by more specific directives in another ini file. Currently there is only support for a value of "relationships.ini" indicating that the settings can be overridden in the relationships.ini file. In order for this to work, related=1 must also be set.
The name of the action's category which can be used to group this action together with other similar actions to be used in a menu in the user interface.
This indicates which tab of the table tabs (find, details, list, etc...) that this action should appear to be part of when the action is viewed as a web page. If this is left undefined, or it does not match any existing visible action in the table tabs, then no tab will appear to be selected.
A PHP expression evaluating to a boolean value to indicate whether the URL directive should be evaluated. This basically checks to make sure that its OK to evaluate the "url" expression, just in case the current state of affairs would cause it to throw a fatal error.
Mouseover text for the action (when displayed as a menu item).
all
PHP Expression Context
Notice that the url?, condition?, and url_condition? directives allow you to use a PHP expression for their values. In order for this to be helpful, you should know a little bit about the context and environment in which these expressions will be executed. All expressions are evaluated immediately prior to being rendered, so the same action can be displayed multiple times in the same page, but have very different resulting values for their urls? and conditions?.
These expressions are all executed within the context of the Dataface_Application::parseString() method, with the following variables loaded in the local symbol table (i.e. you can use the following variables in your expressions).