Пример #1
0
 public function _getOriginalHTML()
 {
     if (defined('JPATH_ROOT')) {
         $path = JPATH_ROOT;
     } else {
         global $mosConfig_absolute_path;
         $path = $mosConfig_absolute_path;
     }
     $status = (include $path . DIRECTORY_SEPARATOR . 'acctexp' . DIRECTORY_SEPARATOR . 'acctexp.php');
     if (!$status && !defined('INSTALLER_FOLDER')) {
         echo "We were unable to load the AEC library. If you removed the AEC folder, please also remove this plugins from the Joomla plugins manager.";
     }
     $user =& CFactory::getActiveProfile();
     // get the memberID
     $membersSessionC =& WGet::classes('members.session');
     $myMember = $membersSessionC->getMember($user->_userid, true);
     $memberId = $myMember->uid;
     // if we dont have member we dont show the view
     if (empty($memberId)) {
         return;
     }
     // set the value for the view filter
     WGlobals::setVar('integrationmemberid', $memberId);
     WGlobals::setVar('extensionKEY', 'subscription.node', 'acctexp');
     // Show the view
     $integrationV = WView::get('subscription_widget_integration');
     if (empty($integrationV)) {
         return '';
     }
     $HTMLoutput .= $integrationV->make();
     return $HTMLoutput;
 }
Пример #2
0
 private function _oneExtension($wid = 0)
 {
     $folder = WExtension::get($wid, 'folder');
     $component = 'com_' . $folder;
     $joomlaExtensionsM = WModel::get('joomla.extensions');
     $joomlaExtensionsM->whereE('type', 'component');
     $joomlaExtensionsM->whereE('element', $component);
     $id = $joomlaExtensionsM->load('lr', 'extension_id');
     $joomlaExtensionsM = WModel::get('joomla.extensions');
     $joomlaExtensionsM->whereE('extension_id', $id);
     $joomlaExtensionsM->delete();
     $joomlaMenuM = WModel::get('joomla.menu');
     $joomlaMenuM->whereE('component_id', $id);
     $joomlaMenuM->delete();
     $assetsT = WTable::get('assets');
     $assetsT->whereE('name', $component);
     $assetsT->delete();
     $folderS = WGet::folder();
     $folderS->delete(JOOBI_DS_ADMIN . $component);
     $folderS->delete(JOOBI_DS_ROOT . 'components' . DS . $component);
 }
Пример #3
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;
 }
Пример #4
0
 /**
  * This function is used in the integration of jLinks to jNews. jNews
  * categories are checked and jLinks entries are categorized. This is also
  * where the mail content is scanned for url links and replaced with
  * jLinks generated links with the namekeys of the original links.
  *
  * @param int $mailingType list type whether Newsletter, Auto-Responder,
  *                     or Smart Newsletter
  * @param object contains the mailer
  * @param int $mailID email ID to be used as suffix of the mail category namekey
  * @param string $mailSubject title or subject of the email
  * @param int $mailCatID determines if the mail category is created or not
  * @param array $convertedLinks container of the content converted links
  * @param int $subsid subscriber id
  *
  **/
 function _linkReplacement($mailingType, $mailID, $mailSubject, $mail, &$mailCatID, &$convertedLinks, $subsid)
 {
     if (empty($GLOBALS[JNEWS . 'show_jlinks'])) {
         return true;
     }
     $acajLinkey = 'jnewslink5wroot';
     $acajNewsKey = 'jnewsKa2f6gpw';
     $acajAutoKey = 'jnewsK9dfn7lws';
     $acajSmartKey = 'jnewsK8kd92hf';
     $acajMailKey = 'jnewsKo02j6d4u5aco';
     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 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;
     }
     //jLinks API class
     static $redirectC = null;
     if (empty($redirectC) && class_exists('WClass')) {
         $redirectC = WClass::get('redirect.api', null, 'class', false);
     }
     if (empty($redirectC) && class_exists('WGet')) {
         if (!method_exists('WGet', 'file')) {
             //mean none static
             $newClass = new WGet();
             if (method_exists($newClass, 'classes')) {
                 $redirectC = WGet::classes('redirect.api', null, 'class', false);
             } else {
                 return false;
             }
         } else {
             return false;
         }
     }
     if (!method_exists($redirectC, 'getCatID')) {
         echo "We were unable to load the Redirect API";
         return true;
     }
     //check if new function exist
     static $updated = null;
     if (empty($updated)) {
         if (!method_exists($redirectC, 'newsletterReplacement')) {
             $updated = false;
         } else {
             $updated = true;
         }
     }
     //jLinks Newsletter Integration class
     static $newsletterC = null;
     $contentLinks = array();
     if ($updated) {
         $redirectC->getContentLinks($mail, $contentLinks);
     } else {
         if (empty($newsletterC) && class_exists('WClass')) {
             $newsletterC = WClass::get('redirect.newsletter', null, 'class', false);
         }
         if (empty($newsletterC) && class_exists('WGet')) {
             if (!method_exists('WGet', 'file')) {
                 //mean none static
                 $newClass = new WGet();
                 if (method_exists($newClass, 'classes')) {
                     $newsletterC = WGet::classes('redirect.newsletter', null, 'class', false);
                 } else {
                     return false;
                 }
             } else {
                 return false;
             }
         }
         if (!method_exists($newsletterC, 'getContentLinks')) {
             echo "We were unable to load the Redirect Newsletter API";
             return true;
         }
         $newsletterC->getContentLinks($mail, $contentLinks);
     }
     //check if mail content have links to be replace else no need for replacement
     if (empty($contentLinks)) {
         return true;
     }
     //new codes as of ver 4.0.x --glenn
     static $newsO = null;
     //initialize newsletter object
     if (empty($newsO)) {
         $newsO = new stdClass();
         $newsO->name = $mailSubject;
         $newsO->namekey = '';
         $newsO->catid = $mailCatID;
         $newsO->app = 'jnews';
     }
     if (empty($newsO->catid)) {
         //determine the type of list
         $mailSuffix = '';
         $mailParentCat = '';
         $mailParentName = '';
         //Newsletter List type
         if ($mailingType == 1) {
             $mailSuffix = 'n' . $mailID;
             $mailParentCat = $acajNewsKey;
             $mailParentName = 'Newsletter';
             //Auto-Responder List type
         } elseif ($mailingType == 2) {
             $mailSuffix = 'ar' . $mailID;
             $mailParentCat = $acajAutoKey;
             $mailParentName = 'Auto-Responder';
             //Smart-Newsletter List type
         } elseif ($mailingType == 7) {
             $mailSuffix = 'sn' . $mailID;
             $mailParentCat = $acajSmartKey;
             $mailParentName = 'Smart Newsletter';
         }
         $newsO->namekey = $acajMailKey . $mailSuffix;
         $newsO->parent = new stdClass();
         $newsO->parent->name = $mailParentName;
         $newsO->parent->namekey = $mailParentCat;
         $newsO->parent->parent = new stdClass();
         $newsO->parent->parent->name = 'jNews';
         $newsO->parent->parent->namekey = $acajLinkey;
         $newsO->parent->parent->parent = 1;
         //old codes
         if (!$updated) {
             //check if mail category exist else create it
             $mailCatID = $redirectC->getCatID($acajMailKey . $mailSuffix);
             if (empty($mailCatID)) {
                 //check if jNews category is created else create it
                 $acajID = $redirectC->getCatID($acajLinkey);
                 if (empty($acajID)) {
                     $acajID = $redirectC->createCategory('jNews', 1, null, $acajLinkey);
                 }
                 //check if the List type category exists else create it
                 $mailParentCatID = $redirectC->getCatID($mailParentCat);
                 if (empty($mailParentCatID)) {
                     //create category parameters [ name, parent id, parent namekey, namekey, namekey prefix, namekey suffix ]
                     $mailParentCatID = $redirectC->createCategory($mailParentName, $acajID, null, $mailParentCat);
                 }
                 $mailCatID = $redirectC->createCategory($mailSubject, $mailParentCatID, null, $acajMailKey . $mailSuffix);
             }
         }
         //end of old codes
     }
     //new code in API
     if ($updated) {
         $redirectC->newsletterReplacement($newsO, $mail->Body, $subsid);
     } else {
         //jLinks Newsletter Integration class
         if (empty($newsletterC)) {
             if (class_exists('WClass')) {
                 $newsletterC = WClass::get('redirect.newsletter', null, 'class', false);
             }
             if (empty($newsletterC) && class_exists('WGet')) {
                 if (!method_exists('WGet', 'file')) {
                     //mean none static
                     $newClass = new WGet();
                     if (method_exists($newClass, 'classes')) {
                         $newsletterC = WGet::classes('redirect.newsletter', null, 'class', false);
                     } else {
                         return false;
                     }
                 } else {
                     return false;
                 }
             }
         }
         if (!method_exists($newsletterC, 'getContentLinks')) {
             echo "We were unable to load the Redirect Newsletter API";
             return true;
         }
         // if converting of content links are done or not
         if (empty($convertedLinks)) {
             //find link in the content and store them
             $newsletterC->convertContentLinks($contentLinks, $convertedLinks, $mailCatID, 'jnews');
         }
         //the replacing of the content links occurs here
         $newsletterC->replaceContentLinks($mail, $convertedLinks, $subsid, 'jnews');
     }
     //end of old codes
     return true;
 }