Xataface Tagger Module 0.3
Tagging Widget & Tag Cloud component for Xataface
|
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. |
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.
modules_XataJax
Definition at line 32 of file tagger.php.
__construct | ( | ) |
Initializes the tagger module and registers all of the event listener.
Definition at line 47 of file tagger.php.
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.
array | $params | Array 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.
array | $params | Parameters. 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.
array | $params | An 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.
array | $field | A field data structure. |
Definition at line 531 of file tagger.php.
drawTransientTagCloud | ( | $ | field | ) |
Renders a tag cloud for a transient field.
array | $field | A field definition. This definition must define a relationship, be marked transient=1, and be marked tag_cloud=1 |
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.
array | $field | A 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.
array | $fields | Field definition array (from fields.ini file). |
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.
stdClass | $event | An event object. Contains record, field, and out properties. |
Definition at line 147 of file tagger.php.