From b22e63b5916367ef55df7e57d0821662cc2cbdc4 Mon Sep 17 00:00:00 2001 From: SharkyKZ Date: Wed, 27 Jun 2018 16:55:58 +0300 Subject: [PATCH 01/92] [plg_user_profile] Add RTL check to ToS field --- plugins/user/profile/field/tos.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/user/profile/field/tos.php b/plugins/user/profile/field/tos.php index 1a714d87cab40..594c1956e2715 100644 --- a/plugins/user/profile/field/tos.php +++ b/plugins/user/profile/field/tos.php @@ -75,6 +75,11 @@ protected function getLabel() ENT_COMPAT, 'UTF-8' ) . '"'; + + if (JFactory::getLanguage()->isRtl()) + { + $label .= ' data-placement="left"'; + } } $tosArticle = $this->element['article'] > 0 ? (int) $this->element['article'] : 0; From fb3e3f70fa1d22f3bc062c69ee980dd11a98ae41 Mon Sep 17 00:00:00 2001 From: Hannes Papenberg Date: Sat, 30 Jun 2018 13:54:56 +0200 Subject: [PATCH 02/92] Fix OpenSearch implementation --- libraries/src/Document/OpensearchDocument.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/src/Document/OpensearchDocument.php b/libraries/src/Document/OpensearchDocument.php index cb288f860fa9d..33c73425dca29 100644 --- a/libraries/src/Document/OpensearchDocument.php +++ b/libraries/src/Document/OpensearchDocument.php @@ -135,7 +135,7 @@ public function render($cache = false, $params = array()) $osns = 'http://a9.com/-/spec/opensearch/1.1/'; // Create the root element - $elOs = $xml->createElementNs($osns, 'OpensearchDescription'); + $elOs = $xml->createElementNs($osns, 'OpenSearchDescription'); $elShortName = $xml->createElementNs($osns, 'ShortName'); $elShortName->appendChild($xml->createTextNode(htmlspecialchars($this->_shortName))); From b46e6b0da6048c6e59f2dd75ff3cf32890e4ddaa Mon Sep 17 00:00:00 2001 From: SharkyKZ Date: Mon, 2 Jul 2018 09:12:31 +0300 Subject: [PATCH 03/92] [mod_articles_category] Showon --- .../en-GB/en-GB.mod_articles_category.ini | 7 ++-- .../mod_articles_category.xml | 33 +++++++++++-------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/language/en-GB/en-GB.mod_articles_category.ini b/language/en-GB/en-GB.mod_articles_category.ini index bdcce35170e3d..7d29a47e64bdc 100644 --- a/language/en-GB/en-GB.mod_articles_category.ini +++ b/language/en-GB/en-GB.mod_articles_category.ini @@ -35,11 +35,12 @@ MOD_ARTICLES_CATEGORY_FIELD_DATEFIELDFORMAT_DESC="Please enter in a valid date f MOD_ARTICLES_CATEGORY_FIELD_DATEFIELDFORMAT_LABEL="Date Format" MOD_ARTICLES_CATEGORY_FIELD_DATEFILTERING_DESC="Select Date Filtering Type." MOD_ARTICLES_CATEGORY_FIELD_DATEFILTERING_LABEL="Date Filtering" -MOD_ARTICLES_CATEGORY_FIELD_ENDDATE_DESC="If Date Range is selected above, please enter an End Date." +MOD_ARTICLES_CATEGORY_FIELD_ENDDATE_DESC="Please enter an End Date." MOD_ARTICLES_CATEGORY_FIELD_ENDDATE_LABEL="To Date" MOD_ARTICLES_CATEGORY_FIELD_EXCLUDEDARTICLES_DESC="Please enter each Article ID on a new line." MOD_ARTICLES_CATEGORY_FIELD_EXCLUDEDARTICLES_LABEL="Article IDs to Exclude" MOD_ARTICLES_CATEGORY_FIELD_GROUP_DISPLAY_LABEL="Display Options" +; The following string is deprecated and will be removed with 4.0 MOD_ARTICLES_CATEGORY_FIELD_GROUP_DYNAMIC_LABEL="Dynamic Mode Options" MOD_ARTICLES_CATEGORY_FIELD_GROUP_FILTERING_LABEL="Filtering Options" MOD_ARTICLES_CATEGORY_FIELD_GROUP_GROUPING_LABEL="Grouping Options" @@ -52,7 +53,7 @@ MOD_ARTICLES_CATEGORY_FIELD_MODE_DESC="Please select the mode you would like to MOD_ARTICLES_CATEGORY_FIELD_MODE_LABEL="Mode" MOD_ARTICLES_CATEGORY_FIELD_MONTHYEARFORMAT_DESC="Please enter in a valid date format. See: http://php.net/date for formatting information." MOD_ARTICLES_CATEGORY_FIELD_MONTHYEARFORMAT_LABEL="Month and Year Display Format" -MOD_ARTICLES_CATEGORY_FIELD_RELATIVEDATE_DESC="If Relative Date is selected above, please enter in a numeric day value. Results will be retrieved relative to the current date and the value you enter." +MOD_ARTICLES_CATEGORY_FIELD_RELATIVEDATE_DESC="Please enter in a numeric day value. Results will be retrieved relative to the current date and the value you enter." MOD_ARTICLES_CATEGORY_FIELD_RELATIVEDATE_LABEL="Relative Date" MOD_ARTICLES_CATEGORY_FIELD_SHOWAUTHOR_DESC="Select Show if you would like the author (or author alias instead, if available) to be displayed." MOD_ARTICLES_CATEGORY_FIELD_SHOWCATEGORY_DESC="Select Show if you would like the category name displayed." @@ -67,7 +68,7 @@ MOD_ARTICLES_CATEGORY_FIELD_SHOWINTROTEXT_DESC="Select Show if you would like th MOD_ARTICLES_CATEGORY_FIELD_SHOWINTROTEXT_LABEL="Introtext" MOD_ARTICLES_CATEGORY_FIELD_SHOWONARTICLEPAGE_DESC="Select to Show or hide Article List from Article Pages. This means that the module will only display itself dynamically on Category Pages." MOD_ARTICLES_CATEGORY_FIELD_SHOWONARTICLEPAGE_LABEL="Show on Article Page" -MOD_ARTICLES_CATEGORY_FIELD_STARTDATE_DESC="If Date Range is selected above, please enter a Starting Date." +MOD_ARTICLES_CATEGORY_FIELD_STARTDATE_DESC="Please enter a Starting Date." MOD_ARTICLES_CATEGORY_FIELD_STARTDATE_LABEL="Start Date Range" MOD_ARTICLES_CATEGORY_OPTION_ASCENDING_VALUE="Ascending" MOD_ARTICLES_CATEGORY_OPTION_CREATED_VALUE="Created Date" diff --git a/modules/mod_articles_category/mod_articles_category.xml b/modules/mod_articles_category/mod_articles_category.xml index 7b702044ca9ec..f15c8111de53e 100644 --- a/modules/mod_articles_category/mod_articles_category.xml +++ b/modules/mod_articles_category/mod_articles_category.xml @@ -32,12 +32,6 @@ - - -
@@ -247,6 +242,7 @@ label="MOD_ARTICLES_CATEGORY_FIELD_DATERANGEFIELD_LABEL" description="MOD_ARTICLES_CATEGORY_FIELD_DATERANGEFIELD_DESC" default="a.created" + showon="date_filtering!:off" > @@ -262,6 +258,7 @@ showtime="true" size="22" filter="user_utc" + showon="date_filtering:range" />
@@ -344,24 +343,27 @@ + + -
@@ -413,6 +416,7 @@ label="MOD_ARTICLES_CATEGORY_FIELD_DATEFIELDFORMAT_LABEL" description="MOD_ARTICLES_CATEGORY_FIELD_DATEFIELDFORMAT_DESC" default="Y-m-d H:i:s" + showon="show_date:1" /> @@ -509,6 +515,7 @@ description="JGLOBAL_SHOW_READMORE_LIMIT_DESC" default="15" filter="integer" + showon="show_readmore:1[AND]show_readmore_title:1" />
From 3ce5d63619ba31a495abc3ee75e86be789eb5de6 Mon Sep 17 00:00:00 2001 From: SharkyKZ Date: Mon, 2 Jul 2018 09:19:59 +0300 Subject: [PATCH 04/92] Add showon to levels --- modules/mod_articles_category/mod_articles_category.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/mod_articles_category/mod_articles_category.xml b/modules/mod_articles_category/mod_articles_category.xml index f15c8111de53e..14d32c0851df9 100644 --- a/modules/mod_articles_category/mod_articles_category.xml +++ b/modules/mod_articles_category/mod_articles_category.xml @@ -124,6 +124,7 @@ description="MOD_ARTICLES_CATEGORY_FIELD_CATDEPTH_DESC" default="1" filter="integer" + showon="show_child_category_articles:1" /> Date: Mon, 2 Jul 2018 10:33:29 +0300 Subject: [PATCH 05/92] Update string --- language/en-GB/en-GB.mod_articles_category.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/language/en-GB/en-GB.mod_articles_category.ini b/language/en-GB/en-GB.mod_articles_category.ini index 7d29a47e64bdc..018eb4e2219bb 100644 --- a/language/en-GB/en-GB.mod_articles_category.ini +++ b/language/en-GB/en-GB.mod_articles_category.ini @@ -53,7 +53,7 @@ MOD_ARTICLES_CATEGORY_FIELD_MODE_DESC="Please select the mode you would like to MOD_ARTICLES_CATEGORY_FIELD_MODE_LABEL="Mode" MOD_ARTICLES_CATEGORY_FIELD_MONTHYEARFORMAT_DESC="Please enter in a valid date format. See: http://php.net/date for formatting information." MOD_ARTICLES_CATEGORY_FIELD_MONTHYEARFORMAT_LABEL="Month and Year Display Format" -MOD_ARTICLES_CATEGORY_FIELD_RELATIVEDATE_DESC="Please enter in a numeric day value. Results will be retrieved relative to the current date and the value you enter." +MOD_ARTICLES_CATEGORY_FIELD_RELATIVEDATE_DESC="Please enter a numeric value. Results will be retrieved relative to the current date and the value you enter." MOD_ARTICLES_CATEGORY_FIELD_RELATIVEDATE_LABEL="Relative Date" MOD_ARTICLES_CATEGORY_FIELD_SHOWAUTHOR_DESC="Select Show if you would like the author (or author alias instead, if available) to be displayed." MOD_ARTICLES_CATEGORY_FIELD_SHOWCATEGORY_DESC="Select Show if you would like the category name displayed." From 20eeef595d14849d3e4662e118b02371c9d294fa Mon Sep 17 00:00:00 2001 From: SharkyKZ Date: Tue, 3 Jul 2018 18:27:55 +0300 Subject: [PATCH 06/92] Remove CSS --- plugins/user/profile/field/tos.php | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/plugins/user/profile/field/tos.php b/plugins/user/profile/field/tos.php index 594c1956e2715..012aa872b2ba6 100644 --- a/plugins/user/profile/field/tos.php +++ b/plugins/user/profile/field/tos.php @@ -49,15 +49,6 @@ protected function getLabel() // Set required to true as this field is not displayed at all if not required. $this->required = true; - // Add CSS and JS for the TOS field - $doc = JFactory::getDocument(); - $css = '#jform_profile_tos {width: 18em; margin: 0 !important; padding: 0 2px !important;} - #jform_profile_tos input {margin: 0 5px 0 0 !important; width: 10px !important;} - #jform_profile_tos label {margin: 0 15px 0 0 !important; width: auto;} - '; - $doc->addStyleDeclaration($css); - JHtml::_('behavior.modal'); - // Build the class for the label. $class = !empty($this->description) ? 'hasPopover' : ''; $class = $class . ' required'; @@ -86,6 +77,7 @@ protected function getLabel() if ($tosArticle) { + JHtml::_('behavior.modal'); JLoader::register('ContentHelperRoute', JPATH_BASE . '/components/com_content/helpers/route.php'); $attribs = array(); From a1afb5a63688ee01afa1a39d1a2be1ef5d07f940 Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Wed, 11 Jul 2018 08:14:06 -0500 Subject: [PATCH 07/92] Add security issue template --- .github/ISSUE_TEMPLATE/Security.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/Security.md diff --git a/.github/ISSUE_TEMPLATE/Security.md b/.github/ISSUE_TEMPLATE/Security.md new file mode 100644 index 0000000000000..8e4f866fda2c5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/Security.md @@ -0,0 +1,9 @@ +--- +name: Security +about: Report a security issue + +--- + +Security issues should **NOT** be reported on this repository. If you believe you have found a security issue, please +contact the Joomla Security Strike Team via email at security@joomla.org or through the contact form at https://developer.joomla.org/security/contact-the-team.html. +Please see https://developer.joomla.org/security.html for more information on how the Joomla project responds to security issues. From c3349f2d8d3759a388215934a22aa3e4d6526d43 Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Wed, 11 Jul 2018 08:14:48 -0500 Subject: [PATCH 08/92] Formatting --- .github/ISSUE_TEMPLATE/Security.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/Security.md b/.github/ISSUE_TEMPLATE/Security.md index 8e4f866fda2c5..d7ff7ea26e670 100644 --- a/.github/ISSUE_TEMPLATE/Security.md +++ b/.github/ISSUE_TEMPLATE/Security.md @@ -4,6 +4,8 @@ about: Report a security issue --- -Security issues should **NOT** be reported on this repository. If you believe you have found a security issue, please -contact the Joomla Security Strike Team via email at security@joomla.org or through the contact form at https://developer.joomla.org/security/contact-the-team.html. +Security issues should **NOT** be reported on this repository. + +If you believe you have found a security issue, please contact the Joomla Security Strike Team via email at security@joomla.org or through the contact form at https://developer.joomla.org/security/contact-the-team.html. + Please see https://developer.joomla.org/security.html for more information on how the Joomla project responds to security issues. From 8d2a2e376bef1769629fa9fa30bfd506961ce200 Mon Sep 17 00:00:00 2001 From: Thomas Hunziker Date: Wed, 11 Jul 2018 20:57:59 +0200 Subject: [PATCH 09/92] Let the table check the data before storing. --- plugins/sampledata/blog/blog.php | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/sampledata/blog/blog.php b/plugins/sampledata/blog/blog.php index 79bb723a8c102..301f43f515a8e 100644 --- a/plugins/sampledata/blog/blog.php +++ b/plugins/sampledata/blog/blog.php @@ -342,6 +342,7 @@ public function onAjaxSampledataApplyStep2() $menuTable->load(); $menuTable->bind($menu); + $menuTable->check(); try { From 364c9e87b115dfce6d0a0bcfeea941ae91217bbe Mon Sep 17 00:00:00 2001 From: SharkyKZ Date: Thu, 12 Jul 2018 01:27:39 +0300 Subject: [PATCH 10/92] [Templates] Escape sitename (#21008) --- administrator/templates/isis/error.php | 2 +- templates/protostar/error.php | 2 +- templates/protostar/index.php | 2 +- templates/protostar/offline.php | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/administrator/templates/isis/error.php b/administrator/templates/isis/error.php index 9c3a0cb1afbbd..cdd951fe9c2d3 100644 --- a/administrator/templates/isis/error.php +++ b/administrator/templates/isis/error.php @@ -32,7 +32,7 @@ $layout = $input->get('layout', ''); $task = $input->get('task', ''); $itemid = $input->get('Itemid', 0, 'int'); -$sitename = $app->get('sitename'); +$sitename = htmlspecialchars($app->get('sitename'), ENT_QUOTES, 'UTF-8'); $cpanel = ($option === 'com_cpanel'); diff --git a/templates/protostar/error.php b/templates/protostar/error.php index 03ade4d5ae4c6..4e394e800ec5c 100644 --- a/templates/protostar/error.php +++ b/templates/protostar/error.php @@ -23,7 +23,7 @@ $layout = $app->input->getCmd('layout', ''); $task = $app->input->getCmd('task', ''); $itemid = $app->input->getCmd('Itemid', ''); -$sitename = $app->get('sitename'); +$sitename = htmlspecialchars($app->get('sitename'), ENT_QUOTES, 'UTF-8'); if ($task === 'edit' || $layout === 'form') { diff --git a/templates/protostar/index.php b/templates/protostar/index.php index cae3f32003e6b..4e336e1f6d99c 100644 --- a/templates/protostar/index.php +++ b/templates/protostar/index.php @@ -26,7 +26,7 @@ $layout = $app->input->getCmd('layout', ''); $task = $app->input->getCmd('task', ''); $itemid = $app->input->getCmd('Itemid', ''); -$sitename = $app->get('sitename'); +$sitename = htmlspecialchars($app->get('sitename'), ENT_QUOTES, 'UTF-8'); if ($task === 'edit' || $layout === 'form') { diff --git a/templates/protostar/offline.php b/templates/protostar/offline.php index b406835c56b9a..7a0ef5c47861e 100644 --- a/templates/protostar/offline.php +++ b/templates/protostar/offline.php @@ -75,7 +75,7 @@ JHtml::_('bootstrap.loadCss', false, $this->direction); // Logo file or site title param -$sitename = $app->get('sitename'); +$sitename = htmlspecialchars($app->get('sitename'), ENT_QUOTES, 'UTF-8'); if ($this->params->get('logoFile')) { @@ -104,10 +104,10 @@

-

get('sitename')); ?>

+

get('offline_image') && file_exists($app->get('offline_image'))) : ?> - <?php echo htmlspecialchars($app->get('sitename')); ?> + <?php echo $sitename; ?> get('display_offline_message', 1) == 1 && str_replace(' ', '', $app->get('offline_message')) !== '') : ?>

get('offline_message'); ?>

From 2648ed0e6f9d878bfad2bc7d852ad9d270b80d0e Mon Sep 17 00:00:00 2001 From: Thomas Hunziker Date: Thu, 12 Jul 2018 10:10:27 +0200 Subject: [PATCH 11/92] Checking return value and catching whole stuff --- plugins/sampledata/blog/blog.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/plugins/sampledata/blog/blog.php b/plugins/sampledata/blog/blog.php index 301f43f515a8e..0be0f8e5a71db 100644 --- a/plugins/sampledata/blog/blog.php +++ b/plugins/sampledata/blog/blog.php @@ -340,12 +340,16 @@ public function onAjaxSampledataApplyStep2() $menu['menutype'] = $i . $type; - $menuTable->load(); - $menuTable->bind($menu); - $menuTable->check(); - try { + $menuTable->load(); + $menuTable->bind($menu); + + if (!$menuTable->check()) + { + throw new Exception($menuTable->getError()); + } + $menuTable->store(); } catch (Exception $e) From 158ba36019a7294def93ee0d58b818c17f80e3a5 Mon Sep 17 00:00:00 2001 From: Thomas Hunziker Date: Thu, 12 Jul 2018 16:21:06 +0200 Subject: [PATCH 12/92] Updating Bosnian installation language files --- installation/language/bs-BA/bs-BA.ini | 74 ++++++++++++++------------- installation/language/bs-BA/bs-BA.xml | 6 +-- 2 files changed, 42 insertions(+), 38 deletions(-) diff --git a/installation/language/bs-BA/bs-BA.ini b/installation/language/bs-BA/bs-BA.ini index 1b2a04d99b92a..17743c2b2cf5f 100644 --- a/installation/language/bs-BA/bs-BA.ini +++ b/installation/language/bs-BA/bs-BA.ini @@ -19,7 +19,7 @@ INSTL_WARNJSON="Za instalaciju Joomla-е! PHP mora imati omogućen JSON dodatak" ;Preinstall view INSTL_PRECHECK_TITLE="Provjera prije instalacije" -INSTL_PRECHECK_DESC="Ako bilo koja od ovih stavki nije podržana (obilježena kao NE) molimo vas da ih omogućite. Ukoliko to ne napravite, nećete biti u mogućnosti instalirati Joomlu." +INSTL_PRECHECK_DESC="Ako bilo koja od ovih stavki nije podržana (obilježena kao NE) molimo vas da ih omogućite. Ukoliko to ne napravite, nećete biti u mogućnosti instalirati Joomlu." INSTL_PRECHECK_RECOMMENDED_SETTINGS_TITLE="Preporučene postavke:" INSTL_PRECHECK_RECOMMENDED_SETTINGS_DESC="Ove PHP postavke su preporučene za potpunu kompatibilnost s Joomlom.
Joomla! će biti funkcionalna i ako postavke nisu baš identične preporučenim." INSTL_PRECHECK_DIRECTIVE="Direktiva" @@ -31,6 +31,9 @@ INSTL_DATABASE="Konfiguracija baze podataka" INSTL_DATABASE_ERROR_POSTGRESQL_QUERY="PostgreSQL upit na bazu nije uspio." INSTL_DATABASE_HOST_DESC="Uobičajeno je ovdje "localhost" ili ime koje ste dobili od hostera." INSTL_DATABASE_HOST_LABEL="Ime servera" +INSTL_DATABASE_HOST_IS_NOT_LOCALHOST_CREATE_FILE="Nismo mogli kreirati fajl. Ručno kreirajte fajl pod nazivom "%1$s" i prenesite ga na "%2$s" mapu vaše Joomla web-stranice." +INSTL_DATABASE_HOST_IS_NOT_LOCALHOST_DELETE_FILE="Da biste potvrdili da ste vlasnik ove web-lokacije, izbrišite fajl pod nazivom "%1$s" koji smo kreirali u "%2$s" mapi vaše Joomla web-stranice." +INSTL_DATABASE_HOST_IS_NOT_LOCALHOST_GENERAL_MESSAGE="Pokušavate koristiti host baze podataka koji nije na lokalnom serveru. Iz sigurnosnih razloga morate potvrditi vlasništvo nad svojim računom za web hosting. Pročitajte dokumentaciju za više informacija." INSTL_DATABASE_NAME_DESC="Neki hostinzi dozvoljavaju samo određena imena baze podataka za svaki portal. Koristite drugačiji prefiks tablice za različite Joomla! portale." INSTL_DATABASE_NAME_LABEL="Ime baze podataka" INSTL_DATABASE_NO_SCHEMA="Ne postoji šema baze za ovaj tip baze." @@ -43,30 +46,29 @@ INSTL_DATABASE_PREFIX_LABEL="Prefiks tablice" INSTL_DATABASE_PREFIX_MSG="Prefiks baze podataka mora početi slovom, za kojim slijede proizvoljni alfanumerički znakovi, a završiti donjom crtom" INSTL_DATABASE_TYPE_DESC="Ovo je vjerovatno "MySQLi"" INSTL_DATABASE_TYPE_LABEL="Tip baze podataka" -INSTL_DATABASE_USER_DESC="Korisničko ime koje ste kreirali ili korisničko ime dobiveno od hostera." +INSTL_DATABASE_USER_DESC="Korisničko ime koje ste kreirali ili korisničko ime hostinga." INSTL_DATABASE_USER_LABEL="Korisničko ime" ;FTP view INSTL_AUTOFIND_FTP_PATH="Automatsko traženje FTP putanje" INSTL_FTP="FTP Konfiguracija" -INSTL_VERIFY_FTP_SETTINGS="Provjeri FTP postavke" INSTL_FTP_DESC="

Na nekim serverima možda ćete morati upisati FTP podatke za završetak instalacije. Ako imate problema sa završetkom instalacije provjerite kod svog hostinga, da li je to potrebno.

Iz sigurnosnih razloga, najbolje je da imate poseban FTP korisnički račun sa pristupom samo instalaciji Joomle, a ne cijelom web serveru. Vaš hoster može vam pomoći oko ovoga.

Napomena: Ako instalirate na Windows OS serveru, FTP sloj vam nije potreban.

" -INSTL_FTP_SETTINGS_CORRECT="Postavke ispravne" INSTL_FTP_ENABLE_LABEL="Omogući FTP Sloj" -INSTL_FTP_USER_DESC="Upozorenje! Preporučljivo je da ovo ostavite prazno i da unesete vaše FTP korisničko ime prilikom svakog kopiranja datoteka." INSTL_FTP_HOST_LABEL="FTP Host" INSTL_FTP_PASSWORD_LABEL="FTP šifra" -INSTL_FTP_PASSWORD_DESC="Upozorenje! Preporučljivo je da ovo ostavite prazno i da unesete vašu FTP šifru prilikom svakog kopiranja datoteka." INSTL_FTP_PORT_LABEL="FTP Port" INSTL_FTP_ROOT_LABEL="FTP Root direktorij" INSTL_FTP_SAVE_LABEL="Sačuvaj FTP šifru" -INSTL_FTP_TITLE="FTP Konfiguracija (Opcionalno - većina korisnika može preskočiti ovaj korak - Kliknite na "_QQ_"Dalje"_QQ_" za preskakanje ovog dijela)" +INSTL_FTP_TITLE="FTP Konfiguracija (Opcionalno - većina korisnika može preskočiti ovaj korak - Kliknite na \"Dalje\" za preskakanje ovog dijela)" INSTL_FTP_USER_LABEL="FTP korisničko ime" -INSTL_SITE_NAME_LABEL="Naziv portala" -INSTL_SITE="Osnovne postavke" +INSTL_VERIFY_FTP_SETTINGS="Provjeri FTP postavke" +INSTL_FTP_SETTINGS_CORRECT="Postavke ispravne" +INSTL_FTP_USER_DESC="Upozorenje! Preporučljivo je da ovo ostavite prazno i da unesete vaše FTP korisničko ime prilikom svakog kopiranja datoteka." +INSTL_FTP_PASSWORD_DESC="Upozorenje! Preporučljivo je da ovo ostavite prazno i da unesete vašu FTP šifru prilikom svakog kopiranja datoteka." ;Site View +INSTL_SITE="Osnovne postavke" INSTL_ADMIN_EMAIL_LABEL="E-mail adresa" INSTL_ADMIN_EMAIL_DESC="Unesite adresu el. pošte super administratora portala." INSTL_ADMIN_PASSWORD_LABEL="Šifra" @@ -74,6 +76,7 @@ INSTL_ADMIN_PASSWORD_DESC="Unesite šifru super administratora i potvrdite je u INSTL_ADMIN_PASSWORD2_LABEL="Potvrda šifre" INSTL_ADMIN_USER_LABEL="Korisničko ime" INSTL_ADMIN_USER_DESC="Podesite korisničko ime za Super administratora." +INSTL_SITE_NAME_LABEL="Naziv portala" INSTL_SITE_NAME_DESC="Unesite ime vašeg Joomla! portala." INSTL_SITE_METADESC_LABEL="Opis" INSTL_SITE_METADESC_TITLE_LABEL="Unesite opis portala koji će koristiti web pretraživači. U pravilu najviše 20 riječi je optimalno." @@ -119,37 +122,31 @@ INSTL_EMAIL_NOT_SENT="El. pošta ne može biti poslata." ;Complete view INSTL_COMPLETE_ADMINISTRATION_LOGIN_DETAILS="Detalji administratorske prijave" -; The word 'installation' should not be translated as it is a physical folder. INSTL_COMPLETE_ERROR_FOLDER_ALREADY_REMOVED="Instalacijski direktorij je već izbrisan." -; The word 'installation' should not be translated as it is a physical folder. INSTL_COMPLETE_ERROR_FOLDER_DELETE="Instalacijski direktorij ne može biti obrisan. Molim, obrišite ga ručno." -; The word 'installation' should not be translated as it is a physical folder. INSTL_COMPLETE_FOLDER_REMOVED="Instalacijski direktorij je uspješno izbrisan" INSTL_COMPLETE_LANGUAGE_1="Joomla! na vašem jeziku" -; The word 'installation' should not be translated as it is a physical folder. INSTL_COMPLETE_LANGUAGE_DESC="Prije nego što obrišete instalacioni direktorij možete instalirati dodatne jezike. Ako želite da dodate jezik za vaš portal kliknite na dugme." INSTL_COMPLETE_LANGUAGE_DESC2="Napomena: da bi Joomla! preuzela i instalirala novi jezik, potreban vam je pristup internetu.
Neke konfiguracije servera neće dozvoliti Joomla! instalaciju jezika. Ako je to i kod vas slučaj, ne brinite, kasnije možete instalirati jezik na standardni način iz administrskog dijela." -; The word 'installation' should not be translated as it is a physical folder. INSTL_COMPLETE_REMOVE_FOLDER="Izbrišite instalacijski direktorij" -; The word 'installation' should not be translated as it is a physical folder. INSTL_COMPLETE_REMOVE_INSTALLATION="MOLIM DA NE ZABORAVITE OBRISATI INSTALACIJSKI DIREKTORIJ
Nećete moći raditi dalje dok se ne ukloni instalacijsku mapu. Ovo je sigurnosna mogućnost Joomla!-e." INSTL_COMPLETE_TITLE="Čestitamo! Joomla! je instalirana!" INSTL_COMPLETE_INSTALL_LANGUAGES="Dodatni koraci: Instaliranje jezika" ;Languages view -INSTL_LANGUAGES_MORE_LANGUAGES="Pritisnite 'Prethodno' tipku ako želite da instalirate više jezika." INSTL_LANGUAGES="Instalacija jezičkog paketa" INSTL_LANGUAGES_COLUMN_HEADER_LANGUAGE="Jezik" INSTL_LANGUAGES_COLUMN_HEADER_LANGUAGE_TAG="Oznaka jezika" INSTL_LANGUAGES_COLUMN_HEADER_VERSION="Verzija" INSTL_LANGUAGES_DESC="Joomla interfejs je dostupan na nekoliko jezika. Izaberite jezik i instalirajte ga klikom na 'Dalje'.
Napomena: ova operacija traje oko 10 sekundi za preuzimanje i instaliranje svakog jezika. Nemojte izabrati više od 3 jezika za istovremenu instalaciju, da zbog previše duge instalacije ne bi došlo do prekida programa." INSTL_LANGUAGES_MESSAGE_PLEASE_WAIT="Ova operacija traje oko 10 sekundi po jeziku
Molim sačekajte da Joomla preuzme i instalira jezik..." +INSTL_LANGUAGES_MORE_LANGUAGES="Pritisnite 'Prethodno' tipku ako želite da instalirate više jezika." INSTL_LANGUAGES_NO_LANGUAGE_SELECTED="Nijedan jezik nije odabran za instaliranje. Ako želite da instalirate više jezika kliknite na dugme 'Prethodno' i odaberite željeni jezik iz liste" INSTL_LANGUAGES_WARNING_NO_INTERNET="Joomla ne može da se prijavi na server sa jezicima. Završite instalacioni proces." INSTL_LANGUAGES_WARNING_NO_INTERNET2="Napomena: Jezik možete instalirati iz Joomla! administracije" INSTL_LANGUAGES_WARNING_BACK_BUTTON="Povratak na zadnji instalacioni korak" -;Defaultlanguage view +;Default language view INSTL_DEFAULTLANGUAGE_ACTIVATE_MULTILANGUAGE="Aktivirajte višejezičnu funkciju" INSTL_DEFAULTLANGUAGE_ACTIVATE_MULTILANGUAGE_DESC="Ako je aktivan, vaš Joomla portal će imati aktivnu višejezičnu osobinu sa lokalizovanim izbornicima za svaki instalirani jezik" INSTL_DEFAULTLANGUAGE_ACTIVATE_LANGUAGE_CODE_PLUGIN="Omogući dodatak za jezik" @@ -160,8 +157,8 @@ INSTL_DEFAULTLANGUAGE_ADMIN_SET_DEFAULT="Joomla je postavila %s kao vaš podrazu INSTL_DEFAULTLANGUAGE_COLUMN_HEADER_SELECT="Odaberi" INSTL_DEFAULTLANGUAGE_COLUMN_HEADER_LANGUAGE="Jezik" INSTL_DEFAULTLANGUAGE_COLUMN_HEADER_TAG="Oznaka" -INSTL_DEFAULTLANGUAGE_COULD_NOT_CREATE_CONTENT_LANGUAGE="Joomla nije u mogućnosti da automatski kreira sadržaj za jezik %s" INSTL_DEFAULTLANGUAGE_COULD_NOT_ADD_ASSOCIATIONS="Joomla ne može automatski da kreira jezičku asocijaciju." +INSTL_DEFAULTLANGUAGE_COULD_NOT_CREATE_CONTENT_LANGUAGE="Joomla nije u mogućnosti da automatski kreira sadržaj za jezik %s" INSTL_DEFAULTLANGUAGE_COULD_NOT_CREATE_MENU="Joomla ne može automatski da kreira izbornik %s" INSTL_DEFAULTLANGUAGE_COULD_NOT_CREATE_MENU_ITEM="Joomla ne može automatski da kreira početnu stavku izbornika %s" INSTL_DEFAULTLANGUAGE_COULD_NOT_CREATE_MENU_MODULE="Joomla ne može automatski da kreira izbornik modul %s" @@ -189,6 +186,7 @@ INSTL_DEFAULTLANGUAGE_NATIVE_LANGUAGE_NAME="Bosanski (bs-BA)" ;Database Model INSTL_DATABASE_COULD_NOT_CONNECT="Nije moguće povezati se na bazu. Povezivanje vraća grešku broj: %s" +INSTL_DATABASE_COULD_NOT_CREATE_DATABASE="Instalacijska procedura se ne može konektovati na specificiranu bazu i nije uspjelo kreiranje iste. Molimo provjerite vaše postavke i ako je potrebno ručno kreirajte bazu." INSTL_DATABASE_COULD_NOT_REFRESH_MANIFEST_CACHE="Nije moguće osvježiti manifest međuspremnik za dodatak: %s" INSTL_DATABASE_EMPTY_NAME="" INSTL_DATABASE_ERROR_BACKINGUP="Pojavila se greška prilikom spremanja sigurnosne kopije baze." @@ -201,17 +199,16 @@ INSTL_DATABASE_FIX_TOO_LONG="Prefiks MySQL tablice smije imati najviše 15 znako INSTL_DATABASE_INVALID_DB_DETAILS="Sadržaj baze je pogrešan i/ili prazan." INSTL_DATABASE_INVALID_MYSQL_VERSION="Potreban je MySQL 5.0.4 ili viša verzija za nastavak instalacije. Vaša verzija je: %s" INSTL_DATABASE_INVALID_MYSQLI_VERSION="Potreban je MySQL 5.0.4 ili viša verzija za nastavak instalacije. Vaša verzija je: %s" +INSTL_DATABASE_INVALID_PDOMYSQL_VERSION="Trebate MySQL 5.0.4 ili višu verziju da nastavite instalaciju. Vaša verzija je: %s" +INSTL_DATABASE_INVALID_POSTGRESQL_VERSION="Trebate PostgreSQL 8.3.18 ili višu verziju da nastavite instalaciju. Vaša verzija je: %s" INSTL_DATABASE_INVALID_SQLSRV_VERSION="Potreban je SQL Server 2008 R2 (10.50.1600.1) ili viša verzija za nastavak instalacije. Vaša verzija je: %s" INSTL_DATABASE_INVALID_SQLZURE_VERSION="Potreban je SQL Server 2008 R2 (10.50.1600.1) ili viša verzija za nastavak instalacije. Vaša verzija je: %s" INSTL_DATABASE_INVALID_TYPE="Molimo odaberite tip baze" INSTL_DATABASE_NAME_TOO_LONG="Ime MySQL baze podataka mora imati najviše 64 znaka" -INSTL_DATABASE_INVALID_NAME="MySQL verzija prije verzije 5.1.6 ne smije sadržavati tačke ili druge "_QQ_"posebne"_QQ_" znakove u nazivu. Vaša verzija je: %s" +INSTL_DATABASE_INVALID_NAME="MySQL verzija prije verzije 5.1.6 ne smije sadržavati tačke ili druge \"posebne\" znakove u nazivu. Vaša verzija je: %s" INSTL_DATABASE_NAME_INVALID_SPACES="MySQL ime baze i tablice ne može početi ili završiti se praznim mjestom (razmaci)." INSTL_DATABASE_NAME_INVALID_CHAR="Niti jedan MySQL identifikator ne može sadržavati NULL ASCII(0x00)." INSTL_DATABASE_FILE_DOES_NOT_EXIST="Datoteka %s ne postoji" -INSTL_DATABASE_COULD_NOT_CREATE_DATABASE="Instalacijska procedura se ne može konektovati na specificiranu bazu i nije uspjelo kreiranje iste. Molimo provjerite vaše postavke i ako je potrebno ručno kreirajte bazu." -INSTL_DATABASE_INVALID_PDOMYSQL_VERSION="Trebate MySQL 5.0.4 ili višu verziju da nastavite instalaciju. Vaša verzija je: %s" -INSTL_DATABASE_INVALID_POSTGRESQL_VERSION="Trebate PostgreSQL 8.3.18 ili višu verziju da nastavite instalaciju. Vaša verzija je: %s" ;controllers INSTL_COOKIES_NOT_ENABLED="Kukiji nisu dozvoljeni u vašem web pregledniku. Nećete moći instalirati aplikaciju ukoliko je ta opcija isključena." @@ -227,22 +224,21 @@ INSTL_STD_OFFLINE_MSG="Stranica je trenutno u izradi .
Molim posjetite nas ;FTP model INSTL_FTP_INVALIDROOT="Unesena FTP mapa nije mapa Joomla! instalacije" INSTL_FTP_NOCONNECT="Nije moguće povezati se na FTP server" -INSTL_FTP_NODELE="Funkcija "_QQ_"DELE"_QQ_" nije uspjela." +INSTL_FTP_NODELE="Funkcija \"DELE\" nije uspjela." INSTL_FTP_NODIRECTORYLISTING="Nije moguće dobiti popis mapa sa FTP servera." -INSTL_FTP_NOLIST="Funkcija "_QQ_"LIST"_QQ_" nije uspjela." +INSTL_FTP_NOLIST="Funkcija \"LIST\" nije uspjela." INSTL_FTP_NOLOGIN="Nije moguća prijava na FTP server." -INSTL_FTP_NOMKD="Funkcija "_QQ_"MKD"_QQ_" nije uspjela." -INSTL_FTP_NONLST="Funkcija "_QQ_"NLST"_QQ_" nije uspjela." -INSTL_FTP_NOPWD="Funkcija "_QQ_"PWD"_QQ_" nije uspjela." -INSTL_FTP_NORETR="Funkcija "_QQ_"RETR"_QQ_" nije uspjela." -INSTL_FTP_NORMD="Funkcija "_QQ_"RMD"_QQ_" nije uspjela." +INSTL_FTP_NOMKD="Funkcija \"MKD\" nije uspjela." +INSTL_FTP_NONLST="Funkcija \"NLST\" nije uspjela." +INSTL_FTP_NOPWD="Funkcija \"PWD\" nije uspjela." +INSTL_FTP_NORETR="Funkcija \"RETR\" nije uspjela." +INSTL_FTP_NORMD="Funkcija \"RMD\" nije uspjela." INSTL_FTP_NOROOT="Nije moguće pristupiti traženoj FTP mapi" -INSTL_FTP_NOSTOR="Funkcija "_QQ_"STOR"_QQ_" nije uspjela." -INSTL_FTP_NOSYST="Funkcija "_QQ_"SYST"_QQ_" nije uspjela." +INSTL_FTP_NOSTOR="Funkcija \"STOR\" nije uspjela." +INSTL_FTP_NOSYST="Funkcija \"SYST\" nije uspjela." INSTL_FTP_UNABLE_DETECT_ROOT_FOLDER="Nije moguće automatsko prepoznavanje osnovnog FTP direktorija" ;others -INSTL_BASIC_SETTINGS="Osnovne postavke" INSTL_CONFPROBLEM="Vaša konfiguracijska datoteka ili mapa nemaju prava za zapisivanje ili je došlo do problema prilikom izrade konfiguracijske datoteke. Morati ćete ručno učitati sljedeći kod. Kliknite u prostor za tekst za odabir cijelog teksta koda, zatim ga kopirajte i dodajte u novu datoteku imena 'configuration.php', te datoteku prenesite u osnovni direktorij vašeg portala." INSTL_DATABASE_SUPPORT="Podrška baze:" INSTL_DISPLAY_ERRORS="Prikaz grešaka" @@ -255,14 +251,13 @@ INSTL_MAGIC_QUOTES_GPC="Magic Quotes GPC isključen" INSTL_MAGIC_QUOTES_RUNTIME="Magic Quotes Okruženje" INSTL_MB_LANGUAGE_IS_DEFAULT="MB jezik je standardan" INSTL_MB_STRING_OVERLOAD_OFF="MB String Overload Isključen" -INSTL_MCRYPT_SUPPORT_AVAILABLE="Podrška za Mcrypt" INSTL_NOTICEMBLANGNOTDEFAULT="PHP mbstring jezik nije neutralan. Ovo možete namjestiti lokalno unošenjem php_value mbstring.language neutral u .htaccess." INSTL_NOTICEMBSTRINGOVERLOAD="PHP mbstring function overload je uključen. Ovo može biti isključeno lokalno unošenjem php_value mbstring.func_overload 0 u .htaccess." -INSTL_NOTICEMCRYPTNOTAVAILABLE="Pažnja! PHP mcrypt dodatak bi trebao biti instaliran i/ili omogućen. Bez ovoga, neke Joomla funkcionalnosti neće biti dostupne." INSTL_NOTICEYOUCANSTILLINSTALL="
Još uvijek možete nastaviti instalaciju, konfiguracijska podešavanja će biti prikazana na kraju. Morati ćete ručno kopirati kod. Kliknite na tekst i odaberite ga, a zatim kopirajte u novu tekstualnu datoteku. Datoteku nazovite 'configuration.php' i kopirajte u osnovni direktorij portala (root direktorij)." INSTL_OUTPUT_BUFFERING="Izlazna međumemorija" INSTL_PARSE_INI_FILE_AVAILABLE="INI Parser podrška" INSTL_PHP_VERSION="PHP verzija" +INSTL_PHP_VERSION_NEWER="PHP Verzija >= %s" INSTL_REGISTER_GLOBALS="Registar Globalnih funkcija isključen" INSTL_SAFE_MODE="Safe Mode funkcija" INSTL_SESSION_AUTO_START="Automatsko pokretanje sesija" @@ -303,6 +298,10 @@ JLIB_FILESYSTEM_ERROR_PATH_IS_NOT_A_FOLDER_FILES="JFolder: :files: Putanja nije JLIB_FORM_FIELD_INVALID="Pogrešno polje: " JLIB_FORM_VALIDATE_FIELD_INVALID="Pogrešno: %s" JLIB_FORM_VALIDATE_FIELD_REQUIRED="Obavezno: %s" +JLIB_INSTALLER_ABORT="Prekid instalacije jezika: %s" +JLIB_INSTALLER_ABORT_PACK_INSTALL_CREATE_DIRECTORY="Instalacija paketa: Ne može se kreirati direktorij: %s." +JLIB_INSTALLER_ABORT_PACK_INSTALL_ERROR_EXTENSION="Paket %1$s: Dogodila se greška pri instalaciji dodatka: %2$s" +JLIB_INSTALLER_ABORT_PACK_INSTALL_NO_FILES="Paket %s: Nema fajlova za instalaciju!" JLIB_INSTALLER_ERROR_FAIL_COPY_FILE="JInstaller: :Install: nije uspjelo kopiranje datoteke %1$s u %2$s." JLIB_INSTALLER_NOT_ERROR="Ako se greška odnosi na instalaciju TinyMCE jezičkih datoteka nema efekta na instalaciju jezika. Neki jezički paketi kreirani prije Joomla! 3.2.0 mogu pokušati da instaliraju odvojene TinyMCE jezičke datoteke. Budući da su sada uključeni u glavnu instalaciu, nije ih potrebno instalirati, " JLIB_UTIL_ERROR_CONNECT_DATABASE="JDatabase: :getInstance: Nije moguće spajanje na bazu podataka
joomla.library: %1$s - %2$s" @@ -338,5 +337,10 @@ WARNING="Upozorenje" JLIB_JS_AJAX_ERROR_CONNECTION_ABORT="Došlo je do prekida veze prilikom dohvaćanja JSON podataka." JLIB_JS_AJAX_ERROR_NO_CONTENT="Nema vraćenog sadržaja." JLIB_JS_AJAX_ERROR_OTHER="Greška kod dohvaćanja JSON podataka: HTTP %s status kôd." -JLIB_JS_AJAX_ERROR_PARSE="Greška prilikom procesiranja JSON podataka:
%s" +JLIB_JS_AJAX_ERROR_PARSE="Greška prilikom procesiranja JSON podataka:
%s" JLIB_JS_AJAX_ERROR_TIMEOUT="Isteklo je vrijeme za dohvaćanje JSON podataka." + +;Old Strings +INSTL_BASIC_SETTINGS="Osnovne postavke" +INSTL_MCRYPT_SUPPORT_AVAILABLE="Podrška za Mcrypt" +INSTL_NOTICEMCRYPTNOTAVAILABLE="Pažnja! PHP mcrypt dodatak bi trebao biti instaliran i/ili omogućen. Bez ovoga, neke Joomla funkcionalnosti neće biti dostupne." diff --git a/installation/language/bs-BA/bs-BA.xml b/installation/language/bs-BA/bs-BA.xml index 791833b32eca3..0ed65473c71f3 100644 --- a/installation/language/bs-BA/bs-BA.xml +++ b/installation/language/bs-BA/bs-BA.xml @@ -1,10 +1,10 @@ Bosanski (BA) - 3.7.0 - October 2016 + 3.8.11 + Jul 2018 Bosnian Translation Team Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt From bbd7bdd6948af80c719916a419950ecd895b939f Mon Sep 17 00:00:00 2001 From: Luca Marzo Date: Fri, 13 Jul 2018 12:53:31 +0200 Subject: [PATCH 13/92] Updated 3.9-dev and added 3.10-dev (#21097) --- .github/CONTRIBUTING.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index caf403a10e050..8de2598070b5a 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -20,5 +20,6 @@ There are other branches available which serve specific purposes. | Branch | Purpose | | ------ | ------- | | staging | Current codebase. Branch for the next minor Joomla version. New backward compatible features go into this branch. | -| 3.9-dev | Branch for the next minor Joomla version. The 3.9.0 release will only include compatibility features for 4.0. Commits to staging will be applied to this branch as well. | +| 3.9-dev | Branch for the next minor Joomla version. The 3.9.0 release will include the Privacy Tools Suite features. Commits to staging will be applied to this branch as well. | +| 3.10-dev | Branch for the next minor Joomla version. The 3.10.0 release will only include compatibility features for 4.0. Commits to staging will be applied to this branch as well. | | 4.0-dev | Branch for the next major Joomla version. New features go into this branch. Commits to staging will be applied to this branch as well. | From aba23aa72545de7323c57c4206f22e5e89758e96 Mon Sep 17 00:00:00 2001 From: Brian Teeman Date: Fri, 13 Jul 2018 14:18:08 +0100 Subject: [PATCH 14/92] Exceptions in Joomla\CMS\Table\Usergroup refer to categories (#21098) * Exceptions in Joomla\CMS\Table\Usergroup refer to categories Pull Request for Issue #21092 . ### Summary of Changes remove todo that is clearly a copy paste error from somewhere else change exception message to usergroups from catergory NOTE the first exception` if ($this->id == 0)` I am not sure if that should even be present - doesn't look like it to me - please advise * Update Usergroup.php --- libraries/src/Table/Usergroup.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/libraries/src/Table/Usergroup.php b/libraries/src/Table/Usergroup.php index 5c9ef105dc172..d171de9d9afc4 100644 --- a/libraries/src/Table/Usergroup.php +++ b/libraries/src/Table/Usergroup.php @@ -160,12 +160,12 @@ public function delete($oid = null) if ($this->id == 0) { - throw new \UnexpectedValueException('Global Category not found'); + throw new \UnexpectedValueException('Usergroup not found'); } if ($this->parent_id == 0) { - throw new \UnexpectedValueException('Root categories cannot be deleted.'); + throw new \UnexpectedValueException('Root usergroup cannot be deleted.'); } if ($this->lft == 0 || $this->rgt == 0) @@ -189,9 +189,6 @@ public function delete($oid = null) throw new \UnexpectedValueException('Left-Right data inconsistency. Cannot delete usergroup.'); } - // Delete the category dependencies - // @todo Remove all related threads, posts and subscriptions - // Delete the usergroup and its children $query->clear() ->delete($db->quoteName($this->_tbl)) From 0c59b29126742d4a8ca673c56baaf515561f0629 Mon Sep 17 00:00:00 2001 From: SharkyKZ Date: Sat, 14 Jul 2018 17:11:55 +0300 Subject: [PATCH 15/92] Deprecate sef_advanced strings (#21116) --- administrator/language/en-GB/en-GB.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/administrator/language/en-GB/en-GB.ini b/administrator/language/en-GB/en-GB.ini index bd1b795573078..2942c6c28820d 100644 --- a/administrator/language/en-GB/en-GB.ini +++ b/administrator/language/en-GB/en-GB.ini @@ -518,6 +518,7 @@ JGLOBAL_SAVE_HISTORY_OPTIONS_DESC="Automatically save old versions of an item. I JGLOBAL_SAVE_HISTORY_OPTIONS_LABEL="Enable Versions" JGLOBAL_SECRETKEY="Secret Key" JGLOBAL_SECRETKEY_HELP="If you have enabled two factor authentication in your user account please enter your secret key. If you do not know what this means, you can leave this field blank." +; The following 4 strings are deprecated and will be removed with 4.0. JGLOBAL_SEF_ADVANCED_DESC="Modern routing enables advanced features but may change your URLs. Legacy routing ensures full compatibility for existing sites. This is configured per component." JGLOBAL_SEF_ADVANCED_LABEL="URL Routing" JGLOBAL_SEF_ADVANCED_LEGACY="Legacy" From 136171ecb9ee4ed8d31baf4a84f753e0d2fd0f78 Mon Sep 17 00:00:00 2001 From: SharkyKZ Date: Tue, 17 Jul 2018 01:29:43 +0300 Subject: [PATCH 16/92] [com_content] Featured articles tag filtering (#21138) --- .../com_content/models/featured.php | 38 ++++++++++++++----- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/administrator/components/com_content/models/featured.php b/administrator/components/com_content/models/featured.php index 81af7d7f57f5d..71b68481fe680 100644 --- a/administrator/components/com_content/models/featured.php +++ b/administrator/components/com_content/models/featured.php @@ -212,18 +212,38 @@ protected function getListQuery() $query->where('a.language = ' . $db->quote($language)); } - // Filter by a single tag. + // Filter by a single or group of tags. $tagId = $this->getState('filter.tag'); - if (is_numeric($tagId)) + if (is_array($tagId) && count($tagId) === 1) { - $query->where($db->quoteName('tagmap.tag_id') . ' = ' . (int) $tagId) - ->join( - 'LEFT', - $db->quoteName('#__contentitem_tag_map', 'tagmap') - . ' ON ' . $db->quoteName('tagmap.content_item_id') . ' = ' . $db->quoteName('a.id') - . ' AND ' . $db->quoteName('tagmap.type_alias') . ' = ' . $db->quote('com_content.article') - ); + $tagId = current($tagId); + } + + if (is_array($tagId)) + { + $tagId = implode(',', ArrayHelper::toInteger($tagId)); + + if ($tagId) + { + $subQuery = $db->getQuery(true) + ->select('DISTINCT content_item_id') + ->from($db->quoteName('#__contentitem_tag_map')) + ->where('tag_id IN (' . $tagId . ')') + ->where('type_alias = ' . $db->quote('com_content.article')); + + $query->join('INNER', '(' . (string) $subQuery . ') AS tagmap ON tagmap.content_item_id = a.id'); + } + } + elseif ($tagId) + { + $query->join( + 'INNER', + $db->quoteName('#__contentitem_tag_map', 'tagmap') + . ' ON tagmap.tag_id = ' . (int) $tagId + . ' AND tagmap.content_item_id = a.id' + . ' AND tagmap.type_alias = ' . $db->quote('com_content.article') + ); } // Add the list ordering clause. From 7279924ddb1922bd4cb279bbf7d3c4fbf67510c8 Mon Sep 17 00:00:00 2001 From: SharkyKZ Date: Tue, 17 Jul 2018 01:38:10 +0300 Subject: [PATCH 17/92] Update ModuleHelper.php (#20273) --- libraries/src/Helper/ModuleHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/src/Helper/ModuleHelper.php b/libraries/src/Helper/ModuleHelper.php index 4c93ac5dcaeb0..8e999efa0a1c1 100644 --- a/libraries/src/Helper/ModuleHelper.php +++ b/libraries/src/Helper/ModuleHelper.php @@ -386,7 +386,7 @@ public static function getModuleList() $clientId = (int) $app->getClientId(); // Build a cache ID for the resulting data object - $cacheId = $groups . $clientId . $Itemid; + $cacheId = $groups . '.' . $clientId . '.' . $Itemid; $db = \JFactory::getDbo(); From 3d713febce30e51906637c1beb76035922f4591b Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Thu, 19 Jul 2018 07:19:05 -0500 Subject: [PATCH 18/92] The JPATH_ constants are not magic strings (#21151) --- administrator/components/com_contact/models/contact.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/components/com_contact/models/contact.php b/administrator/components/com_contact/models/contact.php index d279e57dd548e..936591f4979d9 100644 --- a/administrator/components/com_contact/models/contact.php +++ b/administrator/components/com_contact/models/contact.php @@ -267,7 +267,7 @@ public function getTable($type = 'Contact', $prefix = 'ContactTable', $config = */ public function getForm($data = array(), $loadData = true) { - JForm::addFieldPath('JPATH_ADMINISTRATOR/components/com_users/models/fields'); + JForm::addFieldPath(JPATH_ADMINISTRATOR . '/components/com_users/models/fields'); // Get the form. $form = $this->loadForm('com_contact.contact', 'contact', array('control' => 'jform', 'load_data' => $loadData)); From 7b73d5f230fd6506cbc10e6cf84de532c3798692 Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Fri, 20 Jul 2018 08:17:57 -0500 Subject: [PATCH 19/92] Remove if/else in user debug models that can never hit else conditions (#21188) --- .../components/com_users/models/debuggroup.php | 15 ++------------- .../components/com_users/models/debuguser.php | 15 ++------------- 2 files changed, 4 insertions(+), 26 deletions(-) diff --git a/administrator/components/com_users/models/debuggroup.php b/administrator/components/com_users/models/debuggroup.php index 70617eb49785c..bb87ebade722c 100644 --- a/administrator/components/com_users/models/debuggroup.php +++ b/administrator/components/com_users/models/debuggroup.php @@ -78,19 +78,8 @@ public function getItems() foreach ($actions as $action) { $name = $action[0]; - $level = $action[1]; - - // Check that we check this action for the level of the asset. - if ($level === null || $level >= $asset->level) - { - // We need to test this action. - $asset->checks[$name] = JAccess::checkGroup($groupId, $name, $asset->name); - } - else - { - // We ignore this action. - $asset->checks[$name] = 'skip'; - } + + $asset->checks[$name] = JAccess::checkGroup($groupId, $name, $asset->name); } } } diff --git a/administrator/components/com_users/models/debuguser.php b/administrator/components/com_users/models/debuguser.php index 584a4b825253a..749ce512170b2 100644 --- a/administrator/components/com_users/models/debuguser.php +++ b/administrator/components/com_users/models/debuguser.php @@ -79,19 +79,8 @@ public function getItems() foreach ($actions as $action) { $name = $action[0]; - $level = $action[1]; - - // Check that we check this action for the level of the asset. - if ($level === null || $level >= $asset->level) - { - // We need to test this action. - $asset->checks[$name] = $user->authorise($name, $asset->name); - } - else - { - // We ignore this action. - $asset->checks[$name] = 'skip'; - } + + $asset->checks[$name] = $user->authorise($name, $asset->name); } } } From 4d731784e7c0c49c8abd9b03515f8e489aac1797 Mon Sep 17 00:00:00 2001 From: SharkyKZ Date: Sat, 21 Jul 2018 04:00:41 +0300 Subject: [PATCH 20/92] [com_content] Featured articles access filter (#21168) --- .../components/com_content/models/featured.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/administrator/components/com_content/models/featured.php b/administrator/components/com_content/models/featured.php index 71b68481fe680..944126fd52335 100644 --- a/administrator/components/com_content/models/featured.php +++ b/administrator/components/com_content/models/featured.php @@ -120,15 +120,24 @@ protected function getListQuery() } // Filter by access level. - if ($access = $this->getState('filter.access')) + $access = $this->getState('filter.access'); + + if (is_numeric($access)) { $query->where('a.access = ' . (int) $access); } + elseif (is_array($access)) + { + $access = ArrayHelper::toInteger($access); + $access = implode(',', $access); + $query->where('a.access IN (' . $access . ')'); + } // Filter by access level on categories. if (!$user->authorise('core.admin')) { $groups = implode(',', $user->getAuthorisedViewLevels()); + $query->where('a.access IN (' . $groups . ')'); $query->where('c.access IN (' . $groups . ')'); } From 8655c2cd912959075fe0a5a2c0d8623c8d9434e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Smoli=C5=84ski?= Date: Sat, 21 Jul 2018 03:02:43 +0200 Subject: [PATCH 21/92] Media manager doesn't obey relative pathes for video files (#21156) * correct video url fixes https://github.com/joomla/joomla-cms/issues/21145#issuecomment-405484769 * fix --- .../components/com_media/views/medialist/tmpl/thumbs_videos.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/components/com_media/views/medialist/tmpl/thumbs_videos.php b/administrator/components/com_media/views/medialist/tmpl/thumbs_videos.php index b3b40e249804a..087e44269e6e7 100644 --- a/administrator/components/com_media/views/medialist/tmpl/thumbs_videos.php +++ b/administrator/components/com_media/views/medialist/tmpl/thumbs_videos.php @@ -38,7 +38,7 @@ From d6e33a41b0caf073faa04402fac84569527e0227 Mon Sep 17 00:00:00 2001 From: Tomasz Narloch Date: Sat, 21 Jul 2018 03:03:25 +0200 Subject: [PATCH 22/92] Speed up regex in emailcloak plugin (#20956) * Speed up regex in emailcloak plugin * Fix comment --- plugins/content/emailcloak/emailcloak.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/content/emailcloak/emailcloak.php b/plugins/content/emailcloak/emailcloak.php index a6ed5f1c3d882..9dd2e4ca7d82f 100644 --- a/plugins/content/emailcloak/emailcloak.php +++ b/plugins/content/emailcloak/emailcloak.php @@ -484,9 +484,9 @@ protected function _cloak(&$text, &$params) /* * Search for plain text email addresses, such as email@example.org but not within HTML tags: * or - * The negative lookahead '(?![^<]*>)' is used to exclude this kind of occurrences + * The '<[^<]*>(*SKIP)(*F)|' trick is used to exclude this kind of occurrences */ - $pattern = '~(?![^<>]*>)' . $searchEmail . '~i'; + $pattern = '~<[^<]*>(*SKIP)(*F)|' . $searchEmail . '~i'; while (preg_match($pattern, $text, $regs, PREG_OFFSET_CAPTURE)) { From 98f947ab6c846e292493786ac80973076b9da2da Mon Sep 17 00:00:00 2001 From: Ciaran Walsh Date: Sat, 21 Jul 2018 02:04:40 +0100 Subject: [PATCH 23/92] Fix subform.repeatable-table multi field styling (#20209) * Fix subform.repeatable-table multi field styling * Fix staging less/css * revert previous --- .../templates/isis/css/template-rtl.css | 20 +++---------------- administrator/templates/isis/css/template.css | 4 +++- .../templates/isis/less/blocks/_forms.less | 7 +++++-- .../templates/isis/less/template-rtl.less | 2 +- 4 files changed, 12 insertions(+), 21 deletions(-) diff --git a/administrator/templates/isis/css/template-rtl.css b/administrator/templates/isis/css/template-rtl.css index d5820fc5dbf64..2c082910b1354 100644 --- a/administrator/templates/isis/css/template-rtl.css +++ b/administrator/templates/isis/css/template-rtl.css @@ -7538,7 +7538,9 @@ textarea.noResize { margin-bottom: 10px; } } -.subform-table-layout .control-group, +.subform-table-layout .control-group { + margin-bottom: 10px; +} .subform-table-layout .control-group:last-of-type { margin-bottom: 0; } @@ -9350,22 +9352,6 @@ body { .pager .previous a { float: right; } -.btn-group > .btn:first-child, -.radio.btn-group > label:first-of-type { - margin-left: 0; - -webkit-border-bottom-left-radius: 0px; - border-bottom-left-radius: 0px; - -webkit-border-top-left-radius: 0px; - border-top-left-radius: 0px; - -moz-border-radius-bottomleft: 0px; - -moz-border-radius-topleft: 0px; - -webkit-border-bottom-right-radius: 4px; - border-bottom-right-radius: 4px; - -webkit-border-top-right-radius: 4px; - border-top-right-radius: 4px; - -moz-border-radius-bottomright: 4px; - -moz-border-radius-topright: 4px; -} .icon-arrow-right { background-position: -241px -94px; float: left; diff --git a/administrator/templates/isis/css/template.css b/administrator/templates/isis/css/template.css index 2e2ec4a34e187..059887b1aedae 100644 --- a/administrator/templates/isis/css/template.css +++ b/administrator/templates/isis/css/template.css @@ -7538,7 +7538,9 @@ textarea.noResize { margin-bottom: 10px; } } -.subform-table-layout .control-group, +.subform-table-layout .control-group { + margin-bottom: 10px; +} .subform-table-layout .control-group:last-of-type { margin-bottom: 0; } diff --git a/administrator/templates/isis/less/blocks/_forms.less b/administrator/templates/isis/less/blocks/_forms.less index 3a10120d0c102..ff35a3e525ef1 100644 --- a/administrator/templates/isis/less/blocks/_forms.less +++ b/administrator/templates/isis/less/blocks/_forms.less @@ -253,8 +253,11 @@ textarea.noResize { } .subform-table-layout { - .control-group, .control-group:last-of-type { - margin-bottom: 0; + .control-group { + margin-bottom: 10px; + &:last-of-type { + margin-bottom: 0; + } } .controls { padding-right: 20px; diff --git a/administrator/templates/isis/less/template-rtl.less b/administrator/templates/isis/less/template-rtl.less index 3ca5205be3e5e..57331b61a7285 100644 --- a/administrator/templates/isis/less/template-rtl.less +++ b/administrator/templates/isis/less/template-rtl.less @@ -433,4 +433,4 @@ a.grid_true { } } } -} \ No newline at end of file +} From 7ce46ec07bb3a77c78609df914dc57223b90dd5e Mon Sep 17 00:00:00 2001 From: Helios Ciancio Date: Sat, 21 Jul 2018 03:06:14 +0200 Subject: [PATCH 24/92] Update FormField.php (#20168) --- libraries/src/Form/FormField.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/libraries/src/Form/FormField.php b/libraries/src/Form/FormField.php index 36d5677820155..96dd3fd3a7248 100644 --- a/libraries/src/Form/FormField.php +++ b/libraries/src/Form/FormField.php @@ -600,7 +600,14 @@ public function setup(\SimpleXMLElement $element, $value, $group = null) $this->default = isset($element['value']) ? (string) $element['value'] : $this->default; // Set the field default value. - $this->value = $value; + if ($element['multiple'] && is_string($value) && is_array(json_decode($value, true))) + { + $this->value = (array) json_decode($value); + } + else + { + $this->value = $value; + } foreach ($attributes as $attributeName) { From 1ba7727130f8e5b60df227f7d1b8120edfc7c104 Mon Sep 17 00:00:00 2001 From: ReLater Date: Sat, 21 Jul 2018 03:06:49 +0200 Subject: [PATCH 25/92] Update HTMLHelper.php (#19770) --- libraries/src/HTML/HTMLHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/src/HTML/HTMLHelper.php b/libraries/src/HTML/HTMLHelper.php index 7930e0e2d3c68..190a45ea8f904 100644 --- a/libraries/src/HTML/HTMLHelper.php +++ b/libraries/src/HTML/HTMLHelper.php @@ -582,7 +582,7 @@ public static function image($file, $alt, $attribs = null, $relative = false, $r } // If only path is required - if ($returnPath) + if ($returnPath === 1) { return $file; } From 54d5b93234b2be6ea4b1f50093517894cf880c7f Mon Sep 17 00:00:00 2001 From: Klas Date: Sat, 21 Jul 2018 04:16:26 +0200 Subject: [PATCH 26/92] Fix a problem with older Joomla versions language packs registration and update sites rebuild (#16355) * Fix a problem with older language packs Language packs installed under older Joomla versions are registered in the database under their package name, not under their name and since rebuild function fails on them. e.g. package with Afrikaans (South Africa) af-ZA has name column in #_extensions table set as af-ZA and since existing query fails. * Update updatesites.php --- .../components/com_installer/models/updatesites.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/administrator/components/com_installer/models/updatesites.php b/administrator/components/com_installer/models/updatesites.php index bf55104aa29fe..d8097ace4a7dc 100644 --- a/administrator/components/com_installer/models/updatesites.php +++ b/administrator/components/com_installer/models/updatesites.php @@ -328,7 +328,10 @@ public function rebuild() $query = $db->getQuery(true) ->select($db->quoteName('extension_id')) ->from($db->quoteName('#__extensions')) - ->where($db->quoteName('name') . ' = ' . $db->quote($manifest->name)) + ->where('(' + . $db->quoteName('name') . ' = ' . $db->quote($manifest->name) + . ' OR ' . $db->quoteName('name') . ' = ' . $db->quote($manifest->packagename) + . ')' ) ->where($db->quoteName('type') . ' = ' . $db->quote($manifest['type'])) ->where($db->quoteName('extension_id') . ' NOT IN (' . $joomlaCoreExtensionIds . ')') ->where($db->quoteName('state') . ' != -1'); From 07239d41fc573a3c1de2d93c11e41f7d24313947 Mon Sep 17 00:00:00 2001 From: infograf768 Date: Sun, 22 Jul 2018 15:03:40 +0000 Subject: [PATCH 27/92] missing single quote (#21213) --- administrator/language/en-GB/en-GB.plg_sampledata_blog.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/language/en-GB/en-GB.plg_sampledata_blog.ini b/administrator/language/en-GB/en-GB.plg_sampledata_blog.ini index 18cc9629640c8..f0dacd2203c67 100644 --- a/administrator/language/en-GB/en-GB.plg_sampledata_blog.ini +++ b/administrator/language/en-GB/en-GB.plg_sampledata_blog.ini @@ -10,7 +10,7 @@ PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_0_FULLTEXT="" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_0_INTROTEXT="

This tells you a bit about this blog and the person who writes it.

When you are logged in you will be able to edit this page by selecting the edit icon.

" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_0_TITLE="About" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_1_FULLTEXT="" -PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_1_INTROTEXT="

Here are some basic tips for working on your site.

  • Joomla! has a 'front end' that you are looking at now and an 'administrator' or back end' which is where you do the more advanced work of creating your site such as setting up the menus and deciding what modules to show. You need to login to the administrator separately using the same user name and password that you used to login to this part of the site.
  • One of the first things you will probably want to do is change the site title and tag line and to add a logo. To do this select the Template Settings link in the top menu. To change your site description, browser title, default email and other items, select Site Settings. More advanced configuration options are available in the administrator.
  • To totally change the look of your site you will probably want to install a new template. In the Extensions menu select Extensions Manager and then go to the Install tab. There are many free and commercial templates available for Joomla.
  • As you have already seen, you can control who can see different parts of you site. When you work with modules, articles or weblinks setting the Access level to Registered will mean that only logged in users can see them
  • When you create a new article or other kind of content you also can save it as Published or Unpublished. If it is Unpublished site visitors will not be able to see it but you will.
  • You can learn much more about working with Joomla from the Joomla documentation site and get help from other users at the Joomla forums. In the administrator there are help buttons on every page that provide detailed information about the functions on that page.
" +PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_1_INTROTEXT="

Here are some basic tips for working on your site.

  • Joomla! has a 'front end' that you are looking at now and an 'administrator' or 'back end' which is where you do the more advanced work of creating your site such as setting up the menus and deciding what modules to show. You need to login to the administrator separately using the same user name and password that you used to login to this part of the site.
  • One of the first things you will probably want to do is change the site title and tag line and to add a logo. To do this select the Template Settings link in the top menu. To change your site description, browser title, default email and other items, select Site Settings. More advanced configuration options are available in the administrator.
  • To totally change the look of your site you will probably want to install a new template. In the Extensions menu select Extensions Manager and then go to the Install tab. There are many free and commercial templates available for Joomla.
  • As you have already seen, you can control who can see different parts of you site. When you work with modules, articles or weblinks setting the Access level to Registered will mean that only logged in users can see them
  • When you create a new article or other kind of content you also can save it as Published or Unpublished. If it is Unpublished site visitors will not be able to see it but you will.
  • You can learn much more about working with Joomla from the Joomla documentation site and get help from other users at the Joomla forums. In the administrator there are help buttons on every page that provide detailed information about the functions on that page.
" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_1_TITLE="Working on Your Site" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_2_FULLTEXT="" PLG_SAMPLEDATA_BLOG_SAMPLEDATA_CONTENT_ARTICLE_2_INTROTEXT="

This is a sample blog posting.

If you log in to the site (the Author Login link is on the very bottom of this page) you will be able to edit it and all of the other existing articles. You will also be able to create a new article and make other changes to the site.

As you add and modify articles you will see how your site changes and also how you can customise it in various ways.

Go ahead, you can't break it.

" From d46391e0c63e518bd9ba69c60b54923e7205880f Mon Sep 17 00:00:00 2001 From: Vadim Rigin Date: Thu, 4 May 2017 01:33:11 +0300 Subject: [PATCH 28/92] Add a note field from the #__fields_groups table to the field list query --- administrator/components/com_fields/models/fields.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/components/com_fields/models/fields.php b/administrator/components/com_fields/models/fields.php index 271191d1c8e33..55179ea50659a 100644 --- a/administrator/components/com_fields/models/fields.php +++ b/administrator/components/com_fields/models/fields.php @@ -155,7 +155,7 @@ protected function getListQuery() $query->select('ua.name AS author_name')->join('LEFT', '#__users AS ua ON ua.id = a.created_user_id'); // Join over the field groups. - $query->select('g.title AS group_title, g.access as group_access, g.state AS group_state'); + $query->select('g.title AS group_title, g.access as group_access, g.state AS group_state, g.note as group_note'); $query->join('LEFT', '#__fields_groups AS g ON g.id = a.group_id'); // Filter by context From 044e044574ec25699bbf61df8b82e4bbab7a5d57 Mon Sep 17 00:00:00 2001 From: infograf768 Date: Tue, 24 Jul 2018 00:15:09 +0000 Subject: [PATCH 29/92] [3.x FIX] Getting the correct associations in sidebyside view for contact and newsfeeds (#21180) * [3.x FIX] Getting the correct associations in sidebyside view for contact and newsfeeds * undefined property * correction in js --- .../com_associations/views/association/tmpl/edit.php | 2 ++ .../com_associations/views/association/view.html.php | 3 +++ media/com_associations/js/sidebyside-uncompressed.js | 11 +++++++---- media/com_associations/js/sidebyside.js | 2 +- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/administrator/components/com_associations/views/association/tmpl/edit.php b/administrator/components/com_associations/views/association/tmpl/edit.php index 408033369d06c..2fe76e58a7775 100644 --- a/administrator/components/com_associations/views/association/tmpl/edit.php +++ b/administrator/components/com_associations/views/association/tmpl/edit.php @@ -38,6 +38,7 @@ data-action="edit" data-item="typeName; ?>" data-id="referenceId; ?>" + data-title="referenceTitle; ?>" data-language="referenceLanguage; ?>" data-editurl="editUri); ?>"> @@ -56,6 +57,7 @@ data-action="targetAction; ?>" data-item="typeName; ?>" data-id="targetId; ?>" + data-title="targetTitle; ?>" data-language="targetLanguage; ?>" data-editurl="editUri); ?>"> diff --git a/administrator/components/com_associations/views/association/view.html.php b/administrator/components/com_associations/views/association/view.html.php index b82f2634f1c13..f071bec34671a 100644 --- a/administrator/components/com_associations/views/association/view.html.php +++ b/administrator/components/com_associations/views/association/view.html.php @@ -110,6 +110,7 @@ public function display($tpl = null) $reference = ArrayHelper::fromObject(AssociationsHelper::getItem($extensionName, $typeName, $referenceId)); $this->referenceLanguage = $reference[$languageField]; + $this->referenceTitle = AssociationsHelper::getTypeFieldName($extensionName, $typeName, 'title'); $options = array( 'option' => $typeName === 'category' ? 'com_categories' : $extensionName, @@ -126,6 +127,7 @@ public function display($tpl = null) $this->targetLanguage = ''; $this->defaultTargetSrc = ''; $this->targetAction = ''; + $this->targetTitle = ''; if ($target = $input->get('target', '', 'string')) { @@ -133,6 +135,7 @@ public function display($tpl = null) $this->targetAction = $matches[2]; $this->targetId = $matches[1]; $this->targetLanguage = $matches[0]; + $this->targetTitle = AssociationsHelper::getTypeFieldName($extensionName, $typeName, 'title'); $task = $typeName . '.' . $this->targetAction; $this->defaultTargetSrc = JRoute::_($this->editUri . '&task=' . $task . '&id=' . (int) $this->targetId); $this->form->setValue('itemlanguage', '', $this->targetLanguage . ':' . $this->targetId . ':' . $this->targetAction); diff --git a/media/com_associations/js/sidebyside-uncompressed.js b/media/com_associations/js/sidebyside-uncompressed.js index c583a391aeb30..0fbccca88edf2 100644 --- a/media/com_associations/js/sidebyside-uncompressed.js +++ b/media/com_associations/js/sidebyside-uncompressed.js @@ -258,9 +258,10 @@ jQuery(document).ready(function($) { } // Update the reference item associations tab. - var reference = document.getElementById('reference-association'); - var languageCode = targetLanguage.replace(/-/, '_'); - var title = $(this).contents().find('#jform_title').val() + var reference = document.getElementById('reference-association'); + var languageCode = targetLanguage.replace(/-/, '_'); + var referenceTitle = reference.getAttribute('data-title'); + var title = $(this).contents().find('#jform_' + referenceTitle).val(); // - For modal association selectors. $(reference).contents().find('#jform_associations_' + languageCode + '_id').val(targetLoadedId); @@ -276,7 +277,9 @@ jQuery(document).ready(function($) { var reference = document.getElementById('reference-association'); var referenceId = reference.getAttribute('data-id'); var languageCode = reference.getAttribute('data-language').replace(/-/, '_'); - var title = $(reference).contents().find('#jform_title').val(); + var target = document.getElementById('target-association'); + var targetTitle = target.getAttribute('data-title'); + var title = $(this).contents().find('#jform_' + targetTitle).val(); var target = $(this).contents(); // - For modal association selectors. diff --git a/media/com_associations/js/sidebyside.js b/media/com_associations/js/sidebyside.js index 8ce06d768b7d9..362e9316ba27f 100644 --- a/media/com_associations/js/sidebyside.js +++ b/media/com_associations/js/sidebyside.js @@ -1 +1 @@ -jQuery(document).ready(function(t){t("#toolbar-target").hide(),t("#toolbar-copy").hide(),Joomla.submitbutton=function(e){if("association.cancel"===e)Joomla.submitform(e);else if("copy"===e){Joomla.loadingLayer("show");var a=document.getElementById("target-association").getAttribute("data-language"),i=window.frames["reference-association"].document.getElementById("jform_language");i.removeAttribute("disabled"),i.value=a,window.frames["reference-association"].Joomla.submitbutton(document.getElementById("adminForm").getAttribute("data-associatedview")+".save2copy")}else if("undo-association"===e){var n=document.getElementById("reference-association"),o=document.getElementById("target-association"),s=(n.getAttribute("data-id"),n.getAttribute("data-language").replace(/-/,"_")),a=(o.getAttribute("data-id"),o.getAttribute("data-language").replace(/-/,"_"));n=t(n).contents(),o=t(o).contents(),n.find("#jform_associations_"+a+"_id").val(""),n.find("#jform_associations_"+a+"_name").val(""),n.find("#jform_associations_"+a+"_chzn").remove(),n.find("#jform_associations_"+a).val("").change().chosen();var d="";t("#jform_itemlanguage option").each(function(){d=t(this).val().split("|")[0],"undefined"!=typeof d&&(d=d.replace(/-/,"_"),o.find("#jform_associations_"+d+"_id").val(""),o.find("#jform_associations_"+d+"_chzn").remove(),o.find("#jform_associations_"+d).val("").change().chosen())}),o.find("#jform_associations_"+s+"_id").val(""),o.find("#jform_associations_"+s+"_name").val(""),o.find("#jform_associations_"+s+"_chzn").remove(),o.find("#jform_associations_"+s).val("").change().chosen();var r=t("#jform_itemlanguage").val(),c=a.replace(/_/,"-");t('#jform_itemlanguage option[value="'+r+'"]').val(c+":0:add"),t("#jform_itemlanguage").val("").change(),t("#jform_itemlanguage").trigger("liszt:updated"),Joomla.submitbutton("reference")}else t("#"+e+"-association").contents().find("#jform_language").attr("disabled",!1),window.frames[e+"-association"].Joomla.submitbutton(document.getElementById("adminForm").getAttribute("data-associatedview")+".apply");return!1},Joomla.loadingLayer("load"),t(document).on("click","#toogle-left-panel",function(){var e=this.getAttribute("data-hide-reference"),a=this.getAttribute("data-show-reference");t(this).text()===e?t(this).text(a):t(this).text(e),t("#left-panel").toggle(),t("#right-panel").toggleClass("full-width")}),t(document).on("change","#jform_itemlanguage",function(){var e=document.getElementById("target-association"),a=t(this).val();""!==a&&"undefined"!=typeof a?(e.setAttribute("data-action",a.split(":")[2]),e.setAttribute("data-id",a.split(":")[1]),e.setAttribute("data-language",a.split(":")[0]),Joomla.loadingLayer("show"),e.src=e.getAttribute("data-editurl")+"&task="+e.getAttribute("data-item")+"."+e.getAttribute("data-action")+"&id="+e.getAttribute("data-id")):(t("#toolbar-target").hide(),t("#toolbar-copy").hide(),t("#select-change").addClass("hidden"),t("#remove-assoc").addClass("hidden"),e.setAttribute("data-action",""),e.setAttribute("data-id","0"),e.setAttribute("data-language",""),e.src="")}),t("#reference-association").on("load",function(){if(document.getElementById("target-association").setAttribute("src",document.getElementById("target-association").getAttribute("src")),t(this).contents().find("#jform_id").val()!==this.getAttribute("data-id")){var e=document.getElementById("target-association");e.src=e.getAttribute("data-editurl")+"&task="+e.getAttribute("data-item")+".edit&id="+t(this).contents().find("#jform_id").val(),this.src=this.getAttribute("data-editurl")+"&task="+this.getAttribute("data-item")+".edit&id="+this.getAttribute("data-id")}var a=t(this).contents();a.find("#jform_language_chzn").remove(),a.find("#jform_language").attr("disabled",!0).chosen(),a.find("#associations").find(".btn").remove();var i="";t("#jform_itemlanguage option").each(function(){i=t(this).val().split(":"),"undefined"!=typeof i[0]&&(langAssociation=i[0].replace(/-/,"_"),""==a.find("#jform_associations_"+langAssociation+"_id").val()&&a.find("#jform_associations_"+langAssociation+"_name").val(document.getElementById("reference-association").getAttribute("data-no-assoc")))}),Joomla.loadingLayer("hide")}),t("#target-association").on("load",function(){if(""!=this.getAttribute("src")){t("#toolbar-target").show(),t("#toolbar-copy").show(),t("#select-change").removeClass("hidden");var e=this.getAttribute("data-language"),a=this.getAttribute("data-id"),i=t(this).contents().find("#jform_id").val()||"0";if(t(this).contents().find('a[href="#associations"]').parent().find(".btn").remove(),t(this).contents().find("#associations").find(".btn").remove(),t(this).contents().find("#associations").hasClass("active")&&(t(this).contents().find('a[href="#associations"]').parent().removeClass("active"),t(this).contents().find("#associations").removeClass("active"),t(this).contents().find(".nav-tabs").find("li").first().addClass("active"),t(this).contents().find(".tab-content").find(".tab-pane").first().addClass("active")),t(this).contents().find("#jform_language_chzn").remove(),t(this).contents().find("#jform_language").val(e).change().attr("disabled",!0).chosen(),"0"==i)document.getElementById("select-change-text").innerHTML=document.getElementById("select-change").getAttribute("data-select");else{document.getElementById("select-change-text").innerHTML=document.getElementById("select-change").getAttribute("data-change"),t("#remove-assoc").removeClass("hidden"),t("#toolbar-copy").hide();var n=document.getElementById("target-id").value,o=""==n?i:n+","+i;document.getElementById("target-id").value=o,i!=a&&(t('#jform_itemlanguage option[value^="'+e+":"+a+':add"]').val(e+":"+i+":edit"),this.setAttribute("data-id",i),this.setAttribute("data-action","edit"));var s=document.getElementById("reference-association"),d=e.replace(/-/,"_"),r=t(this).contents().find("#jform_title").val();t(s).contents().find("#jform_associations_"+d+"_id").val(i),t(s).contents().find("#jform_associations_"+d+"_name").val(r),t(s).contents().find("#jform_associations_"+d+"_chzn").remove(),t(s).contents().find("#jform_associations_"+d).append('"),t(s).contents().find("#jform_associations_"+d).val(i).change().chosen()}var s=document.getElementById("reference-association"),c=s.getAttribute("data-id"),d=s.getAttribute("data-language").replace(/-/,"_"),r=t(s).contents().find("#jform_title").val(),l=t(this).contents();l.find("#jform_associations_"+d+"_id").val(c),l.find("#jform_associations_"+d+"_name").val(r),l.find("#jform_associations_"+d+"_chzn").remove();var m=l.find("#jform_associations_"+d);m.append('"),m.val(c).change().chosen();var f,g;t("#jform_itemlanguage option").each(function(){f=t(this).val().split(":"),"undefined"!=typeof f[1]&&"0"!==f[1]&&(g=f[0].replace(/-/,"_"),l.find("#jform_associations_"+g+"_id").val(f[1]),l.find("#jform_associations_"+g+"_chzn").remove(),m=l.find("#jform_associations_"+g),m.append(''),m.val(f[1]).change().chosen())}),Joomla.loadingLayer("hide")}})}); \ No newline at end of file +jQuery(document).ready(function(t){t("#toolbar-target").hide(),t("#toolbar-copy").hide(),Joomla.submitbutton=function(e){if("association.cancel"===e)Joomla.submitform(e);else if("copy"===e){Joomla.loadingLayer("show");var a=document.getElementById("target-association").getAttribute("data-language"),i=window.frames["reference-association"].document.getElementById("jform_language");i.removeAttribute("disabled"),i.value=a,window.frames["reference-association"].Joomla.submitbutton(document.getElementById("adminForm").getAttribute("data-associatedview")+".save2copy")}else if("undo-association"===e){var n=document.getElementById("reference-association"),o=document.getElementById("target-association"),s=(n.getAttribute("data-id"),n.getAttribute("data-language").replace(/-/,"_"));o.getAttribute("data-id"),a=o.getAttribute("data-language").replace(/-/,"_");n=t(n).contents(),o=t(o).contents(),n.find("#jform_associations_"+a+"_id").val(""),n.find("#jform_associations_"+a+"_name").val(""),n.find("#jform_associations_"+a+"_chzn").remove(),n.find("#jform_associations_"+a).val("").change().chosen();var d="";t("#jform_itemlanguage option").each(function(){void 0!==(d=t(this).val().split("|")[0])&&(d=d.replace(/-/,"_"),o.find("#jform_associations_"+d+"_id").val(""),o.find("#jform_associations_"+d+"_chzn").remove(),o.find("#jform_associations_"+d).val("").change().chosen())}),o.find("#jform_associations_"+s+"_id").val(""),o.find("#jform_associations_"+s+"_name").val(""),o.find("#jform_associations_"+s+"_chzn").remove(),o.find("#jform_associations_"+s).val("").change().chosen();var r=t("#jform_itemlanguage").val(),c=a.replace(/_/,"-");t('#jform_itemlanguage option[value="'+r+'"]').val(c+":0:add"),t("#jform_itemlanguage").val("").change(),t("#jform_itemlanguage").trigger("liszt:updated"),Joomla.submitbutton("reference")}else t("#"+e+"-association").contents().find("#jform_language").attr("disabled",!1),window.frames[e+"-association"].Joomla.submitbutton(document.getElementById("adminForm").getAttribute("data-associatedview")+".apply");return!1},Joomla.loadingLayer("load"),t(document).on("click","#toogle-left-panel",function(){var e=this.getAttribute("data-hide-reference"),a=this.getAttribute("data-show-reference");t(this).text()===e?t(this).text(a):t(this).text(e),t("#left-panel").toggle(),t("#right-panel").toggleClass("full-width")}),t(document).on("change","#jform_itemlanguage",function(){var e=document.getElementById("target-association"),a=t(this).val();""!==a&&void 0!==a?(e.setAttribute("data-action",a.split(":")[2]),e.setAttribute("data-id",a.split(":")[1]),e.setAttribute("data-language",a.split(":")[0]),Joomla.loadingLayer("show"),e.src=e.getAttribute("data-editurl")+"&task="+e.getAttribute("data-item")+"."+e.getAttribute("data-action")+"&id="+e.getAttribute("data-id")):(t("#toolbar-target").hide(),t("#toolbar-copy").hide(),t("#select-change").addClass("hidden"),t("#remove-assoc").addClass("hidden"),e.setAttribute("data-action",""),e.setAttribute("data-id","0"),e.setAttribute("data-language",""),e.src="")}),t("#reference-association").on("load",function(){if(document.getElementById("target-association").setAttribute("src",document.getElementById("target-association").getAttribute("src")),t(this).contents().find("#jform_id").val()!==this.getAttribute("data-id")){var e=document.getElementById("target-association");e.src=e.getAttribute("data-editurl")+"&task="+e.getAttribute("data-item")+".edit&id="+t(this).contents().find("#jform_id").val(),this.src=this.getAttribute("data-editurl")+"&task="+this.getAttribute("data-item")+".edit&id="+this.getAttribute("data-id")}var a=t(this).contents();a.find("#jform_language_chzn").remove(),a.find("#jform_language").attr("disabled",!0).chosen(),a.find("#associations").find(".btn").remove();var i="";t("#jform_itemlanguage option").each(function(){void 0!==(i=t(this).val().split(":"))[0]&&(langAssociation=i[0].replace(/-/,"_"),""==a.find("#jform_associations_"+langAssociation+"_id").val()&&a.find("#jform_associations_"+langAssociation+"_name").val(document.getElementById("reference-association").getAttribute("data-no-assoc")))}),Joomla.loadingLayer("hide")}),t("#target-association").on("load",function(){if(""!=this.getAttribute("src")){t("#toolbar-target").show(),t("#toolbar-copy").show(),t("#select-change").removeClass("hidden");var e=this.getAttribute("data-language"),a=this.getAttribute("data-id"),i=t(this).contents().find("#jform_id").val()||"0";if(t(this).contents().find('a[href="#associations"]').parent().find(".btn").remove(),t(this).contents().find("#associations").find(".btn").remove(),t(this).contents().find("#associations").hasClass("active")&&(t(this).contents().find('a[href="#associations"]').parent().removeClass("active"),t(this).contents().find("#associations").removeClass("active"),t(this).contents().find(".nav-tabs").find("li").first().addClass("active"),t(this).contents().find(".tab-content").find(".tab-pane").first().addClass("active")),t(this).contents().find("#jform_language_chzn").remove(),t(this).contents().find("#jform_language").val(e).change().attr("disabled",!0).chosen(),"0"==i)document.getElementById("select-change-text").innerHTML=document.getElementById("select-change").getAttribute("data-select");else{document.getElementById("select-change-text").innerHTML=document.getElementById("select-change").getAttribute("data-change"),t("#remove-assoc").removeClass("hidden"),t("#toolbar-copy").hide();var n=document.getElementById("target-id").value,o=""==n?i:n+","+i;document.getElementById("target-id").value=o,i!=a&&(t('#jform_itemlanguage option[value^="'+e+":"+a+':add"]').val(e+":"+i+":edit"),this.setAttribute("data-id",i),this.setAttribute("data-action","edit"));var s=document.getElementById("reference-association"),d=e.replace(/-/,"_"),r=s.getAttribute("data-title"),c=t(this).contents().find("#jform_"+r).val();t(s).contents().find("#jform_associations_"+d+"_id").val(i),t(s).contents().find("#jform_associations_"+d+"_name").val(c),t(s).contents().find("#jform_associations_"+d+"_chzn").remove(),t(s).contents().find("#jform_associations_"+d).append('"),t(s).contents().find("#jform_associations_"+d).val(i).change().chosen()}var l,m=(s=document.getElementById("reference-association")).getAttribute("data-id"),g=(d=s.getAttribute("data-language").replace(/-/,"_"),(l=document.getElementById("target-association")).getAttribute("data-title"));c=t(this).contents().find("#jform_"+g).val();(l=t(this).contents()).find("#jform_associations_"+d+"_id").val(m),l.find("#jform_associations_"+d+"_name").val(c),l.find("#jform_associations_"+d+"_chzn").remove();var f,u,_=l.find("#jform_associations_"+d);_.append('"),_.val(m).change().chosen(),t("#jform_itemlanguage option").each(function(){void 0!==(f=t(this).val().split(":"))[1]&&"0"!==f[1]&&(u=f[0].replace(/-/,"_"),l.find("#jform_associations_"+u+"_id").val(f[1]),l.find("#jform_associations_"+u+"_chzn").remove(),(_=l.find("#jform_associations_"+u)).append(''),_.val(f[1]).change().chosen())}),Joomla.loadingLayer("hide")}})}); \ No newline at end of file From dc6c907dc74ae12c5a21549c7913881a71f4c320 Mon Sep 17 00:00:00 2001 From: SharkyKZ Date: Tue, 24 Jul 2018 03:15:30 +0300 Subject: [PATCH 30/92] [com_menus] Remove useglobal (#21095) --- .../components/com_menus/models/forms/item_component.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/administrator/components/com_menus/models/forms/item_component.xml b/administrator/components/com_menus/models/forms/item_component.xml index 5a80382a8f5f6..6b9cbe527ffa1 100644 --- a/administrator/components/com_menus/models/forms/item_component.xml +++ b/administrator/components/com_menus/models/forms/item_component.xml @@ -86,7 +86,6 @@ type="text" label="COM_MENUS_ITEM_FIELD_PAGE_HEADING_LABEL" description="COM_MENUS_ITEM_FIELD_PAGE_HEADING_DESC" - useglobal="true" /> From f79cb144734333806e01ca3329a8c9a67ecce021 Mon Sep 17 00:00:00 2001 From: Julien Vonthron Date: Tue, 24 Jul 2018 02:17:10 +0200 Subject: [PATCH 31/92] [fix] fixed PluginHelper import of xtd-editors plugins (#17907) * [fix] fixed PluginHelper import of xtd-editors plugins * [imp] small adjustment and comment --- libraries/src/Plugin/PluginHelper.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libraries/src/Plugin/PluginHelper.php b/libraries/src/Plugin/PluginHelper.php index 48d4709ef5c83..647727145e64b 100644 --- a/libraries/src/Plugin/PluginHelper.php +++ b/libraries/src/Plugin/PluginHelper.php @@ -259,6 +259,17 @@ protected static function import($plugin, $autocreate = true, \JEventDispatcher { $className = 'Plg' . str_replace('-', '', $plugin->type) . $plugin->name; + if ($plugin->type == 'editors-xtd') + { + // This type doesn't follow the convention + $className = 'PlgEditorsXtd' . $plugin->name; + + if (!class_exists($className)) + { + $className = 'PlgButton' . $plugin->name; + } + } + if (class_exists($className)) { // Load the plugin from the database. From f4efdc765ac530f4d94bd90a60bd1822c12bed66 Mon Sep 17 00:00:00 2001 From: Elijah Madden Date: Tue, 24 Jul 2018 17:39:36 +0900 Subject: [PATCH 32/92] Fix errors exposed by strict (#12544) * Don't need a closure, jQuery ready function is enough. Use strict. * Fix errors exposed by strict. Undeclared variables. wrong regex backreference * Fix some undeclared/wrongly declared variables * Avoid some redundant calls of $(this) * Remove some redundant (also wrong) code. --- administrator/templates/isis/js/template.js | 636 ++++++++++---------- 1 file changed, 323 insertions(+), 313 deletions(-) diff --git a/administrator/templates/isis/js/template.js b/administrator/templates/isis/js/template.js index 8a61f1a126269..d42adc59a8269 100644 --- a/administrator/templates/isis/js/template.js +++ b/administrator/templates/isis/js/template.js @@ -6,404 +6,414 @@ * @since 3.0 */ -(function($) +jQuery(function($) { - $(document).ready(function() - { - var $w = $(window); + 'use strict'; - $('*[rel=tooltip]').tooltip(); + var $w = $(window); - // Turn radios into btn-group - $('.radio.btn-group label').addClass('btn'); + $('*[rel=tooltip]').tooltip(); - $('.btn-group label:not(.active)').click(function() - { - var label = $(this); - var input = $('#' + label.attr('for')); + // Turn radios into btn-group + $('.radio.btn-group label').addClass('btn'); - if (!input.prop('checked')) - { - label.closest('.btn-group').find('label').removeClass('active btn-success btn-danger btn-primary'); + $('fieldset.btn-group').each(function() { + // Handle disabled, prevent clicks on the container, and add disabled style to each button + if ($(this).prop('disabled')) { + $(this).css('pointer-events', 'none').off('click'); + $(this).find('.btn').addClass('disabled'); + } + }); - if (label.closest('.btn-group').hasClass('btn-group-reversed')) - { - if (input.val() == '') - { - label.addClass('active btn-primary'); - } - else if (input.val() == 0) - { - label.addClass('active btn-success'); - } - else - { - label.addClass('active btn-danger'); - } - } - else - { - if (input.val() == '') - { - label.addClass('active btn-primary'); - } - else if (input.val() == 0) - { - label.addClass('active btn-danger'); - } - else - { - label.addClass('active btn-success'); - } + $('.btn-group label:not(.active)').click(function() + { + var label = $(this); + var input = $('#' + label.attr('for')); - } - input.prop('checked', true); - input.trigger('change'); - } - }); - $('.btn-group input[checked=checked]').each(function() + if (!input.prop('checked')) { - var $self = $(this); - var attrId = $self.attr('id'); + label.closest('.btn-group').find('label').removeClass('active btn-success btn-danger btn-primary'); - if ($self.parent().hasClass('btn-group-reversed')) + if (label.closest('.btn-group').hasClass('btn-group-reversed')) { - if ($self.val() == '') + if (input.val() == '') { - $('label[for=' + attrId + ']').addClass('active btn-primary'); + label.addClass('active btn-primary'); } - else if ($self.val() == 0) + else if (input.val() == 0) { - $('label[for=' + attrId + ']').addClass('active btn-success'); + label.addClass('active btn-success'); } else { - $('label[for=' + attrId + ']').addClass('active btn-danger'); + label.addClass('active btn-danger'); } } else { - if ($self.val() == '') + if (input.val() == '') { - $('label[for=' + attrId + ']').addClass('active btn-primary'); + label.addClass('active btn-primary'); } - else if ($self.val() == 0) + else if (input.val() == 0) { - $('label[for=' + attrId + ']').addClass('active btn-danger'); + label.addClass('active btn-danger'); } else { - $('label[for=' + attrId + ']').addClass('active btn-success'); + label.addClass('active btn-success'); } + } - }); - // add color classes to chosen field based on value - $('select[class^="chzn-color"], select[class*=" chzn-color"]').on('liszt:ready', function(){ - var select = $(this); - var cls = this.className.replace(/^.(chzn-color[a-z0-9-_]*)$.*/, '\1'); - var container = select.next('.chzn-container').find('.chzn-single'); - container.addClass(cls).attr('rel', 'value_' + select.val()); - select.on('change click', function() + input.prop('checked', true); + input.trigger('change'); + } + }); + $('.btn-group input[checked=checked]').each(function() + { + var $self = $(this); + var attrId = $self.attr('id'); + + if ($self.parent().hasClass('btn-group-reversed')) + { + if ($self.val() == '') { - container.attr('rel', 'value_' + select.val()); - }); + $('label[for=' + attrId + ']').addClass('active btn-primary'); + } + else if ($self.val() == 0) + { + $('label[for=' + attrId + ']').addClass('active btn-success'); + } + else + { + $('label[for=' + attrId + ']').addClass('active btn-danger'); + } + } + else + { + if ($self.val() == '') + { + $('label[for=' + attrId + ']').addClass('active btn-primary'); + } + else if ($self.val() == 0) + { + $('label[for=' + attrId + ']').addClass('active btn-danger'); + } + else + { + $('label[for=' + attrId + ']').addClass('active btn-success'); + } + } + }); + // add color classes to chosen field based on value + $('select[class^="chzn-color"], select[class*=" chzn-color"]').on('liszt:ready', function(){ + var select = $(this); + var cls = this.className.replace(/^.(chzn-color[a-z0-9-_]*)$.*/, '$1'); + var container = select.next('.chzn-container').find('.chzn-single'); + container.addClass(cls).attr('rel', 'value_' + select.val()); + select.on('change click', function() + { + container.attr('rel', 'value_' + select.val()); }); - /** - * Append submenu items to empty UL on hover allowing a scrollable dropdown - */ - if ($w.width() > 767) - { - var menuScroll = $('#menu > li > ul'), - emptyMenu = $('#nav-empty'); - - $('#menu > li').on('click mouseenter', function() { - - // Set max-height (and width if scroll) for dropdown menu, depending of window height - var $dropdownMenu = $(this).children('ul'), - windowHeight = $w.height(), - linkHeight = $(this).outerHeight(true), - statusHeight = $('#status').outerHeight(true), - menuHeight = $dropdownMenu.height(), - menuOuterHeight = $dropdownMenu.outerHeight(true), - scrollMenuWidth = $dropdownMenu.width() + 15, - maxHeight = windowHeight - (linkHeight + statusHeight + (menuOuterHeight - menuHeight) + 20); - - if (maxHeight < menuHeight) - { - $dropdownMenu.css('width', scrollMenuWidth); - } - else if (maxHeight > menuHeight) - { - $dropdownMenu.css('width', 'auto'); - } + }); - $dropdownMenu.css('max-height', maxHeight); + /** + * Append submenu items to empty UL on hover allowing a scrollable dropdown + */ + if ($w.width() > 767) + { + var menuScroll = $('#menu > li > ul'), + emptyMenu = $('#nav-empty'), + linkWidth, + menuWidth, + offsetLeft; + + $('#menu > li').on('click mouseenter', function() { + + // Set max-height (and width if scroll) for dropdown menu, depending of window height + var $self = $(this), + $dropdownMenu = $self.children('ul'), + windowHeight = $w.height(), + linkHeight = $self.outerHeight(true), + statusHeight = $('#status').outerHeight(true), + menuHeight = $dropdownMenu.height(), + menuOuterHeight = $dropdownMenu.outerHeight(true), + scrollMenuWidth = $dropdownMenu.width() + 15, + maxHeight = windowHeight - (linkHeight + statusHeight + (menuOuterHeight - menuHeight) + 20), + linkPaddingLeft = $self.children('a').css('padding-left'); + + if (maxHeight < menuHeight) + { + $dropdownMenu.css('width', scrollMenuWidth); + } + else if (maxHeight > menuHeight) + { + $dropdownMenu.css('width', 'auto'); + } - // Get the submenu position - linkWidth = $(this).outerWidth(true); - menuWidth = $dropdownMenu.width(); - linkPaddingLeft = $(this).children('a').css('padding-left'); - offsetLeft = Math.round($(this).offset().left) - parseInt(linkPaddingLeft); + $dropdownMenu.css('max-height', maxHeight); - emptyMenu.empty().hide(); + // Get the submenu position + linkWidth = $self.outerWidth(true); + menuWidth = $dropdownMenu.width(); + offsetLeft = Math.round($self.offset().left) - parseInt(linkPaddingLeft); - }); + emptyMenu.empty().hide(); - menuScroll.find('.dropdown-submenu > a').on('mouseover', function() { + }); - var $self = $(this), - dropdown = $self.next('ul'), - submenuWidth = dropdown.outerWidth(), - offsetTop = $self.offset().top, - linkPaddingTop = parseInt(dropdown.css('padding-top')) + parseInt($(this).css('padding-top')), - scroll = $w.scrollTop() + linkPaddingTop; + menuScroll.find('.dropdown-submenu > a').on('mouseover', function() { - // Set the submenu position - if ($('html').attr('dir') == 'rtl') - { - emptyMenu.css({ - top : offsetTop - scroll, - left: offsetLeft - (menuWidth - linkWidth) - submenuWidth - }); - } - else - { - emptyMenu.css({ - top : offsetTop - scroll, - left: offsetLeft + menuWidth - }); - } + var $self = $(this), + dropdown = $self.next('ul'), + submenuWidth = dropdown.outerWidth(), + offsetTop = $self.offset().top, + linkPaddingTop = parseInt(dropdown.css('padding-top')) + parseInt($self.css('padding-top')), + scroll = $w.scrollTop() + linkPaddingTop; - // Append items to empty
    and show it - dropdown.hide(); - emptyMenu.show().html(dropdown.html()); + // Set the submenu position + if ($('html').attr('dir') == 'rtl') + { + emptyMenu.css({ + top : offsetTop - scroll, + left: offsetLeft - (menuWidth - linkWidth) - submenuWidth + }); + } + else + { + emptyMenu.css({ + top : offsetTop - scroll, + left: offsetLeft + menuWidth + }); + } - // Check if the full element is visible. If not, adjust the position - if (emptyMenu.Jvisible() !== true) - { - emptyMenu.css({ - top : ($w.height() - emptyMenu.outerHeight()) - $('#status').height() - }); - } + // Append items to empty
      and show it + dropdown.hide(); + emptyMenu.show().html(dropdown.html()); - }); + // Check if the full element is visible. If not, adjust the position + if (emptyMenu.Jvisible() !== true) + { + emptyMenu.css({ + top : ($w.height() - emptyMenu.outerHeight()) - $('#status').height() + }); + } - menuScroll.find('a.no-dropdown').on('mouseenter', function() { + }); - emptyMenu.empty().hide(); + menuScroll.find('a.no-dropdown').on('mouseenter', function() { - }); + emptyMenu.empty().hide(); - // obtain a reference to the original handler - var _clearMenus = $._data(document, 'events').click.filter(function (el) { - return el.namespace === 'data-api.dropdown' && el.selector === undefined - })[0].handler; - - // disable the old listener - $(document) - .off('click.data-api.dropdown', _clearMenus) - .on('click.data-api.dropdown', function(e) { - e.button === 2 || _clearMenus(); - - if (!$('#menu').find('> li').hasClass('open')) - { - emptyMenu.empty().hide(); - } - }); + }); - $.fn.Jvisible = function(partial,hidden) - { - if (this.length < 1) + // obtain a reference to the original handler + var _clearMenus = $._data(document, 'events').click.filter(function (el) { + return el.namespace === 'data-api.dropdown' && el.selector === undefined + })[0].handler; + + // disable the old listener + $(document) + .off('click.data-api.dropdown', _clearMenus) + .on('click.data-api.dropdown', function(e) { + e.button === 2 || _clearMenus(); + + if (!$('#menu').find('> li').hasClass('open')) { - return; + emptyMenu.empty().hide(); } + }); + + $.fn.Jvisible = function(partial,hidden) + { + if (this.length < 1) + { + return; + } - var $t = this.length > 1 ? this.eq(0) : this, - t = $t.get(0) + var $t = this.length > 1 ? this.eq(0) : this, + t = $t.get(0) - var viewTop = $w.scrollTop(), - viewBottom = (viewTop + $w.height()) - $('#status').height(), - offset = $t.offset(), - _top = offset.top, - _bottom = _top + $t.height(), - compareTop = partial === true ? _bottom : _top, - compareBottom = partial === true ? _top : _bottom; + var viewTop = $w.scrollTop(), + viewBottom = (viewTop + $w.height()) - $('#status').height(), + offset = $t.offset(), + _top = offset.top, + _bottom = _top + $t.height(), + compareTop = partial === true ? _bottom : _top, + compareBottom = partial === true ? _top : _bottom; - return !!t.offsetWidth * t.offsetHeight && ((compareBottom <= viewBottom) && (compareTop >= viewTop)); - }; + return !!t.offsetWidth * t.offsetHeight && ((compareBottom <= viewBottom) && (compareTop >= viewTop)); + }; - } + } - /** - * USED IN: All views with toolbar and sticky bar enabled - */ - var navTop; - var isFixed = false; + /** + * USED IN: All views with toolbar and sticky bar enabled + */ + var navTop; + var isFixed = false; - if (document.getElementById('isisJsData') && document.getElementById('isisJsData').getAttribute('data-tmpl-sticky') == "true") { - processScrollInit(); - processScroll(); + if (document.getElementById('isisJsData') && document.getElementById('isisJsData').getAttribute('data-tmpl-sticky') == "true") { + processScrollInit(); + processScroll(); - $(window).on('resize', processScrollInit); - $(window).on('scroll', processScroll); - } + $(window).on('resize', processScrollInit); + $(window).on('scroll', processScroll); + } - function processScrollInit() { - if ($('.subhead').length) { - navTop = $('.subhead').length && $('.subhead').offset().top - parseInt(document.getElementById('isisJsData').getAttribute('data-tmpl-offset')); + function processScrollInit() { + if ($('.subhead').length) { + navTop = $('.subhead').length && $('.subhead').offset().top - parseInt(document.getElementById('isisJsData').getAttribute('data-tmpl-offset')); - // Fix the container top - $(".container-main").css("top", $('.subhead').height() + $('nav.navbar').height()); + // Fix the container top + $(".container-main").css("top", $('.subhead').height() + $('nav.navbar').height()); - // Only apply the scrollspy when the toolbar is not collapsed - if (document.body.clientWidth > 480) { - $('.subhead-collapse').height($('.subhead').height()); - $('.subhead').scrollspy({offset: {top: $('.subhead').offset().top - $('nav.navbar').height()}}); - } + // Only apply the scrollspy when the toolbar is not collapsed + if (document.body.clientWidth > 480) { + $('.subhead-collapse').height($('.subhead').height()); + $('.subhead').scrollspy({offset: {top: $('.subhead').offset().top - $('nav.navbar').height()}}); } } + } - function processScroll() { - if ($('.subhead').length) { - var scrollTop = $(window).scrollTop(); - if (scrollTop >= navTop && !isFixed) { - isFixed = true; - $('.subhead').addClass('subhead-fixed'); - - // Fix the container top - $(".container-main").css("top", $('.subhead').height() + $('nav.navbar').height()); - } else if (scrollTop <= navTop && isFixed) { - isFixed = false; - $('.subhead').removeClass('subhead-fixed'); - } + function processScroll() { + if ($('.subhead').length) { + var scrollTop = $(window).scrollTop(); + if (scrollTop >= navTop && !isFixed) { + isFixed = true; + $('.subhead').addClass('subhead-fixed'); + + // Fix the container top + $(".container-main").css("top", $('.subhead').height() + $('nav.navbar').height()); + } else if (scrollTop <= navTop && isFixed) { + isFixed = false; + $('.subhead').removeClass('subhead-fixed'); } } + } + + /** + * USED IN: All list views to hide/show the sidebar + */ + window.toggleSidebar = function(force) + { + var context = 'jsidebar'; - /** - * USED IN: All list views to hide/show the sidebar - */ - window.toggleSidebar = function(force) + var $sidebar = $('#j-sidebar-container'), + $main = $('#j-main-container'), + $message = $('#system-message-container'), + $debug = $('#system-debug'), + $toggleSidebarIcon = $('#j-toggle-sidebar-icon'), + $toggleButtonWrapper = $('#j-toggle-button-wrapper'), + $toggleButton = $('#j-toggle-sidebar-button'), + $sidebarToggle = $('#j-toggle-sidebar'); + + var openIcon = 'icon-arrow-left-2', + closedIcon = 'icon-arrow-right-2'; + + var $visible = $sidebarToggle.is(":visible"); + + if (jQuery(document.querySelector("html")).attr('dir') == 'rtl') { - var context = 'jsidebar'; + openIcon = 'icon-arrow-right-2'; + closedIcon = 'icon-arrow-left-2'; + } - var $sidebar = $('#j-sidebar-container'), - $main = $('#j-main-container'), - $message = $('#system-message-container'), - $debug = $('#system-debug'), - $toggleSidebarIcon = $('#j-toggle-sidebar-icon'), - $toggleButtonWrapper = $('#j-toggle-button-wrapper'), - $toggleButton = $('#j-toggle-sidebar-button'), - $sidebarToggle = $('#j-toggle-sidebar'); + var isComponent = $('body').hasClass('component'); - var openIcon = 'icon-arrow-left-2', - closedIcon = 'icon-arrow-right-2'; + $sidebar.removeClass('span2').addClass('j-sidebar-container'); + $message.addClass('j-toggle-main'); + $main.addClass('j-toggle-main'); + if (!isComponent) { + $debug.addClass('j-toggle-main'); + } - var $visible = $sidebarToggle.is(":visible"); + var mainHeight = $main.outerHeight()+30, + sidebarHeight = $sidebar.outerHeight(), + bodyWidth = $('body').outerWidth(), + sidebarWidth = $sidebar.outerWidth(), + contentWidth = $('#content').outerWidth(), + contentWidthRelative = contentWidth / bodyWidth * 100, + mainWidthRelative = (contentWidth - sidebarWidth) / bodyWidth * 100; - if (jQuery(document.querySelector("html")).attr('dir') == 'rtl') + if (force) + { + // Load the value from localStorage + if (typeof(Storage) !== "undefined") { - openIcon = 'icon-arrow-right-2'; - closedIcon = 'icon-arrow-left-2'; + $visible = localStorage.getItem(context); } - var isComponent = $('body').hasClass('component'); - - $sidebar.removeClass('span2').addClass('j-sidebar-container'); - $message.addClass('j-toggle-main'); - $main.addClass('j-toggle-main'); + // Need to convert the value to a boolean + $visible = ($visible == 'true'); + } + else + { + $message.addClass('j-toggle-transition'); + $sidebar.addClass('j-toggle-transition'); + $toggleButtonWrapper.addClass('j-toggle-transition'); + $main.addClass('j-toggle-transition'); if (!isComponent) { - $debug.addClass('j-toggle-main'); + $debug.addClass('j-toggle-transition'); } + } - var mainHeight = $main.outerHeight()+30, - sidebarHeight = $sidebar.outerHeight(), - bodyWidth = $('body').outerWidth(), - sidebarWidth = $sidebar.outerWidth(), - contentWidth = $('#content').outerWidth(), - contentWidthRelative = contentWidth / bodyWidth * 100, - mainWidthRelative = (contentWidth - sidebarWidth) / bodyWidth * 100; - - if (force) - { - // Load the value from localStorage - if (typeof(Storage) !== "undefined") - { - $visible = localStorage.getItem(context); - } + if ($visible) + { + $sidebarToggle.hide(); + $sidebar.removeClass('j-sidebar-visible').addClass('j-sidebar-hidden'); + $toggleButtonWrapper.removeClass('j-toggle-visible').addClass('j-toggle-hidden'); + $toggleSidebarIcon.removeClass('j-toggle-visible').addClass('j-toggle-hidden'); + $message.removeClass('span10').addClass('span12'); + $main.removeClass('span10').addClass('span12 expanded'); + $toggleSidebarIcon.removeClass(openIcon).addClass(closedIcon); + $toggleButton.attr( 'data-original-title', Joomla.JText._('JTOGGLE_SHOW_SIDEBAR') ); + $sidebar.attr('aria-hidden', true); + $sidebar.find('a').attr('tabindex', '-1'); + $sidebar.find(':input').attr('tabindex', '-1'); - // Need to convert the value to a boolean - $visible = ($visible == 'true'); + if (!isComponent) { + $debug.css( 'width', contentWidthRelative + '%' ); } - else + + if (typeof(Storage) !== "undefined") { - $message.addClass('j-toggle-transition'); - $sidebar.addClass('j-toggle-transition'); - $toggleButtonWrapper.addClass('j-toggle-transition'); - $main.addClass('j-toggle-transition'); - if (!isComponent) { - $debug.addClass('j-toggle-transition'); - } + // Set the last selection in localStorage + localStorage.setItem(context, true); } - - if ($visible) + } + else + { + $sidebarToggle.show(); + $sidebar.removeClass('j-sidebar-hidden').addClass('j-sidebar-visible'); + $toggleButtonWrapper.removeClass('j-toggle-hidden').addClass('j-toggle-visible'); + $toggleSidebarIcon.removeClass('j-toggle-hidden').addClass('j-toggle-visible'); + $message.removeClass('span12').addClass('span10'); + $main.removeClass('span12 expanded').addClass('span10'); + $toggleSidebarIcon.removeClass(closedIcon).addClass(openIcon); + $toggleButton.attr( 'data-original-title', Joomla.JText._('JTOGGLE_HIDE_SIDEBAR') ); + $sidebar.removeAttr('aria-hidden'); + $sidebar.find('a').removeAttr('tabindex'); + $sidebar.find(':input').removeAttr('tabindex'); + + if (!isComponent && bodyWidth > 768 && mainHeight < sidebarHeight) { - $sidebarToggle.hide(); - $sidebar.removeClass('j-sidebar-visible').addClass('j-sidebar-hidden'); - $toggleButtonWrapper.removeClass('j-toggle-visible').addClass('j-toggle-hidden'); - $toggleSidebarIcon.removeClass('j-toggle-visible').addClass('j-toggle-hidden'); - $message.removeClass('span10').addClass('span12'); - $main.removeClass('span10').addClass('span12 expanded'); - $toggleSidebarIcon.removeClass(openIcon).addClass(closedIcon); - $toggleButton.attr( 'data-original-title', Joomla.JText._('JTOGGLE_SHOW_SIDEBAR') ); - $toggleButton.attr( 'aria-label', Joomla.JText._('JTOGGLE_SHOW_SIDEBAR') ); - $sidebar.attr('aria-hidden', true); - $sidebar.find('a').attr('tabindex', '-1'); - $sidebar.find(':input').attr('tabindex', '-1'); - - if (!isComponent) { - $debug.css( 'width', contentWidthRelative + '%' ); - } - - if (typeof(Storage) !== "undefined") - { - // Set the last selection in localStorage - localStorage.setItem(context, true); - } + $debug.css( 'width', mainWidthRelative + '%' ); } - else + else if (!isComponent) { - $sidebarToggle.show(); - $sidebar.removeClass('j-sidebar-hidden').addClass('j-sidebar-visible'); - $toggleButtonWrapper.removeClass('j-toggle-hidden').addClass('j-toggle-visible'); - $toggleSidebarIcon.removeClass('j-toggle-hidden').addClass('j-toggle-visible'); - $message.removeClass('span12').addClass('span10'); - $main.removeClass('span12 expanded').addClass('span10'); - $toggleSidebarIcon.removeClass(closedIcon).addClass(openIcon); - $toggleButton.attr( 'data-original-title', Joomla.JText._('JTOGGLE_HIDE_SIDEBAR') ); - $toggleButton.attr( 'aria-label', Joomla.JText._('JTOGGLE_HIDE_SIDEBAR') ); - $sidebar.removeAttr('aria-hidden'); - $sidebar.find('a').removeAttr('tabindex'); - $sidebar.find(':input').removeAttr('tabindex'); - - if (!isComponent && bodyWidth > 768 && mainHeight < sidebarHeight) - { - $debug.css( 'width', mainWidthRelative + '%' ); - } - else if (!isComponent) - { - $debug.css( 'width', contentWidthRelative + '%' ); - } + $debug.css( 'width', contentWidthRelative + '%' ); + } - if (typeof(Storage) !== "undefined") - { - // Set the last selection in localStorage - localStorage.setItem( context, false ); - } + if (typeof(Storage) !== "undefined") + { + // Set the last selection in localStorage + localStorage.setItem( context, false ); } } - }); -})(jQuery); + } +}); From 4a7a58e39f9f63ce2ee712d1fd847fb74c16137e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Smoli=C5=84ski?= Date: Tue, 24 Jul 2018 15:29:04 +0200 Subject: [PATCH 33/92] [3.8] Make the text clearer (#20940) * make the text clealer Make the PLG_TWOFACTORAUTH_TOTP_STEP3_TEXT text clealer. * thans @brianteeman --- administrator/language/en-GB/en-GB.plg_twofactorauth_totp.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/language/en-GB/en-GB.plg_twofactorauth_totp.ini b/administrator/language/en-GB/en-GB.plg_twofactorauth_totp.ini index a71cac38671b2..a8447d46abb96 100644 --- a/administrator/language/en-GB/en-GB.plg_twofactorauth_totp.ini +++ b/administrator/language/en-GB/en-GB.plg_twofactorauth_totp.ini @@ -32,5 +32,5 @@ PLG_TWOFACTORAUTH_TOTP_STEP2_RESET="If you want to change the key, disable the t PLG_TWOFACTORAUTH_TOTP_STEP2_TEXT="You will need to enter the following information to Google Authenticator or a compatible app." PLG_TWOFACTORAUTH_TOTP_STEP3_HEAD="Step 3 - Activate Two Factor Authentication" PLG_TWOFACTORAUTH_TOTP_STEP3_SECURITYCODE="Security Code" -PLG_TWOFACTORAUTH_TOTP_STEP3_TEXT="To verify that everything is set up properly, please enter the security code displayed in Google Authenticator in the field below and select the button. If the code is correct, the Two Factor Authentication feature will be enabled." +PLG_TWOFACTORAUTH_TOTP_STEP3_TEXT="To verify that everything is set up properly, please enter the security code displayed in Google Authenticator in the field below. Afterwards, please save your user profile. If the code is correct, the Two Factor Authentication feature will be enabled." PLG_TWOFACTORAUTH_TOTP_XML_DESCRIPTION="Allows users on your site to use two factor authentication using Google Authenticator or other compatible time-based One Time Password generators such as FreeOTP. To use two factor authentication please edit the user profile and enable two factor authentication." From d9a278dc0dc6c85fa4f1698a1eb44024780293d2 Mon Sep 17 00:00:00 2001 From: Thomas Hunziker Date: Wed, 25 Jul 2018 11:10:02 +0200 Subject: [PATCH 34/92] Adding lithuan language files. --- installation/language/lt-LT/lt-LT.ini | 340 ++++++++++++++++++ installation/language/lt-LT/lt-LT.xml | 21 ++ media/system/js/fields/calendar-locales/lt.js | 19 + 3 files changed, 380 insertions(+) create mode 100644 installation/language/lt-LT/lt-LT.ini create mode 100644 installation/language/lt-LT/lt-LT.xml create mode 100644 media/system/js/fields/calendar-locales/lt.js diff --git a/installation/language/lt-LT/lt-LT.ini b/installation/language/lt-LT/lt-LT.ini new file mode 100644 index 0000000000000..f5a0f51eab420 --- /dev/null +++ b/installation/language/lt-LT/lt-LT.ini @@ -0,0 +1,340 @@ +; Joomla! Project +; Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. +; License GNU General Public License version 2 or later; see LICENSE.txt +; Note : All ini files need to be saved as UTF-8 + +;Stepbar +INSTL_STEP_COMPLETE_LABEL="Pabaiga" +INSTL_STEP_DATABASE_LABEL="Duomenų bazė" +INSTL_STEP_DEFAULTLANGUAGE_LABEL="Pasirinkite numatytąją kalbą" +INSTL_STEP_FTP_LABEL="FTP" +INSTL_STEP_LANGUAGES_LABEL="Kalbų diegimas" +INSTL_STEP_SITE_LABEL="Nustatymai" +INSTL_STEP_SUMMARY_LABEL="Apžvalga" + +;Language view +INSTL_SELECT_LANGUAGE_TITLE="Pasirinkite kalbą" +INSTL_WARNJAVASCRIPT="Įspėjimas! JavaScript turi būti įgalintas, kad Joomla! būtų tinkamai įdiegta" +INSTL_WARNJSON="Jūsų PHP diegimui turi būti įgalintas JSON, kad Joomla! būtų tinkamai įdiegta" + +;Preinstall view +INSTL_PRECHECK_TITLE="Diegimo patikrinimas" +INSTL_PRECHECK_DESC="Jei bet kuris iš šių elementų yra nepalaikomas (pažymėtas kaip Ne), prašome imtis veiksmų juos pataisyti.
      Negalite įdiegti Joomla! kol jūsų konfigūracija neatitinka žemiau nurodytų reikalavimų." +INSTL_PRECHECK_RECOMMENDED_SETTINGS_TITLE="Rekomenduojami nustatymai:" +INSTL_PRECHECK_RECOMMENDED_SETTINGS_DESC="Šie parametrai yra rekomenduojami PHP, siekiant užtikrinti visišką suderinamumą su Joomla.
      Tačiau Joomla! vis tiek gali veikti, net jei parametrai nesutaps su rekomenduojamais nustatymais." +INSTL_PRECHECK_DIRECTIVE="Direktyva" +INSTL_PRECHECK_RECOMMENDED="Rekomenduojama" +INSTL_PRECHECK_ACTUAL="Esami nustatymai" + +; Database view +INSTL_DATABASE="Duomenų bazės konfigūracija" +INSTL_DATABASE_ERROR_POSTGRESQL_QUERY="PostgreSQL duomenų bazės užklausa nepavyko." +INSTL_DATABASE_HOST_DESC="Tai dažniausiai "_QQ_"localhost"_QQ_"." +INSTL_DATABASE_HOST_LABEL="Serverio pavadinimas" +INSTL_DATABASE_HOST_IS_NOT_LOCALHOST_CREATE_FILE="Mums nepavyko sukurti failo. Prašome rankiniu būdu sukurti rinkmeną, pavadintą "_QQ_"%1$s"_QQ_" ir įkelti ją į "_QQ_"%2$s"_QQ_" katalogą jūsų Joomla svetainėje." +INSTL_DATABASE_HOST_IS_NOT_LOCALHOST_DELETE_FILE="Norėdami patvirtinti, kad esate svetainės savininkas, prašome ištrinti failą, kurio pavadinimas yra "_QQ_"%1$s"_QQ_" ir kurį mes sukūrėme "_QQ_"%2$s"_QQ_" kataloge Jūsų Joomla svetainėje." +INSTL_DATABASE_HOST_IS_NOT_LOCALHOST_GENERAL_MESSAGE="Bandote naudoti duomenų bazę, kuri nėra Jūsų serveryje. Saugumo sumetimais Jums reikia patikrinti Jūsų web hosting'o sąskaitą nuosavybę. Daugiau informacijos rasite dokumentacijoje." +INSTL_DATABASE_NAME_DESC="Kai kurie serveriai leidžia tik tam tikrą DB pavadinimą vienai svetainei. Naudokite lentelės priešdėlį skirtingiems Joomla! puslapiams." +INSTL_DATABASE_NAME_LABEL="Duomenų bazės pavadinimas" +INSTL_DATABASE_NO_SCHEMA="Šiam duomenų bazės tipui neegzistuoja duomenų bazės schema." +INSTL_DATABASE_OLD_PROCESS_DESC=""_QQ_"Archyvuoti"_QQ_" arba "_QQ_"Pašalinti"_QQ_" visas senas egzistuojančios ankstesniu Joomla diegimų lenteles su vienodo "_QQ_"Lentelių Prefiksu"_QQ_"." +INSTL_DATABASE_OLD_PROCESS_LABEL="Veiksmai su sena duomenų baze" +INSTL_DATABASE_PASSWORD_DESC="Svetainės saugumui duomenų bazės slaptažodžio naudojimas yra privalomas." +INSTL_DATABASE_PASSWORD_LABEL="Slaptažodis" +INSTL_DATABASE_PREFIX_DESC="Pasirinkite lentelių priešdėlį arba naudokite automatiškai sugeneruotą. Idealiai, trijų arba keturių ženklų ilgio, sudarytą tik iš tekstinių ženklų ir PRIVALO baigtis pabraukimo brūkšniu.Įsitikinkite, kad pasirinkto priešdėlio nenaudoja kitos lentelės." +INSTL_DATABASE_PREFIX_LABEL="Lentelės priešdėlis" +INSTL_DATABASE_PREFIX_MSG="Lentelės priešdėlis turi prasidėti raide, toliau raidiniai-skaitiniai simboliai ir pabraukimo simbolis" +INSTL_DATABASE_TYPE_DESC="Tai tikriausiai "_QQ_"MySQLi"_QQ_"." +INSTL_DATABASE_TYPE_LABEL="Duomenų bazės tipas" +INSTL_DATABASE_USER_DESC="Arba Jūsų sukurtas vartotojas arba talpinimo paslaugų teikėjo suteiktas prisijungimo vardas." +INSTL_DATABASE_USER_LABEL="Prisijungimo vardas" + + +;FTP view +INSTL_AUTOFIND_FTP_PATH="Automatiškai rasti kelią iki FTP" +INSTL_FTP="FTP nustatymai" +INSTL_FTP_DESC="

      Kai kuriuose serveriuose Jums gali tekti nurodyti FTP duomenis diegimo užbaigimui. Jei kyla sunkumų užbaigti diegimą be šių duomenų, susisiekite su savo hostingo tiekėju, kad sužinoti ar tie duomenys yra būtini.

      Saugumo sumetimais, geriausia sukurti atskirą FTP nario sąskaitą tik su prieiga prie Joomla! įdiegimo katalogo, bet ne prie viso serverio. Jūsų serverio administratoriai gali padėti šiuo klausimu.

      Pastaba: Jei diegiate Windows operacinėje sistemoje, FTP sluoksnis nėra reikalingas.

      " +INSTL_FTP_ENABLE_LABEL="Įgalinti FTP sluoksnį" +INSTL_FTP_HOST_LABEL="FTP serveris" +INSTL_FTP_PASSWORD_LABEL="FTP slaptažodis" +INSTL_FTP_PORT_LABEL="FTP prievadas" +INSTL_FTP_ROOT_LABEL="FTP šakninis kelias" +INSTL_FTP_SAVE_LABEL="Išsaugoti FTP slaptažodį" +INSTL_FTP_TITLE="FTP nustatymai (Neprivalomi - Dauguma gali praleisti šį žingsnį - Spauskite toliau, kad tęsti įdiegimą)" +INSTL_FTP_USER_LABEL="FTP vartotojo vardas" +INSTL_VERIFY_FTP_SETTINGS="Patikrinti FTP nustatymus" +INSTL_FTP_SETTINGS_CORRECT="Nustatymai teisingi" +INSTL_FTP_USER_DESC="Įspėjimas! Rekomenduojama palikti šį laukelį tuščią ir įvesti FTP prisijungimo vardą kiekvieną kartą perkeliant failus." +INSTL_FTP_PASSWORD_DESC="Įspėjimas! Rekomenduojama palikti šį laukelį tuščią ir įvesti FTP slaptažodį kiekvieną kartą perkeliant failus." + +;Site View +INSTL_SITE="Pagrindinės nuostatos" +INSTL_ADMIN_EMAIL_LABEL="El. paštas" +INSTL_ADMIN_EMAIL_DESC="Įveskite el. pašto adresą. Tai bus svetainės Super Administratoriaus el. pašto adresas." +INSTL_ADMIN_PASSWORD_LABEL="Slaptažodis" +INSTL_ADMIN_PASSWORD_DESC="Įveskite jūsų Super Administratoriaus paskyros slaptažodį ir patvirtinkite jį laukelyje žemiau." +INSTL_ADMIN_PASSWORD2_LABEL="Patvirtinti slaptažodį" +INSTL_ADMIN_USER_LABEL="Vartotojo vardas" +INSTL_ADMIN_USER_DESC="Įveskite jūsų Super Administratoriaus paskyros prisijungimo vardą." +INSTL_SITE_NAME_LABEL="Puslapio pavadinimas" +INSTL_SITE_NAME_DESC="Įveskite savo Joomla! puslapio pavadinimą." +INSTL_SITE_METADESC_LABEL="Aprašymas" +INSTL_SITE_METADESC_TITLE_LABEL="Įveskite bendrą interneto svetainės aprašymą, kuris bus naudojamas paieškos varikliams. Paprastai optimalus variantas yra daugiausiai 20 žodžių." +INSTL_SITE_OFFLINE_LABEL="Tinklapis išjungtas" +INSTL_SITE_OFFLINE_TITLE_LABEL="Pasibaigus instaliacijai pervesti svetainės viešą vartotojo sąsają į autonominį režimą. Šį režimą vėliau galėsite išjungti globalioje svetainės konfigūracijoje." +INSTL_SITE_INSTALL_SAMPLE_LABEL="Įdiegti pavyzdinius duomenis" +INSTL_SITE_INSTALL_SAMPLE_DESC="Įdiegti duomenų pavyzdžius primygtinai rekomenduojama pradedantiesiems.
      Tai įdiegs pavyzdinį turinį, kuris yra įtrauktas į Joomla! diegimo paketą." +INSTL_SITE_INSTALL_SAMPLE_NONE="Nė vienas (Reikalingas bazinei daugiakalbei svetainei sukurti)" +INSTL_SAMPLE_BLOG_SET="Anglų kalbos (GB) dienoraščio pavyzdiniai duomenys" +INSTL_SAMPLE_BROCHURE_SET="Anglų kalbos (GB) brošiūros pavyzdiniai duomenys" +INSTL_SAMPLE_DATA_SET="Numatytieji anglų kalbos (GB) pavyzdiniai duomenys" +INSTL_SAMPLE_LEARN_SET="Anglų kalbos (GB) mokomieji pavyzdiniai duomenys" +INSTL_SAMPLE_TESTING_SET="Anglų kalbos (GB) testiniai pavyzdiniai duomenys" +INSTL_SITE_INSTALL_SAMPLE_NONE_DESC="Įdiegti Joomla tik su vienu meniu ir prisijungimo forma, be jokio turinio." +INSTL_SAMPLE_BLOG_SET_DESC="Įdiegti Joomla su keliais straipsniais ir su tinklaraščiu susijusiais moduliais kaip senesni įrašai, tinklaraščių sąrašas, daugiausiai skaitomi įrašai." +INSTL_SAMPLE_BROCHURE_SET_DESC="Įdiegti Joomla su keliais puslapiais (meniu su pradžios, apie mus, naujienų, kontaktų puslapiais) ir moduliais tokiais, kaip paieška, pasirinktinis, prisijungimo forma." +INSTL_SAMPLE_DATA_SET_DESC="Įdiegti Joomla su vienu puslapiu (meniu su viena nuoroda) ir moduliais tokiais, kaip naujausi straipsniai, prisijungimo forma." +INSTL_SAMPLE_LEARN_SET_DESC="Įdiegti Joomla su pavyzdiniais straipsniais, kuriuose aprašome kaip veikia Joomla." +INSTL_SAMPLE_TESTING_SET_DESC="Įdiegti Joomla su visais įmanomais meniu elementais, kas jums lengviau padės testuoti Joomla." +INSTL_SUPER_USER_TITLE="Super Vartotojo Sąskaitos Duomenys" + +;Summary view +INSTL_FINALISATION="Užbaigimas" +INSTL_SUMMARY_INSTALL="Įdiegti" +INSTL_SUMMARY_EMAIL_LABEL="Siųsti nustatymus el.paštu" +INSTL_SUMMARY_EMAIL_DESC="Aukščiau pasirinkite ar po įdiegimo siųsti el.paštu %s sąrankos parametrus." +INSTL_SUMMARY_EMAIL_PASSWORDS_LABEL="Įtraukti slaptažodžius į laišką" +INSTL_SUMMARY_EMAIL_PASSWORDS_DESC="Įspėjimas! Rekomenduojama nesiųsti ir nesaugoti savo slaptažodžių laiškuose." + +;Installing view +INSTL_INSTALLING="Diegiama..." +INSTL_INSTALLING_DATABASE_BACKUP="Kuriama senos duomenų bazės lentelių atsarginė kopija" +INSTL_INSTALLING_DATABASE_REMOVE="Pašalinamos senos duomenų bazės lentelės" +INSTL_INSTALLING_DATABASE="Kuriamos duomenų bazės lentelės" +INSTL_INSTALLING_SAMPLE="Įdiegiami pavyzdiniai duomenys" +INSTL_INSTALLING_CONFIG="Kuriamas konfigūracijos failas" +INSTL_INSTALLING_EMAIL="Siunčiamas laiškas %s" + +;Email +INSTL_EMAIL_SUBJECT="Konfigūracijos informacija: %s" +INSTL_EMAIL_HEADING="Toliau galite rasti sąrankos parametrus naujai įdiegtai Joomla! svetainei:" +INSTL_EMAIL_NOT_SENT="Laiško nepavyko išsiųsti." + +;Complete view +INSTL_COMPLETE_ADMINISTRATION_LOGIN_DETAILS="Prisijungimo prie administracijos duomenys" +INSTL_COMPLETE_ERROR_FOLDER_ALREADY_REMOVED=""_QQ_"%s"_QQ_" katalogas jau buvo panaikintas." +INSTL_COMPLETE_ERROR_FOLDER_DELETE="\ "_QQ_"%s\" katalogo nepavyko ištrinti. Prašome rankiniu būdu panaikinkiti katalogą." +INSTL_COMPLETE_FOLDER_REMOVED="\ "_QQ_"%s\" katalogas pašalintas." +INSTL_COMPLETE_LANGUAGE_1="Joomla! jūsų kalba ir/arba automatinis paprastos daugiakalbės svetainės kūrimas" +INSTL_COMPLETE_LANGUAGE_DESC="Prieš ištrindami installation aplanką, galite įdiegti papildomas kalbas. Jei norite pridėti papildomas kalbas jūsų Joomla! svetainėje, paspauskite mygtuką." +INSTL_COMPLETE_LANGUAGE_DESC2="Pastaba: jums reikės interneto prieigos, kad Joomla! galėtų atsiųsti ir įdiegti naujas kalbas.
      Kai kurios serverio konfigūracijos neleis Joomla! įdiegti kalbas. Tokiu atveju, nesijaudinkite, galėsite įdiegti jas per Joomla! administracija." +INSTL_COMPLETE_REMOVE_FOLDER="Pašalinti "_QQ_"%s"_QQ_" aplanką" +INSTL_COMPLETE_REMOVE_INSTALLATION="PRAŠOME NEUŽMIRŠTI VISIŠKAI PAŠALINTI INSTALLATION APLANKO.
      Negalėsite tęsti, kol neištrinsite įdiegimo aplanko. Tai yra Joomla! saugumo priemonė." +INSTL_COMPLETE_TITLE="Sveikiname! Joomla! dabar įdiegta." +INSTL_COMPLETE_INSTALL_LANGUAGES="Papildomi žingsniai: kalbų diegimas" + +;Languages view +INSTL_LANGUAGES="Įdiegti kalbos paketus" +INSTL_LANGUAGES_COLUMN_HEADER_LANGUAGE="Kalba" +INSTL_LANGUAGES_COLUMN_HEADER_LANGUAGE_TAG="Kalbos žyma" +INSTL_LANGUAGES_COLUMN_HEADER_VERSION="Versija" +INSTL_LANGUAGES_DESC="Joomla sąsaja gali būti atvaizduojama keliomis kalbomis. Iš pradžių pasirinkite Jūsų pageidaujamas kalbas jas pažymėdami. Vėliau instaliuokite pažymėtas kalbas spausdami "_QQ_"Sekantis"_QQ_" mygtuką.
      Dėmesio: ši operacija gali užtrukti apie 10 sekundžių pakraunant ir diegiant kiekvieną kalbą. Jei norite išvengti diegimo trikių pasirinkite vienu metu diegti ne daugiau kaip 3 kalbas." +INSTL_LANGUAGES_MESSAGE_PLEASE_WAIT="Šis procesas užtruks iki 10 sekundžių kiekvienai kalbai
      Prašome palaukti kol mes atsiųsime ir įdiegsime kalbas ..." +INSTL_LANGUAGES_MORE_LANGUAGES="Paspauskite 'Ankstesnis' mygtuką jei norite įdiegti daugiau kalbų." +INSTL_LANGUAGES_NO_LANGUAGE_SELECTED="Nebuvo pasirinkta kalbų įdiegimui. Jei jums reikia įdiegti daugiau kalbų, paspauskite 'Ankstesnis' mygtuką ir pasirinkite norimas kalbas iš sąrašo." +INSTL_LANGUAGES_WARNING_NO_INTERNET="Joomla'ai nepavyko prisijungti prie kalbų serverio. Užbaikite diegimo procesą." +INSTL_LANGUAGES_WARNING_NO_INTERNET2="Pastaba: Jūs galėsite instaliuoti kalbas vėliau naudojant Joomla! administraciją" +INSTL_LANGUAGES_WARNING_BACK_BUTTON="Grįžti į paskutinį diegimo žingsnį" + +;Default language view +INSTL_DEFAULTLANGUAGE_ACTIVATE_MULTILANGUAGE="Aktyvuoti daugiakalbystės funkciją" +INSTL_DEFAULTLANGUAGE_ACTIVATE_MULTILANGUAGE_DESC="Aktyvavus, jūsų Joomla svetainėje bus aktyvuota daugiakalbystės funkcija su lokalizuotomis meniu kiekvienai įdiegtai kalbai." +INSTL_DEFAULTLANGUAGE_ACTIVATE_LANGUAGE_CODE_PLUGIN="Įjungti kalbos kodo įskiepį" +INSTL_DEFAULTLANGUAGE_ACTIVATE_LANGUAGE_CODE_PLUGIN_DESC="Įjungus, kalbos kodo įskiepis pridės galimybę keisti kalbos kodą sugeneruotame HTML dokumente taip gerindamas SEO." +INSTL_DEFAULTLANGUAGE_ADMINISTRATOR="Numatytoji administratoriaus kalba" +INSTL_DEFAULTLANGUAGE_ADMIN_COULDNT_SET_DEFAULT="Joomla nepavyko nustatyti kalbos kaip numatytosios. Anglų kalba administracijoje bus naudojama kaip numatytoji." +INSTL_DEFAULTLANGUAGE_ADMIN_SET_DEFAULT="Joomla nustatė %s kaip numatytąją administratoriaus kalbą." +INSTL_DEFAULTLANGUAGE_COLUMN_HEADER_SELECT="Pasirinkti" +INSTL_DEFAULTLANGUAGE_COLUMN_HEADER_LANGUAGE="Kalba" +INSTL_DEFAULTLANGUAGE_COLUMN_HEADER_TAG="Žyma" +INSTL_DEFAULTLANGUAGE_COULD_NOT_ADD_ASSOCIATIONS="Joomla nesugebėjo automatiškai sukurti kalbinių asociacijų." +INSTL_DEFAULTLANGUAGE_COULD_NOT_CREATE_CONTENT_LANGUAGE="Joomla nepavyko automatiškai sukurti %s turinio kalbos" +INSTL_DEFAULTLANGUAGE_COULD_NOT_CREATE_MENU="Joomla nepavyko automatiškai sukurti %s meniu" +INSTL_DEFAULTLANGUAGE_COULD_NOT_CREATE_MENU_ITEM="Joomla nepavyko automatiškai sukurti %s pradžios meniu elemento." +INSTL_DEFAULTLANGUAGE_COULD_NOT_CREATE_MENU_MODULE="Joomla nepavyko automatiškai sukurti %s meniu modulio." +INSTL_DEFAULTLANGUAGE_COULD_NOT_CREATE_CATEGORY="Joomla nepavyko automatiškai sukurti %s turinio kategorijos." +INSTL_DEFAULTLANGUAGE_COULD_NOT_CREATE_ARTICLE="Joomla nepavyko automatiškai sukurti %s lokalizuoto straipsnio." +INSTL_DEFAULTLANGUAGE_COULD_NOT_ENABLE_MODULESWHITCHER_LANGUAGECODE="Joomla nepavyko automatiškai paskelbti kalbos perjungiklio modulio." +INSTL_DEFAULTLANGUAGE_COULD_NOT_ENABLE_PLG_LANGUAGECODE="Joomla nepavyko automatiškai įgalinti kalbos kodo įskiepio." +INSTL_DEFAULTLANGUAGE_COULD_NOT_ENABLE_PLG_LANGUAGEFILTER="Joomla nepavyko automatiškai įgalinti kalbos filtro įskiepio." +INSTL_DEFAULTLANGUAGE_COULD_NOT_INSTALL_LANGUAGE="Joomla'i nepavyko įdiegti %s kalbos." +INSTL_DEFAULTLANGUAGE_COULD_NOT_PUBLISH_MOD_MULTILANGSTATUS="Joomla nepavyko automatiškai paskelbti kalbos būsenos modulio." +INSTL_DEFAULTLANGUAGE_COULD_NOT_UNPUBLISH_MOD_DEFAULTMENU="Joomla nepavyko automatiškai nebeskelbi numatytojo meniu modulio." +INSTL_DEFAULTLANGUAGE_DESC="Joomla įdiegė nurodytas kalbas. Prašome pasirinkti norimą numatytąją kalbą Joomla administracijai." +INSTL_DEFAULTLANGUAGE_DESC_FRONTEND="Joomla įdiegė nurodytas kalbas. Prašome pasirinkti numatytąją kalbą Joomla svetainei." +INSTL_DEFAULTLANGUAGE_FRONTEND="Numatyta svetainės kalba" +INSTL_DEFAULTLANGUAGE_FRONTEND_COULDNT_SET_DEFAULT="Joomla nepavyko nustatyti kalbos kaip numatytosios. Anglų kalba svetainėje bus naudojama kaip numatytoji." +INSTL_DEFAULTLANGUAGE_FRONTEND_SET_DEFAULT="Joomla nustatė %s kaip numatytąją SVETAINĖS kalbą." +INSTL_DEFAULTLANGUAGE_INSTALL_LOCALISED_CONTENT="Įdiegti lokalizuotą turinį" +INSTL_DEFAULTLANGUAGE_INSTALL_LOCALISED_CONTENT_DESC="Aktyvavus, Joomla automatiškai sukurs po vieną turinio kategoriją kiekvienai įdiegtai kalbai. Taip pat bus sukurta po vieną siūlomą straipsnį su fiktyviu turiniu kiekvienai kategorijai." +INSTL_DEFAULTLANGUAGE_MULTILANGUAGE_TITLE="Daugiakalbė" +INSTL_DEFAULTLANGUAGE_MULTILANGUAGE_DESC="Ši sekcija leidžia jums automatiškai aktyvuoti Joomla! daugiakalbystės funkciją." +INSTL_DEFAULTLANGUAGE_TRY_LATER="Jūs tai galėsite instaliuoti vėliau naudodamį Joomla! Administratorių" + +; IMPORTANT NOTE FOR TRANSLATORS: Do not literally translate this line, instead add the localised name of the language. For example Spanish will be Español +INSTL_DEFAULTLANGUAGE_NATIVE_LANGUAGE_NAME="Lietuvių" + +;Database Model +INSTL_DATABASE_COULD_NOT_CONNECT="Nepavyko prisijungti prie duomenų bazės. Jungtis grąžino šį skaičių: %s" +INSTL_DATABASE_COULD_NOT_CREATE_DATABASE="Diegimo procesui nepavyko prisijungti prie nurodytos duomenų bazės ir nepavyko sukurti duomenų bazės. Prašome patikrinti savo nustatymus ir, jei būtina, rankiniu būdu sukurti duomenų bazę." +INSTL_DATABASE_COULD_NOT_REFRESH_MANIFEST_CACHE="Nepavyko atnaujinti talpyklos plėtiniui %s" +INSTL_DATABASE_ERROR_BACKINGUP="Darant duomenų bazės atsarginę kopiją, įvyko kai kurios klaidos." +INSTL_DATABASE_ERROR_CREATE="Įvyko klaida bandant sukurti duomenų bazę %s.
      Vartotojas ko gero neturi pakankamai teisių sukurti duomenų bazę. Reikalingą duomenų bazę gali tekti sukurti atskirai prieš instaliuojant Joomla!" +INSTL_DATABASE_ERROR_DELETE="Šalinant duomenų bazę, įvyko kai kurios klaidos." +INSTL_DATABASE_FIELD_VALUE_REMOVE="Pašalinti" +INSTL_DATABASE_FIELD_VALUE_BACKUP="Padaryti atsarginę kopiją" +INSTL_DATABASE_FIX_LOWERCASE="Naudojant PostgreSQL, lentelių priešdėlis turi būti sudarytas iš mažųjų raidžių." +INSTL_DATABASE_FIX_TOO_LONG="MySQL lentelės priešdėlis negali būti ilgesnis nei 15 simbolių." +INSTL_DATABASE_INVALID_DB_DETAILS="Duomenų bazės informacija yra klaidinga ir/arba tuščia." +INSTL_DATABASE_INVALID_MYSQL_VERSION="Norint tęsti įdiegimą, Jums reikia MySQL 5.0.4 ar naujesnės versijos. Jūsų versija yra %s" +INSTL_DATABASE_INVALID_MYSQLI_VERSION="Norint tęsti įdiegimą, Jums reikia MySQL 5.0.4 ar naujesnės versijos. Jūsų versija yra %s" +INSTL_DATABASE_INVALID_PDOMYSQL_VERSION="Norint tęsti įdiegimą, Jums reikia MySQL 5.0.4 ar naujesnės versijos. Jūsų versija yra %s" +INSTL_DATABASE_INVALID_POSTGRESQL_VERSION="Norint tęsti įdiegimą, Jums reikia PostgreSQL 8.3.18 ar naujesnės versijos. Jūsų versija yra %s" +INSTL_DATABASE_INVALID_SQLSRV_VERSION="Norint tęsti įdiegimą, Jums reikalingas SQL Server 2008 R2 (10.50.1600.1) ar naujesnė versija. Jūsų versija yra %s" +INSTL_DATABASE_INVALID_SQLZURE_VERSION="Norint tęsti įdiegimą, Jums reikalingas SQL Server 2008 R2 (10.50.1600.1) ar naujesnė versija. Jūsų versija yra %s" +INSTL_DATABASE_INVALID_TYPE="Prašome pasirinkti duomenų bazės tipą" +INSTL_DATABASE_NAME_TOO_LONG="MySQL duomenų bazės pavadinimas negali būti ilgesnis nei 64 simboliai." +INSTL_DATABASE_INVALID_NAME="MySQL versijos, senesnės nei 5.1.6, negali turėti periodų ar kitų "_QQ_"specialių"_QQ_" simbolių pavadinime. Jūsų versija yra %s" +INSTL_DATABASE_NAME_INVALID_SPACES="MySQL duomenų bazės ir lentelės pavadinimai negali prasidėti arba baigtis tarpais." +INSTL_DATABASE_NAME_INVALID_CHAR="MySQL identifikatorius negali būti NULL ASCII(0x00)." +INSTL_DATABASE_FILE_DOES_NOT_EXIST="Failas %s neegzistuoja" + +;controllers +INSTL_COOKIES_NOT_ENABLED="Slapukai atrodo nėra aktyvuoti Jūsų naršyklėje. Kai jie yra išjungti, Jūs negalėsite įdiegti programos. Taip pat tai gali būti problema su serverio session.save_path verte. Jei tai pastarasis atvejis ir negalite patys išspręsti šios problemos, susisiekite su savo paslaugų teikėju." +INSTL_HEADER_ERROR="Klaida" + +;Helpers +INSTL_PAGE_TITLE="Joomla! WEB diegiklis" + +;Configuration model +INSTL_ERROR_CONNECT_DB="Nepavyko prisijungti prie duomenų bazės. Jungtis grąžino šį skaičių: %s" +INSTL_STD_OFFLINE_MSG="Svetainė neveikia dėl priežiūros darbų.
      Prašome pamėginti vėliau." + +;FTP model +INSTL_FTP_INVALIDROOT="Nurodytas FTP aplankas nėra šio Joomla! įdiegimo aplankas" +INSTL_FTP_NOCONNECT="Nepavyko susisiekti su FTP serveriu" +INSTL_FTP_NODELE="Funkcija "_QQ_"DELE"_QQ_" nepavyko." +INSTL_FTP_NODIRECTORYLISTING="Nepavyko nuskaityti bylų sąrašo FTP serverio kataloge." +INSTL_FTP_NOLIST="Funkcija "_QQ_"LIST"_QQ_" nepavyko." +INSTL_FTP_NOLOGIN="Nepavyko prisijungti prie FTP serverio" +INSTL_FTP_NOMKD="Funkcija "_QQ_"MKD"_QQ_" nepavyko." +INSTL_FTP_NONLST="Funkcija "_QQ_"NLST"_QQ_" nepavyko." +INSTL_FTP_NOPWD="Funkcija "_QQ_"PWD"_QQ_" nepavyko." +INSTL_FTP_NORETR="Funkcija "_QQ_"RETR"_QQ_" nepavyko." +INSTL_FTP_NORMD="Funkcija "_QQ_"RMD"_QQ_" nepavyko." +INSTL_FTP_NOROOT="Nepavyko prieiga prie nurodyto FTP katalogo." +INSTL_FTP_NOSTOR="Funkcija "_QQ_"STOR"_QQ_" nepavyko." +INSTL_FTP_NOSYST="Funkcija "_QQ_"SYST"_QQ_" nepavyko." +INSTL_FTP_UNABLE_DETECT_ROOT_FOLDER="Neįmanoma automatiškai aptikti FTP šakninio aplanko." + +;others +INSTL_CONFPROBLEM="Jūsų konfigūracinis failas arba katalogas, kuriame jis yra neturi uždėtų rašymo teisių arba tiesiog nepavyko sukurti konfigūracinio failo. Jums reikės reikiamą kodą užkrauti rankiniu būdu. Pažymėkite teksto dalį ar tiesiog visą tekstą ir paskui pažymėtą turinį įkopijuokite į naują failą. Pavadinkite šį failą 'configuration.php' ir užkraukite jį į savo svetainės šakninį katalogą." +INSTL_DATABASE_SUPPORT="Duomenų bazės palaikymas:" +INSTL_DISPLAY_ERRORS="Rodyti klaidas" +INSTL_ERROR_DB="Užpildant duomenų bazę, įvyko klaidos: %s" +INSTL_ERROR_INITIALISE_SCHEMA="Nepavyksta inicializuoti duomenų bazės schemos" +INSTL_FILE_UPLOADS="Failų įkėlimai" +INSTL_GNU_GPL_LICENSE="GNU Bendroji Viešoji Licencija" +INSTL_JSON_SUPPORT_AVAILABLE="JSON palaikymas" +INSTL_MAGIC_QUOTES_GPC="Magic Quotes GPC Išjungta" +INSTL_MAGIC_QUOTES_RUNTIME="Magic Quotes Runtime" +INSTL_MB_LANGUAGE_IS_DEFAULT="MB kalba yra numatytoji" +INSTL_MB_STRING_OVERLOAD_OFF="MB String Overload Išjungta" +INSTL_NOTICEMBLANGNOTDEFAULT="PHP mbstring kalba nėra nustatyta į neutralią. Tai galima nustatyti lokaliai, įrašant php_value mbstring.language neutral vertę .htaccess faile." +INSTL_NOTICEMBSTRINGOVERLOAD="PHP mbstring funkcijos perkrovą yra įjungta. Tai galima išjungti lokaliai, įrašant php_value mbstring.func_overload 0 vertę .htaccess faile." +INSTL_NOTICEYOUCANSTILLINSTALL="
      Vis dar galite tęsti instaliaciją, kadangi konfigūracijos parametrai bus rodomi pabaigoje. Jūs turite rankiniu būdu įkelti kodą. Pažymėkite teksto dalį ar tiesiog visą tekstą ir paskui pažymėtą turinį įkopijuokite į naują failą. Pavadinkite šį failą 'configuration.php' ir užkraukite jį į savo svetainės šakninį katalogą." +INSTL_OUTPUT_BUFFERING="Išvesties Buferizavimas" +INSTL_PARSE_INI_FILE_AVAILABLE="INI analizatoriaus palaikymas" +INSTL_PHP_VERSION="PHP versija" +INSTL_PHP_VERSION_NEWER="PHP versija >= %s" +INSTL_REGISTER_GLOBALS="Register Globals Išjungta" +INSTL_SAFE_MODE="Saugus režimas" +INSTL_SESSION_AUTO_START="Sesijos automatinis paleidimas" +INSTL_WRITABLE="%s perrašomas" +INSTL_XML_SUPPORT="XML palaikymas" +INSTL_ZIP_SUPPORT_AVAILABLE="ZIP palaikymas" +INSTL_ZLIB_COMPRESSION_SUPPORT="Zlib glaudinimo suderinamumas" +INSTL_PROCESS_BUSY="Procesas vyksta. Prašome palaukti ..." + +;Global strings +JADMINISTRATOR="Administracija" +JCHECK_AGAIN="Patikrinti dar kartą" +JERROR="Klaida" +JEMAIL="El.paštas" +JGLOBAL_ISFREESOFTWARE="%s yra nemokama programinė įranga, išleista pagal %s." +JGLOBAL_LANGUAGE_VERSION_NOT_PLATFORM="Kalbos paketas neatitinka šios Joomla! versijos. Gali trūkti kai kurių eilučių ir jos bus rodomos anglų kalba." +JGLOBAL_SELECT_AN_OPTION="Parinkite parinktį" +JGLOBAL_SELECT_NO_RESULTS_MATCH="Nėra rezultatų" +JGLOBAL_SELECT_SOME_OPTIONS="Pasirinkite keletą parinkčių" +JINVALID_TOKEN="Naujausias prašymas buvo atmestas, nes jame yra neleistinas saugos atpažinimo ženklas. Prašome atnaujinti puslapį ir bandyti dar kartą." +JNEXT="Kitas" +JNO="Ne" +JNOTICE="Pranešimas" +JOFF="Išjungta" +JON="Įjungta" +JPREVIOUS="Ankstesnis" +JSITE="Puslapis" +JUSERNAME="Prisijungimo vardas" +JYES="Taip" + +; Framework strings necessary when no lang pack is available +JLIB_DATABASE_ERROR_CONNECT_MYSQL="Nepavyko prisijungti prie MySQL." +JLIB_DATABASE_ERROR_DATABASE="Įvyko duomenų bazės klaida." +JLIB_DATABASE_ERROR_LOAD_DATABASE_DRIVER="Nepavyko įkelti duomenų bazės tvarkyklės: %s" +JLIB_ENVIRONMENT_SESSION_EXPIRED="Jūsų sesijos laikas baigėsi. Prašome atnaujinti puslapį." +JLIB_FILESYSTEM_ERROR_COPY_FAILED="Kopijuoti nepavyko" +JLIB_FILESYSTEM_ERROR_PATH_IS_NOT_A_FOLDER_FILES="JFolder: :files: Kelias nėra aplankas. Kelias: %s" +JLIB_FORM_FIELD_INVALID="Klaidingas laukelis: " +JLIB_FORM_VALIDATE_FIELD_INVALID="Neteisingai užpildytas laukelis: %s" +JLIB_FORM_VALIDATE_FIELD_REQUIRED="Laukelis privalomas: %s" +JLIB_INSTALLER_ABORT="Nutraukiamas kalbos įdiegimas: %s" +JLIB_INSTALLER_ABORT_PACK_INSTALL_CREATE_DIRECTORY="Paketo įdiegimas: Nepavyko sukurti katalogo:%s." +JLIB_INSTALLER_ABORT_PACK_INSTALL_ERROR_EXTENSION="Paketas %1$s: Įvyko klaida diegiant išplėtimą: %2$s" +JLIB_INSTALLER_ABORT_PACK_INSTALL_NO_FILES="Paketas %s: Nėra jokių įdiegimo failų!" +JLIB_INSTALLER_ERROR_FAIL_COPY_FILE="JInstaller: :Install: Nepavyko nukopijuoti failo %1$s į %2$s." +JLIB_INSTALLER_NOT_ERROR="Jei klaida susijusi su TinyMCE kalbos failų įdiegimu, ji neturi įtakos kalbos(-ų) įdiegimui. Kai kurie kalbos paketai sukurti prieš Joomla! 3.2.0 gali bandyti įdiegti atskirus TinyMCE kalbos failus. Kadangi jie dabar yra įtraukti į branduolį, jų nebereikia įdiegti." +JLIB_UTIL_ERROR_CONNECT_DATABASE="JDatabase: :getInstance: Nepavyko prisijungti prie duomenų bazės
      joomla.library: %1$s - %2$s" + +; Strings for the language debugger +JDEBUG_LANGUAGE_FILES_IN_ERROR="Analizavimo klaidos kalbos failuose" +JDEBUG_LANGUAGE_UNTRANSLATED_STRING="Neišverstos eilutės" +JNONE="Joks" + +; Necessary for errors +ADMIN_EMAIL="Administratoriaus el. paštas" +ADMIN_PASSWORD="Administratoriaus slaptažodis" +ADMIN_PASSWORD2="Patvirtinti administratoriaus slaptažodį" +SITE_NAME="Puslapio pavadinimas" + +; Database types (allows for a more descriptive label than the internal name) +MYSQL="MySQL" +MYSQLI="MySQLi" +ORACLE="Oracle" +PDOMYSQL="MySQL (PDO)" +POSTGRESQL="PostgreSQL" +SQLAZURE="Microsoft SQL Azure" +SQLITE="SQLite" +SQLSRV="Microsoft SQL Server" + +; Javascript message titles +ERROR="Klaida" +MESSAGE="Žinutė" +NOTICE="Pranešimas" +WARNING="Įspėjimas" + +; Javascript ajax error messages +JLIB_JS_AJAX_ERROR_CONNECTION_ABORT="Ryšys nutrauktas išrenkant JSON duomenis." +JLIB_JS_AJAX_ERROR_NO_CONTENT="Rezultatų negrąžinta." +JLIB_JS_AJAX_ERROR_OTHER="Klaida išrenkant JSON duomenis: HTTP %s būsenos kodas." +JLIB_JS_AJAX_ERROR_PARSE="Klaida apdorojant JSON duomenis:
      %s" +JLIB_JS_AJAX_ERROR_TIMEOUT="Baigėsi laikas bandant išrinkti JSON duomenis." diff --git a/installation/language/lt-LT/lt-LT.xml b/installation/language/lt-LT/lt-LT.xml new file mode 100644 index 0000000000000..03ae03b99d866 --- /dev/null +++ b/installation/language/lt-LT/lt-LT.xml @@ -0,0 +1,21 @@ + + + Lithuanian (Lithuania) + 3.8.10 + June 2018 + Rimvydas Žilinskas + Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + + lt-LT.ini + + + Lithuanian (Lithuania) lt-LT + Lietuvių (Lietuva) lt-LT + lt-LT + 0 + + + diff --git a/media/system/js/fields/calendar-locales/lt.js b/media/system/js/fields/calendar-locales/lt.js new file mode 100644 index 0000000000000..f1d45c20d7508 --- /dev/null +++ b/media/system/js/fields/calendar-locales/lt.js @@ -0,0 +1,19 @@ +window.JoomlaCalLocale = { + today : "Šiandien", + weekend : [0, 6], + wk : "wk", + time : "Laikas:", + days : ["Sekmadienis", "Pirmadienis", "Antradienis", "Trečiadienis", "Ketvirtadienis", "Penktadienis", "Šeštadienis"], + shortDays : ["Sek", "Pir", "Ant", "Tre", "Ket", "Pen", "Šeš"], + months : ["Sausis", "Vasaris", "Kovas", "Balandis", "Gegužė", "Birželis", "Liepa", "Rugpjūtis", "Rugsšjis", "Spalis", "Lapkritis", "Gruodis"], + shortMonths : ["Sau", "Vas", "Kov", "Bal", "Geg", "Bir", "Lie", "Rug", "Rgs", "Spa", "Lap", "Grd"], + AM : "AM", + PM : "PM", + am : "am", + pm : "pm", + dateType : "gregorian", + minYear : 1900, + maxYear : 2100, + exit: "Uždaryti", + save: "Išvalyti" +}; \ No newline at end of file From e6d61160eff61d749328e86c01c98fc5239a198a Mon Sep 17 00:00:00 2001 From: Thomas Hunziker Date: Wed, 25 Jul 2018 11:57:03 +0200 Subject: [PATCH 35/92] Updating lithuanian language strings for TinyMCE --- media/editors/tinymce/langs/lt.js | 257 ++++++++++++++++++------------ 1 file changed, 154 insertions(+), 103 deletions(-) diff --git a/media/editors/tinymce/langs/lt.js b/media/editors/tinymce/langs/lt.js index 594284be785ae..f13e305fcf464 100644 --- a/media/editors/tinymce/langs/lt.js +++ b/media/editors/tinymce/langs/lt.js @@ -1,179 +1,230 @@ tinymce.addI18n('lt',{ +"Redo": "Gr\u0105\u017einti", +"Undo": "Atstatyti", "Cut": "I\u0161kirpti", -"Header 2": "Antra\u0161t\u0117 2", -"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.": "Nar\u0161ykl\u0117s nustatymai neleid\u017eia redaktoriui tiesiogiai pasiekti laikinosios atminties. Pra\u0161ome naudoti klaviat\u016bros klavi\u0161us Ctrl+X\/C\/V.", -"Div": "Div", +"Copy": "Kopijuoti", "Paste": "\u012ed\u0117ti", -"Close": "U\u017edaryti", -"Font Family": "\u0160riftas", -"Pre": "Pre", -"Align right": "Lygiuoti de\u0161in\u0117je", +"Select all": "Pa\u017eym\u0117ti visk\u0105", "New document": "Naujas dokumentas", -"Blockquote": "Citata", +"Ok": "Gerai", +"Cancel": "Atsisakyti", +"Visual aids": "Vaizdin\u0117s priemon\u0117s", +"Bold": "Pary\u0161kintas", +"Italic": "Kursyvinis", +"Underline": "Pabrauktas", +"Strikethrough": "Perbrauktas", +"Superscript": "Vir\u0161utinis indeksas", +"Subscript": "Apatinis indeksas", +"Clear formatting": "Naikinti formatavim\u0105", +"Align left": "Lygiuoti kair\u0117je", +"Align center": "Centruoti", +"Align right": "Lygiuoti de\u0161in\u0117je", +"Justify": "I\u0161d\u0117styti per vis\u0105 plot\u012f", +"Bullet list": "\u017denklinimo s\u0105ra\u0161as", "Numbered list": "Skaitmeninis s\u0105ra\u0161as", +"Decrease indent": "Ma\u017einti \u012ftrauk\u0105", "Increase indent": "Didinti \u012ftrauk\u0105", +"Close": "U\u017edaryti", "Formats": "Formatai", +"Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X\/C\/V keyboard shortcuts instead.": "Nar\u0161ykl\u0117s nustatymai neleid\u017eia redaktoriui tiesiogiai pasiekti laikinosios atminties. Pra\u0161ome naudoti klaviat\u016bros klavi\u0161us Ctrl+X\/C\/V.", "Headers": "Antra\u0161t\u0117s", -"Select all": "Pa\u017eym\u0117ti visk\u0105", -"Header 3": "Antra\u0161t\u0117 3", -"Blocks": "Blokai", -"Undo": "Atstatyti", -"Strikethrough": "Perbrauktas", -"Bullet list": "\u017denklinimo s\u0105ra\u0161as", "Header 1": "Antra\u0161t\u0117 1", -"Superscript": "Vir\u0161utinis indeksas", -"Clear formatting": "Naikinti formatavim\u0105", -"Font Sizes": "\u0160rifto dyd\u017eiai", -"Subscript": "Apatinis indeksas", +"Header 2": "Antra\u0161t\u0117 2", +"Header 3": "Antra\u0161t\u0117 3", +"Header 4": "Antra\u0161t\u0117 4", +"Header 5": "Antra\u0161t\u0117 5", "Header 6": "Antra\u0161t\u0117 6", -"Redo": "Gr\u0105\u017einti", -"Paragraph": "Paragrafas", -"Ok": "Gerai", -"Bold": "Pary\u0161kintas", +"Headings": "Antra\u0161t\u0117s", +"Heading 1": "Antra\u0161t\u0117 1", +"Heading 2": "Antra\u0161t\u0117 2", +"Heading 3": "Antra\u0161t\u0117 3", +"Heading 4": "Antra\u0161t\u0117 4", +"Heading 5": "Antra\u0161t\u0117 5", +"Heading 6": "Antra\u0161t\u0117 6", +"Div": "Div", +"Pre": "Pre", "Code": "Kodas", -"Italic": "Kursyvinis", -"Align center": "Centruoti", -"Header 5": "Antra\u0161t\u0117 5", -"Decrease indent": "Ma\u017einti \u012ftrauk\u0105", -"Header 4": "Antra\u0161t\u0117 4", -"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.": "Dabar \u012fterpiama paprastojo teksto re\u017eimu. Kol \u0161i parinktis \u012fjungta, turinys bus \u012fterptas kaip paprastas tekstas.", -"Underline": "Pabrauktas", -"Cancel": "Atsisakyti", -"Justify": "I\u0161d\u0117styti per vis\u0105 plot\u012f", +"Paragraph": "Paragrafas", +"Blockquote": "Citata", "Inline": "Inline", -"Copy": "Kopijuoti", -"Align left": "Lygiuoti kair\u0117je", -"Visual aids": "Vaizdin\u0117s priemon\u0117s", -"Lower Greek": "Ma\u017eosios graik\u0173", -"Square": "Kvadratas", +"Blocks": "Blokai", +"Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off.": "Dabar \u012fterpiama paprastojo teksto re\u017eimu. Kol \u0161i parinktis \u012fjungta, turinys bus \u012fterptas kaip paprastas tekstas.", +"Font Family": "\u0160riftas", +"Font Sizes": "\u0160rifto dyd\u017eiai", "Default": "Pagrindinis", -"Lower Alpha": "Ma\u017eosios raid\u0117s", "Circle": "Apskritimas", "Disc": "Diskas", +"Square": "Kvadratas", +"Lower Alpha": "Ma\u017eosios raid\u0117s", +"Lower Greek": "Ma\u017eosios graik\u0173", +"Lower Roman": "Ma\u017eosios rom\u0117n\u0173", "Upper Alpha": "Did\u017eiosios raid\u0117s", "Upper Roman": "Did\u017eiosios rom\u0117n\u0173", -"Lower Roman": "Ma\u017eosios rom\u0117n\u0173", -"Name": "Pavadinimas", "Anchor": "\u017dym\u0117", +"Name": "Pavadinimas", +"Id": "ID", +"Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores.": "ID turi prasid\u0117ti raide, po kurios gali b\u016bti raid\u0117s, skai\u010diai, br\u016bk\u0161niai, ta\u0161kai, kabliata\u0161kiai ar apatiniai pabraukimai.", "You have unsaved changes are you sure you want to navigate away?": "Turite nei\u0161saugot\u0173 pakeitim\u0173! Ar tikrai norite i\u0161eiti?", "Restore last draft": "Atstatyti paskutin\u012f projekt\u0105", "Special character": "Specialus simbolis", "Source code": "Pirminis \u0161altinis", -"Right to left": "I\u0161 de\u0161in\u0117s \u012f kair\u0119", +"Insert\/Edit code sample": "Prid\u0117ti \/ keisti kodo pavyzd\u012f", +"Language": "Kalba", +"Color": "Spalva", +"R": "R", +"G": "G", +"B": "B", "Left to right": "I\u0161 kair\u0117s \u012f de\u0161in\u0119", +"Right to left": "I\u0161 de\u0161in\u0117s \u012f kair\u0119", "Emoticons": "Jaustukai", -"Robots": "Robotai", "Document properties": "Dokumento savyb\u0117s", "Title": "Pavadinimas", "Keywords": "\u017dymos", -"Encoding": "Kodavimas", "Description": "Apra\u0161as", +"Robots": "Robotai", "Author": "Autorius", +"Encoding": "Kodavimas", "Fullscreen": "Visas ekranas", "Horizontal line": "Horizontali linija", -"Horizontal space": "Horizontalus tarpas", "Insert\/edit image": "\u012eterpti|Tvarkyti paveiksl\u0117l\u012f", -"General": "Bendra", -"Advanced": "I\u0161pl\u0117stas", +"Image description": "Paveiksl\u0117lio apra\u0161as", "Source": "Pirmin\u0117 nuoroda", -"Border": "R\u0117melis", +"Dimensions": "Matmenys", "Constrain proportions": "Laikytis proporcij\u0173", -"Vertical space": "Vertikalus tarpas", -"Image description": "Paveiksl\u0117lio apra\u0161as", +"General": "Bendra", +"Advanced": "I\u0161pl\u0117stas", "Style": "Stilius", -"Dimensions": "Matmenys", +"Vertical space": "Vertikalus tarpas", +"Horizontal space": "Horizontalus tarpas", +"Border": "R\u0117melis", "Insert image": "\u012eterpti paveiksl\u0117l\u012f", +"Image": "Paveiksl\u0117lis", +"Rotate counterclockwise": "Pasukti prie\u0161 laikrod\u017eio rodykl\u0119", +"Rotate clockwise": "Pasukti pagal laikrod\u017eio rodykl\u0119", +"Flip vertically": "Apversti vertikaliai", +"Flip horizontally": "Apversti horizontaliai", +"Edit image": "Redaguoti paveiksl\u0117l\u012f", +"Image options": "Paveiksl\u0117lio nustatymai", +"Zoom in": "Priartinti", +"Zoom out": "Atitolinti", +"Crop": "Atkarpyti", +"Resize": "Keisti dyd\u012f", +"Orientation": "Pasukimas", +"Brightness": "\u0160viesumas", +"Sharpen": "Ry\u0161kumas", +"Contrast": "Kontrastas", +"Color levels": "Spalv\u0173 lygiai", +"Gamma": "Gama", +"Invert": "Prie\u0161ingos spalvos", +"Apply": "Taikyti", +"Back": "Atgal", "Insert date\/time": "\u012eterpti dat\u0105\/laik\u0105", -"Remove link": "\u0160alinti nuorod\u0105", -"Url": "Nuoroda", -"Text to display": "Rodomas tekstas", -"Anchors": "\u017dym\u0117", +"Date\/time": "Data \/ laikas", "Insert link": "\u012eterpti nuorod\u0105", -"New window": "Naujas langas", +"Insert\/edit link": "\u012eterpti\/taisyti nuorod\u0105", +"Text to display": "Rodomas tekstas", +"Url": "Nuoroda", +"Target": "Tikslin\u0117 nuoroda", "None": "Nieko", +"New window": "Naujas langas", +"Remove link": "\u0160alinti nuorod\u0105", +"Anchors": "\u017dym\u0117", +"Link": "Nuoroda", +"Paste or type a link": "\u012eklijuokite arba \u012fra\u0161ykite nuorod\u0105", +"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?": "Atrodo, kad \u012fvesta nuoroda yra elektroninio pa\u0161to adresas. Ar norite prie\u0161 j\u012f \u012fvesti reikalaujam\u0105 \u201emailto:\u201c?", "The URL you entered seems to be an external link. Do you want to add the required http:\/\/ prefix?": "Atrodo, kad \u012fved\u0117te nuotolin\u0119 nuorod\u0105. Ar norite prie\u0161 j\u0105 \u012fvesti reikalaujam\u0105 \u201ehttp:\/\/\u201c?", -"Target": "Tikslin\u0117 nuoroda", -"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?": "Atrodo, kad \u012fvesta nuoroda yra elektroninio pa\u0161to adresas. Ar prad\u017eioje norite \u012fvesti reikalaujam\u0105 \u201emailto:\u201c?", -"Insert\/edit link": "\u012eterpti\/taisyti nuorod\u0105", +"Insert video": "\u012eterpti video", "Insert\/edit video": "\u012eterpti\/tvarkyti video", -"Poster": "Plakatas", +"Insert\/edit media": "Prid\u0117ti \/ keisti medij\u0105", "Alternative source": "Alternatyvus \u0161altinis", +"Poster": "Plakatas", "Paste your embed code below:": "\u012eterpkite kod\u0105 \u017eemiau:", -"Insert video": "\u012eterpti video", "Embed": "\u012eterpti", +"Media": "Medija", "Nonbreaking space": "Nepertraukiamos vietos", "Page break": "Puslapio skirtukas", "Paste as text": "\u012eklijuoti kaip tekst\u0105", "Preview": "Per\u017ei\u016bra", "Print": "Spausdinti", "Save": "I\u0161saugoti", -"Could not find the specified string.": "Nepavyko rasti nurodytos eilut\u0117s.", +"Find": "Ie\u0161koti", +"Replace with": "Kuo pakeisti", "Replace": "Pakeisti", +"Replace all": "Pakeisti visk\u0105", +"Prev": "Ankstesnis", "Next": "Sekantis", -"Whole words": "Visus \u017eod\u017eius", "Find and replace": "Surasti ir pakeisti", -"Replace with": "Kuo pakeisti", -"Find": "Ie\u0161koti", -"Replace all": "Pakeisti visk\u0105", +"Could not find the specified string.": "Nepavyko rasti nurodytos eilut\u0117s.", "Match case": "Atitinkamus", -"Prev": "Ankstesnis", +"Whole words": "Visus \u017eod\u017eius", "Spellcheck": "Ra\u0161ybos tikrinimas", -"Finish": "Baigti", -"Ignore all": "Ignoruoti visk\u0105", "Ignore": "Ignoruoti", -"Insert row before": "\u012eterpti eilut\u0119 prie\u0161", -"Rows": "Eilut\u0117s", -"Height": "Auk\u0161tis", -"Paste row after": "\u012ed\u0117ti eilut\u0119 po", -"Alignment": "Lygiavimas", -"Column group": "Stulpeli\u0173 grup\u0117", -"Row": "Eilut\u0117s", -"Insert column before": "\u012eterpti stulpel\u012f prie\u0161", -"Split cell": "Skaidyti langelius", -"Cell padding": "Tarpas nuo langelio iki teksto", -"Cell spacing": "Tarpas tarp langeli\u0173", -"Row type": "Eilu\u010di\u0173 tipas", +"Ignore all": "Ignoruoti visk\u0105", +"Finish": "Baigti", +"Add to Dictionary": "Prid\u0117ti \u012f \u017dodyn\u0105", "Insert table": "\u012eterpti lentel\u0119", -"Body": "Turinys", -"Caption": "Antra\u0161t\u0117", -"Footer": "Apa\u010dia", -"Delete row": "Naikinti eilut\u0119", -"Paste row before": "\u012ed\u0117ti eilut\u0119 prie\u0161", -"Scope": "Strukt\u016bra", +"Table properties": "Lentel\u0117s savyb\u0117s", "Delete table": "\u0160alinti lentel\u0119", -"Header cell": "Antra\u0161t\u0117s langelis", -"Column": "Stulpelis", "Cell": "Langeliai", -"Header": "Antra\u0161t\u0117", -"Cell type": "Langelio tipas", -"Copy row": "Kopijuoti eilut\u0119", +"Row": "Eilut\u0117s", +"Column": "Stulpelis", +"Cell properties": "Langelio savyb\u0117s", +"Merge cells": "Sujungti langelius", +"Split cell": "Skaidyti langelius", +"Insert row before": "\u012eterpti eilut\u0119 prie\u0161", +"Insert row after": "\u012eterpti eilut\u0119 po", +"Delete row": "Naikinti eilut\u0119", "Row properties": "Eilut\u0117s savyb\u0117s", -"Table properties": "Lentel\u0117s savyb\u0117s", -"Row group": "Eilu\u010di\u0173 grup\u0117", -"Right": "De\u0161in\u0117", +"Cut row": "I\u0161kirpti eilut\u0119", +"Copy row": "Kopijuoti eilut\u0119", +"Paste row before": "\u012ed\u0117ti eilut\u0119 prie\u0161", +"Paste row after": "\u012ed\u0117ti eilut\u0119 po", +"Insert column before": "\u012eterpti stulpel\u012f prie\u0161", "Insert column after": "\u012eterpti stulpel\u012f po", +"Delete column": "Naikinti stulpel\u012f", "Cols": "Stulpeliai", -"Insert row after": "\u012eterpti eilut\u0119 po", +"Rows": "Eilut\u0117s", "Width": "Plotis", -"Cell properties": "Langelio savyb\u0117s", +"Height": "Auk\u0161tis", +"Cell spacing": "Tarpas tarp langeli\u0173", +"Cell padding": "Tarpas nuo langelio iki teksto", +"Caption": "Antra\u0161t\u0117", "Left": "Kair\u0117", -"Cut row": "I\u0161kirpti eilut\u0119", -"Delete column": "Naikinti stulpel\u012f", "Center": "Centras", -"Merge cells": "Sujungti langelius", +"Right": "De\u0161in\u0117", +"Cell type": "Langelio tipas", +"Scope": "Strukt\u016bra", +"Alignment": "Lygiavimas", +"H Align": "H Lygiavimas", +"V Align": "V Lygiavimas", +"Top": "Vir\u0161uje", +"Middle": "Viduryje", +"Bottom": "Apa\u010dioje", +"Header cell": "Antra\u0161t\u0117s langelis", +"Row group": "Eilu\u010di\u0173 grup\u0117", +"Column group": "Stulpeli\u0173 grup\u0117", +"Row type": "Eilu\u010di\u0173 tipas", +"Header": "Antra\u0161t\u0117", +"Body": "Turinys", +"Footer": "Apa\u010dia", +"Border color": "R\u0117melio spalva", "Insert template": "\u012eterpti \u0161ablon\u0105", "Templates": "\u0160ablonai", -"Background color": "Fono spalva", "Text color": "Teksto spalva", +"Background color": "Fono spalva", +"Custom...": "Pasirinktinas...", +"Custom color": "Pasirinktina spalva", +"No color": "Jokios spalvos", +"Table of Contents": "Turinys", "Show blocks": "Rodyti blokus", "Show invisible characters": "Rodyti nematomus simbolius", "Words: {0}": "\u017dod\u017eiai: {0}", -"Insert": "\u012eterpti", "File": "Failas", "Edit": "Redaguoti", -"Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help": "Suformatuoto teksto laukas. D\u0117l meniu spauskite ALT-F9. U\u017eduo\u010di\u0173 juostos \u012fjungimui spauskite ALT-F10. Pagalbai - spauskite ALT-0.", -"Tools": "\u012erankiai", +"Insert": "\u012eterpti", "View": "Per\u017ei\u016bra", +"Format": "Formatas", "Table": "Lentel\u0117", -"Format": "Formatas" +"Tools": "\u012erankiai", +"Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help": "Suformatuoto teksto laukas. D\u0117l meniu spauskite ALT-F9. U\u017eduo\u010di\u0173 juostos \u012fjungimui spauskite ALT-F10. Pagalbai - spauskite ALT-0." }); \ No newline at end of file From dbb668c9447c02b91fb1a2bf0b4851d519c46fd8 Mon Sep 17 00:00:00 2001 From: Brian Teeman Date: Wed, 25 Jul 2018 23:38:06 +0100 Subject: [PATCH 36/92] Appended input fields (#21257) PR for #12448 ## Steps to reproduce the issue Effects all appended input fields. Eg. Navigate to a single article menu item (Menus -> MainMenu -> Home) and resize the screen below 767px. Input fields extend outside the viewport. --- administrator/templates/isis/css/template-rtl.css | 1 - administrator/templates/isis/css/template.css | 1 - media/jui/less/responsive-767px-max.less | 1 - templates/protostar/css/template.css | 1 - 4 files changed, 4 deletions(-) diff --git a/administrator/templates/isis/css/template-rtl.css b/administrator/templates/isis/css/template-rtl.css index 2c082910b1354..a664a1f057349 100644 --- a/administrator/templates/isis/css/template-rtl.css +++ b/administrator/templates/isis/css/template-rtl.css @@ -4709,7 +4709,6 @@ a.badge:focus { .input-prepend input[class*="span"], .input-append input[class*="span"] { display: inline-block; - width: auto; } .controls-row [class*="span"] + [class*="span"] { margin-left: 0; diff --git a/administrator/templates/isis/css/template.css b/administrator/templates/isis/css/template.css index 059887b1aedae..5cce4e7bbbfac 100644 --- a/administrator/templates/isis/css/template.css +++ b/administrator/templates/isis/css/template.css @@ -4709,7 +4709,6 @@ a.badge:focus { .input-prepend input[class*="span"], .input-append input[class*="span"] { display: inline-block; - width: auto; } .controls-row [class*="span"] + [class*="span"] { margin-left: 0; diff --git a/media/jui/less/responsive-767px-max.less b/media/jui/less/responsive-767px-max.less index c4a82f75da718..d011170d7c44c 100644 --- a/media/jui/less/responsive-767px-max.less +++ b/media/jui/less/responsive-767px-max.less @@ -101,7 +101,6 @@ .input-prepend input[class*="span"], .input-append input[class*="span"] { display: inline-block; // redeclare so they don't wrap to new lines - width: auto; } .controls-row [class*="span"] + [class*="span"] { margin-left: 0; diff --git a/templates/protostar/css/template.css b/templates/protostar/css/template.css index 7b83175a67212..f3667089abdcd 100644 --- a/templates/protostar/css/template.css +++ b/templates/protostar/css/template.css @@ -4870,7 +4870,6 @@ a.badge:focus { .input-prepend input[class*="span"], .input-append input[class*="span"] { display: inline-block; - width: auto; } .controls-row [class*="span"] + [class*="span"] { margin-left: 0; From 343c1b43eab3b3b18ab96fcc712b7657faf210c6 Mon Sep 17 00:00:00 2001 From: Brian Teeman Date: Wed, 25 Jul 2018 23:38:38 +0100 Subject: [PATCH 37/92] CSS for flags (#21254) Fix for #13678 reported by @gwsdesk --- templates/protostar/css/template.css | 3 +++ templates/protostar/less/template.less | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/templates/protostar/css/template.css b/templates/protostar/css/template.css index f3667089abdcd..c6bdb79394610 100644 --- a/templates/protostar/css/template.css +++ b/templates/protostar/css/template.css @@ -7736,6 +7736,9 @@ ul.manager .height-50 .icon-folder-2 { .finder-selects { margin: 0 15px 15px 0; } +.header-search .mod-languages ul { + margin: 0 0 5px 0; +} .rtl .navigation .nav-child { left: auto; right: 0; diff --git a/templates/protostar/less/template.less b/templates/protostar/less/template.less index 061cde530cc12..335a9bfa3be9f 100644 --- a/templates/protostar/less/template.less +++ b/templates/protostar/less/template.less @@ -736,4 +736,8 @@ ul.manager .height-50 .icon-folder-2 { margin: 0 15px 15px 0; } +/* mod_search in position-0 */ +.header-search .mod-languages ul { + margin: 0 0 5px 0; + } @import "template_rtl.less"; // Specific for rtl. Always load last. \ No newline at end of file From 359bb1834412e8c0092970822cca8376a68fa8ec Mon Sep 17 00:00:00 2001 From: Scott Albertson Date: Fri, 27 Jul 2018 04:37:36 -0700 Subject: [PATCH 38/92] Add "Reviewed by Hound" badge (#21263) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b0af7b464221d..0fe606fe5be58 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Joomla! CMS™ [![Analytics](https://ga-beacon.appspot.com/UA-544070-3/joomla-cms/readme)](https://github.com/igrigorik/ga-beacon) +Joomla! CMS™ [![Analytics](https://ga-beacon.appspot.com/UA-544070-3/joomla-cms/readme)](https://github.com/igrigorik/ga-beacon) [![Reviewed by Hound](https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg)](https://houndci.com) ==================== Build Status From ab4f245ac289c039e014eceb22872a9a84dd03fe Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Fri, 27 Jul 2018 06:48:11 -0500 Subject: [PATCH 39/92] Adjust doc block to ensure file is included in patch packages due to accidental deletion with last release's post-update script --- administrator/components/com_installer/models/fields/type.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/components/com_installer/models/fields/type.php b/administrator/components/com_installer/models/fields/type.php index 0dd853b0b4604..eddf06f09a74e 100644 --- a/administrator/components/com_installer/models/fields/type.php +++ b/administrator/components/com_installer/models/fields/type.php @@ -14,7 +14,7 @@ JFormHelper::loadFieldClass('list'); /** - * Type field. + * Form field for a list of extension types. * * @since 3.5 */ From cfa202166959ffdb1f536a233add678b250eb7c5 Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Fri, 27 Jul 2018 06:49:40 -0500 Subject: [PATCH 40/92] Prepare 3.8.11 release candidate --- administrator/language/en-GB/en-GB.xml | 2 +- administrator/language/en-GB/install.xml | 2 +- administrator/manifests/files/joomla.xml | 4 ++-- administrator/manifests/packages/pkg_en-GB.xml | 2 +- installation/language/en-GB/en-GB.xml | 2 +- language/en-GB/en-GB.xml | 2 +- language/en-GB/install.xml | 2 +- libraries/src/Version.php | 10 +++++----- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/administrator/language/en-GB/en-GB.xml b/administrator/language/en-GB/en-GB.xml index 056551f9c9782..88bd5e6ef4c4e 100644 --- a/administrator/language/en-GB/en-GB.xml +++ b/administrator/language/en-GB/en-GB.xml @@ -2,7 +2,7 @@ English (en-GB) 3.8.11 - June 2018 + July 2018 Joomla! Project admin@joomla.org www.joomla.org diff --git a/administrator/language/en-GB/install.xml b/administrator/language/en-GB/install.xml index 3c1b389b06b30..17ffbbf23b85d 100644 --- a/administrator/language/en-GB/install.xml +++ b/administrator/language/en-GB/install.xml @@ -3,7 +3,7 @@ English (en-GB) en-GB 3.8.11 - June 2018 + July 2018 Joomla! Project admin@joomla.org www.joomla.org diff --git a/administrator/manifests/files/joomla.xml b/administrator/manifests/files/joomla.xml index 49a16ddbb81c6..c78d2ad9eadf9 100644 --- a/administrator/manifests/files/joomla.xml +++ b/administrator/manifests/files/joomla.xml @@ -6,8 +6,8 @@ www.joomla.org (C) 2005 - 2018 Open Source Matters. All rights reserved GNU General Public License version 2 or later; see LICENSE.txt - 3.8.11-dev - June 2018 + 3.8.11-rc + July 2018 FILES_JOOMLA_XML_DESCRIPTION administrator/components/com_admin/script.php diff --git a/administrator/manifests/packages/pkg_en-GB.xml b/administrator/manifests/packages/pkg_en-GB.xml index 7c711757573bf..29f33c1ac85e4 100644 --- a/administrator/manifests/packages/pkg_en-GB.xml +++ b/administrator/manifests/packages/pkg_en-GB.xml @@ -3,7 +3,7 @@ English (en-GB) Language Pack en-GB 3.8.11.1 - June 2018 + July 2018 Joomla! Project admin@joomla.org www.joomla.org diff --git a/installation/language/en-GB/en-GB.xml b/installation/language/en-GB/en-GB.xml index 9a64da681ac16..ac2e1f9ce3d0d 100644 --- a/installation/language/en-GB/en-GB.xml +++ b/installation/language/en-GB/en-GB.xml @@ -4,7 +4,7 @@ client="installation"> English (United Kingdom) 3.8.11 - June 2018 + July 2018 Joomla! Project Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/language/en-GB/en-GB.xml b/language/en-GB/en-GB.xml index beac4a6fe130e..bdc368b27ec2c 100644 --- a/language/en-GB/en-GB.xml +++ b/language/en-GB/en-GB.xml @@ -2,7 +2,7 @@ English (en-GB) 3.8.11 - June 2018 + July 2018 Joomla! Project admin@joomla.org www.joomla.org diff --git a/language/en-GB/install.xml b/language/en-GB/install.xml index 5b10b1dea62f1..2834796663116 100644 --- a/language/en-GB/install.xml +++ b/language/en-GB/install.xml @@ -3,7 +3,7 @@ English (en-GB) en-GB 3.8.11 - June 2018 + July 2018 Joomla! Project admin@joomla.org www.joomla.org diff --git a/libraries/src/Version.php b/libraries/src/Version.php index 5b52fa5ee9da0..82cee1b2fd444 100644 --- a/libraries/src/Version.php +++ b/libraries/src/Version.php @@ -60,7 +60,7 @@ final class Version * @var string * @since 3.8.0 */ - const EXTRA_VERSION = 'dev'; + const EXTRA_VERSION = 'rc'; /** * Release version. @@ -78,7 +78,7 @@ final class Version * @since 3.5 * @deprecated 4.0 Use separated version constants instead */ - const DEV_LEVEL = '11-dev'; + const DEV_LEVEL = '11-rc'; /** * Development status. @@ -86,7 +86,7 @@ final class Version * @var string * @since 3.5 */ - const DEV_STATUS = 'Development'; + const DEV_STATUS = 'Release Candidate'; /** * Build number. @@ -111,7 +111,7 @@ final class Version * @var string * @since 3.5 */ - const RELDATE = '26-June-2018'; + const RELDATE = '27-July-2018'; /** * Release time. @@ -119,7 +119,7 @@ final class Version * @var string * @since 3.5 */ - const RELTIME = '15:45'; + const RELTIME = '11:45'; /** * Release timezone. From aa34c79ae746bd15802a8d5237b3995f28723d0a Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Fri, 27 Jul 2018 06:54:45 -0500 Subject: [PATCH 41/92] Reset to dev --- administrator/manifests/files/joomla.xml | 2 +- libraries/src/Version.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/administrator/manifests/files/joomla.xml b/administrator/manifests/files/joomla.xml index c78d2ad9eadf9..759b8b385ecdc 100644 --- a/administrator/manifests/files/joomla.xml +++ b/administrator/manifests/files/joomla.xml @@ -6,7 +6,7 @@ www.joomla.org (C) 2005 - 2018 Open Source Matters. All rights reserved GNU General Public License version 2 or later; see LICENSE.txt - 3.8.11-rc + 3.8.11-dev July 2018 FILES_JOOMLA_XML_DESCRIPTION diff --git a/libraries/src/Version.php b/libraries/src/Version.php index 82cee1b2fd444..24202c606f850 100644 --- a/libraries/src/Version.php +++ b/libraries/src/Version.php @@ -60,7 +60,7 @@ final class Version * @var string * @since 3.8.0 */ - const EXTRA_VERSION = 'rc'; + const EXTRA_VERSION = 'dev'; /** * Release version. @@ -78,7 +78,7 @@ final class Version * @since 3.5 * @deprecated 4.0 Use separated version constants instead */ - const DEV_LEVEL = '11-rc'; + const DEV_LEVEL = '11-dev'; /** * Development status. @@ -86,7 +86,7 @@ final class Version * @var string * @since 3.5 */ - const DEV_STATUS = 'Release Candidate'; + const DEV_STATUS = 'Development'; /** * Build number. From 603db7e3cba04082ee677e56ceafed78efc6b455 Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Tue, 31 Jul 2018 06:40:25 -0500 Subject: [PATCH 42/92] Prepare 3.8.11 release --- administrator/manifests/files/joomla.xml | 2 +- libraries/src/Version.php | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/administrator/manifests/files/joomla.xml b/administrator/manifests/files/joomla.xml index 759b8b385ecdc..f833ee19d3b81 100644 --- a/administrator/manifests/files/joomla.xml +++ b/administrator/manifests/files/joomla.xml @@ -6,7 +6,7 @@ www.joomla.org (C) 2005 - 2018 Open Source Matters. All rights reserved GNU General Public License version 2 or later; see LICENSE.txt - 3.8.11-dev + 3.8.11 July 2018 FILES_JOOMLA_XML_DESCRIPTION diff --git a/libraries/src/Version.php b/libraries/src/Version.php index 24202c606f850..9cd78c010bbbb 100644 --- a/libraries/src/Version.php +++ b/libraries/src/Version.php @@ -60,7 +60,7 @@ final class Version * @var string * @since 3.8.0 */ - const EXTRA_VERSION = 'dev'; + const EXTRA_VERSION = ''; /** * Release version. @@ -78,7 +78,7 @@ final class Version * @since 3.5 * @deprecated 4.0 Use separated version constants instead */ - const DEV_LEVEL = '11-dev'; + const DEV_LEVEL = '11'; /** * Development status. @@ -86,7 +86,7 @@ final class Version * @var string * @since 3.5 */ - const DEV_STATUS = 'Development'; + const DEV_STATUS = 'Stable'; /** * Build number. @@ -111,7 +111,7 @@ final class Version * @var string * @since 3.5 */ - const RELDATE = '27-July-2018'; + const RELDATE = '31-July-2018'; /** * Release time. @@ -119,7 +119,7 @@ final class Version * @var string * @since 3.5 */ - const RELTIME = '11:45'; + const RELTIME = '14:00'; /** * Release timezone. From 9b9be8f4bb024212aeab99e3b4b757975370766c Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Tue, 31 Jul 2018 06:45:13 -0500 Subject: [PATCH 43/92] Bump to 3.8.12-dev --- administrator/language/en-GB/en-GB.xml | 2 +- administrator/language/en-GB/install.xml | 2 +- administrator/manifests/files/joomla.xml | 2 +- administrator/manifests/packages/pkg_en-GB.xml | 2 +- installation/language/en-GB/en-GB.xml | 2 +- language/en-GB/en-GB.xml | 2 +- language/en-GB/install.xml | 2 +- libraries/src/Version.php | 8 ++++---- 8 files changed, 11 insertions(+), 11 deletions(-) diff --git a/administrator/language/en-GB/en-GB.xml b/administrator/language/en-GB/en-GB.xml index 88bd5e6ef4c4e..c36a3ade35e7a 100644 --- a/administrator/language/en-GB/en-GB.xml +++ b/administrator/language/en-GB/en-GB.xml @@ -1,7 +1,7 @@ English (en-GB) - 3.8.11 + 3.8.12 July 2018 Joomla! Project admin@joomla.org diff --git a/administrator/language/en-GB/install.xml b/administrator/language/en-GB/install.xml index 17ffbbf23b85d..f6a160bac4ad0 100644 --- a/administrator/language/en-GB/install.xml +++ b/administrator/language/en-GB/install.xml @@ -2,7 +2,7 @@ English (en-GB) en-GB - 3.8.11 + 3.8.12 July 2018 Joomla! Project admin@joomla.org diff --git a/administrator/manifests/files/joomla.xml b/administrator/manifests/files/joomla.xml index f833ee19d3b81..a30e056e7089a 100644 --- a/administrator/manifests/files/joomla.xml +++ b/administrator/manifests/files/joomla.xml @@ -6,7 +6,7 @@ www.joomla.org (C) 2005 - 2018 Open Source Matters. All rights reserved GNU General Public License version 2 or later; see LICENSE.txt - 3.8.11 + 3.8.12-dev July 2018 FILES_JOOMLA_XML_DESCRIPTION diff --git a/administrator/manifests/packages/pkg_en-GB.xml b/administrator/manifests/packages/pkg_en-GB.xml index 29f33c1ac85e4..5979436b613a7 100644 --- a/administrator/manifests/packages/pkg_en-GB.xml +++ b/administrator/manifests/packages/pkg_en-GB.xml @@ -2,7 +2,7 @@ English (en-GB) Language Pack en-GB - 3.8.11.1 + 3.8.12.1 July 2018 Joomla! Project admin@joomla.org diff --git a/installation/language/en-GB/en-GB.xml b/installation/language/en-GB/en-GB.xml index ac2e1f9ce3d0d..4d35dfd81ce4b 100644 --- a/installation/language/en-GB/en-GB.xml +++ b/installation/language/en-GB/en-GB.xml @@ -3,7 +3,7 @@ version="3.8" client="installation"> English (United Kingdom) - 3.8.11 + 3.8.12 July 2018 Joomla! Project Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. diff --git a/language/en-GB/en-GB.xml b/language/en-GB/en-GB.xml index bdc368b27ec2c..54575d5869a29 100644 --- a/language/en-GB/en-GB.xml +++ b/language/en-GB/en-GB.xml @@ -1,7 +1,7 @@ English (en-GB) - 3.8.11 + 3.8.12 July 2018 Joomla! Project admin@joomla.org diff --git a/language/en-GB/install.xml b/language/en-GB/install.xml index 2834796663116..7ca51b7720177 100644 --- a/language/en-GB/install.xml +++ b/language/en-GB/install.xml @@ -2,7 +2,7 @@ English (en-GB) en-GB - 3.8.11 + 3.8.12 July 2018 Joomla! Project admin@joomla.org diff --git a/libraries/src/Version.php b/libraries/src/Version.php index 9cd78c010bbbb..564c48b2849b3 100644 --- a/libraries/src/Version.php +++ b/libraries/src/Version.php @@ -49,7 +49,7 @@ final class Version * @var integer * @since 3.8.0 */ - const PATCH_VERSION = 11; + const PATCH_VERSION = 12; /** * Extra release version info. @@ -60,7 +60,7 @@ final class Version * @var string * @since 3.8.0 */ - const EXTRA_VERSION = ''; + const EXTRA_VERSION = 'dev'; /** * Release version. @@ -78,7 +78,7 @@ final class Version * @since 3.5 * @deprecated 4.0 Use separated version constants instead */ - const DEV_LEVEL = '11'; + const DEV_LEVEL = '12-dev'; /** * Development status. @@ -86,7 +86,7 @@ final class Version * @var string * @since 3.5 */ - const DEV_STATUS = 'Stable'; + const DEV_STATUS = 'Development'; /** * Build number. From c1bb864b92a1aca52470acf967d0fe45cb514c0e Mon Sep 17 00:00:00 2001 From: David Jardin Date: Wed, 1 Aug 2018 13:58:35 +0200 Subject: [PATCH 44/92] Added security scan tool to CI setup (#20796) * Added security scan tool to CI setup * Updated ordering * fixed command name --- .drone.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.drone.yml b/.drone.yml index aee8988aa80fb..da8e3fda4a91b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -26,3 +26,12 @@ pipeline: - tests/javascript/node_modules/karma/bin/karma start karma.conf.js --single-run - echo $(date) + analysis: + image: rips/rips-cli + secrets: [rips_username, rips_password] + commands: + - export RIPS_BASE_URI='https://api.rips.joomla.org' + - export RIPS_USERNAME=$RIPS_USERNAME + - export RIPS_PASSWORD=$RIPS_PASSWORD + - rips-cli rips:scan:start -a 1 -t 1 -p $(pwd) -t 1 -T $DRONE_REPO_OWNER-$DRONE_BRANCH || { echo "Please contact the security team at security@joomla.org"; exit 1; } + From 822f8b966109dedd37525cfdfd6b2c3c1777a32d Mon Sep 17 00:00:00 2001 From: Luca Marzo Date: Fri, 3 Aug 2018 00:28:19 +0200 Subject: [PATCH 45/92] Update readme to link to Launch instead of Demo (#21364) * No more demo * No more demo * Free hosting service * Free Hosting Service --- README.md | 2 +- README.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0fe606fe5be58..6bd831639e991 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Is Joomla! for you? --------------------- * Joomla! is [the right solution for most content web projects](https://docs.joomla.org/Special:MyLanguage/Portal:Learn_More). * View Joomla's [core features here](https://www.joomla.org/core-features.html). -* Try it out for yourself in our [online demo](https://demo.joomla.org). +* Try it out for yourself on our [free hosting service](https://launch.joomla.org). How to find a Joomla! translation? --------------------- diff --git a/README.txt b/README.txt index 6d93aedcc1e61..9a79be52d8cfa 100644 --- a/README.txt +++ b/README.txt @@ -13,7 +13,7 @@ 3- Is Joomla! for you? * Joomla! is the right solution for most content web projects: https://docs.joomla.org/Special:MyLanguage/Portal:Learn_More * See Joomla's core features - https://www.joomla.org/core-features.html - * Try out our online demo: https://demo.joomla.org + * Try out our free hosting service: https://launch.joomla.org 4- How to find a Joomla! translation? * Repository of accredited language packs: https://community.joomla.org/translations.html From 846d49d37402b2a271059483688505684de714c2 Mon Sep 17 00:00:00 2001 From: SharkyKZ Date: Fri, 3 Aug 2018 01:29:28 +0300 Subject: [PATCH 46/92] [mod_articles_latest/news] Featured articles not shown (#21336) --- modules/mod_articles_latest/helper.php | 24 +++++++++++++----------- modules/mod_articles_news/helper.php | 24 +++++++++++++----------- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/modules/mod_articles_latest/helper.php b/modules/mod_articles_latest/helper.php index 9cada52b954c5..df64dc7fb7152 100644 --- a/modules/mod_articles_latest/helper.php +++ b/modules/mod_articles_latest/helper.php @@ -84,18 +84,20 @@ public static function getList(&$params) // Filter by language $model->setState('filter.language', $app->getLanguageFilter()); - // Featured switch - switch ($params->get('show_featured')) + // Featured switch + $featured = $params->get('show_featured', ''); + + if ($featured === '') { - case 1 : - $model->setState('filter.featured', 'only'); - break; - case 0 : - $model->setState('filter.featured', 'hide'); - break; - default : - $model->setState('filter.featured', 'show'); - break; + $model->setState('filter.featured', 'show'); + } + elseif ($featured) + { + $model->setState('filter.featured', 'only'); + } + else + { + $model->setState('filter.featured', 'hide'); } // Set ordering diff --git a/modules/mod_articles_news/helper.php b/modules/mod_articles_news/helper.php index a296564c9f18a..05e29e9edac16 100644 --- a/modules/mod_articles_news/helper.php +++ b/modules/mod_articles_news/helper.php @@ -61,18 +61,20 @@ public static function getList(&$params) // Filer by tag $model->setState('filter.tag', $params->get('tag', array())); - // Featured switch - switch ($params->get('show_featured')) + // Featured switch + $featured = $params->get('show_featured', ''); + + if ($featured === '') + { + $model->setState('filter.featured', 'show'); + } + elseif ($featured) + { + $model->setState('filter.featured', 'only'); + } + else { - case 1 : - $model->setState('filter.featured', 'only'); - break; - case 0 : - $model->setState('filter.featured', 'hide'); - break; - default : - $model->setState('filter.featured', 'show'); - break; + $model->setState('filter.featured', 'hide'); } // Set ordering From c9e2fa9ce73892093685679392d45e4875d57663 Mon Sep 17 00:00:00 2001 From: SharkyKZ Date: Fri, 3 Aug 2018 01:30:36 +0300 Subject: [PATCH 47/92] [com_content] Redundant access check (#21169) * [com_content] Redundant access check * Cleanup * Cleanup --- .../com_content/models/articles.php | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/administrator/components/com_content/models/articles.php b/administrator/components/com_content/models/articles.php index c38c16b5d5293..da7662560ff36 100644 --- a/administrator/components/com_content/models/articles.php +++ b/administrator/components/com_content/models/articles.php @@ -409,33 +409,4 @@ public function getAuthors() // Return the result return $db->loadObjectList(); } - - /** - * Method to get a list of articles. - * Overridden to add a check for access levels. - * - * @return mixed An array of data items on success, false on failure. - * - * @since 1.6.1 - */ - public function getItems() - { - $items = parent::getItems(); - - if (JFactory::getApplication()->isClient('site')) - { - $groups = JFactory::getUser()->getAuthorisedViewLevels(); - - foreach (array_keys($items) as $x) - { - // Check the access level. Remove articles the user shouldn't see - if (!in_array($items[$x]->access, $groups)) - { - unset($items[$x]); - } - } - } - - return $items; - } } From 5bd30908c62df57c51d88603c7b0416537147494 Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Thu, 2 Aug 2018 17:30:58 -0500 Subject: [PATCH 48/92] Exclude components in discover state from list (Replaces #12469) (#21010) * Update recaptcha.php * Update recaptcha.php Changing load order and adding a comment. Proposed by @piotr-cz * Simple CS for travis * Update helper.php Exclude components in discover state from list * Update helper.php Prevent disabled extensions "enabled = 0" * Update helper.php --- libraries/src/Component/ComponentHelper.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/src/Component/ComponentHelper.php b/libraries/src/Component/ComponentHelper.php index 9baa593d5cf56..9009617e88ba1 100644 --- a/libraries/src/Component/ComponentHelper.php +++ b/libraries/src/Component/ComponentHelper.php @@ -417,7 +417,9 @@ protected static function load($option) $query = $db->getQuery(true) ->select($db->quoteName(array('extension_id', 'element', 'params', 'enabled'), array('id', 'option', null, null))) ->from($db->quoteName('#__extensions')) - ->where($db->quoteName('type') . ' = ' . $db->quote('component')); + ->where($db->quoteName('type') . ' = ' . $db->quote('component')) + ->where($db->quoteName('state') . ' = 0') + ->where($db->quoteName('enabled') . ' = 1'); $db->setQuery($query); return $db->loadObjectList('option', '\JComponentRecord'); From 59a67c0511c5b89433f445b01bfb417410664fa1 Mon Sep 17 00:00:00 2001 From: Elijah Madden Date: Fri, 3 Aug 2018 07:34:58 +0900 Subject: [PATCH 49/92] Fix minicolor initialization in subforms. etc. (#12994) --- layouts/joomla/form/field/color/advanced.php | 20 +++++++++-- media/system/js/color-field-adv-init.js | 36 ++++++++++---------- media/system/js/color-field-adv-init.min.js | 3 +- media/system/js/subform-repeatable.js | 3 +- 4 files changed, 39 insertions(+), 23 deletions(-) diff --git a/layouts/joomla/form/field/color/advanced.php b/layouts/joomla/form/field/color/advanced.php index 4be8a9d1f963b..5321ebd94ca4c 100644 --- a/layouts/joomla/form/field/color/advanced.php +++ b/layouts/joomla/form/field/color/advanced.php @@ -63,7 +63,7 @@ $validate = $validate ? ' data-validate="' . $validate . '"' : ''; $disabled = $disabled ? ' disabled' : ''; $readonly = $readonly ? ' readonly' : ''; -$hint = strlen($hint) ? ' placeholder="' . htmlspecialchars($hint, ENT_COMPAT, 'UTF-8') . '"' : ' placeholder="' . $placeholder . '"'; +$hint = strlen($hint) ? ' placeholder="' . $this->escape($hint) . '"' : ' placeholder="' . $placeholder . '"'; $autocomplete = ! $autocomplete ? ' autocomplete="off"' : ''; // Force LTR input value in RTL, due to display issues with rgba/hex colors @@ -76,5 +76,19 @@ JHtml::_('stylesheet', 'jui/jquery.minicolors.css', array('version' => 'auto', 'relative' => true)); JHtml::_('script', 'system/color-field-adv-init.min.js', array('version' => 'auto', 'relative' => true)); ?> -/> +/> diff --git a/media/system/js/color-field-adv-init.js b/media/system/js/color-field-adv-init.js index 8bf87ac9e57e5..5759b2d4a534f 100644 --- a/media/system/js/color-field-adv-init.js +++ b/media/system/js/color-field-adv-init.js @@ -1,23 +1,23 @@ -jQuery(document).ready(function ($){ +jQuery(function ($){ + initMinicolors(); + $('body').on('subform-row-add', initMinicolors); + + function initMinicolors(event, container) + { + container = container || document; + + $(container).find('.minicolors').each(function() { + var $this = $(this); + var format = $this.data('validate') === 'color' ? 'hex' : $this.data('format') || 'hex'; - function initMinicolors(event, container) { - $(container || document).find('.minicolors').each(function() { - $(this).minicolors({ - control: $(this).attr('data-control') || 'hue', - format: $(this).attr('data-validate') === 'color' - ? 'hex' - : ($(this).attr('data-format') === 'rgba' - ? 'rgb' - : $(this).attr('data-format')) - || 'hex', - keywords: $(this).attr('data-keywords') || '', - opacity: $(this).attr('data-format') === 'rgba' ? true : false || false, - position: $(this).attr('data-position') || 'default', - theme: 'bootstrap' + $this.minicolors({ + control: $this.data('control') || 'hue', + format: format === 'rgba' ? 'rgb' : format, + keywords: $this.data('keywords') || '', + opacity: format === 'rgba', + position: $this.data('position') || 'default', + theme: $this.data('theme') || 'bootstrap', }); }); } - - initMinicolors(); - $(document).on('subform-row-add', initMinicolors); }); diff --git a/media/system/js/color-field-adv-init.min.js b/media/system/js/color-field-adv-init.min.js index 62b5fc62e0e00..abc962094e8b6 100644 --- a/media/system/js/color-field-adv-init.min.js +++ b/media/system/js/color-field-adv-init.min.js @@ -1 +1,2 @@ -jQuery(document).ready(function($){function initMinicolors(event,container){$(container||document).find(".minicolors").each(function(){$(this).minicolors({control:$(this).attr("data-control")||"hue",format:$(this).attr("data-validate")==="color"?"hex":($(this).attr("data-format")==="rgba"?"rgb":$(this).attr("data-format"))||"hex",keywords:$(this).attr("data-keywords")||"",opacity:$(this).attr("data-format")==="rgba"?true:false||false,position:$(this).attr("data-position")||"default",theme:"bootstrap"})})}initMinicolors();$(document).on("subform-row-add",initMinicolors)}); \ No newline at end of file +jQuery((function(o){function a(a,t){t=t||document,o(t).find(".minicolors").each((function(){var a=o(this),t="color"===a.data("validate")?"hex":a.data("format")||"hex";a.minicolors({control:a.data("control")||"hue",format:"rgba"===t?"rgb":t,keywords:a.data("keywords")||"",opacity:"rgba"===t,position:a.data("position")||"default",theme:a.data("theme")||"bootstrap"})}))}a(),o("body").on("subform-row-add",a)})); + diff --git a/media/system/js/subform-repeatable.js b/media/system/js/subform-repeatable.js index 09bb5adc3f366..0c7159a20c657 100644 --- a/media/system/js/subform-repeatable.js +++ b/media/system/js/subform-repeatable.js @@ -1 +1,2 @@ -!function(w){"use strict";w.subformRepeatable=function(e,t){if(this.$container=w(e),this.$container.data("subformRepeatable"))return a;this.$container.data("subformRepeatable",a),this.options=w.extend({},w.subformRepeatable.defaults,t),this.template="",this.prepareTemplate(),this.$containerRows=this.options.rowsContainer?this.$container.find(this.options.rowsContainer):this.$container,this.lastRowNum=this.$containerRows.find(this.options.repeatableElement).length;var a=this;this.$container.on("click",this.options.btAdd,function(e){e.preventDefault();var t=w(this).parents(a.options.repeatableElement);t.length||(t=null),a.addRow(t)}),this.$container.on("click",this.options.btRemove,function(e){e.preventDefault();var t=w(this).parents(a.options.repeatableElement);a.removeRow(t)}),this.options.btMove&&this.$containerRows.sortable({items:this.options.repeatableElement,handle:this.options.btMove,tolerance:"pointer"}),this.$container.trigger("subform-ready")},w.subformRepeatable.prototype.prepareTemplate=function(){if(this.options.rowTemplateSelector){var e=this.$container.find(this.options.rowTemplateSelector)[0]||{};this.template=w.trim(e.text||e.textContent)}else{var t=this.$container.find(this.options.repeatableElement).get(0),a=w(t).clone();try{this.clearScripts(a)}catch(e){window.console&&console.log(e)}this.template=a.prop("outerHTML")}},w.subformRepeatable.prototype.addRow=function(e){var t=this.$containerRows.find(this.options.repeatableElement).length;if(t>=this.options.maximum)return null;var a=w.parseHTML(this.template);e?w(e).after(a):this.$containerRows.append(a);var o=w(a);o.attr("data-new","true"),this.fixUniqueAttributes(o,t);try{this.fixScripts(o)}catch(e){window.console&&console.log(e)}return this.$container.trigger("subform-row-add",o),o},w.subformRepeatable.prototype.removeRow=function(e){this.$containerRows.find(this.options.repeatableElement).length<=this.options.minimum||(this.$container.trigger("subform-row-remove",e),e.remove())},w.subformRepeatable.prototype.fixUniqueAttributes=function(e,t){var a=e.attr("data-group"),o=e.attr("data-base-name"),r=(t=t||0,Math.max(this.lastRowNum,t)),i=o+r;this.lastRowNum=r+1,e.attr("data-group",i);for(var n=e.find("[name]"),s={},l=0,p=n.length;l=this.options.maximum)return null;var a=w.parseHTML(this.template);e?w(e).after(a):this.$containerRows.append(a);var o=w(a);o.attr("data-new","true"),this.fixUniqueAttributes(o,t);try{this.fixScripts(o)}catch(e){window.console&&console.log(e)}return this.$container.trigger("subform-row-add",o),o},w.subformRepeatable.prototype.removeRow=function(e){this.$containerRows.find(this.options.repeatableElement).length<=this.options.minimum||(this.$container.trigger("subform-row-remove",e),e.remove())},w.subformRepeatable.prototype.fixUniqueAttributes=function(e,t){var a=e.attr("data-group"),o=e.attr("data-base-name"),r=(t=t||0,Math.max(this.lastRowNum,t)),i=o+r;this.lastRowNum=r+1,e.attr("data-group",i);for(var n=e.find("[name]"),s={},l=0,p=n.length;l Date: Fri, 3 Aug 2018 12:26:34 +0200 Subject: [PATCH 50/92] Create CODE_OF_CONDUCT.md (#21383) Added our Code of Conduct as suggested by GitHub. --- CODE_OF_CONDUCT.md | 62 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000000000..74fe358fc3453 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,62 @@ +# Joomla Contributor Covenant Code of Conduct + +This document outlines the Code of Conduct for all persons volunteering their service to the Joomla Project and/or Open Source Matters. It covers your behaviour as a member of the Joomla community, in any forum, mailing list, Wiki, Web site, IRC channel, install-fest, public meeting or private correspondence. + +If you cannot agree to any of these principles, then volunteering in the Joomla Project is not for you. Contributing to our community assumes acceptance of these principles: +## Be Considerate + +You are working with others as a team so be considerate of how your actions or contribution affects your colleagues and the community as a whole. +## Be Respectful + +Treat one another and members of the community with respect. Everyone can make a valuable contribution to Joomla. We may not always agree, but disagreement is no excuse for poor behavior or poor manners. + +We might all experience some frustration now and then, but we cannot allow that frustration to turn into a personal attack. It's important to remember that a community where people feel uncomfortable or threatened is not a productive one. We expect the members of Joomla community to be respectful when dealing with other volunteers as well as with people from outside projects and initiatives and with users. + +Avoid becoming involved in flame wars, trolling, personal attacks, and repetitive arguments. Take the matters "outside" (off-list, etc) if it helps resolve the situation, and do not use communal methods of communication to be a vehicle for your private "wall of shame." +## Be Collaborative + +Joomla is free software and about collaboration and working together. Collaboration reduces redundancy of work done in the free software world, and improves the quality of the software produced regardless of whether you are writing code or performing some other task. + +When you disagree, consult others. Disagreements, both political and technical, happen all the time, and Joomla is no exception. Disagreement, debate and constructive criticism is often how progress is made and are a necessary part of doing complex work in a team. + +The important goal is not to avoid disagreements or differing views but to resolve them constructively. Above all, avoid making conflicts about the work into personal conflicts. Debate should never include reference to someone's nationality, gender, religion or other personal characteristics. + +You should turn to the community and to the community process to seek advice and to resolve disagreements. Team leaders and Department Coordinators are able to help you figure out which direction will be most acceptable. + +When you are unsure, ask for help. Nobody knows everything and nobody is expected to be perfect. Asking questions avoids many problems down the road and so questions are encouraged. Those who are asked should be responsive and helpful. However, when asking a question, care must be taken to do so in an appropriate forum. Off-topic questions, such as requests for help on a development mailing list, detract from productive discussion. +## Step Down Considerately + +People on every project come and go, and Joomla is no different. When you leave or disengage from the community, in whole or in part, we ask that you do so in a way that minimizes disruption to the Project. This means you should tell people you are leaving and take the proper steps to ensure that others can pick up where you leave off. +## Be Available + +Check your e-mails regularly and answer them promptly—even if it's "I'll get back to you." +## Be Honest + +Sometimes the hardest thing to say is "no" or admit you've forgotten do something. Be honest with each other and yourself with regards to what you say and what you can realistically commit to. +## Follow the Rules + +Volunteers are expected to uphold Joomla's licensing and trademark requirements including, but not limited to, compliance on their own or affiliate Web sites and extensions. Make sure you have sought the appropriate approvals for domain name, name and logo usage prior to volunteering and that any extensions you distribute comply with the Joomla license. + +All work contributed to the Project, whether code, documentation or other material, must observe the appropriate licenses as set down by the Core Team and Open Source Matters. + +Some contributors represent the Joomla Project in specific areas, but you should not speak on behalf of the Project or present yourself as an official representative of the Project unless you are specifically authorized to do so, and you should never state your opinions as the official policies of the Project. +## Exercise Discretion and Confidentiality at Appropriate Times + +Depending on your role, you will be privy to various levels of information. As a volunteer you are expected to keep site access details (such as logins, FTP details, etc.) secure at all times. + +Information contained within private forums (for example, about serious security matters, legal cases, or personal details), private mailing lists, chats or other mediums is also to be kept confidential even after you have discontinued your service. Breaches in the area of privacy and confidentiality are taken very seriously by the Project. +## Conflict of Interest + +When using Project resources or making decisions within the board, your department, team, or subteam or the concerning Project's policy positions, you must do so based only based on the best interests of the Project and its user community. If you have a situation or affiliation that might constitute or lead to a conflict of interest or might be perceived by a reasonable person in the community to be a conflict of interest, disclose this to your Team Leaders or the team as a whole. If appropriate, after discussing with your team, you should remove yourself from specific decisions or discussions in which you may have a conflict of interest. +## Conflict Resolution Team + +Should you wish to make a CoC violation report or are facing a conflict that has failed to be resolved in the manner set out in this CoC, please [click here](https://docs.google.com/forms/d/e/1FAIpQLSea_VL9NUvUM3iX-gptNuJe5oz5-jp9y5Y4v9ZyKImblfYTcQ/viewform) to access the report form. +## The Fine Print + +Members of the board of Open Source Matters are governed by additional guidelines and requirements and, where a conflict exists, these take precedence over this Code of Conduct. +## The Last Bit + +This Code of Conduct has changed over time and will continue to develop, but was originally derived, with permission, from the Ubuntu CoC. + +Last Updated 8th of June 2017 +Online version of this document is available at https://www.joomla.org/about-joomla/the-project/code-of-conduct.html From 2661b84d44aef36abeba280a0645b0e06f467fd1 Mon Sep 17 00:00:00 2001 From: Luca Marzo Date: Fri, 3 Aug 2018 13:52:48 +0200 Subject: [PATCH 51/92] Removing CODE_OF_CONDUCT (#21385) As requested in https://github.com/joomla/joomla-cms/pull/21383 --- build/build.php | 1 + 1 file changed, 1 insertion(+) diff --git a/build/build.php b/build/build.php index 945745503ef70..70a7406497d07 100644 --- a/build/build.php +++ b/build/build.php @@ -171,6 +171,7 @@ function usage($command) 'jenkins-phpunit.xml', 'RoboFile.php', 'RoboFile.dist.ini', + 'CODE_OF_CONDUCT.md', // Remove the testing sample data from all packages 'installation/sql/mysql/sample_testing.sql', 'installation/sql/postgresql/sample_testing.sql', From cc4df754e657684b546485b593666742d64c43fe Mon Sep 17 00:00:00 2001 From: Brian Teeman Date: Fri, 3 Aug 2018 13:22:43 +0100 Subject: [PATCH 52/92] CoC Fix the english (#21386) --- CODE_OF_CONDUCT.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 74fe358fc3453..990fc7493fc7f 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -47,7 +47,7 @@ Depending on your role, you will be privy to various levels of information. As a Information contained within private forums (for example, about serious security matters, legal cases, or personal details), private mailing lists, chats or other mediums is also to be kept confidential even after you have discontinued your service. Breaches in the area of privacy and confidentiality are taken very seriously by the Project. ## Conflict of Interest -When using Project resources or making decisions within the board, your department, team, or subteam or the concerning Project's policy positions, you must do so based only based on the best interests of the Project and its user community. If you have a situation or affiliation that might constitute or lead to a conflict of interest or might be perceived by a reasonable person in the community to be a conflict of interest, disclose this to your Team Leaders or the team as a whole. If appropriate, after discussing with your team, you should remove yourself from specific decisions or discussions in which you may have a conflict of interest. +When using Project resources or making decisions within the board, your department, team, or subteam or the concerning Project's policy positions, you must do so based only on the best interests of the Project and its user community. If you have a situation or affiliation that might constitute or lead to a conflict of interest or might be perceived by a reasonable person in the community to be a conflict of interest, disclose this to your Team Leaders or the team as a whole. If appropriate, after discussing with your team, you should remove yourself from specific decisions or discussions in which you may have a conflict of interest. ## Conflict Resolution Team Should you wish to make a CoC violation report or are facing a conflict that has failed to be resolved in the manner set out in this CoC, please [click here](https://docs.google.com/forms/d/e/1FAIpQLSea_VL9NUvUM3iX-gptNuJe5oz5-jp9y5Y4v9ZyKImblfYTcQ/viewform) to access the report form. From 1f6d87a85edf3394c0dab9fa1df3247468e6963d Mon Sep 17 00:00:00 2001 From: Brian Teeman Date: Fri, 3 Aug 2018 18:04:16 +0100 Subject: [PATCH 53/92] Readme (#21393) Removes link to jenkins that is no longer used --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6bd831639e991..1a8d352ac4778 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,9 @@ Joomla! CMS™ [![Analytics](https://ga-beacon.appspot.com/UA-544070-3/joomla-cm Build Status --------------------- -| Travis-CI | Drone-CI | AppVeyor | Jenkins | -| ------------- | ------------- | ------------- | ------------- | -| [![Build Status](https://travis-ci.org/joomla/joomla-cms.svg?branch=staging)](https://travis-ci.org/joomla/joomla-cms) | [![Build Status](http://213.160.72.75/api/badges/joomla/joomla-cms/status.svg)](http://213.160.72.75/joomla/joomla-cms) | [![Build status](https://ci.appveyor.com/api/projects/status/bpcxulw6nnxlv8kb/branch/staging?svg=true)](https://ci.appveyor.com/project/joomla/joomla-cms) | [![Build Status](http://build.joomla.org/job/cms/badge/icon)](http://build.joomla.org/job/cms/) | +| Travis-CI | Drone-CI | AppVeyor | +| ------------- | ------------- | ------------- | +| [![Build Status](https://travis-ci.org/joomla/joomla-cms.svg?branch=staging)](https://travis-ci.org/joomla/joomla-cms) | [![Build Status](http://213.160.72.75/api/badges/joomla/joomla-cms/status.svg)](http://213.160.72.75/joomla/joomla-cms) | [![Build status](https://ci.appveyor.com/api/projects/status/bpcxulw6nnxlv8kb/branch/staging?svg=true)](https://ci.appveyor.com/project/joomla/joomla-cms) | What is this? --------------------- From 8bacca95c2247a91230e56ae2d4a96a98e1ca0dc Mon Sep 17 00:00:00 2001 From: infograf768 Date: Sat, 4 Aug 2018 15:29:49 +0000 Subject: [PATCH 54/92] [New Feature] Multilingual: Propagating existing associations if desired (#21321) * [New Feature] Multilingual: Propagating existing associations if desired * cs * lang change * Change and add new messages * lang changes * Small corrections without effect on resulting funtionnality * using new API for token * modifying js function to use Joomla. instead of window. --- .../com_categories/controllers/ajax.json.php | 88 +++++++++++++++++ .../com_categories/models/category.php | 1 + .../models/fields/modal/category.php | 32 +++++- .../com_contact/controllers/ajax.json.php | 87 ++++++++++++++++ .../components/com_contact/models/contact.php | 1 + .../models/fields/modal/contact.php | 32 +++++- .../com_content/controllers/ajax.json.php | 86 ++++++++++++++++ .../components/com_content/models/article.php | 1 + .../models/fields/modal/article.php | 32 +++++- .../com_menus/controllers/ajax.json.php | 88 +++++++++++++++++ .../com_menus/models/fields/modal/menu.php | 35 +++++++ .../components/com_menus/models/item.php | 1 + .../com_newsfeeds/controllers/ajax.json.php | 87 ++++++++++++++++ .../models/fields/modal/newsfeed.php | 32 +++++- .../com_newsfeeds/models/newsfeed.php | 1 + administrator/language/en-GB/en-GB.ini | 8 +- .../js/associations-edit-uncompressed.js | 98 +++++++++++++++++++ media/system/js/associations-edit.js | 2 +- media/system/js/modal-fields-uncompressed.js | 10 +- media/system/js/modal-fields.js | 2 +- 20 files changed, 704 insertions(+), 20 deletions(-) create mode 100644 administrator/components/com_categories/controllers/ajax.json.php create mode 100644 administrator/components/com_contact/controllers/ajax.json.php create mode 100644 administrator/components/com_content/controllers/ajax.json.php create mode 100644 administrator/components/com_menus/controllers/ajax.json.php create mode 100644 administrator/components/com_newsfeeds/controllers/ajax.json.php diff --git a/administrator/components/com_categories/controllers/ajax.json.php b/administrator/components/com_categories/controllers/ajax.json.php new file mode 100644 index 0000000000000..24f69cc569a94 --- /dev/null +++ b/administrator/components/com_categories/controllers/ajax.json.php @@ -0,0 +1,88 @@ +input; + $extension = $input->get('extension'); + + $assocId = $input->getInt('assocId', 0); + + if ($assocId == 0) + { + echo new JResponseJson(null, JText::sprintf('JLIB_FORM_VALIDATE_FIELD_INVALID', 'assocId'), true); + + return; + } + + $excludeLang = $input->get('excludeLang', '', 'STRING'); + + $associations = JLanguageAssociations::getAssociations($extension, '#__categories', 'com_categories.item', (int) $assocId, 'id', 'alias', ''); + + unset($associations[$excludeLang]); + + // Add the title to each of the associated records + JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_categories/tables'); + $categoryTable = JTable::getInstance('Category', 'JTable'); + + foreach ($associations as $lang => $association) + { + $categoryTable->load($association->id); + $associations[$lang]->title = $categoryTable->title; + } + + $countContentLanguages = count(LanguageHelper::getContentLanguages(array(0, 1))); + + if (count($associations) == 0) + { + $message = JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_NONE'); + } + elseif ($countContentLanguages > count($associations) + 2) + { + $tags = implode(', ', array_keys($associations)); + $message = JText::sprintf('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_SOME', $tags); + } + else + { + $message = JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_ALL'); + } + + echo new JResponseJson($associations, $message); + } + } +} diff --git a/administrator/components/com_categories/models/category.php b/administrator/components/com_categories/models/category.php index 458b01eb22740..ae048938ec937 100644 --- a/administrator/components/com_categories/models/category.php +++ b/administrator/components/com_categories/models/category.php @@ -455,6 +455,7 @@ protected function preprocessForm(JForm $form, $data, $group = 'content') $field->addAttribute('new', 'true'); $field->addAttribute('edit', 'true'); $field->addAttribute('clear', 'true'); + $field->addAttribute('propagate', 'true'); } $form->load($addform, false); diff --git a/administrator/components/com_categories/models/fields/modal/category.php b/administrator/components/com_categories/models/fields/modal/category.php index 0b77986150697..5bef5ec0ae392 100644 --- a/administrator/components/com_categories/models/fields/modal/category.php +++ b/administrator/components/com_categories/models/fields/modal/category.php @@ -9,6 +9,8 @@ defined('JPATH_BASE') or die; +use Joomla\CMS\Language\LanguageHelper; + /** * Supports a modal category picker. * @@ -42,10 +44,13 @@ protected function getInput() $extension = (string) JFactory::getApplication()->input->get('extension', 'com_content'); } - $allowNew = ((string) $this->element['new'] == 'true'); - $allowEdit = ((string) $this->element['edit'] == 'true'); - $allowClear = ((string) $this->element['clear'] != 'false'); - $allowSelect = ((string) $this->element['select'] != 'false'); + $allowNew = ((string) $this->element['new'] == 'true'); + $allowEdit = ((string) $this->element['edit'] == 'true'); + $allowClear = ((string) $this->element['clear'] != 'false'); + $allowSelect = ((string) $this->element['select'] != 'false'); + $allowPropagate = ((string) $this->element['propagate'] == 'true'); + + $languages = LanguageHelper::getContentLanguages(array(0, 1)); // Load language. JFactory::getLanguage()->load('com_categories', JPATH_ADMINISTRATOR); @@ -78,6 +83,8 @@ function jSelectCategory_" . $this->id . "(id, title, object) { } "); + JText::script('JGLOBAL_ASSOCIATIONS_PROPAGATE_FAILED'); + $scriptSelect[$this->id] = true; } } @@ -179,6 +186,23 @@ function jSelectCategory_" . $this->id . "(id, title, object) { . ''; } + // Propagate category button + if ($allowPropagate && count($languages) > 2) + { + // Strip off language tag at the end + $tagLength = (int) strlen($this->element['language']); + $callbackFunctionStem = substr("jSelectCategory_" . $this->id, 0, -$tagLength); + + $html .= '' + . '' . JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_BUTTON') + . ''; + } + $html .= ''; // Select category modal. diff --git a/administrator/components/com_contact/controllers/ajax.json.php b/administrator/components/com_contact/controllers/ajax.json.php new file mode 100644 index 0000000000000..a832a3c7a9fad --- /dev/null +++ b/administrator/components/com_contact/controllers/ajax.json.php @@ -0,0 +1,87 @@ +input; + + $assocId = $input->getInt('assocId', 0); + + if ($assocId == 0) + { + echo new JResponseJson(null, JText::sprintf('JLIB_FORM_VALIDATE_FIELD_INVALID', 'assocId'), true); + + return; + } + + $excludeLang = $input->get('excludeLang', '', 'STRING'); + + $associations = JLanguageAssociations::getAssociations('com_contact', '#__contact_details', 'com_contact.item', (int) $assocId); + + unset($associations[$excludeLang]); + + // Add the title to each of the associated records + JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_contact/tables'); + $contactTable = JTable::getInstance('Contact', 'ContactTable'); + + foreach ($associations as $lang => $association) + { + $contactTable->load($association->id); + $associations[$lang]->title = $contactTable->name; + } + + $countContentLanguages = count(LanguageHelper::getContentLanguages(array(0, 1))); + + if (count($associations) == 0) + { + $message = JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_NONE'); + } + elseif ($countContentLanguages > count($associations) + 2) + { + $tags = implode(', ', array_keys($associations)); + $message = JText::sprintf('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_SOME', $tags); + } + else + { + $message = JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_ALL'); + } + + echo new JResponseJson($associations, $message); + } + } +} diff --git a/administrator/components/com_contact/models/contact.php b/administrator/components/com_contact/models/contact.php index 936591f4979d9..5c2fbfc0058c6 100644 --- a/administrator/components/com_contact/models/contact.php +++ b/administrator/components/com_contact/models/contact.php @@ -560,6 +560,7 @@ protected function preprocessForm(JForm $form, $data, $group = 'content') $field->addAttribute('new', 'true'); $field->addAttribute('edit', 'true'); $field->addAttribute('clear', 'true'); + $field->addAttribute('propagate', 'true'); } $form->load($addform, false); diff --git a/administrator/components/com_contact/models/fields/modal/contact.php b/administrator/components/com_contact/models/fields/modal/contact.php index e03511d6855c3..a68420170e2c4 100644 --- a/administrator/components/com_contact/models/fields/modal/contact.php +++ b/administrator/components/com_contact/models/fields/modal/contact.php @@ -9,6 +9,8 @@ defined('JPATH_BASE') or die; +use Joomla\CMS\Language\LanguageHelper; + /** * Supports a modal contact picker. * @@ -33,10 +35,13 @@ class JFormFieldModal_Contact extends JFormField */ protected function getInput() { - $allowNew = ((string) $this->element['new'] == 'true'); - $allowEdit = ((string) $this->element['edit'] == 'true'); - $allowClear = ((string) $this->element['clear'] != 'false'); - $allowSelect = ((string) $this->element['select'] != 'false'); + $allowNew = ((string) $this->element['new'] == 'true'); + $allowEdit = ((string) $this->element['edit'] == 'true'); + $allowClear = ((string) $this->element['clear'] != 'false'); + $allowSelect = ((string) $this->element['select'] != 'false'); + $allowPropagate = ((string) $this->element['propagate'] == 'true'); + + $languages = LanguageHelper::getContentLanguages(array(0, 1)); // Load language JFactory::getLanguage()->load('com_contact', JPATH_ADMINISTRATOR); @@ -69,6 +74,8 @@ function jSelectContact_" . $this->id . "(id, title, object) { } "); + JText::script('JGLOBAL_ASSOCIATIONS_PROPAGATE_FAILED'); + $scriptSelect[$this->id] = true; } } @@ -168,6 +175,23 @@ function jSelectContact_" . $this->id . "(id, title, object) { . ''; } + // Propagate contact button + if ($allowPropagate && count($languages) > 2) + { + // Strip off language tag at the end + $tagLength = (int) strlen($this->element['language']); + $callbackFunctionStem = substr("jSelectContact_" . $this->id, 0, -$tagLength); + + $html .= '' + . '' . JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_BUTTON') + . ''; + } + $html .= ''; // Select contact modal diff --git a/administrator/components/com_content/controllers/ajax.json.php b/administrator/components/com_content/controllers/ajax.json.php new file mode 100644 index 0000000000000..0a6385acdcdb5 --- /dev/null +++ b/administrator/components/com_content/controllers/ajax.json.php @@ -0,0 +1,86 @@ +input; + + $assocId = $input->getInt('assocId', 0); + + if ($assocId == 0) + { + echo new JResponseJson(null, JText::sprintf('JLIB_FORM_VALIDATE_FIELD_INVALID', 'assocId'), true); + + return; + } + + $excludeLang = $input->get('excludeLang', '', 'STRING'); + + $associations = JLanguageAssociations::getAssociations('com_content', '#__content', 'com_content.item', (int) $assocId); + + unset($associations[$excludeLang]); + + // Add the title to each of the associated records + $contentTable = JTable::getInstance('Content', 'JTable'); + + foreach ($associations as $lang => $association) + { + $contentTable->load($association->id); + $associations[$lang]->title = $contentTable->title; + } + + $countContentLanguages = count(LanguageHelper::getContentLanguages(array(0, 1))); + + if (count($associations) == 0) + { + $message = JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_NONE'); + } + elseif ($countContentLanguages > count($associations) + 2) + { + $tags = implode(', ', array_keys($associations)); + $message = JText::sprintf('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_SOME', $tags); + } + else + { + $message = JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_ALL'); + } + + echo new JResponseJson($associations, $message); + } + } +} diff --git a/administrator/components/com_content/models/article.php b/administrator/components/com_content/models/article.php index 868182bd67f2e..01ef41113ff76 100644 --- a/administrator/components/com_content/models/article.php +++ b/administrator/components/com_content/models/article.php @@ -913,6 +913,7 @@ protected function preprocessForm(JForm $form, $data, $group = 'content') $field->addAttribute('new', 'true'); $field->addAttribute('edit', 'true'); $field->addAttribute('clear', 'true'); + $field->addAttribute('propagate', 'true'); } $form->load($addform, false); diff --git a/administrator/components/com_content/models/fields/modal/article.php b/administrator/components/com_content/models/fields/modal/article.php index 28934a3cc7131..e8608a3521bd3 100644 --- a/administrator/components/com_content/models/fields/modal/article.php +++ b/administrator/components/com_content/models/fields/modal/article.php @@ -9,6 +9,8 @@ defined('JPATH_BASE') or die; +use Joomla\CMS\Language\LanguageHelper; + /** * Supports a modal article picker. * @@ -33,10 +35,13 @@ class JFormFieldModal_Article extends JFormField */ protected function getInput() { - $allowNew = ((string) $this->element['new'] == 'true'); - $allowEdit = ((string) $this->element['edit'] == 'true'); - $allowClear = ((string) $this->element['clear'] != 'false'); - $allowSelect = ((string) $this->element['select'] != 'false'); + $allowNew = ((string) $this->element['new'] == 'true'); + $allowEdit = ((string) $this->element['edit'] == 'true'); + $allowClear = ((string) $this->element['clear'] != 'false'); + $allowSelect = ((string) $this->element['select'] != 'false'); + $allowPropagate = ((string) $this->element['propagate'] == 'true'); + + $languages = LanguageHelper::getContentLanguages(array(0, 1)); // Load language JFactory::getLanguage()->load('com_content', JPATH_ADMINISTRATOR); @@ -69,6 +74,8 @@ function jSelectArticle_" . $this->id . "(id, title, catid, object, url, languag } "); + JText::script('JGLOBAL_ASSOCIATIONS_PROPAGATE_FAILED'); + $scriptSelect[$this->id] = true; } } @@ -171,6 +178,23 @@ function jSelectArticle_" . $this->id . "(id, title, catid, object, url, languag . ''; } + // Propagate article button + if ($allowPropagate && count($languages) > 2) + { + // Strip off language tag at the end + $tagLength = (int) strlen($this->element['language']); + $callbackFunctionStem = substr("jSelectArticle_" . $this->id, 0, -$tagLength); + + $html .= '' + . '' . JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_BUTTON') + . ''; + } + $html .= ''; // Select article modal diff --git a/administrator/components/com_menus/controllers/ajax.json.php b/administrator/components/com_menus/controllers/ajax.json.php new file mode 100644 index 0000000000000..0b5c4d552fd18 --- /dev/null +++ b/administrator/components/com_menus/controllers/ajax.json.php @@ -0,0 +1,88 @@ +input; + $extension = $input->get('extension'); + + $assocId = $input->getInt('assocId', 0); + + if ($assocId == 0) + { + echo new JResponseJson(null, JText::sprintf('JLIB_FORM_VALIDATE_FIELD_INVALID', 'assocId'), true); + + return; + } + + $excludeLang = $input->get('excludeLang', '', 'STRING'); + + $associations = JLanguageAssociations::getAssociations('com_menus', '#__menu', 'com_menus.item', (int) $assocId, 'id', '', ''); + + unset($associations[$excludeLang]); + + // Add the title to each of the associated records + JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_menus/tables'); + $menuTable = JTable::getInstance('Menu', 'JTable', array()); + + foreach ($associations as $lang => $association) + { + $menuTable->load($association->id); + $associations[$lang]->title = $menuTable->title; + } + + $countContentLanguages = count(LanguageHelper::getContentLanguages(array(0, 1))); + + if (count($associations) == 0) + { + $message = JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_NONE'); + } + elseif ($countContentLanguages > count($associations) + 2) + { + $tags = implode(', ', array_keys($associations)); + $message = JText::sprintf('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_SOME', $tags); + } + else + { + $message = JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_ALL'); + } + + echo new JResponseJson($associations, $message); + } + } +} diff --git a/administrator/components/com_menus/models/fields/modal/menu.php b/administrator/components/com_menus/models/fields/modal/menu.php index 58c5ed4d17f22..7f1bc95f95f0f 100644 --- a/administrator/components/com_menus/models/fields/modal/menu.php +++ b/administrator/components/com_menus/models/fields/modal/menu.php @@ -8,6 +8,9 @@ */ defined('JPATH_BASE') or die; + +use Joomla\CMS\Language\LanguageHelper; + JHtml::_('bootstrap.tooltip', '.hasTooltip'); /** @@ -57,6 +60,14 @@ class JFormFieldModal_Menu extends JFormField */ protected $allowEdit = false; + /** + * Determinate, if the propagate button is shown + * + * @var boolean + * @since __DEPLOY_VERSION__ + */ + protected $allowPropagate = false; + /** * Method to get certain otherwise inaccessible properties from the form field object. * @@ -74,6 +85,7 @@ public function __get($name) case 'allowClear': case 'allowNew': case 'allowEdit': + case 'allowPropagate': return $this->$name; } @@ -98,6 +110,7 @@ public function __set($name, $value) case 'allowClear': case 'allowNew': case 'allowEdit': + case 'allowPropagate': $value = (string) $value; $this->$name = !($value === 'false' || $value === 'off' || $value === '0'); break; @@ -131,6 +144,7 @@ public function setup(SimpleXMLElement $element, $value, $group = null) $this->allowClear = ((string) $this->element['clear']) !== 'false'; $this->allowNew = ((string) $this->element['new']) === 'true'; $this->allowEdit = ((string) $this->element['edit']) === 'true'; + $this->allowPropagate = ((string) $this->element['propagate']) === 'true'; } return $return; @@ -146,6 +160,7 @@ public function setup(SimpleXMLElement $element, $value, $group = null) protected function getInput() { $clientId = (int) $this->element['clientid']; + $languages = LanguageHelper::getContentLanguages(array(0, 1)); // Load language JFactory::getLanguage()->load('com_menus', JPATH_ADMINISTRATOR); @@ -179,6 +194,8 @@ function jSelectMenu_" . $this->id . "(id, title, object) { " ); + JText::script('JGLOBAL_ASSOCIATIONS_PROPAGATE_FAILED'); + $scriptSelect[$this->id] = true; } } @@ -293,8 +310,26 @@ function jSelectMenu_" . $this->id . "(id, title, object) { . ''; } + // Propagate menu item button + if ($this->allowPropagate && count($languages) > 2) + { + // Strip off language tag at the end + $tagLength = (int) strlen($this->element['language']); + $callbackFunctionStem = substr("jSelectMenu_" . $this->id, 0, -$tagLength); + + $html .= '' + . '' . JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_BUTTON') + . ''; + } + $html .= ''; + // Select menu item modal if ($this->allowSelect) { diff --git a/administrator/components/com_menus/models/item.php b/administrator/components/com_menus/models/item.php index 0a131deefce75..98cb5a00c23be 100644 --- a/administrator/components/com_menus/models/item.php +++ b/administrator/components/com_menus/models/item.php @@ -1242,6 +1242,7 @@ protected function preprocessForm(JForm $form, $data, $group = 'content') $field->addAttribute('new', 'true'); $field->addAttribute('edit', 'true'); $field->addAttribute('clear', 'true'); + $field->addAttribute('propagate', 'true'); $option = $field->addChild('option', 'COM_MENUS_ITEM_FIELD_ASSOCIATION_NO_VALUE'); $option->addAttribute('value', ''); } diff --git a/administrator/components/com_newsfeeds/controllers/ajax.json.php b/administrator/components/com_newsfeeds/controllers/ajax.json.php new file mode 100644 index 0000000000000..f9107ed0fe360 --- /dev/null +++ b/administrator/components/com_newsfeeds/controllers/ajax.json.php @@ -0,0 +1,87 @@ +input; + + $assocId = $input->getInt('assocId', 0); + + if ($assocId == 0) + { + echo new JResponseJson(null, JText::sprintf('JLIB_FORM_VALIDATE_FIELD_INVALID', 'assocId'), true); + + return; + } + + $excludeLang = $input->get('excludeLang', '', 'STRING'); + + $associations = JLanguageAssociations::getAssociations('com_newsfeeds', '#__newsfeeds', 'com_newsfeeds.item', (int) $assocId); + + unset($associations[$excludeLang]); + + // Add the title to each of the associated records + JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_newsfeeds/tables'); + $newsfeedsTable = JTable::getInstance('Newsfeed', 'NewsfeedsTable'); + + foreach ($associations as $lang => $association) + { + $newsfeedsTable->load($association->id); + $associations[$lang]->title = $newsfeedsTable->name; + } + + $countContentLanguages = count(LanguageHelper::getContentLanguages(array(0, 1))); + + if (count($associations) == 0) + { + $message = JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_NONE'); + } + elseif ($countContentLanguages > count($associations) + 2) + { + $tags = implode(', ', array_keys($associations)); + $message = JText::sprintf('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_SOME', $tags); + } + else + { + $message = JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_ALL'); + } + + echo new JResponseJson($associations, $message); + } + } +} diff --git a/administrator/components/com_newsfeeds/models/fields/modal/newsfeed.php b/administrator/components/com_newsfeeds/models/fields/modal/newsfeed.php index 050c040bbf7bc..a4056f4b613f7 100644 --- a/administrator/components/com_newsfeeds/models/fields/modal/newsfeed.php +++ b/administrator/components/com_newsfeeds/models/fields/modal/newsfeed.php @@ -9,6 +9,8 @@ defined('JPATH_BASE') or die; +use Joomla\CMS\Language\LanguageHelper; + /** * Supports a modal newsfeeds picker. * @@ -33,10 +35,13 @@ class JFormFieldModal_Newsfeed extends JFormField */ protected function getInput() { - $allowNew = ((string) $this->element['new'] == 'true'); - $allowEdit = ((string) $this->element['edit'] == 'true'); - $allowClear = ((string) $this->element['clear'] != 'false'); - $allowSelect = ((string) $this->element['select'] != 'false'); + $allowNew = ((string) $this->element['new'] == 'true'); + $allowEdit = ((string) $this->element['edit'] == 'true'); + $allowClear = ((string) $this->element['clear'] != 'false'); + $allowSelect = ((string) $this->element['select'] != 'false'); + $allowPropagate = ((string) $this->element['propagate'] == 'true'); + + $languages = LanguageHelper::getContentLanguages(array(0, 1)); // Load language JFactory::getLanguage()->load('com_newsfeeds', JPATH_ADMINISTRATOR); @@ -70,6 +75,8 @@ function jSelectNewsfeed_" . $this->id . "(id, title, object) { " ); + JText::script('JGLOBAL_ASSOCIATIONS_PROPAGATE_FAILED'); + $scriptSelect[$this->id] = true; } } @@ -169,6 +176,23 @@ function jSelectNewsfeed_" . $this->id . "(id, title, object) { . ''; } + // Propagate newsfeed button + if ($allowPropagate && count($languages) > 2) + { + // Strip off language tag at the end + $tagLength = (int) strlen($this->element['language']); + $callbackFunctionStem = substr("jSelectNewsfeed_" . $this->id, 0, -$tagLength); + + $html .= '' + . '' . JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_BUTTON') + . ''; + } + $html .= ''; // Select newsfeed modal diff --git a/administrator/components/com_newsfeeds/models/newsfeed.php b/administrator/components/com_newsfeeds/models/newsfeed.php index 97ee58633890d..9e6da29806f46 100644 --- a/administrator/components/com_newsfeeds/models/newsfeed.php +++ b/administrator/components/com_newsfeeds/models/newsfeed.php @@ -536,6 +536,7 @@ protected function preprocessForm(JForm $form, $data, $group = 'content') $field->addAttribute('new', 'true'); $field->addAttribute('edit', 'true'); $field->addAttribute('clear', 'true'); + $field->addAttribute('propagate', 'true'); } $form->load($addform, false); diff --git a/administrator/language/en-GB/en-GB.ini b/administrator/language/en-GB/en-GB.ini index 2942c6c28820d..1f8647e459f13 100644 --- a/administrator/language/en-GB/en-GB.ini +++ b/administrator/language/en-GB/en-GB.ini @@ -108,7 +108,7 @@ JPUBLISHED="Published" JRECORD_NUMBER="Record Number" JREGISTER="Register" JORDERINGDISABLED="Please sort by order to enable reordering" - +JPROPAGATE="Propagate" JSAVE="Save & Close" JSELECT="Select" JSTATUS="Status" @@ -281,6 +281,12 @@ JGLOBAL_ARTICLE_ORDER_DESC="The order that articles will show in." JGLOBAL_ARTICLE_ORDER_LABEL="Article Order" JGLOBAL_ARTICLES="Articles" JGLOBAL_ASSOC_NOT_POSSIBLE="To define associations, please make sure the item language is not set to 'All'." +JGLOBAL_ASSOCIATIONS_PROPAGATE_BUTTON="Propagate" +JGLOBAL_ASSOCIATIONS_PROPAGATE_FAILED="Failed propagating associations. You may have to select or create them manually." +JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_ALL="All existing associations have been set." +JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_NONE="No associations exist to propagate." +JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_SOME="Associations have been set for: %s" +JGLOBAL_ASSOCIATIONS_PROPAGATE_TIP="Propagates this item's existing associations." JGLOBAL_ASSOCIATIONS_RESET_WARNING="The language has been changed. If you save this item again it will reset the available associations. If this was not intended, close the item." JGLOBAL_AUTH_ACCESS_DENIED="Access Denied" JGLOBAL_AUTH_ACCESS_GRANTED="Access Granted" diff --git a/media/system/js/associations-edit-uncompressed.js b/media/system/js/associations-edit-uncompressed.js index 08257989a4963..6961791ba7f6d 100644 --- a/media/system/js/associations-edit-uncompressed.js +++ b/media/system/js/associations-edit-uncompressed.js @@ -30,6 +30,104 @@ window.showAssociationMessage = function() jQuery('#associations').prepend('
      ' + Joomla.JText._('JGLOBAL_ASSOC_NOT_POSSIBLE') + '
      '); } + /** + * Inject associations into other association fields + * + * This function is called whenever the Ajax request within propagateAssociation() completes successfully. + * Its purpose is to inject the associations which have been returned in the Ajax response into the other + * association fields in the form. + * It does this by invoking the various callback functions of those association fields (i.e. the function which + * gets called whenever the administrator selects an association via the modal), and passing the appropriate + * associated record details. + * + * @param js object result The response from the Ajax request. + * Its structure is that generated by the JResponseJson class, + * with the data field containing the associations + * @param string fieldPrefix The stem of the html ids for the elements comprising the modal field + * @param string callbackFunctionPrefix The name of the callback function which the modal window uses to set the + * selected item as the association, but minus the language tag at the end + * + * @return boolean + * + * @since __DEPLOY_VERSION__ + */ + Joomla.injectAssociations = function(result, callbackFunctionPrefix) + { + var functionName; + + if (result.success) + { + if (result.data.length !== 0) + { + for (var lang in result.data) + { + functionName = callbackFunctionPrefix + lang.replace("-","_"); + + window[functionName](result.data[lang].id, result.data[lang].title, result.data[lang].catid, null, null, lang); + } + } + + if (result.message) + { + Joomla.renderMessages({"notice":[result.message]}); + } + } + else + { + Joomla.renderMessages({"warning":[(Joomla.JText._('JGLOBAL_ASSOCIATIONS_PROPAGATE_FAILED'))]}); + } + } + + /** + * Propagate associations from this field into other association fields + * + * This function is called whenever an administrator populates an association (in the association modal field) + * and then clicks on the Propagate button. + * The purpose of this function is to find what other records (if any) are associated with the one which the + * administrator has selected, and populate the other association fields with these records. (Otherwise, if the + * administrator just clicks on Save without clicking on Propagate, those other associations will be deleted). + * It does this by finding the id of the selected associated record (from a hidden field) and makes an Ajax call + * to the server to find the other associations, also passing up the language of the record currently being edited, + * as it should be excluded. + * Once it has received from the server the other associations it calls injectAssociations to inject them into + * the other association fields within the form. + * + * @param string fieldPrefix The stem of the html ids for the elements comprising the modal field + * @param string callbackFunctionPrefix The name of the callback function which the modal window uses to set the + * selected item as the association, but minus the language tag at the end + * + * @return boolean + * + * @since __DEPLOY_VERSION__ + */ + Joomla.propagateAssociation = function(fieldPrefix, callbackFunctionPrefix) + { + // Find the id of the record which has been set as an assocation + var assocId = jQuery("#" + fieldPrefix + "_id").val(); + + // Find the language of the record being edited + var currentLang = jQuery('#jform_language').find(":selected").val(); + + // Find the token so that it can be sent in the Ajax request as well + var token = Joomla.getOptions('csrf.token', ''); + + // Find the action url associated with the form - we need to add the token to this + var url = jQuery("form[name='adminForm']").attr("action"); + url += '&' + token + '=1'; + + jQuery.ajax( + { + url: url, + data: { task: "ajax.fetchAssociations", format: "json", assocId: assocId, excludeLang: currentLang }, + + success: function(result, status, xhr) { Joomla.injectAssociations(result, callbackFunctionPrefix); }, + + error: function() { Joomla.renderMessages({"warning":[(Joomla.JText._('JGLOBAL_ASSOCIATIONS_PROPAGATE_FAILED'))]}); }, + }); + + return false; + } + !(function() { jQuery(document).ready(function($) diff --git a/media/system/js/associations-edit.js b/media/system/js/associations-edit.js index ea17b04783700..a4b70bc16a550 100644 --- a/media/system/js/associations-edit.js +++ b/media/system/js/associations-edit.js @@ -1 +1 @@ -window.hideAssociation=function(o,i){jQuery("#associations .control-group").each(function(){jQuery(this).find(".control-label label").attr("for").replace("_id","")==o+"_associations_"+i.replace("-","_")&&jQuery(this).hide()})},window.showAssociationMessage=function(){jQuery("#associations .control-group").hide(),jQuery("#associations").prepend('
      '+Joomla.JText._("JGLOBAL_ASSOC_NOT_POSSIBLE")+"
      ")},!function(){jQuery(document).ready(function(o){var i=Joomla.getOptions("system.associations.edit"),s=i.formControl||"jform";1==i.hidden?window.showAssociationMessage():window.hideAssociation(s,o("#"+s+"_language").val()),o("#"+s+"_language").on("change",function(){Joomla.removeMessages(),o("#associations-notice").remove();var i=!1;o("#associations .control-group").each(function(){var a=o(this).find(".control-label label").attr("for").replace("_id","").replace("jform_associations_","");o(this).show(),i||""===o("#"+s+"_associations_"+a+"_id").val()||(i=!0),o("#"+s+"_associations_"+a+"_clear").click()}),i&&Joomla.renderMessages({warning:[Joomla.JText._("JGLOBAL_ASSOCIATIONS_RESET_WARNING")]});var a=o(this).val();"*"==a?window.showAssociationMessage():window.hideAssociation(s,a)})})}(window,document,Joomla); +window.hideAssociation=function(o,a){jQuery("#associations .control-group").each(function(){jQuery(this).find(".control-label label").attr("for").replace("_id","")==o+"_associations_"+a.replace("-","_")&&jQuery(this).hide()})},window.showAssociationMessage=function(){jQuery("#associations .control-group").hide(),jQuery("#associations").prepend('
      '+Joomla.JText._("JGLOBAL_ASSOC_NOT_POSSIBLE")+"
      ")},Joomla.injectAssociations=function(o,a){var s;if(o.success){if(0!==o.data.length)for(var e in o.data)s=a+e.replace("-","_"),window[s](o.data[e].id,o.data[e].title,o.data[e].catid,null,null,e);o.message&&Joomla.renderMessages({notice:[o.message]})}else Joomla.renderMessages({warning:[Joomla.JText._("JGLOBAL_ASSOCIATIONS_PROPAGATE_FAILED")]})},Joomla.propagateAssociation=function(o,a){var s=jQuery("#"+o+"_id").val(),e=jQuery("#jform_language").find(":selected").val(),i=Joomla.getOptions("csrf.token",""),n=jQuery("form[name='adminForm']").attr("action");return n+="&"+i+"=1",jQuery.ajax({url:n,data:{task:"ajax.fetchAssociations",format:"json",assocId:s,excludeLang:e},success:function(o,s,e){Joomla.injectAssociations(o,a)},error:function(){Joomla.renderMessages({warning:[Joomla.JText._("JGLOBAL_ASSOCIATIONS_PROPAGATE_FAILED")]})}}),!1},window,document,Joomla,jQuery(document).ready(function(o){var a=Joomla.getOptions("system.associations.edit"),s=a.formControl||"jform";1==a.hidden?window.showAssociationMessage():window.hideAssociation(s,o("#"+s+"_language").val()),o("#"+s+"_language").on("change",function(a){Joomla.removeMessages(),o("#associations-notice").remove();var e=!1;o("#associations .control-group").each(function(){var a=o(this).find(".control-label label").attr("for").replace("_id","").replace("jform_associations_","");o(this).show(),e||""===o("#"+s+"_associations_"+a+"_id").val()||(e=!0),o("#"+s+"_associations_"+a+"_clear").click()}),e&&Joomla.renderMessages({warning:[Joomla.JText._("JGLOBAL_ASSOCIATIONS_RESET_WARNING")]});var i=o(this).val();"*"==i?window.showAssociationMessage():window.hideAssociation(s,i)})}); \ No newline at end of file diff --git a/media/system/js/modal-fields-uncompressed.js b/media/system/js/modal-fields-uncompressed.js index a8e3e8f45fe77..685664979ece0 100644 --- a/media/system/js/modal-fields-uncompressed.js +++ b/media/system/js/modal-fields-uncompressed.js @@ -54,6 +54,10 @@ { jQuery('#' + fieldPrefix + '_clear').removeClass('hidden'); } + if (document.getElementById(fieldPrefix + '_propagate')) + { + jQuery('#' + fieldPrefix + '_propagate').removeClass('hidden'); + } } else { @@ -76,6 +80,10 @@ { jQuery('#' + fieldPrefix + '_clear').addClass('hidden'); } + if (document.getElementById(fieldPrefix + '_propagate')) + { + jQuery('#' + fieldPrefix + '_propagate').addClass('hidden'); + } } if (fieldId.getAttribute('data-required') == '1') @@ -188,4 +196,4 @@ return false; } -}()); +}()); \ No newline at end of file diff --git a/media/system/js/modal-fields.js b/media/system/js/modal-fields.js index 1c916aba32857..7e4efdf5ce0c1 100644 --- a/media/system/js/modal-fields.js +++ b/media/system/js/modal-fields.js @@ -1 +1 @@ -(function(){"use strict";window.processModalParent=function(fieldPrefix,id,title,catid,url,language,object){var fieldId=document.getElementById(fieldPrefix+"_id"),fieldTitle=document.getElementById(fieldPrefix+"_name");id=id||"";title=title||"";catid=catid||"";object=object||"";url=url||"";language=language||"";if(id){fieldId.value=id;fieldTitle.value=title;if(document.getElementById(fieldPrefix+"_select")){jQuery("#"+fieldPrefix+"_select").addClass("hidden")}if(document.getElementById(fieldPrefix+"_new")){jQuery("#"+fieldPrefix+"_new").addClass("hidden")}if(document.getElementById(fieldPrefix+"_edit")){jQuery("#"+fieldPrefix+"_edit").removeClass("hidden")}if(document.getElementById(fieldPrefix+"_clear")){jQuery("#"+fieldPrefix+"_clear").removeClass("hidden")}}else{fieldId.value="";fieldTitle.value=fieldId.getAttribute("data-text");if(document.getElementById(fieldPrefix+"_select")){jQuery("#"+fieldPrefix+"_select").removeClass("hidden")}if(document.getElementById(fieldPrefix+"_new")){jQuery("#"+fieldPrefix+"_new").removeClass("hidden")}if(document.getElementById(fieldPrefix+"_edit")){jQuery("#"+fieldPrefix+"_edit").addClass("hidden")}if(document.getElementById(fieldPrefix+"_clear")){jQuery("#"+fieldPrefix+"_clear").addClass("hidden")}}if(fieldId.getAttribute("data-required")=="1"){document.formvalidator.validate(fieldId);document.formvalidator.validate(fieldTitle)}return false};window.processModalEdit=function(element,fieldPrefix,action,itemType,task,formId,idFieldId,titleFieldId){formId=formId||itemType.toLowerCase()+"-form";idFieldId=idFieldId||"jform_id";titleFieldId=titleFieldId||"jform_title";var modalId=element.parentNode.parentNode.id,submittedTask=task;jQuery("#"+modalId+" iframe").get(0).id="Frame_"+modalId;var iframeDocument=jQuery("#Frame_"+modalId).contents().get(0);if(task==="cancel"){document.getElementById("Frame_"+modalId).contentWindow.Joomla.submitbutton(itemType.toLowerCase()+"."+task);jQuery("#"+modalId).modal("hide")}else{jQuery("#Frame_"+modalId).on("load",function(){iframeDocument=jQuery(this).contents().get(0);if(iframeDocument.getElementById(idFieldId)&&iframeDocument.getElementById(idFieldId).value!="0"){window.processModalParent(fieldPrefix,iframeDocument.getElementById(idFieldId).value,iframeDocument.getElementById(titleFieldId).value);if(task==="save"){window.processModalEdit(element,fieldPrefix,"edit",itemType,"cancel",formId,idFieldId,titleFieldId)}}jQuery("#"+modalId+" iframe").removeClass("hidden")});if(iframeDocument.formvalidator.isValid(iframeDocument.getElementById(formId))){if(task==="save"){submittedTask="apply"}document.getElementById("Frame_"+modalId).contentWindow.Joomla.submitbutton(itemType.toLowerCase()+"."+submittedTask)}}return false};window.processModalSelect=function(itemType,fieldPrefix,id,title,catid,object,url,language){window.processModalParent(fieldPrefix,id,title,catid,url,language,object);jQuery("#ModalSelect"+itemType+"_"+fieldPrefix).modal("hide");return false}})(); \ No newline at end of file +!function(){"use strict";window.processModalParent=function(e,t,d,n,a,o,r){var l=document.getElementById(e+"_id"),m=document.getElementById(e+"_name");return t=t||"",d=d||"",n=n||"",r=r||"",a=a||"",o=o||"",t?(l.value=t,m.value=d,document.getElementById(e+"_select")&&jQuery("#"+e+"_select").addClass("hidden"),document.getElementById(e+"_new")&&jQuery("#"+e+"_new").addClass("hidden"),document.getElementById(e+"_edit")&&jQuery("#"+e+"_edit").removeClass("hidden"),document.getElementById(e+"_clear")&&jQuery("#"+e+"_clear").removeClass("hidden"),document.getElementById(e+"_propagate")&&jQuery("#"+e+"_propagate").removeClass("hidden")):(l.value="",m.value=l.getAttribute("data-text"),document.getElementById(e+"_select")&&jQuery("#"+e+"_select").removeClass("hidden"),document.getElementById(e+"_new")&&jQuery("#"+e+"_new").removeClass("hidden"),document.getElementById(e+"_edit")&&jQuery("#"+e+"_edit").addClass("hidden"),document.getElementById(e+"_clear")&&jQuery("#"+e+"_clear").addClass("hidden"),document.getElementById(e+"_propagate")&&jQuery("#"+e+"_propagate").addClass("hidden")),"1"==l.getAttribute("data-required")&&(document.formvalidator.validate(l),document.formvalidator.validate(m)),!1},window.processModalEdit=function(e,t,d,n,a,o,r,l){o=o||n.toLowerCase()+"-form",r=r||"jform_id",l=l||"jform_title";var m=e.parentNode.parentNode.id,u=a;jQuery("#"+m+" iframe").get(0).id="Frame_"+m;var i=jQuery("#Frame_"+m).contents().get(0);return"cancel"===a?(document.getElementById("Frame_"+m).contentWindow.Joomla.submitbutton(n.toLowerCase()+"."+a),jQuery("#"+m).modal("hide")):(jQuery("#Frame_"+m).on("load",function(){(i=jQuery(this).contents().get(0)).getElementById(r)&&"0"!=i.getElementById(r).value&&(window.processModalParent(t,i.getElementById(r).value,i.getElementById(l).value),"save"===a&&window.processModalEdit(e,t,"edit",n,"cancel",o,r,l)),jQuery("#"+m+" iframe").removeClass("hidden")}),i.formvalidator.isValid(i.getElementById(o))&&("save"===a&&(u="apply"),document.getElementById("Frame_"+m).contentWindow.Joomla.submitbutton(n.toLowerCase()+"."+u))),!1},window.processModalSelect=function(e,t,d,n,a,o,r,l){return window.processModalParent(t,d,n,a,r,l,o),jQuery("#ModalSelect"+e+"_"+t).modal("hide"),!1}}(); \ No newline at end of file From e311a04f61fd3c3ef0b432b055f4a875bc75898f Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Sat, 4 Aug 2018 10:33:55 -0500 Subject: [PATCH 55/92] Revert "[New Feature] Multilingual: Propagating existing associations if desired (#21321)" (#21408) This reverts commit 8bacca95c2247a91230e56ae2d4a96a98e1ca0dc. --- .../com_categories/controllers/ajax.json.php | 88 ----------------- .../com_categories/models/category.php | 1 - .../models/fields/modal/category.php | 32 +----- .../com_contact/controllers/ajax.json.php | 87 ---------------- .../components/com_contact/models/contact.php | 1 - .../models/fields/modal/contact.php | 32 +----- .../com_content/controllers/ajax.json.php | 86 ---------------- .../components/com_content/models/article.php | 1 - .../models/fields/modal/article.php | 32 +----- .../com_menus/controllers/ajax.json.php | 88 ----------------- .../com_menus/models/fields/modal/menu.php | 35 ------- .../components/com_menus/models/item.php | 1 - .../com_newsfeeds/controllers/ajax.json.php | 87 ---------------- .../models/fields/modal/newsfeed.php | 32 +----- .../com_newsfeeds/models/newsfeed.php | 1 - administrator/language/en-GB/en-GB.ini | 8 +- .../js/associations-edit-uncompressed.js | 98 ------------------- media/system/js/associations-edit.js | 2 +- media/system/js/modal-fields-uncompressed.js | 10 +- media/system/js/modal-fields.js | 2 +- 20 files changed, 20 insertions(+), 704 deletions(-) delete mode 100644 administrator/components/com_categories/controllers/ajax.json.php delete mode 100644 administrator/components/com_contact/controllers/ajax.json.php delete mode 100644 administrator/components/com_content/controllers/ajax.json.php delete mode 100644 administrator/components/com_menus/controllers/ajax.json.php delete mode 100644 administrator/components/com_newsfeeds/controllers/ajax.json.php diff --git a/administrator/components/com_categories/controllers/ajax.json.php b/administrator/components/com_categories/controllers/ajax.json.php deleted file mode 100644 index 24f69cc569a94..0000000000000 --- a/administrator/components/com_categories/controllers/ajax.json.php +++ /dev/null @@ -1,88 +0,0 @@ -input; - $extension = $input->get('extension'); - - $assocId = $input->getInt('assocId', 0); - - if ($assocId == 0) - { - echo new JResponseJson(null, JText::sprintf('JLIB_FORM_VALIDATE_FIELD_INVALID', 'assocId'), true); - - return; - } - - $excludeLang = $input->get('excludeLang', '', 'STRING'); - - $associations = JLanguageAssociations::getAssociations($extension, '#__categories', 'com_categories.item', (int) $assocId, 'id', 'alias', ''); - - unset($associations[$excludeLang]); - - // Add the title to each of the associated records - JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_categories/tables'); - $categoryTable = JTable::getInstance('Category', 'JTable'); - - foreach ($associations as $lang => $association) - { - $categoryTable->load($association->id); - $associations[$lang]->title = $categoryTable->title; - } - - $countContentLanguages = count(LanguageHelper::getContentLanguages(array(0, 1))); - - if (count($associations) == 0) - { - $message = JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_NONE'); - } - elseif ($countContentLanguages > count($associations) + 2) - { - $tags = implode(', ', array_keys($associations)); - $message = JText::sprintf('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_SOME', $tags); - } - else - { - $message = JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_ALL'); - } - - echo new JResponseJson($associations, $message); - } - } -} diff --git a/administrator/components/com_categories/models/category.php b/administrator/components/com_categories/models/category.php index ae048938ec937..458b01eb22740 100644 --- a/administrator/components/com_categories/models/category.php +++ b/administrator/components/com_categories/models/category.php @@ -455,7 +455,6 @@ protected function preprocessForm(JForm $form, $data, $group = 'content') $field->addAttribute('new', 'true'); $field->addAttribute('edit', 'true'); $field->addAttribute('clear', 'true'); - $field->addAttribute('propagate', 'true'); } $form->load($addform, false); diff --git a/administrator/components/com_categories/models/fields/modal/category.php b/administrator/components/com_categories/models/fields/modal/category.php index 5bef5ec0ae392..0b77986150697 100644 --- a/administrator/components/com_categories/models/fields/modal/category.php +++ b/administrator/components/com_categories/models/fields/modal/category.php @@ -9,8 +9,6 @@ defined('JPATH_BASE') or die; -use Joomla\CMS\Language\LanguageHelper; - /** * Supports a modal category picker. * @@ -44,13 +42,10 @@ protected function getInput() $extension = (string) JFactory::getApplication()->input->get('extension', 'com_content'); } - $allowNew = ((string) $this->element['new'] == 'true'); - $allowEdit = ((string) $this->element['edit'] == 'true'); - $allowClear = ((string) $this->element['clear'] != 'false'); - $allowSelect = ((string) $this->element['select'] != 'false'); - $allowPropagate = ((string) $this->element['propagate'] == 'true'); - - $languages = LanguageHelper::getContentLanguages(array(0, 1)); + $allowNew = ((string) $this->element['new'] == 'true'); + $allowEdit = ((string) $this->element['edit'] == 'true'); + $allowClear = ((string) $this->element['clear'] != 'false'); + $allowSelect = ((string) $this->element['select'] != 'false'); // Load language. JFactory::getLanguage()->load('com_categories', JPATH_ADMINISTRATOR); @@ -83,8 +78,6 @@ function jSelectCategory_" . $this->id . "(id, title, object) { } "); - JText::script('JGLOBAL_ASSOCIATIONS_PROPAGATE_FAILED'); - $scriptSelect[$this->id] = true; } } @@ -186,23 +179,6 @@ function jSelectCategory_" . $this->id . "(id, title, object) { . ''; } - // Propagate category button - if ($allowPropagate && count($languages) > 2) - { - // Strip off language tag at the end - $tagLength = (int) strlen($this->element['language']); - $callbackFunctionStem = substr("jSelectCategory_" . $this->id, 0, -$tagLength); - - $html .= '' - . '' . JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_BUTTON') - . ''; - } - $html .= ''; // Select category modal. diff --git a/administrator/components/com_contact/controllers/ajax.json.php b/administrator/components/com_contact/controllers/ajax.json.php deleted file mode 100644 index a832a3c7a9fad..0000000000000 --- a/administrator/components/com_contact/controllers/ajax.json.php +++ /dev/null @@ -1,87 +0,0 @@ -input; - - $assocId = $input->getInt('assocId', 0); - - if ($assocId == 0) - { - echo new JResponseJson(null, JText::sprintf('JLIB_FORM_VALIDATE_FIELD_INVALID', 'assocId'), true); - - return; - } - - $excludeLang = $input->get('excludeLang', '', 'STRING'); - - $associations = JLanguageAssociations::getAssociations('com_contact', '#__contact_details', 'com_contact.item', (int) $assocId); - - unset($associations[$excludeLang]); - - // Add the title to each of the associated records - JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_contact/tables'); - $contactTable = JTable::getInstance('Contact', 'ContactTable'); - - foreach ($associations as $lang => $association) - { - $contactTable->load($association->id); - $associations[$lang]->title = $contactTable->name; - } - - $countContentLanguages = count(LanguageHelper::getContentLanguages(array(0, 1))); - - if (count($associations) == 0) - { - $message = JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_NONE'); - } - elseif ($countContentLanguages > count($associations) + 2) - { - $tags = implode(', ', array_keys($associations)); - $message = JText::sprintf('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_SOME', $tags); - } - else - { - $message = JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_ALL'); - } - - echo new JResponseJson($associations, $message); - } - } -} diff --git a/administrator/components/com_contact/models/contact.php b/administrator/components/com_contact/models/contact.php index 5c2fbfc0058c6..936591f4979d9 100644 --- a/administrator/components/com_contact/models/contact.php +++ b/administrator/components/com_contact/models/contact.php @@ -560,7 +560,6 @@ protected function preprocessForm(JForm $form, $data, $group = 'content') $field->addAttribute('new', 'true'); $field->addAttribute('edit', 'true'); $field->addAttribute('clear', 'true'); - $field->addAttribute('propagate', 'true'); } $form->load($addform, false); diff --git a/administrator/components/com_contact/models/fields/modal/contact.php b/administrator/components/com_contact/models/fields/modal/contact.php index a68420170e2c4..e03511d6855c3 100644 --- a/administrator/components/com_contact/models/fields/modal/contact.php +++ b/administrator/components/com_contact/models/fields/modal/contact.php @@ -9,8 +9,6 @@ defined('JPATH_BASE') or die; -use Joomla\CMS\Language\LanguageHelper; - /** * Supports a modal contact picker. * @@ -35,13 +33,10 @@ class JFormFieldModal_Contact extends JFormField */ protected function getInput() { - $allowNew = ((string) $this->element['new'] == 'true'); - $allowEdit = ((string) $this->element['edit'] == 'true'); - $allowClear = ((string) $this->element['clear'] != 'false'); - $allowSelect = ((string) $this->element['select'] != 'false'); - $allowPropagate = ((string) $this->element['propagate'] == 'true'); - - $languages = LanguageHelper::getContentLanguages(array(0, 1)); + $allowNew = ((string) $this->element['new'] == 'true'); + $allowEdit = ((string) $this->element['edit'] == 'true'); + $allowClear = ((string) $this->element['clear'] != 'false'); + $allowSelect = ((string) $this->element['select'] != 'false'); // Load language JFactory::getLanguage()->load('com_contact', JPATH_ADMINISTRATOR); @@ -74,8 +69,6 @@ function jSelectContact_" . $this->id . "(id, title, object) { } "); - JText::script('JGLOBAL_ASSOCIATIONS_PROPAGATE_FAILED'); - $scriptSelect[$this->id] = true; } } @@ -175,23 +168,6 @@ function jSelectContact_" . $this->id . "(id, title, object) { . ''; } - // Propagate contact button - if ($allowPropagate && count($languages) > 2) - { - // Strip off language tag at the end - $tagLength = (int) strlen($this->element['language']); - $callbackFunctionStem = substr("jSelectContact_" . $this->id, 0, -$tagLength); - - $html .= '' - . '' . JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_BUTTON') - . ''; - } - $html .= ''; // Select contact modal diff --git a/administrator/components/com_content/controllers/ajax.json.php b/administrator/components/com_content/controllers/ajax.json.php deleted file mode 100644 index 0a6385acdcdb5..0000000000000 --- a/administrator/components/com_content/controllers/ajax.json.php +++ /dev/null @@ -1,86 +0,0 @@ -input; - - $assocId = $input->getInt('assocId', 0); - - if ($assocId == 0) - { - echo new JResponseJson(null, JText::sprintf('JLIB_FORM_VALIDATE_FIELD_INVALID', 'assocId'), true); - - return; - } - - $excludeLang = $input->get('excludeLang', '', 'STRING'); - - $associations = JLanguageAssociations::getAssociations('com_content', '#__content', 'com_content.item', (int) $assocId); - - unset($associations[$excludeLang]); - - // Add the title to each of the associated records - $contentTable = JTable::getInstance('Content', 'JTable'); - - foreach ($associations as $lang => $association) - { - $contentTable->load($association->id); - $associations[$lang]->title = $contentTable->title; - } - - $countContentLanguages = count(LanguageHelper::getContentLanguages(array(0, 1))); - - if (count($associations) == 0) - { - $message = JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_NONE'); - } - elseif ($countContentLanguages > count($associations) + 2) - { - $tags = implode(', ', array_keys($associations)); - $message = JText::sprintf('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_SOME', $tags); - } - else - { - $message = JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_ALL'); - } - - echo new JResponseJson($associations, $message); - } - } -} diff --git a/administrator/components/com_content/models/article.php b/administrator/components/com_content/models/article.php index 01ef41113ff76..868182bd67f2e 100644 --- a/administrator/components/com_content/models/article.php +++ b/administrator/components/com_content/models/article.php @@ -913,7 +913,6 @@ protected function preprocessForm(JForm $form, $data, $group = 'content') $field->addAttribute('new', 'true'); $field->addAttribute('edit', 'true'); $field->addAttribute('clear', 'true'); - $field->addAttribute('propagate', 'true'); } $form->load($addform, false); diff --git a/administrator/components/com_content/models/fields/modal/article.php b/administrator/components/com_content/models/fields/modal/article.php index e8608a3521bd3..28934a3cc7131 100644 --- a/administrator/components/com_content/models/fields/modal/article.php +++ b/administrator/components/com_content/models/fields/modal/article.php @@ -9,8 +9,6 @@ defined('JPATH_BASE') or die; -use Joomla\CMS\Language\LanguageHelper; - /** * Supports a modal article picker. * @@ -35,13 +33,10 @@ class JFormFieldModal_Article extends JFormField */ protected function getInput() { - $allowNew = ((string) $this->element['new'] == 'true'); - $allowEdit = ((string) $this->element['edit'] == 'true'); - $allowClear = ((string) $this->element['clear'] != 'false'); - $allowSelect = ((string) $this->element['select'] != 'false'); - $allowPropagate = ((string) $this->element['propagate'] == 'true'); - - $languages = LanguageHelper::getContentLanguages(array(0, 1)); + $allowNew = ((string) $this->element['new'] == 'true'); + $allowEdit = ((string) $this->element['edit'] == 'true'); + $allowClear = ((string) $this->element['clear'] != 'false'); + $allowSelect = ((string) $this->element['select'] != 'false'); // Load language JFactory::getLanguage()->load('com_content', JPATH_ADMINISTRATOR); @@ -74,8 +69,6 @@ function jSelectArticle_" . $this->id . "(id, title, catid, object, url, languag } "); - JText::script('JGLOBAL_ASSOCIATIONS_PROPAGATE_FAILED'); - $scriptSelect[$this->id] = true; } } @@ -178,23 +171,6 @@ function jSelectArticle_" . $this->id . "(id, title, catid, object, url, languag . ''; } - // Propagate article button - if ($allowPropagate && count($languages) > 2) - { - // Strip off language tag at the end - $tagLength = (int) strlen($this->element['language']); - $callbackFunctionStem = substr("jSelectArticle_" . $this->id, 0, -$tagLength); - - $html .= '' - . '' . JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_BUTTON') - . ''; - } - $html .= ''; // Select article modal diff --git a/administrator/components/com_menus/controllers/ajax.json.php b/administrator/components/com_menus/controllers/ajax.json.php deleted file mode 100644 index 0b5c4d552fd18..0000000000000 --- a/administrator/components/com_menus/controllers/ajax.json.php +++ /dev/null @@ -1,88 +0,0 @@ -input; - $extension = $input->get('extension'); - - $assocId = $input->getInt('assocId', 0); - - if ($assocId == 0) - { - echo new JResponseJson(null, JText::sprintf('JLIB_FORM_VALIDATE_FIELD_INVALID', 'assocId'), true); - - return; - } - - $excludeLang = $input->get('excludeLang', '', 'STRING'); - - $associations = JLanguageAssociations::getAssociations('com_menus', '#__menu', 'com_menus.item', (int) $assocId, 'id', '', ''); - - unset($associations[$excludeLang]); - - // Add the title to each of the associated records - JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_menus/tables'); - $menuTable = JTable::getInstance('Menu', 'JTable', array()); - - foreach ($associations as $lang => $association) - { - $menuTable->load($association->id); - $associations[$lang]->title = $menuTable->title; - } - - $countContentLanguages = count(LanguageHelper::getContentLanguages(array(0, 1))); - - if (count($associations) == 0) - { - $message = JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_NONE'); - } - elseif ($countContentLanguages > count($associations) + 2) - { - $tags = implode(', ', array_keys($associations)); - $message = JText::sprintf('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_SOME', $tags); - } - else - { - $message = JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_ALL'); - } - - echo new JResponseJson($associations, $message); - } - } -} diff --git a/administrator/components/com_menus/models/fields/modal/menu.php b/administrator/components/com_menus/models/fields/modal/menu.php index 7f1bc95f95f0f..58c5ed4d17f22 100644 --- a/administrator/components/com_menus/models/fields/modal/menu.php +++ b/administrator/components/com_menus/models/fields/modal/menu.php @@ -8,9 +8,6 @@ */ defined('JPATH_BASE') or die; - -use Joomla\CMS\Language\LanguageHelper; - JHtml::_('bootstrap.tooltip', '.hasTooltip'); /** @@ -60,14 +57,6 @@ class JFormFieldModal_Menu extends JFormField */ protected $allowEdit = false; - /** - * Determinate, if the propagate button is shown - * - * @var boolean - * @since __DEPLOY_VERSION__ - */ - protected $allowPropagate = false; - /** * Method to get certain otherwise inaccessible properties from the form field object. * @@ -85,7 +74,6 @@ public function __get($name) case 'allowClear': case 'allowNew': case 'allowEdit': - case 'allowPropagate': return $this->$name; } @@ -110,7 +98,6 @@ public function __set($name, $value) case 'allowClear': case 'allowNew': case 'allowEdit': - case 'allowPropagate': $value = (string) $value; $this->$name = !($value === 'false' || $value === 'off' || $value === '0'); break; @@ -144,7 +131,6 @@ public function setup(SimpleXMLElement $element, $value, $group = null) $this->allowClear = ((string) $this->element['clear']) !== 'false'; $this->allowNew = ((string) $this->element['new']) === 'true'; $this->allowEdit = ((string) $this->element['edit']) === 'true'; - $this->allowPropagate = ((string) $this->element['propagate']) === 'true'; } return $return; @@ -160,7 +146,6 @@ public function setup(SimpleXMLElement $element, $value, $group = null) protected function getInput() { $clientId = (int) $this->element['clientid']; - $languages = LanguageHelper::getContentLanguages(array(0, 1)); // Load language JFactory::getLanguage()->load('com_menus', JPATH_ADMINISTRATOR); @@ -194,8 +179,6 @@ function jSelectMenu_" . $this->id . "(id, title, object) { " ); - JText::script('JGLOBAL_ASSOCIATIONS_PROPAGATE_FAILED'); - $scriptSelect[$this->id] = true; } } @@ -310,26 +293,8 @@ function jSelectMenu_" . $this->id . "(id, title, object) { . ''; } - // Propagate menu item button - if ($this->allowPropagate && count($languages) > 2) - { - // Strip off language tag at the end - $tagLength = (int) strlen($this->element['language']); - $callbackFunctionStem = substr("jSelectMenu_" . $this->id, 0, -$tagLength); - - $html .= '' - . '' . JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_BUTTON') - . ''; - } - $html .= ''; - // Select menu item modal if ($this->allowSelect) { diff --git a/administrator/components/com_menus/models/item.php b/administrator/components/com_menus/models/item.php index 98cb5a00c23be..0a131deefce75 100644 --- a/administrator/components/com_menus/models/item.php +++ b/administrator/components/com_menus/models/item.php @@ -1242,7 +1242,6 @@ protected function preprocessForm(JForm $form, $data, $group = 'content') $field->addAttribute('new', 'true'); $field->addAttribute('edit', 'true'); $field->addAttribute('clear', 'true'); - $field->addAttribute('propagate', 'true'); $option = $field->addChild('option', 'COM_MENUS_ITEM_FIELD_ASSOCIATION_NO_VALUE'); $option->addAttribute('value', ''); } diff --git a/administrator/components/com_newsfeeds/controllers/ajax.json.php b/administrator/components/com_newsfeeds/controllers/ajax.json.php deleted file mode 100644 index f9107ed0fe360..0000000000000 --- a/administrator/components/com_newsfeeds/controllers/ajax.json.php +++ /dev/null @@ -1,87 +0,0 @@ -input; - - $assocId = $input->getInt('assocId', 0); - - if ($assocId == 0) - { - echo new JResponseJson(null, JText::sprintf('JLIB_FORM_VALIDATE_FIELD_INVALID', 'assocId'), true); - - return; - } - - $excludeLang = $input->get('excludeLang', '', 'STRING'); - - $associations = JLanguageAssociations::getAssociations('com_newsfeeds', '#__newsfeeds', 'com_newsfeeds.item', (int) $assocId); - - unset($associations[$excludeLang]); - - // Add the title to each of the associated records - JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_newsfeeds/tables'); - $newsfeedsTable = JTable::getInstance('Newsfeed', 'NewsfeedsTable'); - - foreach ($associations as $lang => $association) - { - $newsfeedsTable->load($association->id); - $associations[$lang]->title = $newsfeedsTable->name; - } - - $countContentLanguages = count(LanguageHelper::getContentLanguages(array(0, 1))); - - if (count($associations) == 0) - { - $message = JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_NONE'); - } - elseif ($countContentLanguages > count($associations) + 2) - { - $tags = implode(', ', array_keys($associations)); - $message = JText::sprintf('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_SOME', $tags); - } - else - { - $message = JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_ALL'); - } - - echo new JResponseJson($associations, $message); - } - } -} diff --git a/administrator/components/com_newsfeeds/models/fields/modal/newsfeed.php b/administrator/components/com_newsfeeds/models/fields/modal/newsfeed.php index a4056f4b613f7..050c040bbf7bc 100644 --- a/administrator/components/com_newsfeeds/models/fields/modal/newsfeed.php +++ b/administrator/components/com_newsfeeds/models/fields/modal/newsfeed.php @@ -9,8 +9,6 @@ defined('JPATH_BASE') or die; -use Joomla\CMS\Language\LanguageHelper; - /** * Supports a modal newsfeeds picker. * @@ -35,13 +33,10 @@ class JFormFieldModal_Newsfeed extends JFormField */ protected function getInput() { - $allowNew = ((string) $this->element['new'] == 'true'); - $allowEdit = ((string) $this->element['edit'] == 'true'); - $allowClear = ((string) $this->element['clear'] != 'false'); - $allowSelect = ((string) $this->element['select'] != 'false'); - $allowPropagate = ((string) $this->element['propagate'] == 'true'); - - $languages = LanguageHelper::getContentLanguages(array(0, 1)); + $allowNew = ((string) $this->element['new'] == 'true'); + $allowEdit = ((string) $this->element['edit'] == 'true'); + $allowClear = ((string) $this->element['clear'] != 'false'); + $allowSelect = ((string) $this->element['select'] != 'false'); // Load language JFactory::getLanguage()->load('com_newsfeeds', JPATH_ADMINISTRATOR); @@ -75,8 +70,6 @@ function jSelectNewsfeed_" . $this->id . "(id, title, object) { " ); - JText::script('JGLOBAL_ASSOCIATIONS_PROPAGATE_FAILED'); - $scriptSelect[$this->id] = true; } } @@ -176,23 +169,6 @@ function jSelectNewsfeed_" . $this->id . "(id, title, object) { . ''; } - // Propagate newsfeed button - if ($allowPropagate && count($languages) > 2) - { - // Strip off language tag at the end - $tagLength = (int) strlen($this->element['language']); - $callbackFunctionStem = substr("jSelectNewsfeed_" . $this->id, 0, -$tagLength); - - $html .= '' - . '' . JText::_('JGLOBAL_ASSOCIATIONS_PROPAGATE_BUTTON') - . ''; - } - $html .= ''; // Select newsfeed modal diff --git a/administrator/components/com_newsfeeds/models/newsfeed.php b/administrator/components/com_newsfeeds/models/newsfeed.php index 9e6da29806f46..97ee58633890d 100644 --- a/administrator/components/com_newsfeeds/models/newsfeed.php +++ b/administrator/components/com_newsfeeds/models/newsfeed.php @@ -536,7 +536,6 @@ protected function preprocessForm(JForm $form, $data, $group = 'content') $field->addAttribute('new', 'true'); $field->addAttribute('edit', 'true'); $field->addAttribute('clear', 'true'); - $field->addAttribute('propagate', 'true'); } $form->load($addform, false); diff --git a/administrator/language/en-GB/en-GB.ini b/administrator/language/en-GB/en-GB.ini index 1f8647e459f13..2942c6c28820d 100644 --- a/administrator/language/en-GB/en-GB.ini +++ b/administrator/language/en-GB/en-GB.ini @@ -108,7 +108,7 @@ JPUBLISHED="Published" JRECORD_NUMBER="Record Number" JREGISTER="Register" JORDERINGDISABLED="Please sort by order to enable reordering" -JPROPAGATE="Propagate" + JSAVE="Save & Close" JSELECT="Select" JSTATUS="Status" @@ -281,12 +281,6 @@ JGLOBAL_ARTICLE_ORDER_DESC="The order that articles will show in." JGLOBAL_ARTICLE_ORDER_LABEL="Article Order" JGLOBAL_ARTICLES="Articles" JGLOBAL_ASSOC_NOT_POSSIBLE="To define associations, please make sure the item language is not set to 'All'." -JGLOBAL_ASSOCIATIONS_PROPAGATE_BUTTON="Propagate" -JGLOBAL_ASSOCIATIONS_PROPAGATE_FAILED="Failed propagating associations. You may have to select or create them manually." -JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_ALL="All existing associations have been set." -JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_NONE="No associations exist to propagate." -JGLOBAL_ASSOCIATIONS_PROPAGATE_MESSAGE_SOME="Associations have been set for: %s" -JGLOBAL_ASSOCIATIONS_PROPAGATE_TIP="Propagates this item's existing associations." JGLOBAL_ASSOCIATIONS_RESET_WARNING="The language has been changed. If you save this item again it will reset the available associations. If this was not intended, close the item." JGLOBAL_AUTH_ACCESS_DENIED="Access Denied" JGLOBAL_AUTH_ACCESS_GRANTED="Access Granted" diff --git a/media/system/js/associations-edit-uncompressed.js b/media/system/js/associations-edit-uncompressed.js index 6961791ba7f6d..08257989a4963 100644 --- a/media/system/js/associations-edit-uncompressed.js +++ b/media/system/js/associations-edit-uncompressed.js @@ -30,104 +30,6 @@ window.showAssociationMessage = function() jQuery('#associations').prepend('
      ' + Joomla.JText._('JGLOBAL_ASSOC_NOT_POSSIBLE') + '
      '); } - /** - * Inject associations into other association fields - * - * This function is called whenever the Ajax request within propagateAssociation() completes successfully. - * Its purpose is to inject the associations which have been returned in the Ajax response into the other - * association fields in the form. - * It does this by invoking the various callback functions of those association fields (i.e. the function which - * gets called whenever the administrator selects an association via the modal), and passing the appropriate - * associated record details. - * - * @param js object result The response from the Ajax request. - * Its structure is that generated by the JResponseJson class, - * with the data field containing the associations - * @param string fieldPrefix The stem of the html ids for the elements comprising the modal field - * @param string callbackFunctionPrefix The name of the callback function which the modal window uses to set the - * selected item as the association, but minus the language tag at the end - * - * @return boolean - * - * @since __DEPLOY_VERSION__ - */ - Joomla.injectAssociations = function(result, callbackFunctionPrefix) - { - var functionName; - - if (result.success) - { - if (result.data.length !== 0) - { - for (var lang in result.data) - { - functionName = callbackFunctionPrefix + lang.replace("-","_"); - - window[functionName](result.data[lang].id, result.data[lang].title, result.data[lang].catid, null, null, lang); - } - } - - if (result.message) - { - Joomla.renderMessages({"notice":[result.message]}); - } - } - else - { - Joomla.renderMessages({"warning":[(Joomla.JText._('JGLOBAL_ASSOCIATIONS_PROPAGATE_FAILED'))]}); - } - } - - /** - * Propagate associations from this field into other association fields - * - * This function is called whenever an administrator populates an association (in the association modal field) - * and then clicks on the Propagate button. - * The purpose of this function is to find what other records (if any) are associated with the one which the - * administrator has selected, and populate the other association fields with these records. (Otherwise, if the - * administrator just clicks on Save without clicking on Propagate, those other associations will be deleted). - * It does this by finding the id of the selected associated record (from a hidden field) and makes an Ajax call - * to the server to find the other associations, also passing up the language of the record currently being edited, - * as it should be excluded. - * Once it has received from the server the other associations it calls injectAssociations to inject them into - * the other association fields within the form. - * - * @param string fieldPrefix The stem of the html ids for the elements comprising the modal field - * @param string callbackFunctionPrefix The name of the callback function which the modal window uses to set the - * selected item as the association, but minus the language tag at the end - * - * @return boolean - * - * @since __DEPLOY_VERSION__ - */ - Joomla.propagateAssociation = function(fieldPrefix, callbackFunctionPrefix) - { - // Find the id of the record which has been set as an assocation - var assocId = jQuery("#" + fieldPrefix + "_id").val(); - - // Find the language of the record being edited - var currentLang = jQuery('#jform_language').find(":selected").val(); - - // Find the token so that it can be sent in the Ajax request as well - var token = Joomla.getOptions('csrf.token', ''); - - // Find the action url associated with the form - we need to add the token to this - var url = jQuery("form[name='adminForm']").attr("action"); - url += '&' + token + '=1'; - - jQuery.ajax( - { - url: url, - data: { task: "ajax.fetchAssociations", format: "json", assocId: assocId, excludeLang: currentLang }, - - success: function(result, status, xhr) { Joomla.injectAssociations(result, callbackFunctionPrefix); }, - - error: function() { Joomla.renderMessages({"warning":[(Joomla.JText._('JGLOBAL_ASSOCIATIONS_PROPAGATE_FAILED'))]}); }, - }); - - return false; - } - !(function() { jQuery(document).ready(function($) diff --git a/media/system/js/associations-edit.js b/media/system/js/associations-edit.js index a4b70bc16a550..ea17b04783700 100644 --- a/media/system/js/associations-edit.js +++ b/media/system/js/associations-edit.js @@ -1 +1 @@ -window.hideAssociation=function(o,a){jQuery("#associations .control-group").each(function(){jQuery(this).find(".control-label label").attr("for").replace("_id","")==o+"_associations_"+a.replace("-","_")&&jQuery(this).hide()})},window.showAssociationMessage=function(){jQuery("#associations .control-group").hide(),jQuery("#associations").prepend('
      '+Joomla.JText._("JGLOBAL_ASSOC_NOT_POSSIBLE")+"
      ")},Joomla.injectAssociations=function(o,a){var s;if(o.success){if(0!==o.data.length)for(var e in o.data)s=a+e.replace("-","_"),window[s](o.data[e].id,o.data[e].title,o.data[e].catid,null,null,e);o.message&&Joomla.renderMessages({notice:[o.message]})}else Joomla.renderMessages({warning:[Joomla.JText._("JGLOBAL_ASSOCIATIONS_PROPAGATE_FAILED")]})},Joomla.propagateAssociation=function(o,a){var s=jQuery("#"+o+"_id").val(),e=jQuery("#jform_language").find(":selected").val(),i=Joomla.getOptions("csrf.token",""),n=jQuery("form[name='adminForm']").attr("action");return n+="&"+i+"=1",jQuery.ajax({url:n,data:{task:"ajax.fetchAssociations",format:"json",assocId:s,excludeLang:e},success:function(o,s,e){Joomla.injectAssociations(o,a)},error:function(){Joomla.renderMessages({warning:[Joomla.JText._("JGLOBAL_ASSOCIATIONS_PROPAGATE_FAILED")]})}}),!1},window,document,Joomla,jQuery(document).ready(function(o){var a=Joomla.getOptions("system.associations.edit"),s=a.formControl||"jform";1==a.hidden?window.showAssociationMessage():window.hideAssociation(s,o("#"+s+"_language").val()),o("#"+s+"_language").on("change",function(a){Joomla.removeMessages(),o("#associations-notice").remove();var e=!1;o("#associations .control-group").each(function(){var a=o(this).find(".control-label label").attr("for").replace("_id","").replace("jform_associations_","");o(this).show(),e||""===o("#"+s+"_associations_"+a+"_id").val()||(e=!0),o("#"+s+"_associations_"+a+"_clear").click()}),e&&Joomla.renderMessages({warning:[Joomla.JText._("JGLOBAL_ASSOCIATIONS_RESET_WARNING")]});var i=o(this).val();"*"==i?window.showAssociationMessage():window.hideAssociation(s,i)})}); \ No newline at end of file +window.hideAssociation=function(o,i){jQuery("#associations .control-group").each(function(){jQuery(this).find(".control-label label").attr("for").replace("_id","")==o+"_associations_"+i.replace("-","_")&&jQuery(this).hide()})},window.showAssociationMessage=function(){jQuery("#associations .control-group").hide(),jQuery("#associations").prepend('
      '+Joomla.JText._("JGLOBAL_ASSOC_NOT_POSSIBLE")+"
      ")},!function(){jQuery(document).ready(function(o){var i=Joomla.getOptions("system.associations.edit"),s=i.formControl||"jform";1==i.hidden?window.showAssociationMessage():window.hideAssociation(s,o("#"+s+"_language").val()),o("#"+s+"_language").on("change",function(){Joomla.removeMessages(),o("#associations-notice").remove();var i=!1;o("#associations .control-group").each(function(){var a=o(this).find(".control-label label").attr("for").replace("_id","").replace("jform_associations_","");o(this).show(),i||""===o("#"+s+"_associations_"+a+"_id").val()||(i=!0),o("#"+s+"_associations_"+a+"_clear").click()}),i&&Joomla.renderMessages({warning:[Joomla.JText._("JGLOBAL_ASSOCIATIONS_RESET_WARNING")]});var a=o(this).val();"*"==a?window.showAssociationMessage():window.hideAssociation(s,a)})})}(window,document,Joomla); diff --git a/media/system/js/modal-fields-uncompressed.js b/media/system/js/modal-fields-uncompressed.js index 685664979ece0..a8e3e8f45fe77 100644 --- a/media/system/js/modal-fields-uncompressed.js +++ b/media/system/js/modal-fields-uncompressed.js @@ -54,10 +54,6 @@ { jQuery('#' + fieldPrefix + '_clear').removeClass('hidden'); } - if (document.getElementById(fieldPrefix + '_propagate')) - { - jQuery('#' + fieldPrefix + '_propagate').removeClass('hidden'); - } } else { @@ -80,10 +76,6 @@ { jQuery('#' + fieldPrefix + '_clear').addClass('hidden'); } - if (document.getElementById(fieldPrefix + '_propagate')) - { - jQuery('#' + fieldPrefix + '_propagate').addClass('hidden'); - } } if (fieldId.getAttribute('data-required') == '1') @@ -196,4 +188,4 @@ return false; } -}()); \ No newline at end of file +}()); diff --git a/media/system/js/modal-fields.js b/media/system/js/modal-fields.js index 7e4efdf5ce0c1..1c916aba32857 100644 --- a/media/system/js/modal-fields.js +++ b/media/system/js/modal-fields.js @@ -1 +1 @@ -!function(){"use strict";window.processModalParent=function(e,t,d,n,a,o,r){var l=document.getElementById(e+"_id"),m=document.getElementById(e+"_name");return t=t||"",d=d||"",n=n||"",r=r||"",a=a||"",o=o||"",t?(l.value=t,m.value=d,document.getElementById(e+"_select")&&jQuery("#"+e+"_select").addClass("hidden"),document.getElementById(e+"_new")&&jQuery("#"+e+"_new").addClass("hidden"),document.getElementById(e+"_edit")&&jQuery("#"+e+"_edit").removeClass("hidden"),document.getElementById(e+"_clear")&&jQuery("#"+e+"_clear").removeClass("hidden"),document.getElementById(e+"_propagate")&&jQuery("#"+e+"_propagate").removeClass("hidden")):(l.value="",m.value=l.getAttribute("data-text"),document.getElementById(e+"_select")&&jQuery("#"+e+"_select").removeClass("hidden"),document.getElementById(e+"_new")&&jQuery("#"+e+"_new").removeClass("hidden"),document.getElementById(e+"_edit")&&jQuery("#"+e+"_edit").addClass("hidden"),document.getElementById(e+"_clear")&&jQuery("#"+e+"_clear").addClass("hidden"),document.getElementById(e+"_propagate")&&jQuery("#"+e+"_propagate").addClass("hidden")),"1"==l.getAttribute("data-required")&&(document.formvalidator.validate(l),document.formvalidator.validate(m)),!1},window.processModalEdit=function(e,t,d,n,a,o,r,l){o=o||n.toLowerCase()+"-form",r=r||"jform_id",l=l||"jform_title";var m=e.parentNode.parentNode.id,u=a;jQuery("#"+m+" iframe").get(0).id="Frame_"+m;var i=jQuery("#Frame_"+m).contents().get(0);return"cancel"===a?(document.getElementById("Frame_"+m).contentWindow.Joomla.submitbutton(n.toLowerCase()+"."+a),jQuery("#"+m).modal("hide")):(jQuery("#Frame_"+m).on("load",function(){(i=jQuery(this).contents().get(0)).getElementById(r)&&"0"!=i.getElementById(r).value&&(window.processModalParent(t,i.getElementById(r).value,i.getElementById(l).value),"save"===a&&window.processModalEdit(e,t,"edit",n,"cancel",o,r,l)),jQuery("#"+m+" iframe").removeClass("hidden")}),i.formvalidator.isValid(i.getElementById(o))&&("save"===a&&(u="apply"),document.getElementById("Frame_"+m).contentWindow.Joomla.submitbutton(n.toLowerCase()+"."+u))),!1},window.processModalSelect=function(e,t,d,n,a,o,r,l){return window.processModalParent(t,d,n,a,r,l,o),jQuery("#ModalSelect"+e+"_"+t).modal("hide"),!1}}(); \ No newline at end of file +(function(){"use strict";window.processModalParent=function(fieldPrefix,id,title,catid,url,language,object){var fieldId=document.getElementById(fieldPrefix+"_id"),fieldTitle=document.getElementById(fieldPrefix+"_name");id=id||"";title=title||"";catid=catid||"";object=object||"";url=url||"";language=language||"";if(id){fieldId.value=id;fieldTitle.value=title;if(document.getElementById(fieldPrefix+"_select")){jQuery("#"+fieldPrefix+"_select").addClass("hidden")}if(document.getElementById(fieldPrefix+"_new")){jQuery("#"+fieldPrefix+"_new").addClass("hidden")}if(document.getElementById(fieldPrefix+"_edit")){jQuery("#"+fieldPrefix+"_edit").removeClass("hidden")}if(document.getElementById(fieldPrefix+"_clear")){jQuery("#"+fieldPrefix+"_clear").removeClass("hidden")}}else{fieldId.value="";fieldTitle.value=fieldId.getAttribute("data-text");if(document.getElementById(fieldPrefix+"_select")){jQuery("#"+fieldPrefix+"_select").removeClass("hidden")}if(document.getElementById(fieldPrefix+"_new")){jQuery("#"+fieldPrefix+"_new").removeClass("hidden")}if(document.getElementById(fieldPrefix+"_edit")){jQuery("#"+fieldPrefix+"_edit").addClass("hidden")}if(document.getElementById(fieldPrefix+"_clear")){jQuery("#"+fieldPrefix+"_clear").addClass("hidden")}}if(fieldId.getAttribute("data-required")=="1"){document.formvalidator.validate(fieldId);document.formvalidator.validate(fieldTitle)}return false};window.processModalEdit=function(element,fieldPrefix,action,itemType,task,formId,idFieldId,titleFieldId){formId=formId||itemType.toLowerCase()+"-form";idFieldId=idFieldId||"jform_id";titleFieldId=titleFieldId||"jform_title";var modalId=element.parentNode.parentNode.id,submittedTask=task;jQuery("#"+modalId+" iframe").get(0).id="Frame_"+modalId;var iframeDocument=jQuery("#Frame_"+modalId).contents().get(0);if(task==="cancel"){document.getElementById("Frame_"+modalId).contentWindow.Joomla.submitbutton(itemType.toLowerCase()+"."+task);jQuery("#"+modalId).modal("hide")}else{jQuery("#Frame_"+modalId).on("load",function(){iframeDocument=jQuery(this).contents().get(0);if(iframeDocument.getElementById(idFieldId)&&iframeDocument.getElementById(idFieldId).value!="0"){window.processModalParent(fieldPrefix,iframeDocument.getElementById(idFieldId).value,iframeDocument.getElementById(titleFieldId).value);if(task==="save"){window.processModalEdit(element,fieldPrefix,"edit",itemType,"cancel",formId,idFieldId,titleFieldId)}}jQuery("#"+modalId+" iframe").removeClass("hidden")});if(iframeDocument.formvalidator.isValid(iframeDocument.getElementById(formId))){if(task==="save"){submittedTask="apply"}document.getElementById("Frame_"+modalId).contentWindow.Joomla.submitbutton(itemType.toLowerCase()+"."+submittedTask)}}return false};window.processModalSelect=function(itemType,fieldPrefix,id,title,catid,object,url,language){window.processModalParent(fieldPrefix,id,title,catid,url,language,object);jQuery("#ModalSelect"+itemType+"_"+fieldPrefix).modal("hide");return false}})(); \ No newline at end of file From 1dc9d9186c8bbaefdaa7373ce27efe5a93f5a0ed Mon Sep 17 00:00:00 2001 From: Tomasz Narloch Date: Mon, 6 Aug 2018 11:34:55 +0200 Subject: [PATCH 56/92] Fix unit tests for PostgreSQL 10 (#21370) --- .../JDatabaseDriverPostgresqlTest.php | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/tests/unit/suites/database/driver/postgresql/JDatabaseDriverPostgresqlTest.php b/tests/unit/suites/database/driver/postgresql/JDatabaseDriverPostgresqlTest.php index 5a770a8c01990..695e4fbcc52c9 100644 --- a/tests/unit/suites/database/driver/postgresql/JDatabaseDriverPostgresqlTest.php +++ b/tests/unit/suites/database/driver/postgresql/JDatabaseDriverPostgresqlTest.php @@ -411,18 +411,30 @@ public function testGetTableSequences() $seq->schema = 'public'; $seq->table = 'jos_dbtest'; $seq->column = 'id'; - $seq->data_type = 'bigint'; - if (version_compare(self::$driver->getVersion(), '9.1.0') >= 0) + $version = self::$driver->getVersion(); + + if (version_compare($version, '9.1.0') >= 0) { $seq->start_value = '1'; $seq->minimum_value = '1'; - $seq->maximum_value = '9223372036854775807'; $seq->increment = '1'; $seq->cycle_option = 'NO'; + + if (version_compare($version, '10') >= 0) + { + $seq->data_type = 'integer'; + $seq->maximum_value = '2147483647'; + } + else + { + $seq->data_type = 'bigint'; + $seq->maximum_value = '9223372036854775807'; + } } else { + $seq->data_type = 'bigint'; $seq->minimum_value = null; $seq->maximum_value = null; $seq->increment = null; @@ -500,7 +512,7 @@ public function testGetTableList() public function testGetVersion() { $versionRow = self::$driver->setQuery('SELECT version();')->loadRow(); - preg_match('/((\d+)\.)((\d+)\.)(\*|\d+)/', $versionRow[0], $versionArray); + preg_match('/\d+(?:\.\d+)+/', $versionRow[0], $versionArray); $this->assertGreaterThanOrEqual($versionArray[0], self::$driver->getVersion()); } From b4fb261adf2bcdf7624ca850c07923e668f82c13 Mon Sep 17 00:00:00 2001 From: Tomasz Narloch Date: Thu, 9 Aug 2018 14:49:05 +0200 Subject: [PATCH 57/92] Escaping float value should be non-locale aware (#20643) * Escaping float value should be non-locale aware * Fix sqlite query dateAdd and add unit tests --- libraries/joomla/database/driver/mysql.php | 11 ++++ libraries/joomla/database/driver/mysqli.php | 11 ++++ libraries/joomla/database/driver/pdo.php | 8 ++- libraries/joomla/database/driver/pdomysql.php | 12 +++- .../joomla/database/driver/postgresql.php | 11 ++++ libraries/joomla/database/driver/sqlite.php | 8 ++- libraries/joomla/database/driver/sqlsrv.php | 11 ++++ libraries/joomla/database/query/sqlite.php | 4 +- .../driver/mysql/JDatabaseDriverMysqlTest.php | 37 ++++++++++++- .../mysqli/JDatabaseDriverMysqliTest.php | 37 ++++++++++++- .../pdomysql/JDatabaseDriverPdomysqlTest.php | 37 ++++++++++++- .../JDatabaseDriverPostgresqlTest.php | 55 +++++++++++++------ .../sqlsrv/JDatabaseDriverSqlsrvTest.php | 35 ++++++++++++ .../joomla/database/JDatabaseDriverTest.php | 4 +- 14 files changed, 253 insertions(+), 28 deletions(-) diff --git a/libraries/joomla/database/driver/mysql.php b/libraries/joomla/database/driver/mysql.php index c871efdfcffe4..e0189d9a5283a 100644 --- a/libraries/joomla/database/driver/mysql.php +++ b/libraries/joomla/database/driver/mysql.php @@ -138,6 +138,17 @@ public function disconnect() */ public function escape($text, $extra = false) { + if (is_int($text)) + { + return $text; + } + + if (is_float($text)) + { + // Force the dot as a decimal point. + return str_replace(',', '.', $text); + } + $this->connect(); $result = mysql_real_escape_string($text, $this->getConnection()); diff --git a/libraries/joomla/database/driver/mysqli.php b/libraries/joomla/database/driver/mysqli.php index e4876984b4b7d..d11c6d78b6302 100644 --- a/libraries/joomla/database/driver/mysqli.php +++ b/libraries/joomla/database/driver/mysqli.php @@ -231,6 +231,17 @@ public function disconnect() */ public function escape($text, $extra = false) { + if (is_int($text)) + { + return $text; + } + + if (is_float($text)) + { + // Force the dot as a decimal point. + return str_replace(',', '.', $text); + } + $this->connect(); $result = mysqli_real_escape_string($this->getConnection(), $text); diff --git a/libraries/joomla/database/driver/pdo.php b/libraries/joomla/database/driver/pdo.php index 6f91f97c1fdbf..353ef219ec287 100644 --- a/libraries/joomla/database/driver/pdo.php +++ b/libraries/joomla/database/driver/pdo.php @@ -341,11 +341,17 @@ public function disconnect() */ public function escape($text, $extra = false) { - if (is_int($text) || is_float($text)) + if (is_int($text)) { return $text; } + if (is_float($text)) + { + // Force the dot as a decimal point. + return str_replace(',', '.', $text); + } + $text = str_replace("'", "''", $text); return addcslashes($text, "\000\n\r\\\032"); diff --git a/libraries/joomla/database/driver/pdomysql.php b/libraries/joomla/database/driver/pdomysql.php index 057dadbf55fda..64ab49a93d83c 100644 --- a/libraries/joomla/database/driver/pdomysql.php +++ b/libraries/joomla/database/driver/pdomysql.php @@ -456,13 +456,19 @@ public function renameTable($oldTable, $newTable, $backup = null, $prefix = null */ public function escape($text, $extra = false) { - $this->connect(); - - if (is_int($text) || is_float($text)) + if (is_int($text)) { return $text; } + if (is_float($text)) + { + // Force the dot as a decimal point. + return str_replace(',', '.', $text); + } + + $this->connect(); + $result = substr($this->connection->quote($text), 1, -1); if ($extra) diff --git a/libraries/joomla/database/driver/postgresql.php b/libraries/joomla/database/driver/postgresql.php index d47c5fdfc99b1..b139d6162d12b 100644 --- a/libraries/joomla/database/driver/postgresql.php +++ b/libraries/joomla/database/driver/postgresql.php @@ -167,6 +167,17 @@ public function disconnect() */ public function escape($text, $extra = false) { + if (is_int($text)) + { + return $text; + } + + if (is_float($text)) + { + // Force the dot as a decimal point. + return str_replace(',', '.', $text); + } + $this->connect(); $result = pg_escape_string($this->connection, $text); diff --git a/libraries/joomla/database/driver/sqlite.php b/libraries/joomla/database/driver/sqlite.php index b7319577b6657..3d1c2ea27abd8 100644 --- a/libraries/joomla/database/driver/sqlite.php +++ b/libraries/joomla/database/driver/sqlite.php @@ -147,11 +147,17 @@ public function dropTable($tableName, $ifExists = true) */ public function escape($text, $extra = false) { - if (is_int($text) || is_float($text)) + if (is_int($text)) { return $text; } + if (is_float($text)) + { + // Force the dot as a decimal point. + return str_replace(',', '.', $text); + } + return SQLite3::escapeString($text); } diff --git a/libraries/joomla/database/driver/sqlsrv.php b/libraries/joomla/database/driver/sqlsrv.php index 74495279b6d93..a38647504b2a6 100644 --- a/libraries/joomla/database/driver/sqlsrv.php +++ b/libraries/joomla/database/driver/sqlsrv.php @@ -225,6 +225,17 @@ protected function renameConstraints($constraints = array(), $prefix = null, $ba */ public function escape($text, $extra = false) { + if (is_int($text)) + { + return $text; + } + + if (is_float($text)) + { + // Force the dot as a decimal point. + return str_replace(',', '.', $text); + } + $result = str_replace("'", "''", $text); // SQL Server does not accept NULL byte in query string diff --git a/libraries/joomla/database/query/sqlite.php b/libraries/joomla/database/query/sqlite.php index 53b1bbf8da288..2260606f9e0cb 100644 --- a/libraries/joomla/database/query/sqlite.php +++ b/libraries/joomla/database/query/sqlite.php @@ -245,7 +245,9 @@ public function dateAdd($date, $interval, $datePart) // SQLite does not support microseconds as a separate unit. Convert the interval to seconds if (strcasecmp($datePart, 'microseconds') == 0) { - $interval = .001 * $interval; + // Force the dot as a decimal point + $interval = str_replace(',', '.', .001 * $interval); + $datePart = 'seconds'; } diff --git a/tests/unit/suites/database/driver/mysql/JDatabaseDriverMysqlTest.php b/tests/unit/suites/database/driver/mysql/JDatabaseDriverMysqlTest.php index d46df278a7043..b6bd8029833ae 100644 --- a/tests/unit/suites/database/driver/mysql/JDatabaseDriverMysqlTest.php +++ b/tests/unit/suites/database/driver/mysql/JDatabaseDriverMysqlTest.php @@ -27,7 +27,9 @@ public function dataTestEscape() { return array( array("'%_abc123", false, '\\\'%_abc123'), - array("'%_abc123", true, '\\\'\\%\_abc123') + array("'%_abc123", true, '\\\'\\%\_abc123'), + array(3, false, 3), + array(3.14, false, '3.14'), ); } @@ -142,6 +144,39 @@ public function testEscape($text, $extra, $expected) $this->assertSame($expected, self::$driver->escape($text, $extra), 'The string was not escaped properly'); } + /** + * Tests the escape method 2. + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ + public function testEscapeNonLocaleAware() + { + $origin = setLocale(LC_NUMERIC, 0); + + // Test with decimal_point equals to comma + setLocale(LC_NUMERIC, 'pl_PL'); + + $this->assertThat( + self::$driver->escape(3.14), + $this->equalTo('3.14'), + 'The string was not escaped properly' + ); + + // Test with C locale + setLocale(LC_NUMERIC, 'C'); + + $this->assertThat( + self::$driver->escape(3.14), + $this->equalTo('3.14'), + 'The string was not escaped properly' + ); + + // Revert to origin locale + setLocale(LC_NUMERIC, $origin); + } + /** * Test the quoteName method. * diff --git a/tests/unit/suites/database/driver/mysqli/JDatabaseDriverMysqliTest.php b/tests/unit/suites/database/driver/mysqli/JDatabaseDriverMysqliTest.php index 5a9a8a8bb8248..b1c2ca3498e2e 100644 --- a/tests/unit/suites/database/driver/mysqli/JDatabaseDriverMysqliTest.php +++ b/tests/unit/suites/database/driver/mysqli/JDatabaseDriverMysqliTest.php @@ -27,7 +27,9 @@ public function dataTestEscape() { return array( array("'%_abc123", false, '\\\'%_abc123'), - array("'%_abc123", true, '\\\'\\%\_abc123') + array("'%_abc123", true, '\\\'\\%\_abc123'), + array(3, false, 3), + array(3.14, false, '3.14'), ); } @@ -142,6 +144,39 @@ public function testEscape($text, $extra, $expected) $this->assertThat(self::$driver->escape($text, $extra), $this->equalTo($expected), 'The string was not escaped properly'); } + /** + * Tests the escape method 2. + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ + public function testEscapeNonLocaleAware() + { + $origin = setLocale(LC_NUMERIC, 0); + + // Test with decimal_point equals to comma + setLocale(LC_NUMERIC, 'pl_PL'); + + $this->assertThat( + self::$driver->escape(3.14), + $this->equalTo('3.14'), + 'The string was not escaped properly' + ); + + // Test with C locale + setLocale(LC_NUMERIC, 'C'); + + $this->assertThat( + self::$driver->escape(3.14), + $this->equalTo('3.14'), + 'The string was not escaped properly' + ); + + // Revert to origin locale + setLocale(LC_NUMERIC, $origin); + } + /** * Test the quoteName method. * diff --git a/tests/unit/suites/database/driver/pdomysql/JDatabaseDriverPdomysqlTest.php b/tests/unit/suites/database/driver/pdomysql/JDatabaseDriverPdomysqlTest.php index 809c0c83449eb..4ff6039b45176 100644 --- a/tests/unit/suites/database/driver/pdomysql/JDatabaseDriverPdomysqlTest.php +++ b/tests/unit/suites/database/driver/pdomysql/JDatabaseDriverPdomysqlTest.php @@ -27,7 +27,9 @@ public function dataTestEscape() { return array( array("'%_abc123", false, '\\\'%_abc123'), - array("'%_abc123", true, '\\\'\\%\_abc123') + array("'%_abc123", true, '\\\'\\%\_abc123'), + array(3, false, 3), + array(3.14, false, '3.14'), ); } @@ -131,6 +133,39 @@ public function testEscape($text, $extra, $expected) ); } + /** + * Tests the escape method 2. + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ + public function testEscapeNonLocaleAware() + { + $origin = setLocale(LC_NUMERIC, 0); + + // Test with decimal_point equals to comma + setLocale(LC_NUMERIC, 'pl_PL'); + + $this->assertThat( + self::$driver->escape(3.14), + $this->equalTo('3.14'), + 'The string was not escaped properly' + ); + + // Test with C locale + setLocale(LC_NUMERIC, 'C'); + + $this->assertThat( + self::$driver->escape(3.14), + $this->equalTo('3.14'), + 'The string was not escaped properly' + ); + + // Revert to origin locale + setLocale(LC_NUMERIC, $origin); + } + /** * Test the quoteName method. * diff --git a/tests/unit/suites/database/driver/postgresql/JDatabaseDriverPostgresqlTest.php b/tests/unit/suites/database/driver/postgresql/JDatabaseDriverPostgresqlTest.php index 695e4fbcc52c9..492d84b1cfa8d 100644 --- a/tests/unit/suites/database/driver/postgresql/JDatabaseDriverPostgresqlTest.php +++ b/tests/unit/suites/database/driver/postgresql/JDatabaseDriverPostgresqlTest.php @@ -31,24 +31,10 @@ public function dataTestEscape() // ' and \ will be escaped: the first become '', the latter \\ array("\'%_abc123", false, '\\\\\'\'%_abc123'), - array("\'%_abc123", true, '\\\\\'\'\%\_abc123')); - } - - /** - * Data for the testGetEscaped test, proxies of escape, so same data test. - * - * @return array - * - * @since 11.3 - */ - public function dataTestGetEscaped() - { - return array( - // ' will be escaped and become '' - array("'%_abc123", false), array("'%_abc123", true), - - // ' and \ will be escaped: the first become '', the latter \\ - array("\'%_abc123", false), array("\'%_abc123", true)); + array("\'%_abc123", true, '\\\\\'\'\%\_abc123'), + array(3, false, 3), + array(3.14, false, '3.14'), + ); } /** @@ -243,6 +229,39 @@ public function testEscape($text, $extra, $result) $this->assertEquals($result, self::$driver->escape($text, $extra), 'The string was not escaped properly'); } + /** + * Tests the escape method 2. + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ + public function testEscapeNonLocaleAware() + { + $origin = setLocale(LC_NUMERIC, 0); + + // Test with decimal_point equals to comma + setLocale(LC_NUMERIC, 'pl_PL'); + + $this->assertThat( + self::$driver->escape(3.14), + $this->equalTo('3.14'), + 'The string was not escaped properly' + ); + + // Test with C locale + setLocale(LC_NUMERIC, 'C'); + + $this->assertThat( + self::$driver->escape(3.14), + $this->equalTo('3.14'), + 'The string was not escaped properly' + ); + + // Revert to origin locale + setLocale(LC_NUMERIC, $origin); + } + /** * Test getAffectedRows method. * diff --git a/tests/unit/suites/database/driver/sqlsrv/JDatabaseDriverSqlsrvTest.php b/tests/unit/suites/database/driver/sqlsrv/JDatabaseDriverSqlsrvTest.php index 685540c7363da..cdab8e6602426 100644 --- a/tests/unit/suites/database/driver/sqlsrv/JDatabaseDriverSqlsrvTest.php +++ b/tests/unit/suites/database/driver/sqlsrv/JDatabaseDriverSqlsrvTest.php @@ -28,6 +28,8 @@ public function dataTestEscape() array("'%_abc123[]", false, "''%_abc123[]"), array("'%_abc123[]", true, "''[%][_]abc123[[]]"), array("binary\000data", false, "binary' + CHAR(0) + N'data"), + array(3, false, 3), + array(3.14, false, '3.14'), ); } @@ -84,6 +86,39 @@ public function testEscape($text, $extra, $expected) ); } + /** + * Tests the escape method 2. + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ + public function testEscapeNonLocaleAware() + { + $origin = setLocale(LC_NUMERIC, 0); + + // Test with decimal_point equals to comma + setLocale(LC_NUMERIC, 'pl_PL'); + + $this->assertThat( + self::$driver->escape(3.14), + $this->equalTo('3.14'), + 'The string was not escaped properly' + ); + + // Test with C locale + setLocale(LC_NUMERIC, 'C'); + + $this->assertThat( + self::$driver->escape(3.14), + $this->equalTo('3.14'), + 'The string was not escaped properly' + ); + + // Revert to origin locale + setLocale(LC_NUMERIC, $origin); + } + /** * Test the quoteName method. * diff --git a/tests/unit/suites/libraries/joomla/database/JDatabaseDriverTest.php b/tests/unit/suites/libraries/joomla/database/JDatabaseDriverTest.php index a91ab87078545..80bcacacd1876 100644 --- a/tests/unit/suites/libraries/joomla/database/JDatabaseDriverTest.php +++ b/tests/unit/suites/libraries/joomla/database/JDatabaseDriverTest.php @@ -445,9 +445,11 @@ public function testQuoteInteger() */ public function testQuoteFloat() { + // This call `escape()` method from nosqldriver, which is locale aware $this->assertThat( + // Below line may generate "'-3.14-'" or "'-3,14-'" $this->db->quote(3.14), - $this->equalTo("'-3.14-'"), + $this->equalTo("'-" . 3.14 . "-'"), 'Tests handling of float with escaping (default).' ); } From c83103ef33fce177049218c44dcf413273c4eb36 Mon Sep 17 00:00:00 2001 From: Elijah Madden Date: Thu, 9 Aug 2018 21:49:48 +0900 Subject: [PATCH 58/92] Fix errors exposed by strict and also improve js (#20221) * Don't need a closure, jQuery ready function is enough. Use strict. * Radio buttons and tooltips work in subforms. * Make chose colors work in dynamically added Chosen (in new subform rows, for example) * Combine the two init functions as one. No reason to call two functions here. --- administrator/templates/isis/js/template.js | 153 ++++++++------------ 1 file changed, 58 insertions(+), 95 deletions(-) diff --git a/administrator/templates/isis/js/template.js b/administrator/templates/isis/js/template.js index d42adc59a8269..19bed63eb52b6 100644 --- a/administrator/templates/isis/js/template.js +++ b/administrator/templates/isis/js/template.js @@ -12,112 +12,77 @@ jQuery(function($) var $w = $(window); - $('*[rel=tooltip]').tooltip(); - - // Turn radios into btn-group - $('.radio.btn-group label').addClass('btn'); + $(document.body) + // add color classes to chosen field based on value + .on('liszt:ready', 'select[class^="chzn-color"], select[class*=" chzn-color"]', function() { + var $select = $(this); + var cls = this.className.replace(/^.(chzn-color[a-z0-9-_]*)$.*/, '$1'); + var $container = $select.next('.chzn-container').find('.chzn-single'); + + $container.addClass(cls).attr('rel', 'value_' + $select.val()); + $select.on('change click', function() { + $container.attr('rel', 'value_' + $select.val()); + }); + }) + // Handle clicks to button groups + .on('click', '.btn-group label:not(.active)', function() { + var $label = $(this); + var $input = $('#' + $label.attr('for')); - $('fieldset.btn-group').each(function() { - // Handle disabled, prevent clicks on the container, and add disabled style to each button - if ($(this).prop('disabled')) { - $(this).css('pointer-events', 'none').off('click'); - $(this).find('.btn').addClass('disabled'); - } - }); + if ($input.prop('checked')) + { + return; + } - $('.btn-group label:not(.active)').click(function() - { - var label = $(this); - var input = $('#' + label.attr('for')); + $label.closest('.btn-group').find('label').removeClass('active btn-success btn-danger btn-primary'); - if (!input.prop('checked')) - { - label.closest('.btn-group').find('label').removeClass('active btn-success btn-danger btn-primary'); + var btnClass = 'primary'; - if (label.closest('.btn-group').hasClass('btn-group-reversed')) + if ($input.val() != '') { - if (input.val() == '') - { - label.addClass('active btn-primary'); - } - else if (input.val() == 0) - { - label.addClass('active btn-success'); - } - else - { - label.addClass('active btn-danger'); - } + var reversed = $label.closest('.btn-group').hasClass('btn-group-reversed'); + btnClass = ($input.val() == 0 ? !reversed : reversed) ? 'danger' : 'success'; } - else - { - if (input.val() == '') - { - label.addClass('active btn-primary'); - } - else if (input.val() == 0) - { - label.addClass('active btn-danger'); - } - else - { - label.addClass('active btn-success'); - } - } - input.prop('checked', true); - input.trigger('change'); - } - }); - $('.btn-group input[checked=checked]').each(function() + $label.addClass('active btn-' + btnClass); + $input.prop('checked', true).trigger('change'); + }) + .on('subform-row-add', initTemplate); + + initTemplate(); + + // Called once on domready, again when a subform row is added + function initTemplate(event, container) { - var $self = $(this); - var attrId = $self.attr('id'); + var $container = $(container || document); - if ($self.parent().hasClass('btn-group-reversed')) - { - if ($self.val() == '') - { - $('label[for=' + attrId + ']').addClass('active btn-primary'); - } - else if ($self.val() == 0) - { - $('label[for=' + attrId + ']').addClass('active btn-success'); - } - else - { - $('label[for=' + attrId + ']').addClass('active btn-danger'); - } - } - else - { - if ($self.val() == '') - { - $('label[for=' + attrId + ']').addClass('active btn-primary'); - } - else if ($self.val() == 0) - { - $('label[for=' + attrId + ']').addClass('active btn-danger'); - } - else + // Create tooltips + $container.find('*[rel=tooltip]').tooltip(); + + // Turn radios into btn-group + $container.find('.radio.btn-group label').addClass('btn'); + + // Handle disabled, prevent clicks on the container, and add disabled style to each button + $container.find('fieldset.btn-group:disabled').each(function() { + $(this).css('pointer-events', 'none').off('click').find('.btn').addClass('disabled'); + }); + + // Setup coloring for buttons + $container.find('.btn-group input:checked').each(function() { + var $input = $(this); + var $label = $('label[for=' + $input.attr('id') + ']'); + var btnClass = 'primary'; + + if ($input.val() != '') { - $('label[for=' + attrId + ']').addClass('active btn-success'); + var reversed = $input.parent().hasClass('btn-group-reversed'); + btnClass = ($input.val() == 0 ? !reversed : reversed) ? 'danger' : 'success'; } - } - }); - - // add color classes to chosen field based on value - $('select[class^="chzn-color"], select[class*=" chzn-color"]').on('liszt:ready', function(){ - var select = $(this); - var cls = this.className.replace(/^.(chzn-color[a-z0-9-_]*)$.*/, '$1'); - var container = select.next('.chzn-container').find('.chzn-single'); - container.addClass(cls).attr('rel', 'value_' + select.val()); - select.on('change click', function() - { - container.attr('rel', 'value_' + select.val()); + + $label.addClass('active btn-' + btnClass); }); + } - }); /** * Append submenu items to empty UL on hover allowing a scrollable dropdown @@ -249,14 +214,12 @@ jQuery(function($) } - /** * USED IN: All views with toolbar and sticky bar enabled */ var navTop; var isFixed = false; - if (document.getElementById('isisJsData') && document.getElementById('isisJsData').getAttribute('data-tmpl-sticky') == "true") { processScrollInit(); processScroll(); From bf199b045049a8f4e0154cec7b21ad2a6543cea9 Mon Sep 17 00:00:00 2001 From: Tomasz Narloch Date: Fri, 10 Aug 2018 10:40:11 +0200 Subject: [PATCH 59/92] Repair the update of database schema changes on postgreSQL (#19707) * Repair the update of database schema changes on postgreSQL * Add a better regex to split actions by comma * Remove useless code * Add a comment to sql file --- .../sql/updates/postgresql/3.1.0.sql | 6 +- .../ChangeItem/PostgresqlChangeItem.php | 177 +++++++++++++----- 2 files changed, 133 insertions(+), 50 deletions(-) diff --git a/administrator/components/com_admin/sql/updates/postgresql/3.1.0.sql b/administrator/components/com_admin/sql/updates/postgresql/3.1.0.sql index 1893538b9d3b9..d51b351a530b3 100644 --- a/administrator/components/com_admin/sql/updates/postgresql/3.1.0.sql +++ b/administrator/components/com_admin/sql/updates/postgresql/3.1.0.sql @@ -1,6 +1,10 @@ /* Changes to tables where data type conflicts exist with MySQL (mainly dealing with null values */ ALTER TABLE "#__modules" ALTER COLUMN "content" SET DEFAULT ''; -ALTER TABLE "#__updates" ALTER COLUMN "data" SET DEFAULT ''; +-- +-- The following statement has to be disabled because it conflicts with +-- a later change added with Joomla! 3.8.8 to repair the update of database schema changes +-- +-- ALTER TABLE "#__updates" ALTER COLUMN "data" SET DEFAULT ''; /* Tags database schema */ diff --git a/libraries/src/Schema/ChangeItem/PostgresqlChangeItem.php b/libraries/src/Schema/ChangeItem/PostgresqlChangeItem.php index 14be04f90974b..7cd59416cadf3 100644 --- a/libraries/src/Schema/ChangeItem/PostgresqlChangeItem.php +++ b/libraries/src/Schema/ChangeItem/PostgresqlChangeItem.php @@ -40,20 +40,28 @@ protected function buildCheckQuery() { // Initialize fields in case we can't create a check query $this->checkStatus = -1; // change status to skipped + $result = null; + $splitIntoWords = "~'[^']*'(*SKIP)(*F)|\s+~"; + $splitIntoActions = "~'[^']*'(*SKIP)(*F)|\([^)]*\)(*SKIP)(*F)|,~"; // Remove any newlines $this->updateQuery = str_replace("\n", '', $this->updateQuery); + // Remove trailing whitespace and semicolon + $this->updateQuery = rtrim($this->updateQuery, "; \t\n\r\0\x0B"); + // Fix up extra spaces around () and in general $find = array('#((\s*)\(\s*([^)\s]+)\s*)(\))#', '#(\s)(\s*)#'); $replace = array('($3)', '$1'); $updateQuery = preg_replace($find, $replace, $this->updateQuery); - $wordArray = explode(' ', $updateQuery); + $wordArray = preg_split($splitIntoWords, $updateQuery, null, PREG_SPLIT_NO_EMPTY); + + $totalWords = count($wordArray); // First, make sure we have an array of at least 6 elements // if not, we can't make a check query for this one - if (count($wordArray) < 6) + if ($totalWords < 6) { // Done with method return; @@ -64,93 +72,164 @@ protected function buildCheckQuery() if ($command === 'ALTER TABLE') { + // Check only the last action + $actions = ltrim(substr($updateQuery, strpos($updateQuery, $wordArray[2]) + strlen($wordArray[2]))); + $actions = preg_split($splitIntoActions, $actions); + + // Get the last action + $lastActionArray = preg_split($splitIntoWords, end($actions), null, PREG_SPLIT_NO_EMPTY); + + // Replace all actions by the last one + array_splice($wordArray, 3, $totalWords, $lastActionArray); + $alterCommand = strtoupper($wordArray[3] . ' ' . $wordArray[4]); if ($alterCommand === 'ADD COLUMN') { - $result = 'SELECT column_name FROM information_schema.columns WHERE table_name=' - . $this->fixQuote($wordArray[2]) . ' AND column_name=' . $this->fixQuote($wordArray[5]); + $result = 'SELECT column_name' + . ' FROM information_schema.columns' + . ' WHERE table_name=' + . $this->fixQuote($wordArray[2]) + . ' AND column_name=' . $this->fixQuote($wordArray[5]); $this->queryType = 'ADD_COLUMN'; - $this->msgElements = array($this->fixQuote($wordArray[2]), $this->fixQuote($wordArray[5])); + $this->msgElements = array( + $this->fixQuote($wordArray[2]), + $this->fixQuote($wordArray[5]) + ); } elseif ($alterCommand === 'DROP COLUMN') { - $result = 'SELECT column_name FROM information_schema.columns WHERE table_name=' - . $this->fixQuote($wordArray[2]) . ' AND column_name=' . $this->fixQuote($wordArray[5]); + $result = 'SELECT column_name' + . ' FROM information_schema.columns' + . ' WHERE table_name=' + . $this->fixQuote($wordArray[2]) + . ' AND column_name=' . $this->fixQuote($wordArray[5]); $this->queryType = 'DROP_COLUMN'; $this->checkQueryExpected = 0; - $this->msgElements = array($this->fixQuote($wordArray[2]), $this->fixQuote($wordArray[5])); + $this->msgElements = array( + $this->fixQuote($wordArray[2]), + $this->fixQuote($wordArray[5]) + ); } elseif ($alterCommand === 'ALTER COLUMN') { - if (strtoupper($wordArray[6]) === 'TYPE') + $alterAction = strtoupper($wordArray[6]); + + if ($alterAction === 'TYPE') { - $type = ''; + $type = implode(' ', array_slice($wordArray, 7)); - for ($i = 7, $iMax = count($wordArray); $i < $iMax; $i++) + if ($pos = stripos($type, ' USING ')) { - $type .= $wordArray[$i] . ' '; + $type = substr($type, 0, $pos); } if ($pos = strpos($type, '(')) { - $type = substr($type, 0, $pos); + $datatype = substr($type, 0, $pos); } - - if ($pos = strpos($type, ';')) + else { - $type = substr($type, 0, $pos); + $datatype = $type; } - $result = 'SELECT column_name, data_type FROM information_schema.columns WHERE table_name=' - . $this->fixQuote($wordArray[2]) . ' AND column_name=' . $this->fixQuote($wordArray[5]) - . ' AND data_type=' . $this->fixQuote($type); + $result = 'SELECT column_name, data_type ' + . 'FROM information_schema.columns WHERE table_name=' + . $this->fixQuote($wordArray[2]) . ' AND column_name=' + . $this->fixQuote($wordArray[5]) + . ' AND data_type=' . $this->fixQuote($datatype); + + if ($datatype === 'character varying') + { + $result .= ' AND character_maximum_length = ' . (int) substr($type, $pos + 1); + } $this->queryType = 'CHANGE_COLUMN_TYPE'; - $this->msgElements = array($this->fixQuote($wordArray[2]), $this->fixQuote($wordArray[5]), $type); + $this->msgElements = array( + $this->fixQuote($wordArray[2]), + $this->fixQuote($wordArray[5]), + $type + ); } - elseif (strtoupper($wordArray[7] . ' ' . $wordArray[8]) === 'NOT NULL') + elseif ($alterAction === 'SET') { - if (strtoupper($wordArray[6]) === 'SET') + $alterType = strtoupper($wordArray[7]); + + if ($alterType === 'NOT' && strtoupper($wordArray[8]) === 'NULL') { - // SET NOT NULL - $isNullable = $this->fixQuote('NO'); + $result = 'SELECT column_name, data_type, is_nullable' + . ' FROM information_schema.columns' + . ' WHERE table_name=' . $this->fixQuote($wordArray[2]) + . ' AND column_name=' . $this->fixQuote($wordArray[5]) + . ' AND is_nullable=' . $this->fixQuote('NO'); + + $this->queryType = 'CHANGE_COLUMN_TYPE'; + $this->msgElements = array( + $this->fixQuote($wordArray[2]), + $this->fixQuote($wordArray[5]), + 'NOT NULL' + ); } - else + elseif ($alterType === 'DEFAULT') { - // DROP NOT NULL - $isNullable = $this->fixQuote('YES'); - } + $result = 'SELECT column_name, data_type, is_nullable' + . ' FROM information_schema.columns' + . ' WHERE table_name=' . $this->fixQuote($wordArray[2]) + . ' AND column_name=' . $this->fixQuote($wordArray[5]) + . ' AND (CASE (position(' . $this->db->quote('::') . ' in column_default))' + . ' WHEN 0 THEN ' + . ' column_default = ' . $this->db->quote($wordArray[8]) + . ' ELSE ' + . ' substring(column_default, 1, (position(' . $this->db->quote('::') + . ' in column_default) -1)) = ' . $this->db->quote($wordArray[8]) + . ' END)'; - $result = 'SELECT column_name, data_type, is_nullable FROM information_schema.columns WHERE table_name=' - . $this->fixQuote($wordArray[2]) . ' AND column_name=' . $this->fixQuote($wordArray[5]) - . ' AND is_nullable=' . $isNullable; - - $this->queryType = 'CHANGE_COLUMN_TYPE'; - $this->checkQueryExpected = 1; - $this->msgElements = array($this->fixQuote($wordArray[2]), $this->fixQuote($wordArray[5]), $isNullable); + $this->queryType = 'CHANGE_COLUMN_TYPE'; + $this->msgElements = array( + $this->fixQuote($wordArray[2]), + $this->fixQuote($wordArray[5]), + 'DEFAULT ' . $wordArray[8] + ); + } } - elseif (strtoupper($wordArray[7]) === 'DEFAULT') + elseif ($alterAction === 'DROP') { - if (strtoupper($wordArray[6]) === 'SET') + $alterType = strtoupper($wordArray[7]); + + if ($alterType === 'DEFAULT') { - $isNullDef = 'IS NOT NULL'; + $result = 'SELECT column_name, data_type, is_nullable , column_default' + . ' FROM information_schema.columns' + . ' WHERE table_name=' . $this->fixQuote($wordArray[2]) + . ' AND column_name=' . $this->fixQuote($wordArray[5]) + . ' AND column_default IS NOT NULL'; + + $this->queryType = 'CHANGE_COLUMN_TYPE'; + $this->checkQueryExpected = 0; + $this->msgElements = array( + $this->fixQuote($wordArray[2]), + $this->fixQuote($wordArray[5]), + 'NOT DEFAULT' + ); } - else + elseif ($alterType === 'NOT' && strtoupper($wordArray[8]) === 'NULL') { - // DROP DEFAULT - $isNullDef = 'IS NULL'; - } + $result = 'SELECT column_name, data_type, is_nullable , column_default' + . ' FROM information_schema.columns' + . ' WHERE table_name=' . $this->fixQuote($wordArray[2]) + . ' AND column_name=' . $this->fixQuote($wordArray[5]) + . ' AND is_nullable = ' . $this->fixQuote('NO'); - $result = 'SELECT column_name, data_type, column_default FROM information_schema.columns WHERE table_name=' - . $this->fixQuote($wordArray[2]) . ' AND column_name=' . $this->fixQuote($wordArray[5]) - . ' AND column_default ' . $isNullDef; - - $this->queryType = 'CHANGE_COLUMN_TYPE'; - $this->checkQueryExpected = 1; - $this->msgElements = array($this->fixQuote($wordArray[2]), $this->fixQuote($wordArray[5]), $isNullDef); + $this->queryType = 'CHANGE_COLUMN_TYPE'; + $this->checkQueryExpected = 0; + $this->msgElements = array( + $this->fixQuote($wordArray[2]), + $this->fixQuote($wordArray[5]), + 'NULL' + ); + } } } } From 2982a6334bcf0ea38cd03a5d2d07fd421bd20e30 Mon Sep 17 00:00:00 2001 From: Robert Deutz Date: Thu, 16 Aug 2018 11:27:54 +0200 Subject: [PATCH 60/92] build a not on windows group (#21633) --- .appveyor.yml | 2 +- .../libraries/joomla/crypt/cipher/JCryptCipherSodiumTest.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 60cee9472f7bf..df4e4cfe42a19 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -130,4 +130,4 @@ before_test: test_script: - cd C:\projects\joomla-cms - - libraries/vendor/bin/phpunit -c appveyor-phpunit.xml + - ps: If ($env:php_ver_target -eq "5.6") {libraries/vendor/bin/phpunit -c appveyor-phpunit.xml --exclude-group not-on-windows } Else {libraries/vendor/bin/phpunit -c appveyor-phpunit.xml} diff --git a/tests/unit/suites/libraries/joomla/crypt/cipher/JCryptCipherSodiumTest.php b/tests/unit/suites/libraries/joomla/crypt/cipher/JCryptCipherSodiumTest.php index 2658e367f8f44..a168bcc27e2a9 100644 --- a/tests/unit/suites/libraries/joomla/crypt/cipher/JCryptCipherSodiumTest.php +++ b/tests/unit/suites/libraries/joomla/crypt/cipher/JCryptCipherSodiumTest.php @@ -40,6 +40,8 @@ public function dataStrings() * * @param string $data The decrypted data to validate * + * @group not-on-windows + * * @covers Joomla\CMS\Crypt\Cipher\SodiumCipher::decrypt * @covers Joomla\CMS\Crypt\Cipher\SodiumCipher::encrypt * @dataProvider dataStrings @@ -65,6 +67,8 @@ public function testDataEncryptionAndDecryption($data) /** * @testdox Validates keys are correctly generated * + * @group not-on-windows + * * @covers Joomla\CMS\Crypt\Cipher\SodiumCipher::generateKey */ public function testGenerateKey() From c880377e973c7389d65d5078838200c521c23c51 Mon Sep 17 00:00:00 2001 From: Ciaran Walsh Date: Thu, 16 Aug 2018 17:11:01 +0100 Subject: [PATCH 61/92] Stick permissions tab on scroll (#21637) --- administrator/templates/isis/css/template-rtl.css | 6 ++++++ administrator/templates/isis/css/template.css | 6 ++++++ .../templates/isis/less/blocks/_custom.less | 12 +++++++++++- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/administrator/templates/isis/css/template-rtl.css b/administrator/templates/isis/css/template-rtl.css index a664a1f057349..41c31a5c5cc1c 100644 --- a/administrator/templates/isis/css/template-rtl.css +++ b/administrator/templates/isis/css/template-rtl.css @@ -9029,6 +9029,12 @@ input:focus, .hero-unit .lead { font-weight: 400; } +@media (min-width: 1200px) { + #permissions .tab-content { + position: sticky; + top: 90px; + } +} .com_cpanel .well { padding: 8px 14px; border: 1px solid rgba(0,0,0,0.05); diff --git a/administrator/templates/isis/css/template.css b/administrator/templates/isis/css/template.css index 5cce4e7bbbfac..e8621d83818d3 100644 --- a/administrator/templates/isis/css/template.css +++ b/administrator/templates/isis/css/template.css @@ -9029,6 +9029,12 @@ input:focus, .hero-unit .lead { font-weight: 400; } +@media (min-width: 1200px) { + #permissions .tab-content { + position: sticky; + top: 90px; + } +} .com_cpanel .well { padding: 8px 14px; border: 1px solid rgba(0,0,0,0.05); diff --git a/administrator/templates/isis/less/blocks/_custom.less b/administrator/templates/isis/less/blocks/_custom.less index 3b0a369d3bae8..7e32b12707c88 100644 --- a/administrator/templates/isis/less/blocks/_custom.less +++ b/administrator/templates/isis/less/blocks/_custom.less @@ -291,4 +291,14 @@ textarea:focus, input:focus, .uneditable-input:focus { /* Overrid font-weight 200 */ .lead, .navbar .brand, .hero-unit, .hero-unit .lead { font-weight: 400; -} \ No newline at end of file +} + +/* Stick permissions tab */ +@media (min-width: @xl) { + #permissions { + .tab-content { + position: sticky; + top: 90px; + } + } +} From c506eac3d31abeea778999cbcdf7b9dfc7abafa3 Mon Sep 17 00:00:00 2001 From: Robert Deutz Date: Fri, 17 Aug 2018 14:56:10 +0200 Subject: [PATCH 62/92] add a note why we have a not-on-windows group --- .../libraries/joomla/crypt/cipher/JCryptCipherSodiumTest.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/unit/suites/libraries/joomla/crypt/cipher/JCryptCipherSodiumTest.php b/tests/unit/suites/libraries/joomla/crypt/cipher/JCryptCipherSodiumTest.php index a168bcc27e2a9..ae7052e6adab2 100644 --- a/tests/unit/suites/libraries/joomla/crypt/cipher/JCryptCipherSodiumTest.php +++ b/tests/unit/suites/libraries/joomla/crypt/cipher/JCryptCipherSodiumTest.php @@ -41,6 +41,7 @@ public function dataStrings() * @param string $data The decrypted data to validate * * @group not-on-windows + * @note Key generation takes very long on Windows/PHP5.6, build a group allows to exclude this test * * @covers Joomla\CMS\Crypt\Cipher\SodiumCipher::decrypt * @covers Joomla\CMS\Crypt\Cipher\SodiumCipher::encrypt @@ -68,6 +69,7 @@ public function testDataEncryptionAndDecryption($data) * @testdox Validates keys are correctly generated * * @group not-on-windows + * @note Key generation takes very long on Windows/PHP5.6, build a group allows to exclude this test * * @covers Joomla\CMS\Crypt\Cipher\SodiumCipher::generateKey */ From c8095c4b9237a88ff9d2196d6f627df3ba47f380 Mon Sep 17 00:00:00 2001 From: Robert Deutz Date: Sat, 18 Aug 2018 14:02:38 +0200 Subject: [PATCH 63/92] =?UTF-8?q?I=20will=20use=20tabs,=20I=20will=20use?= =?UTF-8?q?=20tabs,=20I=20will=20use=20tabs,=20=E2=80=A6.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../libraries/joomla/crypt/cipher/JCryptCipherSodiumTest.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/unit/suites/libraries/joomla/crypt/cipher/JCryptCipherSodiumTest.php b/tests/unit/suites/libraries/joomla/crypt/cipher/JCryptCipherSodiumTest.php index ae7052e6adab2..69155751b551a 100644 --- a/tests/unit/suites/libraries/joomla/crypt/cipher/JCryptCipherSodiumTest.php +++ b/tests/unit/suites/libraries/joomla/crypt/cipher/JCryptCipherSodiumTest.php @@ -41,7 +41,7 @@ public function dataStrings() * @param string $data The decrypted data to validate * * @group not-on-windows - * @note Key generation takes very long on Windows/PHP5.6, build a group allows to exclude this test + * @note Key generation takes very long on Windows/PHP5.6, build a group allows to exclude this test * * @covers Joomla\CMS\Crypt\Cipher\SodiumCipher::decrypt * @covers Joomla\CMS\Crypt\Cipher\SodiumCipher::encrypt @@ -69,7 +69,7 @@ public function testDataEncryptionAndDecryption($data) * @testdox Validates keys are correctly generated * * @group not-on-windows - * @note Key generation takes very long on Windows/PHP5.6, build a group allows to exclude this test + * @note Key generation takes very long on Windows/PHP5.6, build a group allows to exclude this test * * @covers Joomla\CMS\Crypt\Cipher\SodiumCipher::generateKey */ From aed17e0681e07339b3b05cf06c63e19018682396 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Smoli=C5=84ski?= Date: Sat, 18 Aug 2018 16:21:20 +0200 Subject: [PATCH 64/92] Update CODEOWNERS after github nick chenge (#21688) --- .github/CODEOWNERS | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 3af433d8336f1..0ca00d82e240e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -42,7 +42,7 @@ libraries/src/Updater/* @mbabker @rdeutz @wilsonge @zero-24 build/jenkins/* @mbabker @rdeutz build/travis/* @mbabker @rdeutz tests/codeception/* @rdeutz -tests/javascript/* @dgt41 @rdeutz +tests/javascript/* @dgrammatiko @rdeutz tests/unit/* @mbabker @rdeutz .appveyor.yml @mbabker @rdeutz .drone.yml @rdeutz @@ -50,11 +50,11 @@ tests/unit/* @mbabker @rdeutz .travis.yml @mbabker @rdeutz appveyor-phpunit.xml @mbabker @rdeutz codeception.yml @rdeutz -karma.conf.js @dgt41 @rdeutz +karma.conf.js @dgrammatiko @rdeutz phpunit.xml.dist @mbabker @rdeutz RoboFile.dist.ini @rdeutz RoboFile.php @rdeutz travis-phpunit.xml @mbabker @rdeutz # Core JS -media/*/js/* @dgt41 +media/*/js/* @dgrammatiko From 2cd00da1ad34ca39dc4d1ffd0f24e930db04aa3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Smoli=C5=84ski?= Date: Sat, 18 Aug 2018 17:26:50 +0200 Subject: [PATCH 65/92] Add .editorconfig to this repository (#21686) --- .editorconfig | 12 ++++++++++++ .gitignore | 1 - build/build.php | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000000000..287896868eaa4 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +# EditorConfig is awesome: http://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +indent_style = tab +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true diff --git a/.gitignore b/.gitignore index fea6b1c925bcc..e17b0bc274afa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ # IDE & System Related Files # .buildpath -.editorconfig .project .settings .DS_Store diff --git a/build/build.php b/build/build.php index 70a7406497d07..f3c626acb8522 100644 --- a/build/build.php +++ b/build/build.php @@ -149,6 +149,7 @@ function usage($command) $doNotPackage = array( '.appveyor.yml', '.drone.yml', + '.editorconfig', '.github', '.gitignore', '.hound.yml', From 742d8c4317efab1425f11e71b50f7fd294f3c774 Mon Sep 17 00:00:00 2001 From: Elijah Madden Date: Sun, 19 Aug 2018 00:54:19 +0900 Subject: [PATCH 66/92] Set option by mime type, not by mode name (#21515) --- .../editors/codemirror/layouts/editors/codemirror/init.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/editors/codemirror/layouts/editors/codemirror/init.php b/plugins/editors/codemirror/layouts/editors/codemirror/init.php index 4e9d7fd599e86..3b9715a76a68b 100644 --- a/plugins/editors/codemirror/layouts/editors/codemirror/init.php +++ b/plugins/editors/codemirror/layouts/editors/codemirror/init.php @@ -51,9 +51,9 @@ cm.autoLoadMode(editor, mode ? mode.mode : editor.options.mode); - if (mode) + if (mode && mode.mime) { - editor.setOption('mode', mode.mode); + editor.setOption('mode', mode.mime); } // Handle gutter clicks (place or remove a marker). From 903c3d5a927df64a03933426a7efb03982a0f84e Mon Sep 17 00:00:00 2001 From: SharkyKZ Date: Sat, 18 Aug 2018 18:55:06 +0300 Subject: [PATCH 67/92] [com_content] Tags not shown in some cases (#21275) * [com_content] Tags not shown in some cases * Featured view * CS --- .../views/category/tmpl/blog_item.php | 16 +++++++++------- .../views/featured/tmpl/default_item.php | 14 ++++++++------ 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/components/com_content/views/category/tmpl/blog_item.php b/components/com_content/views/category/tmpl/blog_item.php index d63b2d93929e8..6d5644e3cc9cf 100644 --- a/components/com_content/views/category/tmpl/blog_item.php +++ b/components/com_content/views/category/tmpl/blog_item.php @@ -35,11 +35,11 @@ || $params->get('show_hits') || $params->get('show_category') || $params->get('show_parent_category') || $params->get('show_author') || $assocParam); ?> - + $this->item, 'params' => $params, 'position' => 'above')); ?> - get('show_tags', 1) && !empty($this->item->tags->itemTags)) : ?> - item->tags->itemTags); ?> - + +get('show_tags', 1) && !empty($this->item->tags->itemTags)) : ?> + item->tags->itemTags); ?> item); ?> @@ -54,9 +54,11 @@ item->introtext; ?> - - - $this->item, 'params' => $params, 'position' => 'below')); ?> + + + + $this->item, 'params' => $params, 'position' => 'below')); ?> + get('show_tags', 1) && !empty($this->item->tags->itemTags)) : ?> item->tags->itemTags); ?> diff --git a/components/com_content/views/featured/tmpl/default_item.php b/components/com_content/views/featured/tmpl/default_item.php index b5642c8786f8f..7b5239fec2492 100644 --- a/components/com_content/views/featured/tmpl/default_item.php +++ b/components/com_content/views/featured/tmpl/default_item.php @@ -60,9 +60,9 @@ $this->item, 'params' => $params, 'position' => 'above')); ?> - get('show_tags', 1) && !empty($this->item->tags->itemTags)) : ?> - item->tags->itemTags); ?> - + +get('show_tags', 1) && !empty($this->item->tags->itemTags)) : ?> + item->tags->itemTags); ?> image_intro) && !empty($images->image_intro)) : ?> @@ -74,9 +74,11 @@ item->introtext; ?> - - - $this->item, 'params' => $params, 'position' => 'below')); ?> + + + + $this->item, 'params' => $params, 'position' => 'below')); ?> + get('show_tags', 1) && !empty($this->item->tags->itemTags)) : ?> item->tags->itemTags); ?> From 8116f0096ac4cc220914d8c5f4ab2dd6206fb01b Mon Sep 17 00:00:00 2001 From: Quy Date: Sat, 18 Aug 2018 08:56:09 -0700 Subject: [PATCH 68/92] Fix validation messages in reverse order on installation (#20850) * Reverse error messages * Move comment --- installation/model/setup.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/installation/model/setup.php b/installation/model/setup.php index a90bd98e2908a..903b38a44529e 100644 --- a/installation/model/setup.php +++ b/installation/model/setup.php @@ -445,7 +445,9 @@ public function validate($data, $view = null) if ($return === false) { // Get the validation messages from the form. - foreach ($form->getErrors() as $message) + $messages = array_reverse($form->getErrors()); + + foreach ($messages as $message) { if ($message instanceof Exception) { From 7fe9f07061da1dc2ab36f3f9d05b0abcb18d460e Mon Sep 17 00:00:00 2001 From: George Wilson Date: Sun, 19 Aug 2018 10:57:59 +0100 Subject: [PATCH 69/92] Cleanup batch copy of items (#13501) * Cleanup batch copy of items * Fix codestyle * Banners doesn't use a title field * Fix merge conflict * Fix batch copy not copying fields --- .../components/com_banners/models/banner.php | 144 +++--------------- .../components/com_contact/models/contact.php | 95 ------------ .../components/com_content/models/article.php | 139 +++-------------- .../com_newsfeeds/models/newsfeed.php | 96 ------------ libraries/src/MVC/Model/AdminModel.php | 17 +++ 5 files changed, 61 insertions(+), 430 deletions(-) diff --git a/administrator/components/com_banners/models/banner.php b/administrator/components/com_banners/models/banner.php index bf1e662526716..c53fd9447f9aa 100644 --- a/administrator/components/com_banners/models/banner.php +++ b/administrator/components/com_banners/models/banner.php @@ -95,131 +95,6 @@ protected function batchClient($value, $pks, $contexts) return true; } - /** - * Batch copy items to a new category or current. - * - * @param integer $value The new category. - * @param array $pks An array of row IDs. - * @param array $contexts An array of item contexts. - * - * @return mixed An array of new IDs on success, boolean false on failure. - * - * @since 2.5 - */ - protected function batchCopy($value, $pks, $contexts) - { - $categoryId = (int) $value; - - /** @var BannersTableBanner $table */ - $table = $this->getTable(); - $newIds = array(); - - // Check that the category exists - if ($categoryId) - { - $categoryTable = JTable::getInstance('Category'); - - if (!$categoryTable->load($categoryId)) - { - if ($error = $categoryTable->getError()) - { - // Fatal error - $this->setError($error); - - return false; - } - - $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_MOVE_CATEGORY_NOT_FOUND')); - - return false; - } - } - - if (empty($categoryId)) - { - $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_MOVE_CATEGORY_NOT_FOUND')); - - return false; - } - - // Check that the user has create permission for the component - if (!JFactory::getUser()->authorise('core.create', 'com_banners.category.' . $categoryId)) - { - $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_CREATE')); - - return false; - } - - // Parent exists so we let's proceed - while (!empty($pks)) - { - // Pop the first ID off the stack - $pk = array_shift($pks); - - $table->reset(); - - // Check that the row actually exists - if (!$table->load($pk)) - { - if ($error = $table->getError()) - { - // Fatal error - $this->setError($error); - - return false; - } - - // Not fatal error - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); - continue; - } - - // Alter the title & alias - $data = $this->generateNewTitle($categoryId, $table->alias, $table->name); - $table->name = $data['0']; - $table->alias = $data['1']; - - // Reset the ID because we are making a copy - $table->id = 0; - - // New category ID - $table->catid = $categoryId; - - // Unpublish because we are making a copy - $table->state = 0; - - // TODO: Deal with ordering? - // $table->ordering = 1; - - // Check the row. - if (!$table->check()) - { - $this->setError($table->getError()); - - return false; - } - - // Store the row. - if (!$table->store()) - { - $this->setError($table->getError()); - - return false; - } - - // Get the new item ID - $newId = $table->get('id'); - - // Add the new ID to the array - $newIds[$pk] = $newId; - } - - // Clean the cache - $this->cleanCache(); - - return $newIds; - } - /** * Method to test whether a record can be deleted. * @@ -247,6 +122,25 @@ protected function canDelete($record) } } + /** + * A method to preprocess generating a new title in order to allow tables with alternative names + * for alias and title to use the batch move and copy methods + * + * @param integer $categoryId The target category id + * @param JTable $table The JTable within which move or copy is taking place + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ + public function generateTitle($categoryId, $table) + { + // Alter the title & alias + $data = $this->generateNewTitle($categoryId, $table->alias, $table->name); + $table->name = $data['0']; + $table->alias = $data['1']; + } + /** * Method to test whether a record can have its state changed. * diff --git a/administrator/components/com_contact/models/contact.php b/administrator/components/com_contact/models/contact.php index 936591f4979d9..0faa2d034eeb7 100644 --- a/administrator/components/com_contact/models/contact.php +++ b/administrator/components/com_contact/models/contact.php @@ -57,101 +57,6 @@ class ContactModelContact extends JModelAdmin 'user_id' => 'batchUser', ); - /** - * Batch copy items to a new category or current. - * - * @param integer $value The new category. - * @param array $pks An array of row IDs. - * @param array $contexts An array of item contexts. - * - * @return mixed An array of new IDs on success, boolean false on failure. - * - * @since 11.1 - */ - protected function batchCopy($value, $pks, $contexts) - { - $categoryId = (int) $value; - - $newIds = array(); - - if (!parent::checkCategoryId($categoryId)) - { - return false; - } - - // Parent exists so we proceed - while (!empty($pks)) - { - // Pop the first ID off the stack - $pk = array_shift($pks); - - $this->table->reset(); - - // Check that the row actually exists - if (!$this->table->load($pk)) - { - if ($error = $this->table->getError()) - { - // Fatal error - $this->setError($error); - - return false; - } - else - { - // Not fatal error - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); - continue; - } - } - - // Alter the title & alias - $data = $this->generateNewTitle($categoryId, $this->table->alias, $this->table->name); - $this->table->name = $data['0']; - $this->table->alias = $data['1']; - - // Reset the ID because we are making a copy - $this->table->id = 0; - - // New category ID - $this->table->catid = $categoryId; - - // Unpublish because we are making a copy - $this->table->published = 0; - - // TODO: Deal with ordering? - - // Check the row. - if (!$this->table->check()) - { - $this->setError($this->table->getError()); - - return false; - } - - $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table); - - // Store the row. - if (!$this->table->store()) - { - $this->setError($this->table->getError()); - - return false; - } - - // Get the new item ID - $newId = $this->table->get('id'); - - // Add the new ID to the array - $newIds[$pk] = $newId; - } - - // Clean the cache - $this->cleanCache(); - - return $newIds; - } - /** * Batch change a linked user. * diff --git a/administrator/components/com_content/models/article.php b/administrator/components/com_content/models/article.php index 868182bd67f2e..4de61547ef1c1 100644 --- a/administrator/components/com_content/models/article.php +++ b/administrator/components/com_content/models/article.php @@ -46,138 +46,49 @@ class ContentModelArticle extends JModelAdmin protected $associationsContext = 'com_content.item'; /** - * Batch copy items to a new category or current. + * Function that can be overriden to do any data cleanup after batch copying data * - * @param integer $value The new category. - * @param array $pks An array of row IDs. - * @param array $contexts An array of item contexts. + * @param \JTableInterface $table The table object containing the newly created item + * @param integer $newId The id of the new item + * @param integer $oldId The original item id * - * @return mixed An array of new IDs on success, boolean false on failure. + * @return void * - * @since 11.1 + * @since __DEPLOY_VERSION__ */ - protected function batchCopy($value, $pks, $contexts) + protected function cleanupPostBatchCopy(\JTableInterface $table, $newId, $oldId) { - $categoryId = (int) $value; - - $newIds = array(); - - if (!$this->checkCategoryId($categoryId)) + // Check if the article was featured and update the #__content_frontpage table + if ($table->featured == 1) { - return false; + $db = $this->getDbo(); + $query = $db->getQuery(true) + ->insert($db->quoteName('#__content_frontpage')) + ->values($newId . ', 0'); + $db->setQuery($query); + $db->execute(); } - JPluginHelper::importPlugin('system'); - $dispatcher = JEventDispatcher::getInstance(); - // Register FieldsHelper JLoader::register('FieldsHelper', JPATH_ADMINISTRATOR . '/components/com_fields/helpers/fields.php'); - // Parent exists so we let's proceed - while (!empty($pks)) - { - // Pop the first ID off the stack - $pk = array_shift($pks); - - $this->table->reset(); + $oldItem = $this->getTable(); + $oldItem->load($oldId); + $fields = FieldsHelper::getFields('com_content.article', $oldItem, true); - // Check that the row actually exists - if (!$this->table->load($pk)) - { - if ($error = $this->table->getError()) - { - // Fatal error - $this->setError($error); - - return false; - } - else - { - // Not fatal error - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); - continue; - } - } - - $fields = FieldsHelper::getFields('com_content.article', $this->table, true); - $fieldsData = array(); - - if (!empty($fields)) - { - $fieldsData['com_fields'] = array(); + $fieldsData = array(); - foreach ($fields as $field) - { - $fieldsData['com_fields'][$field->name] = $field->rawvalue; - } - } - - // Alter the title & alias - $data = $this->generateNewTitle($categoryId, $this->table->alias, $this->table->title); - $this->table->title = $data['0']; - $this->table->alias = $data['1']; - - // Reset the ID because we are making a copy - $this->table->id = 0; - - // Reset hits because we are making a copy - $this->table->hits = 0; - - // Unpublish because we are making a copy - $this->table->state = 0; - - // New category ID - $this->table->catid = $categoryId; - - // TODO: Deal with ordering? - // $table->ordering = 1; - - // Get the featured state - $featured = $this->table->featured; - - // Check the row. - if (!$this->table->check()) - { - $this->setError($this->table->getError()); - - return false; - } - - $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table); - - // Store the row. - if (!$this->table->store()) - { - $this->setError($this->table->getError()); - - return false; - } - - // Get the new item ID - $newId = $this->table->get('id'); - - // Add the new ID to the array - $newIds[$pk] = $newId; + if (!empty($fields)) + { + $fieldsData['com_fields'] = array(); - // Check if the article was featured and update the #__content_frontpage table - if ($featured == 1) + foreach ($fields as $field) { - $db = $this->getDbo(); - $query = $db->getQuery(true) - ->insert($db->quoteName('#__content_frontpage')) - ->values($newId . ', 0'); - $db->setQuery($query); - $db->execute(); + $fieldsData['com_fields'][$field->name] = $field->rawvalue; } - - // Run event for copied article - $dispatcher->trigger('onContentAfterSave', array('com_content.article', &$this->table, true, $fieldsData)); } - // Clean the cache - $this->cleanCache(); - - return $newIds; + JEventDispatcher::getInstance()->trigger('onContentAfterSave', array('com_content.article', &$this->table, true, $fieldsData)); } /** diff --git a/administrator/components/com_newsfeeds/models/newsfeed.php b/administrator/components/com_newsfeeds/models/newsfeed.php index 97ee58633890d..19c1c4a88c0a3 100644 --- a/administrator/components/com_newsfeeds/models/newsfeed.php +++ b/administrator/components/com_newsfeeds/models/newsfeed.php @@ -43,102 +43,6 @@ class NewsfeedsModelNewsfeed extends JModelAdmin */ protected $text_prefix = 'COM_NEWSFEEDS'; - /** - * Batch copy items to a new category or current. - * - * @param integer $value The new category. - * @param array $pks An array of row IDs. - * @param array $contexts An array of item contexts. - * - * @return mixed An array of new IDs on success, boolean false on failure. - * - * @since 11.1 - */ - protected function batchCopy($value, $pks, $contexts) - { - $categoryId = (int) $value; - - $newIds = array(); - - if (!parent::checkCategoryId($categoryId)) - { - return false; - } - - // Parent exists so we let's proceed - while (!empty($pks)) - { - // Pop the first ID off the stack - $pk = array_shift($pks); - - $this->table->reset(); - - // Check that the row actually exists - if (!$this->table->load($pk)) - { - if ($error = $this->table->getError()) - { - // Fatal error - $this->setError($error); - - return false; - } - else - { - // Not fatal error - $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); - continue; - } - } - - // Alter the title & alias - $data = $this->generateNewTitle($categoryId, $this->table->alias, $this->table->name); - $this->table->name = $data['0']; - $this->table->alias = $data['1']; - - // Reset the ID because we are making a copy - $this->table->id = 0; - - // Unpublish because we are making a copy - $this->table->published = 0; - - // New category ID - $this->table->catid = $categoryId; - - // TODO: Deal with ordering? - // $this->table->ordering = 1; - - // Check the row. - if (!$this->table->check()) - { - $this->setError($this->table->getError()); - - return false; - } - - parent::createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table); - - // Store the row. - if (!$this->table->store()) - { - $this->setError($this->table->getError()); - - return false; - } - - // Get the new item ID - $newId = $this->table->get('id'); - - // Add the new ID to the array - $newIds[$pk] = $newId; - } - - // Clean the cache - $this->cleanCache(); - - return $newIds; - } - /** * Method to test whether a record can be deleted. * diff --git a/libraries/src/MVC/Model/AdminModel.php b/libraries/src/MVC/Model/AdminModel.php index 1055717b59b91..ea21d07dad06c 100644 --- a/libraries/src/MVC/Model/AdminModel.php +++ b/libraries/src/MVC/Model/AdminModel.php @@ -486,6 +486,8 @@ protected function batchCopy($value, $pks, $contexts) // Get the new item ID $newId = $this->table->get('id'); + $this->cleanupPostBatchCopy($this->table, $newId, $pk); + // Add the new ID to the array $newIds[$pk] = $newId; } @@ -496,6 +498,21 @@ protected function batchCopy($value, $pks, $contexts) return $newIds; } + /** + * Function that can be overriden to do any data cleanup after batch copying data + * + * @param \JTableInterface $table The table object containing the newly created item + * @param integer $newId The id of the new item + * @param integer $oldId The original item id + * + * @return void + * + * @since __DEPLOY_VERSION__ + */ + protected function cleanupPostBatchCopy(\JTableInterface $table, $newId, $oldId) + { + } + /** * Batch language changes for a group of rows. * From f3094f29b480c4a84e1c632bd4395463a7adcf4a Mon Sep 17 00:00:00 2001 From: George Wilson Date: Sun, 19 Aug 2018 11:45:55 +0100 Subject: [PATCH 70/92] Better documentation for addAttachment method. Fixes #14285 --- libraries/src/Mail/Mail.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/src/Mail/Mail.php b/libraries/src/Mail/Mail.php index b886fbdbb36eb..16deb46c90a73 100644 --- a/libraries/src/Mail/Mail.php +++ b/libraries/src/Mail/Mail.php @@ -440,7 +440,8 @@ public function addBcc($bcc, $name = '') * Add file attachment to the email * * @param mixed $path Either a string or array of strings [filenames] - * @param mixed $name Either a string or array of strings [names] + * @param mixed $name Either a string or array of strings [names]. N.B. if this is an array it must contain the same + * number of elements as the array of paths supplied. * @param mixed $encoding The encoding of the attachment * @param mixed $type The mime type * @param string $disposition The disposition of the attachment From bc2b16e8ac8d9b453e6e5dc7155276a434680c78 Mon Sep 17 00:00:00 2001 From: infograf768 Date: Tue, 21 Aug 2018 03:50:19 +0000 Subject: [PATCH 71/92] [Fix] Batch menu items: Translate the menu item title when client is (#21748) administrator --- libraries/cms/html/menu.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libraries/cms/html/menu.php b/libraries/cms/html/menu.php index 4a98c6472f65f..b6bcf866febc0 100644 --- a/libraries/cms/html/menu.php +++ b/libraries/cms/html/menu.php @@ -126,6 +126,12 @@ public static function menuItems($config = array()) $lookup[$item->menutype][] = &$item; + // Translate the menu item title when client is administrator + if ($clientId === 1) + { + $item->text = JText::_($item->text); + } + $item->text = str_repeat('- ', $item->level) . $item->text; } From 9bd84285e0b42cab4a2fd2f5fa83f4a14f94ab56 Mon Sep 17 00:00:00 2001 From: George Wilson Date: Tue, 21 Aug 2018 04:50:48 +0100 Subject: [PATCH 72/92] Use the fixed menu item for open search url (#21713) * Use the fixed menu item for open search url * Fix Itemid --- modules/mod_search/mod_search.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/mod_search/mod_search.php b/modules/mod_search/mod_search.php index 5ae0e254ca9f2..3640f44cdd927 100644 --- a/modules/mod_search/mod_search.php +++ b/modules/mod_search/mod_search.php @@ -12,8 +12,10 @@ // Include the search functions only once JLoader::register('ModSearchHelper', __DIR__ . '/helper.php'); -$lang = JFactory::getLanguage(); -$app = JFactory::getApplication(); +$lang = JFactory::getLanguage(); +$app = JFactory::getApplication(); +$set_Itemid = (int) $params->get('set_itemid', 0); +$mitemid = $set_Itemid > 0 ? $set_Itemid : $app->input->getInt('Itemid'); if ($params->get('opensearch', 1)) { @@ -22,7 +24,7 @@ $ostitle = $params->get('opensearch_title', JText::_('MOD_SEARCH_SEARCHBUTTON_TEXT') . ' ' . $app->get('sitename')); $doc->addHeadLink( JUri::getInstance()->toString(array('scheme', 'host', 'port')) - . JRoute::_('&option=com_search&format=opensearch'), 'search', 'rel', + . JRoute::_('&option=com_search&format=opensearch&Itemid=' . $mitemid), 'search', 'rel', array( 'title' => htmlspecialchars($ostitle, ENT_COMPAT, 'UTF-8'), 'type' => 'application/opensearchdescription+xml' @@ -39,7 +41,6 @@ $maxlength = $upper_limit; $text = htmlspecialchars($params->get('text', JText::_('MOD_SEARCH_SEARCHBOX_TEXT')), ENT_COMPAT, 'UTF-8'); $label = htmlspecialchars($params->get('label', JText::_('MOD_SEARCH_LABEL_TEXT')), ENT_COMPAT, 'UTF-8'); -$set_Itemid = (int) $params->get('set_itemid', 0); $moduleclass_sfx = htmlspecialchars($params->get('moduleclass_sfx'), ENT_COMPAT, 'UTF-8'); if ($imagebutton) @@ -47,5 +48,4 @@ $img = ModSearchHelper::getSearchImage($button_text); } -$mitemid = $set_Itemid > 0 ? $set_Itemid : $app->input->getInt('Itemid'); require JModuleHelper::getLayoutPath('mod_search', $params->get('layout', 'default')); From a497887478aa087eaad89673aa925b195f92de25 Mon Sep 17 00:00:00 2001 From: George Wilson Date: Tue, 21 Aug 2018 04:52:17 +0100 Subject: [PATCH 73/92] Allow filtering by archived in Redirect Manager (#21673) * Allow filtering by archived state in redirect component * Fix spaces --- libraries/src/Form/Field/RedirectStatusField.php | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/src/Form/Field/RedirectStatusField.php b/libraries/src/Form/Field/RedirectStatusField.php index 47f40b1909db5..d453ccde549d0 100644 --- a/libraries/src/Form/Field/RedirectStatusField.php +++ b/libraries/src/Form/Field/RedirectStatusField.php @@ -39,6 +39,7 @@ class RedirectStatusField extends \JFormFieldPredefinedList '-2' => 'JTRASHED', '0' => 'JDISABLED', '1' => 'JENABLED', + '2' => 'JARCHIVED', '*' => 'JALL', ); } From 071476b8117b905c77ba4749191d558a02e879e6 Mon Sep 17 00:00:00 2001 From: SharkyKZ Date: Tue, 21 Aug 2018 06:53:00 +0300 Subject: [PATCH 74/92] Don't show module chromes of disabled templates (#21437) --- libraries/src/Form/Field/ChromestyleField.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/src/Form/Field/ChromestyleField.php b/libraries/src/Form/Field/ChromestyleField.php index 39a79bd94ff4f..b0548ab7dd096 100644 --- a/libraries/src/Form/Field/ChromestyleField.php +++ b/libraries/src/Form/Field/ChromestyleField.php @@ -218,7 +218,6 @@ protected function getSystemTemplate() $template = new \stdClass; $template->element = 'system'; $template->name = 'system'; - $template->enabled = 1; return $template; } @@ -238,10 +237,11 @@ protected function getTemplates() $query = $db->getQuery(true); // Build the query. - $query->select('element, name, enabled') + $query->select('element, name') ->from('#__extensions') ->where('client_id = ' . $this->clientId) - ->where('type = ' . $db->quote('template')); + ->where('type = ' . $db->quote('template')) + ->where('enabled = 1'); // Set the query and load the templates. $db->setQuery($query); From 1ae34d04ff1d54c75f11482456705c2f40b7abf4 Mon Sep 17 00:00:00 2001 From: SharkyKZ Date: Tue, 21 Aug 2018 06:53:39 +0300 Subject: [PATCH 75/92] [com_tags] All Tags default layout (#21031) --- components/com_tags/views/tags/view.html.php | 78 +++++--------------- 1 file changed, 18 insertions(+), 60 deletions(-) diff --git a/components/com_tags/views/tags/view.html.php b/components/com_tags/views/tags/view.html.php index 4d89eac1399aa..7caca68fd6887 100644 --- a/components/com_tags/views/tags/view.html.php +++ b/components/com_tags/views/tags/view.html.php @@ -37,14 +37,12 @@ class TagsViewTags extends JViewLegacy */ public function display($tpl = null) { - $app = JFactory::getApplication(); - $params = $app->getParams(); - // Get some data from the models - $state = $this->get('State'); - $items = $this->get('Items'); - $item = $this->get('Item'); - $pagination = $this->get('Pagination'); + $this->state = $this->get('State'); + $this->items = $this->get('Items'); + $this->pagination = $this->get('Pagination'); + $this->params = $this->state->get('params'); + $this->user = JFactory::getUser(); /* * // Change to catch @@ -55,12 +53,11 @@ public function display($tpl = null) // Check whether access level allows access. // @todo: Should already be computed in $item->params->get('access-view') - $user = JFactory::getUser(); - $groups = $user->getAuthorisedViewLevels(); + $groups = $this->user->getAuthorisedViewLevels(); - if (!empty($items)) + if (!empty($this->items)) { - foreach ($items as $itemElement) + foreach ($this->items as $itemElement) { if (!in_array($itemElement->access, $groups)) { @@ -69,68 +66,29 @@ public function display($tpl = null) // Prepare the data. $temp = new Registry($itemElement->params); - $itemElement->params = clone $params; + $itemElement->params = clone $this->params; $itemElement->params->merge($temp); $itemElement->params = (array) json_decode($itemElement->params); } } - $this->state = &$state; - $this->items = &$items; - $this->pagination = &$pagination; - $this->user = &$user; - $this->item = &$item; - // Escape strings for HTML output - $this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx')); + $this->pageclass_sfx = htmlspecialchars($this->params->get('pageclass_sfx')); - // Merge tag params. If this is single-tag view, menu params override tag params - // Otherwise, article params override menu item params - $this->params = $this->state->get('params'); - $active = $app->getMenu()->getActive(); - $temp = clone $this->params; + $active = JFactory::getApplication()->getMenu()->getActive(); - // Check to see which parameters should take priority - if ($active) + // Load layout from active query (in case it is an alternative menu item) + if ($active && $active->query['option'] === 'com_tags' && $active->query['view'] === 'tags') { - $currentLink = $active->link; - - // If the current view is the active item and the tags view, then the menu item params take priority - if (strpos($currentLink, 'view=tags')) + if (isset($active->query['layout'])) { - $this->params = $active->params; - $this->params->merge($temp); - - // Load layout from active query (in case it is an alternative menu item) - if (isset($active->query['layout'])) - { - $this->setLayout($active->query['layout']); - } - } - else - { - // Current view is not a single tag, so the tag params take priority here - // Merge the menu item params with the tag params so that the tag params take priority - $temp->merge($item->params); - $item->params = $temp; - - // Check for alternative layouts (since we are not in a single-article menu item) - // Single tag menu item layout takes priority over alt layout for a tag - if ($layout = $item->params->get('tag_layout')) - { - $this->setLayout($layout); - } + $this->setLayout($active->query['layout']); } } - elseif (!empty($items[0])) + else { - // Merge so that tag params take priority - $temp->merge($items[0]->params); - $items[0]->params = $temp; - - // Check for alternative layouts (since we are not in a single-tag menu item) - // Single-tag menu item layout takes priority over alt layout for a tag - if ($layout = $items[0]->params->get('tag_layout')) + // Load default All Tags layout from component + if ($layout = $this->params->get('tags_layout')) { $this->setLayout($layout); } From ed2fa0570ce748f643c0506e24709705007e8a02 Mon Sep 17 00:00:00 2001 From: Benjamin Trenkle Date: Tue, 21 Aug 2018 05:54:05 +0200 Subject: [PATCH 76/92] Merge Script Options recursive (#19972) --- libraries/src/Document/Document.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/src/Document/Document.php b/libraries/src/Document/Document.php index 270a87de3062b..1d710623a6e54 100644 --- a/libraries/src/Document/Document.php +++ b/libraries/src/Document/Document.php @@ -612,7 +612,7 @@ public function addScriptOptions($key, $options, $merge = true) if ($merge && is_array($options)) { - $this->scriptOptions[$key] = array_merge($this->scriptOptions[$key], $options); + $this->scriptOptions[$key] = array_replace_recursive($this->scriptOptions[$key], $options); } else { From 895a14857d5b216128544e6ba098569f09e220b7 Mon Sep 17 00:00:00 2001 From: Frank Mayer Date: Tue, 21 Aug 2018 06:56:56 +0300 Subject: [PATCH 77/92] Work on indexer (#12253) * Merge some unset() * Lots of work on the indexer itself: - Type safe comparisons - a few simplifications - a few performance optimizations * Some Elvis's and a missing @since annotation * One more StringHelper... * Codestyle... * Not to potentially break BC, reversed back to `!empty($var)` operation but with the non inverted style `(bool) $var` * Formatting * Fix formatting * Revert this change for now. Look into it later again. * Codesniffer... * Removed repeated `use` * Some extra work according to @andrepereiradasilva's notes * Additional changes according to reviewer's comments * Code style * Fix misbehavior due to not correctly handling the single object case of mixed variable (array|object) * Pass float value to db->escape as float may produce problems for some locales. * "Make values float again" - (pun intended) --- .../com_finder/helpers/indexer/adapter.php | 11 +- .../helpers/indexer/driver/mysql.php | 3 +- .../helpers/indexer/driver/postgresql.php | 7 +- .../helpers/indexer/driver/sqlsrv.php | 5 +- .../com_finder/helpers/indexer/helper.php | 29 +++-- .../com_finder/helpers/indexer/indexer.php | 35 ++--- .../helpers/indexer/parser/html.php | 2 + .../com_finder/helpers/indexer/parser/rtf.php | 6 +- .../com_finder/helpers/indexer/query.php | 122 +++++++++--------- .../com_finder/helpers/indexer/result.php | 11 +- .../com_finder/helpers/indexer/stemmer/fr.php | 27 ++-- .../helpers/indexer/stemmer/porter_en.php | 34 ++--- .../helpers/indexer/stemmer/snowball.php | 2 +- .../com_finder/helpers/indexer/taxonomy.php | 4 +- .../com_finder/helpers/indexer/token.php | 30 ++++- cli/finder_indexer.php | 8 +- 16 files changed, 178 insertions(+), 158 deletions(-) diff --git a/administrator/components/com_finder/helpers/indexer/adapter.php b/administrator/components/com_finder/helpers/indexer/adapter.php index 6ef6b2e422958..990b645f507d7 100644 --- a/administrator/components/com_finder/helpers/indexer/adapter.php +++ b/administrator/components/com_finder/helpers/indexer/adapter.php @@ -160,7 +160,7 @@ public function __construct(&$subject, $config) /** * Method to get the adapter state and push it into the indexer. * - * @return boolean True on success. + * @return void * * @since 2.5 * @throws Exception on error. @@ -312,7 +312,7 @@ abstract protected function index(FinderIndexerResult $item); * * @param integer $id The ID of the item to reindex. * - * @return boolean True on success. + * @return void * * @since 2.5 * @throws Exception on database error. @@ -902,12 +902,9 @@ protected function pluginDisable($pks) protected function translateState($item, $category = null) { // If category is present, factor in its states as well - if ($category !== null) + if ($category !== null && $category == 0) { - if ($category == 0) - { - $item = 0; - } + $item = 0; } // Translate the state diff --git a/administrator/components/com_finder/helpers/indexer/driver/mysql.php b/administrator/components/com_finder/helpers/indexer/driver/mysql.php index c91c1295e24a9..69892a20f815f 100644 --- a/administrator/components/com_finder/helpers/indexer/driver/mysql.php +++ b/administrator/components/com_finder/helpers/indexer/driver/mysql.php @@ -216,8 +216,7 @@ public function index($item, $format = 'html') if ($group === static::PATH_CONTEXT) { $ip = JFile::stripExt($ip); - $ip = str_replace('/', ' ', $ip); - $ip = str_replace('-', ' ', $ip); + $ip = str_replace(array('/', '-'), ' ', $ip); } // Tokenize a string of content and add it to the database. diff --git a/administrator/components/com_finder/helpers/indexer/driver/postgresql.php b/administrator/components/com_finder/helpers/indexer/driver/postgresql.php index cc3a32055eba9..9c3ea1a60c12d 100644 --- a/administrator/components/com_finder/helpers/indexer/driver/postgresql.php +++ b/administrator/components/com_finder/helpers/indexer/driver/postgresql.php @@ -58,7 +58,7 @@ public function index($item, $format = 'html') $isNew = empty($link->link_id) ? true : false; // Check the signatures. If they match, the item is up to date. - if (!$isNew && $curSig == $oldSig) + if (!$isNew && $curSig === $oldSig) { return $linkId; } @@ -208,8 +208,7 @@ public function index($item, $format = 'html') if ($group === static::PATH_CONTEXT) { $ip = JFile::stripExt($ip); - $ip = str_replace('/', ' ', $ip); - $ip = str_replace('-', ' ', $ip); + $ip = str_replace(array('/', '-'), ' ', $ip); } // Tokenize a string of content and add it to the database. @@ -328,7 +327,7 @@ public function index($item, $format = 'html') ' WHERE ta.term_id = 0' ); - if ($db->loadRow() == null) + if ($db->loadRow() === null) { $db->setQuery( 'INSERT INTO ' . $db->quoteName('#__finder_terms') . diff --git a/administrator/components/com_finder/helpers/indexer/driver/sqlsrv.php b/administrator/components/com_finder/helpers/indexer/driver/sqlsrv.php index dd975dc1e9470..922b6792dd594 100644 --- a/administrator/components/com_finder/helpers/indexer/driver/sqlsrv.php +++ b/administrator/components/com_finder/helpers/indexer/driver/sqlsrv.php @@ -66,7 +66,7 @@ public function index($item, $format = 'html') $isNew = empty($link->link_id) ? true : false; // Check the signatures. If they match, the item is up to date. - if (!$isNew && $curSig == $oldSig) + if (!$isNew && $curSig === $oldSig) { return $linkId; } @@ -216,8 +216,7 @@ public function index($item, $format = 'html') if ($group === static::PATH_CONTEXT) { $ip = JFile::stripExt($ip); - $ip = str_replace('/', ' ', $ip); - $ip = str_replace('-', ' ', $ip); + $ip = str_replace(array('/', '-'), ' ', $ip); } // Tokenize a string of content and add it to the database. diff --git a/administrator/components/com_finder/helpers/indexer/helper.php b/administrator/components/com_finder/helpers/indexer/helper.php index 3a8d3768b096c..5367f736459c9 100644 --- a/administrator/components/com_finder/helpers/indexer/helper.php +++ b/administrator/components/com_finder/helpers/indexer/helper.php @@ -64,7 +64,7 @@ public static function parse($input, $format = 'html') * @param string $lang The language of the input. * @param boolean $phrase Flag to indicate whether input could be a phrase. [optional] * - * @return array An array of FinderIndexerToken objects. + * @return array|FinderIndexerToken An array of FinderIndexerToken objects or a single FinderIndexerToken object. * * @since 2.5 */ @@ -124,14 +124,14 @@ public static function tokenize($input, $lang, $phrase = false) for ($i = 0, $n = count($terms); $i < $n; $i++) { $charMatches = array(); - $charCount = preg_match_all('#[\p{Han}]#mui', $terms[$i], $charMatches); + $charCount = preg_match_all('#[\p{Han}]#mui', $terms[$i], $charMatches); // Split apart any groups of Chinese characters. for ($j = 0; $j < $charCount; $j++) { $tSplit = StringHelper::str_ireplace($charMatches[0][$j], '', $terms[$i], false); - if (!empty($tSplit)) + if ((bool) $tSplit) { $terms[$i] = $tSplit; } @@ -177,7 +177,12 @@ public static function tokenize($input, $lang, $phrase = false) if ($i2 < $n && isset($tokens[$i2])) { // Tokenize the two word phrase. - $token = new FinderIndexerToken(array($tokens[$i]->term, $tokens[$i2]->term), $lang, $lang === 'zh' ? '' : ' '); + $token = new FinderIndexerToken( + array( + $tokens[$i]->term, + $tokens[$i2]->term + ), $lang, $lang === 'zh' ? '' : ' ' + ); $token->derived = true; // Add the token to the stack. @@ -188,7 +193,13 @@ public static function tokenize($input, $lang, $phrase = false) if ($i3 < $n && isset($tokens[$i3])) { // Tokenize the three word phrase. - $token = new FinderIndexerToken(array($tokens[$i]->term, $tokens[$i2]->term, $tokens[$i3]->term), $lang, $lang === 'zh' ? '' : ' '); + $token = new FinderIndexerToken( + array( + $tokens[$i]->term, + $tokens[$i2]->term, + $tokens[$i3]->term + ), $lang, $lang === 'zh' ? '' : ' ' + ); $token->derived = true; // Add the token to the stack. @@ -265,7 +276,7 @@ public static function addContentType($title, $mime = null) { static $types; - $db = JFactory::getDbo(); + $db = JFactory::getDbo(); $query = $db->getQuery(true); // Check if the types are loaded. @@ -432,7 +443,7 @@ public static function getContentPath($url) } // Build the relative route. - $uri = $router->build($url); + $uri = $router->build($url); $route = $uri->toString(array('path', 'query', 'fragment')); $route = str_replace(JUri::base(true) . '/', '', $route); @@ -450,7 +461,7 @@ public static function getContentPath($url) * @since 2.5 * @throws Exception on database error. */ - public static function getContentExtras(FinderIndexerResult &$item) + public static function getContentExtras(FinderIndexerResult $item) { // Get the event dispatcher. $dispatcher = JEventDispatcher::getInstance(); @@ -504,7 +515,7 @@ public static function prepareContent($text, $params = null, FinderIndexerResult } // Create a mock content object. - $content = JTable::getInstance('Content'); + $content = JTable::getInstance('Content'); $content->text = $text; if ($item) diff --git a/administrator/components/com_finder/helpers/indexer/indexer.php b/administrator/components/com_finder/helpers/indexer/indexer.php index 34af6698cf5a6..777ec513abc8f 100644 --- a/administrator/components/com_finder/helpers/indexer/indexer.php +++ b/administrator/components/com_finder/helpers/indexer/indexer.php @@ -177,7 +177,7 @@ public static function getInstance() public static function getState() { // First, try to load from the internal state. - if (!empty(static::$state)) + if ((bool) static::$state) { return static::$state; } @@ -443,8 +443,7 @@ protected function tokenizeToDb($input, $context, $lang, $format) // Parse, tokenise and add tokens to the database. $count = $this->tokenizeToDbShort($string, $context, $lang, $format, $count); - unset($string); - unset($tokens); + unset($string, $tokens); } return $count; @@ -513,20 +512,12 @@ protected function addTokensToDb($tokens, $context = '') $query = clone $this->addTokensToDbQueryTemplate; - // Check if a single FinderIndexerToken object was given and make it to be an array of FinderIndexerToken objects - $tokens = is_array($tokens) ? $tokens : array($tokens); - // Count the number of token values. $values = 0; - // Break into chunks of no more than 1000 items - $chunks = array_chunk($tokens, 1000); - - foreach ($chunks as $tokens) + // Iterate through the tokens to create SQL value sets. + if (!is_a($tokens, 'FinderIndexerToken')) { - $query->clear('values'); - - // Iterate through the tokens to create SQL value sets. foreach ($tokens as $token) { $query->values( @@ -534,15 +525,27 @@ protected function addTokensToDb($tokens, $context = '') . $db->quote($token->stem) . ', ' . (int) $token->common . ', ' . (int) $token->phrase . ', ' - . (float) $token->weight . ', ' + . $db->escape((float) $token->weight) . ', ' . (int) $context . ', ' . $db->quote($token->language) ); ++$values; } - - $db->setQuery($query)->execute(); } + else + { + $query->values( + $db->quote($tokens->term) . ', ' + . $db->quote($tokens->stem) . ', ' + . (int) $tokens->common . ', ' + . (int) $tokens->phrase . ', ' + . $db->escape((float) $tokens->weight) . ', ' + . (int) $context . ', ' + . $db->quote($tokens->language) + ); + ++$values; + } + $db->setQuery($query)->execute(); return $values; } diff --git a/administrator/components/com_finder/helpers/indexer/parser/html.php b/administrator/components/com_finder/helpers/indexer/parser/html.php index 4bf1e79b8dfce..8fcd0ac103fc3 100644 --- a/administrator/components/com_finder/helpers/indexer/parser/html.php +++ b/administrator/components/com_finder/helpers/indexer/parser/html.php @@ -98,6 +98,8 @@ protected function process($input) * @param string $endTag String representing the end tag. * * @return string with blocks removed. + * + * @since 3.4 */ private function removeBlocks($input, $startTag, $endTag) { diff --git a/administrator/components/com_finder/helpers/indexer/parser/rtf.php b/administrator/components/com_finder/helpers/indexer/parser/rtf.php index fbb2563d2c4db..d6b5acb9faddb 100644 --- a/administrator/components/com_finder/helpers/indexer/parser/rtf.php +++ b/administrator/components/com_finder/helpers/indexer/parser/rtf.php @@ -30,12 +30,12 @@ class FinderIndexerParserRtf extends FinderIndexerParser protected function process($input) { // Remove embedded pictures. - $input = preg_replace('#{\\\pict[^}]*}#mis', '', $input); + $input = preg_replace('#{\\\pict[^}]*}#mi', '', $input); // Remove control characters. $input = str_replace(array('{', '}', "\\\n"), array(' ', ' ', "\n"), $input); - $input = preg_replace('#\\\([^;]+?);#mis', ' ', $input); - $input = preg_replace('#\\\[\'a-zA-Z0-9]+#mis', ' ', $input); + $input = preg_replace('#\\\([^;]+?);#m', ' ', $input); + $input = preg_replace('#\\\[\'a-zA-Z0-9]+#mi', ' ', $input); return $input; } diff --git a/administrator/components/com_finder/helpers/indexer/query.php b/administrator/components/com_finder/helpers/indexer/query.php index 02850fc13f73c..468ee32cd7b06 100644 --- a/administrator/components/com_finder/helpers/indexer/query.php +++ b/administrator/components/com_finder/helpers/indexer/query.php @@ -188,34 +188,34 @@ public function __construct($options) $this->dates = new Registry; // Populate the temporary date storage. - if (isset($options['date1']) && !empty($options['date1'])) + if (!empty($options['date1'])) { $this->dates->set('date1', $options['date1']); } - if (isset($options['date2']) && !empty($options['date1'])) + if (!empty($options['date2'])) { $this->dates->set('date2', $options['date2']); } - if (isset($options['when1']) && !empty($options['date1'])) + if (!empty($options['when1'])) { $this->dates->set('when1', $options['when1']); } - if (isset($options['when2']) && !empty($options['date1'])) + if (!empty($options['when2'])) { $this->dates->set('when2', $options['when2']); } // Process the static taxonomy filters. - if (isset($options['filter']) && !empty($options['filter'])) + if (!empty($options['filter'])) { $this->processStaticTaxonomy($options['filter']); } // Process the dynamic taxonomy filters. - if (isset($options['filters']) && !empty($options['filters'])) + if (!empty($options['filters'])) { $this->processDynamicTaxonomy($options['filters']); } @@ -272,10 +272,10 @@ public function __construct($options) * * @since 2.5 */ - public function toUri($base = null) + public function toUri($base = '') { // Set the base if not specified. - if (empty($base)) + if ($base === '') { $base = 'index.php?option=com_finder&view=search'; } @@ -284,7 +284,7 @@ public function toUri($base = null) $uri = JUri::getInstance($base); // Add the static taxonomy filter if present. - if (!empty($this->filter)) + if ((bool) $this->filter) { $uri->setVar('f', $this->filter); } @@ -293,7 +293,7 @@ public function toUri($base = null) $t = JFactory::getApplication()->input->request->get('t', array(), 'array'); // Add the dynamic taxonomy filters if present. - if (!empty($this->filters)) + if ((bool) $this->filters) { foreach ($this->filters as $nodes) { @@ -522,7 +522,7 @@ protected function processStaticTaxonomy($filterId) $filters = ArrayHelper::toInteger($filters); // Remove any values of zero. - if (array_search(0, $filters, true) !== false) + if (in_array(0, $filters, true) !== false) { unset($filters[array_search(0, $filters, true)]); } @@ -585,7 +585,7 @@ protected function processDynamicTaxonomy($filters) $filters = ArrayHelper::toInteger($filters); // Remove any values of zero. - if (array_search(0, $filters, true) !== false) + if (in_array(0, $filters, true) !== false) { unset($filters[array_search(0, $filters, true)]); } @@ -598,6 +598,7 @@ protected function processDynamicTaxonomy($filters) // Get the database object. $db = JFactory::getDbo(); + $query = $db->getQuery(true); /* @@ -633,7 +634,7 @@ protected function processDynamicTaxonomy($filters) foreach ($results as $result) { // Check if the branch has been cleared. - if (!in_array($result->branch, $cleared)) + if (!in_array($result->branch, $cleared, true)) { // Clear the branch. $this->filters[$result->branch] = array(); @@ -690,7 +691,7 @@ protected function processDates($date1, $date2, $when1, $when2) { // Set the date filter. $this->date1 = $date->toSql(); - $this->when1 = in_array($when1, $whens) ? $when1 : 'before'; + $this->when1 = in_array($when1, $whens, true) ? $when1 : 'before'; } // The value of 'today' is a special case that we need to handle. @@ -707,7 +708,7 @@ protected function processDates($date1, $date2, $when1, $when2) { // Set the date filter. $this->date2 = $date->toSql(); - $this->when2 = in_array($when2, $whens) ? $when2 : 'before'; + $this->when2 = in_array($when2, $whens, true) ? $when2 : 'before'; } return true; @@ -814,7 +815,7 @@ protected function processString($input, $lang, $mode) { // Set the date filter. $this->date1 = $date->toSql(); - $this->when1 = in_array($modifier, $whens) ? $modifier : 'before'; + $this->when1 = in_array($modifier, $whens, true) ? $modifier : 'before'; } break; @@ -822,7 +823,7 @@ protected function processString($input, $lang, $mode) // Handle a taxonomy branch filter. default: - { + { // Try to find the node id. $return = FinderIndexerTaxonomy::getNodeByTitle($modifier, $value); @@ -830,7 +831,7 @@ protected function processString($input, $lang, $mode) if ($return) { // Check if the branch has been cleared. - if (!in_array($modifier, $cleared)) + if (!in_array($modifier, $cleared, true)) { // Clear the branch. $this->filters[$modifier] = array(); @@ -863,7 +864,7 @@ protected function processString($input, $lang, $mode) $matches = array(); // Extract the tokens enclosed in double quotes. - if (preg_match_all('#\"([^"]+)\"#mi', $input, $matches)) + if (preg_match_all('#\"([^"]+)\"#m', $input, $matches)) { /* * One or more phrases were found so we need to iterate through @@ -941,7 +942,7 @@ protected function processString($input, $lang, $mode) if (count($chunk)) { $phrases[] = implode(' ', $chunk); - $terms[] = implode(' ', $chunk); + $terms[] = implode(' ', $chunk); } } } @@ -949,14 +950,14 @@ protected function processString($input, $lang, $mode) { // The phrase is <= 3 words so we can use it as is. $phrases[] = $match; - $terms[] = $match; + $terms[] = $match; } } } } // Add the remaining terms if present. - if (!empty($input)) + if ((bool) $input) { $terms = array_merge($terms, explode(' ', $input)); } @@ -972,7 +973,7 @@ protected function processString($input, $lang, $mode) if (JDEBUG) { $debugStrings = array('**', '??'); - $operators = str_replace($debugStrings, '', $operators); + $operators = str_replace($debugStrings, '', $operators); } /* @@ -983,16 +984,18 @@ protected function processString($input, $lang, $mode) for ($i = 0, $c = count($terms); $i < $c; $i++) { // Check if the term is followed by an operator that we understand. - if (isset($terms[$i + 1]) && in_array($terms[$i + 1], $operators)) + if (isset($terms[$i + 1]) && in_array($terms[$i + 1], $operators, true)) { // Get the operator mode. - $op = array_search($terms[$i + 1], $operators); + $op = array_search($terms[$i + 1], $operators, true); // Handle the AND operator. if ($op === 'AND' && isset($terms[$i + 2])) { // Tokenize the current term. $token = FinderIndexerHelper::tokenize($terms[$i], $lang, true); + + // Todo: The previous function call may return an array, which seems not to be handled by the next one, which expects an object $token = $this->getTokenData($token); // Set the required flag. @@ -1000,7 +1003,7 @@ protected function processString($input, $lang, $mode) // Add the current token to the stack. $this->included[] = $token; - $this->highlight = array_merge($this->highlight, array_keys($token->matches)); + $this->highlight = array_merge($this->highlight, array_keys($token->matches)); // Skip the next token (the mode operator). $this->operators[] = $terms[$i + 1]; @@ -1014,23 +1017,21 @@ protected function processString($input, $lang, $mode) // Add the token after the next token to the stack. $this->included[] = $other; - $this->highlight = array_merge($this->highlight, array_keys($other->matches)); + $this->highlight = array_merge($this->highlight, array_keys($other->matches)); // Remove the processed phrases if possible. - if (($pk = array_search($terms[$i], $phrases)) !== false) + if (($pk = array_search($terms[$i], $phrases, true)) !== false) { unset($phrases[$pk]); } - if (($pk = array_search($terms[$i + 2], $phrases)) !== false) + if (($pk = array_search($terms[$i + 2], $phrases, true)) !== false) { unset($phrases[$pk]); } // Remove the processed terms. - unset($terms[$i]); - unset($terms[$i + 1]); - unset($terms[$i + 2]); + unset($terms[$i], $terms[$i + 1], $terms[$i + 2]); // Adjust the loop. $i += 2; @@ -1047,10 +1048,10 @@ protected function processString($input, $lang, $mode) $token->required = false; // Add the current token to the stack. - if (count($token->matches)) + if ((bool) $token->matches) { $this->included[] = $token; - $this->highlight = array_merge($this->highlight, array_keys($token->matches)); + $this->highlight = array_merge($this->highlight, array_keys($token->matches)); } else { @@ -1068,10 +1069,10 @@ protected function processString($input, $lang, $mode) $other->required = false; // Add the token after the next token to the stack. - if (count($other->matches)) + if ((bool) $other->matches) { $this->included[] = $other; - $this->highlight = array_merge($this->highlight, array_keys($other->matches)); + $this->highlight = array_merge($this->highlight, array_keys($other->matches)); } else { @@ -1079,20 +1080,18 @@ protected function processString($input, $lang, $mode) } // Remove the processed phrases if possible. - if (($pk = array_search($terms[$i], $phrases)) !== false) + if (($pk = array_search($terms[$i], $phrases, true)) !== false) { unset($phrases[$pk]); } - if (($pk = array_search($terms[$i + 2], $phrases)) !== false) + if (($pk = array_search($terms[$i + 2], $phrases, true)) !== false) { unset($phrases[$pk]); } // Remove the processed terms. - unset($terms[$i]); - unset($terms[$i + 1]); - unset($terms[$i + 2]); + unset($terms[$i], $terms[$i + 1], $terms[$i + 2]); // Adjust the loop. $i += 2; @@ -1100,7 +1099,7 @@ protected function processString($input, $lang, $mode) } } // Handle an orphaned OR operator. - elseif (isset($terms[$i + 1]) && array_search($terms[$i], $operators) === 'OR') + elseif (isset($terms[$i + 1]) && array_search($terms[$i], $operators, true) === 'OR') { // Skip the next token (the mode operator). $this->operators[] = $terms[$i]; @@ -1113,10 +1112,10 @@ protected function processString($input, $lang, $mode) $other->required = false; // Add the token after the next token to the stack. - if (count($other->matches)) + if ((bool) $other->matches) { $this->included[] = $other; - $this->highlight = array_merge($this->highlight, array_keys($other->matches)); + $this->highlight = array_merge($this->highlight, array_keys($other->matches)); } else { @@ -1124,21 +1123,20 @@ protected function processString($input, $lang, $mode) } // Remove the processed phrase if possible. - if (($pk = array_search($terms[$i + 1], $phrases)) !== false) + if (($pk = array_search($terms[$i + 1], $phrases, true)) !== false) { unset($phrases[$pk]); } // Remove the processed terms. - unset($terms[$i]); - unset($terms[$i + 1]); + unset($terms[$i], $terms[$i + 1]); // Adjust the loop. $i++; continue; } // Handle the NOT operator. - elseif (isset($terms[$i + 1]) && array_search($terms[$i], $operators) === 'NOT') + elseif (isset($terms[$i + 1]) && array_search($terms[$i], $operators, true) === 'NOT') { // Skip the next token (the mode operator). $this->operators[] = $terms[$i]; @@ -1151,7 +1149,7 @@ protected function processString($input, $lang, $mode) $other->required = false; // Add the next token to the stack. - if (count($other->matches)) + if ((bool) $other->matches) { $this->excluded[] = $other; } @@ -1161,14 +1159,13 @@ protected function processString($input, $lang, $mode) } // Remove the processed phrase if possible. - if (($pk = array_search($terms[$i + 1], $phrases)) !== false) + if (($pk = array_search($terms[$i + 1], $phrases, true)) !== false) { unset($phrases[$pk]); } // Remove the processed terms. - unset($terms[$i]); - unset($terms[$i + 1]); + unset($terms[$i], $terms[$i + 1]); // Adjust the loop. $i++; @@ -1192,10 +1189,10 @@ protected function processString($input, $lang, $mode) // Add the current token to the stack. $this->included[] = $token; - $this->highlight = array_merge($this->highlight, array_keys($token->matches)); + $this->highlight = array_merge($this->highlight, array_keys($token->matches)); // Remove the processed term if possible. - if (($pk = array_search($phrases[$i], $terms)) !== false) + if (($pk = array_search($phrases[$i], $terms, true)) !== false) { unset($terms[$pk]); } @@ -1207,10 +1204,10 @@ protected function processString($input, $lang, $mode) /* * Handle any remaining tokens using the standard processing mechanism. */ - if (!empty($terms)) + if ((bool) $terms) { // Tokenize the terms. - $terms = implode(' ', $terms); + $terms = implode(' ', $terms); $tokens = FinderIndexerHelper::tokenize($terms, $lang, false); // Make sure we are working with an array. @@ -1223,13 +1220,13 @@ protected function processString($input, $lang, $mode) $token = $this->getTokenData($token); // Set the required flag for the token. - $token->required = $mode === 'AND' ? ($token->phrase ? false : true) : false; + $token->required = $mode === 'AND' ? (!$token->phrase) : false; // Add the token to the appropriate stack. - if (count($token->matches) || $token->required) + if ($token->required || (bool) $token->matches) { $this->included[] = $token; - $this->highlight = array_merge($this->highlight, array_keys($token->matches)); + $this->highlight = array_merge($this->highlight, array_keys($token->matches)); } else { @@ -1299,11 +1296,8 @@ protected function getTokenData($token) $db->setQuery($query); $matches = $db->loadObjectList(); - // Setup the container. - $token->matches = array(); - // Check the matching terms. - if (!empty($matches)) + if ((bool) $matches) { // Add the matches to the token. for ($i = 0, $c = count($matches); $i < $c; $i++) @@ -1355,7 +1349,7 @@ protected function getTokenData($token) // Get the closest match. $keys = array_keys($suggestions); - $key = $keys[0]; + $key = $keys[0]; // Add the suggested term. $token->suggestion = $results[$key]->term; diff --git a/administrator/components/com_finder/helpers/indexer/result.php b/administrator/components/com_finder/helpers/indexer/result.php index 58629d069bf27..bf3590d1ca93b 100644 --- a/administrator/components/com_finder/helpers/indexer/result.php +++ b/administrator/components/com_finder/helpers/indexer/result.php @@ -324,14 +324,11 @@ public function getInstructions() public function addInstruction($group, $property) { // Check if the group exists. We can't add instructions for unknown groups. - if (array_key_exists($group, $this->instructions)) + // Check if the property exists in the group. + if (array_key_exists($group, $this->instructions) && !in_array($property, $this->instructions[$group], true)) { - // Check if the property exists in the group. - if (!in_array($property, $this->instructions[$group])) - { - // Add the property to the group. - $this->instructions[$group][] = $property; - } + // Add the property to the group. + $this->instructions[$group][] = $property; } } diff --git a/administrator/components/com_finder/helpers/indexer/stemmer/fr.php b/administrator/components/com_finder/helpers/indexer/stemmer/fr.php index 8aa080efc5fff..cd99112c4e370 100644 --- a/administrator/components/com_finder/helpers/indexer/stemmer/fr.php +++ b/administrator/components/com_finder/helpers/indexer/stemmer/fr.php @@ -27,7 +27,7 @@ class FinderIndexerStemmerFr extends FinderIndexerStemmer * @var array * @since 3.0 */ - private static $stemRules = null; + private static $stemRules; /** * Method to stem a token and return the root. @@ -48,7 +48,7 @@ public function stem($token, $lang) } // Check if the language is French or All. - if ($lang !== 'fr' && $lang != '*') + if ($lang !== 'fr' && $lang !== '*') { return $token; } @@ -216,7 +216,6 @@ private static function getStem($input) { $vars = static::getStemRules(); - $intact = true; $reversed_input = strrev(utf8_decode($input)); $rule_number = 0; @@ -225,7 +224,7 @@ private static function getStem($input) { $rule_number = self::getFirstRule($reversed_input, $rule_number); - if ($rule_number == -1) + if ($rule_number === -1) { // No other rule can be applied => the stem has been found break; @@ -234,23 +233,15 @@ private static function getStem($input) $rule = $vars['rules'][$rule_number]; preg_match($vars['rule_pattern'], $rule, $matches); - if ($matches[2] != '*' || $intact) - { - $reversed_stem = utf8_decode($matches[4]) . substr($reversed_input, $matches[3], strlen($reversed_input) - $matches[3]); + $reversed_stem = utf8_decode($matches[4]) . substr($reversed_input, $matches[3]); - if (self::check($reversed_stem)) - { - $reversed_input = $reversed_stem; + if (self::check($reversed_stem)) + { + $reversed_input = $reversed_stem; - if ($matches[5] == '.') - { - break; - } - } - else + if ($matches[5] === '.') { - // Go to another rule - $rule_number++; + break; } } else diff --git a/administrator/components/com_finder/helpers/indexer/stemmer/porter_en.php b/administrator/components/com_finder/helpers/indexer/stemmer/porter_en.php index 663cc6cf26f55..0b019c013f5fd 100644 --- a/administrator/components/com_finder/helpers/indexer/stemmer/porter_en.php +++ b/administrator/components/com_finder/helpers/indexer/stemmer/porter_en.php @@ -56,7 +56,7 @@ public function stem($token, $lang) } // Check if the language is English or All. - if ($lang !== 'en' && $lang != '*') + if ($lang !== 'en' && $lang !== '*') { return $token; } @@ -92,7 +92,7 @@ public function stem($token, $lang) private static function step1ab($word) { // Part a - if (substr($word, -1) == 's') + if (substr($word, -1) === 's') { self::replace($word, 'sses', 'ss') || self::replace($word, 'ies', 'i') @@ -101,7 +101,7 @@ private static function step1ab($word) } // Part b - if (substr($word, -2, 1) != 'e' || !self::replace($word, 'eed', 'ee', 0)) + if (substr($word, -2, 1) !== 'e' || !self::replace($word, 'eed', 'ee', 0)) { // First rule $v = self::$regex_vowel; @@ -115,11 +115,13 @@ private static function step1ab($word) if (!self::replace($word, 'at', 'ate') && !self::replace($word, 'bl', 'ble') && !self::replace($word, 'iz', 'ize')) { // Double consonant ending - if (self::doubleConsonant($word) && substr($word, -2) != 'll' && substr($word, -2) != 'ss' && substr($word, -2) != 'zz') + $wordSubStr = substr($word, -2); + + if ($wordSubStr !== 'll' && $wordSubStr !== 'ss' && $wordSubStr !== 'zz' && self::doubleConsonant($word)) { $word = substr($word, 0, -1); } - elseif (self::m($word) == 1 && self::cvc($word)) + elseif (self::m($word) === 1 && self::cvc($word)) { $word .= 'e'; } @@ -143,7 +145,7 @@ private static function step1c($word) { $v = self::$regex_vowel; - if (substr($word, -1) == 'y' && preg_match("#$v+#", substr($word, 0, -1))) + if (substr($word, -1) === 'y' && preg_match("#$v+#", substr($word, 0, -1))) { self::replace($word, 'y', 'i'); } @@ -280,7 +282,9 @@ private static function step4($word) || self::replace($word, 'ent', '', 1); break; case 'o': - if (substr($word, -4) == 'tion' || substr($word, -4) == 'sion') + $wordSubStr = substr($word, -4); + + if ($wordSubStr === 'tion' || $wordSubStr === 'sion') { self::replace($word, 'ion', '', 1); } @@ -322,13 +326,13 @@ private static function step4($word) private static function step5($word) { // Part a - if (substr($word, -1) == 'e') + if (substr($word, -1) === 'e') { if (self::m(substr($word, 0, -1)) > 1) { self::replace($word, 'e', ''); } - elseif (self::m(substr($word, 0, -1)) == 1) + elseif (self::m(substr($word, 0, -1)) === 1) { if (!self::cvc(substr($word, 0, -1))) { @@ -338,7 +342,7 @@ private static function step5($word) } // Part b - if (self::m($word) > 1 && self::doubleConsonant($word) && substr($word, -1) == 'l') + if (self::m($word) > 1 && self::doubleConsonant($word) && substr($word, -1) === 'l') { $word = substr($word, 0, -1); } @@ -365,11 +369,11 @@ private static function replace(&$str, $check, $repl, $m = null) { $len = 0 - strlen($check); - if (substr($str, $len) == $check) + if (substr($str, $len) === $check) { $substr = substr($str, 0, $len); - if (is_null($m) || self::m($substr) > $m) + if ($m === null || self::m($substr) > $m) { $str = $substr . $repl; } @@ -423,7 +427,7 @@ private static function doubleConsonant($str) { $c = self::$regex_consonant; - return preg_match("#$c{2}$#", $str, $matches) && $matches[0]{0} == $matches[0]{1}; + return preg_match("#$c{2}$#", $str, $matches) && $matches[0][0] === $matches[0][1]; } /** @@ -440,7 +444,7 @@ private static function cvc($str) $c = self::$regex_consonant; $v = self::$regex_vowel; - return preg_match("#($c$v$c)$#", $str, $matches) && strlen($matches[1]) == 3 && $matches[1]{2} != 'w' && $matches[1]{2} != 'x' - && $matches[1]{2} != 'y'; + return preg_match("#($c$v$c)$#", $str, $matches) && strlen($matches[1]) === 3 && $matches[1][2] !== 'w' && $matches[1][2] !== 'x' + && $matches[1][2] !== 'y'; } } diff --git a/administrator/components/com_finder/helpers/indexer/stemmer/snowball.php b/administrator/components/com_finder/helpers/indexer/stemmer/snowball.php index 44a8899654a72..89bdec4a85c4d 100644 --- a/administrator/components/com_finder/helpers/indexer/stemmer/snowball.php +++ b/administrator/components/com_finder/helpers/indexer/stemmer/snowball.php @@ -34,7 +34,7 @@ public function stem($token, $lang) static $defaultLang = ''; // If language is All then try to get site default language. - if ($lang == '*' && $defaultLang == '') + if ($lang === '*' && $defaultLang === '') { $languages = JLanguageHelper::getLanguages(); $defaultLang = isset($languages[0]->sef) ? $languages[0]->sef : '*'; diff --git a/administrator/components/com_finder/helpers/indexer/taxonomy.php b/administrator/components/com_finder/helpers/indexer/taxonomy.php index 92637310965b5..52c28b1d13e09 100644 --- a/administrator/components/com_finder/helpers/indexer/taxonomy.php +++ b/administrator/components/com_finder/helpers/indexer/taxonomy.php @@ -65,7 +65,7 @@ public static function addBranch($title, $state = 1, $access = 1) $result = $db->loadObject(); // Check if the database matches the input data. - if (!empty($result) && $result->state == $state && $result->access == $access) + if ((bool) $result && $result->state == $state && $result->access == $access) { // The data matches, add the item to the cache. static::$branches[$title] = $result; @@ -145,7 +145,7 @@ public static function addNode($branch, $title, $state = 1, $access = 1) $result = $db->loadObject(); // Check if the database matches the input data. - if (!empty($result) && $result->state == $state && $result->access == $access) + if ((bool) $result && $result->state == $state && $result->access == $access) { // The data matches, add the item to the cache. static::$nodes[$branch][$title] = $result; diff --git a/administrator/components/com_finder/helpers/indexer/token.php b/administrator/components/com_finder/helpers/indexer/token.php index ec8040983605d..6f7aafc4c7503 100644 --- a/administrator/components/com_finder/helpers/indexer/token.php +++ b/administrator/components/com_finder/helpers/indexer/token.php @@ -87,6 +87,30 @@ class FinderIndexerToken */ public $language; + /** + * The container for matches. + * + * @var array + * @since __DEPLOY_VERSION__ + */ + public $matches = array(); + + /** + * Is derived token (from individual words) + * + * @var boolean + * @since __DEPLOY_VERSION__ + */ + public $derived; + + /** + * The suggested term + * + * @var string + * @since __DEPLOY_VERSION__ + */ + public $suggestion; + /** * Method to construct the token object. * @@ -138,9 +162,9 @@ public function __construct($term, $lang, $spacer = ' ') * 3. If numeric, multiply weight by 1.5. * 4. Round weight to 4 decimal points. */ - $this->weight = (($this->length >= 15 ? 15 : $this->length) / 15); - $this->weight = ($this->common == true ? $this->weight / 8 : $this->weight); - $this->weight = ($this->numeric == true ? $this->weight * 1.5 : $this->weight); + $this->weight = ($this->length >= 15 ? 15 : $this->length) / 15; + $this->weight = $this->common === true ? $this->weight / 8 : $this->weight; + $this->weight = $this->numeric === true ? $this->weight * 1.5 : $this->weight; $this->weight = round($this->weight, 4); } } diff --git a/cli/finder_indexer.php b/cli/finder_indexer.php index be0746f56a962..29cb332b11b6f 100644 --- a/cli/finder_indexer.php +++ b/cli/finder_indexer.php @@ -73,7 +73,7 @@ class FinderCli extends JApplicationCli * @var string * @since 2.5 */ - private $time = null; + private $time; /** * Start time for each batch @@ -81,7 +81,7 @@ class FinderCli extends JApplicationCli * @var string * @since 2.5 */ - private $qtime = null; + private $qtime; /** * Static filters information. @@ -207,7 +207,7 @@ private function index() JEventDispatcher::getInstance()->trigger('onBuildIndex'); // Batch reporting. - $this->out(JText::sprintf('FINDER_CLI_BATCH_COMPLETE', ($i + 1), round(microtime(true) - $this->qtime, 3)), true); + $this->out(JText::sprintf('FINDER_CLI_BATCH_COMPLETE', $i + 1, round(microtime(true) - $this->qtime, 3)), true); } } catch (Exception $e) @@ -342,7 +342,7 @@ private function getFilters() foreach ($filters as $filter) { // Skip empty filters. - if ($filter->data == '') + if ($filter->data === '') { continue; } From 07e74e729a144bb0e9f1289bf10e0a8febf854a0 Mon Sep 17 00:00:00 2001 From: Brian Teeman Date: Tue, 21 Aug 2018 05:01:07 +0100 Subject: [PATCH 78/92] Tab not slider (#21694) * Tab not slider As probably the majority of people use isis and not hathor templates AND we have almost told people not to use hathor any more then we should use the correct language when describing a tab. It was only a "slider" inn joomla 2.5 and hathor but its clearly a tab in isis * grammar --- administrator/language/en-GB/en-GB.com_content.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/administrator/language/en-GB/en-GB.com_content.ini b/administrator/language/en-GB/en-GB.com_content.ini index deaddc6e90c9e..de05d7df01f79 100644 --- a/administrator/language/en-GB/en-GB.com_content.ini +++ b/administrator/language/en-GB/en-GB.com_content.ini @@ -178,14 +178,14 @@ COM_CONTENT_SAVE_WARNING="Alias already existed so a number was added at the end COM_CONTENT_SELECT_AN_ARTICLE="Select an Article" COM_CONTENT_SHARED_DESC="These settings apply for Shared Options in List, Blog and Featured unless they are changed by the menu settings." COM_CONTENT_SHARED_LABEL="Shared" -COM_CONTENT_SHOW_ARTICLE_OPTIONS_DESC="Show or hide article options slider in the Backend article edit view. These options allow overriding of the global options." +COM_CONTENT_SHOW_ARTICLE_OPTIONS_DESC="Show or hide the article options tab in the Backend article edit view. These options allow overriding of the global options." COM_CONTENT_SHOW_ARTICLE_OPTIONS_LABEL="Show Article Options" COM_CONTENT_SHOW_EMPTY_CATEGORIES_DESC="If Show, empty categories will display. A category is only empty if it has no articles or subcategories." COM_CONTENT_SHOW_IMAGES_URLS_BACK_DESC="Show or hide fields to insert images and links in the Administrator." COM_CONTENT_SHOW_IMAGES_URLS_BACK_LABEL="Administrator Images and Links" COM_CONTENT_SHOW_IMAGES_URLS_FRONT_DESC="Show or hide fields to insert images and links when Frontend editing." COM_CONTENT_SHOW_IMAGES_URLS_FRONT_LABEL="Frontend Images and Links" -COM_CONTENT_SHOW_PUBLISHING_OPTIONS_DESC="Show or hide the publishing options slider in the article edit view. These options allow changes in dates and author identities." +COM_CONTENT_SHOW_PUBLISHING_OPTIONS_DESC="Show or hide the publishing options tab in the article edit view. These options allow changes in dates and author identities." COM_CONTENT_SHOW_PUBLISHING_OPTIONS_LABEL="Show Publishing Options" COM_CONTENT_SLIDER_EDITOR_CONFIG="Configure Edit Screen" COM_CONTENT_SUBMENU_CATEGORIES="Categories" From d18979642bd5d13ae68bbdf09b6d5b484cb32f6b Mon Sep 17 00:00:00 2001 From: George Wilson Date: Tue, 21 Aug 2018 05:01:40 +0100 Subject: [PATCH 79/92] Remove debug from calendar field as it breaks saving to the DB (#21717) --- libraries/joomla/form/fields/calendar.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libraries/joomla/form/fields/calendar.php b/libraries/joomla/form/fields/calendar.php index 3bc372ff9e001..d639c006d9d0f 100644 --- a/libraries/joomla/form/fields/calendar.php +++ b/libraries/joomla/form/fields/calendar.php @@ -200,6 +200,9 @@ protected function getInput() { $showTime = (string) $this->element['showtime']; + $lang = \JFactory::getLanguage(); + $debug = $lang->setDebug(false); + if ($showTime && $showTime != 'false') { $this->format = JText::_('DATE_FORMAT_CALENDAR_DATETIME'); @@ -208,6 +211,8 @@ protected function getInput() { $this->format = JText::_('DATE_FORMAT_CALENDAR_DATE'); } + + $lang->setDebug($debug); } // If a known filter is given use it. From 6c718c0602caabe29fe7d5ebddb159676cfffe1f Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Fri, 24 Aug 2018 10:45:25 -0500 Subject: [PATCH 80/92] Prepare 3.8.12 release candidate --- administrator/components/com_banners/models/banner.php | 2 +- .../components/com_content/models/article.php | 2 +- .../components/com_finder/helpers/indexer/token.php | 6 +++--- administrator/language/en-GB/en-GB.xml | 2 +- administrator/language/en-GB/install.xml | 2 +- administrator/manifests/files/joomla.xml | 4 ++-- administrator/manifests/packages/pkg_en-GB.xml | 2 +- installation/language/en-GB/en-GB.xml | 2 +- language/en-GB/en-GB.xml | 2 +- language/en-GB/install.xml | 2 +- libraries/src/MVC/Model/AdminModel.php | 2 +- libraries/src/Version.php | 10 +++++----- .../database/driver/mysql/JDatabaseDriverMysqlTest.php | 2 +- .../driver/mysqli/JDatabaseDriverMysqliTest.php | 2 +- .../driver/pdomysql/JDatabaseDriverPdomysqlTest.php | 2 +- .../postgresql/JDatabaseDriverPostgresqlTest.php | 2 +- .../driver/sqlsrv/JDatabaseDriverSqlsrvTest.php | 2 +- 17 files changed, 24 insertions(+), 24 deletions(-) diff --git a/administrator/components/com_banners/models/banner.php b/administrator/components/com_banners/models/banner.php index c53fd9447f9aa..5be2b01b7cd1e 100644 --- a/administrator/components/com_banners/models/banner.php +++ b/administrator/components/com_banners/models/banner.php @@ -131,7 +131,7 @@ protected function canDelete($record) * * @return void * - * @since __DEPLOY_VERSION__ + * @since 3.8.12 */ public function generateTitle($categoryId, $table) { diff --git a/administrator/components/com_content/models/article.php b/administrator/components/com_content/models/article.php index 4de61547ef1c1..bc25325350562 100644 --- a/administrator/components/com_content/models/article.php +++ b/administrator/components/com_content/models/article.php @@ -54,7 +54,7 @@ class ContentModelArticle extends JModelAdmin * * @return void * - * @since __DEPLOY_VERSION__ + * @since 3.8.12 */ protected function cleanupPostBatchCopy(\JTableInterface $table, $newId, $oldId) { diff --git a/administrator/components/com_finder/helpers/indexer/token.php b/administrator/components/com_finder/helpers/indexer/token.php index 6f7aafc4c7503..e8b180fe4f972 100644 --- a/administrator/components/com_finder/helpers/indexer/token.php +++ b/administrator/components/com_finder/helpers/indexer/token.php @@ -91,7 +91,7 @@ class FinderIndexerToken * The container for matches. * * @var array - * @since __DEPLOY_VERSION__ + * @since 3.8.12 */ public $matches = array(); @@ -99,7 +99,7 @@ class FinderIndexerToken * Is derived token (from individual words) * * @var boolean - * @since __DEPLOY_VERSION__ + * @since 3.8.12 */ public $derived; @@ -107,7 +107,7 @@ class FinderIndexerToken * The suggested term * * @var string - * @since __DEPLOY_VERSION__ + * @since 3.8.12 */ public $suggestion; diff --git a/administrator/language/en-GB/en-GB.xml b/administrator/language/en-GB/en-GB.xml index c36a3ade35e7a..426ed19507082 100644 --- a/administrator/language/en-GB/en-GB.xml +++ b/administrator/language/en-GB/en-GB.xml @@ -2,7 +2,7 @@ English (en-GB) 3.8.12 - July 2018 + August 2018 Joomla! Project admin@joomla.org www.joomla.org diff --git a/administrator/language/en-GB/install.xml b/administrator/language/en-GB/install.xml index f6a160bac4ad0..5d80b84483512 100644 --- a/administrator/language/en-GB/install.xml +++ b/administrator/language/en-GB/install.xml @@ -3,7 +3,7 @@ English (en-GB) en-GB 3.8.12 - July 2018 + August 2018 Joomla! Project admin@joomla.org www.joomla.org diff --git a/administrator/manifests/files/joomla.xml b/administrator/manifests/files/joomla.xml index a30e056e7089a..56f46d34b44cc 100644 --- a/administrator/manifests/files/joomla.xml +++ b/administrator/manifests/files/joomla.xml @@ -6,8 +6,8 @@ www.joomla.org (C) 2005 - 2018 Open Source Matters. All rights reserved GNU General Public License version 2 or later; see LICENSE.txt - 3.8.12-dev - July 2018 + 3.8.12-rc + August 2018 FILES_JOOMLA_XML_DESCRIPTION administrator/components/com_admin/script.php diff --git a/administrator/manifests/packages/pkg_en-GB.xml b/administrator/manifests/packages/pkg_en-GB.xml index 5979436b613a7..8817584ec2c02 100644 --- a/administrator/manifests/packages/pkg_en-GB.xml +++ b/administrator/manifests/packages/pkg_en-GB.xml @@ -3,7 +3,7 @@ English (en-GB) Language Pack en-GB 3.8.12.1 - July 2018 + August 2018 Joomla! Project admin@joomla.org www.joomla.org diff --git a/installation/language/en-GB/en-GB.xml b/installation/language/en-GB/en-GB.xml index 4d35dfd81ce4b..d946773492f12 100644 --- a/installation/language/en-GB/en-GB.xml +++ b/installation/language/en-GB/en-GB.xml @@ -4,7 +4,7 @@ client="installation"> English (United Kingdom) 3.8.12 - July 2018 + August 2018 Joomla! Project Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/language/en-GB/en-GB.xml b/language/en-GB/en-GB.xml index 54575d5869a29..91c071485424d 100644 --- a/language/en-GB/en-GB.xml +++ b/language/en-GB/en-GB.xml @@ -2,7 +2,7 @@ English (en-GB) 3.8.12 - July 2018 + August 2018 Joomla! Project admin@joomla.org www.joomla.org diff --git a/language/en-GB/install.xml b/language/en-GB/install.xml index 7ca51b7720177..96d1e5c4164b0 100644 --- a/language/en-GB/install.xml +++ b/language/en-GB/install.xml @@ -3,7 +3,7 @@ English (en-GB) en-GB 3.8.12 - July 2018 + August 2018 Joomla! Project admin@joomla.org www.joomla.org diff --git a/libraries/src/MVC/Model/AdminModel.php b/libraries/src/MVC/Model/AdminModel.php index ea21d07dad06c..a63cedbb3848b 100644 --- a/libraries/src/MVC/Model/AdminModel.php +++ b/libraries/src/MVC/Model/AdminModel.php @@ -507,7 +507,7 @@ protected function batchCopy($value, $pks, $contexts) * * @return void * - * @since __DEPLOY_VERSION__ + * @since 3.8.12 */ protected function cleanupPostBatchCopy(\JTableInterface $table, $newId, $oldId) { diff --git a/libraries/src/Version.php b/libraries/src/Version.php index 564c48b2849b3..1442bb7d89ef7 100644 --- a/libraries/src/Version.php +++ b/libraries/src/Version.php @@ -60,7 +60,7 @@ final class Version * @var string * @since 3.8.0 */ - const EXTRA_VERSION = 'dev'; + const EXTRA_VERSION = 'rc'; /** * Release version. @@ -78,7 +78,7 @@ final class Version * @since 3.5 * @deprecated 4.0 Use separated version constants instead */ - const DEV_LEVEL = '12-dev'; + const DEV_LEVEL = '12-rc'; /** * Development status. @@ -86,7 +86,7 @@ final class Version * @var string * @since 3.5 */ - const DEV_STATUS = 'Development'; + const DEV_STATUS = 'Release Candidate'; /** * Build number. @@ -111,7 +111,7 @@ final class Version * @var string * @since 3.5 */ - const RELDATE = '31-July-2018'; + const RELDATE = '24-August-2018'; /** * Release time. @@ -119,7 +119,7 @@ final class Version * @var string * @since 3.5 */ - const RELTIME = '14:00'; + const RELTIME = '16:00'; /** * Release timezone. diff --git a/tests/unit/suites/database/driver/mysql/JDatabaseDriverMysqlTest.php b/tests/unit/suites/database/driver/mysql/JDatabaseDriverMysqlTest.php index b6bd8029833ae..d6f29f32c17f8 100644 --- a/tests/unit/suites/database/driver/mysql/JDatabaseDriverMysqlTest.php +++ b/tests/unit/suites/database/driver/mysql/JDatabaseDriverMysqlTest.php @@ -149,7 +149,7 @@ public function testEscape($text, $extra, $expected) * * @return void * - * @since __DEPLOY_VERSION__ + * @since 3.8.12 */ public function testEscapeNonLocaleAware() { diff --git a/tests/unit/suites/database/driver/mysqli/JDatabaseDriverMysqliTest.php b/tests/unit/suites/database/driver/mysqli/JDatabaseDriverMysqliTest.php index b1c2ca3498e2e..09416d76696ad 100644 --- a/tests/unit/suites/database/driver/mysqli/JDatabaseDriverMysqliTest.php +++ b/tests/unit/suites/database/driver/mysqli/JDatabaseDriverMysqliTest.php @@ -149,7 +149,7 @@ public function testEscape($text, $extra, $expected) * * @return void * - * @since __DEPLOY_VERSION__ + * @since 3.8.12 */ public function testEscapeNonLocaleAware() { diff --git a/tests/unit/suites/database/driver/pdomysql/JDatabaseDriverPdomysqlTest.php b/tests/unit/suites/database/driver/pdomysql/JDatabaseDriverPdomysqlTest.php index 4ff6039b45176..dd05eb7a2cdf1 100644 --- a/tests/unit/suites/database/driver/pdomysql/JDatabaseDriverPdomysqlTest.php +++ b/tests/unit/suites/database/driver/pdomysql/JDatabaseDriverPdomysqlTest.php @@ -138,7 +138,7 @@ public function testEscape($text, $extra, $expected) * * @return void * - * @since __DEPLOY_VERSION__ + * @since 3.8.12 */ public function testEscapeNonLocaleAware() { diff --git a/tests/unit/suites/database/driver/postgresql/JDatabaseDriverPostgresqlTest.php b/tests/unit/suites/database/driver/postgresql/JDatabaseDriverPostgresqlTest.php index 492d84b1cfa8d..9446a6275145d 100644 --- a/tests/unit/suites/database/driver/postgresql/JDatabaseDriverPostgresqlTest.php +++ b/tests/unit/suites/database/driver/postgresql/JDatabaseDriverPostgresqlTest.php @@ -234,7 +234,7 @@ public function testEscape($text, $extra, $result) * * @return void * - * @since __DEPLOY_VERSION__ + * @since 3.8.12 */ public function testEscapeNonLocaleAware() { diff --git a/tests/unit/suites/database/driver/sqlsrv/JDatabaseDriverSqlsrvTest.php b/tests/unit/suites/database/driver/sqlsrv/JDatabaseDriverSqlsrvTest.php index cdab8e6602426..fc445114fb8d6 100644 --- a/tests/unit/suites/database/driver/sqlsrv/JDatabaseDriverSqlsrvTest.php +++ b/tests/unit/suites/database/driver/sqlsrv/JDatabaseDriverSqlsrvTest.php @@ -91,7 +91,7 @@ public function testEscape($text, $extra, $expected) * * @return void * - * @since __DEPLOY_VERSION__ + * @since 3.8.12 */ public function testEscapeNonLocaleAware() { From 2b5d12aef449c99c3e8124cca7760a372b4c83c9 Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Fri, 24 Aug 2018 10:48:17 -0500 Subject: [PATCH 81/92] Reset for dev --- administrator/manifests/files/joomla.xml | 2 +- libraries/src/Version.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/administrator/manifests/files/joomla.xml b/administrator/manifests/files/joomla.xml index 56f46d34b44cc..f900126a45e4c 100644 --- a/administrator/manifests/files/joomla.xml +++ b/administrator/manifests/files/joomla.xml @@ -6,7 +6,7 @@ www.joomla.org (C) 2005 - 2018 Open Source Matters. All rights reserved GNU General Public License version 2 or later; see LICENSE.txt - 3.8.12-rc + 3.8.12-dev August 2018 FILES_JOOMLA_XML_DESCRIPTION diff --git a/libraries/src/Version.php b/libraries/src/Version.php index 1442bb7d89ef7..7c550caecb9dd 100644 --- a/libraries/src/Version.php +++ b/libraries/src/Version.php @@ -60,7 +60,7 @@ final class Version * @var string * @since 3.8.0 */ - const EXTRA_VERSION = 'rc'; + const EXTRA_VERSION = 'dev'; /** * Release version. @@ -78,7 +78,7 @@ final class Version * @since 3.5 * @deprecated 4.0 Use separated version constants instead */ - const DEV_LEVEL = '12-rc'; + const DEV_LEVEL = '12-dev'; /** * Development status. @@ -86,7 +86,7 @@ final class Version * @var string * @since 3.5 */ - const DEV_STATUS = 'Release Candidate'; + const DEV_STATUS = 'Development'; /** * Build number. From ff3b587e8183a4df8098194747c0a6122b9b4703 Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Sun, 26 Aug 2018 13:59:01 -0500 Subject: [PATCH 82/92] Prepare 3.8.12 release --- administrator/manifests/files/joomla.xml | 2 +- .../com_users/views/profile/tmpl/default_core.php | 4 ++-- libraries/src/Filter/InputFilter.php | 13 +++++++++++-- libraries/src/Form/Form.php | 9 +++++++++ libraries/src/Version.php | 10 +++++----- 5 files changed, 28 insertions(+), 10 deletions(-) diff --git a/administrator/manifests/files/joomla.xml b/administrator/manifests/files/joomla.xml index f900126a45e4c..273400a7e7bf6 100644 --- a/administrator/manifests/files/joomla.xml +++ b/administrator/manifests/files/joomla.xml @@ -6,7 +6,7 @@ www.joomla.org (C) 2005 - 2018 Open Source Matters. All rights reserved GNU General Public License version 2 or later; see LICENSE.txt - 3.8.12-dev + 3.8.12 August 2018 FILES_JOOMLA_XML_DESCRIPTION diff --git a/components/com_users/views/profile/tmpl/default_core.php b/components/com_users/views/profile/tmpl/default_core.php index a5bbd19823325..5a95493c4a5d3 100644 --- a/components/com_users/views/profile/tmpl/default_core.php +++ b/components/com_users/views/profile/tmpl/default_core.php @@ -19,13 +19,13 @@
      - data->name; ?> + escape($this->data->name); ?>
      - data->username, ENT_COMPAT, 'UTF-8'); ?> + escape($this->data->username); ?>
      diff --git a/libraries/src/Filter/InputFilter.php b/libraries/src/Filter/InputFilter.php index 3f80fc28c52b4..ff8bde2ef5d95 100644 --- a/libraries/src/Filter/InputFilter.php +++ b/libraries/src/Filter/InputFilter.php @@ -485,6 +485,7 @@ public function emailToPunycode($text) * null_byte Prevent files with a null byte in their name (buffer overflow attack) * forbidden_extensions Do not allow these strings anywhere in the file's extension * php_tag_in_content Do not allow ` true, + // __HALT_COMPILER() + 'phar_stub_in_content' => true, + // Which file extensions to scan for short tags 'shorttag_extensions' => array( 'inc', 'phps', 'class', 'php3', 'php4', 'php5', 'txt', 'dat', 'tpl', 'tmpl', @@ -620,7 +624,7 @@ public static function isSafeFile($file, $options = array()) // 3. File contents scanner (PHP tag in file contents) if ($options['php_tag_in_content'] - || $options['shorttag_in_content'] + || $options['shorttag_in_content'] || $options['phar_stub_in_content'] || ($options['fobidden_ext_in_content'] && !empty($options['forbidden_extensions']))) { $fp = @fopen($tempName, 'r'); @@ -633,7 +637,12 @@ public static function isSafeFile($file, $options = array()) { $data .= @fread($fp, 131072); - if ($options['php_tag_in_content'] && stristr($data, 'exists((string) $element['name']) || $input->exists($group . '.' . (string) $element['name']); + + // If the field is disabled but it is passed in the request this is invalid as disabled fields are not added to the request + if ($disabled && $fieldExistsInRequestData) + { + return new \RuntimeException(\JText::sprintf('JLIB_FORM_VALIDATE_FIELD_INVALID', $element['name'])); + } if ($required) { diff --git a/libraries/src/Version.php b/libraries/src/Version.php index 7c550caecb9dd..f4ef8ec0d8998 100644 --- a/libraries/src/Version.php +++ b/libraries/src/Version.php @@ -60,7 +60,7 @@ final class Version * @var string * @since 3.8.0 */ - const EXTRA_VERSION = 'dev'; + const EXTRA_VERSION = ''; /** * Release version. @@ -78,7 +78,7 @@ final class Version * @since 3.5 * @deprecated 4.0 Use separated version constants instead */ - const DEV_LEVEL = '12-dev'; + const DEV_LEVEL = '12'; /** * Development status. @@ -86,7 +86,7 @@ final class Version * @var string * @since 3.5 */ - const DEV_STATUS = 'Development'; + const DEV_STATUS = 'Stable'; /** * Build number. @@ -111,7 +111,7 @@ final class Version * @var string * @since 3.5 */ - const RELDATE = '24-August-2018'; + const RELDATE = '28-August-2018'; /** * Release time. @@ -119,7 +119,7 @@ final class Version * @var string * @since 3.5 */ - const RELTIME = '16:00'; + const RELTIME = '14:00'; /** * Release timezone. From 27ca70a097a3d64f958bfee77a21f33002c33bfc Mon Sep 17 00:00:00 2001 From: Michael Babker Date: Sun, 30 Sep 2018 15:17:23 -0500 Subject: [PATCH 83/92] Prepare 3.8.13 release --- .../com_installer/controllers/database.php | 3 ++ .../com_installer/controllers/discover.php | 6 +++ .../com_joomlaupdate/joomlaupdate.php | 2 +- administrator/language/en-GB/en-GB.xml | 4 +- administrator/language/en-GB/install.xml | 4 +- administrator/manifests/files/joomla.xml | 4 +- .../manifests/packages/pkg_en-GB.xml | 4 +- administrator/modules/mod_menu/menu.php | 4 ++ .../com_contact/controllers/contact.php | 31 ++++++++++++++- components/com_tags/controllers/tags.php | 1 + .../com_users/controllers/registration.php | 38 +++++++++++++++++++ components/com_users/models/registration.php | 31 +++++++++++---- installation/language/en-GB/en-GB.xml | 4 +- language/en-GB/en-GB.com_users.ini | 2 + language/en-GB/en-GB.xml | 4 +- language/en-GB/install.xml | 4 +- libraries/src/Helper/TagsHelper.php | 7 ++++ libraries/src/Version.php | 6 +-- 18 files changed, 131 insertions(+), 28 deletions(-) diff --git a/administrator/components/com_installer/controllers/database.php b/administrator/components/com_installer/controllers/database.php index c4f0fa936c4dd..f84243ee4e2db 100644 --- a/administrator/components/com_installer/controllers/database.php +++ b/administrator/components/com_installer/controllers/database.php @@ -26,6 +26,9 @@ class InstallerControllerDatabase extends JControllerLegacy */ public function fix() { + // Check for request forgeries. + $this->checkToken(); + $model = $this->getModel('database'); $model->fix(); diff --git a/administrator/components/com_installer/controllers/discover.php b/administrator/components/com_installer/controllers/discover.php index 28d8220c7b13f..96fe5bf01f575 100644 --- a/administrator/components/com_installer/controllers/discover.php +++ b/administrator/components/com_installer/controllers/discover.php @@ -25,6 +25,8 @@ class InstallerControllerDiscover extends JControllerLegacy */ public function refresh() { + $this->checkToken(); + $model = $this->getModel('discover'); $model->discover(); $this->setRedirect(JRoute::_('index.php?option=com_installer&view=discover', false)); @@ -39,6 +41,8 @@ public function refresh() */ public function install() { + $this->checkToken(); + $this->getModel('discover')->discover_install(); $this->setRedirect(JRoute::_('index.php?option=com_installer&view=discover', false)); } @@ -52,6 +56,8 @@ public function install() */ public function purge() { + $this->checkToken(); + $model = $this->getModel('discover'); $model->purge(); $this->setRedirect(JRoute::_('index.php?option=com_installer&view=discover', false), $model->_message); diff --git a/administrator/components/com_joomlaupdate/joomlaupdate.php b/administrator/components/com_joomlaupdate/joomlaupdate.php index 4baf72dd8186a..32f8463fce285 100644 --- a/administrator/components/com_joomlaupdate/joomlaupdate.php +++ b/administrator/components/com_joomlaupdate/joomlaupdate.php @@ -9,7 +9,7 @@ defined('_JEXEC') or die; -if (!JFactory::getUser()->authorise('core.manage', 'com_joomlaupdate')) +if (!JFactory::getUser()->authorise('core.admin', 'com_joomlaupdate')) { throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403); } diff --git a/administrator/language/en-GB/en-GB.xml b/administrator/language/en-GB/en-GB.xml index 426ed19507082..9a95470ee65fe 100644 --- a/administrator/language/en-GB/en-GB.xml +++ b/administrator/language/en-GB/en-GB.xml @@ -1,8 +1,8 @@ English (en-GB) - 3.8.12 - August 2018 + 3.8.13 + October 2018 Joomla! Project admin@joomla.org www.joomla.org diff --git a/administrator/language/en-GB/install.xml b/administrator/language/en-GB/install.xml index 5d80b84483512..3bfa75ec4be94 100644 --- a/administrator/language/en-GB/install.xml +++ b/administrator/language/en-GB/install.xml @@ -2,8 +2,8 @@ English (en-GB) en-GB - 3.8.12 - August 2018 + 3.8.13 + October 2018 Joomla! Project admin@joomla.org www.joomla.org diff --git a/administrator/manifests/files/joomla.xml b/administrator/manifests/files/joomla.xml index 273400a7e7bf6..6c79b21560ded 100644 --- a/administrator/manifests/files/joomla.xml +++ b/administrator/manifests/files/joomla.xml @@ -6,8 +6,8 @@ www.joomla.org (C) 2005 - 2018 Open Source Matters. All rights reserved GNU General Public License version 2 or later; see LICENSE.txt - 3.8.12 - August 2018 + 3.8.13 + October 2018 FILES_JOOMLA_XML_DESCRIPTION administrator/components/com_admin/script.php diff --git a/administrator/manifests/packages/pkg_en-GB.xml b/administrator/manifests/packages/pkg_en-GB.xml index 8817584ec2c02..016a9a705a591 100644 --- a/administrator/manifests/packages/pkg_en-GB.xml +++ b/administrator/manifests/packages/pkg_en-GB.xml @@ -2,8 +2,8 @@ English (en-GB) Language Pack en-GB - 3.8.12.1 - August 2018 + 3.8.13.1 + October 2018 Joomla! Project admin@joomla.org www.joomla.org diff --git a/administrator/modules/mod_menu/menu.php b/administrator/modules/mod_menu/menu.php index 882ee939227e2..56a8e4b047424 100644 --- a/administrator/modules/mod_menu/menu.php +++ b/administrator/modules/mod_menu/menu.php @@ -318,6 +318,10 @@ protected function preprocess($items) { continue; } + elseif ($item->element === 'com_joomlaupdate' && !$user->authorise('core.admin')) + { + continue; + } elseif ($item->element === 'com_admin') { parse_str($item->link, $query); diff --git a/components/com_contact/controllers/contact.php b/components/com_contact/controllers/contact.php index 00943099d0809..b0b1cddbbaeeb 100644 --- a/components/com_contact/controllers/contact.php +++ b/components/com_contact/controllers/contact.php @@ -51,10 +51,37 @@ public function submit() $id = (int) $stub; // Get the data from POST - $data = $this->input->post->get('jform', array(), 'array'); + $data = $this->input->post->get('jform', array(), 'array'); + + // Get item + $model->setState('filter.published', 1); $contact = $model->getItem($id); - $params->merge($contact->params); + // Get item params, take menu parameters into account if necessary + $active = $app->getMenu()->getActive(); + $stateParams = clone $model->getState()->get('params'); + + // If the current view is the active item and a contact view for this contact, then the menu item params take priority + if ($active && strpos($active->link, 'view=contact') && strpos($active->link, '&id=' . (int) $contact->id)) + { + // $item->params are the contact params, $temp are the menu item params + // Merge so that the menu item params take priority + $contact->params->merge($stateParams); + } + else + { + // Current view is not a single contact, so the contact params take priority here + $stateParams->merge($contact->params); + $contact->params = $stateParams; + } + + // Check if the contact form is enabled + if (!$contact->params->get('show_email_form')) + { + $this->setRedirect(JRoute::_('index.php?option=com_contact&view=contact&id=' . $stub, false)); + + return false; + } // Check for a valid session cookie if ($params->get('validate_session', 0)) diff --git a/components/com_tags/controllers/tags.php b/components/com_tags/controllers/tags.php index 397a05cf5d378..7828466e8b7bc 100644 --- a/components/com_tags/controllers/tags.php +++ b/components/com_tags/controllers/tags.php @@ -34,6 +34,7 @@ public function searchAjax() 'flanguage' => $app->input->get('flanguage', null, 'word'), 'published' => $app->input->get('published', 1, 'int'), 'parent_id' => $app->input->get('parent_id', 0, 'int'), + 'access' => $user->getAuthorisedViewLevels(), ); if ((!$user->authorise('core.edit.state', 'com_tags')) && (!$user->authorise('core.edit', 'com_tags'))) diff --git a/components/com_users/controllers/registration.php b/components/com_users/controllers/registration.php index e3c9493329fda..20cf3d843f90b 100644 --- a/components/com_users/controllers/registration.php +++ b/components/com_users/controllers/registration.php @@ -58,6 +58,44 @@ public function activate() return false; } + // Get the User ID + $userIdToActivate = $model->getUserIdFromToken($token); + + if (!$userIdToActivate) + { + JError::raiseError(403, JText::_('COM_USERS_ACTIVATION_TOKEN_NOT_FOUND')); + + return false; + } + + // Get the user we want to activate + $userToActivate = JFactory::getUser($userIdToActivate); + + // Admin activation is on and admin is activating the account + if (($uParams->get('useractivation') == 2) && $userToActivate->getParam('activate', 0)) + { + // If a user admin is not logged in, redirect them to the login page with a error message + if (!$user->authorise('core.create', 'com_users')) + { + $activationUrl = 'index.php?option=com_users&task=registration.activate&token=' . $token; + $loginUrl = 'index.php?option=com_users&view=login&return=' . base64_encode($activationUrl); + + // In case we still run into this in the second step the user does not have the right permissions + $message = JText::_('COM_USERS_REGISTRATION_ACL_ADMIN_ACTIVATION_PERMISSIONS'); + + // When we are not logged in we should login + if ($user->guest) + { + $message = JText::_('COM_USERS_REGISTRATION_ACL_ADMIN_ACTIVATION'); + } + + $this->setMessage($message); + $this->setRedirect(JRoute::_($loginUrl, false)); + + return false; + } + } + // Attempt to activate the user. $return = $model->activate($token); diff --git a/components/com_users/models/registration.php b/components/com_users/models/registration.php index 69ee8503740ca..f50f9ebcd2cfa 100644 --- a/components/com_users/models/registration.php +++ b/components/com_users/models/registration.php @@ -43,18 +43,16 @@ public function __construct($config = array()) } /** - * Method to activate a user account. + * Method to get the user ID from the given token * * @param string $token The activation token. * - * @return mixed False on failure, user object on success. + * @return mixed False on failure, id of the user on success * - * @since 1.6 + * @since __DEPLOY_VERSION__ */ - public function activate($token) + public function getUserIdFromToken($token) { - $config = JFactory::getConfig(); - $userParams = JComponentHelper::getParams('com_users'); $db = $this->getDbo(); // Get the user id based on the token. @@ -68,7 +66,7 @@ public function activate($token) try { - $userId = (int) $db->loadResult(); + return (int) $db->loadResult(); } catch (RuntimeException $e) { @@ -76,6 +74,22 @@ public function activate($token) return false; } + } + + /** + * Method to activate a user account. + * + * @param string $token The activation token. + * + * @return mixed False on failure, user object on success. + * + * @since 1.6 + */ + public function activate($token) + { + $config = JFactory::getConfig(); + $userParams = JComponentHelper::getParams('com_users'); + $userId = $this->getUserIdFromToken($token); // Check for a valid user id. if (!$userId) @@ -131,7 +145,8 @@ public function activate($token) ); // Get all admin users - $query->clear() + $db = $this->getDbo(); + $query = $db->getQuery(true) ->select($db->quoteName(array('name', 'email', 'sendEmail', 'id'))) ->from($db->quoteName('#__users')) ->where($db->quoteName('sendEmail') . ' = 1') diff --git a/installation/language/en-GB/en-GB.xml b/installation/language/en-GB/en-GB.xml index d946773492f12..e014f931189a9 100644 --- a/installation/language/en-GB/en-GB.xml +++ b/installation/language/en-GB/en-GB.xml @@ -3,8 +3,8 @@ version="3.8" client="installation"> English (United Kingdom) - 3.8.12 - August 2018 + 3.8.13 + October 2018 Joomla! Project Copyright (C) 2005 - 2018 Open Source Matters. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt diff --git a/language/en-GB/en-GB.com_users.ini b/language/en-GB/en-GB.com_users.ini index 0fed26601179c..e863ee2776482 100644 --- a/language/en-GB/en-GB.com_users.ini +++ b/language/en-GB/en-GB.com_users.ini @@ -114,6 +114,8 @@ COM_USERS_REGISTER_USERNAME_DESC="Enter your desired username." COM_USERS_REGISTER_USERNAME_LABEL="Username" COM_USERS_REGISTER_USERNAME_MESSAGE="The username you entered is not available. Please pick another username." COM_USERS_REGISTRATION="User Registration" +COM_USERS_REGISTRATION_ACL_ADMIN_ACTIVATION="Please log in to confirm that you are authorised to activate new accounts." +COM_USERS_REGISTRATION_ACL_ADMIN_ACTIVATION_PERMISSIONS="You are not authorised to activate new accounts, please login with a privileged account." COM_USERS_REGISTRATION_ACTIVATE_SUCCESS="Your Account has been activated. You can now log in using the username and password you chose during the registration." COM_USERS_REGISTRATION_ACTIVATION_NOTIFY_SEND_MAIL_FAILED="An error was encountered while sending activation notification email" COM_USERS_REGISTRATION_ACTIVATION_SAVE_FAILED="Failed to save activation data: %s" diff --git a/language/en-GB/en-GB.xml b/language/en-GB/en-GB.xml index 91c071485424d..446c1e175e32e 100644 --- a/language/en-GB/en-GB.xml +++ b/language/en-GB/en-GB.xml @@ -1,8 +1,8 @@ English (en-GB) - 3.8.12 - August 2018 + 3.8.13 + October 2018 Joomla! Project admin@joomla.org www.joomla.org diff --git a/language/en-GB/install.xml b/language/en-GB/install.xml index 96d1e5c4164b0..d50447fc844ff 100644 --- a/language/en-GB/install.xml +++ b/language/en-GB/install.xml @@ -2,8 +2,8 @@ English (en-GB) en-GB - 3.8.12 - August 2018 + 3.8.13 + October 2018 Joomla! Project admin@joomla.org www.joomla.org diff --git a/libraries/src/Helper/TagsHelper.php b/libraries/src/Helper/TagsHelper.php index fd13ed2f00d78..2a6bd548dec4a 100644 --- a/libraries/src/Helper/TagsHelper.php +++ b/libraries/src/Helper/TagsHelper.php @@ -954,6 +954,13 @@ public static function searchTags($filters = array()) $query->where('a.published = ' . (int) $filters['published']); } + // Filter on the access level + if (isset($filters['access']) && is_array($filters['access']) && count($filters['access'])) + { + $groups = ArrayHelper::toInteger($filters['access']); + $query->where('a.access IN (' . implode(",", $groups) . ')'); + } + // Filter by parent_id if (isset($filters['parent_id']) && is_numeric($filters['parent_id'])) { diff --git a/libraries/src/Version.php b/libraries/src/Version.php index f4ef8ec0d8998..f148c40474f3a 100644 --- a/libraries/src/Version.php +++ b/libraries/src/Version.php @@ -49,7 +49,7 @@ final class Version * @var integer * @since 3.8.0 */ - const PATCH_VERSION = 12; + const PATCH_VERSION = 13; /** * Extra release version info. @@ -78,7 +78,7 @@ final class Version * @since 3.5 * @deprecated 4.0 Use separated version constants instead */ - const DEV_LEVEL = '12'; + const DEV_LEVEL = '13'; /** * Development status. @@ -111,7 +111,7 @@ final class Version * @var string * @since 3.5 */ - const RELDATE = '28-August-2018'; + const RELDATE = '9-October-2018'; /** * Release time. From 056e329b6356830d273e3a7067b4ede849d9b07b Mon Sep 17 00:00:00 2001 From: wilsonge Date: Sat, 2 Mar 2019 22:11:13 +0000 Subject: [PATCH 84/92] Fix stability --- libraries/src/Version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/src/Version.php b/libraries/src/Version.php index 492502d1d92d7..8490f0ee059c2 100644 --- a/libraries/src/Version.php +++ b/libraries/src/Version.php @@ -68,7 +68,7 @@ final class Version * @var string * @since 3.5 */ - const DEV_STATUS = 'Stable'; + const DEV_STATUS = 'Development'; /** * Code name. From f7cc970a8ea907284ad4f35220fa9e937edd4d3d Mon Sep 17 00:00:00 2001 From: wilsonge Date: Sun, 3 Mar 2019 14:51:22 +0000 Subject: [PATCH 85/92] Fix codestyle in mod search, move calendar locale to new location --- .../media_source}/system/js/fields/calendar-locales/lt.js | 0 modules/mod_search/mod_search.php | 4 +++- 2 files changed, 3 insertions(+), 1 deletion(-) rename {media => build/media_source}/system/js/fields/calendar-locales/lt.js (100%) diff --git a/media/system/js/fields/calendar-locales/lt.js b/build/media_source/system/js/fields/calendar-locales/lt.js similarity index 100% rename from media/system/js/fields/calendar-locales/lt.js rename to build/media_source/system/js/fields/calendar-locales/lt.js diff --git a/modules/mod_search/mod_search.php b/modules/mod_search/mod_search.php index 9c656608e1385..e80f5c5060646 100644 --- a/modules/mod_search/mod_search.php +++ b/modules/mod_search/mod_search.php @@ -22,7 +22,9 @@ { $ostitle = $params->get('opensearch_title', Text::_('MOD_SEARCH_SEARCHBUTTON_TEXT') . ' ' . $app->get('sitename')); $app->getDocument()->addHeadLink( - Uri::getInstance()->toString(array('scheme', 'host', 'port')) . Route::_('&option=com_search&format=opensearch&Itemid=' . $mitemid), 'search', 'rel', + Uri::getInstance()->toString(array('scheme', 'host', 'port')) . Route::_('&option=com_search&format=opensearch&Itemid=' . $mitemid), + 'search', + 'rel', [ 'title' => htmlspecialchars($ostitle, ENT_COMPAT, 'UTF-8'), 'type' => 'application/opensearchdescription+xml' From 2dcc610401a505bb864e2310205122387e272c8b Mon Sep 17 00:00:00 2001 From: George Wilson Date: Sun, 3 Mar 2019 15:55:32 +0000 Subject: [PATCH 86/92] Fix path to file (#24074) --- layouts/joomla/toolbar/basic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/joomla/toolbar/basic.php b/layouts/joomla/toolbar/basic.php index 49eb81d5e6e97..b64305bbedf34 100644 --- a/layouts/joomla/toolbar/basic.php +++ b/layouts/joomla/toolbar/basic.php @@ -12,7 +12,7 @@ use Joomla\CMS\HTML\HTMLHelper; HTMLHelper::_('behavior.core'); -HTMLHelper::_('webcomponent', 'system/fields/joomla-toolbar-button.min.js', ['relative' => true, 'version' => 'auto', 'detectDebug' => true]); +HTMLHelper::_('webcomponent', 'system/joomla-toolbar-button.min.js', ['relative' => true, 'version' => 'auto', 'detectDebug' => true]); /** * @var int $id From 9a80848bd2aadae4006179d2935620b6b8cd5e06 Mon Sep 17 00:00:00 2001 From: George Wilson Date: Sun, 3 Mar 2019 21:04:09 +0000 Subject: [PATCH 87/92] [4.0] Fix webcomponents not being included on the page (#24075) --- libraries/src/HTML/HTMLHelper.php | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/libraries/src/HTML/HTMLHelper.php b/libraries/src/HTML/HTMLHelper.php index 25db7e6fc5352..03cdfda8e282c 100644 --- a/libraries/src/HTML/HTMLHelper.php +++ b/libraries/src/HTML/HTMLHelper.php @@ -799,26 +799,19 @@ public static function webcomponent(string $file, array $options = []) } } - if (count($includes) === 1) + foreach ($includes as $include) { - $potential = $includes[0] . ((strpos($includes[0], '?') === false) ? $version : ''); + $potential = $include . ((strpos($include, '?') === false) ? $version : ''); + $components = Factory::getDocument()->getScriptOptions('webcomponents'); - if (!in_array($potential, Factory::getDocument()->getScriptOptions('webcomponents'))) + if (in_array($potential, $components)) { - Factory::getDocument()->addScriptOptions('webcomponents', [$potential]); - return; + continue; } - return; - } - - $potential = $includes . ((strpos($includes, '?') === false) ? $version : ''); - - if (!in_array($potential, Factory::getDocument()->getScriptOptions('webcomponents'))) - { - Factory::getDocument()->addScriptOptions('webcomponents', [$potential]); + $components[] = $potential; + Factory::getDocument()->addScriptOptions('webcomponents', $components); } - } /** From ea9b47d8f29f26950c64cdeb47bd5881eb57376e Mon Sep 17 00:00:00 2001 From: Brian Teeman Date: Mon, 4 Mar 2019 02:30:35 +0000 Subject: [PATCH 88/92] [4.0] Remove com_admin profile (#24064) The users icon in the mod_status module links to a view of the logged in users profile. However because it is NOT using com_users any plugins that extend com_users are not displayed. For example TFA plugins when enabled are not accessible from this link and are only accessible from the users component. Maintaining this additional view makes no sense to me. Its a regular cause of bug reports etc. This PR completely removes the com_admin profile and replaces the link in the module to use com_users. Now any plugins that extend com_users are accessible from the link which is what the user expects --- .../Controller/ProfileController.php | 84 --------- .../com_admin/Model/ProfileModel.php | 168 ------------------ .../com_admin/View/Profile/HtmlView.php | 100 ----------- .../components/com_admin/forms/profile.xml | 150 ---------------- .../com_admin/tmpl/profile/edit.php | 69 ------- .../language/en-GB/en-GB.com_admin.ini | 28 --- .../modules/mod_status/tmpl/default.php | 2 +- 7 files changed, 1 insertion(+), 600 deletions(-) delete mode 100644 administrator/components/com_admin/Controller/ProfileController.php delete mode 100644 administrator/components/com_admin/Model/ProfileModel.php delete mode 100644 administrator/components/com_admin/View/Profile/HtmlView.php delete mode 100644 administrator/components/com_admin/forms/profile.xml delete mode 100644 administrator/components/com_admin/tmpl/profile/edit.php diff --git a/administrator/components/com_admin/Controller/ProfileController.php b/administrator/components/com_admin/Controller/ProfileController.php deleted file mode 100644 index b629ce35ad5bc..0000000000000 --- a/administrator/components/com_admin/Controller/ProfileController.php +++ /dev/null @@ -1,84 +0,0 @@ -app->getIdentity()->id; - } - - /** - * Overrides parent save method to check the submitted passwords match. - * - * @param string $key The name of the primary key of the URL variable. - * @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions). - * - * @return boolean True if successful, false otherwise. - * - * @since 3.2 - */ - public function save($key = null, $urlVar = null) - { - $this->setRedirect(Route::_('index.php?option=com_admin&view=profile&layout=edit&id=' . $this->app->getIdentity()->id, false)); - - $return = parent::save(); - - if ($this->getTask() != 'apply') - { - // Redirect to the main page. - $this->setRedirect(Route::_('index.php', false)); - } - - return $return; - } - - /** - * Method to cancel an edit. - * - * @param string $key The name of the primary key of the URL variable. - * - * @return boolean True if access level checks pass, false otherwise. - * - * @since 1.6 - */ - public function cancel($key = null) - { - $return = parent::cancel($key); - - // Redirect to the main page. - $this->setRedirect(Route::_('index.php', false)); - - return $return; - } -} diff --git a/administrator/components/com_admin/Model/ProfileModel.php b/administrator/components/com_admin/Model/ProfileModel.php deleted file mode 100644 index 884d4b5413b7b..0000000000000 --- a/administrator/components/com_admin/Model/ProfileModel.php +++ /dev/null @@ -1,168 +0,0 @@ -loadForm('com_admin.profile', 'profile', array('control' => 'jform', 'load_data' => $loadData)); - - if (empty($form)) - { - return false; - } - - // Check for username compliance and parameter set - $isUsernameCompliant = true; - - if ($this->loadFormData()->username) - { - $username = $this->loadFormData()->username; - $isUsernameCompliant = !(preg_match('#[<>"\'%;()&\\\\]|\\.\\./#', $username) || strlen(utf8_decode($username)) < 2 - || trim($username) != $username); - } - - $this->setState('user.username.compliant', $isUsernameCompliant); - - if (!ComponentHelper::getParams('com_users')->get('change_login_name') && $isUsernameCompliant) - { - $form->setFieldAttribute('username', 'required', 'false'); - $form->setFieldAttribute('username', 'readonly', 'true'); - $form->setFieldAttribute('username', 'description', 'COM_ADMIN_USER_FIELD_NOCHANGE_USERNAME_DESC'); - } - - // When multilanguage is set, a user's default site language should also be a Content Language - if (Multilanguage::isEnabled()) - { - $form->setFieldAttribute('language', 'type', 'frontend_language', 'params'); - } - - // If the user needs to change their password, mark the password fields as required - if (Factory::getUser()->requireReset) - { - $form->setFieldAttribute('password', 'required', 'true'); - $form->setFieldAttribute('password2', 'required', 'true'); - } - - return $form; - } - - /** - * Method to get the data that should be injected in the form. - * - * @return mixed The data for the form. - * - * @since 1.6 - */ - protected function loadFormData() - { - // Check the session for previously entered form data. - $data = Factory::getApplication()->getUserState('com_users.edit.user.data', array()); - - if (empty($data)) - { - $data = $this->getItem(); - } - - // Load the users plugins. - PluginHelper::importPlugin('user'); - - $this->preprocessData('com_admin.profile', $data); - - return $data; - } - - /** - * Method to get a single record. - * - * @param integer $pk The id of the primary key. - * - * @return mixed Object on success, false on failure. - * - * @since 1.6 - */ - public function getItem($pk = null) - { - return parent::getItem(Factory::getUser()->id); - } - - /** - * Method to save the form data. - * - * @param array $data The form data. - * - * @return boolean True on success. - * - * @since 1.6 - */ - public function save($data) - { - $user = Factory::getUser(); - - unset($data['id']); - unset($data['groups']); - unset($data['sendEmail']); - unset($data['block']); - - $isUsernameCompliant = $this->getState('user.username.compliant'); - - if (!ComponentHelper::getParams('com_users')->get('change_login_name') && $isUsernameCompliant) - { - unset($data['username']); - } - - // Bind the data. - if (!$user->bind($data)) - { - $this->setError($user->getError()); - - return false; - } - - $user->groups = null; - - // Store the data. - if (!$user->save()) - { - $this->setError($user->getError()); - - return false; - } - - $this->setState('user.id', $user->id); - - return true; - } -} diff --git a/administrator/components/com_admin/View/Profile/HtmlView.php b/administrator/components/com_admin/View/Profile/HtmlView.php deleted file mode 100644 index fef7263d23ef6..0000000000000 --- a/administrator/components/com_admin/View/Profile/HtmlView.php +++ /dev/null @@ -1,100 +0,0 @@ -form = $this->get('Form'); - $this->item = $this->get('Item'); - $this->state = $this->get('State'); - - // Check for errors. - if (count($errors = $this->get('Errors'))) - { - throw new \JViewGenericdataexception(implode("\n", $errors), 500); - } - - $this->form->setValue('password', null); - $this->form->setValue('password2', null); - - $this->addToolbar(); - - return parent::display($tpl); - } - - /** - * Add the page title and toolbar. - * - * @return void - * - * @since 1.6 - */ - protected function addToolbar() - { - Factory::getApplication()->input->set('hidemainmenu', 1); - - ToolbarHelper::title(Text::_('COM_ADMIN_VIEW_PROFILE_TITLE'), 'user user-profile'); - - ToolbarHelper::apply('profile.apply'); - ToolbarHelper::divider(); - ToolbarHelper::save('profile.save'); - ToolbarHelper::divider(); - ToolbarHelper::cancel('profile.cancel', 'JTOOLBAR_CLOSE'); - ToolbarHelper::divider(); - ToolbarHelper::help('JHELP_ADMIN_USER_PROFILE_EDIT'); - } -} diff --git a/administrator/components/com_admin/forms/profile.xml b/administrator/components/com_admin/forms/profile.xml deleted file mode 100644 index e1daa6ed6a1c4..0000000000000 --- a/administrator/components/com_admin/forms/profile.xml +++ /dev/null @@ -1,150 +0,0 @@ - -
      -
      - - - - - - - - - - - - - - - - -
      - - - - -
      - - - - - - - - - - - - - - - - - - - - - - - - -
      -
      -
      diff --git a/administrator/components/com_admin/tmpl/profile/edit.php b/administrator/components/com_admin/tmpl/profile/edit.php deleted file mode 100644 index 2f34cfae0f8f7..0000000000000 --- a/administrator/components/com_admin/tmpl/profile/edit.php +++ /dev/null @@ -1,69 +0,0 @@ -form->getFieldsets(); -?> - -
      - 'account')); ?> - - - form->getFieldset('user_details') as $field) : ?> -
      -
      - label; ?> -
      -
      - fieldname == 'password2') : ?> - - - input; ?> -
      -
      - - - - - name == 'user_details') - { - continue; - } - ?> - name, Text::_($fieldset->label)); ?> - form->getFieldset($fieldset->name) as $field) : ?> - hidden) : ?> -
      -
      input; ?>
      -
      - -
      -
      - label; ?> -
      -
      input; ?>
      -
      - - - - - - - - -
      diff --git a/administrator/language/en-GB/en-GB.com_admin.ini b/administrator/language/en-GB/en-GB.com_admin.ini index 3c691310375ea..c962f01715467 100644 --- a/administrator/language/en-GB/en-GB.com_admin.ini +++ b/administrator/language/en-GB/en-GB.com_admin.ini @@ -138,25 +138,8 @@ COM_ADMIN_SYSTEM_INFO="System Info" COM_ADMIN_SYSTEM_INFORMATION="System Information" COM_ADMIN_TEMP_DIRECTORY="(Temp folder)" COM_ADMIN_UNWRITABLE="Unwritable" -COM_ADMIN_USER_ACCOUNT_DETAILS="My Profile Details" COM_ADMIN_USER_AGENT="User Agent" -COM_ADMIN_USER_FIELD_BACKEND_LANGUAGE_LABEL="Backend Language" -COM_ADMIN_USER_FIELD_BACKEND_TEMPLATE_LABEL="Backend Template Style" -COM_ADMIN_USER_FIELD_EDITOR_LABEL="Editor" -COM_ADMIN_USER_FIELD_FRONTEND_LANGUAGE_LABEL="Frontend Language" -COM_ADMIN_USER_FIELD_HELPSITE_LABEL="Help Site" -COM_ADMIN_USER_FIELD_LASTVISIT_LABEL="Last Visit Date" -COM_ADMIN_USER_FIELD_NOCHANGE_USERNAME_DESC="If you want to change your Username, please contact a site administrator." -COM_ADMIN_USER_FIELD_PASSWORD1_MESSAGE="The passwords you entered do not match. Please enter your desired password in the password field and confirm your entry by entering it in the confirm password field." -COM_ADMIN_USER_FIELD_PASSWORD2_LABEL="Confirm Password" -COM_ADMIN_USER_FIELD_REGISTERDATE_LABEL="Registration Date" -COM_ADMIN_USER_FIELD_TIMEZONE_LABEL="Time Zone" -COM_ADMIN_USER_FIELD_USERNAME_LABEL="Login Name" -COM_ADMIN_USER_HEADING_NAME="Name" -COM_ADMIN_USER_SETTINGS_FIELDSET_LABEL="Basic Settings" COM_ADMIN_VALUE="Value" -COM_ADMIN_VIEW="View" -COM_ADMIN_VIEW_PROFILE_TITLE="My Profile" COM_ADMIN_WEBSERVER_TO_PHP_INTERFACE="WebServer to PHP Interface" COM_ADMIN_WEB_SERVER="Web Server" COM_ADMIN_WRITABLE="Writable" @@ -165,14 +148,3 @@ COM_ADMIN_XML_ENABLED="XML Enabled" COM_ADMIN_ZIP_ENABLED="Native ZIP Enabled" COM_ADMIN_ZLIB_ENABLED="Zlib Enabled" -; Messages -COM_USERS_MSG_NOT_ENOUGH_INTEGERS_N="Password does not have enough digits. At least %s digits are required." -COM_USERS_MSG_NOT_ENOUGH_INTEGERS_N_1="Password does not have enough digits. At least 1 digit is required." -COM_USERS_MSG_NOT_ENOUGH_SYMBOLS_N="Password does not have enough symbols. At least %s symbols are required." -COM_USERS_MSG_NOT_ENOUGH_SYMBOLS_N_1="Password does not have enough symbols. At least 1 symbol is required." -COM_USERS_MSG_NOT_ENOUGH_UPPERCASE_LETTERS_N="Password does not have enough uppercase characters. At least %s upper case characters are required." -COM_USERS_MSG_NOT_ENOUGH_UPPERCASE_LETTERS_N_1="Password does not have enough uppercase characters. At least 1 upper case character is required." -COM_USERS_MSG_PASSWORD_TOO_LONG="Password is too long. Passwords must be less than 100 characters." -COM_USERS_MSG_PASSWORD_TOO_SHORT_N="Password is too short. Passwords must have at least %s characters." -COM_USERS_MSG_SPACES_IN_PASSWORD="Password must not have spaces at the beginning or end." - diff --git a/administrator/modules/mod_status/tmpl/default.php b/administrator/modules/mod_status/tmpl/default.php index 6af9c5075acd4..4ad725bb5898c 100644 --- a/administrator/modules/mod_status/tmpl/default.php +++ b/administrator/modules/mod_status/tmpl/default.php @@ -97,7 +97,7 @@ name; ?> - id; ?> + id; ?>
      From 5a6965e421367d3c5a03ed2b115d009f4be12b4f Mon Sep 17 00:00:00 2001 From: George Wilson Date: Mon, 4 Mar 2019 15:49:34 +0000 Subject: [PATCH 92/92] Fix typehint to be compatible with parent interface (#24041) --- administrator/components/com_workflow/Model/WorkflowModel.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/administrator/components/com_workflow/Model/WorkflowModel.php b/administrator/components/com_workflow/Model/WorkflowModel.php index 1912eece826b4..c86c9075def1c 100644 --- a/administrator/components/com_workflow/Model/WorkflowModel.php +++ b/administrator/components/com_workflow/Model/WorkflowModel.php @@ -13,6 +13,7 @@ defined('_JEXEC') or die; use Joomla\CMS\Factory; +use Joomla\CMS\Form\Form; use Joomla\CMS\Language\Text; use Joomla\CMS\MVC\Model\AdminModel; use Joomla\CMS\Workflow\Workflow; @@ -259,7 +260,7 @@ protected function loadFormData() * * @since 4.0.0 */ - protected function preprocessForm(\JForm $form, $data, $group = 'content') + protected function preprocessForm(Form $form, $data, $group = 'content') { $extension = Factory::getApplication()->input->get('extension');