diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..207cbc6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,47 @@ +# Created by .ignore support plugin (hsz.mobi) +### JetBrains template +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff: +.idea/workspace.xml +.idea/tasks.xml +.idea/dictionaries +.idea/vcs.xml +.idea/jsLibraryMappings.xml + +# Sensitive or high-churn files: +.idea/dataSources.ids +.idea/dataSources.xml +.idea/dataSources.local.xml +.idea/sqlDataSources.xml +.idea/dynamic.xml +.idea/uiDesigner.xml + +# Gradle: +.idea/gradle.xml +.idea/libraries + +# Mongo Explorer plugin: +.idea/mongoSettings.xml + +## File-based project format: +*.iws + +## Plugin-specific files: + +# IntelliJ +/out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + diff --git a/dd_disable_mailto.php b/dd_disable_mailto.php new file mode 100644 index 0000000..bfd1694 --- /dev/null +++ b/dd_disable_mailto.php @@ -0,0 +1,76 @@ +isAdmin()){ // Trigger Events only in Backend + + $input = JFactory::getApplication()->input; + $option = $input->get->get("option",0,"STR"); + + if($option === "com_plugins" ){ // And only on plugin page, to save performance + + // Load plugin parameters + $this->plugin = JPluginHelper::getPlugin(self::TYPE, self::NAME); + $this->params = new JRegistry($this->plugin->params); + + $disable_mailTo = $this->params->get('disable_mailto',0); + + if(!$disable_mailTo){ + $this->set_mailTo(false); + } else { + $this->set_mailTo(); + } + + } + + } + + } + + /** + * Enable / Disable com_mailto extension method + * @param $enable boolean true = enabled + * @since Version 3.6.2 + */ + private function set_mailTo($enable = true) + { + $enable = intval($enable); + $db = JFactory::getDbo(); + $query = $db->getQuery(true); + $query->update('#__extensions') + ->set($db->quoteName('enabled') . ' = ' . $enable) + ->where($db->quoteName('element') . ' = ' . $db->quote('com_mailto')) + ->where($db->quoteName('type') . ' = ' . $db->quote('component')); + $db->setQuery($query); + $db->execute(); + } + +} \ No newline at end of file diff --git a/dd_disable_mailto.xml b/dd_disable_mailto.xml new file mode 100644 index 0000000..e87d278 --- /dev/null +++ b/dd_disable_mailto.xml @@ -0,0 +1,40 @@ + + + PLG_SYSTEM_DD_DISABLE_MAILTO + 1.1.0.0 + 01.01.2016 + Didldu e.K. Florian Häusler + info@hr-it-solutions.com + Didldu e.K. Florian Häusler https://www.hr-it-solutions.com + Copyright (C) 2011 - 2016 Didldu e.K. | HR IT-Solutions + GNU/GPLv2 only + PLG_SYSTEM_DD_DISABLE_MAILTO_XML_DESCRIPTION + + dd_disable_mailto.php + index.html + dd_disable_mailto_script.php + + + language/en-GB/en-GB.plg_system_dd_disable_mailto.sys.ini + + dd_disable_mailto_script.php + + http://www.hr-it-solutions.com/jextensions/update.xml + + + + +
+ + + + +
+
+
+
\ No newline at end of file diff --git a/dd_disable_mailto_script.php b/dd_disable_mailto_script.php new file mode 100644 index 0000000..36b905e --- /dev/null +++ b/dd_disable_mailto_script.php @@ -0,0 +1,21 @@ +getQuery(true); + $query->update('#__extensions') + ->set($db->quoteName('enabled') . ' = 1') + ->where($db->quoteName('element') . ' = ' . $db->quote('com_mailto')) + ->where($db->quoteName('type') . ' = ' . $db->quote('component')); + $db->setQuery($query); + $db->execute(); + } +} diff --git a/index.html b/index.html new file mode 100644 index 0000000..3af6301 --- /dev/null +++ b/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/language/en-GB/en-GB.plg_system_dd_disable_mailto.sys.ini b/language/en-GB/en-GB.plg_system_dd_disable_mailto.sys.ini new file mode 100644 index 0000000..f541d5a --- /dev/null +++ b/language/en-GB/en-GB.plg_system_dd_disable_mailto.sys.ini @@ -0,0 +1,9 @@ +; @version 1-1-0-0 // Y-m-d 2016-10-01 +; @author Didldu e.K. Florian Häusler https://www.hr-it-solutions.com +; @copyright Copyright (C) 2011 - 2016 Didldu e.K. | HR IT-Solutions +; @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only + +PLG_SYSTEM_DD_DISABLE_MAILTO="DD Disable Mailto" +PLG_SYSTEM_DD_DISABLE_MAILTO_XML_DESCRIPTION="System plugin to disable mailto function!
This removes also the "recommend to a friend link" and the "recommend to a friend form" from frontend.

Plugin must be enabled to trigger enable/disable events. To undo changes, just need to uninstall Plugin." +PLG_SYSTEM_DD_DISABLE_MAILTO_FIELD_DISABLE_MAILTO_LABEL="Mailto Component" +PLG_SYSTEM_DD_DISABLE_MAILTO_FIELD_DISABLE_MAILTO="This will enable/disable Joomla locked Mailto Component. Set disable to disable mailto function!" \ No newline at end of file diff --git a/language/en-GB/index.html b/language/en-GB/index.html new file mode 100644 index 0000000..3af6301 --- /dev/null +++ b/language/en-GB/index.html @@ -0,0 +1 @@ + \ No newline at end of file