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
2d051472
Commit
2d051472
authored
Jan 29, 2007
by
Richard Mansfield
Browse files
Warn before letting users access empty views (bug 407)
parent
0271a6d7
Changes
2
Show whitespace changes
Inline
Side-by-side
htdocs/lang/en.utf8/mahara.php
View file @
2d051472
...
...
@@ -292,6 +292,7 @@ $string['editview'] = 'Edit View';
$string
[
'editviewinformation'
]
=
'Edit View Information'
;
$string
[
'myviews'
]
=
'My Views'
;
$string
[
'notownerofview'
]
=
'You are not the owner of this view'
;
$string
[
'reallyaddaccesstoemptyview'
]
=
'Your view contains no artefacts. Do you really want to give these users access to the view?'
;
$string
[
'saveaccess'
]
=
'Save Access'
;
$string
[
'submitview'
]
=
'Submit View'
;
$string
[
'submitviewfailed'
]
=
'Submit view failed'
;
...
...
htdocs/view/create4.php
View file @
2d051472
...
...
@@ -35,6 +35,22 @@ $createid = param_integer('createid', null);
$data
=
$SESSION
->
get
(
'create_'
.
$createid
);
if
(
empty
(
$data
[
'artefacts'
]))
{
$confirmmessage
=
get_string
(
'reallyaddaccesstoemptyview'
);
$backpage
=
get_config
(
'wwwroot'
)
.
'view/create3.php?createid='
.
$createid
;
$js
=
<<<EOF
addLoadEvent(function() {
connect('createview4_submit', 'onclick', function () {
var accesslistrows = getElementsByTagAndClassName('tr', null, 'accesslistitems');
if (accesslistrows.length > 0 && !confirm('{$confirmmessage}')) {
replaceChildNodes('accesslistitems', []);
}
});
});
EOF;
$smarty
->
assign
(
'INLINEJAVASCRIPT'
,
$js
);
}
$form
=
array
(
'name'
=>
'createview4'
,
'elements'
=>
array
(
...
...
@@ -53,8 +69,10 @@ function createview4_submit_cancel() {
redirect
(
'/view/'
);
}
function
createview4_submit
(
Pieform
$form
,
$values
)
{
global
$SESSION
,
$USER
,
$createid
,
$data
;
log_debug
(
$values
);
if
(
param_boolean
(
'back'
))
{
$data
[
'accesslist'
]
=
array_values
((
array
)
$values
[
'accesslist'
]);
...
...
Write
Preview
Markdown
is supported
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