Moodle

clean up the public api

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.9, 2.0
  • Fix Version/s: 1.9
  • Component/s: Tags
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE, MOODLE_20_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

The current API for tags isn't optimal. Some operations are done in tag/lib.php, some in blog/lib.php, some in blocks/... This aims to clean up the current API, makit it easier to expend the tags functions in moodle.

I'm sending a first file, containing only documentation and prototypes. I'm trying to come up with something that does the job, but is as minimal as possible.

Missing from this file are:

  • tag_selection_box(...): a function to display the "tag selection box", so that all forms display the same interface to the user (which is currently not the case: user interests and blog posts have different ways of getting tags)
  • tag_get_links(...): a function to return the tags along with the html links to them
  • ...?

Activity

Hide
Mathieu Petit-Clair added a comment -

Petr, to answer your question (and if I understand correctly) - is the tag string case normalised? ... yes it is, I'll be re-using part of the same code as is already in cvs.

Though, while on the subject, I was thinking that it might eventually be an option not to normalize it and let users use whatever they want as tag.

Show
Mathieu Petit-Clair added a comment - Petr, to answer your question (and if I understand correctly) - is the tag string case normalised? ... yes it is, I'll be re-using part of the same code as is already in cvs. Though, while on the subject, I was thinking that it might eventually be an option not to normalize it and let users use whatever they want as tag.
Hide
Mathieu Petit-Clair added a comment -

I'm closing this issue : the public API is now stable. It's possible that changes will be done to "private" functions. More specifically, any function receiving an "array $record" might change to "string $record_type, int $record_id", but there are only very few of them left, and they shouldn't be used outside of the tag library itself.

Show
Mathieu Petit-Clair added a comment - I'm closing this issue : the public API is now stable. It's possible that changes will be done to "private" functions. More specifically, any function receiving an "array $record" might change to "string $record_type, int $record_id", but there are only very few of them left, and they shouldn't be used outside of the tag library itself.

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: