Пример #1
0
 function showMailings($task, $action, $listId, $listType, $message, $showHeader, $title)
 {
     $start = mosGetParam($_REQUEST, 'start', 0);
     //ADRIEN
     //$limit = mosGetParam($_REQUEST, 'limit', $GLOBALS['mosConfig_list_limit']);
     $limit = -1;
     $emailsearch = mosGetParam($_REQUEST, 'emailsearch', '');
     $dropList = mosGetParam($_REQUEST, 'droplist', 'ZZZZ');
     if ($dropList == 'ZZZZ') {
         $dropList = $listType . '-' . $listId;
     }
     $total = 0;
     $dropListValues = explode('-', $dropList);
     $listType = $dropListValues[0];
     $listId = $dropListValues[1];
     if ($listId > 0) {
         $listTypeM = 0;
     } else {
         $listTypeM = $listType;
     }
     $orddef = 'idD';
     if ($listType == 2) {
         $orddef = 'idA';
     }
     $order = mosGetParam($_REQUEST, 'order', $orddef);
     if ($listId == 0) {
         $lists['title'] = lisType::chooseType($task, $action, $listType, 'titles', '', $title);
     } else {
         $listing = lists::getLists($listId, 0, 1, '', false, false, true);
         $lists['title'] = $title . "<span style='color: rgb(51, 51, 51);'>" . $listing[0]->list_name . "</span>";
     }
     $dropDownList = lisType::getMailingDropList($listId, $listType, $order);
     $lists['droplist'] = mosHTML::selectList($dropDownList, 'droplist', 'class="inputbox" size="1" onchange="document.AcajoomFilterForm.submit();"', 'id', 'name', $dropList);
     $mailings = xmailing::getMailings($listId, $listTypeM, $start, $limit, $emailsearch, $total, $order, false, false);
     $forms['main'] = " <form action='index2.php' method='post' name='adminForm'> \n\r";
     $forms['select'] = " <form action='index2.php' method='post' name='AcajoomFilterForm'> \n\r";
     $show = lisType::showType($listType, 'showMailings');
     if ($showHeader) {
         xmailing::_header($task, $action, $listType, $message, '');
     }
     backHTML::formStart('show_mailing', 0, '');
     mailingsHTML::showMailingList($mailings, $lists, $start, $limit, $total, $emailsearch, $listId, $listType, $forms, $show, $action);
     backHTML::formEnd();
 }
Пример #2
0
 function showMailingsFront($task, $action, $subscriberId, $listId, $listType, $viewArchive, $pageTile)
 {
     global $Itemid;
     if (ACA_CMSTYPE) {
         // joomla 15
         $start = JRequest::getVar('start', '0');
         $emailsearch = JRequest::getVar('emailsearch', '');
         $order = JRequest::getVar('order', 'idD');
         $dropList = JRequest::getVar('droplist', 'ZZZZ');
     } else {
         //joomla 1x
         $start = intval(mosGetParam($_REQUEST, 'start', 0));
         $emailsearch = mosGetParam($_REQUEST, 'emailsearch', '');
         $order = mosGetParam($_REQUEST, 'order', 'idD');
         $dropList = mosGetParam($_REQUEST, 'droplist', 'ZZZZ');
     }
     //endif
     //ADRIEN
     //$limit = intval(mosGetParam($_REQUEST, 'limit', $GLOBALS['mosConfig_list_limit']));
     $limit = -1;
     $total = 0;
     if ($dropList == 'ZZZZ') {
         $dropList = $listType . '-' . $listId;
     }
     $total = 0;
     $dropListValues = explode('-', $dropList);
     $listType = $dropListValues[0];
     $listId = $dropListValues[1];
     if (class_exists('pro') && $listId > 0) {
         $list = lists::getOneList($listId);
         $accessGrant = acajoom::checkPermissions('hello', 0, $list->acc_level);
     } else {
         $accessGrant = acajoom::checkPermissions('admin');
     }
     if ($accessGrant) {
         if ($listId > 0) {
             $mailings = xmailing::getMailings($listId, 0, $start, $limit, $emailsearch, $total, $order, false, $viewArchive);
         } else {
             $mailings = xmailing::getMailings($listId, $listType, $start, $limit, $emailsearch, $total, $order, false, $viewArchive);
         }
     } else {
         if ($listType == 1 or $listType == 2 or $listType == 7) {
             $mailings = xmailing::getMailings($listId, 0, $start, $limit, $emailsearch, $total, $order, true, $viewArchive);
         } elseif ($listType == 0) {
             $mailings1 = xmailing::getMailings($listId, 1, $start, $limit, $emailsearch, $total, $order, true, $viewArchive);
             $mailings2 = xmailing::getMailings($listId, 2, $start, $limit, $emailsearch, $total, $order, true, $viewArchive);
             $mailings7 = xmailing::getMailings($listId, 7, $start, $limit, $emailsearch, $total, $order, true, $viewArchive);
             $mailings = array_merge($mailings1, $mailings2, $mailings7);
         } else {
             $mailings = '';
         }
     }
     if ($listId == 0) {
         $lists['title'] = lisType::chooseType($task, $action, $listType, 'titles', '', _ACA_MENU_MAILING);
     } else {
         $listing = lists::getLists($listId, 0, $subscriberId, '', false, false, true);
         $listType = $listType > 0 ? $listType : '0';
         $lists['title'] = $pageTile . @constant($GLOBALS[ACA . 'listname' . $listType]);
     }
     $dropDownList = lisType::getMailingDropList($listId, $listType, $order);
     if (ACA_CMSTYPE) {
         // joomla 15
         $lists['droplist'] = JHTML::_('select.genericlist', $dropDownList, 'droplist', 'class="inputbox" size="1" onchange="document.AcajoomFilterForm.submit();"', 'id', 'name', $dropList);
     } else {
         //joomla 1x
         $lists['droplist'] = mosHTML::selectList($dropDownList, 'droplist', 'class="inputbox" size="1" onchange="document.AcajoomFilterForm.submit();"', 'id', 'name', $dropList);
     }
     //endif
     $linkMain = '.php?option=com_acajoom&act=' . $action;
     compa::completeLink($linkMain, false);
     $forms['main'] = '<form method="post" action="' . $linkMain . '" onsubmit="submitbutton();return false;" name="mosForm" >' . "\n\r";
     $forms['select'] = '<form method="post" action="' . $linkMain . '"  name="AcajoomFilterForm">' . "\n\r";
     $forms['main'] .= '<input type="hidden" name="Itemid" value="' . $Itemid . '" />';
     $forms['select'] .= '<input type="hidden" name="Itemid" value="' . $Itemid . '" />';
     $show = lisType::showType($listType, 'showMailings');
     $show['index'] = 'index';
     $show['select'] = false;
     $show['buttons'] = true;
     if (class_exists('pro') && !$viewArchive) {
         $show['admin'] = true;
         $show['status'] = true;
     }
     frontHTML::formStart($lists['title'], 0, 'show_mailing');
     mailingsHTML::showMailingList($mailings, $lists, $start, $limit, $total, $emailsearch, $listId, $listType, $forms, $show, $action);
     frontHTML::formEnd();
     return true;
 }