Xataface Tagger Module 0.3
Tagging Widget & Tag Cloud component for Xataface
Public Member Functions
modules_tagger Class Reference

A module to add a "tagger" widget to Xataface. This allows many-to-many relationships to be edited on the edit form of the source record in a simple tag-like environment. More...

Public Member Functions

 __construct ()
 Initializes the tagger module and registers all of the event listener.
 getBaseURL ()
 Returns the base URL to this module's directory. Useful for including Javascripts and CSS.
 getLabelColumn ($field)
 Returns the name of the column that we are using for the label of a tag for a given field.
 initField ($event)
 Handler for the initTransientField event. This loads the tags into a transient field for the first time.
 beforeSave ($params)
 Handler for beforeSave event. Basically tallies up all of the tagger fields that need to be processed.
 afterSave ($params)
 Handler for the afterSave() event. This goes through all changed tagger fields and saves any changes to the database.
 block__after_form_open_tag ($params=array())
 Fills the after_form_open_tag block to add tagger javascripts to the form appropriately.
 getTagCloudFields ($fields)
 Returns the subset of fields input that are marked as tag cloud fields. Fields that are marked with tag_cloud=1 in the fields.ini file are considered to be tag cloud fields.
 drawTransientTagCloud ($field)
 Renders a tag cloud for a transient field.
 drawScalarTagCloud ($field)
 drawTagCloud ($field)
 Draws a tag cloud for the specified field.
 block__after_left_column ()
 A block that draws the tag clouds for the current table.

Detailed Description

A module to add a "tagger" widget to Xataface. This allows many-to-many relationships to be edited on the edit form of the source record in a simple tag-like environment.

See also:
Dataface_FormTool_tagger For the actual widget building definition.

modules_XataJax

Definition at line 32 of file tagger.php.


Constructor & Destructor Documentation

__construct ( )

Initializes the tagger module and registers all of the event listener.

Definition at line 47 of file tagger.php.


Member Function Documentation

afterSave ( params)

Handler for the afterSave() event. This goes through all changed tagger fields and saves any changes to the database.

The tagger works by going through all of the related records in relationship marked in the tagger field, and adding any related records that haven't been previously added and removing ones that have been removed.

This works similar to the checkbox widget on transient fields.

Parameters:
array$paramsArray of parameters. First element is the record, 2nd element is the IO object.

Definition at line 221 of file tagger.php.

beforeSave ( params)

Handler for beforeSave event. Basically tallies up all of the tagger fields that need to be processed.

Parameters:
array$paramsParameters. First element is the record, 2nd element is the IO object.

Definition at line 185 of file tagger.php.

block__after_form_open_tag ( params = array())

Fills the after_form_open_tag block to add tagger javascripts to the form appropriately.

Parameters:
array$paramsAn associative array of the Smarty tag parameters. This block expects at least the following data structure:
 array(
     'form' => <array> // The form data structure as passed to the Dataface_Form_Template.html template
 )

Definition at line 421 of file tagger.php.

block__after_left_column ( )

A block that draws the tag clouds for the current table.

Definition at line 543 of file tagger.php.

drawScalarTagCloud ( field)

Definition at line 519 of file tagger.php.

drawTagCloud ( field)

Draws a tag cloud for the specified field.

Parameters:
array$fieldA field data structure.
Returns:
void
See also:
drawScalarTagCloud()'
drawTransientTagCloud()

Definition at line 531 of file tagger.php.

drawTransientTagCloud ( field)

Renders a tag cloud for a transient field.

Parameters:
array$fieldA field definition. This definition must define a relationship, be marked transient=1, and be marked tag_cloud=1
Returns:
void
See also:
getTagCloudFields()
drawScalarTagCloud()

Definition at line 472 of file tagger.php.

getBaseURL ( )

Returns the base URL to this module's directory. Useful for including Javascripts and CSS.

Definition at line 85 of file tagger.php.

getLabelColumn ( field)

Returns the name of the column that we are using for the label of a tag for a given field.

Parameters:
array$fieldA Xataface field definition array.

Definition at line 102 of file tagger.php.

getTagCloudFields ( fields)

Returns the subset of fields input that are marked as tag cloud fields. Fields that are marked with tag_cloud=1 in the fields.ini file are considered to be tag cloud fields.

Parameters:
array$fieldsField definition array (from fields.ini file).
Returns:
array All of the field definitions that have tag_cloud=1
See also:
Dataface_Table::fields()

Definition at line 449 of file tagger.php.

initField ( event)

Handler for the initTransientField event. This loads the tags into a transient field for the first time.

Parameters:
stdClass$eventAn event object. Contains record, field, and out properties.
Returns:
void

Definition at line 147 of file tagger.php.


The documentation for this class was generated from the following file:
 All Data Structures Files Functions