Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions event/main_listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public static function getSubscribedEvents()
'core.posting_modify_template_vars' => 'posting_modify_template_vars',
'core.viewforum_modify_topicrow' => 'viewforum_modify_topicrow',
'robertheim.topictags.viewforum_modify_topicrow' => 'viewforum_modify_topicrow',
'core.search_modify_tpl_ary' => 'search_modify_tpl_ary',
'core.viewtopic_assign_template_vars_before' => 'viewtopic_assign_template_vars_before',
'core.submit_post_end' => 'submit_post_end',
'core.delete_topics_before_query' => 'delete_topics_before_query',
Expand Down Expand Up @@ -356,6 +357,37 @@ public function viewforum_modify_topicrow($event)
}
}
}

public function search_modify_tpl_ary($event)

@RobertHeim RobertHeim Jul 19, 2016

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add documentation. Also, the implementation seems to be redundant (cf. function viewforum_modify_topicrow) and hence should move to its own private function.

{
if ($this->config[prefixes::CONFIG.'_display_tags_in_viewforum'])
{
$data = $event->get_data();

$topic_id = (int) $data['row']['topic_id'];
$forum_id = (int) $data['row']['forum_id'];

if ($this->tags_manager->is_tagging_enabled_in_forum($forum_id))
{
$tags = $this->tags_manager->get_assigned_tags($topic_id);
if (!empty($tags))
{
// we cannot use assign_block_vars('topicrow.tags', ...) here, because the block 'topicrow' is not yet assigned
// add links
$this->assign_tags_to_template('rh_tags_tmp', $tags);
// small_tag.html might want to use our extension's css.
$this->template->assign_var('S_RH_TOPICTAGS_INCLUDE_CSS', true);
$rendered_tags = $this->template->assign_display('@robertheim_topictags/small_tag.html');
// remove temporary data
$this->template->destroy_block_vars('rh_tags_tmp');

// assign the template data
$data['tpl_ary']['RH_TOPICTAGS_TAGS'] = $rendered_tags;
$event->set_data($data);
}
}
}
}

/**
* Assigns the given tags to the template block
Expand Down
5 changes: 4 additions & 1 deletion styles/all/template/event/topiclist_row_append.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<!-- IF topicrow.RH_TOPICTAGS_TAGS -->
{topicrow.RH_TOPICTAGS_TAGS}
<div class="rh_tags-view">{topicrow.RH_TOPICTAGS_TAGS}</div>

@RobertHeim RobertHeim Jul 19, 2016

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why adding wrappers? are they used anywere?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hello i am not able to install on my forum 3.3.0 its showing blank page after enable all forum

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can try again using the master branch (it supports 3.3x.x now)

<!-- ENDIF -->
<!-- IF searchresults.RH_TOPICTAGS_TAGS -->
<div class="rh_tags-search">{searchresults.RH_TOPICTAGS_TAGS}</div>
<!-- ENDIF -->

8 changes: 8 additions & 0 deletions styles/prosilver/theme/rh_topictags.css
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,11 @@ and (max-width : 480px)
display: block;
}
}

dl.row-item {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these ruels should probably be bound to rh_topictags and not change dl/dt in general

background-position: 10px 50%;
background-repeat: no-repeat;
}
dl.row-item dt .list-inner {
padding-left: 45px;
}