Exemple #1
0
 /**
  * @param string $action
  * @param string $task
  * to display the redirect  on the view
  */
 public static function leads($action, $task)
 {
     if (empty($GLOBALS[JNEWS . 'show_jlinks'])) {
         return true;
     }
     $acajLinkey = 'jnewslink5wroot';
     $acajNewsKey = 'jnewsKa2f6gpw';
     $acajAutoKey = 'jnewsK9dfn7lws';
     $acajSmartKey = 'jnewsK8kd92hf';
     $acajMailKey = 'jnewsKo02j6d4u5aco';
     static $ezlinks = false;
     static $loaded = false;
     //TODO put priority if easylinks and jlinks exist or add checking if easylinks is installed instead of jlinks
     if (!$loaded) {
         if (!defined('JOOBI_SECURE')) {
             define('JOOBI_SECURE', true);
         }
         $joobiEntryPoint = __FILE__;
         if (defined('JPATH_ROOT')) {
             $path = JPATH_ROOT;
         } elseif (isset($mosConfig_absolute_path)) {
             $path = $mosConfig_absolute_path;
         }
         $status = false;
         //if EasyLinks or jLinks is not installed on the website there is no need to proceed
         if (file_exists($path . DS . 'administrator' . DS . 'components' . DS . 'com_jlink' . DS . 'y.php')) {
             //Prioritize Easy Links	loading
             $status = @(include $path . DS . 'administrator' . DS . 'components' . DS . 'com_jlink' . DS . 'y.php');
             if (!$status && !defined('INSTALLER_FOLDER')) {
                 echo "We were unable to load Easy Links library.";
             } else {
                 $ezlinks = true;
             }
         }
         //if Easylinks is not installed or is installed but file include was not successful
         if (!$ezlinks) {
             //if jLinks is not installed on the website there is no need to proceed
             if (!file_exists($path . DS . 'joobi' . DS . 'entry.php')) {
                 return true;
             }
             $status = @(include $path . DS . 'joobi' . DS . 'entry.php');
             if (!$status && !defined('INSTALLER_FOLDER')) {
                 echo "We were unable to load Joobi library.";
             }
         }
         //file include trials failed
         if (!$status) {
             return true;
         }
         $loaded = true;
     }
     switch ($task) {
         case 'show':
             $linkForm = 'option=' . JNEWS_OPTION . '&act=leads&mid=7&type=50';
             $linkForm = jNews_Tools::completeLink($linkForm, false);
             $menuBack = new stdClass();
             $menuBack->popup = new stdClass();
             $menuBack->popup->isPop = false;
             $menuBack->link = $linkForm;
             $menuBack->action = 'back';
             $menuBack->onclick = new stdClass();
             $menuBack->onclick->custom = true;
             $menuBack->onclick->js = 'javascript:history.go(-1)';
             $menuBack->title = _JNEWS_MENU_BACK;
             frontHTML::formStart(_JNEWS_LEADS_REP, 0, '', $menuA);
             $gid = !empty($GLOBALS[JNEWS . 'list_creatorfe']) ? $GLOBALS[JNEWS . 'list_creatorfe'] : 0;
             frontHTML::FEmenu();
             frontHTML::formEndFN(null, '');
             $params = new stdClass();
             $params->controller = 'redirect-history';
             $params->task = 'show';
             $params->option = JNEWS_OPTION;
             $params->level = 50;
             $params->wid = WGet::extension('redirect.node', 'wid');
             $this->layout = WView::get('redirect_historylist', 'html', null, '', $params);
             $view = $this->layout->make();
             break;
         default:
             //default task = listing
             $linkForm = 'option=' . JNEWS_OPTION;
             $linkForm = jNews_Tools::completeLink($linkForm, false);
             $menuCpanel = new stdClass();
             $menuCpanel->popup = new stdClass();
             $menuCpanel->popup->isPop = false;
             $menuCpanel->link = $linkForm;
             $menuCpanel->action = 'cpanel';
             $menuCpanel->onclick = new stdClass();
             $menuCpanel->onclick->custom = true;
             $menuCpanel->onclick->js = 'javascript:history.go(-1)';
             $menuCpanel->title = _JNEWS_MENU_CPANEL;
             $menuA['cpanel'] = $menuCpanel;
             frontHTML::formStart(_JNEWS_LEADS_REP, 0, '', $menuA);
             frontHTML::FEmenu();
             frontHTML::formEndFN(null, '');
             $params = new stdClass();
             $params->controller = 'redirect';
             $params->task = 'listing';
             $params->option = JNEWS_OPTION;
             $params->wid = WGet::extension('redirect.node', 'wid');
             $this->layout = WView::get('redirects_listing', 'html', null, '', $params);
             $view = $this->layout->make();
             $view = str_replace('option=com_jcenter&controller=redirect-history', 'option=' . JNEWS_OPTION . '&act=leads&task=show&mid=7', $view);
             $view = str_replace('option=com_jcenter&controller=redirect&task=edit', 'option=' . JNEWS_OPTION . '&act=leads&mid=7&type=50', $view);
     }
     WPage::addScript(JOOBI_JS . 'rootscript.js');
     echo $view;
     return true;
 }
Exemple #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;
     }
 }