Exemple #1
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;
 }
 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;
 }