Esempio n. 1
0
 function normal($params, $module = null)
 {
     if (isset($module->id)) {
         $this->moduleID = $module->id;
     }
     $this->version_captcha = 2;
     $this->shownamefield = $params->get('shownamefield', 1);
     $this->receivehtmldefault = $params->get('receivehtmldefault', 1);
     $this->showreceivehtml = $params->get('showreceivehtml', 0);
     $this->listIds = $params->get('listids', 0);
     $this->linear = $params->get('linear', 0);
     $this->fieldsize = $params->get('fieldsize', 18);
     $this->introtext = $params->get('introtext', '');
     $this->redirectURL = str_replace('&', '&', $params->get('red_url', ''));
     $this->showListName = $params->get('showlistname', 1);
     $this->buttonUnregistered = $params->get('button_text', _JNEWS_MOD_SUBSCRIBE);
     $this->imgUnregistered = $params->get('button_img', null);
     $this->buttonRegistered = $params->get('button_text_change', _JNEWS_CHANGE_SUBSCRIPTIONS);
     $this->imgRegistered = $params->get('button_img_change', null);
     $this->moduleclass_sfx = $params->get('moduleclass_sfx', null);
     $this->mod_align = $params->get('mod_align', '');
     $this->posttext = $params->get('posttext', '');
     $this->defaultchecked = $params->get('defaultchecked', 1);
     $this->dropdown = $params->get('dropdown', 0);
     $this->selecteddrop = intval($params->get('selecteddrop', 0));
     $this->effect = $params->get('effect', 'normal');
     if (isset($module->effect)) {
         $this->effect = $module->effect;
     }
     $this->cssfile = $params->get('cssfile', 'default.css');
     $this->mootools_btntext = $params->get('mootools_btntext', _JNEWS_MOOTOOLS_BTNTEXT);
     $this->mootools_boxw = $params->get('mootools_boxw', 200);
     $this->mootools_boxh = $params->get('mootools_boxh', 210);
     $this->red_subscription = $params->get('red_subscription', 0);
     $this->module_message = $params->get('module_message', 0);
     $this->enable_captcha = $params->get('enable_captcha', 0);
     //	$this->version_captcha = $params->get('version_captcha' , 2);
     $this->captcha_width = $params->get('captcha_width', 80);
     $this->captcha_height = $params->get('captcha_height', 25);
     $this->captcha_bgcolor = str_replace('#', '', $params->get('captcha_bgcolor', ''));
     $this->captcha_ftcolor = str_replace('#', '', $params->get('captcha_ftcolor', ''));
     $this->show_terms = $params->get('show_terms', 0);
     $this->check_terms = $params->get('check_terms', 0);
     $this->terms_condition = $params->get('terms_condition', '');
     $this->use_new = $params->get('use_new', '1');
     $this->req_name = $params->get('req_name', '1');
     if ($GLOBALS[JNEWS . 'level'] > 2) {
         //check if the version of jnews is pro
         $this->column1 = $params->get('column1', 0);
         $this->column2 = $params->get('column2', 0);
         $this->column3 = $params->get('column3', 0);
         $this->column4 = $params->get('column4', 0);
         $this->column5 = $params->get('column5', 0);
         $this->req_column1 = $params->get('req_column1', 0);
         $this->req_column2 = $params->get('req_column2', 0);
         $this->req_column3 = $params->get('req_column3', 0);
         $this->req_column4 = $params->get('req_column4', 0);
         $this->req_column5 = $params->get('req_column5', 0);
     }
     //end if for check version pro
     $this->lists = jNews_Lists::getSpecifiedLists($this->listIds);
     //	$this->_html = "\n\r" . '<!-- Beginning Module : '.jnews::version().' -->'."\n\r";
     if ($this->use_new) {
         $this->_html = $this->create();
     } else {
         $this->_html = $this->createOld();
     }
     //	$this->_html .= '<!-- End Module : '.jnews::version().' -->'."\n\r";
     return $this->_html;
 }
Esempio n. 2
0
 private static function _processConfirmationEmail($receiver, $subscriberId, $listSub)
 {
     $status = true;
     $listIds = trim(implode(",", $listSub), ',');
     $lists = jNews_Lists::getSpecifiedLists($listIds, false);
     //check that there is at least one list not hidden.
     $haveNotHiddenList = false;
     foreach ($lists as $oneList) {
         if (!empty($oneList->hidden)) {
             $haveNotHiddenList = true;
             break;
         }
     }
     $message = '';
     foreach ($lists as $list) {
         $Sub_TAG = '';
         //if we have a hidden list we dont take the subscirption message
         if ($haveNotHiddenList && empty($list->hidden)) {
             continue;
         }
         if (empty($list->subscribemessage) || substr_count($list->subscribemessage, '{tag:confirm}') < 1) {
             $Sub_TAG = '{tag:confirm}';
             //'[CONFIRM]';
         }
         $mailing = new stdClass();
         $mailing->subject = _JNEWS_SUBSCRIBE_SUBJECT_MESS;
         $mailing->html = 1;
         if (!empty($list->subscribemessage)) {
             $mailing->htmlcontent = $list->subscribemessage . '<br />' . $Sub_TAG;
         } else {
             // default message
             $mailing->htmlcontent = 'Hi {tag:name},<br /><br />Please confirm your subscription to our website by clicking on the following link.<br /><br />';
             $mailing->htmlcontent .= $Sub_TAG;
         }
         $mailing->textonly = '';
         if (!$GLOBALS[JNEWS . 'minisendmail']) {
             $mailing->fromname = $list->sendername;
         }
         $mailing->fromemail = $list->senderemail;
         $mailing->frombounce = $list->bounceadres;
         $mailing->id = 0;
         $mailing->issue_nb = 0;
         $mailing->images = '';
         $mailing->attachments = '';
         $GLOBALS[JNEWS . 'show_signature'] = 0;
         $mailerC = new jNews_ProcessMail();
         if (!$mailerC->send($mailing, $receiver)) {
             $status = false;
         }
         //we send only one notification
         break;
     }
     return $status;
 }
Esempio n. 3
0
 public static function showLists($subscriberId, $listId, $lisType, $action, $task)
 {
     $Itemid = JRequest::getInt('Itemid');
     if (empty($Itemid)) {
         $Itemid = $GLOBALS[JNEWS . 'itemidAca'];
     }
     // we initialize the listType with one
     if (empty($lisType)) {
         $lisType = 1;
     }
     $mainframe = JFactory::getApplication();
     $my = JFactory::getUser();
     $gid = !empty($GLOBALS[JNEWS . 'list_creatorfe']) ? $GLOBALS[JNEWS . 'list_creatorfe'] : 0;
     if (version_compare(JVERSION, '1.6.0', '<')) {
         $listsAddEdit = jNews_Lists::getIDswithacclevel($my->gid);
     } else {
         $groups = JAccess::getGroupsByUser($my->id);
         $listsAddEdit = jNews_Lists::getIDswithacclevel($groups);
     }
     if (!empty($my->id)) {
         $ownedlists = jNews_Lists::getOwnedlists($my->id);
         //UPDATE321
         $lists = jNews_Lists::getLists(0, 0, true);
         $access = false;
         foreach ($lists as $list) {
             $bit = jnews::checkPermissions($list->acc_level);
             if ($bit) {
                 $access = true;
                 break;
             }
         }
         if (!$access && empty($listsAddEdit) && empty($ownedlists) && !jnews::checkPermissions('admin') && !jnews::checkPermissions($gid)) {
             frontHTML::showPanel();
             return true;
         }
     }
     //for popup window
     JHTML::_('behavior.modal');
     switch ($task) {
         case 'new':
         case 'add':
             $access = 'admin';
             $id = 0;
             if ($GLOBALS[JNEWS . 'enable_jsub']) {
                 if (!empty($my->id)) {
                     $ownedlists = jNews_Lists::getOwnedlists($my->id);
                 }
                 if (!empty($ownedlists)) {
                     $access = strtolower($my->usertype);
                 }
                 $id = $my->id;
             }
             if (jnews::checkPermissions($access) || jnews::checkPermissions($gid)) {
                 //traces
                 $task = 'save';
                 $subscriber = jNews_Subscribers::getSubscriberInfoFromUserId($my->id);
                 if (version_compare(JVERSION, '1.6.0', '<')) {
                     //j15
                     $acl = JFactory::getACL();
                     $groups = $acl->get_group_children_tree(null, 'USERS', false);
                 } else {
                     //j16
                     $db = JFactory::getDBO();
                     $db->setQuery('SELECT a.*, a.title as text, a.id as value  FROM #__usergroups AS a ORDER BY a.lft ASC');
                     $groups = $db->loadObjectList();
                 }
                 $allGroupIds = array();
                 foreach ($groups as $oneGroup) {
                     $allGroupIds[] = $oneGroup->value;
                 }
                 $newList = new stdClass();
                 $newList->id = '';
                 $newList->html = 1;
                 $newList->new_letter = 1;
                 $newList->list_name = '';
                 $newList->list_desc = '';
                 if (empty($subscriber)) {
                     $newList->sendername = '';
                     $newList->senderemail = '';
                     $newList->bounceadres = '';
                     //$GLOBALS[JNEWS.'sendmail_from'];
                 } else {
                     $newList->sendername = $subscriber->name;
                     $newList->senderemail = $subscriber->email;
                     $newList->bounceadres = $subscriber->email;
                 }
                 $newList->hidden = 1;
                 $newList->auto_add = 0;
                 $newList->list_type = $lisType;
                 $newList->delay_min = 1;
                 $newList->delay_max = 7;
                 $newList->user_choose = 0;
                 $newList->cat_id = '0:0';
                 $newList->follow_up = '';
                 $newList->notify_id = 0;
                 $newList->owner = $my->id;
                 $newList->acc_level = '24,25,7,8';
                 $newList->acc_id = implode(',', $allGroupIds);
                 $newList->published = 1;
                 $newList->start_date = date('Y-m-d', jnews::getNow(0, true));
                 $newList->next_date = jnews::getNow(0, true);
                 $newList->subscribemessage = _JNEWS_DEFAULT_SUBSCRIBE_MESS;
                 $newList->unsubscribemessage = _JNEWS_DEFAULT_UNSUBSCRIBE_MESS;
                 $newList->notifyadminmsg = _JNEWS_UNSUBSCRIBE_ADMIN_NOTIFICATION;
                 $newList->subnotifymsg = _JNEWS_SUBSDEFAULT_NOTIFYMSG;
                 $newList->subnotifysend = 1;
                 $newList->unsubscribesend = 1;
                 $newList->unsubscribenotifyadmin = 1;
                 $newList->footer = 1;
                 $linkForm = 'option=' . JNEWS_OPTION;
                 $linkForm = jNews_Tools::completeLink($linkForm, false, false);
                 $mainLink = JRoute::_('index.php?option=' . JNEWS_OPTION);
                 $forms['main'] = "<form action='{$mainLink}' method='post' name='adminForm' enctype='multipart/form-data' onsubmit='submitbutton();return false;' id=\"adminForm\">";
                 $show = jNews_ListType::showType($lisType, 'editlist');
                 // menus for list edit
                 // menu save
                 $linkForm = jNews_Tools::completeLink($linkForm, true);
                 $linkForm = '#';
                 $menuSave = new stdClass();
                 $menuSave->popup = new stdClass();
                 $menuSave->popup->isPop = false;
                 $menuSave->link = $linkForm;
                 $menuSave->action = 'save';
                 $menuSave->onclick = new stdClass();
                 $menuSave->onclick->custom = false;
                 $menuSave->onclick->js = '';
                 $menuSave->title = _JNEWS_SAVE;
                 // menu cancel
                 $menuCancel = new stdClass();
                 $menuCancel->popup = new stdClass();
                 $menuCancel->popup->isPop = false;
                 $menuCancel->link = jNews_Tools::completeLink('option=' . JNEWS_OPTION . '&act=list&Itemid=' . $Itemid, false);
                 $menuCancel->action = 'cancel';
                 $menuCancel->onclick = new stdClass();
                 $menuCancel->onclick->custom = true;
                 $menuCancel->onclick->js = '';
                 $menuCancel->title = _JNEWS_CANCEL;
                 $link = 'option=' . JNEWS_OPTION;
                 $link = jNews_Tools::completeLink($link, false);
                 $menuCpanel = new stdClass();
                 $menuCpanel->popup = new stdClass();
                 $menuCpanel->popup->isPop = false;
                 $menuCpanel->popup->isPop = false;
                 $menuCpanel->link = $link;
                 $menuCpanel->action = 'cpanel';
                 $menuCpanel->onclick = new stdClass();
                 $menuCpanel->onclick->custom = false;
                 $menuCpanel->onclick->js = '';
                 $menuCpanel->title = _JNEWS_MENU_CPANEL;
                 $menuA = array();
                 $menuA['save'] = $menuSave;
                 $menuA['cancel'] = $menuCancel;
                 $menuA['cpanel'] = $menuCpanel;
                 frontHTML::formStart(_JNEWS_EDIT_A . @constant($GLOBALS[JNEWS . 'listname' . $lisType]) . ' ' . _JNEWS_LIST, $newList->html, 'listedit', $menuA);
                 jNews_ListsHTML::editList($newList, $forms, $show, $lisType);
                 $go[] = jnews::makeObj('list_id', $newList->id);
                 $go[] = jnews::makeObj('act', $action);
                 $go[] = jnews::makeObj('task', '');
                 $go[] = jnews::makeObj('listype', JRequest::getInt('listype'));
                 frontHTML::formEndFN(null, $go);
             }
             break;
         case 'edit':
             $access = 'admin';
             $id = 0;
             if ($GLOBALS[JNEWS . 'enable_jsub']) {
                 if (!empty($my->id)) {
                     $ownedlists = jNews_Lists::getOwnedlists($my->id);
                 }
                 if (!empty($ownedlists)) {
                     $access = strtolower($my->usertype);
                 }
                 $id = $my->id;
             }
             if (jnews::checkPermissions($access) || jnews::checkPermissions($gid)) {
                 //traces
                 $task = 'update';
                 $list = jNews_Lists::getLists($listId, $lisType, $subscriberId, '', false, false, false);
                 $listEdit = $list[0];
                 $listEdit->new_letter = 0;
                 if (!empty($listEdit)) {
                     $linkForm = 'option=' . JNEWS_OPTION;
                     $linkForm = jNews_Tools::completeLink($linkForm, false, false);
                     $mainLink = JRoute::_('index.php?option=' . JNEWS_OPTION);
                     $forms['main'] = "<form action='{$mainLink}' method='post' name='adminForm' enctype='multipart/form-data' onsubmit='submitbutton();return false;' id=\"adminForm\">";
                     $show = jNews_ListType::showType($listEdit->list_type, 'editlist');
                     // menus for list edit
                     // menu save
                     $linkForm = 'option=' . JNEWS_OPTION . '&act=list&listid=' . $listId . '&listype=' . $lisType . '&siteend=1&Itemid=' . $Itemid;
                     $linkForm = jNews_Tools::completeLink($linkForm, false);
                     $menuSave = new stdClass();
                     $menuSave->popup = new stdClass();
                     $menuSave->popup->isPop = false;
                     $menuSave->link = $linkForm;
                     $menuSave->action = 'save';
                     $menuSave->onclick = new stdClass();
                     $menuSave->onclick->custom = false;
                     $menuSave->onclick->js = '';
                     $menuSave->title = _JNEWS_SAVE;
                     // menu cancel
                     $menuCancel = new stdClass();
                     $menuCancel->popup = new stdClass();
                     $menuCancel->popup->isPop = false;
                     $menuCancel->link = jNews_Tools::completeLink('option=' . JNEWS_OPTION . '&act=list&Itemid=' . $Itemid, false);
                     $menuCancel->action = 'cancel';
                     $menuCancel->onclick = new stdClass();
                     $menuCancel->onclick->custom = true;
                     $menuCancel->onclick->js = '';
                     $menuCancel->title = _JNEWS_CANCEL;
                     $link = 'option=' . JNEWS_OPTION;
                     $link = jNews_Tools::completeLink($link, false);
                     $menuCpanel = new stdClass();
                     $menuCpanel->popup = new stdClass();
                     $menuCpanel->popup->isPop = false;
                     $menuCpanel->popup->isPop = false;
                     $menuCpanel->link = $link;
                     $menuCpanel->action = 'cpanel';
                     $menuCpanel->onclick = new stdClass();
                     $menuCpanel->onclick->custom = false;
                     $menuCpanel->onclick->js = '';
                     $menuCpanel->title = _JNEWS_MENU_CPANEL;
                     $menuA = array();
                     if (@(include_once JNEWSPATH_ADMIN . 'social' . DS . 'class.social.php')) {
                         if (class_exists('jNews_Social')) {
                             $menuA['save'] = $menuSave;
                             $menuA['cancel'] = $menuCancel;
                         }
                     }
                     $menuA['cpanel'] = $menuCpanel;
                     frontHTML::formStart(_JNEWS_EDIT_A . @constant($GLOBALS[JNEWS . 'listname' . $lisType]) . ' ' . _JNEWS_LIST, $listEdit->html, 'listedit', $menuA);
                     jNews_ListsHTML::editList($listEdit, $forms, $show, $lisType);
                     $go[] = jnews::makeObj('list_id', $listEdit->id);
                     $go[] = jnews::makeObj('act', $action);
                     $go[] = jnews::makeObj('task', 'update');
                     frontHTML::formEndFN(null, $go);
                 }
             }
             break;
         case 'save':
             JRequest::checkToken() or die('Invalid Token');
             if (empty($listId)) {
                 if (@(include_once JNEWSPATH_ADMIN . 'social' . DS . 'class.social.php')) {
                     if (class_exists('jNews_Social')) {
                         $status = jNews_Social::createFrontendList($action, $task, $lisType);
                     }
                 }
                 $msgtype = $status ? 'ok' : 'no';
                 $message = jnews::printYN($msgtype, _JNEWS_LIST_ADDED, _JNEWS_ERROR);
                 if ($mainframe->isAdmin()) {
                     jNews_Tools::redirect('index.php?option=' . JNEWS_OPTION . '&act=list&listype=' . $lisType . '&siteend=1');
                 } else {
                     $mainLink = JRoute::_('index.php?option=' . JNEWS_OPTION . '&act=list&listype=' . $lisType . '&siteend=1');
                     jNews_Tools::redirect($mainLink);
                 }
                 echo $message;
             } else {
                 $lisType = jNews_Lists::getListType($listId);
                 $message = jnews::printYN(jNews_Lists::updateListFromEdit($listId, '', false, $lisType), _JNEWS_LIST_UPDATED, _JNEWS_ERROR);
                 //						jNews_Tools::redirect('index.php?option='.JNEWS_OPTION.'&act=list&listype='.$lisType.'&siteend=1');
                 if ($mainframe->isAdmin()) {
                     jNews_Tools::redirect('index.php?option=' . JNEWS_OPTION . '&act=list&listype=' . $lisType . '&siteend=1');
                 } else {
                     $mainLink = JRoute::_('index.php?option=' . JNEWS_OPTION . '&act=list&listype=' . $lisType . '&siteend=1');
                     jNews_Tools::redirect($mainLink);
                 }
                 echo $message;
                 $listId = 0;
             }
             break;
         case 'ownerslists':
             $ownerid = JRequest::getVar('ownerid', 0);
             $item = JRequest::getInt('Itemid');
             $ownerslists = jNews_Lists::getSpecifiedLists(0, '', $ownerid);
             $module = new jnews_module();
             $module->lists = $ownerslists;
             $module->showListName = true;
             $module->defaultchecked = true;
             $module->dropdown = false;
             $module->shownamefield = true;
             $HTML = $module->create();
             echo $HTML;
             break;
         case 'make':
         case 'forms':
             if (class_exists('jNews_CreateForm')) {
                 jNews_CreateForm::taskOptions($task);
                 $showLists = false;
             } else {
                 $showLists = true;
             }
             break;
         case 'cpanel':
             jNews_Tools::redirect('index.php?option=' . JNEWS_OPTION);
             break;
         default:
             $my = JFactory::getUser();
             $show = jNews_ListType::showType($lisType, 'showListsFront');
             $msgtype = JRequest::getVar('msg', '');
             if (!empty($msgtype)) {
                 if ($msgtype == 'no') {
                     echo jnews::printM($msgtype, _JNEWS_ERROR);
                 } else {
                     echo jnews::printM($msgtype, _JNEWS_LIST_ADDED);
                 }
             }
             $mainLink = JRoute::_('index.php?option=' . JNEWS_OPTION);
             $forms['main'] = '<form method="post" action="' . $mainLink . '" onsubmit="submitbutton();return false;" name="mosForm" >' . "\n\r";
             //$link
             $forms['main'] .= '<input type="hidden" name="Itemid" value="' . $Itemid . '" />';
             $order = 'listnameA';
             $id = 0;
             if ($GLOBALS[JNEWS . 'enable_jsub']) {
                 if (!empty($my->id)) {
                     $ownedlists = jNews_Lists::getOwnedlists($my->id);
                 }
                 if (!empty($ownedlists)) {
                     $id = $my->id;
                 }
             }
             if (jnews::checkPermissions('admin') || jnews::checkPermissions($gid) || !empty($listsAddEdit)) {
                 if ($mainframe->isAdmin()) {
                     $lists = jNews_Lists::getLists($listId, $lisType, $subscriberId, $order, false, false, false);
                 } else {
                     $lists = jNews_Lists::getLists($listId, $lisType, $subscriberId, $order, false, true, false, false, true);
                 }
             } else {
                 if ($mainframe->isAdmin()) {
                     if ($lisType == 0) {
                         $lists1 = jNews_Lists::getLists($listId, 1, $subscriberId, $order, false, true, false);
                         $lists2 = jNews_Lists::getLists($listId, 2, $subscriberId, $order, false, true, false);
                         $lists7 = jNews_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 = jNews_Lists::getLists($listId, $lisType, $subscriberId, $order, false, true, false);
                     } else {
                         $lists = '';
                     }
                 } else {
                     if ($lisType == 0) {
                         //get the owned list of the logged user
                         $ownedlists = 0;
                         if ($GLOBALS[JNEWS . 'enable_jsub']) {
                             $my = JFactory::getUser();
                             if (!empty($my->id)) {
                                 $ownedlists = jNews_Lists::getOwnedlists($my->id);
                             }
                             if (!empty($ownedlists)) {
                                 $access = true;
                             }
                         }
                         $lists1 = jNews_Lists::getLists($listId, 1, $subscriberId, $order, false, true, false, false, true, '', '', $ownedlists, $my->id);
                         $lists2 = jNews_Lists::getLists($listId, 2, $subscriberId, $order, false, true, false, false, true);
                         $lists7 = jNews_Lists::getLists($listId, 7, $subscriberId, $order, false, true, false, false, true);
                         $lists = array_merge($lists1, $lists2, $lists7);
                     } elseif ($lisType == 1 or $lisType == 2 or $lisType == 7) {
                         $lists = jNews_Lists::getLists($listId, $lisType, $subscriberId, $order, false, true, false, false, true);
                     } else {
                         $lists = '';
                     }
                 }
             }
             if (!empty($lists) || jnews::checkPermissions($gid)) {
                 $menuA = null;
                 if ($my->id > 0) {
                     $link = 'option=' . JNEWS_OPTION;
                     $link = jNews_Tools::completeLink($link, false);
                     $menuCpanel = new stdClass();
                     $menuCpanel->popup = new stdClass();
                     $menuCpanel->popup->isPop = false;
                     $menuCpanel->popup->isPop = false;
                     $menuCpanel->link = $link;
                     $menuCpanel->action = 'cpanel';
                     $menuCpanel->onclick = new stdClass();
                     $menuCpanel->onclick->custom = false;
                     $menuCpanel->onclick->js = '';
                     $menuCpanel->title = _JNEWS_MENU_CPANEL;
                     $menuShare = new stdClass();
                     $menuForms = new stdClass();
                     $menuNew = new stdClass();
                     $itemId = $GLOBALS[JNEWS . 'itemidAca'];
                     if ($GLOBALS[JNEWS . 'enable_jsub'] && !empty($ownedlists) || jnews::checkPermissions('admin') || jnews::checkPermissions($gid)) {
                         $linkShare = 'option=' . JNEWS_OPTION . '&act=list&task=ownerslists&ownerid=' . $my->id . '&Itemid=' . $itemId;
                         $linkShare = jNews_Tools::completeLink($linkShare, false);
                         $menuShare = new stdClass();
                         $menuShare->popup = new stdClass();
                         $menuShare->popup->isPop = false;
                         $menuShare->link = $linkShare;
                         $menuShare->action = 'share';
                         $menuShare->onclick = new stdClass();
                         $menuShare->onclick->custom = false;
                         $menuShare->onclick->js = '';
                         $menuShare->title = 'Share';
                         $menuBack = new stdClass();
                         $menuBack->popup = new stdClass();
                         $menuBack->popup = new stdClass();
                         $menuBack->popup->isPop = false;
                         $menuBack->link = jNews_Tools::completeLink('option=' . JNEWS_OPTION . '&act=list&Itemid=' . $Itemid, false);
                         $menuBack->action = 'back';
                         $menuBack->onclick = new stdClass();
                         $menuBack->onclick->custom = true;
                         $menuBack->onclick->js = '';
                         $menuBack->title = _JNEWS_MENU_BACK;
                         $menuDelete = new stdClass();
                         $menuDelete->popup = new stdClass();
                         $menuDelete->popup->isPop = false;
                         $menuDelete->link = '#';
                         $menuDelete->action = 'delete';
                         $menuDelete->onclick = new stdClass();
                         $menuDelete->onclick->custom = false;
                         $menuDelete->onclick->js = '';
                         $menuDelete->title = _JNEWS_DELETE;
                         $menuForms = new stdClass();
                         $menuNew = new stdClass();
                         if ($GLOBALS[JNEWS . 'enable_jsub'] && !empty($ownedlists)) {
                             $linkForm = jNews_Tools::completeLink('option=' . JNEWS_OPTION . '&act=list&task=make', false, false, true);
                             $menuForms->link = $linkForm;
                             $menuForms->popup = new stdClass();
                             $menuForms->popup->isPop = true;
                             $menuForms->popup->rel = true;
                             $menuForms->popup->x = 750;
                             $menuForms->popup->y = 500;
                             $menuForms->action = 'form';
                             $menuForms->title = 'Create Form';
                             $linknew = 'option=com_jsubscription&view=jsubscription&task=listing&Itemid=' . $itemId;
                             $menuNew = new stdClass();
                             $menuNew->popup = new stdClass();
                             $menuNew->popup->isPop = false;
                             $menuNew->action = 'new';
                             $menuNew->onclick = new stdClass();
                             $menuNew->onclick->custom = true;
                             $menuNew->onclick->js = '';
                             $menuNew->title = 'New';
                             $menuNew->link = $linknew;
                         } else {
                             if (@(include_once JNEWSPATH_ADMIN . 'social' . DS . 'class.social.php')) {
                                 if (class_exists('jNews_Social')) {
                                     //									if($lisType == 1){
                                     $linkForm = jNews_Tools::completeLink('option=' . JNEWS_OPTION . '&act=list&task=make', true, false, true);
                                     $menuForms->link = $linkForm;
                                     $menuForms->popup = new stdClass();
                                     $menuForms->popup->isPop = true;
                                     $menuForms->popup->rel = true;
                                     $menuForms->popup->x = 750;
                                     $menuForms->popup->y = 500;
                                     $menuForms->action = 'form';
                                     $menuForms->title = 'Create Form';
                                     //										$linknew = 'option='.JNEWS_OPTION.'&act=list&task=new&listype='.$lisType.'&siteend=1&Itemid='.$itemId;
                                     $mainLink = JRoute::_('index.php?option=' . JNEWS_OPTION);
                                     $menuNew = new stdClass();
                                     $menuNew->popup = new stdClass();
                                     $menuNew->popup->isPop = false;
                                     //										$linknew = jNews_Tools::completeLink($linknew,false);
                                     $linknew = '#';
                                     // #
                                     $menuNew->action = 'new';
                                     $menuNew->onclick = new stdClass();
                                     $menuNew->onclick->custom = true;
                                     $menuNew->onclick->js = "javascript: submitbutton('new')";
                                     $menuNew->title = 'New';
                                     $menuNew->link = $linknew;
                                 }
                                 //								}
                             }
                         }
                         $menuUnpub = new stdClass();
                         $menuUnpub->popup = new stdClass();
                         $menuUnpub->popup->isPop = false;
                         $menuUnpub->link = '#';
                         $menuUnpub->action = 'unpublished';
                         $menuUnpub->onclick = new stdClass();
                         $menuUnpub->onclick->custom = true;
                         $menuUnpub->onclick->js = 'javascript:history.go(-1)';
                         $menuUnpub->title = 'Unpublished';
                         $menuPub = new stdClass();
                         $menuPub->popup = new stdClass();
                         $menuPub->popup->isPop = false;
                         $menuPub->link = '#';
                         $menuPub->action = 'published';
                         $menuPub->onclick = new stdClass();
                         $menuPub->onclick->custom = true;
                         $menuPub->onclick->js = 'javascript:history.go(-1)';
                         $menuPub->title = 'Published';
                         $menuCopy = new stdClass();
                         $menuCopy->popup = new stdClass();
                         $menuCopy->popup->isPop = false;
                         $menuCopy->link = '#';
                         $menuCopy->action = 'copy';
                         $menuCopy->onclick = new stdClass();
                         $menuCopy->onclick->custom = true;
                         $menuCopy->onclick->js = 'javascript:history.go(-1)';
                         $menuCopy->title = 'Copy';
                         $menuDivider = new stdClass();
                         $menuDivider->divider = true;
                     }
                     $menuA = array();
                     if ($lisType == '2') {
                         $menuA['new'] = $menuNew;
                         $menuA['cpanel'] = $menuCpanel;
                     } else {
                         if ($GLOBALS[JNEWS . 'enable_jsub']) {
                             $menuA['share'] = $menuShare;
                         }
                         $menuA['form'] = $menuForms;
                         $menuA['new'] = $menuNew;
                         $menuA['cpanel'] = $menuCpanel;
                     }
                 }
                 if ($lisType == 1) {
                     $title = _JNEWS_EMAIL_LISTS;
                 } else {
                     $title = 'Auto-responders';
                 }
                 if (empty($my->id)) {
                     $title = _JNEWS_SUBSCRIBE_LIST2;
                 }
                 if (empty($ownedlists) && !empty($my->id)) {
                     $title = _JNEWS_SUBSCRIBE_LIST2;
                 }
                 $gid = !empty($GLOBALS[JNEWS . 'list_creatorfe']) ? $GLOBALS[JNEWS . 'list_creatorfe'] : 0;
                 frontHTML::formStart($title, 0, '', $menuA);
                 frontHTML::FEmenu();
                 if ($show['list_type']) {
                     $show['list_type'] = jNews_ListType::checkOthers();
                 }
                 $setSort = new stdClass();
                 $setSort->orderDir = '';
                 $setSort->orderValue = '';
                 if (class_exists('jNews_Pro')) {
                     $id = 0;
                     if ($GLOBALS[JNEWS . 'enable_jsub']) {
                         if (!empty($my->id)) {
                             $ownedlists = jNews_Lists::getOwnedlists($my->id);
                         }
                         if (!empty($ownedlists)) {
                             $id = $my->id;
                         }
                     }
                     $access = false;
                     foreach ($lists as $list) {
                         $bit = jnews::checkPermissions($list->acc_level);
                         if ($bit) {
                             $access = true;
                             break;
                         }
                     }
                     $my = JFactory::getUser();
                     //owner of the list to access the list
                     if ($GLOBALS[JNEWS . 'enable_jsub']) {
                         if (!empty($my->id)) {
                             $ownedlists = jNews_Lists::getOwnedlists($my->id);
                         }
                         if (!empty($ownedlists)) {
                             $access = true;
                             $usertype = strtolower($my->usertype);
                         }
                     }
                     if ($access) {
                         jNews_Pro::showListingLists($lists, $action, 'edit', $forms, $show, $my->id);
                         $go[] = jnews::makeObj('listype', JRequest::getInt('listype'));
                     } else {
                         jNews_ListsHTML::showListingLists($lists, $action, 'edit', $forms, $show, '', 0, null, null, $setSort);
                         $go[] = jnews::makeObj('listype', JRequest::getInt('listype'));
                     }
                 } else {
                     jNews_ListsHTML::showListingLists($lists, $action, 'edit', $forms, $show, '', 0, null, null, $setSort);
                 }
                 $go[] = jnews::makeObj('act', $action);
                 frontHTML::formEnd('', $go);
             } else {
                 frontHTML::FEmenu();
             }
             break;
     }
 }
Esempio n. 4
0
 function getDisplayRegistration($tab, $user, $ui)
 {
     $my = JFactory::getUser();
     require_once JNEWS_JPATH_ROOT_NO_ADMIN . DS . 'administrator' . DS . 'components' . DS . JNEWS_OPTION . DS . 'classes' . DS . 'class.jnews.php';
     require_once JNEWS_JPATH_ROOT_NO_ADMIN . DS . 'administrator' . DS . 'components' . DS . JNEWS_OPTION . DS . 'classes' . DS . 'class.lists.php';
     $html = '';
     if ($GLOBALS['jnews_cb_plugin'] == '1') {
         $lists = jNews_Lists::getSpecifiedLists($GLOBALS['jnews_cb_listIds'], false);
         if (!empty($lists)) {
             $i = 0;
             $accessLevel = 18;
             //default access level jack 31
             $htmlOK = false;
             if (!empty($GLOBALS['jnews_cb_intro'])) {
                 $html .= '<tr><td class="titleCell" colspan="2">' . $GLOBALS['jnews_cb_intro'] . '</td></tr>';
             }
             if ($GLOBALS['jnews_cb_showname']) {
                 foreach ($lists as $list) {
                     $i++;
                     $subscribed = 0;
                     if ($list->html == 1) {
                         $htmlOK = true;
                     }
                     $checked = $GLOBALS['jnews_cb_checkLists'];
                     if ($list->hidden == 1) {
                         $subscriber->blacklist = 0;
                         if ($checked != 0) {
                             $checkedPrint = ' checked="checked" ';
                         } else {
                             $checkedPrint = '';
                         }
                         $html .= '<tr>';
                         if ($GLOBALS['jnews_cb_checkLists'] == 1) {
                             $text = "\n" . '<td class="titleCell" style="text-align: right;"><input type="checkbox" class="inputbox" value="1" name="subscribed[' . $i . ']" checked="checked" /></td>';
                         } else {
                             $text = "\n" . '<td class="titleCell" style="text-align: right;"><input type="checkbox" class="inputbox" value="1" name="subscribed[' . $i . ']" ' . $checkedPrint . ' /></td>';
                         }
                         $text .= "\n" . '<input type="hidden" name="sub_list_id[' . $i . ']" value="' . $list->id . '" />';
                         $text .= "\n" . '<td class="fieldCell"><span class="aca_list_name" onclick=\'return false;\'>' . jNews_Tools::toolTip($list->list_desc, $list->list_name, '', '', $list->list_name, '#', 1) . '</span></td>';
                         $html .= $text;
                         $html .= '</tr>';
                     } else {
                         $html .= '<input type="hidden"  value=1 name="subscribed[' . $i . ']" />';
                         $html .= "\n" . '<input type="hidden" name="sub_list_id[' . $i . ']" value="' . $list->id . '" />';
                     }
                     $html .= "\n" . '<input type="hidden" name="acc_level[' . $i . ']" value="' . $accessLevel . '" />';
                 }
             } else {
                 foreach ($lists as $list) {
                     $i++;
                     $html .= '<input type="hidden"  value="1" name="subscribed[' . $i . ']" />';
                     $html .= "\n" . '<input type="hidden" name="sub_list_id[' . $i . ']" value="' . $list->id . '" />';
                     $html .= "\n" . '<input type="hidden" name="acc_level[' . $i . ']" value="' . $accessLevel . '" />';
                     if ($list->html == 1) {
                         $htmlOK = true;
                     }
                 }
             }
             $checked = $GLOBALS['jnews_cb_defaultHTML'];
             if ($htmlOK) {
                 if ($GLOBALS['jnews_cb_showHTML']) {
                     $html .= '<tr>';
                     if ($checked != 0) {
                         $checkedPrint = ' checked="checked" ';
                     } else {
                         $checkedPrint = '';
                     }
                     $text = '<td class="titleCell" style="text-align: right;"><input type="checkbox" class="inputbox" value="1" name="receive_html" ' . $checkedPrint . ' /></td>';
                     $text .= '<td class="fieldCell">' . _JNEWS_RECEIVE_HTML . '</td>';
                     $html .= jnews::printLine(false, $text);
                     $html .= '</tr>';
                 } else {
                     $html .= '<input type="hidden" value="' . $checked . '" name="receive_html" />' . "\n";
                 }
             } else {
                 $html .= '<input type="hidden" value="' . $checked . '" name="receive_html" />' . "\n";
             }
         } else {
             $html = '<input type="hidden" value="' . $GLOBALS['jnews_cb_defaultHTML'] . '" name="receive_html" />' . "\n";
         }
     } else {
         $html = '<input type="hidden" value="' . $GLOBALS['jnews_cb_defaultHTML'] . '" name="receive_html" />' . "\n";
     }
     return $html;
 }