Commit 551a3576 authored by Robert Lyon's avatar Robert Lyon

Orphaned label sorted out in certain places (Bug #1271778)

- Also includes fix to show profile tagged blogpost in profile block
with correct blog id

Change-Id: I5b6a3b844ad98b8c4bdb3fc02ebc4ae12af32847
Signed-off-by: Robert Lyon's avatarRobert Lyon <robertl@catalyst.net.nz>
parent d694da1a
......@@ -14,23 +14,23 @@
<div id="{$blog.id}_desc" class="detail hidden">{$blog.description|clean_html|safe}</div>
{if $blog.tags}
<div class="tags">
<label>{str tag=tags}:</label> {list_tags owner=0 tags=$blog.tags}
<strong>{str tag=tags}:</strong> {list_tags owner=0 tags=$blog.tags}
</div>
{/if}
<div class="posts">
<label>{str tag=blogpost section=artefact.blog}:</label> <a class="showposts" href="" id="{$blog.id}">{str tag=nposts section=artefact.blog arg1=count($blog.entryposts)}</a>
<strong>{str tag=blogpost section=artefact.blog}:</strong> <a class="showposts" href="" id="{$blog.id}">{str tag=nposts section=artefact.blog arg1=count($blog.entryposts)}</a>
</div>
</div>
<div class="importcolumn importcolumn2">
{if $blog.duplicateditem}
<div class="duplicatedblog">
<label>{str tag=duplicatedblog section=artefact.blog}:</label> <a class="showduplicatedblog" href="" id="{$blog.duplicateditem.id}">{$blog.duplicateditem.title|str_shorten_text:80:true}</a>
<strong>{str tag=duplicatedblog section=artefact.blog}:</strong> <a class="showduplicatedblog" href="" id="{$blog.duplicateditem.id}">{$blog.duplicateditem.title|str_shorten_text:80:true}</a>
<div id="{$blog.duplicateditem.id}_duplicatedblog" class="detail hidden">{$blog.duplicateditem.html|clean_html|safe}</div>
</div>
{/if}
{if $blog.existingitems}
<div class="existingblogs">
<label>{str tag=existingblogs section=artefact.blog}:</label>
<strong>{str tag=existingblogs section=artefact.blog}:</strong>
{foreach from=$blog.existingitems item=existingitem}
<a class="showexistingblog" href="" id="{$existingitem.id}">{$existingitem.title|str_shorten_text:80:true}</a><br>
<div id="{$existingitem.id}_existingblog" class="detail hidden">{$existingitem.html|clean_html|safe}</div>
......@@ -99,13 +99,13 @@
<div class="importcolumn importcolumn2">
{if $post.duplicateditem}
<div class="duplicatedpost">
<label>{str tag=duplicatedpost section=artefact.blog}:</label> <a class="showduplicatedpost" href="" id="{$post.duplicateditem.id}">{$post.duplicateditem.title|str_shorten_text:80:true}</a>
<strong>{str tag=duplicatedpost section=artefact.blog}:</strong> <a class="showduplicatedpost" href="" id="{$post.duplicateditem.id}">{$post.duplicateditem.title|str_shorten_text:80:true}</a>
<div id="{$post.duplicateditem.id}_duplicatedpost" class="detail hidden">{$post.duplicateditem.html|clean_html|safe}</div>
</div>
{/if}
{if $post.existingitems}
<div class="existingposts">
<label>{str tag=existingposts section=artefact.blog}:</label>
<strong>{str tag=existingposts section=artefact.blog}:</strong>
{foreach from=$post.existingitems item=existingitem}
<a class="showexistingpost" href="" id="{$existingitem.id}">{$existingitem.title|str_shorten_text:80:true}</a><br>
<div id="{$existingitem.id}_existingpost" class="detail hidden">{$existingitem.html|clean_html|safe}</div>
......
......@@ -56,7 +56,7 @@
{else}
{strip}
{foreach $item->attachments item=a name=attachments}
{if $.foreach.attachments.first}<label>{str tag=Attachments section=artefact.comment}:</label>{else},{/if} <span class="attachment"><a href="{$WWWROOT}artefact/file/download.php?file={$a->attachid}&comment={$item->id}&view={$viewid}">{$a->attachtitle}</a> <span class="attachsize">({$a->attachsize})</span></span>
{if $.foreach.attachments.first}<strong>{str tag=Attachments section=artefact.comment}:</strong>{else},{/if} <span class="attachment"><a href="{$WWWROOT}artefact/file/download.php?file={$a->attachid}&comment={$item->id}&view={$viewid}">{$a->attachtitle}</a> <span class="attachsize">({$a->attachsize})</span></span>
{/foreach}
{/strip}
{/if}</div>
......
......@@ -4,16 +4,16 @@
<h5>{$file->get('title')}</h5>
{if $zipinfo}
<p>
<span><label>{str tag=Files section=artefact.file}:</label> {$zipinfo->files}&nbsp;</span>
<span><label>{str tag=Folders section=artefact.file}:</label> {$zipinfo->folders}</span>
<span><label>{str tag=spacerequired section=artefact.file}:</label> {$zipinfo->displaysize}</span>
<span><strong>{str tag=Files section=artefact.file}:</strong> {$zipinfo->files}&nbsp;</span>
<span><strong>{str tag=Folders section=artefact.file}:</strong> {$zipinfo->folders}</span>
<span><strong>{str tag=spacerequired section=artefact.file}:</strong> {$zipinfo->displaysize}</span>
</p>
{/if}
<p>{$message}</p>
{if $zipinfo}
{$form|safe}
<p>
<div><label>{str tag=Contents section=artefact.file}:</label></div>
<div><strong>{str tag=Contents section=artefact.file}:</strong></div>
{foreach from=$zipinfo->names item=name}
<div>{$name}</div>
{/foreach}
......
......@@ -9,17 +9,17 @@
</th>
</tr>
<tr class="required">
<th><label>{str tag=name}</label> <span class="requiredmarker">*</span></th>
<th><label for="{$prefix}_edit_title">{str tag=name}</label> <span class="requiredmarker">*</span></th>
<td><input type="text" class="text" name="{$prefix}_edit_title" id="{$prefix}_edit_title" value="{$fileinfo->title}" size="40" /></td>
</tr>
{if $fileinfo->artefacttype != 'profileicon'}
<tr>
<th><label>{str tag=description}</label></th>
<th><label for="{$prefix}_edit_description">{str tag=description}</label></th>
<td><input type="text" class="text" name="{$prefix}_edit_description" id="{$prefix}_edit_description" value="{$fileinfo->description}" size="40" /></td>
</tr>
{/if}
<tr class="tags">
<th><label>{str tag=tags}</label></th>
<th><label for="{$prefix}_edit_tags">{str tag=tags}</label></th>
<td>
<input name="{$prefix}_edit_tags" size="40" id="{$prefix}_edit_tags" value="{foreach from=$fileinfo->tags item=tag name=tags}{if !$.foreach.tags.first}, {/if}{$tag}{/foreach}" />
<span>{contextualhelp plugintype='artefact' pluginname='file' section='tags'}</span>
......@@ -31,7 +31,7 @@
</tr>
{if $groupinfo}
<tr>
<th><label>{str tag=Permissions}</label></th>
<th><strong>{str tag=Permissions}</strong></th>
<td>
<table class="editpermissions">
<tbody>
......@@ -46,9 +46,11 @@
<td>{$role->display}</td>
{foreach from=$groupinfo.perm item=whocares key=permid}
{if $fileinfo}
<td><input type="checkbox" class="permission" name="{$prefix}_permission:{$r}:{$permid}"{if $fileinfo->permissions.$r.$permid} checked{/if}{if $r == 'admin'} disabled{/if} /></td>
<td><label for="{$prefix}_permission_{$r}_{$permid}">{str tag=changerolepermissions section=group arg1=$permid arg2=$r}</label>
<input type="checkbox" class="permission" id="{$prefix}_permission_{$r}_{$permid}" name="{$prefix}_permission:{$r}:{$permid}"{if $fileinfo->permissions.$r.$permid} checked{/if}{if $r == 'admin'} disabled{/if} /></td>
{else}
<td><input type="checkbox" class="permission" name="{$prefix}_permission:{$r}:{$permid}" {if $r == 'admin'} checked disabled{/if}/></td>
<td><label for="{$prefix}_permission_{$r}_{$permid}">{str tag=changerolepermissions section=group arg1=$permid arg2=$r}</label>
<input type="checkbox" class="permission" id="{$prefix}_permission_{$r}_{$permid}" name="{$prefix}_permission:{$r}:{$permid}" {if $r == 'admin'} checked disabled{/if}/></td>
{/if}
{/foreach}
</tr>
......@@ -60,7 +62,7 @@
{/if}
{license_form_files($prefix, 'edit')}
<tr>
<th><label>{str tag=allowcomments section=artefact.comment}</label></th>
<th><label for="{$prefix}_edit_allowcomments">{str tag=allowcomments section=artefact.comment}</label></th>
<td><input type="checkbox" name="{$prefix}_edit_allowcomments" id="{$prefix}_edit_allowcomments" {if $fileinfo->allowcomments}checked {/if}/></td>
</tr>
<tr>
......
......@@ -45,7 +45,7 @@
<div id="{$prefix}_upload_messages"></div>
{if $config.uploadagreement}
<div id="{$prefix}_agreement" class="uploadform">
<label>{str tag='uploadfile' section='artefact.file'}</label>
<label for="{$prefix}_notice">{str tag='uploadfile' section='artefact.file'}</label>
<input type="checkbox" name="{$prefix}_notice" id="{$prefix}_notice" />
{$agreementtext|clean_html|safe}
</div>
......
......@@ -30,7 +30,7 @@
{if !$file->isparent}
{if $editable}
<div class="icon-drag" id="drag:{$file->id}" tabindex="0">
<img src="{$file->icon}" title="{str tag=clickanddragtomovefile section=artefact.file arg1=$file->title}">
<img src="{$file->icon}" title="{str tag=clickanddragtomovefile section=artefact.file arg1=$file->title}" alt="{$file->title}">
</div>
{else}
<img src="{$file->icon}">
......
......@@ -19,7 +19,7 @@
{/if}
{if $file.tags}
<div class="tags">
<label>{str tag=tags}:</label> {list_tags owner=0 tags=$file.tags}
<strong>{str tag=tags}:</strong> {list_tags owner=0 tags=$file.tags}
</div>
{/if}
</div>
......
{if $tags}<p class="tags s"><label>{str tag=tags}:</label> {list_tags owner=$owner tags=$tags}</p>{/if}
{if $tags}<p class="tags s"><strong>{str tag=tags}:</strong> {list_tags owner=$owner tags=$tags}</p>{/if}
{if $tasks.data}
<table id="tasktable_{$blockid}" class="plansblocktable fullwidth">
<thead>
......
......@@ -14,11 +14,11 @@
<div id="{$plan.id}_desc" class="detail hidden">{$plan.description|clean_html|safe}</div>
{if $plan.tags}
<div class="tags">
<label>{str tag=tags}:</label> {list_tags owner=0 tags=$plan.tags}
<strong>{str tag=tags}:</strong> {list_tags owner=0 tags=$plan.tags}
</div>
{/if}
<div class="tasks">
<label>{str tag=tasks section=artefact.plans}:</label>
<strong>{str tag=tasks section=artefact.plans}:</strong>
{if count($plan.entrytasks)}<a class="showtasks" href="" id="{$plan.id}">{/if}
{str tag=ntasks section=artefact.plans arg1=count($plan.entrytasks)}
{if count($plan.entrytasks)}</a>{/if}
......@@ -27,13 +27,13 @@
<div class="importcolumn importcolumn2">
{if $plan.duplicateditem}
<div class="duplicatedplan">
<label>{str tag=duplicatedplan section=artefact.plans}:</label> <a class="showduplicatedplan" href="" id="{$plan.duplicateditem.id}">{$plan.duplicateditem.title|str_shorten_text:80:true}</a>
<strong>{str tag=duplicatedplan section=artefact.plans}:</strong> <a class="showduplicatedplan" href="" id="{$plan.duplicateditem.id}">{$plan.duplicateditem.title|str_shorten_text:80:true}</a>
<div id="{$plan.duplicateditem.id}_duplicatedplan" class="detail hidden">{$plan.duplicateditem.html|clean_html|safe}</div>
</div>
{/if}
{if $plan.existingitems}
<div class="existingplans">
<label>{str tag=existingplans section=artefact.plans}:</label>
<strong>{str tag=existingplans section=artefact.plans}:</strong>
{foreach from=$plan.existingitems item=existingitem}
<a class="showexistingplan" href="" id="{$existingitem.id}">{$existingitem.title|str_shorten_text:80:true}</a><br>
<div id="{$existingitem.id}_existingplan" class="detail hidden">{$existingitem.html|clean_html|safe}</div>
......@@ -59,7 +59,7 @@
<div id="{$task.id}_desc" class="detail hidden">
{$task.description|clean_html|safe}
</div>
<div class="completiondate"><label>{str tag='completiondate' section='artefact.plans'}:</label> {$task.completiondate}</div>
<div class="completiondate"><strong>{str tag='completiondate' section='artefact.plans'}:</strong> {$task.completiondate}</div>
{if $task.completed == 1}<div class="completed">{str tag=completed section=artefact.plans}</div>{/if}
</div>
<div class="importcolumn importcolumn2">
......
......@@ -3,7 +3,7 @@
<div class="rbuttons">
<a class="btn" href="{$WWWROOT}artefact/plans/new.php?id={$plan}">{str section="artefact.plans" tag="newtask"}</a>
</div>
{if $tags}<p class="tags s"><label>{str tag=tags}:</label> {list_tags owner=$owner tags=$tags}</p>{/if}
{if $tags}<p class="tags s"><strong>{str tag=tags}:</strong> {list_tags owner=$owner tags=$tags}</p>{/if}
{if !$tasks.data}
<div>{$planstasksdescription}</div>
<div class="message">{$strnotasksaddone|safe}</div>
......
{if $tags}<p class="tags s"><label>{str tag=tags}:</label> {list_tags owner=$owner tags=$tags}</p>{/if}
{if $tags}<p class="tags s"><strong>{str tag=tags}:</strong> {list_tags owner=$owner tags=$tags}</p>{/if}
<table id="tasktable">
<thead>
<tr>
......
......@@ -19,13 +19,13 @@
<div class="importcolumn importcolumn2">
{if $fieldvalue.duplicateditem}
<div class="duplicatedpfield">
<label>{str tag=duplicatedresumefieldvalue section=artefact.resume}:</label>
<strong>{str tag=duplicatedresumefieldvalue section=artefact.resume}:</strong>
<div id="{$fieldvalue.duplicateditem.id}_duplicatedpfield" class="detail">{$fieldvalue.duplicateditem.html|clean_html|safe}</div>
</div>
{/if}
{if $fieldvalue.existingitems}
<div class="existingpfields">
<label>{str tag=existingresumefieldvalues section=artefact.resume}:</label>
<strong>{str tag=existingresumefieldvalues section=artefact.resume}:</strong>
{foreach from=$fieldvalue.existingitems item=existingitem}
<div id="{$existingitem.id}_existingresumefield" class="detail">{$existingitem.html|clean_html|safe}</div>
{/foreach}
......
......@@ -1282,7 +1282,7 @@ function auth_get_login_form_elements() {
if (!empty($extraelements) && $showbasicform) {
$loginlabel = array(
'type' => 'markup',
'value' => '<label>'.get_string('orloginvia') . '</label>'
'value' => '<strong>'.get_string('orloginvia') . '</strong>'
);
$extraelements = array_merge(array('label' => $loginlabel), $extraelements);
$keys = array_keys($extraelements);
......
......@@ -9,7 +9,7 @@
{/if}
<h4 class="title"><a href="{$view.fullurl}">{$view.title}</a></h4>
<div class="detail">{$view.description|str_shorten_html:100:true|strip_tags|safe}</div>
{if $view.tags}<div class="tags"><label>{str tag=tags}:</label> {list_tags owner=$view.owner tags=$view.tags}</div>{/if}
{if $view.tags}<div class="tags"><strong>{str tag=tags}:</strong> {list_tags owner=$view.owner tags=$view.tags}</div>{/if}
</div>
{/foreach}
</div>
......
......@@ -15,7 +15,7 @@
</h4>
<div class="detail">{$collection.description|str_shorten_html:100:true|strip_tags|safe}</div>
{if $collection.tags}
<div class="tags"><label>{str tag=tags}:</label> {list_tags owner=$collection.owner tags=$collection.tags}</div>
<div class="tags"><strong>{str tag=tags}:</strong> {list_tags owner=$collection.owner tags=$collection.tags}</div>
{/if}
</div>
{/foreach}
......@@ -18,7 +18,7 @@
</h4>
<div class="detail">{$view.description|str_shorten_html:100:true|strip_tags|safe}</div>
{if $view.tags}
<div class="tags"><label>{str tag=tags}:</label> {list_tags owner=$view.owner tags=$view.tags}</div>
<div class="tags"><strong>{str tag=tags}:</strong> {list_tags owner=$view.owner tags=$view.tags}</div>
{/if}
</div>
{/foreach}
......@@ -7,7 +7,7 @@
<div class="detail">{$item.description|str_shorten_html:100:true|strip_tags|safe}</div>
{/if}
{if $item.tags}
<div class="tags"><label>{str tag=tags}:</label> {list_tags owner=$item.owner tags=$item.tags}</div>
<div class="tags"><strong>{str tag=tags}:</strong> {list_tags owner=$item.owner tags=$item.tags}</div>
{/if}
</div>
{/foreach}
......
......@@ -51,7 +51,7 @@
<div class="message">{str tag=noforums section=interaction.forum}</div>
{/if}
<div class="forummods">
<label>{str tag="groupadminlist" section="interaction.forum"}</label>
<strong>{str tag="groupadminlist" section="interaction.forum"}</strong>
{foreach from=$groupadmins item=groupadmin}
<span class="inlinelist">
<a href="{profile_url($groupadmin)}" class="groupadmin"><img src="{profile_icon_url user=$groupadmin maxheight=20 maxwidth=20}" alt="{str tag=profileimagetext arg1=$groupadmin|display_default_name}"> {$groupadmin|display_name}</a>
......
......@@ -67,7 +67,7 @@
</div>
<div class="forumfooter">
<label>{str tag="groupadminlist" section="interaction.forum"}</label>
<strong>{str tag="groupadminlist" section="interaction.forum"}</strong>
{foreach from=$groupadmins item=groupadmin}
<span class="s inlinelist">
<a href="{profile_url($groupadmin)}"><img src="{$WWWROOT}thumb.php?type=profileicon&amp;maxsize=20&amp;id={$groupadmin}" alt="{str tag=profileimagetext arg1=$groupadmin|display_default_name}"></a>
......@@ -76,7 +76,7 @@
{/foreach}
{if $moderators}
<div>
<label>{str tag="moderatorslist" section="interaction.forum"}</label>
<strong>{str tag="moderatorslist" section="interaction.forum"}</strong>
{foreach from=$moderators item=mod}
<span class="s inlinelist">
<a href="{profile_url($mod)}"><img src="{$WWWROOT}thumb.php?type=profileicon&amp;maxsize=20&amp;id={$mod}" alt=""></a>
......
......@@ -345,6 +345,7 @@ $string['title'] = 'Title';
$string['Role'] = 'Role';
$string['changerole'] = 'Change role';
$string['changeroleofuseringroup'] = 'Change role of %s in %s';
$string['changerolepermissions'] = 'Change %s role for %s';
$string['currentrole'] = 'Current role';
$string['changerolefromto'] = 'Change role from %s to';
$string['rolechanged'] = 'Role changed';
......
......@@ -45,6 +45,7 @@ $string['Help'] = 'Help';
$string['closehelp'] = 'Close help';
$string['applychanges'] = 'Apply changes';
$string['general'] = 'General';
$string['units'] = 'Units';
// Objectionable strings.
$string['complaint'] = 'Complaint';
$string['notifyadministrator'] = 'Notify administrator';
......@@ -168,6 +169,7 @@ $string['resultsperpage'] = 'Results per page';
// License metadata
$string['license'] = 'License';
$string['licenseother'] = 'Other license (enter URL)';
$string['licenseotherurl'] = 'Enter URL';
$string['licensedesc'] = 'The license for this content.';
$string['licensenone'] = 'None selected';
$string['licensenonedetailed'] = '%s has not chosen a license for this content.';
......@@ -561,8 +563,10 @@ $string['noenddate'] = 'No end date';
$string['day'] = 'day';
$string['days'] = 'days';
$string['weeks'] = 'weeks';
$string['month'] = 'month';
$string['months'] = 'months';
$string['years'] = 'years';
$string['year'] = 'year';
// Boolean site option
// Site content pages
......@@ -689,6 +693,7 @@ $string['addemail'] = 'Add email address';
// Search
$string['search'] = 'Search';
$string['searchtype'] = 'Search type';
$string['searchusers'] = 'Search users';
$string['Query'] = 'Search';
$string['query'] = 'Search';
......
......@@ -52,6 +52,7 @@ function pieform_element_emaillist(Pieform $form, $element) {
$smarty->assign('default', $value['default']);
}
$smarty->assign('form', $form->get_name());
$smarty->assign('name', $element['name']);
$smarty->assign('title', $element['title']);
$smarty->assign('addbuttonstr', get_string('addbutton', 'artefact.internal'));
......
......@@ -2785,6 +2785,14 @@ function profile_sideblock() {
ORDER BY a.title',
array(get_string('profile'), $USER->get('id'))
);
if (!empty($data['artefacts'])) {
// check if we have any blogposts and fetch their blog id if we do
foreach ($data['artefacts'] as $key => $value) {
if ($value->artefacttype == 'blogpost') {
$value->blogid = get_field('artefact', 'parent', 'id', $value->id);
}
}
}
return $data;
}
......
......@@ -1035,20 +1035,25 @@ EOF;
* Element IDs are used for <label>s, so use this method to ensure that
* an element gets an ID.
*
* The element's existing 'id' and 'name' attributes are checked first. If
* they are not specified, a random ID is created
* The element is assigned a random ID. Then overridden by 'name' and/or 'id'
* if they are specified. If formname is required this is prepended to the string.
*
* @param array $element The element to make an ID for
* @param bool Add the form name to the element ID string
* @return string The ID for the element
*/
public function make_id($element) {/*{{{*/
public function make_id($element, $formname = false) {/*{{{*/
$elementid = 'a' . substr(md5(mt_rand()), 0, 4);
if (isset($element['name'])) {
$elementid = self::hsc($element['name']);
}
if (isset($element['id'])) {
return self::hsc($element['id']);
$elementid = self::hsc($element['id']);
}
if (isset($element['name'])) {
return self::hsc($element['name']);
if ($formname) {
$elementid = $this->name . '_' . $elementid;
}
return 'a' . substr(md5(mt_rand()), 0, 4);
return $elementid;
}/*}}}*/
/**
......@@ -1447,9 +1452,10 @@ EOF;
else {
$labelclass = '';
}
if (!empty($element['nolabel'])) {
// Don't bother with a label for the element
$nolabeltypes = array('radio', 'emaillist', 'date', 'files', 'checkboxes');
if (!empty($element['nolabel']) || in_array($element['type'], $nolabeltypes)) {
// Don't bother with a label for the element.
// Special 'nolabeltypes' have their own label(s) added direct to the form field(s).
$element['labelhtml'] = $title . $requiredmarker;
}
else {
......
......@@ -73,8 +73,8 @@ function pieform_element_bytes(Pieform $form, $element) {/*{{{*/
$numberinput .= ' aria-describedby="' . $form->element_descriptors($element) . '"';
}
$numberinput .= ">\n";
$uselect = '<select name="' . $name . '_units" id="' . $formname . '_' . $name . '_units"' . ' tabindex="' . Pieform::hsc($element['tabindex']) . '"';
$uselect = '<label for="' . $formname . '_' . $name . '_units" class="accessible-hidden">' . get_string('units') . '</label>';
$uselect .= '<select name="' . $name . '_units" id="' . $formname . '_' . $name . '_units"' . ' tabindex="' . Pieform::hsc($element['tabindex']) . '"';
if (isset($element['description'])) {
$uselect .= ' aria-describedby="' . $form->element_descriptors($element) . '"';
}
......
......@@ -77,7 +77,8 @@ EOF;
// Year
$value = pieform_element_date_get_timeperiod_value('year', $element['minyear'], $element['maxyear'], $element, $form);
$year = '<select name="' . $name . '_year" id="' . $name . '_year"'
$year = '<label for="' . $name . '_year" class="accessible-hidden">' . get_string('year') . '</label>';
$year .= '<select name="' . $name . '_year" id="' . $name . '_year"'
. (!$required && !$dateisset ? ' disabled="disabled"' : '')
. ' tabindex="' . Pieform::hsc($element['tabindex']) . '"';
if (isset($element['description'])) {
......@@ -91,7 +92,8 @@ EOF;
// Month
$value = pieform_element_date_get_timeperiod_value('month', 1, 12, $element, $form);
$month = '<select name="' . $name . '_month" id="' . $name . '_month"'
$month = '<label for="' . $name . '_month" class="accessible-hidden">' . get_string('month') . '</label>';
$month .= '<select name="' . $name . '_month" id="' . $name . '_month"'
. (!$required && !$dateisset ? ' disabled="disabled"' : '')
. ' tabindex="' . Pieform::hsc($element['tabindex']) . '"';
if (isset($element['description'])) {
......@@ -106,7 +108,8 @@ EOF;
// Day
$value = pieform_element_date_get_timeperiod_value('day', 1, 31, $element, $form);
$day = '<select name="' . $name . '_day" id="' . $name . '_day"'
$day = '<label for="' . $name . '_day" class="accessible-hidden">' . get_string('day') . '</label>';
$day .= '<select name="' . $name . '_day" id="' . $name . '_day"'
. (!$required && !$dateisset ? ' disabled="disabled"' : '')
. ' tabindex="' . Pieform::hsc($element['tabindex']) . '"';
if (isset($element['description'])) {
......
......@@ -73,8 +73,8 @@ function pieform_element_expiry(Pieform $form, $element) {/*{{{*/
$numberinput .= ' aria-describedby="' . $form->element_descriptors($element) . '"';
}
$numberinput .= (isset($element['error']) ? ' class="error"' : '') . ">\n";
$uselect = '<select onchange="' . $name . '_change()" ';
$uselect = '<label for="' . $formname . '_' . $name . '_units" class="accessible-hidden">' . get_string('units', 'mahara') . '</label>';
$uselect .= '<select onchange="' . $name . '_change()" ';
$uselect .= 'name="' . $name . '_units" id="' . $formname . '_' . $name . '_units"' . ' tabindex="' . Pieform::hsc($element['tabindex']) . '"';
if (isset($element['description'])) {
$uselect .= ' aria-describedby="' . $form->element_descriptors($element) . '"';
......
......@@ -55,7 +55,8 @@ function pieform_element_select(Pieform $form, $element) {
if (is_array($value)) {
$value = $value['value'];
}
$result = Pieform::hsc($value) . '<input type="hidden" name="' . Pieform::hsc($element['name']) . '" value="' . Pieform::hsc($key) . '">';
$result = Pieform::hsc($value) . '<input type="hidden" id="' . $form->make_id($element, true) . '" name="' . Pieform::hsc($element['name']) . '" value="' . Pieform::hsc($key) . '">';
}
return $result;
}
......@@ -116,7 +117,8 @@ function pieform_element_select(Pieform $form, $element) {
$other_attrib['class'] = 'hidden';
$other_value = '';
}
$result .= '<input type="text"'
$result .= '<label for="' . $element['id'] . '_other" class="accessible-hidden">' . get_string('licenseotherurl') . '</label>'
. '<input type="text"'
. $form->element_attributes($other_attrib)
. $other_value
. ">\n";
......
......@@ -4217,7 +4217,7 @@ class View {
);
if ($collectiondata) {
View::get_extra_collection_info($collectiondata, false);
View::get_extra_collection_info($collectiondata);
}
else {
$collectiondata = array();
......@@ -4346,7 +4346,7 @@ class View {
* @param array a list of collections $collectiondata
* @return array updated collection data
*/
public static function get_extra_collection_info(&$collectiondata) {
public static function get_extra_collection_info(&$collectiondata, $gettags=true) {
if ($collectiondata) {
// Get view owner details for display
$owners = array();
......@@ -4363,7 +4363,15 @@ class View {
$institutions[$c->institution] = $c->institution;
}
}
if ($gettags) {
$collectionidlist = join(',', array_map('intval', array_keys($collectiondata)));
$tags = get_records_select_array('collection_tag', 'collection IN (' . $collectionidlist . ')');
if ($tags) {
foreach ($tags as &$tag) {
$collectiondata[$tag->collection]->tags[] = $tag->tag;
}
}
}
if (!empty($owners)) {
global $USER;
$userid = $USER->get('id');
......
......@@ -80,6 +80,8 @@ $searchform = array(
$searchform['elements']['query'] = array(
'type' => 'text',
'defaultvalue' => $query,
'title' => get_string('pagetitle', 'search.elasticsearch'),
'hiddenlabel' => true,
);
$searchform['elements']['submit'] = array(
'type' => 'submit',
......@@ -88,7 +90,7 @@ $searchform['elements']['submit'] = array(
$searchform['elements']['tagsonly'] = array(
'type' => 'checkbox',
'value' => (isset($options['tagsonly']) && $options['tagsonly'] == true) ? true : false,
'posthtml' => get_string('tagsonly', 'search.elasticsearch'),
'title' => get_string('tagsonly', 'search.elasticsearch'),
);
$searchform = pieform($searchform);
......
......@@ -36,7 +36,7 @@
{if $record->views|count gt 0}
<div class="usedon">
{if $record->views|count gt 1}
<label>{str tag=usedonpages section=search.elasticsearch}:</label>
<strong>{str tag=usedonpages section=search.elasticsearch}:</strong>
<ul>
{foreach from=$record->views key=id item=view}
<li><a href="{$WWWROOT}view/view.php?id={$id}">{$view|str_shorten_html:50:true|safe}</a>
......@@ -63,7 +63,7 @@
{/foreach}
</ul>
{else}
<label>{str tag=usedonpage section=search.elasticsearch}:</label>
<strong>{str tag=usedonpage section=search.elasticsearch}:</strong>
<ul>
{foreach from=$record->views key=id item=view}
<li><a href="{$WWWROOT}view/view.php?id={$id}">{$view|str_shorten_html:50:true|safe}</a>
......@@ -95,7 +95,7 @@
<!-- end VIEWS -->
<!-- TAGS -->
{if $record->tags|count gt 0}
<div class="tags"><label>{str tag=tags section=search.elasticsearch}:</label>
<div class="tags"><strong>{str tag=tags section=search.elasticsearch}:</strong>
{foreach from=$record->tags item=tag name=tags}
<a href="{$WWWROOT}search/elasticsearch/index.php?query={$tag}&tagsonly=true">{$tag}</a>{if !$.foreach.tags.last}, {/if}
{/foreach}
......
......@@ -6,7 +6,7 @@
<div class="createdby">{str tag=createdby section=search.elasticsearch arg1='<a href="`$record->createdby|profile_url}">`$record->createdbyname|safe`</a>'}</div>
{/if}
<div class="detail">{$record->description|str_shorten_html:140:true|safe}</div>
<div class="tags"><label>{str tag=pages section=search.elasticsearch}:</label>