From 4e30092e43c8c0e21dc2fcc2a03b98e11ad110bc Mon Sep 17 00:00:00 2001
From: Johan Janssens
Date: Wed, 8 Jul 2015 03:51:51 +0200
Subject: [PATCH] #210 - Remove plg_system_languagecode
---
install/mysql/data.sql | 1 -
.../en-GB/en-GB.plg_system_languagecode.ini | 10 --
.../en-GB.plg_system_languagecode.sys.ini | 8 -
.../system/languagecode/languagecode.php | 153 ------------------
.../system/languagecode/languagecode.xml | 23 ---
5 files changed, 195 deletions(-)
delete mode 100644 lib/plugins/system/languagecode/language/en-GB/en-GB.plg_system_languagecode.ini
delete mode 100644 lib/plugins/system/languagecode/language/en-GB/en-GB.plg_system_languagecode.sys.ini
delete mode 100644 lib/plugins/system/languagecode/languagecode.php
delete mode 100644 lib/plugins/system/languagecode/languagecode.xml
diff --git a/install/mysql/data.sql b/install/mysql/data.sql
index ee6a0cacf3..e9da44c1f4 100644
--- a/install/mysql/data.sql
+++ b/install/mysql/data.sql
@@ -73,7 +73,6 @@ INSERT INTO `extensions` (`extension_id`, `name`, `type`, `element`, `folder`, `
(430, 'plg_system_logout', 'plugin', 'logout', 'system', 0, 1, 1, 1, '', '', '', '', 0, '0000-00-00 00:00:00', 3, 0),
(432, 'plg_user_joomla', 'plugin', 'joomla', 'user', 0, 1, 1, 0, '', '{"strong_passwords":"1","autoregister":"1"}', '', '', 0, '0000-00-00 00:00:00', 2, 0),
(433, 'plg_user_profile', 'plugin', 'profile', 'user', 0, 0, 1, 0, '', '{"register-require_address1":"1","register-require_address2":"1","register-require_city":"1","register-require_region":"1","register-require_country":"1","register-require_postal_code":"1","register-require_phone":"1","register-require_website":"1","register-require_favoritebook":"1","register-require_aboutme":"1","register-require_tos":"1","register-require_dob":"1","profile-require_address1":"1","profile-require_address2":"1","profile-require_city":"1","profile-require_region":"1","profile-require_country":"1","profile-require_postal_code":"1","profile-require_phone":"1","profile-require_website":"1","profile-require_favoritebook":"1","profile-require_aboutme":"1","profile-require_tos":"1","profile-require_dob":"1"}', '', '', 0, '0000-00-00 00:00:00', 0, 0),
-(436, 'plg_system_languagecode', 'plugin', 'languagecode', 'system', 0, 0, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 10, 0),
(449, 'plg_authentication_cookie', 'plugin', 'cookie', 'authentication', 0, 1, 1, 0, '', '', '', '', 0, '0000-00-00 00:00:00', 0, 0),
(506, 'protostar', 'template', 'protostar', '', 0, 1, 1, 0, '', '{"templateColor":"","logoFile":"","googleFont":"1","googleFontName":"Open+Sans","fluidContainer":"0"}', '', '', 0, '0000-00-00 00:00:00', 0, 0),
(507, 'isis', 'template', 'isis', '', 1, 1, 1, 0, '', '{"templateColor":"","logoFile":""}', '', '', 0, '0000-00-00 00:00:00', 0, 0),
diff --git a/lib/plugins/system/languagecode/language/en-GB/en-GB.plg_system_languagecode.ini b/lib/plugins/system/languagecode/language/en-GB/en-GB.plg_system_languagecode.ini
deleted file mode 100644
index d8c39d380d..0000000000
--- a/lib/plugins/system/languagecode/language/en-GB/en-GB.plg_system_languagecode.ini
+++ /dev/null
@@ -1,10 +0,0 @@
-; Joomla! Project
-; Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved.
-; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php
-; Note : All ini files need to be saved as UTF-8
-
-PLG_SYSTEM_LANGUAGECODE="System - Language Code"
-PLG_SYSTEM_LANGUAGECODE_FIELD_DESC="Changes the language code used for the %s language"
-PLG_SYSTEM_LANGUAGECODE_FIELDSET_DESC="Changes the language code for the generated HTML document. Example of use: One has installed the fr-FR language pack and wants the Search Engines to recognise the page as aimed at French-speaking Canada. Add the tag 'fr-CA' to the corresponding field for 'fr-FR' to resolve this."
-PLG_SYSTEM_LANGUAGECODE_FIELDSET_LABEL="Language codes"
-PLG_SYSTEM_LANGUAGECODE_XML_DESCRIPTION="Provides the ability to change the language code in the generated HTML document to improve SEO.
The fields will appear when the plugin is enabled and saved.
More information at W3.org "
diff --git a/lib/plugins/system/languagecode/language/en-GB/en-GB.plg_system_languagecode.sys.ini b/lib/plugins/system/languagecode/language/en-GB/en-GB.plg_system_languagecode.sys.ini
deleted file mode 100644
index 99825cf268..0000000000
--- a/lib/plugins/system/languagecode/language/en-GB/en-GB.plg_system_languagecode.sys.ini
+++ /dev/null
@@ -1,8 +0,0 @@
-; Joomla! Project
-; Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved.
-; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php
-; Note : All ini files need to be saved as UTF-8
-
-PLG_SYSTEM_LANGUAGECODE="System - Language Code"
-PLG_SYSTEM_LANGUAGECODE_XML_DESCRIPTION="Provides ability to change the language code in the generated HTML document to improve SEO"
-
diff --git a/lib/plugins/system/languagecode/languagecode.php b/lib/plugins/system/languagecode/languagecode.php
deleted file mode 100644
index 2bbbd2fb21..0000000000
--- a/lib/plugins/system/languagecode/languagecode.php
+++ /dev/null
@@ -1,153 +0,0 @@
- tag.
- *
- * @return void
- *
- * @since 2.5
- */
- public function onAfterRender()
- {
- $app = JFactory::getApplication();
-
- // Use this plugin only in site application.
- if ($app->isSite())
- {
- // Get the response body.
- $body = $app->getBody();
-
- // Get the current language code.
- $code = JFactory::getDocument()->getLanguage();
-
- // Get the new code.
- $new_code = $this->params->get($code);
-
- // Replace the old code by the new code in the tag.
- if ($new_code)
- {
- // Replace the new code in the HTML document.
- $patterns = array(
- chr(1) . '()' . chr(1) . 'i',
- chr(1) . '()' . chr(1) . 'i',
- );
- $replace = array(
- '${1}' . strtolower($new_code) . '${3}',
- '${1}' . strtolower($new_code) . '${3}'
- );
- }
- else
- {
- $patterns = array();
- $replace = array();
- }
-
- // Replace codes in attributes.
- preg_match_all(chr(1) . '()' . chr(1) . 'i', $body, $matches);
-
- foreach ($matches[2] as $match)
- {
- $new_code = $this->params->get(strtolower($match));
-
- if ($new_code)
- {
- $patterns[] = chr(1) . '()' . chr(1) . 'i';
- $replace[] = '${1}' . $new_code . '${3}';
- }
- }
-
- preg_match_all(chr(1) . '()' . chr(1) . 'i', $body, $matches);
-
- foreach ($matches[2] as $match)
- {
- $new_code = $this->params->get(strtolower($match));
-
- if ($new_code)
- {
- $patterns[] = chr(1) . '()' . chr(1) . 'i';
- $replace[] = '${1}' . $new_code . '${3}';
- }
- }
-
- $app->setBody(preg_replace($patterns, $replace, $body));
- }
- }
-
- /**
- * Prepare form.
- *
- * @param JForm $form The form to be altered.
- * @param mixed $data The associated data for the form.
- *
- * @return boolean
- *
- * @since 2.5
- */
- public function onContentPrepareForm($form, $data)
- {
- // Check we have a form.
- if (!($form instanceof JForm))
- {
- $this->_subject->setError('JERROR_NOT_A_FORM');
-
- return false;
- }
-
- // Check we are manipulating the languagecode plugin.
- if ($form->getName() != 'com_plugins.plugin' || !$form->getField('languagecodeplugin', 'params'))
- {
- return true;
- }
-
- // Get site languages.
- if ($languages = JLanguage::getKnownLanguages(JPATH_SITE))
- {
- // Inject fields into the form.
- foreach ($languages as $tag => $language)
- {
- $form->load('
-
- ');
- }
- }
-
- return true;
- }
-}
diff --git a/lib/plugins/system/languagecode/languagecode.xml b/lib/plugins/system/languagecode/languagecode.xml
deleted file mode 100644
index cc57300fb0..0000000000
--- a/lib/plugins/system/languagecode/languagecode.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
- plg_system_languagecode
- Joomla! Project
- November 2011
- Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved.
- GNU General Public License version 2 or later; see LICENSE.txt
- admin@joomla.org
- www.joomla.org
- 3.0.0
- PLG_SYSTEM_LANGUAGECODE_XML_DESCRIPTION
-
- languagecode.php
- language
-
-
-
-
-
-
-
-