Commit 65776bec authored by Yuliya Bozhko's avatar Yuliya Bozhko
Browse files

Add warning when deleting a page used in a collection (Bug #1027260)



Change-Id: I52c488bd36a69b69d21321313e296f87740e3dda
Signed-off-by: default avatarYuliya Bozhko <yuliya.bozhko@totaralms.com>
parent b721e8cf
......@@ -169,6 +169,7 @@ $string['deletespecifiedview'] = 'Delete page "%s"';
$string['deleteviewconfirm1'] = 'Do you really want to delete this page? It cannot be undone.';
$string['deleteviewconfirmbackup'] = 'Please consider creating a backup of this page by <a href="%sexport/" target="_blank">exporting</a> it.';
$string['deleteviewconfirmnote1'] = '<strong>NOTE:</strong> All your files and journal entries that you linked in this page will still be available.<br/>However, any feedback placed on this page will be deleted.';
$string['deleteviewconfirmnote2'] = 'This page is a part of the collection <a href="%s">"%s"</a>.';
$string['editaccesspagedescription3'] = 'By default, only you can see your collections and pages. You can share pages with others by adding access rules below. You may set multiple items to have identical settings by choosing them from the checkboxes. Once you are done, scroll down and click "Save" to continue.';
$string['editaccessdescription'] = 'You may set multiple items to have identical settings by choosing them from the checkboxes. Once you are done, scroll down and click "Save" to continue.';
......
{include file="header.tpl"}
<div class="message deletemessage">
<p>{str tag="deleteviewconfirm1" section="view"}
<p>
{if $collectionnote}{$collectionnote|clean_html|safe}<br>{/if}
{str tag="deleteviewconfirm1" section="view"}
{if $view->get('owner')}<br>{str tag="deleteviewconfirmbackup" section="view" arg1=$WWWROOT}{/if}
</p>
{$form|safe}
......
......@@ -25,6 +25,12 @@ if ($groupid && !group_within_edit_window($groupid)) {
throw new AccessDeniedException(get_string('cantdeleteview', 'view'));
}
$collectionnote = '';
$collection = $view->get_collection();
if ($collection) {
$collectionnote = get_string('deleteviewconfirmnote2', 'view', $collection->get_url(), $collection->get('name'));
}
$institution = $view->get('institution');
View::set_nav($groupid, $institution);
......@@ -61,6 +67,7 @@ $smarty = smarty();
$smarty->assign('PAGEHEADING', TITLE);
$smarty->assign_by_ref('view', $view);
$smarty->assign('form', $form);
$smarty->assign('collectionnote', $collectionnote);
$smarty->display('view/delete.tpl');
function deleteview_submit(Pieform $form, $values) {
......
Supports Markdown
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