nblgeoweb VIP
Total posts: 178
26 May 2015 17:27

I have a situation where comments (Cobalt built-in) are only viewable by a certain group. The comments are hidden properly when a user is not in that group but the "Comments" title and the RSS icon are still shown. I find that looks odd and confusing to users not in that group. In this case I use comments for administrators to comment on the record so I don't want regular users to even know comments may exist.

In order to hide the title and icon as well, I changed line 71 in views/record/tmpl/default_comments.php from:

<?php if($this->tmpl_params['comment']->get('tmpl_core.comments_title', 1) || $this->tmpl_params['comment']->get('tmpl_core.comments_rss_button', 1)):?>

to:

<?php if(($this->tmpl_params['comment']->get('tmpl_core.comments_title', 1) || $this->tmpl_params['comment']->get('tmpl_core.comments_rss_button', 1)) && in_array($this->item->params->get('comments.comments_access_post', $this->type->params->get('comments.comments_access_post')), $this->user->getAuthorisedViewLevels())):?>

You may want to include something like that in a future release if you think it's appropriate. It looks like you had plans to add template functionality to commenting but it doesn't appear to be fully implemented yet. That would be a handy feature if you ever get the time.

Last Modified: 27 May 2015


Sergey
Total posts: 13,748
27 May 2015 16:26

Thank you. Added it to the next release.

Powered by Cobalt