本文整理汇总了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()) {