/** * This method looks for a backup of cacert.pem file created * by an prior release of this plugin, restoring it if found. * * @return void */ public function onAfterInitialise() { $app = Factory::getApplication(); if ($app->getName() === 'administrator') { OSSystemHelper::revertCARootFileToOriginal(); } }
public function __construct($config = array()) { if (version_compare(JVERSION, '3.0', 'lt')) { $this->option = JRequest::getCmd('option'); } else { $app = Factory::getApplication(); $this->option = $app->input->get('option'); } $info = ExtensionHelper::getExtensionInfoFromElement($this->option); $this->extension = Factory::getExtension($info['namespace'], $info['type']); }
protected function buildBreadcrumbs(&$paths, $item) { $this->buildPath($paths, $item->cate_id); $app = Factory::getApplication(); $pathway = $app->getPathway(); $itemID = JRequest::getVar("Itemid", null, 'default', 'int'); $countPaths = count($paths) - 1; for ($i = $countPaths; $i >= 0; $i--) { $pathway->addItem($paths[$i]->title, JRoute::_("index.php?option=com_osdownloads&view=downloads&id={$paths[$i]->id}" . "&Itemid={$itemID}")); } }
public function addToMailchimpList() { $app = Factory::getApplication(); $params = $app->getParams('com_osdownloads'); $apiKey = $params->get("mailchimp_api", 0); $listId = $params->get("list_id", 0); if (!empty($this->email)) { $mc = new MailChimpAPI($apiKey); $merge_vars = array(); $mc->listSubscribe($listId, $this->email, $merge_vars); } }
public function executeRedirectTask() { // Joomla 2.5 Backward Compatibility if (version_compare(JVERSION, '3.0', '<')) { $task = JRequest::getCmd('task'); } else { $app = Factory::getApplication(); $task = $app->input->getCmd('task'); } $this->controller->execute($task); $this->controller->redirect(); }
public static function addCustomFooterIntoNativeComponentOutput($element) { // Check if the specified extension is from Alledia $extension = ExtensionHelper::getExtensionForElement($element); $footer = $extension->getFooterMarkup(); if (!empty($footer)) { // Inject the custom footer if (version_compare(JVERSION, '3.0', 'lt')) { $body = JResponse::getBody(); $body = preg_replace('#(<p\\salign="center">Joomla!\\s[0-9.\\s&;]*</p>)#i', $footer . '$1', $body); JResponse::setBody($body); } else { $app = Factory::getApplication(); $body = $app->getBody(); $body = str_replace('</section>', '</section>' . $footer, $body); $app->setBody($body); } } }
/** * Task to route the download workflow * * @return void */ public function routedownload() { $app = Factory::getApplication(); $component = FreeComponentSite::getInstance(); $params = $app->getParams('com_osdownloads'); $downloadEmailContent = $params->get("download_email_content", false); $id = (int) JRequest::getVar("id"); $model = $component->getModel('Item'); $item = $model->getItem($id); if (empty($item)) { JError::raiseWarning(404, JText::_("COM_OSDOWNLOADS_THIS_DOWNLOAD_ISNT_AVAILABLE")); return; } if ($this->processRequirements($item)) { $this->processEmailRequirement($item); } JRequest::setVar("view", "item"); $this->display(); }