Minor - send title item or a new question to the popup

pull/2588/merge
Julio Montoya 8 years ago
parent ae91b48ec5
commit 3ed6737f3b
  1. 9
      main/exercise/exercise.php
  2. 10
      main/template/default/layout/main.js.tpl

@ -486,6 +486,7 @@ if ($is_allowedToEdit && $origin != 'learnpath') {
echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/qti2.php?'.api_get_cidreq().'">'.Display::return_icon('import_qti2.png', get_lang('ImportQtiQuiz'), '', ICON_SIZE_MEDIUM).'</a>';
echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/aiken.php?'.api_get_cidreq().'">'.Display::return_icon('import_aiken.png', get_lang('ImportAikenQuiz'), '', ICON_SIZE_MEDIUM).'</a>';
echo '<a href="'.api_get_path(WEB_CODE_PATH).'exercise/upload_exercise.php?'.api_get_cidreq().'">'.Display::return_icon('import_excel.png', get_lang('ImportExcelQuiz'), '', ICON_SIZE_MEDIUM).'</a>';
echo Display::url(
Display::return_icon(
'clean_all.png',
@ -493,10 +494,12 @@ if ($is_allowedToEdit && $origin != 'learnpath') {
'',
ICON_SIZE_MEDIUM
),
'',
'#',
[
'onclick' => "javascript:if(!confirm('".addslashes(api_htmlentities(get_lang('AreYouSureToEmptyAllTestResults'), ENT_QUOTES, $charset))."')) return false;",
'href' => api_get_path(WEB_CODE_PATH).'exercise/exercise.php?'.api_get_cidreq().'&choice=clean_all_test&sec_token='.$token,
'data-item-question' => addslashes(get_lang('AreYouSureToEmptyAllTestResults')),
'data-href' => api_get_path(WEB_CODE_PATH).'exercise/exercise.php?'.api_get_cidreq().'&choice=clean_all_test&sec_token='.$token,
'data-toggle' => 'modal',
'data-target' => '#confirm-delete',
]
);
}

@ -101,9 +101,13 @@ $(function() {
// Delete modal
$('#confirm-delete').on('show.bs.modal', function(e) {
$(this).find('.btn-ok').attr('href', $(e.relatedTarget).data('href'));
$('.debug-url').html(
'{{ 'AreYouSureToDeleteJS' | get_lang }}: <strong>' + $(e.relatedTarget).data('item-title') + '</strong>'
);
var message = '{{ 'AreYouSureToDeleteJS' | get_lang }}: <strong>' + $(e.relatedTarget).data('item-title') + '</strong>';
if ($(e.relatedTarget).data('item-question')) {
message = $(e.relatedTarget).data('item-question');
}
$('.debug-url').html(message);
});
// End modals

Loading…
Cancel
Save