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
fb869122
Commit
fb869122
authored
Jan 08, 2008
by
Richard Mansfield
Browse files
When there is only one institution, display it on institution admin/staff pages
parent
223a312d
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/institution.php
View file @
fb869122
...
...
@@ -419,27 +419,18 @@ function get_institution_selector($includedefault = true) {
return
null
;
}
if
(
count
(
$institutions
)
>
1
)
{
$options
=
array
();
foreach
(
$institutions
as
$i
)
{
$options
[
$i
->
name
]
=
$i
->
displayname
;
}
$institution
=
key
(
$options
);
$institutionelement
=
array
(
'type'
=>
'select'
,
'title'
=>
get_string
(
'institution'
),
'defaultvalue'
=>
$institution
,
'options'
=>
$options
,
'rules'
=>
array
(
'regex'
=>
'/^[a-zA-Z0-9]+$/'
)
);
}
else
{
$institution
=
$institutions
[
0
]
->
name
;
$institutionelement
=
array
(
'type'
=>
'hidden'
,
'value'
=>
$institution
,
'rules'
=>
array
(
'regex'
=>
'/^[a-zA-Z0-9]+$/'
)
);
$options
=
array
();
foreach
(
$institutions
as
$i
)
{
$options
[
$i
->
name
]
=
$i
->
displayname
;
}
$institution
=
key
(
$options
);
$institutionelement
=
array
(
'type'
=>
'select'
,
'title'
=>
get_string
(
'institution'
),
'defaultvalue'
=>
$institution
,
'options'
=>
$options
,
'rules'
=>
array
(
'regex'
=>
'/^[a-zA-Z0-9]+$/'
)
);
return
$institutionelement
;
}
...
...
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