Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
15a78e42
Commit
15a78e42
authored
Sep 24, 2007
by
Richard Mansfield
Committed by
Nigel McNie
Oct 17, 2007
Browse files
Institution drop-down
parent
a14c94a0
Changes
3
Show whitespace changes
Inline
Side-by-side
htdocs/admin/users/search.php
View file @
15a78e42
...
...
@@ -37,6 +37,7 @@ require('searchlib.php');
$search
=
(
object
)
array
(
'query'
=>
trim
(
param_variable
(
'query'
,
''
)),
'sort'
=>
param_alpha
(
'sort'
,
'lastname'
),
'institution'
=>
param_alpha
(
'institution'
,
'all'
),
'f'
=>
param_alpha
(
'f'
,
null
),
'l'
=>
param_alpha
(
'l'
,
null
),
'offset'
=>
param_integer
(
'offset'
,
0
),
...
...
@@ -46,6 +47,7 @@ $search = (object) array(
$smarty
=
smarty
(
array
(
'usersearch'
));
$smarty
->
assign
(
'search'
,
$search
);
$smarty
->
assign
(
'alphabet'
,
explode
(
','
,
get_string
(
'alphabet'
)));
$smarty
->
assign
(
'institutions'
,
get_records_array
(
'institution'
));
$smarty
->
assign
(
'results'
,
build_admin_user_search_results
(
$search
));
$smarty
->
display
(
'admin/users/search.tpl'
);
...
...
htdocs/lib/searchlib.php
View file @
15a78e42
...
...
@@ -153,7 +153,7 @@ function build_admin_user_search_results($search) {
'string'
=>
$search
->
l
);
}
}
if
(
!
empty
(
$search
->
institution
))
{
if
(
!
empty
(
$search
->
institution
)
&&
$search
->
institution
!=
'all'
)
{
$search
->
expr
[
'and'
][]
=
array
(
'field'
=>
'institution'
,
'type'
=>
'equals'
,
'string'
=>
$search
->
institution
);
...
...
htdocs/theme/default/templates/admin/users/search.tpl
View file @
15a78e42
...
...
@@ -35,8 +35,20 @@
<div
class=
"searchform"
>
<label>
Query:
<input
type=
"text"
name=
"query"
id=
"query"
>
<button
id=
"query-button"
type=
"submit"
>
{
str
tag
=
"go"
}
</button>
</label>
{
if
$USER
->
get
(
'admin'
)
&&
!
empty
(
$institutions
)
}
<span
class=
"institutions"
>
<label>
Institution:
<select
name=
"institution"
>
<option
value=
all
>
{
str
tag
=
all
}
</option>
{
foreach
from
=
$institutions
item
=
i
}
<option
value=
{
$i
->
name
}
>
{
$i
->
displayname
}
</option
>
{/
foreach
}
</select>
</label>
</span>
{/
if
}
<button
id=
"query-button"
type=
"submit"
>
{
str
tag
=
"go"
}
</button>
</div>
<div
id=
"results"
>
{
$results
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment