Class to manage tag collections.
More...
|
static | change_sortorder ($tagcoll, $direction) |
| Moves the tag collection in the list one position up or down. More...
|
|
static | cleanup_unused_tags ($collections=null) |
| Permanently deletes all non-standard tags that no longer have any instances pointing to them. More...
|
|
static | cloud_sort ($a, $b) |
| This function is used to sort the tags in the cloud. More...
|
|
static | create ($data) |
| Creates a new tag collection. More...
|
|
static | delete ($tagcoll) |
| Deletes a custom tag collection. More...
|
|
static | display_name ($record) |
| Returns formatted name of the tag collection. More...
|
|
static | get_areas ($tagcollid) |
| Returns all tag areas in the given tag collection. More...
|
|
static | get_areas_names ($tagcollid, $enabledonly=true) |
| Returns the list of names of areas (enabled only) that are in this collection. More...
|
|
static | get_by_id ($tagcollid) |
| Returns the tag collection object. More...
|
|
static | get_collections ($onlysearchable=false) |
| Returns the list of tag collections defined in the system. More...
|
|
static | get_collections_menu ($unlockedonly=false, $onlysearchable=false, $selectalllabel=null) |
| Returns the list of existing tag collections as id=>name. More...
|
|
static | get_default () |
| Returns id of the default tag collection. More...
|
|
static | get_tag_cloud ($tagcollid, $isstandard=false, $limit=150, $sort='name', $search='', $fromctx=0, $ctx=0, $rec=1) |
| Returns the list of tags with number of items tagged. More...
|
|
static | update ($tagcoll, $data) |
| Updates the tag collection information. More...
|
|
Class to manage tag collections.
- Copyright
- 2015 Marina Glancy
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ change_sortorder()
static core_tag_collection::change_sortorder |
( |
|
$tagcoll, |
|
|
|
$direction |
|
) |
| |
|
static |
Moves the tag collection in the list one position up or down.
- Parameters
-
stdClass | $tagcoll | existing record in DB table tag_coll |
int | $direction | move direction: +1 or -1 |
- Return values
-
◆ cleanup_unused_tags()
static core_tag_collection::cleanup_unused_tags |
( |
|
$collections = null | ) |
|
|
static |
Permanently deletes all non-standard tags that no longer have any instances pointing to them.
- Parameters
-
array | $collections | optional list of tag collections ids to cleanup |
◆ cloud_sort()
static core_tag_collection::cloud_sort |
( |
|
$a, |
|
|
|
$b |
|
) |
| |
|
static |
This function is used to sort the tags in the cloud.
- Parameters
-
string | $a | Tag name to compare against $b |
string | $b | Tag name to compare against $a |
- Return values
-
int | The result of the comparison/validation 1, 0 or -1 |
◆ create()
static core_tag_collection::create |
( |
|
$data | ) |
|
|
static |
Creates a new tag collection.
- Parameters
-
stdClass | $data | data from form core_tag_collection_form |
- Return values
-
int|false | id of created tag collection or false if failed |
◆ delete()
static core_tag_collection::delete |
( |
|
$tagcoll | ) |
|
|
static |
Deletes a custom tag collection.
- Parameters
-
stdClass | $tagcoll | existing record in DB table tag_coll |
- Return values
-
bool | wether the tag collection was deleted |
◆ display_name()
static core_tag_collection::display_name |
( |
|
$record | ) |
|
|
static |
Returns formatted name of the tag collection.
- Parameters
-
stdClass | $record | record from DB table tag_coll |
- Return values
-
◆ get_areas()
static core_tag_collection::get_areas |
( |
|
$tagcollid | ) |
|
|
static |
Returns all tag areas in the given tag collection.
- Parameters
-
- Return values
-
◆ get_areas_names()
static core_tag_collection::get_areas_names |
( |
|
$tagcollid, |
|
|
|
$enabledonly = true |
|
) |
| |
|
static |
Returns the list of names of areas (enabled only) that are in this collection.
- Parameters
-
- Return values
-
◆ get_by_id()
static core_tag_collection::get_by_id |
( |
|
$tagcollid | ) |
|
|
static |
Returns the tag collection object.
- Parameters
-
- Return values
-
◆ get_collections()
static core_tag_collection::get_collections |
( |
|
$onlysearchable = false | ) |
|
|
static |
Returns the list of tag collections defined in the system.
- Parameters
-
bool | $onlysearchable | only return collections that can be searched. |
- Return values
-
array | array of objects where each object has properties: id, name, isdefault, itemtypes, sortorder |
◆ get_collections_menu()
static core_tag_collection::get_collections_menu |
( |
|
$unlockedonly = false , |
|
|
|
$onlysearchable = false , |
|
|
|
$selectalllabel = null |
|
) |
| |
|
static |
Returns the list of existing tag collections as id=>name.
- Parameters
-
bool | $unlockedonly | |
bool | $onlysearchable | |
string | $selectalllabel | |
- Return values
-
◆ get_default()
static core_tag_collection::get_default |
( |
| ) |
|
|
static |
Returns id of the default tag collection.
- Return values
-
◆ get_tag_cloud()
static core_tag_collection::get_tag_cloud |
( |
|
$tagcollid, |
|
|
|
$isstandard = false , |
|
|
|
$limit = 150 , |
|
|
|
$sort = 'name' , |
|
|
|
$search = '' , |
|
|
|
$fromctx = 0 , |
|
|
|
$ctx = 0 , |
|
|
|
$rec = 1 |
|
) |
| |
|
static |
Returns the list of tags with number of items tagged.
- Parameters
-
int | $tagcollid | |
null | bool | $isstandard | return only standard tags |
int | $limit | maximum number of tags to retrieve, tags are sorted by the instance count descending here regardless of $sort parameter |
string | $sort | sort order for display, default 'name' - tags will be sorted after they are retrieved |
string | $search | search string |
int | $fromctx | context id where this tag cloud is displayed |
int | $ctx | only retrieve tag instances in this context |
int | $rec | retrieve tag instances in the $ctx context and it's children (default 1) |
- Return values
-
◆ update()
static core_tag_collection::update |
( |
|
$tagcoll, |
|
|
|
$data |
|
) |
| |
|
static |
Updates the tag collection information.
- Parameters
-
stdClass | $tagcoll | existing record in DB table tag_coll |
stdClass | $data | data to update |
- Return values
-
bool | wether the record was updated |
The documentation for this class was generated from the following file: