Ejemplo n.º 1
0
$oSubscription = BxDolSubscription::getInstance();
if ($_POST['queue_message'] && $_POST['msgs_id']) {
    set_time_limit(1800);
    $sActionResult = QueueMessage();
}
if ($_POST['add_message']) {
    $action = 'add';
}
if ($_POST['delete_message'] && $_POST['msgs_id']) {
    $sActionResult = DeleteMessage() ? _t('_adm_mmail_Message_was_deleted') : _t('_adm_mmail_Message_was_not_deleted');
}
if ($_POST['preview_message']) {
    $action = 'preview';
}
if (bx_get('action') == 'empty') {
    $sActionResult = EmptyQueue() ? _t('_adm_mmail_Queue_empty') : _t('_adm_mmail_Queue_emptying_failed');
}
if (isset($_POST['adm-ms-delete'])) {
    foreach ($_POST['members'] as $iMemberId) {
        $oSubscription->unsubscribe(array('type' => 'visitor', 'id' => $iMemberId));
    }
}
$aPages = array('massmailer' => array('index' => 13, 'title' => _t('_adm_mmail_title'), 'url' => BX_DOL_URL_ADMIN . 'notifies.php?mode=massmailer', 'func' => 'PageCodeMassmailer', 'func_params' => array()), 'manage_subscribers' => array('index' => 9, 'title' => _t('_adm_page_cpt_manage_subscribers'), 'url' => BX_DOL_URL_ADMIN . 'notifies.php?mode=manage_subscribers', 'func' => 'PageCodeManageSubscribers', 'func_params' => array($oSubscription)), 'settings' => array('index' => 9, 'title' => _t('_Settings'), 'url' => BX_DOL_URL_ADMIN . 'notifies.php?mode=settings', 'func' => 'PageCodeSettings', 'func_params' => array()));
if (!isset($_GET['mode']) || !isset($aPages[$_GET['mode']])) {
    $sMode = 'massmailer';
} else {
    $sMode = $_GET['mode'];
}
$aTopItems = array();
foreach ($aPages as $k => $r) {
    $aTopItems['dbmenu_' . $k] = array('href' => $r['url'], 'title' => $r['title'], 'active' => $k == $sMode ? 1 : 0);
Ejemplo n.º 2
0
if (!$demo_mode && $action == 'update' && $_POST['msgs_id'] && strlen($_POST['body_html'])) {
    if (UpdateMessage()) {
        $action_result .= "Message was updated.<br>";
    } else {
        $action_result .= "Message was not updated.<br>";
    }
}
if (!$demo_mode && $action == 'delete' && $_POST['msgs_id']) {
    if (DeleteMessage()) {
        $action_result .= "Message was deleted.<br>";
    } else {
        $action_result .= "Message was not deleted.<br>";
    }
}
if (!$demo_mode && $action == 'empty') {
    if (EmptyQueue()) {
        $action_result .= "Queue empty.<br>";
    } else {
        $action_result .= "Queue emptying failed.<br>";
    }
}
if (!$demo_mode && $action == 'queue' && $_POST['msgs_id']) {
    $action_result .= QueueMessage();
}
if (strlen($action_result)) {
    echo "<br><center><div class=\"err\">{$action_result}</div></center><br>\n";
}
PrintStatus();
// Print combobox with all messages
?>
	<form name="form_messages" method="POST" action="<?php