当前位置: 首页>>代码示例>>PHP>>正文


PHP FormMail::remove_attached_files方法代码示例

本文整理汇总了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);
开发者ID:Albertopf,项目名称:prueba,代码行数:31,代码来源:actions_sendmails.inc.php

示例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);
            }
        }
    }
}
开发者ID:NoisyBoy86,项目名称:Dolibarr_test,代码行数:47,代码来源:files.lib.php

示例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 = '';
开发者ID:TAASA,项目名称:Dolibarr-ERP-3.8.1,代码行数:31,代码来源:mails.php

示例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;
}
开发者ID:remyyounes,项目名称:dolibarr,代码行数:49,代码来源:files.lib.php


注:本文中的FormMail::remove_attached_files方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。