diff --git a/README.md b/README.md index 40f307e44..734b6a429 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have! -You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.10.12) with **ALL** its features and **ALL** concepts totally open-source and free! +You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.10.13) with **ALL** its features and **ALL** concepts totally open-source and free! > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) @@ -144,14 +144,14 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 13th March, 2020 -+ *Version*: 2.10.12 ++ *Last Build*: 24th March, 2020 ++ *Version*: 2.10.13 + *Copyright*: Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **278824** -+ *Field count*: **1506** -+ *File count*: **1757** -+ *Folder count*: **278** ++ *Line count*: **280169** ++ *Field count*: **1512** ++ *File count*: **1771** ++ *Folder count*: **287** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) diff --git a/admin/README.txt b/admin/README.txt index 40f307e44..734b6a429 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -12,7 +12,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will safe you lots of time and money. A real must have! -You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.10.12) with **ALL** its features and **ALL** concepts totally open-source and free! +You can install it quite easily and with no limitations. On [github](https://github.com/vdm-io/Joomla-Component-Builder/releases) is the latest release (2.10.13) with **ALL** its features and **ALL** concepts totally open-source and free! > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) @@ -144,14 +144,14 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 13th March, 2020 -+ *Version*: 2.10.12 ++ *Last Build*: 24th March, 2020 ++ *Version*: 2.10.13 + *Copyright*: Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **278824** -+ *Field count*: **1506** -+ *File count*: **1757** -+ *Folder count*: **278** ++ *Line count*: **280169** ++ *Field count*: **1512** ++ *File count*: **1771** ++ *Folder count*: **287** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) diff --git a/admin/config.xml b/admin/config.xml index ab8e9d975..7cc153967 100644 --- a/admin/config.xml +++ b/admin/config.xml @@ -229,7 +229,7 @@ label="COM_COMPONENTBUILDER_CONFIG_LANGUAGE_LABEL" class="list_class" multiple="false" - default="0" + default="en-GB" required="true" button="true" /> diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php index 14a6bacac..8e5b9322f 100644 --- a/admin/helpers/compiler/a_Get.php +++ b/admin/helpers/compiler/a_Get.php @@ -794,7 +794,7 @@ class Get { foreach ($plugins as $plugin) { - // get posible plugins + // get possible plugins if (\JPluginHelper::isEnabled('extension', $plugin)) { // Import the appropriate plugin group. @@ -937,7 +937,7 @@ class Get * @param string $event The event to trigger * @param mix $data The values to pass to the event/plugin * - * @return string + * @return void * */ public function triggerEvent($event, $data) @@ -3880,7 +3880,7 @@ class Get { $script = $this->setDynamicValues($script); } - // check if we still hava a string + // check if we still have a string if (ComponentbuilderHelper::checkString($script)) { // now load the placeholder snippet if needed @@ -5855,7 +5855,7 @@ class Get $query->from($this->db->quoteName('#__componentbuilder_language_translation', 'a')); if (ComponentbuilderHelper::checkArray($values)) { - $query->select($this->db->quoteName(array('a.id', 'a.translation', 'a.source', 'a.components', 'a.published'))); + $query->select($this->db->quoteName(array('a.id', 'a.translation', 'a.source', 'a.components', 'a.modules', 'a.plugins', 'a.published'))); $query->where($this->db->quoteName('a.source') . ' IN (' . implode(',', array_map(function($a) { return $this->db->quote($a); @@ -5872,12 +5872,12 @@ class Get /** * Set the Current language values to DB - * + * * * @return void - * + * */ - public function setLangPlaceholders($strings) + public function setLangPlaceholders($strings, $target_id, $target = 'components') { $counterInsert = 0; $counterUpdate = 0; @@ -5888,7 +5888,7 @@ class Get { // to keep or remove $remove = false; - // build the tranlations + // build the translations if (ComponentbuilderHelper::checkString($string) && isset($this->multiLangString[$string])) { // make sure we have converted the string to array @@ -5923,18 +5923,18 @@ class Get $remove = true; } } - // do the database managment + // do the database management if (ComponentbuilderHelper::checkString($string) && ($key = array_search($string, $strings)) !== false) { if (isset($this->multiLangString[$string])) { // update the existing placeholder in db $id = $this->multiLangString[$string]['id']; - if (ComponentbuilderHelper::checkJson($this->multiLangString[$string]['components'])) + if (ComponentbuilderHelper::checkJson($this->multiLangString[$string][$target])) { - $components = (array) json_decode($this->multiLangString[$string]['components'], true); - // check if we should add the component ID - if (in_array($this->componentID, $components)) + $targets = (array) json_decode($this->multiLangString[$string][$target], true); + // check if we should add the target ID + if (in_array($target_id, $targets)) { // only skip the update if the string is published and has the component ID if ($this->multiLangString[$string]['published'] == 1) @@ -5944,19 +5944,19 @@ class Get } else { - $components[] = $this->componentID; + $targets[] = $target_id; } } else { - $components = array($this->componentID); + $targets = array($target_id); } // start the bucket for this lang - $this->setUpdateExistingLangStrings($id, $components, 1, $today, $counterUpdate); + $this->setUpdateExistingLangStrings($id, $target, $targets, 1, $today, $counterUpdate); $counterUpdate++; - // load to db + // load to db $this->setExistingLangStrings(50); // remove string if needed if ($remove) @@ -5967,19 +5967,23 @@ class Get else { // add the new lang placeholder to the db - $this->newLangStrings[$counterInsert] = array(); - $this->newLangStrings[$counterInsert][] = $this->db->quote(json_encode(array($this->componentID))); // 'components' - $this->newLangStrings[$counterInsert][] = $this->db->quote($string); // 'source' - $this->newLangStrings[$counterInsert][] = $this->db->quote(1); // 'published' - $this->newLangStrings[$counterInsert][] = $this->db->quote($today); // 'created' - $this->newLangStrings[$counterInsert][] = $this->db->quote((int) $this->user->id); // 'created_by' - $this->newLangStrings[$counterInsert][] = $this->db->quote(1); // 'version' - $this->newLangStrings[$counterInsert][] = $this->db->quote(1); // 'access' + if (!isset($this->newLangStrings[$target])) + { + $this->newLangStrings[$target] = array(); + } + $this->newLangStrings[$target][$counterInsert] = array(); + $this->newLangStrings[$target][$counterInsert][] = $this->db->quote(json_encode(array([$target_id]))); // 'target' + $this->newLangStrings[$target][$counterInsert][] = $this->db->quote($string); // 'source' + $this->newLangStrings[$target][$counterInsert][] = $this->db->quote(1); // 'published' + $this->newLangStrings[$target][$counterInsert][] = $this->db->quote($today); // 'created' + $this->newLangStrings[$target][$counterInsert][] = $this->db->quote((int) $this->user->id); // 'created_by' + $this->newLangStrings[$target][$counterInsert][] = $this->db->quote(1); // 'version' + $this->newLangStrings[$target][$counterInsert][] = $this->db->quote(1); // 'access' $counterInsert++; - // load to db - $this->setNewLangStrings(100); + // load to db + $this->setNewLangStrings($target, 100); } // only set the string once unset($strings[$key]); @@ -5988,20 +5992,21 @@ class Get } // just to make sure all is done $this->setExistingLangStrings(); - $this->setNewLangStrings(); + $this->setNewLangStrings($target); } /** * store the language placeholders - * - * @param int $when To set when to update + * + * @param string $target The target extention type + * @param int $when To set when to update * * @return void * */ - protected function setNewLangStrings($when = 1) + protected function setNewLangStrings($target, $when = 1) { - if (count((array) $this->newLangStrings) >= $when) + if (isset($this->newLangStrings[$target]) && count((array) $this->newLangStrings[$target]) >= $when) { // Create a new query object. $query = $this->db->getQuery(true); @@ -6011,7 +6016,7 @@ class Get // Prepare the insert query. $query->insert($this->db->quoteName('#__componentbuilder_language_translation')); $query->columns($this->db->quoteName($columns)); - foreach ($this->newLangStrings as $values) + foreach ($this->newLangStrings[$target] as $values) { if (count((array) $values) == 7) { @@ -6024,7 +6029,7 @@ class Get } } // clear the values array - $this->newLangStrings = array(); + $this->newLangStrings[$target] = array(); if (!$continue) { return false; // insure we dont continue if no values were loaded @@ -6095,12 +6100,16 @@ class Get * @return void * */ - public function purgeLanuageStrings($values) + public function purgeLanuageStrings($values, $target_id, $target = 'components') { + // the target types are + $target_types = array('components' => 'components', 'modules' => 'modules', 'plugins' => 'plugins'); + // remove the current target + unset($target_types[$target]); // Create a new query object. $query = $this->db->getQuery(true); $query->from($this->db->quoteName('#__componentbuilder_language_translation', 'a')); - $query->select($this->db->quoteName(array('a.id', 'a.translation', 'a.components'))); + $query->select($this->db->quoteName(array('a.id', 'a.translation', 'a.components', 'a.modules', 'a.plugins'))); // get all string that are not linked to this component $query->where($this->db->quoteName('a.source') . ' NOT IN (' . implode(',', array_map(function($a) { @@ -6116,54 +6125,71 @@ class Get $today = JFactory::getDate()->toSql(); foreach ($otherStrings as $item) { - if (ComponentbuilderHelper::checkJson($item['components'])) + if (ComponentbuilderHelper::checkJson($item[$target])) { - $components = (array) json_decode($item['components'], true); + $targets = (array) json_decode($item[$target], true); // if component is not found ignore this string, and do nothing - if (($key = array_search($this->componentID, $components)) !== false) + if (($key = array_search($target_id, $targets)) !== false) { // first remove the component from the string - unset($components[$key]); + unset($targets[$key]); // check if there are more components - if (ComponentbuilderHelper::checkArray($components)) + if (ComponentbuilderHelper::checkArray($targets)) { // just update the string to unlink the current component - $this->setUpdateExistingLangStrings($item['id'], $components, 1, $today, $counterUpdate); + $this->setUpdateExistingLangStrings($item['id'], $target, $targets, 1, $today, $counterUpdate); $counterUpdate++; // load to db $this->setExistingLangStrings(50); } - // check if this string has been worked on - elseif (ComponentbuilderHelper::checkJson($item['translation'])) - { - $translation = json_decode($item['translation'], true); - if (ComponentbuilderHelper::checkArray($translation)) - { - // only archive the item and update the string to unlink the current component - $this->setUpdateExistingLangStrings($item['id'], $components, 2, $today, $counterUpdate); - - $counterUpdate++; - - // load to db - $this->setExistingLangStrings(50); - } - else - { - // remove the string since no translation found and not linked to any other component - $this->removeExitingLangString($item['id']); - } - } + // check if this string has been worked on or is linked to other extensions else { - // remove the string since no translation found and not linked to any other component - $this->removeExitingLangString($item['id']); + // the action (1 = remove, 2 = archive, 0 = do nothing) + $action_with_string = 1; + // now check if it is linked to other extensions + foreach($target_types as $other_target) + { + // just one linked extension type is enough to stop the search + if ($action_with_string && ComponentbuilderHelper::checkJson($item[$other_target])) + { + $other_targets = (array)json_decode($item[$other_target], true); + // check if linked to other extensions + if (ComponentbuilderHelper::checkArray($other_targets)) + { + $action_with_string = 0; // do nothing + } + } + } + // check we should just archive or remove string + if ($action_with_string && ComponentbuilderHelper::checkJson($item['translation'])) + { + $translation = json_decode($item['translation'], true); + if (ComponentbuilderHelper::checkArray($translation)) + { + // only archive the item and update the string to unlink the current component + $this->setUpdateExistingLangStrings($item['id'], $target, $targets, 2, $today, $counterUpdate); + + $counterUpdate++; + + // load to db + $this->setExistingLangStrings(50); + + $action_with_string = 2; // we archived it + } + } + // remove the string since no translation found and not linked to any other extensions + if ($action_with_string == 1) + { + $this->removeExitingLangString($item['id']); + } } } } } - // load to db + // load to db $this->setExistingLangStrings(); } } @@ -6174,7 +6200,7 @@ class Get * @return void * */ - protected function setUpdateExistingLangStrings($id, $components, $published, $today, $counterUpdate) + protected function setUpdateExistingLangStrings($id, $target, $targets, $published, $today, $counterUpdate) { // start the bucket for this lang $this->existingLangStrings[$counterUpdate] = array(); @@ -6182,7 +6208,7 @@ class Get $this->existingLangStrings[$counterUpdate]['conditions'] = array(); $this->existingLangStrings[$counterUpdate]['conditions'][] = $this->db->quoteName('id') . ' = ' . $this->db->quote($id); $this->existingLangStrings[$counterUpdate]['fields'] = array(); - $this->existingLangStrings[$counterUpdate]['fields'][] = $this->db->quoteName('components') . ' = ' . $this->db->quote(json_encode($components)); + $this->existingLangStrings[$counterUpdate]['fields'][] = $this->db->quoteName($target) . ' = ' . $this->db->quote(json_encode($targets)); $this->existingLangStrings[$counterUpdate]['fields'][] = $this->db->quoteName('published') . ' = ' . $this->db->quote($published); $this->existingLangStrings[$counterUpdate]['fields'][] = $this->db->quoteName('modified') . ' = ' . $this->db->quote($today); $this->existingLangStrings[$counterUpdate]['fields'][] = $this->db->quoteName('modified_by') . ' = ' . $this->db->quote((int) $this->user->id); @@ -6590,6 +6616,7 @@ class Get { // set GUI mapper field $guiMapper['field'] = 'default'; + $guiMapper['type'] = 'html'; $module->default = $this->setGuiCodePlaceholder( $this->setPlaceholders($this->setDynamicValues(base64_decode($module->default)), $this->placeholders), $guiMapper @@ -8451,8 +8478,9 @@ class Get $localPaths['admin'] = JPATH_ADMINISTRATOR . '/components/com_' . $this->componentCodeName; // site path $localPaths['site'] = JPATH_ROOT . '/components/com_' . $this->componentCodeName; - // TODO later to include the JS and CSS + // media path $localPaths['media'] = JPATH_ROOT . '/media/com_' . $this->componentCodeName; + // lets also go over the REPOS (TODO) // Painfull but we need to folder paths for the linked modules if (($module_ids = $this->getModuleIDs()) !== false) { diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index 0bee15833..aaea20390 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -16806,8 +16806,7 @@ function vdm_dkim() { // now build the language files if (isset($this->langContent[$module->key])) { - $lang = array_map(function ($langstring, $placeholder) - { + $lang = array_map(function ($langstring, $placeholder){ return $placeholder . '="' . $langstring . '"'; }, $this->langContent[$module->key], array_keys($this->langContent[$module->key])); // add to language file @@ -17064,8 +17063,8 @@ function vdm_dkim() { { $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . ''; $xml .= PHP_EOL . $this->_t(1) . ''; - $xml .= PHP_EOL . $this->_t(2) . '' . $this->langTag . '/' . $this->langTag . '.plg_' . strtolower($plugin->group) . '_' . strtolower($plugin->code_name) . '.ini'; - $xml .= PHP_EOL . $this->_t(2) . '' . $this->langTag . '/' . $this->langTag . '.plg_' . strtolower($plugin->group) . '_' . strtolower($plugin->code_name) . '.sys.ini'; + $xml .= PHP_EOL . $this->_t(2) . '' . $this->langTag . '/' . $this->langTag . '.plg_' . strtolower($plugin->group) . '_' . strtolower($plugin->code_name) . '.ini'; + $xml .= PHP_EOL . $this->_t(2) . '' . $this->langTag . '/' . $this->langTag . '.plg_' . strtolower($plugin->group) . '_' . strtolower($plugin->code_name) . '.sys.ini'; $xml .= PHP_EOL . $this->_t(1) . ''; } // add the plugin files diff --git a/admin/helpers/compiler/f_Infusion.php b/admin/helpers/compiler/f_Infusion.php index 27529d3e4..d819967a6 100644 --- a/admin/helpers/compiler/f_Infusion.php +++ b/admin/helpers/compiler/f_Infusion.php @@ -1253,16 +1253,16 @@ class Infusion extends Interpretation // get the other lang strings if there is any $this->multiLangString = $this->getMultiLangStrings($values); // update insert the current lang in to DB - $this->setLangPlaceholders($values); + $this->setLangPlaceholders($values, $this->componentID); // remove old unused language strings - $this->purgeLanuageStrings($values); + $this->purgeLanuageStrings($values, $this->componentID); // path to INI file $getPAth = $this->templatePath . '/en-GB.com_admin.ini'; + // Trigger Event: jcb_ce_onBeforeBuildAllLangFiles + $this->triggerEvent('jcb_ce_onBeforeBuildAllLangFiles', array(&$this->componentContext, &$this->languages, &$this->langTag)); // now we insert the values into the files if (ComponentbuilderHelper::checkArray($this->languages)) { - // Trigger Event: jcb_ce_onBeforeBuildAllLangFiles - $this->triggerEvent('jcb_ce_onBeforeBuildAllLangFiles', array(&$this->componentContext, &$this->languages, &$this->langTag)); // rest xml array $langXML = array(); foreach ($this->languages as $tag => $areas) diff --git a/admin/helpers/componentbuilder.php b/admin/helpers/componentbuilder.php index ed5d3d72e..09094fc76 100644 --- a/admin/helpers/componentbuilder.php +++ b/admin/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) { diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index 6f813bd96..2bcfbc886 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -1375,6 +1375,7 @@ COM_COMPONENTBUILDER_ALL_OF_THESE_PACKAGES_ARE_A_FULLY_DEVELOPEDMAPPED_COMPONENT COM_COMPONENTBUILDER_ALL_THE_LANGUAGES_FOUND_IN_JOOMLA_WERE_SUCCESSFULLY_IMPORTED="All the languages found in Joomla were successfully imported." COM_COMPONENTBUILDER_ALL_UNSAVED_WORK_ON_THIS_PAGE_WILL_BE_LOST_ARE_YOU_SURE_YOU_WANT_TO_CONTINUE="All unsaved work on this page will be lost, are you sure you want to continue?" COM_COMPONENTBUILDER_ALREADY_SELECTED_TRY_ANOTHER="Already selected, try another." +COM_COMPONENTBUILDER_ALREADY_TRANSLATED_INTO="Already translated into" COM_COMPONENTBUILDER_ALWAYS_ADD="Always Add" COM_COMPONENTBUILDER_ALWAYS_INSURE_THAT_YOU_HAVE_YOUR_LOCAL_COMPONENTS_BACKED_UP_BY_MAKING_AN_EXPORT_OF_ALL_YOUR_LOCAL_COMPONENTS_BEFORE_IMPORTING_ANY_NEW_COMPONENTS_SMALLMAKE_BSUREB_TO_MOVE_THIS_ZIPPED_BACKUP_PACKAGE_OUT_OF_THE_TMP_FOLDER_BEFORE_DOING_AN_IMPORTSMALLBR_IF_YOU_ARE_IMPORTING_A_PACKAGE_OF_A_THREERD_PARTY_JCB_PACKAGE_DEVELOPER_BMAKE_SURE_IT_IS_A_REPUTABLE_JCB_PACKAGE_DEVELOPERSB_A_SFIND_OUT_WHYA="Always insure that you have your local components backed up, by making an export of all your local components before importing any new components. (Make SURE to move this zipped backup package out of the tmp folder before doing an import)
If you are importing a package of a 3rd party JCB package developer, make sure it is a reputable JCB package developers! Find out why!" COM_COMPONENTBUILDER_ANY_SELECTION_ONLY_FOUR_LISTRADIOCHECKBOXESDYNAMIC_LIST="Any Selection (only 4 list/radio/checkboxes/dynamic_list)" @@ -1752,6 +1753,7 @@ COM_COMPONENTBUILDER_COMPILER_SUBMENU_DESC="Allows the users in this group to su COM_COMPONENTBUILDER_COMPILER_TRANSLATE_BUTTON_ACCESS="Compiler Translate Button Access" COM_COMPONENTBUILDER_COMPILER_TRANSLATE_BUTTON_ACCESS_DESC="Allows the users in this group to access the translate button." COM_COMPONENTBUILDER_COMPILE_COMPONENT="Compile Component" +COM_COMPONENTBUILDER_COMPONENT="Component" COM_COMPONENTBUILDER_COMPONENTS="Components" COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS="Components Admin Views" COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_ACCESS="Components Admin Views Access" @@ -7146,7 +7148,7 @@ COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_N_ITEMS_UNPUBLISHED_1="%s Language Tr COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_SUBMENU="Language Translations Submenu" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_SUBMENU_DESC="Allows the users in this group to submenu of language translation" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_COMPONENTS="Components" -COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_COMPONENTS_LABEL="Components" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_COMPONENTS_LABEL="Components
source string is used in these components" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_CREATED_BY_DESC="The user that created this Language Translation." COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_CREATED_BY_LABEL="Created By" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_CREATED_DATE_DESC="The date this Language Translation was created." @@ -7161,9 +7163,13 @@ COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_MODIFIED_BY_DESC="The last user that m COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_MODIFIED_BY_LABEL="Modified By" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_MODIFIED_DATE_DESC="The date this Language Translation was modified." COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_MODIFIED_DATE_LABEL="Modified Date" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_MODULES="Modules" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_MODULES_LABEL="Modules
source string is used in these modules" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_NEW="A New Language Translation" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_ORDERING_LABEL="Ordering" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_PERMISSION="Permissions" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_PLUGINS="Plugins" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_PLUGINS_LABEL="Plugins
source string is used in these plugins" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_PUBLISHING="Publishing" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Language Translation to customise the alias." COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_SOURCE="Source" @@ -7709,6 +7715,8 @@ COM_COMPONENTBUILDER_MINIFY_JAVASCRIPT="Minify JavaScript" COM_COMPONENTBUILDER_MIN_LENGTH_ONLY_FOUR_TEXT_FIELD="Min Length (only 4 text_field)" COM_COMPONENTBUILDER_MODEL_AFTER_MODELLING="Model (after modelling)" COM_COMPONENTBUILDER_MODEL_BEFORE_MODELLING="Model (before modelling)" +COM_COMPONENTBUILDER_MODULE="Module" +COM_COMPONENTBUILDER_MODULES="Modules" COM_COMPONENTBUILDER_NAME="Name" COM_COMPONENTBUILDER_NAME_ASC="Name (Asc)" COM_COMPONENTBUILDER_NAME_DESC="Name (Desc)" @@ -7891,6 +7899,8 @@ COM_COMPONENTBUILDER_PLEASE_SELECT_A_COMPONENT_THAT_YOU_WOULD_LIKE_TO_COMPILE="P COM_COMPONENTBUILDER_PLEASE_TRY_AGAIN_LATER="Please try again later" COM_COMPONENTBUILDER_PLEASE_WAIT_CLEARING_THE_TMP_FOLDER="Please wait! Clearing the tmp folder" COM_COMPONENTBUILDER_PLEASE_WAIT_LOADING="Please wait, loading" +COM_COMPONENTBUILDER_PLUGIN="Plugin" +COM_COMPONENTBUILDER_PLUGINS="Plugins" COM_COMPONENTBUILDER_PROPERTIES="Properties" COM_COMPONENTBUILDER_PROPERTIESBR_SMALLHERE_YOU_CAN_SET_THE_PROPERTIES_FOR_THIS_FIELDSMALL="Properties
Here you can set the properties for this field." COM_COMPONENTBUILDER_PROPERTY="Property" @@ -9054,7 +9064,7 @@ COM_COMPONENTBUILDER_UPDATE_ALL_DIVERGED_SNIPPETS="Update All Diverged Snippets" COM_COMPONENTBUILDER_UPDATE_ALL_OUT_DATED_SNIPPETS="Update All Out Dated Snippets" COM_COMPONENTBUILDER_UP_TO_DATE="Up to date" COM_COMPONENTBUILDER_USAGE="Usage" -COM_COMPONENTBUILDER_USED_IN="used in" +COM_COMPONENTBUILDER_USED_IN="Used in" COM_COMPONENTBUILDER_USE_BATCH="Use Batch" COM_COMPONENTBUILDER_USE_BATCH_DESC="Allows users in this group to use batch copy/update method." COM_COMPONENTBUILDER_USE_KEY="Use Key" diff --git a/admin/layouts/language_translation/details_fullwidth.php b/admin/layouts/language_translation/details_fullwidth.php index ac4984f68..7f548d4b1 100644 --- a/admin/layouts/language_translation/details_fullwidth.php +++ b/admin/layouts/language_translation/details_fullwidth.php @@ -28,7 +28,9 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1]; $fields = $displayData->get($fields_tab_layout) ?: array( 'source', 'translation', - 'components' + 'components', + 'modules', + 'plugins' ); $hiddenFields = $displayData->get('hidden_fields') ?: array(); diff --git a/admin/models/fields/excludedlanguages.php b/admin/models/fields/excludedlanguages.php new file mode 100644 index 000000000..b7200b61e --- /dev/null +++ b/admin/models/fields/excludedlanguages.php @@ -0,0 +1,176 @@ + + * @github Joomla Component Builder + * @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) {