Class to manage tag areas.
More...
|
static | allows_tagging_in_multiple_contexts ($component, $itemtype) |
| Checks if the tag area allows items to be tagged in multiple different contexts.
|
|
static | display_name ($component, $itemtype) |
| Returns the display name for this area.
|
|
static | get_areas ($tagcollid=null, $enabledonly=false) |
| Returns the list of areas indexed by itemtype and component.
|
|
static | get_by_id ($tagareaid) |
| Retrieves info about one tag area.
|
|
static | get_collection ($component, $itemtype) |
| Returns the id of the tag collection that should be used for storing tags of this itemtype.
|
|
static | get_showstandard ($component, $itemtype) |
| Returns wether this tag area should display or not standard tags when user edits it.
|
|
static | is_enabled ($component, $itemtype) |
| Returns whether the tag area is enabled.
|
|
static | move_tags ($component, $itemtype, $tagcollid) |
| Moves existing tags associated with an item type to another tag collection.
|
|
static | reset_definitions_for_component ($componentname) |
| Update the database to contain a list of tagged areas for a component.
|
|
static | uninstall ($pluginname) |
| Deletes all tag areas, collections and instances associated with the plugin.
|
|
static | update ($existing, $data) |
| Update the tag area.
|
|
|
static | create ($record) |
| Create a new tag area.
|
|
static | delete ($record) |
| Completely delete a tag area and all instances inside it.
|
|
static | get_definitions_for_component ($componentname) |
| Returns all tag areas and collections that are currently cached in DB for this component.
|
|
Class to manage tag areas.
- Copyright
- 2015 Marina Glancy
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ allows_tagging_in_multiple_contexts()
static core_tag_area::allows_tagging_in_multiple_contexts |
( |
| $component, |
|
|
| $itemtype ) |
|
static |
Checks if the tag area allows items to be tagged in multiple different contexts.
If true then it indicates that not all tag instance contexts must match the context of the item they are tagging. If false then all tag instance should match the context of the item they are tagging.
Example use case for multi-context tagging: A question that exists in a course category context may be used by multiple child courses. The question tag area can allow tag instances to be created in multiple contexts which allows the tag API to tag the question at the course category context and then seperately in each of the child course contexts.
- Parameters
-
string | $component | component responsible for tagging |
string | $itemtype | what is being tagged, for example, 'post', 'course', 'user', etc. |
- Return values
-
◆ create()
static core_tag_area::create |
( |
| $record | ) |
|
|
staticprotected |
Create a new tag area.
- Parameters
-
◆ delete()
static core_tag_area::delete |
( |
| $record | ) |
|
|
staticprotected |
Completely delete a tag area and all instances inside it.
- Parameters
-
◆ display_name()
static core_tag_area::display_name |
( |
| $component, |
|
|
| $itemtype ) |
|
static |
Returns the display name for this area.
- Parameters
-
string | $component | |
string | $itemtype | |
- Return values
-
◆ get_areas()
static core_tag_area::get_areas |
( |
| $tagcollid = null, |
|
|
| $enabledonly = false ) |
|
static |
Returns the list of areas indexed by itemtype and component.
- Parameters
-
int | $tagcollid | return only areas in this tag collection |
bool | $enabledonly | return only enabled tag areas |
- Return values
-
array | itemtype=>component=>tagarea object |
◆ get_by_id()
static core_tag_area::get_by_id |
( |
| $tagareaid | ) |
|
|
static |
Retrieves info about one tag area.
- Parameters
-
- Return values
-
◆ get_collection()
static core_tag_area::get_collection |
( |
| $component, |
|
|
| $itemtype ) |
|
static |
Returns the id of the tag collection that should be used for storing tags of this itemtype.
- Parameters
-
string | $component | component responsible for tagging |
string | $itemtype | what is being tagged, for example, 'post', 'course', 'user', etc. |
- Return values
-
◆ get_definitions_for_component()
static core_tag_area::get_definitions_for_component |
( |
| $componentname | ) |
|
|
staticprotected |
Returns all tag areas and collections that are currently cached in DB for this component.
- Parameters
-
- Return values
-
array | first element is the list of areas and the second list of collections |
◆ get_showstandard()
static core_tag_area::get_showstandard |
( |
| $component, |
|
|
| $itemtype ) |
|
static |
Returns wether this tag area should display or not standard tags when user edits it.
- Parameters
-
string | $component | component responsible for tagging |
string | $itemtype | what is being tagged, for example, 'post', 'course', 'user', etc. |
- Return values
-
◆ is_enabled()
static core_tag_area::is_enabled |
( |
| $component, |
|
|
| $itemtype ) |
|
static |
Returns whether the tag area is enabled.
- Parameters
-
string | $component | component responsible for tagging |
string | $itemtype | what is being tagged, for example, 'post', 'course', 'user', etc. |
- Return values
-
◆ move_tags()
static core_tag_area::move_tags |
( |
| $component, |
|
|
| $itemtype, |
|
|
| $tagcollid ) |
|
static |
Moves existing tags associated with an item type to another tag collection.
- Parameters
-
string | $component | |
string | $itemtype | |
int | $tagcollid | |
◆ reset_definitions_for_component()
static core_tag_area::reset_definitions_for_component |
( |
| $componentname | ) |
|
|
static |
Update the database to contain a list of tagged areas for a component.
The list of tagged areas is read from [plugindir]/db/tag.php
- Parameters
-
string | $componentname | - The frankenstyle component name. |
◆ uninstall()
static core_tag_area::uninstall |
( |
| $pluginname | ) |
|
|
static |
Deletes all tag areas, collections and instances associated with the plugin.
- Parameters
-
◆ update()
static core_tag_area::update |
( |
| $existing, |
|
|
| $data ) |
|
static |
Update the tag area.
- Parameters
-
stdClass | $existing | current record from DB table tag_area |
array | stdClass | $data | fields that need updating |
The documentation for this class was generated from the following file: