Commit 52fdee51 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

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

parents 1c6b7d70 a8ccbf09
......@@ -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}
......
Supports Markdown
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