本文整理汇总了PHP中FormMail::remove_attached_files方法的典型用法代码示例。如果您正苦于以下问题:PHP FormMail::remove_attached_files方法的具体用法?PHP FormMail::remove_attached_files怎么用?PHP FormMail::remove_attached_files使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormMail
的用法示例。
在下文中一共展示了FormMail::remove_attached_files方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: explode
if (!empty($_SESSION["listofnames"])) {
$listofnames = explode(';', $_SESSION["listofnames"]);
}
if (!empty($_SESSION["listofmimes"])) {
$listofmimes = explode(';', $_SESSION["listofmimes"]);
}
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
foreach ($listofpaths as $key => $value) {
$pathtodelete = $value;
$filetodelete = $listofnames[$key];
$result = dol_delete_file($pathtodelete, 1);
// Delete uploded Files
$langs->load("other");
setEventMessages($langs->trans("FileWasRemoved", $filetodelete), null, 'mesgs');
$formmail->remove_attached_files($key);
// Update Session
}
}
/*
* Send mail
*/
if (($action == 'send' || $action == 'relance') && !$_POST['addfile'] && !$_POST['removAll'] && !$_POST['removedfile'] && !$_POST['cancel'] && !$_POST['modelselected']) {
if ($conf->dolimail->enabled) {
$langs->load("dolimail@dolimail");
}
$langs->load('mails');
$subject = '';
$actionmsg = '';
$actionmsg2 = '';
$result = $object->fetch($id);
示例2: dol_remove_file_process
/**
* Remove an uploaded file (for example after submitting a new file a mail form).
* All information used are in db, conf, langs, user and _FILES.
*
* @param int $filenb File nb to delete
* @param int $donotupdatesession 1=Do not edit _SESSION variable
* @param int $donotdeletefile 1=Do not delete physically file
* @return void
*/
function dol_remove_file_process($filenb, $donotupdatesession = 0, $donotdeletefile = 1)
{
global $db, $user, $conf, $langs, $_FILES;
$keytodelete = $filenb;
$keytodelete--;
$listofpaths = array();
$listofnames = array();
$listofmimes = array();
if (!empty($_SESSION["listofpaths"])) {
$listofpaths = explode(';', $_SESSION["listofpaths"]);
}
if (!empty($_SESSION["listofnames"])) {
$listofnames = explode(';', $_SESSION["listofnames"]);
}
if (!empty($_SESSION["listofmimes"])) {
$listofmimes = explode(';', $_SESSION["listofmimes"]);
}
if ($keytodelete >= 0) {
$pathtodelete = $listofpaths[$keytodelete];
$filetodelete = $listofnames[$keytodelete];
if (empty($donotdeletefile)) {
$result = dol_delete_file($pathtodelete, 1);
} else {
$result = 0;
}
if ($result >= 0) {
if (empty($donotdeletefile)) {
$langs->load("other");
setEventMessages($langs->trans("FileWasRemoved", $filetodelete), null, 'mesgs');
}
if (empty($donotupdatesession)) {
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
$formmail->remove_attached_files($keytodelete);
}
}
}
}
示例3: explode
}
if (!empty($_SESSION["listofnames"])) {
$listofnames = explode(';', $_SESSION["listofnames"]);
}
if (!empty($_SESSION["listofmimes"])) {
$listofmimes = explode(';', $_SESSION["listofmimes"]);
}
if ($keytodelete >= 0) {
$pathtodelete = $listofpaths[$keytodelete];
$filetodelete = $listofnames[$keytodelete];
$result = dol_delete_file($pathtodelete, 1);
if ($result) {
setEventMessage($langs->trans("FileWasRemoved"), $filetodelete);
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
$formmail = new FormMail($db);
$formmail->remove_attached_files($keytodelete);
}
}
if ($_POST['removedfile'] || ($action = 'send')) {
$action = 'test';
}
if ($_POST['removedfilehtml'] || ($action = 'sendhtml')) {
$action = 'testhtml';
}
}
/*
* Send mail
*/
if (($action == 'send' || $action == 'sendhtml') && !GETPOST('addfile') && !GETPOST('addfilehtml') && !GETPOST('removedfile') && !GETPOST('cancel')) {
$error = 0;
$email_from = '';
示例4: dol_remove_file_process
/**
* Remove an uploaded file (for example after submitting a new file a mail form).
* All information used are in db, conf, langs, user and _FILES.
* @param filenb File nb to delete
* @param donotupdatesession 1=Do not edit _SESSION variable
* @param donotdeletefile 1=Do not delete physically file
* @return string Message with result of upload and store.
*/
function dol_remove_file_process($filenb,$donotupdatesession=0,$donotdeletefile=0)
{
global $db,$user,$conf,$langs,$_FILES;
$mesg='';
$keytodelete=$filenb;
$keytodelete--;
$listofpaths=array();
$listofnames=array();
$listofmimes=array();
if (! empty($_SESSION["listofpaths"])) $listofpaths=explode(';',$_SESSION["listofpaths"]);
if (! empty($_SESSION["listofnames"])) $listofnames=explode(';',$_SESSION["listofnames"]);
if (! empty($_SESSION["listofmimes"])) $listofmimes=explode(';',$_SESSION["listofmimes"]);
if ($keytodelete >= 0)
{
$pathtodelete=$listofpaths[$keytodelete];
$filetodelete=$listofnames[$keytodelete];
if (empty($donotdeletefile)) $result = dol_delete_file($pathtodelete,1);
else $result=0;
if ($result >= 0)
{
if (empty($donotdeletefile))
{
$langs->load("other");
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved",$filetodelete).'</div>';
//print_r($_FILES);
}
if (empty($donotupdatesession))
{
include_once(DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php');
$formmail = new FormMail($db);
$formmail->remove_attached_files($keytodelete);
}
}
}
return $mesg;
}