Commit d0f94f96 authored by Doris Tam's avatar Doris Tam Committed by Robert Lyon

Bug 1824684: Tags for folders and files appearing for non-personal files

Separated the show tags from the user id of who is owning the tags

Also, removed help icon for Institiution tags in the settings as there
was no linked help text for the icon and the existing description
is intuitive enough.

behatnotneeded

Change-Id: I1a980413fbb94fb290ffe21bd832c0a8dafe6756
(cherry picked from commit a8ccbf09)
parent b9398402
......@@ -607,7 +607,6 @@ if ($institution || $add) {
'title' => get_string('allowinstitutiontags'),
'description' => get_string('allowinstitutiontagsdescription'),
'defaultvalue' => $data->tags,
'help' => true,
);
$elements['reviewselfdeletion'] = array(
'type' => 'switchbox',
......
......@@ -22,7 +22,7 @@
*/
use Dwoo\Core;
function PluginListTags(Core $core, $tags, $owner, $view = null) {
function PluginListTags(Core $core, $tags, $owner, $view = null, $showtags = null) {
global $USER;
if (!is_array($tags)) {
return '';
......
......@@ -153,8 +153,9 @@ function pieform_element_filebrowser(Pieform $form, $element) {
$config['pluginname'] = $form->get_property('pluginname');
$config['browsehelp'] = $element['browsehelp'];
}
$config['showtags'] = !empty($config['tag']) ? 1 : 0;
$config['tagsowner'] = !empty($config['tag']) ? (int) $userid : 0;
$config['showtags'] = !empty($config['tag']) ? (int) $userid : 0;
$config['editmeta'] = (int) ($userid && !$config['edit'] && !empty($config['tag']));
$smarty->assign('config', $config);
......@@ -350,7 +351,8 @@ function pieform_element_filebrowser_build_filelist($form, $element, $folder, $h
$selectable = (int) $element['config']['select'];
$selectfolders = (int) !empty($element['config']['selectfolders']);
$publishing = (int) !empty($element['config']['publishing']);
$showtags = !empty($element['config']['tag']) ? (int) $userid : 0;
$showtags = !empty($element['config']['tag']) ? 1 : 0;
$tagsowner = !empty($element['config']['tag']) ? (int) $userid : 0;
$editmeta = (int) ($userid && !$editable && !empty($element['config']['tag']));
$querybase = $element['page'] . (strpos($element['page'], '?') === false ? '?' : '&');
$prefix = $form->get_name() . '_' . $element['name'];
......
......@@ -92,7 +92,7 @@
<div class="tags filetags text-small">
{str tag=tags}:
<span>
{list_tags tags=$file->tags owner=$showtags}
{list_tags tags=$file->tags owner=$tagsowner showtags=$showtags}
</span>
</div>
{/if}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment