Пример #1
0
 function updateListFromEdit($listId, $status, $new)
 {
     global $my;
     $erro = new xerr(__FILE__, __FUNCTION__, __CLASS__);
     $listUpdated = '';
     $total = 0;
     $allow_html = compa::allow_html();
     $listUpdated->id = $listId;
     $listUpdated->list_name = mosGetParam($_REQUEST, 'list_name', '', $allow_html);
     $listUpdated->list_desc = mosGetParam($_REQUEST, 'list_desc', '', $allow_html);
     //$listUpdated->list_desc = str_replace('"', '"' , $listUpdated->list_desc);
     //$listUpdated->list_name = str_replace('"', '"' , $listUpdated->list_name);
     $listUpdated->sendername = mosGetParam($_REQUEST, 'sendername', '');
     $listUpdated->senderemail = mosGetParam($_REQUEST, 'senderemail', '');
     $listUpdated->bounceadres = mosGetParam($_REQUEST, 'bounceadres', '');
     $listUpdated->layout = mosGetParam($_REQUEST, 'layout', '', $allow_html);
     $listUpdated->template = mosGetParam($_REQUEST, 'template', 0);
     $listUpdated->subscribemessage = mosGetParam($_REQUEST, 'subscribemessage', '', $allow_html);
     $listUpdated->unsubscribemessage = mosGetParam($_REQUEST, 'unsubscribemessage', '', $allow_html);
     $listUpdated->unsubscribesend = mosGetParam($_REQUEST, 'unsubscribesend', 1);
     $listUpdated->html = mosGetParam($_REQUEST, 'html', 1);
     $listUpdated->hidden = mosGetParam($_REQUEST, 'hidden', 0);
     $listUpdated->list_type = mosGetParam($_REQUEST, 'list_type', 1);
     $listUpdated->auto_add = mosGetParam($_REQUEST, 'auto_add', 0);
     $listUpdated->user_choose = mosGetParam($_REQUEST, 'user_choose', 0);
     $listUpdated->cat_id = mosGetParam($_REQUEST, 'cat_id', 0);
     $listUpdated->delay_min = mosGetParam($_REQUEST, 'delay_min', 0);
     $listUpdated->delay_max = mosGetParam($_REQUEST, 'delay_max', 0);
     $listUpdated->follow_up = mosGetParam($_REQUEST, 'follow_up', 0);
     $listUpdated->notify_id = $listUpdated->list_type == '7' ? mosGetParam($_REQUEST, 'notify_id', 0) : 0;
     $listUpdated->owner = $my->id;
     $listUpdated->auto_add = mosGetParam($_REQUEST, 'auto_add', 0);
     $listUpdated->acc_level = mosGetParam($_REQUEST, 'acc_level', 25);
     $listUpdated->acc_id = mosGetParam($_REQUEST, 'acc_id', 29);
     $listUpdated->footer = mosGetParam($_REQUEST, 'footer', 1);
     $listUpdated->start_date = mosGetParam($_REQUEST, 'start_date', 0);
     $listUpdated->next_date = mosGetParam($_REQUEST, 'next_date', 0);
     $listUpdated->notification = 0;
     if ($status == '') {
         $listUpdated->published = mosGetParam($_REQUEST, 'published', 0);
     } else {
         $listUpdated->published = $status;
     }
     if ($listUpdated->published == 0 and ($listUpdated->list_type == 2 or $listUpdated->list_type == 3)) {
         $published = 0;
     } else {
         $published = $listUpdated->published;
     }
     if (!empty($listUpdated->hidden)) {
         $visible = $listUpdated->hidden;
     } else {
         $visible = 0;
     }
     if ($new) {
         $published = $listUpdated->published;
     }
     if (!lists::updateList($listId, $listUpdated, $status, $new)) {
         return false;
     }
     if ($listUpdated->list_type != 11) {
         return xmailing::updateMailingFromList($listId, $published, $listUpdated->html, $visible);
     } else {
         return true;
     }
 }
Пример #2
0
 function updateListFromEdit($listId, $status, $new)
 {
     if (ACA_CMSTYPE) {
         // joomla 15
         $my =& JFactory::getUser();
     } else {
         //joomla 1x
         global $my;
     }
     //endif
     $erro = new xerr(__FILE__, __FUNCTION__, __CLASS__);
     $listUpdated = '';
     $total = 0;
     $allow_html = compa::allow_html();
     $listUpdated->id = $listId;
     if (ACA_CMSTYPE) {
         // joomla 15
         $issue_nb = JRequest::getVar('issue_nb', '0');
         $listUpdated->list_name = JRequest::getVar('list_name', '', 'request', 'string', $allow_html);
         $listUpdated->list_desc = JRequest::getVar('list_desc', '', 'request', 'string', $allow_html);
         $listUpdated->sendername = JRequest::getVar('sendername', '');
         $listUpdated->senderemail = JRequest::getVar('senderemail', '');
         $listUpdated->bounceadres = JRequest::getVar('bounceadres', '');
         $listUpdated->layout = JRequest::getVar('layout', '', 'request', 'string', $allow_html);
         $listUpdated->template = JRequest::getVar('template', 0);
         $listUpdated->subscribemessage = JRequest::getVar('subscribemessage', '', 'request', 'string', $allow_html);
         $listUpdated->unsubscribemessage = JRequest::getVar('unsubscribemessage', '', 'request', 'string', $allow_html);
         $listUpdated->unsubscribesend = JRequest::getVar('unsubscribesend', 1);
         $listUpdated->html = JRequest::getVar('html', 1);
         $listUpdated->hidden = JRequest::getVar('hidden', 0);
         $listUpdated->list_type = JRequest::getVar('list_type', 1);
         $listUpdated->auto_add = JRequest::getVar('auto_add', 0);
         $listUpdated->user_choose = JRequest::getVar('user_choose', 0);
         $listUpdated->cat_id = implode(',', JRequest::getVar('cat_id', array()));
         $listUpdated->delay_min = JRequest::getVar('delay_min', 0);
         $listUpdated->delay_max = JRequest::getVar('delay_max', 0);
         $listUpdated->follow_up = JRequest::getVar('follow_up', 0);
         $listUpdated->notify_id = $listUpdated->list_type == '7' ? JRequest::getVar('notify_id', 0) : 0;
         $listUpdated->auto_add = JRequest::getVar('auto_add', 0);
         $listUpdated->acc_level = JRequest::getVar('acc_level', 25);
         $listUpdated->acc_id = JRequest::getVar('acc_id', 29);
         $listUpdated->footer = JRequest::getVar('footer', 1);
         $listUpdated->start_date = JRequest::getVar('start_date', '');
         $listUpdated->next_date = JRequest::getVar('next_date', 0);
     } else {
         //joomla 1x
         $listUpdated->list_name = mosGetParam($_REQUEST, 'list_name', '', $allow_html);
         $listUpdated->list_desc = mosGetParam($_REQUEST, 'list_desc', '', $allow_html);
         $listUpdated->sendername = mosGetParam($_REQUEST, 'sendername', '');
         $listUpdated->senderemail = mosGetParam($_REQUEST, 'senderemail', '');
         $listUpdated->bounceadres = mosGetParam($_REQUEST, 'bounceadres', '');
         $listUpdated->layout = mosGetParam($_REQUEST, 'layout', '', $allow_html);
         $listUpdated->template = mosGetParam($_REQUEST, 'template', 0);
         $listUpdated->subscribemessage = mosGetParam($_REQUEST, 'subscribemessage', '', $allow_html);
         $listUpdated->unsubscribemessage = mosGetParam($_REQUEST, 'unsubscribemessage', '', $allow_html);
         $listUpdated->unsubscribesend = mosGetParam($_REQUEST, 'unsubscribesend', 1);
         $listUpdated->html = mosGetParam($_REQUEST, 'html', 1);
         $listUpdated->hidden = mosGetParam($_REQUEST, 'hidden', 0);
         $listUpdated->list_type = mosGetParam($_REQUEST, 'list_type', 1);
         $listUpdated->auto_add = mosGetParam($_REQUEST, 'auto_add', 0);
         $listUpdated->user_choose = mosGetParam($_REQUEST, 'user_choose', 0);
         $listUpdated->cat_id = implode(',', mosGetParam($_REQUEST, 'cat_id', array()));
         $listUpdated->delay_min = mosGetParam($_REQUEST, 'delay_min', 0);
         $listUpdated->delay_max = mosGetParam($_REQUEST, 'delay_max', 0);
         $listUpdated->follow_up = mosGetParam($_REQUEST, 'follow_up', 0);
         $listUpdated->notify_id = $listUpdated->list_type == '7' ? mosGetParam($_REQUEST, 'notify_id', 0) : 0;
         $listUpdated->auto_add = mosGetParam($_REQUEST, 'auto_add', 0);
         $listUpdated->acc_level = mosGetParam($_REQUEST, 'acc_level', 25);
         $listUpdated->acc_id = mosGetParam($_REQUEST, 'acc_id', 29);
         $listUpdated->footer = mosGetParam($_REQUEST, 'footer', 1);
         $listUpdated->start_date = mosGetParam($_REQUEST, 'start_date', '');
         $listUpdated->next_date = mosGetParam($_REQUEST, 'next_date', 0);
     }
     //endif
     $listUpdated->owner = $my->id;
     $listUpdated->notification = 0;
     if ($status == '') {
         if (ACA_CMSTYPE) {
             // joomla 15
             $listUpdated->published = JRequest::getVar('published', 0);
         } else {
             $listUpdated->published = intval(mosGetParam($_REQUEST, 'published', 0));
         }
         //endif
     } else {
         $listUpdated->published = $status;
     }
     if ($listUpdated->published == 0 and ($listUpdated->list_type == 2 or $listUpdated->list_type == 3)) {
         $published = 0;
     } else {
         $published = $listUpdated->published;
     }
     if (!empty($listUpdated->hidden)) {
         $visible = $listUpdated->hidden;
     } else {
         $visible = 0;
     }
     if ($new) {
         $published = $listUpdated->published;
     }
     if (!lists::updateList($listId, $listUpdated, $listUpdated->published, $new)) {
         return false;
     }
     if ($listUpdated->list_type != 11) {
         return xmailing::updateMailingFromList($listId, $published, $listUpdated->html, $visible);
     } else {
         return true;
     }
 }