<?xml version="1.0"?>
<record><wiki id="wiki?page_id=15">
	<page_name>validateRegistrationForm</page_name>
	<page_id>15</page_id>
	<page_title>validateRegistrationForm</page_title>
	<content>==validateRegistrationForm() hook==

A hook that validates the input into the user registration form to make sure that the input is valid.

===Signature===

function validateRegistrationForm( array $values ) : mixed

====Parameters====

{| class=&quot;listing listing2&quot;
! Name
! Description
|-
| $values
| An associative array of the input values of the registration form.
|-
| returns
| Mixed. If this method returns a PEAR_Error object then the validation will fail - and the user will be asked to correct his input.
|}

===Example===

&lt;code&gt;
&lt;?php
class conf_ApplicationDelegate {
    function validateRegistrationForm($values){
        if ( $values[&apos;age&apos;] &lt; 18 ){
            return PEAR::raiseError(&quot;Sorry you must be at least 18 years old to join this site.&quot;);
        }
        return true;
    }
}
&lt;/code&gt;

===Validation via the Users table Delegate class===

Note that since the registration form is just a &quot;new record form&quot; for the users table, it is also possible (and preferred) to do validation through the users [[table delegate class]].

===See Also===

* [[afterRegister]]
* [[beforeRegister]]
* [[sendRegistrationActivationEmail]]
* [[getRegistrationActivationEmailInfo]]
* [[getRegistrationActivationEmailSubject]]
* [[getRegistrationActivationEmailMessage]]
* [[getRegistrationActivationEmailParameters]]
* [[getRegistrationActivationEmailHeaders]]</content>
	<keywords></keywords>
	<language>en</language>
	<original_page>0</original_page>
</wiki>
<wiki id="wiki?page_id=14">
	<page_name>afterRegister</page_name>
	<page_id>14</page_id>
	<page_title>afterRegister</page_title>
	<content>==afterRegister() Trigger==

A trigger that can be implemented in the [[Application Delegate Class]] or the [[Table Delegate Class]], to be executed after the registration form is saved.  This can be used to perform some custom actions like emailing the administrator.

===Signature===

function afterRegister( Dataface_Record &amp;$record ) : mixed

====Parameters====

{| class=&quot;listing listing2&quot;
! Name
! Description
|-
| &amp;$record
| A Dataface_Record object encapsulating the record that is being inserted in the users table for this registration.
|-
| returns
| Mixed. If this method returns a PEAR_Error object, then registration will fail with an error.
|}

===Example===

&lt;code&gt;
&lt;?php
class conf_ApplicationDelegate {
    function afterRegister(&amp;$record){
        // mail the admin to let him know that the registration is occurring.
        mail(&apos;admin@example.com&apos;, &apos;New registration&apos;, &apos;A new user &apos;.$record-&gt;val(&apos;username&apos;).&apos; has registered);
    }
}
&lt;/code&gt;

===See Also===

* [[beforeRegister]]
* [[validateRegistrationForm]]
* [[sendRegistrationActivationEmail]]
* [[getRegistrationActivationEmailInfo]]
* [[getRegistrationActivationEmailSubject]]
* [[getRegistrationActivationEmailMessage]]
* [[getRegistrationActivationEmailParameters]]
* [[getRegistrationActivationEmailHeaders]]</content>
	<keywords></keywords>
	<language>en</language>
	<original_page>0</original_page>
</wiki>
<wiki id="wiki?page_id=13">
	<page_name>beforeRegister</page_name>
	<page_id>13</page_id>
	<page_title>beforeRegister</page_title>
	<content>==beforeRegister() Trigger==

A trigger that can be implemented in the [[Application Delegate Class]] or the [[Table Delegate Class]], to be executed before the registration form is saved.  This can be used to perform some custom actions like emailing the administrator.

===Signature===

function beforeRegister( Dataface_Record &amp;$record ) : mixed

====Parameters====

{| class=&quot;listing listing2&quot;
! Name
! Description
|-
| &amp;$record
| A Dataface_Record object encapsulating the record that is being inserted in the users table for this registration.
|-
| returns
| Mixed. If this method returns a PEAR_Error object, then registration will fail with an error.
|}

===Example===

&lt;code&gt;
&lt;?php
class conf_ApplicationDelegate {
    function beforeRegister(&amp;$record){
        // mail the admin to let him know that the registration is occurring.
        mail(&apos;admin@example.com&apos;, &apos;New registration&apos;, &apos;A new user &apos;.$record-&gt;val(&apos;username&apos;).&apos; has registered);
    }
}
&lt;/code&gt;

===See Also===

* [[afterRegister]]
* [[validateRegistrationForm]]
* [[sendRegistrationActivationEmail]]
* [[getRegistrationActivationEmailInfo]]
* [[getRegistrationActivationEmailSubject]]
* [[getRegistrationActivationEmailMessage]]
* [[getRegistrationActivationEmailParameters]]
* [[getRegistrationActivationEmailHeaders]]</content>
	<keywords></keywords>
	<language>en</language>
	<original_page>0</original_page>
</wiki>
<wiki id="wiki?page_id=12">
	<page_name>Application_Delegate_Class</page_name>
	<page_id>12</page_id>
	<page_title>Application Delegate Class</page_title>
	<content>[[toc]]

===Synopsis===

The application delegate class is similar to the [[Delegate_class_methods|table_delegate_class]] except that it is applicable to the application as a whole, not just one table.  It allows the developer to implement hooks that will be executed by Xataface to modify behavior.

Examples of customizations that can be made with the Application Delegate class include:

* Permissions
* User Preferences
* Custom content to be inserted into templates.
* Triggers
* more.

===Location===

The delegate class is optional and should be located in the conf/ApplicationDelegate.php file in the application directory.

===Example===

&lt;code&gt;
&lt;?php
class conf_ApplicationDelegate {
   function getPermissions(&amp;$record){
       return Dataface_PermissionsTool::NO_ACCESS();
   }
}
&lt;/code&gt;

===Available Methods===

====Triggers====
{| class=&quot;listing listing2&quot;
! Name
! Description
! Version
|-
| after_action_activate
| Trigger called after activation is complete.  Activation occurs after a user registers and responds to the registration confirmation email.
| 1.2.5
|-
| after_action_login
| Trigger called after a user logs in
| 1.0
|-
| after_action_logout
| Trigger called after a user logs out
| 1.0
|-
| after_action_edit
| Trigger called after the edit action completes.
| 1.0
|-
| after_action_new
| Trigger called after new action completes.
| 1.0
|-
| after_action_delete
| Trigger called after the delete action completes.
| 1.0
|-
| [[after_action_activate]]
| Trigger called after successfully email validation (after registering).
| 1.2
|-
| [[before_authenticate]]
| Trigger called just before authentication is carried out.  This allows you to change the authentication type based on such things as SESSION variables etc...
| 1.2.5
|-
| [[beforeHandleRequest]]
| Trigger called on each page request immediately before the action handler is called.  This is handy if you need to perform some action on each page request, such as changing the default action depending on the logged in user.
| 1.0
|-
| [[loginFailed]]
| Trigger called after a failed login attempt.  Allows you to provide your own logging.
| 2.0.1
|-
| [[startSession]]
| If implemented, this overrides how Xataface starts its sessions.  If you implement this method, your custom method should at least include a call to [http://php.net/session_start session_start].
| 1.2.5
|}

====Preferences====

{| class=&quot;listing listing2&quot;
! Name
! Description
! Version
|-
| getPreferences
| Returns the user preference settings.
| 0.6
|}


====Permissions====

{| class=&quot;listing listing2&quot;
! Name
! Description
! Version
|-
| getPermissions
| Returns the permissions available for a given record.
| 0.6
|-
| getRoles
| Returns the roles allowed for a given record.
| 1.0
|-
| __field__permissions
| Returns the default permissions for a field of a given record.
| 1.0
|-
| __field__roles
| Returns the default roles for a field of a given record.
| 1.0
|-
| fieldname__permissions
| Returns the permissions that are allowed for the field &quot;fieldname&quot; on a given record.
| 0.7
|-
| fieldname__roles
| Returns the roles that are allowed for the field &quot;fieldname&quot; on a given record.
| 1.0
|-
| rel_relationshipname__permissions
| Returns the permissions pertaining to the relationship &apos;&apos;relationshipname&apos;&apos; on a given record.
| 1.0
|-
| rel_relationshiopname__roles
| Returns the role or roles pertaining to the relationship &apos;&apos;relationshipname&apos;&apos; on a given record.
| 1.0
|}

See [[permissions]] for more information about Xataface&apos;s permissions architecture and how to implement custom application permissions.

&lt;nowiki&gt;&lt;a name=&quot;registration&quot;&gt;&lt;/a&gt;&lt;/nowiki&gt;
====Registration====

{| class=&quot;listing listing2&quot;
! Name
! Description
! Version
|-
| [[beforeRegister]]
| Trigger called before the user registration form is saved.
| 1.0
|-
| [[afterRegister]]
| Trigger called after registration form is saved.
| 1.0
|-
| [[validateRegistrationForm]]
| Validates the input into the registration form.
| 1.0
|-
| [[sendRegistrationActivationEmail]]
| Overrides the sending of the registration activation email.
| 1.0
|-
| [[getRegistrationActivationEmailInfo]]
| Overrides the activation email info.  Returns an associative array of the email details (e.g. subject, to, headers, etc...
| 1.0
|-
| [[getRegistrationActivationEmailSubject]]
| Returns the subject of the activation email.
| 1.0
|-
| [[getRegistrationActivationEmailMessage]]
| Returns the message body for the activation email.
| 1.0
|-
| [[getRegistrationActivationEmailParameters]]
| Returns the parameters for the actication email.
| 1.0
|-
| [[getRegistrationActivationEmailHeaders]]
| Returns the headers for the activation email.
| 1.0
|-
| [[after_action_activate]]
| Trigger fired after activation is complete.
| 1.2
|}

See [[registration form]] for more information about Xataface&apos;s registration system and how to allow users to register for an account on your application.

&lt;nowiki&gt;&lt;a name=&quot;password-reset&quot;&gt;&lt;/a&gt;&lt;/nowiki&gt;
====Forgot Password====

{| class=&quot;listing listing2&quot;
! Name
! Description
! Version
|-
| [[getPasswordChangedEmailInfo]]
| Optional method to define the settings for the email that is sent to the user upon successful resetting of their password using the password reset function.  
| 1.3
|-
| [[getResetPasswordEmailInfo]]
| Optional method to define the settings for the email that is sent when a user requests to reset their password.  This step comes before the password changed email as first the user requests a password reset and receives this email.  Then they click a link in this email to reset the password upon which time they receive a second email containing their temporary password.  That email is generated by the [[getPasswordChangedEmailInfo]] method if defined.  If this method is not defined then a generic email predefined in Xataface will be sent instead.
| 1.3
|}




====RSS Feed Customization====
{| class=&quot;listing listing2&quot;
! Name
! Description
! Version
|-
| [[getFeedItem]]
| For RSS Feeds, overrides the defaults and returns an associative array with feed elements for a particular record
| 1.0
|-
| [[getFeed]]
| For RSS feeds, overrides the default feed for a query, returning an array of feed items.
| 1.0
|-
| getFeedSource
| Overrides the default feed source parameter for an RSS feed.
| 1.0
|-
| [[getRelatedFeed]]
| For RSS feeds, overrides the default feed for a related feed.
| 1.0
|-
| getRSSDescription
| Overrides the default generated RSS description for a record.
| 1.0
|}


====Template Customization====
{| class=&quot;listing listing2&quot;
! Name
! Description
! Version
|-
| [[block__blockname]]
| Outputs content that is meant to override a slot or a block named &quot;blockname&quot;.
| 0.6
|-
| [[getNavItem]]
| Overrides the navigation menu item for a particular table.
| 1.3
|-
| [[navItemIsSelected]]
| Overrides the &quot;selected&quot; setting for nav menu items.  This is used by the default implementation of [[getNavItem]].
| 1.3
|-
| [[getTemplateContext]]
| Returns an associative array of variables that should be made available to all templates.
| 1.0
|}

====Output Cache Customization====
{| class=&quot;listing listing2&quot;
! Name
! Description
! Version
|-
| [[getOutputCacheUserId]]
| Returns a unique user id that is used by the output cache to ensure that different users don&apos;t use the same cached page (unless appropriate).   This is generally not necessary as the output cache by default uses a different cache for each user... but in some cases you may want to use a different cache for the same user.
| 2.0
|}

====Valuelist Customization====
{| class=&quot;listing listing2&quot;
! Name
! Description
! Version
|-
| [[valuelist__valuelistname]]
| Defines a valuelist named &apos;&apos;valuelistname&apos;&apos;.
| 0.7
|}
</content>
	<keywords>application delegate class</keywords>
	<language>en</language>
	<original_page>0</original_page>
</wiki>
<wiki id="wiki?page_id=11">
	<page_name>block__blockname</page_name>
	<page_id>11</page_id>
	<page_title>block__blockname</page_title>
	<content>===Available Blocks===

This is a grep to show the blocks that are defined in Xataface templates:

* Dataface_ActionsMenu.html:actions_menu_head
* Dataface_ActionsMenu.html:actions_menu_tail
* Dataface_Add_Existing_Related_Record.html:before_add_existing_related_record_form
* Dataface_Add_Existing_Related_Record.html:before_add_existing_related_`$ENV.relationship`_form
* Dataface_Add_Existing_Related_Record.html:after_add_existing_related_`$ENV.relationship`_form
* Dataface_Add_Existing_Related_Record.html:after_add_existing_related_record_form
* Dataface_Add_New_Related_Record.html:before_add_new_related_record_form
* Dataface_Add_New_Related_Record.html:before_add_new_related_`$ENV.relationship`_form
* Dataface_Add_New_Related_Record.html:after_add_new_related_`$ENV.relationship`_form
* Dataface_Add_New_Related_Record.html:after_add_new_related_record_form
* Dataface_AjaxEventDetails.html:before_event_details
* Dataface_AjaxEventDetails.html:after_event_details
* Dataface_Delete_Record.html:before_delete_record_form
* Dataface_Delete_Record.html:after_delete_record_form
* Dataface_Edit_Record.html:before_edit_record_form
* Dataface_Edit_Record.html:after_edit_record_form
* Dataface_FindForm.html:findform_before_`$element.field.name`_row
* Dataface_FindForm.html:findform_before_`$element.field.name`_widget
* Dataface_FindForm.html:findform_after_`$element.field.name`_widget
* Dataface_FindForm.html:findform_after_`$element.field.name`_row
* Dataface_FindForm.html:before_findform_table
* Dataface_FindForm.html:findform_before_`$element.field.name`_row
* Dataface_FindForm.html:findform_before_`$element.field.name`_widget
* Dataface_FindForm.html:findform_after_`$element.field.name`_widget
* Dataface_FindForm.html:findform_after_`$element.field.name`_row
* Dataface_FindForm.html:after_findform_table
* Dataface_Find_View.html:before_find_form
* Dataface_Find_View.html:after_find_form
* Dataface_Form_Section_Template.html:before_quickform_table
* Dataface_Import_RelatedRecords.html:before_import_related_records_form
* Dataface_Import_RelatedRecords.html:before_import_related_`$ENV.relationship`_form
* Dataface_Import_RelatedRecords.html:after_import_related_`$ENV.relationship`_form
* Dataface_Import_RelatedRecords.html:after_import_related_records_form
* Dataface_List_View.html:before_result_list
* Dataface_List_View.html:after_result_list
* Dataface_Login_Prompt.html:before_login_form
* Dataface_Login_Prompt.html:after_login_form
* Dataface_Main_Template.html:custom_stylesheets2
* Dataface_Main_Template.html:head
* Dataface_Main_Template.html:body_atts
* Dataface_Main_Template.html:before_body
* Dataface_Main_Template.html:before_header
* Dataface_Main_Template.html:after_header
* Dataface_Main_Template.html:before_search
* Dataface_Main_Template.html:after_search_form_submit
* Dataface_Main_Template.html:after_search
* Dataface_Main_Template.html:before_nav_menu
* Dataface_Main_Template.html:after_nav_menu
* Dataface_Main_Template.html:before_language_selector
* Dataface_Main_Template.html:after_language_selector
* Dataface_Main_Template.html:before_user_status_logged_in
* Dataface_Main_Template.html:after_user_status_logged_in
* Dataface_Main_Template.html:before_user_status_not_logged_in
* Dataface_Main_Template.html:after_user_status_not_logged_in
* Dataface_Main_Template.html:before_personal_tools
* Dataface_Main_Template.html:after_personal_tools
* Dataface_Main_Template.html:before_bread_crumbs
* Dataface_Main_Template.html:after_bread_crumbs
* Dataface_Main_Template.html:before_main_table
* Dataface_Main_Template.html:before_left_column
* Dataface_Main_Template.html:before_record_tree
* Dataface_Main_Template.html:after_record_tree
* Dataface_Main_Template.html:before_nav_menu
* Dataface_Main_Template.html:after_nav_menu
* Dataface_Main_Template.html:before_application_menu
* Dataface_Main_Template.html:after_application_menu
* Dataface_Main_Template.html:after_left_column
* Dataface_Main_Template.html:before_main_column
* Dataface_Main_Template.html:before_message
* Dataface_Main_Template.html:message
* Dataface_Main_Template.html:after_message
* Dataface_Main_Template.html:before_errors
* Dataface_Main_Template.html:error
* Dataface_Main_Template.html:after_errors
* Dataface_Main_Template.html:before_table_tabs
* Dataface_Main_Template.html:before_menus
* Dataface_Main_Template.html:after_menus
* Dataface_Main_Template.html:before_main_section
* Dataface_Main_Template.html:before_recently_viewed
* Dataface_Main_Template.html:after_recently_viewed
* Dataface_Main_Template.html:before_record_content
* Dataface_Main_Template.html:after_record_content
* Dataface_Main_Template.html:after_main_section
* Dataface_Main_Template.html:before_fineprint
* Dataface_Main_Template.html:after_fineprint
* Dataface_Main_Template.html:before_global_footer
* Dataface_Main_Template.html:after_global_footer
* Dataface_Main_Template.html:before_main_section
* Dataface_Main_Template.html:before_recently_viewed
* Dataface_Main_Template.html:after_recently_viewed
* Dataface_Main_Template.html:before_record_content
* Dataface_Main_Template.html:after_record_content
* Dataface_Main_Template.html:after_main_section
* Dataface_NavMenu.html:tables_menu_head
* Dataface_NavMenu.html:tables_menu_tail
* Dataface_NavMenu.html:tables_menu_head
* Dataface_NavMenu.html:tables_menu_tail
* Dataface_New_Record.html:before_new_record_form
* Dataface_New_Record.html:after_new_record_form
* Dataface_Record_Template.html:before_details_controller
* Dataface_Record_Template.html:after_details_controller
* Dataface_Record_Template.html:before_record_heading
* Dataface_Record_Template.html:after_record_heading
* Dataface_Record_Template.html:before_record_tabs
* Dataface_Record_Template.html:before_record_content
* Dataface_Record_Template.html:after_record_content
* Dataface_Record_Template.html:before_record_footer
* Dataface_Record_Template.html:after_record_footer
* Dataface_Registration.html:before_registration_form
* Dataface_Registration.html:after_registration_form
* Dataface_Related_Records_List.html:before_related_`$ENV.relationship`_records_list
* Dataface_Related_Records_List.html:after_related_`$ENV.relationship`_records_list
* Dataface_Remove_Related_Record.html:before_remove_related_record_form
* Dataface_Remove_Related_Record.html:before_remove_related_`$ENV.relationship`_record_form
* Dataface_Remove_Related_Record.html:after_remove_related_`$ENV.relationship`_record_form
* Dataface_Remove_Related_Record.html:after_remove_related_record_form
* Dataface_View_Record.html:before_view_tab_content
* Dataface_View_Record.html:before_record_actions
* Dataface_View_Record.html:after_record_actions
* Dataface_View_Record.html:after_view_tab_content
* Dataface_related_records_checkboxes.html:before_related_`$ENV.relationship`_records_checkboxes
* Dataface_related_records_checkboxes.html:before_related_records_checkboxes
* Dataface_related_records_checkboxes.html:after_related_records_checkboxes
* Dataface_related_records_checkboxes.html:after_related_`$ENV.relationship`_records_checkboxes
* Dataface_set_translation_status.html:before_details_controller
* Dataface_set_translation_status.html:after_details_controller

===Available Slots===

* Dataface_ActionsMenu.html:actions_menu
* Dataface_Add_Existing_Related_Record.html:add_existing_related_`$ENV.relationship`_form
* Dataface_Add_Existing_Related_Record.html:add_existing_related_record_form
* Dataface_Add_New_Related_Record.html:add_new_related_`$ENV.relationship`_form
* Dataface_Add_New_Related_Record.html:add_new_related_record_form
* Dataface_AjaxEventDetails.html:event_details
* Dataface_Delete_Record.html:delete_record_form
* Dataface_Edit_Record.html:edit_record_form
* Dataface_FindForm.html:findform_`$element.field.name`_row
* Dataface_FindForm.html:findform_`$element.field.name`_widget
* Dataface_FindForm.html:findform_`$element.field.name`_row
* Dataface_FindForm.html:findform_`$element.field.name`_widget
* Dataface_Find_View.html:find_form
* Dataface_Import_RelatedRecords.html:import_related_`$ENV.relationship`_form
* Dataface_Import_RelatedRecords.html:import_related_records_form
* Dataface_List_View.html:result_list
* Dataface_List_View_summary.html:result_list
* Dataface_Login_Prompt.html:login_form
* Dataface_Main_Template.html:doctype_tag
* Dataface_Main_Template.html:html_tag
* Dataface_Main_Template.html:html_head
* Dataface_Main_Template.html:html_title
* Dataface_Main_Template.html:dataface_stylesheets
* Dataface_Main_Template.html:custom_stylesheets
* Dataface_Main_Template.html:dataface_javascripts
* Dataface_Main_Template.html:custom_javascripts
* Dataface_Main_Template.html:head_slot
* Dataface_Main_Template.html:html_body
* Dataface_Main_Template.html:global_header
* Dataface_Main_Template.html:search_form
* Dataface_Main_Template.html:language_selector
* Dataface_Main_Template.html:user_status_logged_in
* Dataface_Main_Template.html:user_status_not_logged_in
* Dataface_Main_Template.html:personal_tools
* Dataface_Main_Template.html:bread_crumbs
* Dataface_Main_Template.html:main_table
* Dataface_Main_Template.html:left_column
* Dataface_Main_Template.html:application_menu
* Dataface_Main_Template.html:main_column
* Dataface_Main_Template.html:table_tabs
* Dataface_Main_Template.html:menus
* Dataface_Main_Template.html:main_section
* Dataface_Main_Template.html:record_content
* Dataface_Main_Template.html:fineprint
* Dataface_Main_Template.html:global_footer
* Dataface_Main_Template.html:main_section
* Dataface_Main_Template.html:record_content
* Dataface_Main_Templateold.html:doctype_tag
* Dataface_Main_Templateold.html:html_tag
* Dataface_Main_Templateold.html:html_head
* Dataface_Main_Templateold.html:html_title
* Dataface_Main_Templateold.html:dataface_stylesheets
* Dataface_Main_Templateold.html:custom_stylesheets
* Dataface_Main_Templateold.html:dataface_javascripts
* Dataface_Main_Templateold.html:custom_javascripts
* Dataface_Main_Templateold.html:head_slot
* Dataface_Main_Templateold.html:html_body
* Dataface_Main_Templateold.html:global_header
* Dataface_Main_Templateold.html:search_form
* Dataface_Main_Templateold.html:language_selector
* Dataface_Main_Templateold.html:user_status_logged_in
* Dataface_Main_Templateold.html:user_status_not_logged_in
* Dataface_Main_Templateold.html:personal_tools
* Dataface_Main_Templateold.html:bread_crumbs
* Dataface_Main_Templateold.html:main_table
* Dataface_Main_Templateold.html:left_column
* Dataface_Main_Templateold.html:application_menu
* Dataface_Main_Templateold.html:main_column
* Dataface_Main_Templateold.html:table_tabs
* Dataface_Main_Templateold.html:menus
* Dataface_Main_Templateold.html:main_section
* Dataface_Main_Templateold.html:record_content
* Dataface_Main_Templateold.html:fineprint
* Dataface_Main_Templateold.html:global_footer
* Dataface_Main_Templateold.html:main_section
* Dataface_Main_Templateold.html:record_content
* Dataface_NavMenu.html:tables_menu_options
* Dataface_NavMenu.html:tables_menu_options
* Dataface_New_Record.html:new_record_form
* Dataface_Record_Template.html:record_heading
* Dataface_Record_Template.html:record_content
* Dataface_Record_Template.html:record_footer
* Dataface_Registration.html:registration_form
* Dataface_Related_Records_List.html:before_related_list
* Dataface_Related_Records_List.html:related_`$ENV.relationship`_records_list
* Dataface_Related_Records_List.html:related_records_list
* Dataface_Related_Records_List.html:after_related_list
* Dataface_Remove_Related_Record.html:remove_related_`$ENV.relationship`_record_form
* Dataface_Remove_Related_Record.html:remove_related_record_form
* Dataface_View_Record.html:view_tab_content
* Dataface_View_Record.html:record_actions
* Dataface_View_Record.html:record_search
* Dataface_View_Record.html:`$section.name`_section_content
* Dataface_View_Record.html:record_view_main_section
* Dataface_View_Record.html:`$section.name`_section_content
* Dataface_related_records_checkboxes.html:related_`$ENV.relationship`_records_checkbox_form
* Dataface_related_records_checkboxes.html:related_records_checkbox_form
* global_header.html:site_logo

</content>
	<keywords></keywords>
	<language>en</language>
	<original_page>0</original_page>
</wiki>
<wiki id="wiki?page_id=10">
	<page_name>preferences</page_name>
	<page_id>10</page_id>
	<page_title>preferences</page_title>
	<content>==Xataface Preferences==

[[toc]]

Xataface preferences can be defined in 3 ways:

# In the &apos;&apos;[_prefs]&apos;&apos; section of rhe [[conf.ini file]] for global static preferences.
# Implementing the [[getPreferences]] method in the [[Application Delegate Class]]
# In the [[__prefs__]] section of the fields.ini file for a table for static preferences on that table.  (Limited to only certain preferences).

===Example [_prefs] section===
In the conf.ini
&lt;code&gt;
[_prefs]
    hide_updated=1
    hide_posted_by=1
&lt;/code&gt;

===Example [[getPreferences]] method===
In the [[Application Delegate Class]]:
&lt;code&gt;
function getPreferences(){
    return array(&apos;hide_update&apos;=&gt;1, &apos;hide_posted_by&apos;=&gt;1);

}
&lt;/code&gt;

===Available Preferences===

{| class=&quot;listing listing2&quot;
! Name
! Description
! Default
! Version
|-
| show_result_stats
| Show the result statistics (e.g. found x of y records in table z)
| 1
| 0.6
|-
| show_jump_menu
| Show he drop-down menu that allows you to &quot;jump&quot; to any record in the found set.
| 1
| 0.6
|-
| show_result_controller
| Show Next, previous, page number .. links...
| 1
| 0.6
|-
| show_table_tabs
| Show  Details, List, Find, etc... tabs.
| 1
| 0.6
|-
| show_actions_menu
| Show New record, Show all, delete, etc..
| 1
| 0.6
|-
| show_logo
| Show logo at top of app
| 1
| 0.6
|-
| show_tables_menu
| Show the tabs to select a table.
| 1
| 0.6
|-
| show_search
| Show search field in upper right.
| 1
| 0.6
|-
| show_record_actions
| Show actions related to particular record
| 1
| 0.6
|-
| show_bread_crumbs
| Show bread crumbs at top of page to show where you are.
| 1
| 0.6
|-
| show_record_tabs
| View, Edit, Translate, History, etc...
| 1
| 0.6
|-
| show_record_tree
| Show tree to navigate the relationships of this record.
| 1
| 0.6
|-
| list_view_scroll_horizontal
| Whether to scroll list horizontal if it exceeds page width
| 1
| 0.6
|-
| list_view_scroll_vertical
| Whether to scroll list vertical if it exceeds page height.
| 1
| 0.6
|-
| hide_posted_by
| Whether to hide the &apos;&apos;posted by&apos;&apos; text in glance lists (e.g. in the view tab, the related records are shown in the left column.  This hides the &apos;&apos;posted by&apos;&apos; text next to each related record.
| 0
| 1.0b4
|-
| hide_updated
| Whether to hide the &apos;&apos;updated&apos;&apos; text in the glance lists (e.g. in the view tab, the related records are shown in the left column.  This hides the &apos;&apos;updated&apos;&apos; text next to each related record.
| 0
| 1.0b4
|-
| SummaryList_logo_width
| The width of the logo to be used as the preview image in summary lists.
| null
| 0.7
|-
| SummaryList_hideSort
| Hides the sort control for a summary list (the box that allows users to sort by column).
| 0
| 0.7
|-
| hide_user_status
| Hides the user&apos;s status (e.g. &quot;You are logged in as ...&quot;
| 0
| 0.7
|-
| hide_personal_tools
| Hides the personal tool links in upper right.  This includes likes such as &quot;Control Panel&quot; and &quot;My Profile&quot;
| 0
| 0.7
|-
| hide_resultlist_controller
| Hides the controller for a result list (E.g. next/back/results per page etc...).
| 0
| 0.7
|-
| hide_related_sections
| Hides the sections of the view tab that show the related records.  These are the sortable section boxes.  Not the related tabs.
| 0
| 1.3
|-
| hide_record_search
| Hides the record search form that appears in the view tab.  Not to be confused with the find tab.
| 0
| 1.3
|-
| show_resultlist_controller_only_when_needed
| Sets the resultlist controller (e.g. back/next/results per page/etc...) to only show up if paging is required (i.e. if there are more records than can be shown on one page (according to the &apos;-limit&apos; parameter).
| 0
| 1.0
|-
| hide_record_view_logo
| Hides the logo for a record that appears in the upper left of the view tab for each record.
| 0
| 0.7
|-
| horizontal_tables_menu
| Whether to force the tables menu to appear as tabs along the top of the page (alternative is as a menu on the left). If there are 10 or fewer allowed tables, then the default is 1, otherwise the default is set to 0.
| 1
| 0.6
|-
| hide_result_filters
| In list view, setting this value to 1 will cause the column filters to be hidden (the select lists to filter the results).
| 0
| 0.7
|-
| disable_select_rows
| A value of 1 causes the checkboxes in each row of the list view to be hidden.
| 0
| 0.7
|-
| result_list_use_geturl
| Use the getURL() method to link to records in the list view rather than the default (which uses the -cursor parameter).
| 0
| 0.7
|-
| disable_ajax_record_details
| Whether to disable the ajax record details (the &apos;+&apos; sign beside each record in list view that expands to show the record details.
| 1
| 0.7
|-
| use_old_resultlist_controller
| As of Xataface 1.1, a new style result list controller is used that resembles facebook.  It is more slimmed down and is easier to manage.  If you prefer the old controller, set this preference to 1.
| 0
| 1.1
|}

===Inverse Preferences===

The following preferences perform the inverse of some of the options above. When these options are set to 1, their respective option is set to 0.

{| class=&quot;listing listing2&quot;
! Name
! Inverse
|-
| hide_nav_menu
| show_tables_menu
|-
| hide_view_tabs
| show_table_tabs
|-
| hide_result_controller
| show_result_controller
|-
| hide_table_result_stats
| show_result_stats
|-
| hide_search
| show_search
|}
</content>
	<keywords>preferences, prefs, getPreferences</keywords>
	<language>en</language>
	<original_page>0</original_page>
</wiki>
<wiki id="wiki?page_id=9">
	<page_name>__prefs__</page_name>
	<page_id>9</page_id>
	<page_title>__prefs__</page_title>
	<content>==__prefs__ fields.ini Section==

A global section of the [[fields.ini file]] that sets the preferences for the given table and its records.

E.g.
&lt;code&gt;
[__prefs__]
    hide_posted_by=1 ; Hides the &quot;Posted by&quot; text in glance lists (e.g. related records in the view tab).
    hide_updated=1 ; Hides the &quot;Updated&quot; text in glance lists (e.g. the related records in the view tab).
&lt;/code&gt;


===Available Preferences===

Ultimately, all of the preferences available at a global level should be available here, however currently this is not the case and only selected preferences are available at the table level.

{| class=&quot;listing listing2&quot;
! Name
! Description
! Version
|-
| [[hide_posted_by]]
| HIdes the &apos;&apos;posted_by&apos;&apos; text in glance lists.  E.g. In the view tab of a record, the related records are shown in the left column.  This will hide the &apos;&apos;posted_by&apos;&apos; text next to each related record.
| 1.0b4
|-
| [[hide_updated]]
| Hides the &apos;&apos;updated&apos;&apos; text in glance lists.  E.g. In the view tab of a record, the related records are shown in the left column.  This will hide the &apos;&apos;updated&apos;&apos; text next to each related record.
| 1.0b4
|-
|}</content>
	<keywords></keywords>
	<language>en</language>
	<original_page>0</original_page>
</wiki>
<wiki id="wiki?page_id=8">
	<page_name>Internet_Media_Manager</page_name>
	<page_id>8</page_id>
	<page_title>Internet Media Manager</page_title>
	<content>&apos;&apos;&apos;Manage your videos and photos all in one place&apos;&apos;&apos;

[[toc]]

===Watch the Guided Tour (6 minutes)===
&lt;nowiki&gt;
&lt;embed src=&quot;http://media.weblite.ca/lib/flvplayer.swf&quot; width=&quot;640&quot; height=&quot;448&quot; bgcolor=&quot;#FFFFFF&quot; type=&quot;application/x-shockwave-flash&quot; pluginspage=&quot;http://www.macromedia.com/go/getflashplayer&quot; flashvars=&quot;file=http%3A%2F%2Fs3.amazonaws.com%2Fweblite_media%2Fintro_video.flv&amp;image=http%3A%2F%2Fmedia.weblite.ca%2Ffiles%2Fphotos%2Fintro_video.flv.AbpY0Y.jpg&amp;showdigits=true&amp;autostart=false&quot; /&gt;
&lt;/nowiki&gt;

===Introduction===

The Internet Media Manager is a web-based database application that allows webmasters to centrally store their images and videos to be served on their website(s).  It provides a Youtube-like interface whereby users can simply copy and paste code snippets to embed images and videos into their web pages.  It also provides a photo gallery component that allows users to easily embed a gallery of images into their web pages by simply copying and pasting a snippet of javascript code.

===Purpose===

I created this application because:

# I didn&apos;t want to have to resize images in Photoshop anymore before uploading them to the web.
# I wanted to be able to embed videos, images, and photo galleries into my web pages without having to muck around with HTML code.

IMM (Internet Media Manager) allows you to resize your photos to any size you want, and embed these resized images in your web pages by copying and pasting a snippet of HTML.  Similarly it makes embedding videos and photo galleries into your website a snap.

===Features===

* Add/Edit/Delete/Categorize images and videos in a searchable database.
* Import multiple images or videos at once by uploading a ZIP file.
* Large file imports via FTP/SSH.
* Embed video and images directly into other web pages by copying and pasting HTML snippets (like Youtube).
* Resize images and videos.
* FLV video support (like Youtube).
* Search media by content type, category, keyword, etc..
* Includes javascript photo gallery component that can be embedded into any web page.
* Amazon Simple Storage Service (S3) integration.

===Requirements===

* [http://www.php.net|PHP] 5.2+
* [http://www.mysql.com|MySQL] 4.1+
* [http://ca.php.net/gd|GD_Image_Processing_Library]
* [http://ffmpeg.mplayerhq.hu/|FFMPEG] (optional - if you want to automatically generate poster images for videos).

===Download===

* [https://sourceforge.net/projects/immgr/files/|Internet Media Manager 0.3]

===Installation===

# Download the latest version from Sourceforge.
# Extract the files and copy to your web server.
# Point your web browser to the install.php and follow the instructions. 

===Screenshots===

&lt;nowiki&gt;
&lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot; src=&quot;http://media.weblite.ca/index.php?-action=gallery&amp;-table=files&amp;categories=3&amp;-cursor=0&amp;-skip=0&amp;-limit=30&amp;-mode=list&amp;-photo_max_width=500&amp;--format=js&quot;&gt;&lt;/script&gt;
&lt;div style=&quot;clear:both&quot;&gt;&lt;/div&gt;
&lt;/nowiki&gt;

===Screencasts===

How to import multiple images at once in a ZIP archive.

&lt;nowiki&gt;&lt;iframe title=&quot;YouTube video player&quot; width=&quot;640&quot; height=&quot;510&quot; src=&quot;http://www.youtube.com/embed/0gfRJ5HkRsI&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;&lt;/nowiki&gt;

===Support===

Visit the [http://xataface.com/forum/viewforum.php?f=12|Support_forum].
</content>
	<keywords>Internet Media Manager,resize photos,image gallery,photo gallery,video gallery</keywords>
	<language>en</language>
	<original_page>0</original_page>
</wiki>
<wiki id="wiki?page_id=7">
	<page_name>Delegate_class_methods</page_name>
	<page_id>7</page_id>
	<page_title>Delegate_class_methods</page_title>
	<content>==Delegate Class Reference==

[[toc]]

A delegate class is a PHP class that complements a particular table with custom bahaviors.  Basic table metadata can be supplied using the [[fields.ini file]], however some things are better customized using PHP.

===Delegate Class Location===

The delegate class should be located in a file named TABLENAME.php (where TABLENAME is the name of the table with which the delegate class is associated) inside the table&apos;s [[table configuration directory|configuration directory]].  E.g. given a table named &quot;people&quot;, you would place the delegate class in the file &quot;tables/people/people.php&quot;

===Basic Delegate Class===

&lt;code&gt;
&lt;?php
class tables_people {}
?&gt;
&lt;/code&gt;

===Available Methods===

====Table Settings====

{| class=&quot;listing listing2&quot;
! Name
! Description
! Version
|-
| [[sql delegate method|__sql__]]
| Defines the SQL query that can be used to fetch records of this table.  This is identical to the [[fields.ini file]] [[__sql__]] directive, except that by defining it in the delegate class you have more flexibility.
| 1.0
|}

====Permissions====

{| class=&quot;listing listing2&quot;
! Name
! Description
! Version
|-
| [[getPermissions]]
| Returns the permissions available for a given record.
| 0.6
|-
| getRoles
| Returns the roles allowed for a given record.
| 1.0
|-
| [[__field__permissions]]
| Returns the default permissions for a field of a given record.
| 1.0
|-
| __field__roles
| Returns the default roles for a field of a given record.
| 1.0
|-
| [[fieldname__permissions]]
| Returns the permissions that are allowed for the field &quot;fieldname&quot; on a given record.
| 0.7
|-
| fieldname__roles
| Returns the roles that are allowed for the field &quot;fieldname&quot; on a given record.
| 1.0
|-
| rel_relationshipname__permissions
| Returns the permissions pertaining to the relationship &apos;&apos;relationshipname&apos;&apos; on a given record.
| 1.0
|-
| rel_relationshipname__roles
| Returns the role or roles pertaining to the relationship &apos;&apos;relationshipname&apos;&apos; on a given record.
| 1.0
|}

====Triggers====

{| class=&quot;listing listing2&quot;
! Name
! Description
! Version
|-
| [[after_action_edit]]
| Trigger called after the edit action is succesfully completed.
| 0.7
|-
| [[after_action_new]]
| Trigger called after the new action is successfully completed.
| 0.7
|-
| [[after_action_delete]]
| Trigger called after the delete action is successfully completed.
| 0.7
|-
| [[afterAddExistingRelatedRecord]]
| Trigger called after an existing related record is added.
| 0.5
|-
| [[aftereAddNewRelatedRecord]]
| Trigger called after a new related record is added.
| 0.5
|-
| [[afterCopy]]
| Trigger called after a record is copied.
| 1.3
|-
| [[afterDelete]]
| Trigger called after a record is deleted.
|0.5
|-
| [[afterAddRelatedRecord]]
| Trigger called after a related record of this table is added (either an existing record or a new record).
| 0.5
|-
| [[afterRemoveRelatedRecord]]
| Trigger called after a related record is removed from a relationship.
| 1.1.6
|-
| [[afterInsert]]
| Trigger called after a given record is inserted.
| 0.5
|-
| [[afterSave]]
| Trigger called after a given record is saved (insert or update).
| 0.5
|-
| [[afterUpdate]]
| Trigger called after a given record is updated.
| 0.5
|-
| [[beforeAddExistingRelatedRecord]]
| Trigger called before an existing related record is added.
| 0.5
|-
| [[beforeAddNewRelatedRecord]]
| Trigger called before a new related record is added.
| 0.5
|-
| [[beforeAddRelatedRecord]]
| Trigger called before a related record of this table is added (either an existing record or a new record).
| 0.5
|-
| [[beforeCopy]]
| Trigger called before a record is copied.
| 1.3
|-
| [[beforeDelete]]
| Trigger called before a record is deleted.
| 0.5
|-
| [[beforeRemoveRelatedRecord]]
| Trigger called before a related record is removed.
| 1.1.6
|-
| [[beforeSave]]
| Trigger called before a given record is saved (insert or update).
| 0.5
|-
| [[beforeInsert]]
| Trigger called before a given record is inserted.
| 0.5
|-
| [[beforeUpdate]]
| Trigger called before a given record is updated.
| 0.5
|-
| [[init]]
| This method is called the first time the table is loaded.  It allows you to specify initialization details.
| 0.8
|}


====Field Filters====

{| class=&quot;listing listing2&quot;
! Name
! Description
! Version
|-
| fieldname__htmlValue
| Returns the value of the field &quot;fieldname&quot; for a given record as HTML.
| 0.5
|-
| fieldname__display
| Returns the value of the field &quot;fieldname&quot; appropriate for displaying.
| 0.5
|-
| [[fieldname__default]]
| Returns the default value for the field &apos;&apos;fieldname&apos;&apos;.  New record forms will be prepopulated with this value.
| 0.7
|-
| [[fieldname__validate]]
| Validates the input for the field &apos;&apos;fieldname&apos;&apos;.
| 0.6
|-
| fieldname__parse
| Parses the input value for the field &apos;&apos;fieldname&apos;&apos;.  This is called by Xataface inside the setValue() method or each record to normalize input values before they are stored in the object (not the database).
| 0.5
|-
| fieldname__toString
| Converts the value of the field &apos;&apos;fieldname&apos;&apos; to a string.  This string representation is used as the basis for most higher level data retrieval methods (such as serialize and display).  This could be treated as an inverse to the [[fieldname__parse]] method.
| 0.5
|-
| fieldname__serialize
| Converts a value of the field &apos;&apos;fieldname&apos;&apos; to be saved in the database.  This should return a string representation of the value that is suitable for database storage.
| 0.5
|-
| fieldname__link
| A link that appears beside the field &apos;&apos;fieldname&apos;&apos; on the edit form.
| 0.6
|-
| [[field__pushValue]]
| Converts form input for field &apos;&apos;fieldname&apos;&apos; to be ready to store in a Dataface_Record.
| 0.6
|-
| [[field__pullValue]]
| Converts a value for field &apos;&apos;fieldname&apos;&apos; in a Dataface_Record object to be ready to be inserted as a value on an HTML form.
| 0.6
|-
| [[field__fieldname]]
| Effectively creates a calculated field named &quot;fieldname&quot; available on the given record.
| 0.6
|-
| [[no_access_text]]
| Replace the default NO ACCESS permission text with another text.
| 1.1.6
|-
| [[no_access_link]]
| Replace the default link of the NO ACCESS permission link with another link.
| 1.1.6
|}

====Template Customization====
{| class=&quot;listing listing2&quot;
! Name
! Description
! Version
|-
| [[block__blockname]]
| Outputs content that is meant to override a slot or a block named &quot;blockname&quot;.
| 0.6
|}

====List Tab Customization====

{| class=&quot;listing listing2&quot;
! Name
! Description
! Version
|-
| css__tableHeaderCellClass
| Returns a custom CSS class for a table header cell (th tag) in the list view.  Takes the name of a table column as a parameter.
| 2.0alpha2
|-
| css__tableRowClass
| Returns a custom CSS class for a table row (tr tag) in list view.  Takes a Dataface record as a parameter.
| 1.2
|-
| fieldname__renderCell
| Overrides the table cell content for the &quot;fieldname&quot; field in list view with custom HTML.
| 1.0
|-
| renderRow
| Overrides the the html used for a row in list view for the given record.
| 0.7
|-
| renderRowHeader
| Overrides the header for the table in list view.
| 0.7
|-
| renderRelatedRow
| Overrides the html used for a row in a related record list for a given related record.
| 1.0 beta 4
|-
| renderRelatedRowHeader
| Overrides the html used for the header in a related list.
| 1.0 beta 4
|}

====Record Metadata====
{| class=&quot;listing listing2&quot;
! Name
! Description
! Version
|-
| [[getBreadCrumbs]]
| Returns the bread crumbs (i.e. you are here) for a given record as an associative array of path parts.
| 0.6
|-
| [[getChildren]]
| Returns a list of Dataface_Record objects that are to be considered children of the given record.
| 0.8
|-
| [[getCreated]]
| Returns a unix timestamp marking the date that a record was created. 
| 0.9
|-
| getDescription
| Returns a string description summary of this record.  This is used for indexing, RSS feeds, and anywhere that a brief summary of a record is appropriate.
| 0.7
|-
| getPublicLink
| Returns the public URL of this record (in case it is different than the standard URL).
| 0.8
|-
| getTitle
| Returns the title for a given record.  The title is used in various parts of the application to represent the record.
| 0.5
|-
| [[getURL]]
| Overrides the getURL() method for a record.  Returns the URL that should be used to display the given record.
| 0.6
|-
| titleColumn
| Returns a string SQL select expression that is used to describe the title of records.
| 0.5
|}

====View Tab Customization====

{| class=&quot;listing listing2&quot;
! Name
! Description
! Version
|-
| [[How_to_Add_Custom_Sections_to_View_Tab|section__sectionname]]
| Defines a section to be displayed in the view tab for the given record.
| 0.7
|}


====Search Setup====
{| class=&quot;listing listing2&quot;
! Name
! Description
! Version
|-
| getSearchableText
| If [[_index|Indexing]] is turned on, then this returns the text that should be stored in the index for this record for searchability.
| 1.0
|}

====RSS Feed Customization====
{| class=&quot;listing listing2&quot;
! Name
! Description
! Version
|-
| [[getFeedItem]]
| For RSS Feeds, overrides the defaults and returns an associative array with feed elements for a particular record
| 1.0
|-
| [[getFeed]]
| For RSS feeds, overrides the default feed for a query, returning an array of feed items.
| 1.0
|-
| getFeedSource
| Overrides the default feed source parameter for an RSS feed.
| 1.0
|-
| [[getRelatedFeed]]
| For RSS feeds, overrides the default feed for a related feed.
| 1.0
|-
| getRSSDescription
| Overrides the default generated RSS description for a record.
| 1.0
|}

===XML Output Customization===
{| class=&quot;listing listing2&quot;
! Name
! Description
! Version
|-
| [[toXML]]
| Overrides the default XML produced for a record in the [[export xml]] action.  Returns an XML string.
| 1.2.7
|-
| [[getXMLHead]]
| Returns a string to be included at the beginning of XML output for a particular record. (just inside the opening tag).
| 1.2.7
|-
| [[xmlTail]]
| Returns a string to be included at the end of XML output for a particular record. (just inside the closing tag).
| 1.2.7
|}

====Valuelist Customization====
{| class=&quot;listing listing2&quot;
! Name
! Description
! Version
|-
| [[valuelist__valuelistname]]
| Defines a valuelist named &apos;&apos;valuelistname&apos;&apos;.
| 0.7
|}


====Importing Records====
{| class=&quot;listing listing2&quot;
! Name
! Description
! Version
|-
| [[__import__filtername]]
| Defines an import filter to named &apos;&apos;filtername&apos;&apos; which is used to import records into the table.
| 0.7
|}
</content>
	<keywords>RSS,Feeds,delegate classes, triggers</keywords>
	<language>en</language>
	<original_page>0</original_page>
</wiki>
<wiki id="wiki?page_id=6">
	<page_name>actions.ini_file</page_name>
	<page_id>6</page_id>
	<page_title>actions.ini_file</page_title>
	<content>==actions.ini file Reference==

[[toc]]

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&apos;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.

&lt;code&gt;
[browse &gt; browse]
	label = Browse
&lt;/code&gt;

The &amp;gt; 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&apos;s behavior.

Here is a snippet from the Xataface actions.ini file to give you an idea:

&lt;code&gt;
;; Show the details of the current record
[browse]
	label = Details
	category = table_tabs
	url = &quot;{$this-&gt;url(&apos;-action=view&apos;)}&quot;
	accessKey = &quot;b&quot;
	mode = browse
	permission = view
	order=0

;; Show a list of the records in the current found set
[list]
	label = List
	category = table_tabs
	url = &quot;{$this-&gt;url(&apos;-action=list&apos;)}&quot;
	accessKey = &quot;l&quot;
	mode = list
	template = Dataface_List_View.html
	permission = list
	order=0.5

;; Show a &quot;Find Record Form&quot;
[find]
	label = Find
	category = table_tabs
	url = &quot;{$this-&gt;url(&apos;-action=find&apos;)}&quot;
	accessKey = &quot;f&quot;
	mode = find
	permission = find
	template = Dataface_Find_View.html
	order=0.75
&lt;/code&gt;

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 &quot;category&quot; value of &quot;table_tabs&quot;, which tells Xataface to display the actions as part of the table tabs in the user interface.

===Directives===

{| class=&quot;listing listing2&quot;
|-
! Name
! Description
! Version
|-
| [[action allow_override|allow_override]]
| 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 &quot;relationships.ini&quot; indicating that the settings can be overridden in the relationships.ini file.  In order for this to work, related=1 must also be set.
| 1.3rc4
|-
| [[action label|label]]
| The label to display if the action is used as a menu item.
| all
|-
| [[action category|category]]
| The name of the action&apos;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.
| all
|-
| [[action url|url]]
| If the action appears as a menu item, this is the URL that the menu item points to.  This may contain PHP expressions inside curly braces.
| all
|-
| [[action accessKey|accessKey]]
| The key code to automatically select this action if it is included as a menu item.  I.e. ALT+accessKey calls the action.
| all
|-
| [[action mode|mode]]
| 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.
| all
|-
| [[action permission|permission]]
| The name of a permission required to both see the action as part of a menu and to access the action as a web page.
| all
|-
| [[action visible|visible]]
| A boolean value indicating whether the action should be visible as a menu item.
| all
|-
| [[action condition|condition]]
| A boolean value or a PHP expression evaluating to a boolean value to indicate whether the action should be visible as a menu item.
| all
|-
| [[action url_condition|url_condition]]
| 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 &quot;url&quot; expression, just in case the current state of affairs would cause it to throw a fatal error.
| all
|-
| [[action order|order]]
| A numeric value indicating the order in which the action should be displayed as part of a menu.  Low numbers result in higher placement in the menu.
| all
|-
| [[action icon|icon]]
| The path to an icon that should be used when the action appears as a menu item.
| all
|-
| [[action template|template]]
| The path to the template that should be used when the action is displayed as a web page.
| all
|-
| [[action description|description]]
| Mouseover text for the action (when displayed as a menu item).
| all
|}

===PHP Expression Context===

Notice that the [[action url|url]], [[action condition|condition]], and [[action url_condition|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 [[action url|urls]] and [[action condition|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).

{| class=&quot;listing listing2&quot;
|-
! Name
! Description
! Version
|-
| [[action context:site_url|$site_url]]
| The URL to the current application&apos;s directory (not including &quot;index.php&quot;)
| all
|-
| $site_href
| The URL to the current application including &quot;index.php&quot;
| all
|-
| $dataface_url
| The URL to the xataface installation directory.
| all
|-
| $table
| The name of the current table (i.e. the value of the &quot;-table&quot; request parameter&quot;
| all
|-
| $query
| An associative array of the current query variables.
| all
|-
| $app
| A reference to the current Dataface_Application object.  Alias of &quot;$this&quot;
| all
|-
| $resultSet
| A reference to the Dataface_QueryTool object for the current query.
| all
|-
| [[action context:record|$record]]
| A reference to the current Dataface_Record object.
| all
|-
| [[action context:context|$context]]
| An associative array of context variables that are passed to the action from the context in which the action is called.
| all
|}</content>
	<keywords></keywords>
	<language>en</language>
	<original_page>0</original_page>
</wiki>
<wiki id="wiki?page_id=5">
	<page_name>valuelists.ini_file</page_name>
	<page_id>5</page_id>
	<page_title>valuelists.ini_file</page_title>
	<content>==valuelists.ini file Reference==

[[toc]]

The valuelists.ini file stores value lists that can be used as [[vocabulary|vocabularies]] for select lists, checkbox groups, and other widgets the provide the user with options to choose from.

Each table can have an associated valuelists.ini file located in its [[table configuration directory]]. E.g. for a table named &quot;people&quot; its valuelists.ini file will be stored in &quot;tables/people/valuelists.ini&quot;.

In addition you can define an application-wide valuelists.ini file in the root of your application&apos;s directory, whose valuelists can be used by any table.

===Syntax===

The valuelists.ini file uses [[INI file syntax]], where a valuelist is defined by a single section of the INI file.  E.g.

&lt;code&gt;
[colors]
    r=Red
    b=Blue
    g=Green
&lt;/code&gt;

This example would define a single valuelist named &quot;colors&quot; with 3 values: r,g, and b (with corresponding labels &quot;Red&quot;, &quot;Green&quot;, and &quot;Blue).  The values (the left of the equals sign) are stored in the database, while the labels are rendered on screen for the user&apos;s convenience.

===Dynamic Valuelists===

It is often advantageous to load valuelists from the database rather than store them directly in the valuelists.ini file.  The __sql__ directive allows you to specify an SQL query which selects up to 2 columns (the first is the id and the second, the label).

E.g.

&lt;code&gt;
[colors]
    __sql__ = &quot;select colorCode, colorName from colors&quot;
&lt;/code&gt;


===Defining Valuelists in a Delegate Class===

If you require more flexibility with the definition of your valuelists than can be gained from the valuelists.ini file, you can define your valuelist using PHP inside a delegate class.  Essentially you just create a method that returns an associative array, where the keys are the IDs that are stored in the database, and the values are the values that are visible in the select list.

e.g.  In either the application delegate class or a table delegate class:

&lt;code&gt;
function valuelist__colors(){
    return array(
        &apos;r&apos;=&gt;&apos;Red&apos;,
        &apos;g&apos;=&gt;&apos;Green&apos;,
        &apos;b&apos;=&gt;&apos;Blue&apos;
    );
}
&lt;/code&gt;

This method is called each time the valuelist is about to be used, so if your method performs any sort of intensive processing, it is a good idea to use a caching scheme so that it only runs the critical code once per request.  For example, you could use a static variable as follows:

&lt;code&gt;
function valuelist__colors(){
    static $colors = -1;
    if ( !is_array($colors) ){
        $colors = array();
        $res = mysql_query(&quot;select colorCode, colorName from colors&quot;, df_db());
        if ( !$res ) throw new Exception(mysql_error(df_db()));
        while ($row = mysql_fetch_row($res) ) $colors[$row[0]] = $row[1];
    }
    return $colors;
}
&lt;/code&gt;

In this example the database query is only executed once per request to load the $colors variable.  The rest of the time it simply loads the cached value from $colors.</content>
	<keywords>valuelists, dynamic valuelists, programmatically defined valuelists</keywords>
	<language>en</language>
	<original_page>0</original_page>
</wiki>
<wiki id="wiki?page_id=4">
	<page_name>widget:type</page_name>
	<page_id>4</page_id>
	<page_title>widget:type</page_title>
	<content>==widget:type Directive Reference==

The widget:type directive in the [[fields.ini file]] specifies the type of widget that should be used to edit a particular field in HTML forms.  Xataface uses [http://pear.php.net/package/HTML_QuickForm/ HTML_QuickForm] for its form generation so theoretically any widget supported by HTML_QuickForm should work with Xataface.

===Available Widget Types===

{| class=&quot;listing listing2&quot;
|-
! Name
! Description
! Version
|-
| [[advmultiselect]]
| Two select lists with add/remove buttons.  Selected items appear in the right select list.  Options may be selected from the left select list.
| 1.0
|-
| [[autocomplete]]
| An autocomplete. text field.  This is not to be confused with the [[yui_autocomplete]] widget.  The main difference is that this widget does not provide a drop-down list of possibilities, it just tries to complete what the user is typing inside the text field based on a valuelist.
| all
|-
| [[calendar]]
| A DHTML pop-up calendar to select the date.  [[Image:http://media.weblite.ca/files/photos/calendar_widget.png?max_width=400]]
| 0.5.3
|-
| [[checkbox]]
| A checkbox or checkbox group. 

Example 1: Checkbox as boolean on Tinyint field.

[[Image:http://media.weblite.ca/files/photos/checkbox_widget.png?max_width=400]]

Example 2: Checkbox group to allow multiple selections.

[[Image:http://media.weblite.ca/files/photos/checkbox-group_widget.png?max_width=500]]
| all
|-
| [[date]]
| Select lists for month, year, day, hour, etc...
| all
|-
| [[file]]
| A file widget (default type for [[container]] fields and [[blob]] fields.  [[Image:http://media.weblite.ca/files/photos/file_widget.png?max_width=400]]

| all
|-
| [[grid]]
| A grid widget for editing multiple rows of related records inside the edit form.  Supports adding/removing/reordering. As of version 1.2.5, file uploads are not supported in the grid widget.

[[Image: http://media.weblite.ca/files/photos/grid_widget.png?max_width=500]]
| 1.0
|-
| [[group]]
| A compound widget for editing multiple fields but storing the data in a single XML field.
[[Image:http://media.weblite.ca/files/photos/group_widget.png?max_width=400]]
| all
|-
| [[hidden]]
| A hidden field 
| all
|-
| [[htmlarea]]
| A WYSIWYG (What you see is what you get) HTML editor.  This defaults to [http://www.fckeditor.net/ FCKeditor], but [http://tinymce.moxiecode.com/ TinyMCE] is also supported.  [[Image:http://media.weblite.ca/files/photos/htmlarea_widget.png?max_width=400]]
| all
|-
| [[lookup]]
| A field that allows users to look-up a record from another table.  THis is a good alternative to a select list.  It doesn&apos;t use a vocabulary, so this is appropriate when vocabularies would be unpractical (for large vocabularies).  You do, however need to specify the widget:table directive for the field so that the lookup knows from which table to load the records.
[[Image:http://media.weblite.ca/files/photos/Picture%2023.png?max_width=640]]

| 1.2
|-
| [[password]]
| A password field.

[[Image:http://media.weblite.ca/files/photos/password_widget.png?max_width=400]]
| all
|-
| [[select]]
| A select list.

Example 1: A single select.

[[Image:http://media.weblite.ca/files/photos/select_widget.png?max_width=400]]

Example 2: A multi-select.  To use a multi-select, add repeat=1 to your fields.ini.

[[Image:http://media.weblite.ca/files/photos/multi-select_widget.png?max_width=500]]
| all
|-
| [[table]]
| A compound widget for editing tabular data.  This widget dictates the storage format as XML.

[[Image:http://media.weblite.ca/files/photos/table_widget.png?max_width=400]]
| all
|-
| [[text]]
| A text field

[[Image:http://media.weblite.ca/files/photos/text_widget.png?max_width=400]]
| all
|-
| [[textarea]]
| A text area (multi-line text field)

[[Image:http://media.weblite.ca/files/photos/textarea_widget.png?max_width=400]]
| all
|-
| [[time]]
| A select list of times separated by a specified interval (default 30 minutes).
| 0.7
|-
| [[yui_autocomplete]]
| An autocomplete widget ported from the [http://developer.yahoo.com/yui/autocomplete/ Yahoo UI Library].

[[Image:http://media.weblite.ca/files/photos/yui_autocomplete.png?max_width=400]]
| 1.0
|}</content>
	<keywords></keywords>
	<language>en</language>
	<original_page>0</original_page>
</wiki>
<wiki id="wiki?page_id=3">
	<page_name>fields.ini_file</page_name>
	<page_id>3</page_id>
	<page_title>fields.ini_file</page_title>
	<content>==fields.ini File Reference==

[[toc]]

===Overview===

The fields.ini file is a configuration file which is associated with a single table of a database application.  It provides metadata about the table&apos;s fields to help Xataface dictate how they should be included in the application.  This includes metadata such as

* [[widget:type|Widget type]] - To specify the type of widget that should be used to edit content in the field (e.g. text, select, checkbox).
* [[widget:label|Label]] - The labels that can be used in column headers and on forms.
* [[widget:description|Help text]] - for forms to inform the user how data should be entered.
* [[group|Field Groupings]]
* [[widget:atts|widget:atts]] - To use javascripts in event handlers
* and more

Although a table doesn&apos;t need to have an associated fields.ini file in order for the application to work, each table can have one; and it is always located in the [[table configuration directory]].  For example, the fields.ini file for the [[people]] table would be located at [[Site Root]]/tables/people/fields.ini file.

===Syntax===

The fields.ini file uses [[standard INI syntax]] (just like the php.ini file), where each section corresponds to a column in the table. 

For example, consider a table &quot;people&quot; with columns &quot;first_name&quot;, &quot;last_name&quot;, and &quot;age&quot;.  The fields.ini file for the people table could then contain sections for each of its columns as follows:

&lt;code&gt;
[first_name]

[last_name]

[age]
&lt;/code&gt;

In this example the sections are empty (i.e. they have no directives, but we could easily add some directives:

&lt;code&gt;
[first_name]
    widget:description=&quot;Please enter your first name&quot;
    widget:label=&quot;Given Name&quot;

...etc...
&lt;/code&gt;

Here we have told Xataface that the first name field should include some help text (using the [[widget:description]] directive) on its edit form.

===Example fields.ini file===
&lt;code&gt;

;; Global directives applied to every field (requires Xataface 1.2.6)
[__global__]
	visibility:list=hidden

[isbn]
widget:label = ISBN
visibility:list=visible


[copyright_year]
widget:label = &quot;Year&quot;
widget:atts:size=4
visibility:list=visible

[categories]
widget:type=checkbox
vocabulary = book_categories

[media]
widget:type=checkbox
vocabulary = book_media

[borrower_id]
widget:type=select
vocabulary=users

[due_date]
widget:description = &quot;The date that the book is due to be returned to the library&quot;
visibility:list=visible


[cover_art_url_small]
visibility:browse=hidden


[cover_art_url_medium]
;visibility:browse=hidden


[cover_art_url_large]
visibility:browse=hidden
visibility:find=hidden

[amazon_description]
widget:label = Description


[amazon_reviews]


[amazon_url]

[amazon_refresh_timestamp]
widget:type=static

[date_created]
timestamp=insert
widget:type = static


[date_modified]
timestamp=update
widget:type=static


[created_by]
widget:type=static


[modified_by]
widget:type=static

[notes]

&lt;/code&gt;

This is an example from the [http://apps.weblite.ca/index.php?-action=view&amp;-table=packages&amp;package_id=%3D2 Library DB] application for the books table. 


===Field Directives===

The following directives may be added to a field&apos;s section of the fields.ini file to customize the field&apos;s behavior.  Some directives are not applicable to all fields.

{| class=&quot;listing listing2&quot;
|-
! Name
! Description
! Version
|-
| [[column:label]]
| Specifies a custom label to use in list view for the column.  If this is not specified, then the value of [[widget:label]] will be used.
| 1.3
|-
| [[column:legend]]
| Adds a small amount of help text to the column header for this field in list view.  Default is blank.  E.g. &lt;nowiki&gt;&lt;br/&gt;&lt;img src=&quot;http://media.weblite.ca/files/photos/Screen%20shot%202011-02-08%20at%205.05.55%20PM.png?max_width=640&quot;/&gt;&lt;br/&gt;&lt;/nowiki&gt;In this photo it shows the text &quot;*Paper Uploaded&quot; set as the [[column:legend]] for &quot;field 1&quot;.
| 1.3
|-
| [[date_format]]
| Specifies how the field should be formatted when displayed.  Takes same parameters as PHP [http://php.net/strftime strftime] function.
| 2.0
|-
| [[display]]
| Specifies the layout of the field on the edit form.  Most fields have an implicit value of &quot;inline&quot; meaning the widget and its label appear on the same line.  Textareas and htmlareas have an implicit value of &quot;block&quot; meaning that the label and widget appear in separate rows (label above the widget).  You can set this value explicitly also to override the layout of a field.
| 0.8
|-
| [[display_format]]
| A pattern that can be used to define the display format of the field.  This takes the same parameters as the PHP [http://php.net/sprintf sprintf] function.
| 2.0
|-
| [[encryption]]
| Primarily used with password fields, indicates the type of encryption that should be used to save the field.  Supports &quot;md5&quot;, &quot;sha1&quot;, &quot;encrypt&quot;, and &quot;password&quot;.
| 0.6
|-
| event.date
| For use by the [[Calendar Action]].  Indicates that the field stores the date of the record when interpreted as an event.  Possible values &quot;0&quot; or &quot;1&quot;.
| 1.0
|-
| event.start
| For use by the [[Calendar Action]].  Indicates that the field stores the start time of the record when interpreted as an event.  Possible values &quot;0&quot; or &quot;1&quot;.
| 1.0
|-
| event.end
| For use by the [[Calendar Action]]. Indicates that the field stores the end time of the record when interpreted as an event.  Possible values &quot;0&quot; or &quot;1&quot;.
| 1.0
|-
| event.location
| For use by the [[Calendar Action]].  Indicates that the field stores the location of a record when interpreted as an event.  Possible values &quot;0&quot; or &quot;1&quot;.
| 1.0
|-
| [[filter]]
| Boolean value (0 or 1) indicating whether this field should be [[filterable]] in [[list view]].
| 0.8
|-
| [[frozen_description]]
| The field description shown when the widget is frozen (i.e. uneditable).  If this is not specified, no field description is shown in this case.
| 1.2
|-
| [[group]]
| The name of the field group that this field belongs to.  Fields with the same &quot;group&quot; value will be rendered in the same field group on the form.
| 0.5
|-
| [[Key]]
| If you are using a View for the table you need to explicitly mark the fields that comprise the primary key.  E.g. Key=PRI
| 0.6

|-
| [[label_link]]
| An optional URL for the field label to link to.  This would usually be some &quot;help&quot; page that explains what the field is for.  The link will be a link in both the view and edit tabs.
| 1.1.3
|-
| [[ignore]]
| Boolean value (0 or 1) indicating whether this field should be ignored on the edit form.  This is handy if the field is going to be constantly updated in the background (via a cron job perhaps) and you don&apos;t want the edit form to interfere.
| 1.0
|-
| [[logo]]
| Boolean value (0 or 1) to indicate if this field should be treated as a logo field.  Logo fields are displayed in the upper left of the [[view tab]] for a record, and are assumed to contain an image.  If no logo field is explicitly specified, Xataface will make a best guess as to which field should be used.
| 0.7
|-
| [[money_format]]
| For fields containing monetary amounts, this specifies the format.  Takes same parameters as PHP [http://php.net/money_format money_format] function.
| 2.0
|-
| [[noLinkFromListView]]
| Boolean value (0 or 1) to indicate if this field should be linked when in list view (or in a related list).  Default value is 0 to indicate that the field IS linked.  It is common to use this directive when using a custom xxx__renderCell() method that contains its own links.
| 1.1
|-
| [[not_findable]]
| A flag to indicate that this field can not be used as part of a query. This is helpful if you want a field to remain completely confidential to prevent people from finding records based on the value of this field.  This flag is even necessary if the permissions for the field don&apos;t permit viewing the value of the field.
| 1.1
|-
| [[number_format]]
| For numeric fields, this indicates the number of decimal places to display when displaying this field.  E.g. 2
| 2.0
|-
| [[order]]
| The order of the field when laid out on forms and lists.  Can contain any floating point number or integer (e.g. 0, 10, -10, 235.4)
| 0.6
|-
| [[relationship]]
| Used only with complex fields that involve editing related records (e.g. [[grid]]).  This is the name of the relationship that the field should be edited.
| 0.8
|-
| [[repeat]]
| Boolean value (0 or 1) used in conjunction with a select widget to indicate whether to enable a multi-select.
| ?
|-
| [[section]]
| The name of the section that this field should belong to in the [[view tab]].
| 0.7
|-
| [[secure]]
| A boolean flag for use with [[container fields]] to indicate that it should use secure URLs for the file downloads (i.e. it will obey the application permissions).  Without this directives, uploaded files are served directly by apache and don&apos;t obey the Xataface permissions defined per record.
| 1.3
|-
| [[struct]]
| A boolean (0 or 1) value indicating whether this field is considered a structure.  A value of 1 indicates that this field is a structure and should not be truncated under any circumstances.  Normally fields are truncated at 255 chars in list view.  This is useful if the field contains XML or other structured data so that attempts to truncate it would destroy integrity.
| 1.1.2
|-
| [[tab]]
| If tabbed forms are enabled, then this specifies the name of the tab that this field belongs to on the edit form.
| 0.8
|-
| [[timestamp]]
| Indicates when a timestamp should be set in the field (only applicable for date and time fields).  Possible values are &quot;insert&quot; and &quot;update&quot;
| 0.7
|}

{| class=&quot;listing listing2&quot;
|-
! Name
! Description
! Version
|-
| [[title]]
| Boolean value (0 or 1) indicating whether this field should be treated as a title field.
| 0.7
|-
| [[transient]]
| Boolean value (0 or 1) indicating whether this field is a transient field or not.  A transient field is a field that is defined in the fields.ini file but not in the database.  Hence the values that are input into this field on the edit form are not saved to the database.
| 0.8
|-
| [[Type]]
| The data type of the field (note the capital &quot;T&quot; as Xataface is case sensitive).  This value is only overridden for [[container]] fields, however its value can be accessed programmatically for any field.
| 0.5
|-
| [[validators|validators:VALIDATOR_NAME]]
| A prefix for a validation type on the current field. (Replace &quot;VALIDATOR_NAME&quot; with the name of the validator to be used. e.g. required). There are many validators available to be used.
| 0.5
|-
| [[validators:VALIDATOR_NAME:message]]
| The message the should be displayed if the form fails to validator due to the &quot;VALIDATION_NAME&quot; validation rule.
| 0.5
|-
| [[viewgroup]]
| The name of the field grouping that this field will belong to in the view tab.  If this is not present, then it will be grouped according to the [[group]] directive.
| 1.0
|-
| [[visibility:browse]]
| Indicates whether the field should be visible in browse mode (i.e. in the &quot;view&quot; tab).  Possible values are &quot;visible&quot; and &quot;hidden&quot;.
| 0.6
|-
| [[visibility:csv]]
| Indicates whether the field should be included in CSV exports.  Possible values are &quot;visible&quot; and &quot;hidden&quot;. (1.0 beta 4)
| 1.0b4
|-
| [[visibility:find]]
| Indicates whether the field should be visible in find mode.  Possible values are &quot;visible&quot; and &quot;hidden&quot;
| 1.0
|-
| [[visibility:list]]
| Indicates whether the field should be visible in list view.  Possible values are &quot;visible&quot; and &quot;hidden&quot;.
| 0.6
|-
| [[visibility:update]]
| Indicates whether the field should be included in update and copy/replace forms.  Possible values are &quot;visible&quot; and &quot;hidden&quot;.
| 1.3
|-
| [[vocabulary]]
| The [[valuelist]] that should be used as the options to select.  This is only applicable for fields that have options to select like a select list or a checkbox group.
| 0.5
|-
| [[widget:atts]]
| A namespace for attributes that should be added to the HTML widget.  This allows you to specify things like javascript events, styles, widget size, etc..
| 0.5
|-
| [[widget:columns]]
| For checkbox groups, this specifies the number of columns to use for laying out the checkboxes.
| 1.0
|-
| [[widget:description]]
| Help text to give the user a hint about how to edit the field&apos;s content.
| 0.1
|-
| [[widget:editor]]
| The type of HTML editor that should be used.  This is used only when [[widget:type]] is set to [[widget:type htmlarea|htmlarea]]

Acceptable values include:

* [http://www.fckeditor.net/ fckeditor] (default)
* [http://tinymce.moxiecode.com/ tinymce]  (version 0.6 or higher)
* [http://www.nicedit.com/ nicedit] (version 1.0 or higher)
| all
|-
| [[widget:editvalues]]
| Used with select lists to allow users to add values to the select list.  E.g. widget:editvalues=1
| 0.8
|-
| widget:focus
| Sets default focus. 0 or 1. (Javascript focus in a form)
| 0.6
|-
| [[widget:label]]
| The label that should be used for the current field on edit forms, column headings, and other relevant locations.
| 0.1
|-
| [[widget:question]]
| Text displayed just before the widget.  This is almost the same as [[widget:description]] except that this text is guaranteed to be displayed before the widget, whereas [[widget:description]] may be displayed below or beside the widget.
| 0.1
|-
| [[widget:type]]
| The type of widget that should be used (e.g. checkbox, select, text, etc..)
| 0.1
|-
| [[xml]]
| A flag for use with calculated fields (i.e. fields defined in the [[delegate class]] via the [[field__fieldname]] method) that will include the field in XML output produced by the [[export xml action]].  Default is 0, but setting this value to 1 wil cause the field to be included.
| 1.2.7
|}

===Applying Directives to All fields (__global__)===

Xataface 1.2.6 includes support for a [[__global__]] section that allows you to specify directives that should be applied to all fields.  These directives can be overridden on a field by field basis.  The [[__global__]] section can take all the same directives that a normal field section takes.


===widget:atts:class Values===

The widget:atts:class directive allows you to assign a CSS class to a field&apos;s widget.  There
are certain CSS classes that have meaning to Xataface and will cause additional functionality
to automatically be added to the field.  These built-in classes are listed below:

{| class=&quot;listing listing2&quot;
|-
! Name
! Description
! Version
|-
| [[passwordTwice]]
| Applicable only to password fields.  If you set widget:atts:class=passwordTwice, then this will convert the password field into two fields whereby both fields need to match in order for submission to continue on the edit form. This operates as a password verification field.&quot;
| 1.3rc2
|}



===Global Directives===

The following directives can be added to the beginning of the fields.ini file (before any field sections) to customize field groups and the table as a whole.

{| class=&quot;listing listing2&quot;
|-
! Name
! Description
! Version
|-
| [[__dependencies__]]
| A comma-delimited list of tables that this table is dependent upon for caching purposes.  E.g. if any table in this list is modified, then the query cache is cleared for queries on this table.  See this [http://xataface.blogspot.com/2009/06/using-query-caching-in-xataface.html blog article] for more information about query caching.
| 1.2
|-
| [[__isa__]]
| The name of the parent table of the current table.  This directive allows you to have a heirarchical structure amongst the tables in your application.
| 0.8
|-
| [[__source_tables__]]
| A comma-delimited list of tables that this table/view is derived from.  This is used with the query caching feature and is necessary to use this directive if the table is actually a view.  If this directive is not set, then any queries involving this view will not use the query cache because Xataface would have no way to discern the update time of the view.  See this [http://xataface.blogspot.com/2009/06/using-query-caching-in-xataface.html blog article] for more information about query caching.
| 1.2
|-
| [[__sql__]]
| Defines a custom select query to override the default select query for the current table.  (The default select query is generally &quot;select * from tablename&quot;).
| 0.7
|-
| [[__prefs__]]
| Sets preferences for this table and its records.
| 1.0b4
|}


===Field Groups===

The [[group]] directive allows you to group multiple fields together so that they will be rendered in the same field group on forms.  
You can also configure these groups as a whole by defining a section named &quot;[fieldgroup:GROUPNAME]&quot; (where GROUPNAME is the name of the field group, corresponding to the [[group]] directive values for the fields)
in the fields.ini file.  This section provides a few basic directives to customize some aspects of the field group:

* label
* order
* description
* template
* more...

The most common use of these sections is to customize the label or order of groups, especially when there are multiple field groups in the table.
For example, suppose we have a table &quot;people&quot; with fields &quot;first_name&quot;, &quot;last_name&quot;, &quot;phone&quot;, &quot;fax&quot;, &quot;email&quot;, &quot;address&quot;, &quot;city&quot;, and &quot;country&quot;. 
Suppose these fields are grouped as follows:

* &quot;first_name&quot; and &quot;last_name&quot;
* &quot;phone&quot;, &quot;fax&quot;, and &quot;email&quot;
* &quot;address&quot;, &quot;city&quot;, and &quot;country&quot;

so that the fields.ini file looks like:

&lt;code&gt;
[first_name]
    group=name
    
[last_name]
    group=last_name
    
[phone]
    group=contact
    
[fax]
    group=contact
[email]
    group=contact
    
[address]
    group=address
    
[city]
    group=address
    
[country]
    group=address

&lt;/code&gt;

By default, the &quot;name&quot; group will appear first in the form, followed by &quot;contact&quot; and &quot;address&quot;.  If we want to place &quot;address&quot; first we could add the following section to our fields.ini file:

&lt;code&gt;
[fieldgroup:address]
    order=-1
&lt;/code&gt;

Since the default order value is 0 on other groups, setting the &quot;order&quot; parameter to -1 will place the &quot;address&quot; group before all others.

====Field Group Directives====

The following directives are applicable in a fieldgroup section:

{| class=&quot;listing listing2&quot;
|-
! name
! description
! version
|-
| [[fieldgroup order|order]]
| Specifies the order of the group with respect to other groups on the form.  Accepts any numerical value (e.g. 0, 1, -1, 25.43), with lower values appearing first.  Default value is 0.
| 0.6
|-
| [[fieldgroup label|label]]
| Specifies the label that should be used for the field group.
| 0.6
|-
| [[label_link]]
| Specifies a URL that the field group label should link to.
| 1.1.3
|- 
| [[fieldgroup template|template]]
| The path to a custom template that should be used to render the fields of the field group.
| 1.0
|-
| [[fieldgroup collapsed|collapsed]]
| Boolean value (0 or 1) indicating whether the field group should be collapsed by default (user can expand it).  
| 1.0
|}
</content>
	<keywords>fields.ini directives </keywords>
	<language>en</language>
	<original_page>0</original_page>
</wiki>
<wiki id="wiki?page_id=2">
	<page_name>testpage2</page_name>
	<page_id>2</page_id>
	<page_title>testpage2</page_title>
	<content>Another test page
[[testpage]]</content>
	<keywords></keywords>
	<language>en</language>
	<original_page>0</original_page>
</wiki>
<wiki id="wiki?page_id=1">
	<page_name>index_page</page_name>
	<page_id>1</page_id>
	<page_title>index_page</page_title>
	<content>==Documentation==

[[toc]]

===Introductory===

* [[about|About Xataface]]
* [http://xataface.com/documentation/tutorial/getting_started Getting Started Tutorial]
* [[How to build a PHP MySQL Application with 4 lines of code]]
* [[Troubleshooting]]

===Reference===

* [http://dataface.weblite.ca API Docs]
* [[conf.ini file]] directives
* [[fields.ini file]] directives
* [[valuelists.ini file]] directives
* [[relationships.ini file]] directives
* [[Delegate class methods]]
* [[Application Delegate Class]]
* [[permissions.ini file]] directives
* [[actions.ini file]] directives
* [[preferences|User Preferences]] - options for customizing the application further via the getPreferences() method.
* [[xataface templates|templates]]
* &apos;&apos;&apos;[[URL Conventions]]&apos;&apos;&apos; - Learn how to use Xataface&apos;s URL conventions to form URLs that return exactly the result set that you want.
* &apos;&apos;&apos;[[Roadmap]]&apos;&apos;&apos; - What is planned for the next releases of Xataface

===Cook Book===

* [[Customizing Theme Based on IP Address]] - An article on storing IP addresses in the database and showing users a different theme depending on which range of IP addresses they are connecting from.

===By Topic===

====Installation====

* &apos;&apos;&apos;[http://xataface.com/documentation/tutorial/getting_started/installation Xataface Installation Instructions]&apos;&apos;&apos; - This document explains how to install Xataface on your system.  It does not describe how to create an application with Xataface.
* &apos;&apos;&apos;[http://xataface.com/documentation/tutorial/getting_started/first_application Creating your first App]&apos;&apos;&apos; - How to create an application using Xataface (from the Getting Started Tutorial)
* &apos;&apos;&apos;[[about|About Xataface]]&apos;&apos;&apos; - Quick overview of Xataface.  Includes a 6 step example of creating an application with Xataface.

====Configuration====

* &apos;&apos;&apos;[http://xataface.com/documentation/tutorial/getting_started/customizing Customizing field labels, descriptions, and widgets]&apos;&apos;&apos; - This document explains how to customize some basic aspects of your application&apos;s edit forms. (From the Getting Started tutorial).
* &apos;&apos;&apos;[http://xataface.com/documentation/tutorial/getting_started/valuelists Using Valuelists]&apos;&apos;&apos; - How to use valuelists to set up options for your select lists and checkbox groups.
* &apos;&apos;&apos;[http://xataface.com/documentation/how-to/list_tab Configuring and customizing the list tab]&apos;&apos;&apos; -     This document explains how to customize the display of the list tab using INI files, templates, and delegate classes.


====Internationalization====

* &apos;&apos;&apos;[[Contribute to Xataface Translation Project]]&apos;&apos;&apos; - We need translators to help us keep the Xataface translations up to date.  This page shows how you can help.
* &apos;&apos;&apos;[http://xataface.com/documentation/tutorial/internationalization-with-dataface-0.6 Internationalization with Xataface]&apos;&apos;&apos; (tutorial)
* &apos;&apos;&apos;[http://xataface.com/documentation/how-to/how-to-internationalize-your-application How to internationalize your application]&apos;&apos;&apos; (how to) - Xataface 0.6 contains a LanguageTool class that allows your applications to be presented in multiple languages
* &apos;&apos;&apos;[http://xataface.com/documentation/how-to/use-translations How to use other translations]&apos;&apos;&apos; - Xataface 0.7 includes German and French translations. This document explains how to allow your application to use these and other translations, rather than the default English translation.
* &apos;&apos;&apos;[http://xataface.com/documentation/how-to/unicode How to enable unicode support]&apos;&apos;&apos; -     As of Xataface 0.6, unicode is fully supported so that your dataface application will work with any and multiple languages simultaneously.
* &apos;&apos;&apos;[http://weblite.ca/svn/dataface/core/trunk/lang Download latest language files out of SVN]&apos;&apos;&apos; - If you want to make sure that you have the latest translations, you can download them from SVN and place them into your xataface lang directory.


====User Interface Customization====

* &apos;&apos;&apos;[[preferences|User Preferences]]&apos;&apos;&apos; - You can hide, show, enable, and disable features of the application selectively.
* &apos;&apos;&apos;[http://xataface.com/documentation/tutorial/getting_started/changing-look-and-feel Changing the Look and Feel]&apos;&apos;&apos; - Change the way your application looks by adding custom headers, footers, and sections, and by overriding the default templates with your own custom templates.  (From the Getting Started tutorial).
* [[xataface templates|templates]]
* &apos;&apos;&apos;[http://xataface.com/documentation/tutorial/customizing-the-dataface-look-and-feel Customizing the Xataface look and feel]&apos;&apos;&apos; tutorial
* &apos;&apos;&apos;[[Customizing the look and feel of a row or a cell| Customizing the look and feel of an element in the list view]]&apos;&apos;&apos; - Personnalize the aspect of each part of your list according to its content.
* &apos;&apos;&apos;[http://xataface.com/documentation/how-to/custom_javascripts How to include custom javascripts and stylesheets]&apos;&apos;&apos; - Use the custom_javascripts and custom_stylesheets blocks to include your own custom javascript and CSS files in your application.
* &apos;&apos;&apos;[http://xataface.com/documentation/how-to/hide_search How to hide the search box]&apos;&apos;&apos; -     The full-text search box that appears in the upper right can easily be removed.
* &apos;&apos;&apos;[http://xataface.com/documentation/how-to/list_tab Configuring and customizing the list tab]&apos;&apos;&apos; -     This document explains how to customize the display of the list tab using INI files, templates, and delegate classes.
* &apos;&apos;&apos;[[How to Add Custom Sections to View Tab]]&apos;&apos;&apos; - The &apos;&apos;View&apos;&apos; tab in a Xataface application can be configured in many ways.  This tutorial shows you how to add your own custom sections to the view tab.
* &apos;&apos;&apos;[[Creating a Dashboard]]&apos;&apos;&apos; - Create a dashboard action for your users to so that they have a logical starting point in your application.
* &apos;&apos;&apos;[[Grafted fields]]&apos;&apos;&apos; - Add a grafted field to your table for user convenience. You can use it also to be able to sort columns with relative tables content.
* &apos;&apos;&apos;[[Clean the html for the export]]&apos;&apos;&apos; - Clean the HTML tags and entities for the export in CSV or XML.

====Using the API====

* &apos;&apos;&apos;[[Introduction to the Xataface API]]&apos;&apos;&apos; - A short introduction to the classes, methods, and functions available in the Xataface API.
* &apos;&apos;&apos;[http://xataface.com/documentation/how-to/how-to-define-custom-serialization-for-fields How to define custom serialization for fields]&apos;&apos;&apos;

====Security====

* &apos;&apos;&apos;[[authentication]]&apos;&apos;&apos; - Overview of Xataface Authentication
* &apos;&apos;&apos;[[registration form]]&apos;&apos;&apos; - Enabling User Registration in Xataface
* &apos;&apos;&apos;[[permissions.ini file]]&apos;&apos;&apos; - Reference of the permissions.ini file directives.
* &apos;&apos;&apos;[http://xataface.com/documentation/tutorial/getting_started/permissions Permissions]&apos;&apos;&apos; - Use sessions and delegate classes to define permissions at the record and field level. (From the Getting Started tutorial).
* &apos;&apos;&apos;[[Cached permissions]]&apos;&apos;&apos; - Use cached perms for complex queries inside getPermissions()
* &apos;&apos;&apos;[[Delegate_class_methods#toc5|Delegate class methods]]&apos;&apos;&apos; - Permissions-related functions
* &apos;&apos;&apos;[[Relationship Permissions]]&apos;&apos;&apos; - Guide to permissions on related records.
* &apos;&apos;&apos;[http://xataface.com/documentation/how-to/disallow_tables How to disallow access to tables]&apos;&apos;&apos;
* &apos;&apos;&apos;[[site_with_backoffice]]&apos;&apos;&apos; - A site with a backoffice without obligation to log in
* &apos;&apos;&apos;[http://xataface.com/documentation/how-to/security_filters Security Filters]&apos;&apos;&apos; - Use security filters to block users from seeing certain records.
* &apos;&apos;&apos;[[How to granulate permissions on each field]]&apos;&apos;&apos; - Decide for each field who can edit, read...
** &apos;&apos;&apos;[[no_access_text]]&apos;&apos;&apos; - Replace the default NO ACCESS permission text with another text.
* &apos;&apos;&apos;[[LDAP or Active Directory]]&apos;&apos;&apos; - How to authenticate users with LDAP or Active Directory...

====Performance====

* &apos;&apos;&apos;[http://xataface.blogspot.com/2009/06/using-query-caching-in-xataface.html Using Query Caching]&apos;&apos;&apos; - Query caching can drastically improve performance of busy applications with large databases.  This article explains how to enable this caching in your Xataface application.
* &apos;&apos;&apos;[[_output_cache]]&apos;&apos;&apos; - Xataface does quite a bit of heavy lifting on each page request. If your application is getting a lot of traffic that is slowing your server down, you may want to look at enabling the Xataface output cache.

====Modules====

* [[modules]] - Available Xataface Modules.  This includes such things as CAPTCHA validation, editable javascript grids, and more.
* [[Module Developers Guide]] - A guide / Tutorial on how to develop your own Xataface modules.

====Preferences====

====Relationships====

* &apos;&apos;&apos;[http://xataface.com/documentation/tutorial/getting_started/relationships Relationships]&apos;&apos;&apos; - Xataface allows you to define relationships between tables using the relationships.ini file. (From the Getting Started Tutorial)
* &apos;&apos;&apos;[http://xataface.com/documentation/how-to/how-to-assign-order-to-related-records How to assign order to related records]&apos;&apos;&apos; -     Sometimes it is desirable for the records in a relationship to take on a particular default order. Dataface 0.6 makes this easy if you follow a few conventions.
* &apos;&apos;&apos;[[Drag and Drop Reordering of Relationships]]&apos;&apos;&apos; - A more in-depth tutorial about adding ordering to relationships.
* &apos;&apos;&apos;[[relationships.ini file]] reference
* &apos;&apos;&apos;[[Relationship Permissions]]


====Forms====

* &apos;&apos;&apos;[http://xataface.com/documentation/how-to/DisableEnterKeyInFields How to disable the enter key in forms]&apos;&apos;&apos;
* &apos;&apos;&apos;[http://xataface.com/documentation/tutorial/getting_started/customizing Customizing field labels, descriptions, and widgets]&apos;&apos;&apos; - This document explains how to customize some basic aspects of your application&apos;s edit forms. (From the Getting Started tutorial).
* &apos;&apos;&apos;[http://xataface.com/documentation/tutorial/getting_started/valuelists Using Valuelists]&apos;&apos;&apos; - How to use valuelists to set up options for your select lists and checkbox groups. (From the Getting Started tutorial)
* &apos;&apos;&apos;[http://xataface.com/documentation/tutorial/getting_started/validation Form Validation]&apos;&apos;&apos; - Xataface allows you to add validation rules to fields using the fields.ini file.  (From the Getting Started tutorial).
* &apos;&apos;&apos;[http://xataface.com/documentation/how-to/how-to-handle-file-uploads How to handle file uploads]&apos;&apos;&apos; -     Xataface allows you to store file uploads in BLOB fields or on the file system.
* &apos;&apos;&apos;[http://xataface.com/documentation/how-to/custom_validation How to add custom validation with delegate classes]&apos;&apos;&apos; - If the standard validators (e.g., required, email, regex, etc..) don&apos;t quite cut it for your validation rules, Xataface allows you to define custom validation methods in the delegate class.
* &apos;&apos;&apos;[http://xataface.com/documentation/how-to/regex_validation Validating with regular expressions]&apos;&apos;&apos; - How to validate input into a field using regular expressions.
* &apos;&apos;&apos;[[Dynamic select boxes]]&apos;&apos;&apos; -     How to create two dynamic javascript select boxes from the valuelists.

====Importing====

* &apos;&apos;&apos;[http://xataface.com/documentation/how-to/import_filters Import Filters]&apos;&apos;&apos; - It is common to need to import records en masse into a database. This is what import filters are for. (Since 0.7).

====Actions====

* &apos;&apos;&apos;[http://xataface.com/documentation/tutorial/getting_started/dataface_actions Actions I: The Basics]&apos;&apos;&apos; - Web Lite&apos;s actions framework allows you to customize existing actions (e.g. new, edit, find) and create your own new actions. (From the Getting Started Tutorial).
* &apos;&apos;&apos;[http://xataface.com/documentation/how-to/after_action_triggers Adding triggers to actions]&apos;&apos;&apos; -     Xataface 0.6.1 adds some triggers to actions so that the developer can define custom functionality to be performed after an action has successfullly taken place.
* &apos;&apos;&apos;[[Calendar Action]]&apos;&apos;&apos; - Using the built-in calendar action to add a full-fledged event calendar to your application.
* &apos;&apos;&apos;[[Creating a Dashboard]]&apos;&apos;&apos; - Create a dashboard action for your users to so that they have a logical starting point in your application.
* &apos;&apos;&apos;[[Selected Records Actions]]&apos;&apos;&apos; - Create custom actions that are performed on records that have been selected in the list tab.
* &apos;&apos;&apos;[[Creating Printable Reports]]&apos;&apos;&apos; - Create a custom printable report using a custom action.
* &apos;&apos;&apos;[[Using RecordGrid]]&apos;&apos;&apos; - Using Dataface_RecordGrid to print data in tabular form.

====History====

* &apos;&apos;&apos;[http://xataface.com/documentation/how-to/history-howto How to activate history logging]&apos;&apos;&apos; -     Xataface 0.6.9 comes with support for managing the history of your records. This how-to shows you how to enable and use this feature.

====RSS Feeds====

* &apos;&apos;&apos;[[Introduction to RSS Feeds in Xataface]]&apos;&apos;&apos; - Xataface provides RSS feeds to any found set in your application.  This tutorial shows how it works and how you can configure these feeds to get your desired results.

====Event Calendar====

* &apos;&apos;&apos;[[Calendar Action]]&apos;&apos;&apos; - Introduction to the Xataface calendar action which can be used to convert your application into a full-fledged event calendar.
</content>
	<keywords></keywords>
	<language>en</language>
	<original_page>0</original_page>
</wiki></record>