本文整理匯總了PHP中FileData::undelete方法的典型用法代碼示例。如果您正苦於以下問題:PHP FileData::undelete方法的具體用法?PHP FileData::undelete怎麽用?PHP FileData::undelete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FileData
的用法示例。
在下文中一共展示了FileData::undelete方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: pmt_delete
display_smarty_template('deleteview.tpl');
}
} elseif (isset($_POST['submit']) && $_POST['submit'] == 'Delete file(s)') {
isset($_REQUEST['checkbox']) ? $_REQUEST['checkbox'] : '';
foreach ($_REQUEST['checkbox'] as $value) {
if (!pmt_delete($value)) {
header('Location: error.php?ec=21');
exit;
}
}
header('Location:' . urlencode($redirect) . '?last_message=' . urlencode(msg('undeletepage_file_permanently_deleted')));
} elseif (isset($_REQUEST['submit']) && $_REQUEST['submit'] == 'Undelete') {
if (isset($_REQUEST['checkbox'])) {
foreach ($_REQUEST['checkbox'] as $fileId) {
$file_obj = new FileData($fileId, $pdo);
$file_obj->undelete();
fmove($GLOBALS['CONFIG']['archiveDir'] . $fileId . '.dat', $GLOBALS['CONFIG']['dataDir'] . $fileId . '.dat');
}
}
header('Location:' . urlencode($redirect) . '?last_message=' . urlencode(msg('undeletepage_file_undeleted')));
}
draw_footer();
/*
* Permanently Delete A File
* @param integer $id The file ID to be deleted permanently
*/
function pmt_delete($id)
{
global $pdo;
$userperm_obj = new User_Perms($_SESSION['uid'], $pdo);
if (!$userperm_obj->user_obj->isRoot()) {