+ * @copyright Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved.
+ * @license GNU General Public License version 2 or later; see LICENSE.txt
+ */
+
+// No direct access to this file
+defined('_JEXEC') or die('Restricted access');
+
+// import the list field type
+jimport('joomla.form.helper');
+JFormHelper::loadFieldClass('list');
+
+/**
+ * Excludedlanguages Form Field class for the Componentbuilder component
+ */
+class JFormFieldExcludedlanguages extends JFormFieldList
+{
+ /**
+ * The excludedlanguages field type.
+ *
+ * @var string
+ */
+ public $type = 'excludedlanguages';
+
+ /**
+ * Override to add new button
+ *
+ * @return string The field input markup.
+ *
+ * @since 3.2
+ */
+ protected function getInput()
+ {
+ // see if we should add buttons
+ $set_button = $this->getAttribute('button');
+ // get html
+ $html = parent::getInput();
+ // if true set button
+ if ($set_button === 'true')
+ {
+ $button = array();
+ $script = array();
+ $button_code_name = $this->getAttribute('name');
+ // get the input from url
+ $app = JFactory::getApplication();
+ $jinput = $app->input;
+ // get the view name & id
+ $values = $jinput->getArray(array(
+ 'id' => 'int',
+ 'view' => 'word'
+ ));
+ // check if new item
+ $ref = '';
+ $refJ = '';
+ if (!is_null($values['id']) && strlen($values['view']))
+ {
+ // only load referral if not new item.
+ $ref = '&ref=' . $values['view'] . '&refid=' . $values['id'];
+ $refJ = '&ref=' . $values['view'] . '&refid=' . $values['id'];
+ // get the return value.
+ $_uri = (string) JUri::getInstance();
+ $_return = urlencode(base64_encode($_uri));
+ // load return value.
+ $ref .= '&return=' . $_return;
+ $refJ .= '&return=' . $_return;
+ }
+ // get button label
+ $button_label = trim($button_code_name);
+ $button_label = preg_replace('/_+/', ' ', $button_label);
+ $button_label = preg_replace('/\s+/', ' ', $button_label);
+ $button_label = preg_replace("/[^A-Za-z ]/", '', $button_label);
+ $button_label = ucfirst(strtolower($button_label));
+ // get user object
+ $user = JFactory::getUser();
+ // only add if user allowed to create language
+ if ($user->authorise('language.create', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
+ {
+ // build Create button
+ $button[] = '
+ ';
+ }
+ // only add if user allowed to edit language
+ if ($user->authorise('language.edit', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area.
+ {
+ // build edit button
+ $button[] = '
+ ';
+ // build script
+ $script[] = "
+ jQuery(document).ready(function() {
+ jQuery('#adminForm').on('change', '#jform_".$button_code_name."',function (e) {
+ e.preventDefault();
+ var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val();
+ ".$button_code_name."Button(".$button_code_name."Value);
+ });
+ var ".$button_code_name."Value = jQuery('#jform_".$button_code_name."').val();
+ ".$button_code_name."Button(".$button_code_name."Value);
+ });
+ function ".$button_code_name."Button(value) {
+ if (value > 0) {
+ // hide the create button
+ jQuery('#".$button_code_name."Create').hide();
+ // show edit button
+ jQuery('#".$button_code_name."Edit').show();
+ var url = 'index.php?option=com_componentbuilder&view=languages&task=language.edit&id='+value+'".$refJ."';
+ jQuery('#".$button_code_name."Edit').attr('href', url);
+ } else {
+ // show the create button
+ jQuery('#".$button_code_name."Create').show();
+ // hide edit button
+ jQuery('#".$button_code_name."Edit').hide();
+ }
+ }";
+ }
+ // check if button was created for language field.
+ if (is_array($button) && count($button) > 0)
+ {
+ // Load the needed script.
+ $document = JFactory::getDocument();
+ $document->addScriptDeclaration(implode(' ',$script));
+ // return the button attached to input field.
+ return '' .$html . implode('',$button).'
';
+ }
+ }
+ return $html;
+ }
+
+ /**
+ * Method to get a list of options for a list input.
+ *
+ * @return array An array of JHtml options.
+ */
+ protected function getOptions()
+ {
+ $db = JFactory::getDBO();
+ $query = $db->getQuery(true);
+ $query->select($db->quoteName(array('a.langtag','a.name'),array('langtag','languages_name')));
+ $query->from($db->quoteName('#__componentbuilder_language', 'a'));
+ $query->where($db->quoteName('a.published') . ' >= 1');
+ $query->order('a.langtag ASC');
+ $db->setQuery((string)$query);
+ $items = $db->loadObjectList();
+ // add the main language
+ $main_lang = trim(JComponentHelper::getParams('com_componentbuilder')->get('language', 'en-GB'));
+ // check if any language was added
+ $wasAdded = false;
+ $options = array();
+ if ($items)
+ {
+ $options[] = JHtml::_('select.option', '', 'Select an option');
+ foreach($items as $item)
+ {
+ $item->langtag = trim($item->langtag);
+ // do not add main language
+ if ($main_lang !== $item->langtag)
+ {
+ $options[] = JHtml::_('select.option', $item->langtag, $item->languages_name . ' (' .$item->langtag.')');
+ $wasAdded = true;
+ }
+ }
+ }
+ // now if none was added give notice
+ if (!$wasAdded)
+ {
+ $options[] = JHtml::_('select.option', '', 'Add languages to select');
+ }
+ return $options;
+ }
+}
diff --git a/admin/models/fields/lang.php b/admin/models/fields/lang.php
index f893411fa..e683fa747 100644
--- a/admin/models/fields/lang.php
+++ b/admin/models/fields/lang.php
@@ -36,33 +36,43 @@ class JFormFieldLang extends JFormFieldList
protected function getOptions()
{
$db = JFactory::getDBO();
-$query = $db->getQuery(true);
-$query->select($db->quoteName(array('a.langtag','a.name'),array('langtag','language_name')));
-$query->from($db->quoteName('#__componentbuilder_language', 'a'));
-$query->where($db->quoteName('a.published') . ' >= 1');
-$query->order('a.langtag ASC');
-$db->setQuery((string)$query);
-$items = $db->loadObjectList();
-// make sure the English GB is added
-$wasAdded = false;
-$options = array();
-if ($items)
-{
- $options[] = JHtml::_('select.option', '', 'Select an option');
- foreach($items as $item)
- {
- $options[] = JHtml::_('select.option', trim($item->langtag), $item->language_name . ' (' .$item->langtag.')');
- if ('en-GB' === trim($item->langtag))
+ $query = $db->getQuery(true);
+ $query->select($db->quoteName(array('a.langtag','a.name'),array('langtag','language_name')));
+ $query->from($db->quoteName('#__componentbuilder_language', 'a'));
+ $query->where($db->quoteName('a.published') . ' >= 1');
+ $query->order('a.langtag ASC');
+ $db->setQuery((string)$query);
+ $items = $db->loadObjectList();
+ // add the main language
+ $main_lang = trim(JComponentHelper::getParams('com_componentbuilder')->get('language', 'en-GB'));
+ // make sure the main language is added
+ $wasAdded = false;
+ $options = array();
+ if ($items)
{
- $wasAdded = true;
+ $options[] = JHtml::_('select.option', '', 'Select an option');
+ foreach($items as $item)
+ {
+ $item->langtag = trim($item->langtag);
+ $options[] = JHtml::_('select.option', $item->langtag, $item->language_name . ' (' .$item->langtag.')');
+ if ($main_lang === $item->langtag)
+ {
+ $wasAdded = true;
+ }
+ }
}
- }
-}
-// now add it if not already added
-if (!$wasAdded)
-{
- $options[] = JHtml::_('select.option', 'en-GB', 'English GB (en-GB)');
-}
-return $options;
+ // now add it if not already added (it must default to $main_lang)
+ if (!$wasAdded)
+ {
+ if ('en-GB' === $main_lang)
+ {
+ $options[] = JHtml::_('select.option', $main_lang, 'English GB (' . $main_lang . ')');
+ }
+ else
+ {
+ $options[] = JHtml::_('select.option', $main_lang, 'Main Language (' . $main_lang . ')');
+ }
+ }
+ return $options;
}
}
diff --git a/admin/models/forms/language_translation.xml b/admin/models/forms/language_translation.xml
index 9a4f34015..fdd2632cd 100644
--- a/admin/models/forms/language_translation.xml
+++ b/admin/models/forms/language_translation.xml
@@ -100,15 +100,34 @@
readonly="true"
disabled="true"
/>
+
+
+
+
@@ -141,7 +160,7 @@
label="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_LANGUAGE_LABEL"
class="list_class"
multiple="false"
- default="0"
+ default="en-GB"
required="true"
button="false"
/>
diff --git a/admin/models/language_translation.php b/admin/models/language_translation.php
index 38eb49a98..350d3cbf4 100644
--- a/admin/models/language_translation.php
+++ b/admin/models/language_translation.php
@@ -29,7 +29,9 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin
'fullwidth' => array(
'source',
'translation',
- 'components'
+ 'components',
+ 'modules',
+ 'plugins'
)
)
);
@@ -905,6 +907,18 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin
$data['translation'] = '';
}
+ // Set the plugins string to JSON string.
+ if (isset($data['plugins']))
+ {
+ $data['plugins'] = (string) json_encode($data['plugins']);
+ }
+
+ // Set the modules string to JSON string.
+ if (isset($data['modules']))
+ {
+ $data['modules'] = (string) json_encode($data['modules']);
+ }
+
// Set the components string to JSON string.
if (isset($data['components']))
{
diff --git a/admin/models/language_translations.php b/admin/models/language_translations.php
index a650d4095..090f3f478 100644
--- a/admin/models/language_translations.php
+++ b/admin/models/language_translations.php
@@ -104,50 +104,13 @@ class ComponentbuilderModelLanguage_translations extends JModelList
continue;
}
+ // escape all strings if not being exported
+ if (!isset($_export))
+ {
+ $item->source = ComponentbuilderHelper::htmlEscape($item->source, 'UTF-8', true, 150);
+ }
}
}
- // show all languages that are already set for this string
- if (!isset($_export) && ComponentbuilderHelper::checkArray($items))
- {
- foreach ($items as $nr => &$item)
- {
- $langBucket = array();
- if (ComponentbuilderHelper::checkJson($item->translation))
- {
- $translations = json_decode($item->translation, true);
- if (ComponentbuilderHelper::checkArray($translations))
- {
- foreach ($translations as $language)
- {
- if (isset($language['translation']) && ComponentbuilderHelper::checkString($language['translation'])
- && isset($language['language']) && ComponentbuilderHelper::checkString($language['language']))
- {
- $langBucket[$language['language']] = $language['language'];
- }
- }
- }
- }
- // set how many component use this string
- $componentCounter = '';
- if (ComponentbuilderHelper::checkJson($item->components))
- {
- $item->components = json_decode($item->components, true);
- }
- if (ComponentbuilderHelper::checkArray($item->components))
- {
- $componentCounter = ' - ' . JText::_('COM_COMPONENTBUILDER_USED_IN') . ' ' . count($item->components) . '';
- }
- // load the languages to the string
- if (ComponentbuilderHelper::checkArray($langBucket))
- {
- $item->source = '(' . implode(', ', $langBucket) . ') ' . ComponentbuilderHelper::htmlEscape($item->source, 'UTF-8', true, 150) . $componentCounter;
- }
- else
- {
- $item->source = '(' . JText::_('COM_COMPONENTBUILDER_NOTRANSLATION') . ') ' . ComponentbuilderHelper::htmlEscape($item->source, 'UTF-8', true, 150) . $componentCounter;
- }
- }
- }
// prep the lang strings for export
if (isset($_export) && $_export && ComponentbuilderHelper::checkArray($items))
{
@@ -157,6 +120,8 @@ class ComponentbuilderModelLanguage_translations extends JModelList
{
// remove some values completely
unset($item->components);
+ unset($item->modules);
+ unset($item->plugins);
unset($item->params);
unset($item->published);
unset($item->created_by);
@@ -331,6 +296,11 @@ class ComponentbuilderModelLanguage_translations extends JModelList
continue;
}
+ // escape all strings if not being exported
+ if (!isset($_export))
+ {
+ $item->source = ComponentbuilderHelper::htmlEscape($item->source, 'UTF-8', true, 150);
+ }
// unset the values we don't want exported.
unset($item->asset_id);
unset($item->checked_out);
@@ -344,49 +314,7 @@ class ComponentbuilderModelLanguage_translations extends JModelList
array_unshift($items,$headers);
}
- // show all languages that are already set for this string
- if (!isset($_export) && ComponentbuilderHelper::checkArray($items))
- {
- foreach ($items as $nr => &$item)
- {
- $langBucket = array();
- if (ComponentbuilderHelper::checkJson($item->translation))
- {
- $translations = json_decode($item->translation, true);
- if (ComponentbuilderHelper::checkArray($translations))
- {
- foreach ($translations as $language)
- {
- if (isset($language['translation']) && ComponentbuilderHelper::checkString($language['translation'])
- && isset($language['language']) && ComponentbuilderHelper::checkString($language['language']))
- {
- $langBucket[$language['language']] = $language['language'];
- }
- }
- }
- }
- // set how many component use this string
- $componentCounter = '';
- if (ComponentbuilderHelper::checkJson($item->components))
- {
- $item->components = json_decode($item->components, true);
- }
- if (ComponentbuilderHelper::checkArray($item->components))
- {
- $componentCounter = ' - ' . JText::_('COM_COMPONENTBUILDER_USED_IN') . ' ' . count($item->components) . '';
- }
- // load the languages to the string
- if (ComponentbuilderHelper::checkArray($langBucket))
- {
- $item->source = '(' . implode(', ', $langBucket) . ') ' . ComponentbuilderHelper::htmlEscape($item->source, 'UTF-8', true, 150) . $componentCounter;
- }
- else
- {
- $item->source = '(' . JText::_('COM_COMPONENTBUILDER_NOTRANSLATION') . ') ' . ComponentbuilderHelper::htmlEscape($item->source, 'UTF-8', true, 150) . $componentCounter;
- }
- }
- }
- // prep the lang strings for export
+ // prep the lang strings for export
if (isset($_export) && $_export && ComponentbuilderHelper::checkArray($items))
{
// insure we have the same order in the languages
@@ -395,6 +323,8 @@ class ComponentbuilderModelLanguage_translations extends JModelList
{
// remove some values completely
unset($item->components);
+ unset($item->modules);
+ unset($item->plugins);
unset($item->params);
unset($item->published);
unset($item->created_by);
diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql
index fe7db6418..1c24e2442 100644
--- a/admin/sql/install.mysql.utf8.sql
+++ b/admin/sql/install.mysql.utf8.sql
@@ -1104,6 +1104,8 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_language_translation` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.',
`components` TEXT NOT NULL,
+ `modules` TEXT NOT NULL,
+ `plugins` TEXT NOT NULL,
`source` MEDIUMTEXT NOT NULL,
`translation` TEXT NOT NULL,
`params` text NOT NULL,
@@ -2172,83 +2174,84 @@ INSERT INTO `#__componentbuilder_fieldtype` (`id`, `catid`, `description`, `name
--
INSERT INTO `#__componentbuilder_language` (`id`, `langtag`, `name`, `params`, `published`, `created`, `modified`, `version`, `hits`, `ordering`) VALUES
-(1, 'af-ZA', 'Afrikaans', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(2, 'sq-AL', 'Albanian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(3, 'ar-AA', 'Arabic Unitag', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(4, 'hy-AM', 'Armenian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(5, 'id-ID', 'Bahasa Indonesia', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(6, 'eu-ES', 'Basque', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(7, 'be-BY', 'Belarusian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(8, 'bn-BD', 'Bengali', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(9, 'bs-BA', 'Bosnian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(10, 'bg-BG', 'Bulgarian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(11, 'ca-ES', 'Catalan', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(12, 'zh-CN', 'Chinese Simplified', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(13, 'zh-TW', 'Chinese Traditional', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(14, 'hr-HR', 'Croatian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(15, 'cs-CZ', 'Czech', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(16, 'da-DK', 'Danish', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(17, 'prs-AF', 'Dari Persian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(18, 'nl-NL', 'Dutch', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(19, 'dz-BT', 'Dzongkha', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(20, 'en-AU', 'English AU', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(21, 'en-CA', 'English CA', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(22, 'en-GB', 'English GB', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(23, 'en-NZ', 'English NZ', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(24, 'en-US', 'English US', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(25, 'eo-XX', 'Esperanto', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(26, 'et-EE', 'Estonian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(27, 'fi-FI', 'Finnish', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(28, 'nl-BE', 'Flemish', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(29, 'fr-FR', 'French', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(30, 'fr-CA', 'French CA', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(31, 'gl-ES', 'Galician', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(32, 'ka-GE', 'Georgian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(33, 'de-AT', 'German AT', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(34, 'de-CH', 'German CH', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(35, 'de-DE', 'German DE', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(36, 'de-LI', 'German LI', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(37, 'de-LU', 'German LU', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(38, 'el-GR', 'Greek', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(39, 'he-IL', 'Hebrew', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(40, 'hi-IN', 'Hindi', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(41, 'hu-HU', 'Hungarian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(42, 'ga-IE', 'Irish', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(43, 'it-IT', 'Italian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(44, 'ja-JP', 'Japanese', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(45, 'km-KH', 'Khmer', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(46, 'ko-KR', 'Korean', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(47, 'lv-LV', 'Latvian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(48, 'mk-MK', 'Macedonian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(49, 'ms-MY', 'Malay', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(50, 'srp-ME', 'Montenegrin', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(51, 'nb-NO', 'Norwegian Bokmal', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(52, 'nn-NO', 'Norwegian Nynorsk', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(53, 'fa-IR', 'Persian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(54, 'pl-PL', 'Polish', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(55, 'pt-PT', 'Portuguese', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(56, 'pt-BR', 'Portuguese Brazil', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(57, 'ro-RO', 'Romanian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(58, 'ru-RU', 'Russian', '', 1, '2018-04-19 13:43:44', '2019-10-11 11:55:13', 3, '', 1),
-(59, 'sr-RS', 'Serbian Cyrillic', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(60, 'sr-YU', 'Serbian Latin', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(61, 'si-LK', 'Sinhala', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(62, 'sk-SK', 'Slovak', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(63, 'sl-SI', 'Slovenian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(64, 'es-ES', 'Spanish', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(65, 'es-CO', 'Spanish CO', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(66, 'sw-KE', 'Swahili', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(67, 'sv-SE', 'Swedish', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(68, 'sy-IQ', 'Syriac', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(69, 'ta-IN', 'Tamil', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(70, 'th-TH', 'Thai', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(71, 'tr-TR', 'Turkish', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(72, 'tk-TM', 'Turkmen', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(73, 'uk-UA', 'Ukrainian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(74, 'ug-CN', 'Uyghur', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(75, 'vi-VN', 'Vietnamese', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(76, 'cy-GB', 'Welsh', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1),
-(77, 'lt-LT', 'Lithuanian', '', 1, '2018-09-14 10:39:11', '0000-00-00 00:00:00', 1, '', 2);
+(1, 'af-ZA', 'Afrikaans', '', 1, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(2, 'sq-AL', 'Albanian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(3, 'ar-AA', 'Arabic Unitag', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(4, 'hy-AM', 'Armenian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(5, 'id-ID', 'Bahasa Indonesia', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(6, 'eu-ES', 'Basque', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(7, 'be-BY', 'Belarusian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(8, 'bn-BD', 'Bengali', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(9, 'bs-BA', 'Bosnian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(10, 'bg-BG', 'Bulgarian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(11, 'ca-ES', 'Catalan', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(12, 'zh-CN', 'Chinese Simplified', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(13, 'zh-TW', 'Chinese Traditional', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(14, 'hr-HR', 'Croatian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(15, 'cs-CZ', 'Czech', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(16, 'da-DK', 'Danish', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(17, 'prs-AF', 'Dari Persian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(18, 'nl-NL', 'Dutch', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(19, 'dz-BT', 'Dzongkha', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(20, 'en-AU', 'English AU', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(21, 'en-CA', 'English CA', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(22, 'en-GB', 'English GB', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(23, 'en-NZ', 'English NZ', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(24, 'en-US', 'English US', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(25, 'eo-XX', 'Esperanto', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(26, 'et-EE', 'Estonian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(27, 'fi-FI', 'Finnish', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(28, 'nl-BE', 'Flemish', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(29, 'fr-FR', 'French', '', 1, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(30, 'fr-CA', 'French CA', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(31, 'gl-ES', 'Galician', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(32, 'ka-GE', 'Georgian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(33, 'de-AT', 'German AT', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(34, 'de-CH', 'German CH', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(35, 'de-DE', 'German DE', '', 1, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(36, 'de-LI', 'German LI', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(37, 'de-LU', 'German LU', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(38, 'el-GR', 'Greek', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(39, 'he-IL', 'Hebrew', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(40, 'hi-IN', 'Hindi', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(41, 'hu-HU', 'Hungarian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(42, 'ga-IE', 'Irish', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(43, 'it-IT', 'Italian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(44, 'ja-JP', 'Japanese', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(45, 'km-KH', 'Khmer', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(46, 'ko-KR', 'Korean', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(47, 'lv-LV', 'Latvian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(48, 'mk-MK', 'Macedonian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(49, 'ms-MY', 'Malay', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(50, 'srp-ME', 'Montenegrin', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(51, 'nb-NO', 'Norwegian Bokmal', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(52, 'nn-NO', 'Norwegian Nynorsk', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(53, 'fa-IR', 'Persian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(54, 'pl-PL', 'Polish', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(55, 'pt-PT', 'Portuguese', '', 1, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(56, 'pt-BR', 'Portuguese Brazil', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(57, 'ro-RO', 'Romanian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(58, 'ru-RU', 'Russian', '', 1, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 4, '', 1),
+(59, 'sr-RS', 'Serbian Cyrillic', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(60, 'sr-YU', 'Serbian Latin', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(61, 'si-LK', 'Sinhala', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(62, 'sk-SK', 'Slovak', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(63, 'sl-SI', 'Slovenian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(64, 'es-ES', 'Spanish', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(65, 'es-CO', 'Spanish CO', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(66, 'sw-KE', 'Swahili', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(67, 'sv-SE', 'Swedish', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(68, 'sy-IQ', 'Syriac', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(69, 'ta-IN', 'Tamil', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(70, 'th-TH', 'Thai', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(71, 'tr-TR', 'Turkish', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(72, 'tk-TM', 'Turkmen', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(73, 'uk-UA', 'Ukrainian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(74, 'ug-CN', 'Uyghur', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(75, 'vi-VN', 'Vietnamese', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(76, 'cy-GB', 'Welsh', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
+(77, 'lt-LT', 'Lithuanian', '', 2, '2018-09-14 10:39:11', '2020-03-19 13:41:00', 2, '', 2),
+(78, 'kk-KZ', 'Kazakh', '', 2, '2020-03-19 13:41:00', '0000-00-00 00:00:00', 1, '', 3);
--
-- Dumping data for table `#__componentbuilder_help_document`
diff --git a/admin/sql/updates/mysql/2.10.11.sql b/admin/sql/updates/mysql/2.10.11.sql
new file mode 100644
index 000000000..7bc76eb0a
--- /dev/null
+++ b/admin/sql/updates/mysql/2.10.11.sql
@@ -0,0 +1 @@
+ALTER TABLE `#__componentbuilder_joomla_module` ADD `target` TINYINT(1) NOT NULL DEFAULT 0 AFTER `system_name`;
diff --git a/admin/sql/updates/mysql/2.10.12.sql b/admin/sql/updates/mysql/2.10.12.sql
new file mode 100644
index 000000000..d1138bb0f
--- /dev/null
+++ b/admin/sql/updates/mysql/2.10.12.sql
@@ -0,0 +1,3 @@
+ALTER TABLE `#__componentbuilder_language_translation` ADD `modules` TEXT NOT NULL AFTER `components`;
+
+ALTER TABLE `#__componentbuilder_language_translation` ADD `plugins` TEXT NOT NULL AFTER `modules`;
diff --git a/admin/views/language_translations/tmpl/default_body.php b/admin/views/language_translations/tmpl/default_body.php
index 30d94839b..b6e538f32 100644
--- a/admin/views/language_translations/tmpl/default_body.php
+++ b/admin/views/language_translations/tmpl/default_body.php
@@ -61,15 +61,98 @@ $edit = "index.php?option=com_componentbuilder&view=language_translations&task=l
-
- get('language_translation.edit')): ?>
- source; ?>
- checked_out): ?>
- name, $item->checked_out_time, 'language_translations.', $canCheckin); ?>
-
-
- source; ?>
+
+ get('language_translation.edit')): ?>
+ source; ?>
+ checked_out): ?>
+ name, $item->checked_out_time, 'language_translations.', $canCheckin); ?>
+
+ source; ?>
+
+ translation))
+ {
+ $translations = json_decode($item->translation, true);
+ if (ComponentbuilderHelper::checkArray($translations))
+ {
+ foreach ($translations as $language)
+ {
+ if (isset($language['translation']) && ComponentbuilderHelper::checkString($language['translation'])
+ && isset($language['language']) && ComponentbuilderHelper::checkString($language['language']))
+ {
+ $langBucket[$language['language']] = $language['language'];
+ }
+ }
+ }
+ }
+ // start how many usedin's
+ $counterUsedin = array();
+ // set how many components use this string
+ if (ComponentbuilderHelper::checkJson($item->components))
+ {
+ $item->components = json_decode($item->components, true);
+ }
+ if (($number = ComponentbuilderHelper::checkArray($item->components)) !== false)
+ {
+ if ($number == 1)
+ {
+ $counterUsedin[] = $number . ' ' . JText::_('COM_COMPONENTBUILDER_COMPONENT');
+ }
+ else
+ {
+ $counterUsedin[] = $number . ' ' . JText::_('COM_COMPONENTBUILDER_COMPONENTS');
+ }
+ }
+ // set how many modules use this string
+ if (ComponentbuilderHelper::checkJson($item->modules))
+ {
+ $item->modules = json_decode($item->modules, true);
+ }
+ if (($number = ComponentbuilderHelper::checkArray($item->modules)) !== false)
+ {
+ if ($number == 1)
+ {
+ $counterUsedin[] = $number . ' ' . JText::_('COM_COMPONENTBUILDER_MODULE');
+ }
+ else
+ {
+ $counterUsedin[] = $number . ' ' . JText::_('COM_COMPONENTBUILDER_MODULES');
+ }
+ }
+ // set how many plugins use this string
+ if (ComponentbuilderHelper::checkJson($item->plugins))
+ {
+ $item->plugins = json_decode($item->plugins, true);
+ }
+ if (($number = ComponentbuilderHelper::checkArray($item->plugins)) !== false)
+ {
+ if ($number == 1)
+ {
+ $counterUsedin[] = $number . ' ' . JText::_('COM_COMPONENTBUILDER_PLUGIN');
+ }
+ else
+ {
+ $counterUsedin[] = $number . ' ' . JText::_('COM_COMPONENTBUILDER_PLUGINS');
+ }
+ }
+ // build the numbers
+ $numbersUsedin = '';
+ if (ComponentbuilderHelper::checkArray($counterUsedin))
+ {
+ $numbersUsedin = ' ' . JText::_('COM_COMPONENTBUILDER_USED_IN') . ' ' . implode(' ', $counterUsedin);
+ }
+ // load the languages to the string
+ if (ComponentbuilderHelper::checkArray($langBucket))
+ {
+ echo ' ' . JText::_('COM_COMPONENTBUILDER_ALREADY_TRANSLATED_INTO') . ' (' . implode(', ', $langBucket) . ')' . $numbersUsedin . '';
+ }
+ else
+ {
+ echo ' (' . JText::_('COM_COMPONENTBUILDER_NOTRANSLATION') . ')' . $numbersUsedin . '';
+ }
+ ?>
|
diff --git a/componentbuilder.xml b/componentbuilder.xml
index 7f5327984..4a54c3ebc 100644
--- a/componentbuilder.xml
+++ b/componentbuilder.xml
@@ -1,15 +1,15 @@
COM_COMPONENTBUILDER
- 13th March, 2020
+ 24th March, 2020
Llewellyn van der Merwe
llewellyn@joomlacomponentbuilder.com
http://www.joomlacomponentbuilder.com
Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved.
GNU General Public License version 2 or later; see LICENSE.txt
- 2.10.12
+ 2.10.13
Component Builder (v.2.10.12)
+ Component Builder (v.2.10.13)
The Component Builder for [Joomla](https://extensions.joomla.org/extension/component-builder/) is highly advanced tool that is truly able to build extremely complex components in a fraction of the time.
diff --git a/componentbuilder_update_server.xml b/componentbuilder_update_server.xml
index f72ddbb73..237904a04 100644
--- a/componentbuilder_update_server.xml
+++ b/componentbuilder_update_server.xml
@@ -951,4 +951,21 @@
http://www.joomlacomponentbuilder.com
+
+ Component Builder
+ Builds Complex Joomla Components
+ com_componentbuilder
+ component
+ 2.10.13
+ http://www.joomlacomponentbuilder.com
+
+ http://domain.com/demo.zip
+
+
+ stable
+
+ Llewellyn van der Merwe
+ http://www.joomlacomponentbuilder.com
+
+
\ No newline at end of file
diff --git a/script.php b/script.php
index ff5c32189..72f8fab3f 100644
--- a/script.php
+++ b/script.php
@@ -6166,9 +6166,9 @@ class com_componentbuilderInstallerScript
$language_translation->type_title = 'Componentbuilder Language_translation';
$language_translation->type_alias = 'com_componentbuilder.language_translation';
$language_translation->table = '{"special": {"dbtable": "#__componentbuilder_language_translation","key": "id","type": "Language_translation","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
- $language_translation->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "source","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"source":"source","components":"components"}}';
+ $language_translation->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "source","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"source":"source","plugins":"plugins","modules":"modules","components":"components"}}';
$language_translation->router = 'ComponentbuilderHelperRoute::getLanguage_translationRoute';
- $language_translation->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/language_translation.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "components","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}';
+ $language_translation->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/language_translation.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "plugins","targetTable": "#__componentbuilder_joomla_plugin","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "modules","targetTable": "#__componentbuilder_joomla_module","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "components","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}';
// Set the object into the content types table.
$language_translation_Inserted = $db->insertObject('#__content_types', $language_translation);
@@ -7931,9 +7931,9 @@ class com_componentbuilderInstallerScript
$language_translation->type_title = 'Componentbuilder Language_translation';
$language_translation->type_alias = 'com_componentbuilder.language_translation';
$language_translation->table = '{"special": {"dbtable": "#__componentbuilder_language_translation","key": "id","type": "Language_translation","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
- $language_translation->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "source","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"source":"source","components":"components"}}';
+ $language_translation->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "source","core_state": "published","core_alias": "null","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "null","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "null","core_metadesc": "null","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"source":"source","plugins":"plugins","modules":"modules","components":"components"}}';
$language_translation->router = 'ComponentbuilderHelperRoute::getLanguage_translationRoute';
- $language_translation->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/language_translation.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "components","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}';
+ $language_translation->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/language_translation.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "plugins","targetTable": "#__componentbuilder_joomla_plugin","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "modules","targetTable": "#__componentbuilder_joomla_module","targetColumn": "id","displayColumn": "system_name"},{"sourceColumn": "components","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}';
// Check if language_translation type is already in content_type DB.
$language_translation_id = null;
@@ -9115,7 +9115,7 @@ class com_componentbuilderInstallerScript
echo '
- Upgrade to Version 2.10.12 Was Successful! Let us know if anything is not working as expected.';
+ Upgrade to Version 2.10.13 Was Successful! Let us know if anything is not working as expected.';
// Set db if not set already.
if (!isset($db))
diff --git a/site/helpers/componentbuilder.php b/site/helpers/componentbuilder.php
index dfbae3ce2..2fdc0d030 100644
--- a/site/helpers/componentbuilder.php
+++ b/site/helpers/componentbuilder.php
@@ -5603,7 +5603,7 @@ abstract class ComponentbuilderHelper
/**
- * Change to nice fancy date
+ * Change to nice fancy date
*/
public static function fancyDate($date)
{
@@ -5615,7 +5615,7 @@ abstract class ComponentbuilderHelper
}
/**
- * get date based in period past
+ * get date based in period past
*/
public static function fancyDynamicDate($date)
{
@@ -5641,7 +5641,7 @@ abstract class ComponentbuilderHelper
}
/**
- * Change to nice fancy day time and date
+ * Change to nice fancy day time and date
*/
public static function fancyDayTimeDate($time)
{
@@ -5653,7 +5653,7 @@ abstract class ComponentbuilderHelper
}
/**
- * Change to nice fancy time and date
+ * Change to nice fancy time and date
*/
public static function fancyDateTime($time)
{
@@ -5665,7 +5665,7 @@ abstract class ComponentbuilderHelper
}
/**
- * Change to nice hour:minutes time
+ * Change to nice hour:minutes time
*/
public static function fancyTime($time)
{
@@ -5677,31 +5677,91 @@ abstract class ComponentbuilderHelper
}
/**
- * set the date as 2004/05 (for charts)
+ * set the date day as Sunday through Saturday
*/
- public static function setYearMonth($date)
+ public static function setDayName($date)
{
if (!self::isValidTimeStamp($date))
{
$date = strtotime($date);
}
- return date('Y/m', $date);
+ return date('l', $date);
+ }
+
+ /**
+ * set the date month as January through December
+ */
+ public static function setMonthName($date)
+ {
+ if (!self::isValidTimeStamp($date))
+ {
+ $date = strtotime($date);
+ }
+ return date('F', $date);
+ }
+
+ /**
+ * set the date day as 1st
+ */
+ public static function setDay($date)
+ {
+ if (!self::isValidTimeStamp($date))
+ {
+ $date = strtotime($date);
+ }
+ return date('jS', $date);
+ }
+
+ /**
+ * set the date month as 5
+ */
+ public static function setMonth($date)
+ {
+ if (!self::isValidTimeStamp($date))
+ {
+ $date = strtotime($date);
+ }
+ return date('n', $date);
+ }
+
+ /**
+ * set the date year as 2004 (for charts)
+ */
+ public static function setYear($date)
+ {
+ if (!self::isValidTimeStamp($date))
+ {
+ $date = strtotime($date);
+ }
+ return date('Y', $date);
+ }
+
+ /**
+ * set the date as 2004/05 (for charts)
+ */
+ public static function setYearMonth($date, $spacer = '/')
+ {
+ if (!self::isValidTimeStamp($date))
+ {
+ $date = strtotime($date);
+ }
+ return date('Y' . $spacer . 'm', $date);
}
/**
* set the date as 2004/05/03 (for charts)
*/
- public static function setYearMonthDay($date)
+ public static function setYearMonthDay($date, $spacer = '/')
{
if (!self::isValidTimeStamp($date))
{
$date = strtotime($date);
}
- return date('Y/m/d', $date);
+ return date('Y' . $spacer . 'm' . $spacer . 'd', $date);
}
/**
- * Check if string is a valid time stamp
+ * Check if string is a valid time stamp
*/
public static function isValidTimeStamp($timestamp)
{
|