Пример #1
0
function lists($action, $task, $listId, $listType)
{
    global $database, $my;
    $message = '';
    $xf = new xonfig();
    $erro = new xerr(__FILE__, __FUNCTION__);
    $erro->show();
    $showLists = true;
    switch ($task) {
        case 'new':
            if ($listType < 1) {
                $listType = 1;
            }
            $filename = $GLOBALS['mosConfig_absolute_path'] . '/components/com_acajoom/templates/default/default.html';
            $handle = fopen($filename, "rb");
            $template = fread($handle, filesize($filename));
            fclose($handle);
            $template = str_replace('src="', 'src="' . $GLOBALS['mosConfig_live_site'] . '/', $template);
            $subscriber = subscribers::getSubscriberInfoFromUserId($my->id);
            $showLists = false;
            $newList->id = '';
            $newList->html = 1;
            $newList->new_letter = 1;
            $newList->list_name = '';
            $newList->list_desc = '';
            $newList->sendername = $subscriber->name;
            $newList->senderemail = $subscriber->email;
            $newList->bounceadres = $subscriber->email;
            $newList->layout = $template;
            $newList->template = 0;
            $newList->hidden = 1;
            $newList->auto_add = 0;
            $newList->list_type = $listType;
            $newList->delay_min = 1;
            $newList->delay_max = 7;
            $newList->user_choose = 0;
            $newList->cat_id = 0;
            $newList->follow_up = '';
            $newList->notify_id = 0;
            $newList->owner = $my->id;
            $newList->acc_level = 25;
            $newList->acc_id = 29;
            $newList->published = 0;
            $newList->start_date = date('Y-m-d', time());
            $newList->next_date = time();
            $newList->subscribemessage = _ACA_DEFAULT_SUBSCRIBE_MESS;
            $newList->unsubscribemessage = _ACA_DEFAULT_UNSUBSCRIBE_MESS;
            $newList->unsubscribesend = 1;
            $newList->footer = 1;
            $forms['main'] = " <form action='index2.php' method='post' name='adminForm'> \n ";
            $show = lisType::showType($newList->list_type, 'editlist');
            backHTML::_header(_ACA_NEW . ' ' . _ACA_LIST, $GLOBALS[ACA . 'listlogo0'], $message, $task, $action);
            backHTML::formStart('listedit', $newList->html, '');
            listsHTML::editList($newList, $forms, $show);
            $go[] = acajoom::makeObj('act', $action);
            $go[] = acajoom::makeObj('listid', $newList->id);
            backHTML::formEnd($go);
            break;
        case 'doNew':
            $listname = mosGetParam($_REQUEST, 'list_name', '');
            $listType = mosGetParam($_REQUEST, 'list_type', 0);
            $now = acajoom::getNow();
            $query = "SELECT `id` FROM `#__acajoom_lists` WHERE `list_name`= '{$listname}' ";
            $database->setQuery($query);
            $lId = $database->loadResult();
            $erro->err = $database->getErrorMsg();
            $erro->E(__LINE__, '1091', $database);
            if ($lId > 0) {
                echo "<script> alert(' This list already exist, please choose another name. '); window.history.go(-1);</script>\n";
                return false;
            } else {
                $query = "INSERT INTO `#__acajoom_lists` (`list_name`,`createdate`) VALUES ( '" . addslashes($listname) . "'  , '{$now}' )";
                $database->setQuery($query);
                $database->query();
                $erro->err = $database->getErrorMsg();
            }
            if ($erro->E(__LINE__, '1001', $database)) {
                $query = "SELECT * FROM `#__acajoom_lists` WHERE `list_name`= '{$listname}' ";
                $database->setQuery($query);
                $database->loadObject($mynewlist);
                $mynewlist->list_name = stripslashes($mynewlist->list_name);
                $mynewlist->list_desc = stripslashes($mynewlist->list_desc);
                $mynewlist->layout = stripslashes($mynewlist->layout);
                $mynewlist->subscribemessage = stripslashes($mynewlist->subscribemessage);
                $mynewlist->unsubscribemessage = stripslashes($mynewlist->unsubscribemessage);
                $erro->err = $database->getErrorMsg();
                $erro->E(__LINE__, '1005');
                $listId = $mynewlist->id;
                $message = acajoom::printYN(lists::updateListFromEdit($listId, '', true), _ACA_LIST_ADDED, _ACA_ERROR);
                $xf->plus('totallist0', 1);
                $xf->plus('act_totallist0', 1);
                $xf->plus('totallist' . $listType, 1);
                $xf->plus('act_totallist' . $listType, 1);
            }
            break;
        case 'edit':
            if ($listId == 0) {
                echo "<script> alert('" . addslashes(_ACA_SELECT_LIST) . "'); window.history.go(-1);</script>\n";
                return false;
            } else {
                $showLists = false;
                $query = 'SELECT * FROM `#__acajoom_lists` WHERE `id` = ' . intval($listId);
                $database->setQuery($query);
                $database->loadObject($listEdit);
                $erro->err = $database->getErrorMsg();
                if (!$erro->E(__LINE__, '1002')) {
                    return false;
                } else {
                    $listEdit->list_name = stripslashes($listEdit->list_name);
                    $listEdit->list_desc = stripslashes($listEdit->list_desc);
                    $listEdit->layout = stripslashes($listEdit->layout);
                    $listEdit->subscribemessage = stripslashes($listEdit->subscribemessage);
                    $listEdit->unsubscribemessage = stripslashes($listEdit->unsubscribemessage);
                    $listEdit->new_letter = 0;
                    $forms['main'] = " <form action='index2.php' method='post' name='adminForm'> \n ";
                    $show = lisType::showType($listEdit->list_type, 'editlist');
                    backHTML::_header(_ACA_EDIT_A . @constant($GLOBALS[ACA . 'listname' . $listEdit->list_type]) . ' ' . _ACA_LIST, $GLOBALS[ACA . 'listlogo0'], $message, $task, $action);
                    backHTML::formStart('listedit', $listEdit->html, '');
                    listsHTML::editList($listEdit, $forms, $show);
                    $go[] = acajoom::makeObj('act', $action);
                    $go[] = acajoom::makeObj('listid', $listEdit->id);
                    backHTML::formEnd($go);
                }
            }
            break;
        case 'update':
            $message = acajoom::printYN(lists::updateListFromEdit($listId, '', false), _ACA_LIST_UPDATED, _ACA_ERROR);
            break;
        case 'delete':
            $message = acajoom::printYN(lists::deleteList($listId), _ACA_LIST . _ACA_SUCCESS_DELETED, _ACA_ERROR);
            break;
        case 'copy':
            $message = acajoom::printYN(lists::copyList($listId), _ACA_LIST_COPY, _ACA_ERROR);
            break;
        case 'publish':
            $message = acajoom::printYN(lists::updateListFromList($listId, true, false), _ACA_PUBLISHED, _ACA_ERROR);
            break;
        case 'unpublish':
            $message = acajoom::printYN(lists::updateListFromList($listId, false, false), _ACA_UNPUBLISHED, _ACA_ERROR);
            break;
        case 'forms':
        case 'make':
            if (class_exists('createForm')) {
                createForm::taskOptions($task);
                $showLists = false;
            } else {
                $showLists = true;
            }
            break;
        case 'cpanel':
            backHTML::controlPanel();
            return true;
            break;
    }
    if ($showLists) {
        backHTML::_header(_ACA_MENU_LIST, $GLOBALS[ACA . 'listlogo0'], $message, $task, $action);
        $show = lisType::showType(0, 'showListsBack');
        $forms['main'] = " <form action='index2.php' method='post' name='adminForm'> \n";
        backHTML::formStart('show_mailing', '', '');
        $listing = lists::getLists(0, 0, 1, '', false, false, false);
        if ($show['list_type']) {
            $show['list_type'] = lisType::checkOthers();
        }
        listsHTML::showListingLists($listing, $action, 'edit', $forms, $show);
        $go[] = acajoom::makeObj('act', $action);
        backHTML::formEnd($go);
        return true;
    }
}
Пример #2
0
 function writeLogs($list, $log_simple, $log_detailed)
 {
     if (ACA_CMSTYPE) {
         $database =& JFactory::getDBO();
     } else {
         global $database;
     }
     //endif
     if ($GLOBALS[ACA . 'send_log_simple']) {
         $send = $log_simple;
     } else {
         $send = $log_detailed;
     }
     if (lisType::sendLogs($list->list_type)) {
         $database->setQuery("SELECT * FROM `#__users` WHERE `gid` = 25 LIMIT 1");
         if (ACA_CMSTYPE) {
             // joomla 15
             $admin = $database->loadObject();
             $owner = subscribers::getSubscriberInfoFromUserId($list->owner);
             if ($GLOBALS[ACA . 'send_log'] == 1) {
                 if (!empty($owner->email)) {
                     JUTility::sendMail($admin->email, $admin->username, $owner->email, 'Acajoom mailing report', $send);
                 } else {
                     JUTility::sendMail($admin->email, $admin->username, $admin->email, 'Acajoom mailing report', $send);
                 }
             } else {
                 if ($GLOBALS[ACA . 'send_log_closed'] == 1 && connection_aborted()) {
                     if (!empty($owner->email)) {
                         JUTility::sendMail($admin->email, $admin->username, $owner->email, 'Acajoom mailing report', $send);
                     } else {
                         JUTility::sendMail($admin->email, $admin->username, $admin->email, 'Acajoom mailing report', $send);
                     }
                 }
             }
         } else {
             //joomla 1x
             $database->loadObject($admin);
             $owner = subscribers::getSubscriberInfoFromUserId($list->owner);
             if ($GLOBALS[ACA . 'send_log'] == 1) {
                 if (!empty($owner->email)) {
                     mosMail($admin->email, $admin->username, $owner->email, 'Acajoom mailing report', $send);
                 } else {
                     mosMail($admin->email, $admin->username, $admin->email, 'Acajoom mailing report', $send);
                 }
             } else {
                 if ($GLOBALS[ACA . 'send_log_closed'] == 1 && connection_aborted()) {
                     if (!empty($owner->email)) {
                         mosMail($admin->email, $admin->username, $owner->email, 'Acajoom mailing report', $send);
                     } else {
                         mosMail($admin->email, $admin->username, $admin->email, 'Acajoom mailing report', $send);
                     }
                 }
             }
         }
         //endif
     }
     if ($GLOBALS[ACA . 'save_log']) {
         if ($GLOBALS[ACA . 'save_log_simple']) {
             @file_put_contents(ACA_JPATH_ROOT_NO_ADMIN . $GLOBALS[ACA . 'save_log_file'], $log_simple, FILE_APPEND);
         } else {
             @file_put_contents(ACA_JPATH_ROOT_NO_ADMIN . $GLOBALS[ACA . 'save_log_file'], $log_detailed, FILE_APPEND);
         }
     }
 }
Пример #3
0
 function getEditTab($tab, $user, $ui)
 {
     global $Itemid;
     if (ACA_CMSTYPE) {
         // joomla 15
         $my =& JFactory::getUser();
         if ($my->get('id') < 1) {
             echo JText::_('ALERTNOTAUTH');
             echo "<br />" . JText::_('You need to login.');
             return false;
         }
     } else {
         //joomla 1x
         global $my;
         if (intval($my->id) < 1) {
             mosNotAuth();
             return false;
         }
     }
     //endif
     if (!getAcajoomTab::checkInstalled()) {
         return _UE_NEWSLETTERNOTINSTALLED;
     }
     $html = '';
     require_once ACA_JPATH_ROOT_NO_ADMIN . '/administrator/components/com_acajoom/classes/class.acajoom.php';
     require_once ACA_JPATH_ROOT_NO_ADMIN . '/administrator/components/com_acajoom/subscribers.acajoom.html.php';
     if (!empty($user->id)) {
         $userId = $user->id;
         $subscriber = subscribers::getSubscriberInfoFromUserId($userId);
         if (empty($subscriber)) {
             subscribers::syncSubscribers(true);
             $subscriber = subscribers::getSubscriberInfoFromUserId($userId);
         }
         $subscriberId = $subscriber->id;
         $queues = queue::getSubscriberLists($subscriberId);
         $access = acajoom::checkPermissions('admin', $my->id);
     } else {
         $userId = 0;
         $queues = '';
         $access = false;
         $subscriberId = 0;
         $subscriber->id = '';
         $subscriber->user_id = 0;
         $subscriber->name = '';
         $subscriber->email = '';
         $subscriber->receive_html = 1;
         $subscriber->confirmed = 1;
         $subscriber->blacklist = 0;
         $subscriber->timezone = '00:00:00';
         $subscriber->language_iso = 'eng';
         $subscriber->params = '';
         $subscriber->subscribe_date = acajoom::getNow();
     }
     $lists = lists::getLists(0, 0, $subscriberId, '', false, true, false);
     $doShowSubscribers = false;
     $mainLink = '.php?option=com_acajoom';
     $selectLink = '.php?option=com_acajoom&act=subscriber';
     compa::completeLink($mainLink, false);
     compa::completeLink($selectLink, false);
     $forms['main'] = '<form method="post" action="' . $mainLink . '" onsubmit="submitbutton();return false;" name="mosForm" >' . "\n\r";
     $forms['select'] = '<form method="post" action="' . $selectLink . '"  name="AcajoomFilterForm">';
     $html .= subscribersHTML::editSubscriber($subscriber, $lists, $queues, $forms, $access, false, true);
     //$html .= '<input type="hidden" name="Itemid" value="'.$Itemid.'" />';
     $html .= '<input type="hidden" name="subscriber_id" value="' . $subscriber->id . '" />';
     return $html;
 }
Пример #4
0
    function create()
    {
        global $my, $mainframe;
        $Itemid = $GLOBALS[ACA . 'itemidAca'];
        if (!empty($Itemid)) {
            $item = '&Itemid=' . $Itemid;
        } else {
            $item = '';
        }
        $hidden = '';
        $htmlOK = false;
        $h = '';
        if (!empty($this->lists)) {
            if ($my->id > 0) {
                $loggedin = true;
                $subscriber = subscribers::getSubscriberInfoFromUserId($my->id);
            } else {
                $loggedin = false;
            }
            if (!$loggedin and $GLOBALS[ACA . 'allow_unregistered'] and $this->num == 1) {
                $h .= '
				<script language="javascript" type="text/javascript">
					function submitacajoommod(formname) {
						var form = eval(\'document.\'+formname);' . 'var place = form.email.value.indexOf("@",1);' . 'var point = form.email.value.indexOf(".",place+1);';
                if ($this->shownamefield) {
                    $h .= '
						if (form.name.value == "" || form.name.value == "' . addslashes(_ACA_NAME) . '") {
							alert( "' . addslashes(_ACA_REGWARN_NAME) . '" );' . 'return false;
						} else
				';
                }
                $h .= ' if (form.email.value == "" || form.email.value == "' . addslashes(_ACA_EMAIL) . '") {' . 'alert( "' . addslashes(_ACA_REGWARN_MAIL) . '" );' . 'return false;
						} else {' . 'if ((place > -1)&&(form.email.value.length >2)&&(point > 1)){' . 'form.submit();' . 'return true;
							} ' . 'else {' . 'alert( "' . addslashes(_ACA_REGWARN_MAIL) . '" );' . 'return false;' . '}' . '}' . '}' . '</script>';
            }
            mosCommonHTML::loadOverlib();
            $h .= '<link rel="stylesheet" href="' . $GLOBALS['mosConfig_live_site'] . '/components/com_acajoom/css/acajoom.css" type="text/css" >';
            $linkForm = 'index.php?option=com_acajoom';
            if ($GLOBALS[ACA . 'use_sef'] and function_exists('sefRelToAbs')) {
                $h .= '<form action="' . sefRelToAbs($linkForm) . '" method="post" name="modacajoomForm' . $this->num . '">
			<div class="' . $this->moduleclass_sfx . '" style="text-align:' . $this->mod_align . '">';
            } else {
                $h .= '<form action="' . $linkForm . '" method="post" name="modacajoomForm' . $this->num . '">
			<div class="' . $this->moduleclass_sfx . '" style="text-align:' . $this->mod_align . '">';
            }
            if (!empty($this->introtext)) {
                $text = '<span class="pretext' . $this->moduleclass_sfx . '">' . $this->introtext . '</span>';
                $h .= acajoom::printLine($this->linear, $text);
            }
            $i = 0;
            $accessLevel = 0;
            if ($loggedin) {
                $queues = queue::getSubscriberLists($subscriber->id);
            } else {
                $queues = '';
            }
            if ($this->showListName) {
                foreach ($this->lists as $list) {
                    $i++;
                    $subscribed = 0;
                    $accessLevel = 0;
                    if ($loggedin) {
                        if (!empty($queues)) {
                            foreach ($queues as $queue) {
                                if ($list->id == $queue->list_id) {
                                    $subscribed = 1;
                                    $accessLevel = $queue->acc_level;
                                }
                            }
                        }
                    }
                    if ($list->html == 1) {
                        $htmlOK = true;
                    }
                    $checked = 0;
                    if ($loggedin) {
                        $checked = $subscribed;
                    } else {
                        if ($this->defaultchecked) {
                            $checked = 1;
                        }
                        $subscriber->blacklist = 0;
                    }
                    if ($checked != 0) {
                        $checkedPrint = ' checked="checked" ';
                    } else {
                        $checkedPrint = '';
                    }
                    if ($list->hidden == 1) {
                        if ($subscriber->blacklist == 0) {
                            $text = "\n" . '<input id="wz_3' . $i . '" type="checkbox" class="inputbox" value="1" name="subscribed[' . $i . ']" ' . $checkedPrint . ' />';
                        } else {
                            $text = "\n" . '<input type="checkbox" class="inputbox" value="1" name="subscribedfake[' . $i . ']" ' . $checkedPrint . '  />';
                            $text .= "\n" . '<input type="hidden" value="0" name="subscribed[' . $i . ']"  />';
                        }
                        $text .= "\n" . '<input type="hidden" name="sub_list_id[' . $i . ']" value="' . $list->id . '" />';
                        $link = ($list->list_type == '1' or $list->list_type == '7') && $GLOBALS[ACA . 'show_archive'] ? 'index.php?option=com_acajoom' . $item . '&act=mailing&task=archive&listid=' . $list->id . '&listype=' . $list->list_type : '#';
                        $text .= "\n" . '<span class="aca_list_name"';
                        if ($link == "#") {
                            $text .= " onClick='return false;' ";
                        }
                        $text .= '>' . compa::toolTip($list->list_desc, $list->list_name, '', '', $list->list_name, $link, 1) . '</span>';
                        $h .= acajoom::printLine($this->linear, $text);
                        $h .= "\n" . '<input type="hidden" name="acc_level[' . $i . ']" value="' . $accessLevel . '" />' . "\n\r";
                    } else {
                        if (!$loggedin) {
                            $h .= '<input type="hidden"  value="' . $checked . '" name="subscribed[' . $i . ']" />';
                            $h .= "\n" . '<input type="hidden" name="sub_list_id[' . $i . ']" value="' . $list->id . '" />';
                        }
                    }
                }
            } else {
                foreach ($this->lists as $list) {
                    $i++;
                    $subscribed = 0;
                    $accessLevel = 0;
                    if ($loggedin) {
                        if (!empty($queues)) {
                            foreach ($queues as $queue) {
                                if ($list->id == $queue->list_id) {
                                    $subscribed = 1;
                                    $accessLevel = $queue->acc_level;
                                }
                            }
                        }
                    }
                    if ($list->html == 1) {
                        $htmlOK = true;
                    }
                    $checked = 0;
                    if ($loggedin) {
                        $checked = $subscribed;
                    } else {
                        if ($this->defaultchecked) {
                            $checked = 1;
                        }
                    }
                    $h .= '<input type="hidden"  value="' . $checked . '" name="subscribed[' . $i . ']" />';
                    $h .= "\n" . '<input type="hidden" name="sub_list_id[' . $i . ']" value="' . $list->id . '" />';
                    $h .= "\n" . '<input type="hidden" name="acc_level[' . $i . ']" value="' . $accessLevel . '" />';
                    if ($list->html == 1) {
                        $htmlOK = true;
                    }
                }
            }
            if (!$loggedin) {
                if ($GLOBALS[ACA . 'allow_unregistered']) {
                    if ($this->shownamefield) {
                        $text = '<input id="wz_11" type="text" size="' . $this->fieldsize . '" value="' . addslashes(_ACA_NAME) . '" class="inputbox" name="name" onblur="if(this.value==\'\') this.value=\'' . addslashes(_ACA_NAME) . '\';" onfocus="if(this.value==\'' . addslashes(_ACA_NAME) . '\') this.value=\'\' ; " />';
                        $h .= acajoom::printLine($this->linear, $text);
                    } else {
                        $text = '<input id="wz_11" type="hidden" value="" name="name" />';
                    }
                    $text = '<input id="wz_12" type="text" size="' . $this->fieldsize . '" value="' . addslashes(_ACA_EMAIL) . '" class="inputbox" name="email" onblur="if(this.value==\'\') this.value=\'' . addslashes(_ACA_EMAIL) . '\';" onfocus="if(this.value==\'' . addslashes(_ACA_EMAIL) . '\') this.value=\'\' ; " />';
                    $h .= acajoom::printLine($this->linear, $text);
                } else {
                    $h .= acajoom::printLine($this->linear, acajoom::printM('green', _ACA_REGISTER_REQUIRED));
                    $text = _NO_ACCOUNT . " ";
                    if (isset($GLOBALS[ACA . 'cb_integration']) && $GLOBALS[ACA . 'cb_integration']) {
                        $linkme = 'index.php?option=com_comprofiler&amp;task=registers';
                    } else {
                        $linkme = 'index.php?option=com_registration&amp;task=register';
                    }
                    if ($GLOBALS[ACA . 'use_sef'] and function_exists('sefRelToAbs')) {
                        $text .= '<a href="' . sefRelToAbs($linkme) . '">';
                    } else {
                        $text .= '<a href="' . $linkme . '">';
                    }
                    $text .= _CREATE_ACCOUNT . "</a>";
                    $h .= acajoom::printLine($this->linear, $text);
                    $htmlOK = false;
                }
            }
            if ($htmlOK) {
                if ($loggedin and !empty($subscriber)) {
                    $checked = $subscriber->receive_html;
                } else {
                    $checked = $this->receivehtmldefault;
                }
                if ($this->showreceivehtml) {
                    if ($checked != 0) {
                        $checkedPrint = ' checked="checked" ';
                    } else {
                        $checkedPrint = '';
                    }
                    $text = '<input id="wz_2" type="checkbox" class="inputbox" value="1" name="receive_html" ' . $checkedPrint . ' />';
                    $text .= ' ' . _ACA_RECEIVE_HTML;
                    $h .= acajoom::printLine($this->linear, $text);
                } else {
                    $hidden .= '<input id="wz_2" type="hidden" value="' . $checked . '" name="receive_html" />' . "\n";
                }
            } else {
                $hidden .= '<input id="wz_2" type="hidden" value="0" name="receive_html" />' . "\n";
            }
            if (!empty($this->posttext)) {
                $text = '<span class="postext' . $this->moduleclass_sfx . '">' . $this->posttext . '</span>';
                $h .= acajoom::printLine($this->linear, $text);
            }
            if (!$loggedin) {
                if ($GLOBALS[ACA . 'allow_unregistered']) {
                    if (isset($this->imgUnregistered)) {
                        $text = '<input id="aca_22" type="image" src="' . $this->imgUnregistered . '" value="' . $this->buttonUnregistered . '" alt="' . $this->buttonUnregistered . '" name="' . $this->buttonUnregistered . '" onclick="return submitacajoommod(\'modacajoomForm' . $this->num . '\');" />';
                    } else {
                        $text = '<input id="aca_22" type="button" value="' . $this->buttonUnregistered . '" class="button" name="' . $this->buttonUnregistered . '" onclick="return submitacajoommod(\'modacajoomForm' . $this->num . '\');" />';
                    }
                    $h .= acajoom::printLine($this->linear, $text);
                    $h .= '
					</div>
						<input type="hidden" name="act" value="subscribe" />
						<input type="hidden" name="redirectlink" value="' . $this->redirectURL . '" />
						<input type="hidden" name="listname" value="' . $this->showListName . '" />
					';
                } else {
                    $h .= '</div>';
                }
            } else {
                if (isset($this->notifType) and $subscribed) {
                    if (isset($this->imgUnregistered)) {
                        $text = '<input id="aca_22" type="image" src="' . $this->imgUnregistered . '" value="' . $this->buttonUnregistered . '" alt="' . $this->buttonUnregistered . '" name="' . $this->buttonUnregistered . '" onclick="return submitacajoommod(\'modacajoomForm' . $this->num . '\');" />';
                    } else {
                        $text = '<input id="aca_22" type="button" value="' . $this->buttonUnregistered . '" class="button" name="' . $this->buttonUnregistered . '" onclick="return submitacajoommod(\'modacajoomForm' . $this->num . '\');" />';
                    }
                    $h .= acajoom::printLine($this->linear, $text);
                    $h .= '
					</div>
						<input type="hidden" name="act" value="subscribe" />
						<input type="hidden" name="redirectlink" value="' . $this->redirectURL . '" />
						<input type="hidden" name="listname" value="' . $this->showListName . '" />
					';
                } else {
                    if (isset($this->imgRegistered)) {
                        $text = '<input id="aca_22" type="image" src="' . $this->imgRegistered . '" value="' . $this->buttonRegistered . '" alt="' . $this->buttonRegistered . '" name="' . $this->buttonRegistered . '">';
                    } else {
                        $text = '<input id="aca_22"  type="submit" value="' . $this->buttonRegistered . '" name="' . $this->buttonRegistered . '" class="button" />';
                    }
                    $h .= acajoom::printLine($this->linear, $text);
                    $h .= '
					</div>
						<input type="hidden" name="act" value="updatesubscription" />
						<input type="hidden" name="redirectlink" value="' . $this->redirectURL . '" />
						<input type="hidden" name="listname" value="' . $this->showListName . '" />
					';
                }
            }
            $h .= '<input type="hidden" name="Itemid" value="' . $Itemid . '" />';
            $h .= $hidden . '</form>';
        } else {
            $h .= acajoom::printM('blue', _ACA_LIST_NOT_AVAIL);
        }
        $this->_content = $h;
        return $h;
    }
Пример #5
0
 function getEditTab($tab, $user, $ui)
 {
     global $my, $Itemid;
     if (intval($my->id) < 1) {
         mosNotAuth();
         return false;
     }
     if (!getAcajoomTab::checkInstalled()) {
         return _UE_NEWSLETTERNOTINSTALLED;
     }
     $html = '';
     require_once $GLOBALS['mosConfig_absolute_path'] . '/administrator/components/com_acajoom/classes/class.acajoom.php';
     require_once $GLOBALS['mosConfig_absolute_path'] . '/administrator/components/com_acajoom/subscribers.acajoom.html.php';
     if (!empty($user->id)) {
         $userId = $user->id;
         $subscriber = subscribers::getSubscriberInfoFromUserId($userId, false);
         $subscriberId = $subscriber->id;
         $queues = queue::getSubscriberLists($subscriberId);
         $access = acajoom::checkPermissions('admin', $my->id);
     } else {
         $userId = 0;
         $queues = '';
         $access = false;
         $subscriberId = 0;
         $subscriber->id = '';
         $subscriber->user_id = 0;
         $subscriber->name = '';
         $subscriber->email = '';
         $subscriber->receive_html = 1;
         $subscriber->confirmed = 1;
         $subscriber->blacklist = 0;
         $subscriber->timezone = '00:00:00';
         $subscriber->language_iso = 'eng';
         $subscriber->params = '';
         $subscriber->subscribe_date = acajoom::getNow();
     }
     $lists = lists::getLists(0, 0, $subscriberId, '', false, true, false);
     $doShowSubscribers = false;
     if ($ui == 1 and $GLOBALS[ACA . 'use_sef'] and function_exists('sefRelToAbs')) {
         $forms['main'] = '<form method="post" action="' . sefRelToAbs('index.php?option=com_acajoom') . '" onsubmit="submitbutton();return false;" name="mosForm" >' . "\n\r";
         $forms['select'] = '<form method="post" action="' . sefRelToAbs('index.php?option=com_acajoom&act=subscriber') . '"  name="AcajoomFilterForm">';
     } else {
         $forms['main'] = '<form method="post" action="index.php?option=com_acajoom" onsubmit="submitbutton();return false;" name="mosForm" >' . "\n\r";
         $forms['select'] = '<form method="post" action="index.php?option=com_acajoom&act=subscriber"  name="AcajoomFilterForm">';
     }
     $html .= subscribersHTML::editSubscriber($subscriber, $lists, $queues, $forms, $access, false, true);
     //$html .= '<input type="hidden" name="Itemid" value="'.$Itemid.'" />';
     $html .= '<input type="hidden" name="subscriber_id" value="' . $subscriber->id . '" />';
     return $html;
 }