From 99f47ffac7a27a160f0d84245f463295d83bedd3 Mon Sep 17 00:00:00 2001 From: Jean-Marie Simonet Date: Wed, 9 Aug 2017 08:40:26 +0200 Subject: [PATCH] Allows choosing as source pre-stable releases --- component/admin/config.xml | 10 ++++++ .../language/en-GB/en-GB.com_localise.ini | 2 ++ component/admin/models/fields/releases.php | 32 +++++++++++++++---- 3 files changed, 38 insertions(+), 6 deletions(-) diff --git a/component/admin/config.xml b/component/admin/config.xml index b0731c80..9c49bd64 100644 --- a/component/admin/config.xml +++ b/component/admin/config.xml @@ -166,6 +166,16 @@ name="sourcespacer" class="text" label="COM_LOCALISE_SOURCE_SPACER_LABEL" /> + + + + get('pre_stable', '0') == '0') + { + file_put_contents($versions_path, ''); + } + $versions_file = file_get_contents($versions_path); $versions = preg_split("/\\r\\n|\\r|\\n/", $versions_file); @@ -93,13 +100,26 @@ protected function getOptions() $excluded = 1; } - // Filtering also by "is_numeric" disable betas or similar releases. - if (!in_array($tag_name, $versions) && is_numeric($undoted) && $excluded == 0) + // Filtering by "is_numeric" disable betas or similar releases. + if ($params->get('pre_stable', '0') == '0') + { + if (!in_array($tag_name, $versions) && is_numeric($undoted) && $excluded == 0) + { + $versions[] = $tag_name; + JFactory::getApplication()->enqueueMessage( + JText::sprintf('COM_LOCALISE_NOTICE_NEW_VERSION_DETECTED', $tag_name), + 'notice'); + } + } + else { - $versions[] = $tag_name; - JFactory::getApplication()->enqueueMessage( - JText::sprintf('COM_LOCALISE_NOTICE_NEW_VERSION_DETECTED', $tag_name), - 'notice'); + if (!in_array($tag_name, $versions) && $excluded == 0) + { + $versions[] = $tag_name; + JFactory::getApplication()->enqueueMessage( + JText::sprintf('COM_LOCALISE_NOTICE_NEW_VERSION_DETECTED', $tag_name), + 'notice'); + } } } }