}
return $this->content;
- } else if (empty($CFG->usetags)) {
+ } else if (!core_tag_tag::is_enabled('core', 'post')) {
$this->content = new stdClass();
$this->content->text = '';
if ($this->page->user_is_editing()) {
WHERE t.id = ti.tagid AND p.id = ti.itemid
$type
AND ti.itemtype = 'post'
+ AND ti.component = 'core'
AND ti.timemodified > $timewithin";
if ($context->contextlevel == CONTEXT_MODULE) {
}
$blogurl->param('tagid', $tag->id);
- $link = html_writer::link($blogurl, tag_display_name($tag), array('class'=>$tag->class, 'title'=>get_string('numberofentries','blog',$tag->ct)));
+ $link = html_writer::link($blogurl, core_tag_tag::make_display_name($tag),
+ array('class' => $tag->class,
+ 'title' => get_string('numberofentries', 'blog', $tag->ct)));
$this->content->text .= '<li>' . $link . '</li> ';
}
$this->content->text .= "\n</ul>\n";
global $CFG, $USER;
//note: do NOT include files at the top of this file
- require_once($CFG->dirroot.'/tag/lib.php');
require_once($CFG->libdir . '/filelib.php');
if ($this->content !== NULL) {
$tagid = optional_param('id', 0, PARAM_INT); // tag id - for backware compatibility
$tag = optional_param('tag', '', PARAM_TAG); // tag
+ $tc = optional_param('tc', 0, PARAM_INT); // Tag collection id.
- if ($tag) {
- $tagobject = tag_get('name', $tag);
- } else if ($tagid) {
- $tagobject = tag_get('id', $tagid);
+ if ($tagid) {
+ $tagobject = core_tag_tag::get($tagid);
+ } else if ($tag) {
+ $tagobject = core_tag_tag::get_by_name($tc, $tag);
}
if (empty($tagobject)) {
//include related tags in the photo query ?
$tagscsv = $tagobject->name;
if (!empty($this->config->includerelatedtags)) {
- $tagscsv .= ',' . tag_get_related_tags_csv(tag_get_related_tags($tagobject->id), TAG_RETURN_TEXT);
+ foreach ($tagobject->get_related_tags() as $t) {
+ $tagscsv .= ',' . $t->get_display_name(false);
+ }
}
$tagscsv = urlencode($tagscsv);
$mform->setType('config_title', PARAM_TEXT);
$mform->addElement('text', 'config_numberofphotos', get_string('numberofphotos', 'block_tag_flickr'), array('size' => 5));
- $mform->setType('config_numberofvideos', PARAM_INT);
+ $mform->setType('config_numberofphotos', PARAM_INT);
$mform->addElement('selectyesno', 'config_includerelatedtags', get_string('includerelatedtags', 'block_tag_flickr'));
$mform->setDefault('config_includerelatedtags', 0);
global $CFG;
//note: do NOT include files at the top of this file
- require_once($CFG->dirroot.'/tag/lib.php');
require_once($CFG->libdir . '/filelib.php');
if ($this->content !== NULL) {
$tagid = optional_param('id', 0, PARAM_INT); // tag id - for backware compatibility
$tag = optional_param('tag', '', PARAM_TAG); // tag
+ $tc = optional_param('tc', 0, PARAM_INT); // Tag collection id.
- if ($tag) {
- $tagobject = tag_get('name', $tag);
- } else if ($tagid) {
- $tagobject = tag_get('id', $tagid);
+ if ($tagid) {
+ $tagobject = core_tag_tag::get($tagid);
+ } else if ($tag) {
+ $tagobject = core_tag_tag::get_by_name($tc, $tag);
}
if (empty($tagobject)) {
$tagid = optional_param('id', 0, PARAM_INT); // tag id - for backware compatibility
$tag = optional_param('tag', '', PARAM_TAG); // tag
+ $tc = optional_param('tc', 0, PARAM_INT); // Tag collection id.
- if ($tag) {
- $tagobject = tag_get('name', $tag);
- } else if ($tagid) {
- $tagobject = tag_get('id', $tagid);
+ if ($tagid) {
+ $tagobject = core_tag_tag::get($tagid);
+ } else if ($tag) {
+ $tagobject = core_tag_tag::get_by_name($tc, $tag);
}
if (empty($tagobject)) {