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
5ff1c70f
Commit
5ff1c70f
authored
Dec 21, 2006
by
Nigel McNie
Committed by
Nigel McNie
Dec 21, 2006
Browse files
Updated to use the new pieform way of replying to ajax forms
parent
a0bfe5d1
Changes
1
Show whitespace changes
Inline
Side-by-side
htdocs/admin/site/options.php
View file @
5ff1c70f
...
...
@@ -103,11 +103,11 @@ $siteoptionform = pieform(array(
)
));
function
siteoptions_fail
(
$field
)
{
json_reply
(
'local'
,
get_string
(
'
set
siteoptionsfailed'
,
'admin'
,
get_string
(
$field
)));
function
siteoptions_fail
(
$field
,
Pieform
$form
)
{
$form
->
json_reply
(
PIEFORM_ERR
,
get_string
(
'siteoptionsfailed'
,
'admin'
,
get_string
(
$field
))
,
array
(
$field
=>
get_string
(
$field
.
'invalid'
,
'admin'
))
);
}
function
siteoptions_submit
(
$values
)
{
function
siteoptions_submit
(
$values
,
Pieform
$form
)
{
$fields
=
array
(
'sitename'
,
'language'
,
'theme'
,
'pathtoclam'
,
'allowpublicviews'
,
'artefactviewinactivitytime'
);
foreach
(
$fields
as
$field
)
{
...
...
@@ -117,13 +117,13 @@ function siteoptions_submit($values) {
}
// submitted sessionlifetime is in minutes; db entry session_timeout is in seconds
if
(
!
set_config
(
'session_timeout'
,
$values
[
'sessionlifetime'
]
*
60
))
{
siteoptions_fail
(
'sessionlifetime'
);
siteoptions_fail
(
'sessionlifetime'
,
$form
);
}
// Submitted value is on/off; database entry should be 1/0
if
(
!
set_config
(
'viruschecking'
,
(
int
)
(
$values
[
'viruschecking'
]
==
'on'
)))
{
siteoptions_fail
(
'viruschecking'
);
siteoptions_fail
(
'viruschecking'
,
$form
);
}
json_reply
(
false
,
get_string
(
'siteoptionsset'
,
'admin'
));
$form
->
json_reply
(
PIEFORM_OK
,
get_string
(
'siteoptionsset'
,
'admin'
));
}
$smarty
=
smarty
();
...
...
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