Commit efd2c596 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Changes to searchresulttable.tpl template



Change column configuration to use a 'sort' option instead of 'nosort'
Allow columns to specify html to appear in the column header

Change-Id: I87fbaef7e4358856a499f9ccf4a2d8591f70f3e4
Signed-off-by: default avatarRichard Mansfield <richard.mansfield@catalyst.net.nz>
parent be8d1398
......@@ -279,14 +279,27 @@ function build_admin_user_search_results($search, $offset, $limit, $sortby, $sor
. '{if $USER->is_admin_for_user($r.id)}admin/users/edit.php?id={$r.id}{else}user/view.php?id={$r.id}{/if}">{$r.username}</a>';
$cols = array(
'icon' => array('name' => '',
'template' => '<img src="{profile_icon_url user=$r maxwidth=40 maxheight=40}" alt="' . get_string('profileimage') . '" />',
'class' => 'center'),
'firstname' => array('name' => get_string('firstname')),
'lastname' => array('name' => get_string('lastname')),
'username' => array('name' => get_string('username'),
'template' => $usernametemplate),
'email' => array('name' => get_string('email')),
'icon' => array(
'template' => '<img src="{profile_icon_url user=$r maxwidth=40 maxheight=40}" alt="' . get_string('profileimage') . '" />',
'class' => 'center',
),
'firstname' => array(
'name' => get_string('firstname'),
'sort' => true,
),
'lastname' => array(
'name' => get_string('lastname'),
'sort' => true,
),
'username' => array(
'name' => get_string('username'),
'sort' => true,
'template' => $usernametemplate,
),
'email' => array(
'name' => get_string('email'),
'sort' => true,
),
);
$institutions = get_records_assoc('institution', '', '', '', 'name,displayname');
......@@ -301,7 +314,7 @@ function build_admin_user_search_results($search, $offset, $limit, $sortby, $sor
}
$cols['institution'] = array(
'name' => get_string('institution'),
'nosort' => get_config('usersallowedmultipleinstitutions'),
'sort' => !get_config('usersallowedmultipleinstitutions'),
'template' => $template,
);
}
......
......@@ -18,15 +18,14 @@
{/if}
<tr>
{foreach from=$cols key=f item=c}
{if !$c.name}
<th></th>
{elseif $c.nosort}
<th>{$c.name}</th>
{else}
<th class="search-results-sort-column{if $f == $sortby} {$sortdir}{/if}">
<th{if $c.sort} class="search-results-sort-column{if $f == $sortby} {$sortdir}{/if}"{/if}>
{if $c.sort}
<a href="{$searchurl}&sortby={$f}&sortdir={if $f == $sortby && $sortdir == 'asc'}desc{else}asc{/if}">{$c.name}</a>
</th>
{else}
{$c.name}
{/if}
{if $c.headhtml}<div style="font-weight: normal;">{$c.headhtml|safe}</div>{/if}
</th>
{/foreach}
</tr>
</thead>
......
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