function editList($listEdit, $forms, $show)
 {
     $lists = listsHTML::prepList($listEdit);
     $html = $listEdit->html;
     if ($listEdit->footer == '0') {
         $show['unsusbcribe'] = false;
     }
     echo $forms['main'];
     $config_tabs = new mosTabs(0);
     $config_tabs->startPane('acaListEdit');
     $config_tabs->startTab(_ACA_LIST_T_GENERAL, 'acaListEdit.general');
     listsHTML::description($listEdit, $lists, $show, $html);
     $config_tabs->endTab();
     $config_tabs->startTab(_ACA_LIST_T_TEMPLATE, 'acaListEdit.template');
     listsHTML::layout($listEdit, $lists, $show, $html);
     $config_tabs->endTab();
     if (($show['auto_option'] or $listEdit->new_letter == 1) and $GLOBALS[ACA . 'listype2'] == 1 and class_exists('autoresponder')) {
         $config_tabs->startTab(_ACA_AUTORESP, 'acaListEdit.autorespond');
         autoresponder::edit($listEdit, $lists, $show, $html);
         $config_tabs->endTab();
     }
     if (($listEdit->list_type == '7' or $listEdit->new_letter == 1) and $GLOBALS[ACA . 'listype7'] == 1 and class_exists('autonews')) {
         $config_tabs->startTab(_ACA_AUTONEWS, 'acaListEdit.smartnews');
         autonews::edit($listEdit, $lists, $show, $html);
         $config_tabs->endTab();
     }
     if ($show['unsusbcribe'] or $show['auto_subscribe'] or $GLOBALS[ACA . 'require_confirmation'] or $show['email_unsubcribe'] and class_exists('auto')) {
         $config_tabs->startTab(_ACA_LIST_T_SUBSCRIPTION, 'acaListEdit.subscriber');
         listsHTML::subscription($listEdit, $lists, $show, $html);
         $config_tabs->endTab();
     }
     if (class_exists('pro')) {
         $config_tabs->startTab(_ACA_LIST_ADD_TAB, 'acaListEdit.pro');
         pro::editTab($listEdit, $lists, $show, $html);
         $config_tabs->endTab();
     }
     $config_tabs->endPane();
 }
Beispiel #2
0
 function showLists($subscriberId, $listId, $lisType, $action, $task)
 {
     global $Itemid;
     switch ($task) {
         case 'edit':
             if (acajoom::checkPermissions('admin')) {
                 $task = 'save';
                 $list = lists::getLists($listId, $lisType, $subscriberId, '', false, false, false);
                 $listEdit = $list[0];
                 $listEdit->new_letter = 0;
                 if (!empty($listEdit)) {
                     $linkForm = '.php?option=com_acajoom';
                     compa::completeLink($linkForm, false);
                     $forms['main'] = "<form action='{$linkForm}' method='post' name='adminForm'> \n ";
                     $show = lisType::showType($listEdit->list_type, 'editlist');
                     frontHTML::formStart(_ACA_EDIT_A . @constant($GLOBALS[ACA . 'listname' . $lisType]) . ' ' . _ACA_LIST, $listEdit->html, 'listedit');
                     listsHTML::editList($listEdit, $forms, $show);
                     $go[] = acajoom::makeObj('listid', $listEdit->id);
                     $go[] = acajoom::makeObj('act', $action);
                     $go[] = acajoom::makeObj('task', 'save');
                     frontHTML::formEndFN(_ACA_SAVE, $go);
                 }
             }
             break;
         case 'save':
             $message = acajoom::printYN(lists::updateListFromEdit($listId, '', false), _ACA_LIST_UPDATED, _ACA_ERROR);
             echo $message;
             $listId = 0;
         default:
             $show = lisType::showType('', 'showListsFront');
             $link = '.php?option=com_acajoom&act=' . $action;
             compa::completeLink($link, false);
             $forms['main'] = '<form method="post" action="' . $link . '" onsubmit="submitbutton();return false;" name="mosForm" >' . "\n\r";
             $forms['main'] .= '<input type="hidden" name="Itemid" value="' . $Itemid . '" />';
             $order = 'listnameA';
             if (acajoom::checkPermissions('admin')) {
                 $lists = lists::getLists($listId, $lisType, $subscriberId, $order, false, false, false);
             } else {
                 if ($lisType == 0) {
                     $lists1 = lists::getLists($listId, 1, $subscriberId, $order, false, true, false);
                     $lists2 = lists::getLists($listId, 2, $subscriberId, $order, false, true, false);
                     $lists7 = lists::getLists($listId, 7, $subscriberId, $order, false, true, false);
                     $lists = array_merge($lists1, $lists2, $lists7);
                 } elseif ($lisType == 1 or $lisType == 2 or $lisType == 7) {
                     $lists = lists::getLists($listId, $lisType, $subscriberId, $order, false, true, false);
                 } else {
                     $lists = '';
                 }
             }
             if (!empty($lists)) {
                 frontHTML::formStart(_ACA_SUBSCRIBE_LIST2, 0, '');
                 if ($show['list_type']) {
                     $show['list_type'] = lisType::checkOthers();
                 }
                 if (class_exists('pro')) {
                     $access = false;
                     foreach ($lists as $list) {
                         $bit = acajoom::checkPermissions('hello', 0, $list->acc_level);
                         if ($bit) {
                             $access = true;
                             break;
                         }
                     }
                     if ($access) {
                         pro::showListingLists($lists, $action, 'edit', $forms, $show);
                     } else {
                         listsHTML::showListingLists($lists, $action, 'edit', $forms, $show);
                     }
                 } else {
                     listsHTML::showListingLists($lists, $action, 'edit', $forms, $show);
                 }
                 $go[] = acajoom::makeObj('act', $action);
                 frontHTML::formEnd('', $go);
             }
             break;
     }
 }