Added confirm for deleting a module

This commit is contained in:
Marc Alexander
2011-02-01 00:17:25 +00:00
parent e56458eda7
commit 60df8a029d
3 changed files with 35 additions and 15 deletions

View File

@@ -599,6 +599,8 @@ class acp_portal
trigger_error('CLASS_NOT_FOUND', E_USER_ERROR);
}
if (confirm_box(true))
{
$c_class = new $class();
$c_class->uninstall($module_data['module_id']);
@@ -616,6 +618,22 @@ class acp_portal
trigger_error($user->lang['SUCCESS_DELETE'] . adm_back_link($this->u_action));
}
else
{
$c_class = new $class();
if ($c_class->language)
{
$user->add_lang('mods/portal/' . $c_class->language);
}
$confirm_text = (isset($user->lang[$module_data['module_name']])) ? sprintf($user->lang['DELETE_MODULE_CONFIRM'], $user->lang[$module_data['module_name']]) : sprintf($user->lang['DELETE_MODULE_CONFIRM'], utf8_normalize_nfc($module_data['module_name']));
confirm_box(false, $confirm_text, build_hidden_fields(array(
'i' => $id,
'mode' => $mode,
'action' => $action,
'module_id' => $module_id,
)));
}
}
}
$add_module = key(request_var('add', array('' => '')));

View File

@@ -54,6 +54,7 @@ $lang = array_merge($lang, array(
'MOVE_LEFT' => 'Nach links',
'B3P_FILE_NOT_FOUND' => 'Die angegebene Datei konnte nicht gefunden werden',
'UNABLE_TO_MOVE' => 'Es ist nicht möglich den Block in die gewählte Spalte zu verschieben.',
'DELETE_MODULE_CONFIRM' => 'Bist du sicher, dass du das Module "%1$s" löschen möchtest?',
'MODULE_OPTIONS' => 'Modul Optionen',
'MODULE_NAME' => 'Modul Name',

View File

@@ -53,6 +53,7 @@ $lang = array_merge($lang, array(
'MOVE_LEFT' => 'Move left',
'B3P_FILE_NOT_FOUND' => 'The requested file could not be found',
'UNABLE_TO_MOVE' => 'It is not possible to move the block to the selected column.',
'DELETE_MODULE_CONFIRM' => 'Are you sure you wish to delete the module "%1$s"?',
'MODULE_OPTIONS' => 'Module options',
'MODULE_NAME' => 'Module name',