From 31bd94f188ed4475e74c9de1879267411b2239c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20H=C3=A4usler?= Date: Sun, 26 Feb 2017 15:03:54 +0100 Subject: [PATCH 1/2] Some improvements; Version Update --- dd_disable_mailto.php | 19 +++++++++---------- dd_disable_mailto.xml | 2 +- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/dd_disable_mailto.php b/dd_disable_mailto.php index aed6c2c..0aab3b5 100644 --- a/dd_disable_mailto.php +++ b/dd_disable_mailto.php @@ -1,6 +1,6 @@ plugin = JPluginHelper::getPlugin(self::TYPE, self::NAME); $this->params = new JRegistry($this->plugin->params); - $app = JFactory::getApplication(); - - if ($app->isAdmin()){ // Trigger Events only in Backend + if ($this->app->isAdmin()){ // Trigger Events only in Backend - $option = $app->input->get->get("option",0,"STR"); + $option = $this->app->input->get->get("option",0,"STR"); if($option === "com_plugins" ){ // And only on plugin page, to save performance @@ -78,16 +78,15 @@ public function onAfterRoute(){ */ public function onAfterRender() { - $app = JFactory::getApplication(); // Front end - if ($app instanceof JApplicationSite) + if ($this->app instanceof JApplicationSite) { if ($this->params->get('remove_mailto_link',0)) // Remove mailTo link Option { - $html = $app->getBody(); + $html = $this->app->getBody(); $html = $this->remveMailtoLink($html); - $app->setBody($html); + $this->app->setBody($html); } } @@ -113,7 +112,7 @@ private function redirectOldMailtoLinks() { if(strpos(JUri::current(), 'component/mailto') !== false){ $alternativeURL = $this->params->get('redirect_mailto_url'); - JFactory::getApplication()->redirect(JURI::base() . $alternativeURL,301); + $this->app->redirect(JURI::base() . $alternativeURL,301); } } diff --git a/dd_disable_mailto.xml b/dd_disable_mailto.xml index e3999ca..da53a5f 100644 --- a/dd_disable_mailto.xml +++ b/dd_disable_mailto.xml @@ -1,7 +1,7 @@ PLG_SYSTEM_DD_DISABLE_MAILTO - 1.2.1.1 + 1.2.2.0 01.10.2016 HR IT-Solutions Florian Häusler info@hr-it-solutions.com From 772d1de0681394de7062fa98f0aa049fd84bd566 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20H=C3=A4usler?= Date: Sun, 26 Feb 2017 15:07:24 +0100 Subject: [PATCH 2/2] Revision --- dd_disable_mailto.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dd_disable_mailto.php b/dd_disable_mailto.php index 0aab3b5..efe8256 100644 --- a/dd_disable_mailto.php +++ b/dd_disable_mailto.php @@ -1,6 +1,6 @@