本文整理汇总了PHP中DocumentManager::purgeDocument方法的典型用法代码示例。如果您正苦于以下问题:PHP DocumentManager::purgeDocument方法的具体用法?PHP DocumentManager::purgeDocument怎么用?PHP DocumentManager::purgeDocument使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DocumentManager
的用法示例。
在下文中一共展示了DocumentManager::purgeDocument方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: api_protect_admin_script
//require_once '../inc/global.inc.php';
api_protect_admin_script();
if (!api_get_configuration_value('document_manage_deleted_files')) {
api_not_allowed(true);
}
$courseInfo = api_get_course_info();
$sessionId = api_get_session_id();
$files = DocumentManager::getDeletedDocuments($courseInfo, $sessionId);
$actions = Display::url(get_lang('DownloadAll'), api_get_self() . '?' . api_get_cidreq() . '&action=download_all', ['class' => 'btn btn-default']);
$actions .= Display::url(get_lang('DeleteAll'), api_get_self() . '?' . api_get_cidreq() . '&action=delete_all', ['class' => 'btn btn-danger']);
$action = isset($_GET['action']) ? $_GET['action'] : '';
$id = isset($_GET['id']) ? intval($_GET['id']) : '';
$currentUrl = api_get_self() . '?' . api_get_cidreq();
switch ($action) {
case 'delete':
DocumentManager::purgeDocument($id, $courseInfo, $sessionId);
Display::addFlash(Display::return_message(get_lang('Deleted')));
header('Location: ' . $currentUrl);
exit;
break;
case 'delete_all':
DocumentManager::purgeDocuments($courseInfo, $sessionId);
Display::addFlash(Display::return_message(get_lang('Deleted')));
header('Location: ' . $currentUrl);
exit;
break;
case 'download':
DocumentManager::downloadDeletedDocument($id, $courseInfo, $sessionId);
break;
case 'download_all':
DocumentManager::downloadAllDeletedDocument($courseInfo, $sessionId);