Added Plugin and Module Translation integration. #537

Merged
Llewellyn merged 8 commits from staging into master 2020-04-05 00:02:02 +00:00
22 changed files with 739 additions and 324 deletions
Showing only changes of commit e051134a79 - Show all commits

View File

@ -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! 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) > 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) + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015 + *First Build*: 30th April, 2015
+ *Last Build*: 13th March, 2020 + *Last Build*: 24th March, 2020
+ *Version*: 2.10.12 + *Version*: 2.10.13
+ *Copyright*: Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved. + *Copyright*: Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt + *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **278824** + *Line count*: **280169**
+ *Field count*: **1506** + *Field count*: **1512**
+ *File count*: **1757** + *File count*: **1771**
+ *Folder count*: **278** + *Folder count*: **287**
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). > 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) > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)

View File

@ -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! 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) > 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) + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015 + *First Build*: 30th April, 2015
+ *Last Build*: 13th March, 2020 + *Last Build*: 24th March, 2020
+ *Version*: 2.10.12 + *Version*: 2.10.13
+ *Copyright*: Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved. + *Copyright*: Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt + *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **278824** + *Line count*: **280169**
+ *Field count*: **1506** + *Field count*: **1512**
+ *File count*: **1757** + *File count*: **1771**
+ *Folder count*: **278** + *Folder count*: **287**
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). > 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) > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)

View File

@ -229,7 +229,7 @@
label="COM_COMPONENTBUILDER_CONFIG_LANGUAGE_LABEL" label="COM_COMPONENTBUILDER_CONFIG_LANGUAGE_LABEL"
class="list_class" class="list_class"
multiple="false" multiple="false"
default="0" default="en-GB"
required="true" required="true"
button="true" button="true"
/> />

View File

@ -794,7 +794,7 @@ class Get
{ {
foreach ($plugins as $plugin) foreach ($plugins as $plugin)
{ {
// get posible plugins // get possible plugins
if (\JPluginHelper::isEnabled('extension', $plugin)) if (\JPluginHelper::isEnabled('extension', $plugin))
{ {
// Import the appropriate plugin group. // Import the appropriate plugin group.
@ -937,7 +937,7 @@ class Get
* @param string $event The event to trigger * @param string $event The event to trigger
* @param mix $data The values to pass to the event/plugin * @param mix $data The values to pass to the event/plugin
* *
* @return string * @return void
* *
*/ */
public function triggerEvent($event, $data) public function triggerEvent($event, $data)
@ -3880,7 +3880,7 @@ class Get
{ {
$script = $this->setDynamicValues($script); $script = $this->setDynamicValues($script);
} }
// check if we still hava a string // check if we still have a string
if (ComponentbuilderHelper::checkString($script)) if (ComponentbuilderHelper::checkString($script))
{ {
// now load the placeholder snippet if needed // now load the placeholder snippet if needed
@ -5855,7 +5855,7 @@ class Get
$query->from($this->db->quoteName('#__componentbuilder_language_translation', 'a')); $query->from($this->db->quoteName('#__componentbuilder_language_translation', 'a'));
if (ComponentbuilderHelper::checkArray($values)) 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) $query->where($this->db->quoteName('a.source') . ' IN (' . implode(',', array_map(function($a)
{ {
return $this->db->quote($a); return $this->db->quote($a);
@ -5877,7 +5877,7 @@ class Get
* @return void * @return void
* *
*/ */
public function setLangPlaceholders($strings) public function setLangPlaceholders($strings, $target_id, $target = 'components')
{ {
$counterInsert = 0; $counterInsert = 0;
$counterUpdate = 0; $counterUpdate = 0;
@ -5888,7 +5888,7 @@ class Get
{ {
// to keep or remove // to keep or remove
$remove = false; $remove = false;
// build the tranlations // build the translations
if (ComponentbuilderHelper::checkString($string) && isset($this->multiLangString[$string])) if (ComponentbuilderHelper::checkString($string) && isset($this->multiLangString[$string]))
{ {
// make sure we have converted the string to array // make sure we have converted the string to array
@ -5923,18 +5923,18 @@ class Get
$remove = true; $remove = true;
} }
} }
// do the database managment // do the database management
if (ComponentbuilderHelper::checkString($string) && ($key = array_search($string, $strings)) !== false) if (ComponentbuilderHelper::checkString($string) && ($key = array_search($string, $strings)) !== false)
{ {
if (isset($this->multiLangString[$string])) if (isset($this->multiLangString[$string]))
{ {
// update the existing placeholder in db // update the existing placeholder in db
$id = $this->multiLangString[$string]['id']; $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); $targets = (array) json_decode($this->multiLangString[$string][$target], true);
// check if we should add the component ID // check if we should add the target ID
if (in_array($this->componentID, $components)) if (in_array($target_id, $targets))
{ {
// only skip the update if the string is published and has the component ID // only skip the update if the string is published and has the component ID
if ($this->multiLangString[$string]['published'] == 1) if ($this->multiLangString[$string]['published'] == 1)
@ -5944,15 +5944,15 @@ class Get
} }
else else
{ {
$components[] = $this->componentID; $targets[] = $target_id;
} }
} }
else else
{ {
$components = array($this->componentID); $targets = array($target_id);
} }
// start the bucket for this lang // start the bucket for this lang
$this->setUpdateExistingLangStrings($id, $components, 1, $today, $counterUpdate); $this->setUpdateExistingLangStrings($id, $target, $targets, 1, $today, $counterUpdate);
$counterUpdate++; $counterUpdate++;
@ -5967,19 +5967,23 @@ class Get
else else
{ {
// add the new lang placeholder to the db // add the new lang placeholder to the db
$this->newLangStrings[$counterInsert] = array(); if (!isset($this->newLangStrings[$target]))
$this->newLangStrings[$counterInsert][] = $this->db->quote(json_encode(array($this->componentID))); // 'components' {
$this->newLangStrings[$counterInsert][] = $this->db->quote($string); // 'source' $this->newLangStrings[$target] = array();
$this->newLangStrings[$counterInsert][] = $this->db->quote(1); // 'published' }
$this->newLangStrings[$counterInsert][] = $this->db->quote($today); // 'created' $this->newLangStrings[$target][$counterInsert] = array();
$this->newLangStrings[$counterInsert][] = $this->db->quote((int) $this->user->id); // 'created_by' $this->newLangStrings[$target][$counterInsert][] = $this->db->quote(json_encode(array([$target_id]))); // 'target'
$this->newLangStrings[$counterInsert][] = $this->db->quote(1); // 'version' $this->newLangStrings[$target][$counterInsert][] = $this->db->quote($string); // 'source'
$this->newLangStrings[$counterInsert][] = $this->db->quote(1); // 'access' $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++; $counterInsert++;
// load to db // load to db
$this->setNewLangStrings(100); $this->setNewLangStrings($target, 100);
} }
// only set the string once // only set the string once
unset($strings[$key]); unset($strings[$key]);
@ -5988,20 +5992,21 @@ class Get
} }
// just to make sure all is done // just to make sure all is done
$this->setExistingLangStrings(); $this->setExistingLangStrings();
$this->setNewLangStrings(); $this->setNewLangStrings($target);
} }
/** /**
* store the language placeholders * 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 * @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. // Create a new query object.
$query = $this->db->getQuery(true); $query = $this->db->getQuery(true);
@ -6011,7 +6016,7 @@ class Get
// Prepare the insert query. // Prepare the insert query.
$query->insert($this->db->quoteName('#__componentbuilder_language_translation')); $query->insert($this->db->quoteName('#__componentbuilder_language_translation'));
$query->columns($this->db->quoteName($columns)); $query->columns($this->db->quoteName($columns));
foreach ($this->newLangStrings as $values) foreach ($this->newLangStrings[$target] as $values)
{ {
if (count((array) $values) == 7) if (count((array) $values) == 7)
{ {
@ -6024,7 +6029,7 @@ class Get
} }
} }
// clear the values array // clear the values array
$this->newLangStrings = array(); $this->newLangStrings[$target] = array();
if (!$continue) if (!$continue)
{ {
return false; // insure we dont continue if no values were loaded return false; // insure we dont continue if no values were loaded
@ -6095,12 +6100,16 @@ class Get
* @return void * @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. // Create a new query object.
$query = $this->db->getQuery(true); $query = $this->db->getQuery(true);
$query->from($this->db->quoteName('#__componentbuilder_language_translation', 'a')); $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 // get all string that are not linked to this component
$query->where($this->db->quoteName('a.source') . ' NOT IN (' . implode(',', array_map(function($a) $query->where($this->db->quoteName('a.source') . ' NOT IN (' . implode(',', array_map(function($a)
{ {
@ -6116,49 +6125,66 @@ class Get
$today = JFactory::getDate()->toSql(); $today = JFactory::getDate()->toSql();
foreach ($otherStrings as $item) 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 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 // first remove the component from the string
unset($components[$key]); unset($targets[$key]);
// check if there are more components // check if there are more components
if (ComponentbuilderHelper::checkArray($components)) if (ComponentbuilderHelper::checkArray($targets))
{ {
// just update the string to unlink the current component // 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++; $counterUpdate++;
// load to db // load to db
$this->setExistingLangStrings(50); $this->setExistingLangStrings(50);
} }
// check if this string has been worked on // check if this string has been worked on or is linked to other extensions
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']);
}
}
else else
{ {
// remove the string since no translation found and not linked to any other component // the action (1 = remove, 2 = archive, 0 = do nothing)
$this->removeExitingLangString($item['id']); $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']);
}
} }
} }
} }
@ -6174,7 +6200,7 @@ class Get
* @return void * @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 // start the bucket for this lang
$this->existingLangStrings[$counterUpdate] = array(); $this->existingLangStrings[$counterUpdate] = array();
@ -6182,7 +6208,7 @@ class Get
$this->existingLangStrings[$counterUpdate]['conditions'] = array(); $this->existingLangStrings[$counterUpdate]['conditions'] = array();
$this->existingLangStrings[$counterUpdate]['conditions'][] = $this->db->quoteName('id') . ' = ' . $this->db->quote($id); $this->existingLangStrings[$counterUpdate]['conditions'][] = $this->db->quoteName('id') . ' = ' . $this->db->quote($id);
$this->existingLangStrings[$counterUpdate]['fields'] = array(); $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('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') . ' = ' . $this->db->quote($today);
$this->existingLangStrings[$counterUpdate]['fields'][] = $this->db->quoteName('modified_by') . ' = ' . $this->db->quote((int) $this->user->id); $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 // set GUI mapper field
$guiMapper['field'] = 'default'; $guiMapper['field'] = 'default';
$guiMapper['type'] = 'html';
$module->default = $this->setGuiCodePlaceholder( $module->default = $this->setGuiCodePlaceholder(
$this->setPlaceholders($this->setDynamicValues(base64_decode($module->default)), $this->placeholders), $this->setPlaceholders($this->setDynamicValues(base64_decode($module->default)), $this->placeholders),
$guiMapper $guiMapper
@ -8451,8 +8478,9 @@ class Get
$localPaths['admin'] = JPATH_ADMINISTRATOR . '/components/com_' . $this->componentCodeName; $localPaths['admin'] = JPATH_ADMINISTRATOR . '/components/com_' . $this->componentCodeName;
// site path // site path
$localPaths['site'] = JPATH_ROOT . '/components/com_' . $this->componentCodeName; $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; $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 // Painfull but we need to folder paths for the linked modules
if (($module_ids = $this->getModuleIDs()) !== false) if (($module_ids = $this->getModuleIDs()) !== false)
{ {

View File

@ -16806,8 +16806,7 @@ function vdm_dkim() {
// now build the language files // now build the language files
if (isset($this->langContent[$module->key])) if (isset($this->langContent[$module->key]))
{ {
$lang = array_map(function ($langstring, $placeholder) $lang = array_map(function ($langstring, $placeholder){
{
return $placeholder . '="' . $langstring . '"'; return $placeholder . '="' . $langstring . '"';
}, $this->langContent[$module->key], array_keys($this->langContent[$module->key])); }, $this->langContent[$module->key], array_keys($this->langContent[$module->key]));
// add to language file // add to language file
@ -17064,8 +17063,8 @@ function vdm_dkim() {
{ {
$xml .= PHP_EOL . PHP_EOL . $this->_t(1) . '<!--' . $this->setLine(__LINE__) . ' Language files -->'; $xml .= PHP_EOL . PHP_EOL . $this->_t(1) . '<!--' . $this->setLine(__LINE__) . ' Language files -->';
$xml .= PHP_EOL . $this->_t(1) . '<languages folder="language">'; $xml .= PHP_EOL . $this->_t(1) . '<languages folder="language">';
$xml .= PHP_EOL . $this->_t(2) . '<language tag="en-GB">' . $this->langTag . '/' . $this->langTag . '.plg_' . strtolower($plugin->group) . '_' . strtolower($plugin->code_name) . '.ini</language>'; $xml .= PHP_EOL . $this->_t(2) . '<language tag="' . $this->langTag . '">' . $this->langTag . '/' . $this->langTag . '.plg_' . strtolower($plugin->group) . '_' . strtolower($plugin->code_name) . '.ini</language>';
$xml .= PHP_EOL . $this->_t(2) . '<language tag="en-GB">' . $this->langTag . '/' . $this->langTag . '.plg_' . strtolower($plugin->group) . '_' . strtolower($plugin->code_name) . '.sys.ini</language>'; $xml .= PHP_EOL . $this->_t(2) . '<language tag="' . $this->langTag . '">' . $this->langTag . '/' . $this->langTag . '.plg_' . strtolower($plugin->group) . '_' . strtolower($plugin->code_name) . '.sys.ini</language>';
$xml .= PHP_EOL . $this->_t(1) . '</languages>'; $xml .= PHP_EOL . $this->_t(1) . '</languages>';
} }
// add the plugin files // add the plugin files

View File

@ -1253,16 +1253,16 @@ class Infusion extends Interpretation
// get the other lang strings if there is any // get the other lang strings if there is any
$this->multiLangString = $this->getMultiLangStrings($values); $this->multiLangString = $this->getMultiLangStrings($values);
// update insert the current lang in to DB // update insert the current lang in to DB
$this->setLangPlaceholders($values); $this->setLangPlaceholders($values, $this->componentID);
// remove old unused language strings // remove old unused language strings
$this->purgeLanuageStrings($values); $this->purgeLanuageStrings($values, $this->componentID);
// path to INI file // path to INI file
$getPAth = $this->templatePath . '/en-GB.com_admin.ini'; $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 // now we insert the values into the files
if (ComponentbuilderHelper::checkArray($this->languages)) 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 // rest xml array
$langXML = array(); $langXML = array();
foreach ($this->languages as $tag => $areas) foreach ($this->languages as $tag => $areas)

View File

@ -5603,7 +5603,7 @@ abstract class ComponentbuilderHelper
/** /**
* Change to nice fancy date * Change to nice fancy date
*/ */
public static function fancyDate($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) 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) 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) 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) 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)) if (!self::isValidTimeStamp($date))
{ {
$date = strtotime($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) * set the date as 2004/05/03 (for charts)
*/ */
public static function setYearMonthDay($date) public static function setYearMonthDay($date, $spacer = '/')
{ {
if (!self::isValidTimeStamp($date)) if (!self::isValidTimeStamp($date))
{ {
$date = strtotime($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) public static function isValidTimeStamp($timestamp)
{ {

View File

@ -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_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_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_SELECTED_TRY_ANOTHER="Already selected, try another."
COM_COMPONENTBUILDER_ALREADY_TRANSLATED_INTO="Already translated into"
COM_COMPONENTBUILDER_ALWAYS_ADD="Always Add" 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. <small>(Make <b>SURE</b> to move this zipped backup package out of the tmp folder before doing an import)</small><br />If you are importing a package of a 3rd party JCB package developer, <b>make sure it is a reputable JCB package developers!</b> <a %s>Find out why!</a>" 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. <small>(Make <b>SURE</b> to move this zipped backup package out of the tmp folder before doing an import)</small><br />If you are importing a package of a 3rd party JCB package developer, <b>make sure it is a reputable JCB package developers!</b> <a %s>Find out why!</a>"
COM_COMPONENTBUILDER_ANY_SELECTION_ONLY_FOUR_LISTRADIOCHECKBOXESDYNAMIC_LIST="Any Selection (only 4 list/radio/checkboxes/dynamic_list)" 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="Compiler Translate Button Access"
COM_COMPONENTBUILDER_COMPILER_TRANSLATE_BUTTON_ACCESS_DESC="Allows the users in this group to access the translate button." 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_COMPILE_COMPONENT="Compile Component"
COM_COMPONENTBUILDER_COMPONENT="Component"
COM_COMPONENTBUILDER_COMPONENTS="Components" COM_COMPONENTBUILDER_COMPONENTS="Components"
COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS="Components Admin Views" COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS="Components Admin Views"
COM_COMPONENTBUILDER_COMPONENTS_ADMIN_VIEWS_ACCESS="Components Admin Views Access" 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="Language Translations Submenu"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_SUBMENU_DESC="Allows the users in this group to submenu of language translation" 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="Components"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_COMPONENTS_LABEL="Components" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_COMPONENTS_LABEL="Components<br /><small>source string is used in these components</small>"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_CREATED_BY_DESC="The user that created this Language Translation." 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_BY_LABEL="Created By"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_CREATED_DATE_DESC="The date this Language Translation was created." 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_BY_LABEL="Modified By"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_MODIFIED_DATE_DESC="The date this Language Translation was modified." 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_MODIFIED_DATE_LABEL="Modified Date"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_MODULES="Modules"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_MODULES_LABEL="Modules<br /><small>source string is used in these modules</small>"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_NEW="A New Language Translation" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_NEW="A New Language Translation"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_ORDERING_LABEL="Ordering" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_ORDERING_LABEL="Ordering"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_PERMISSION="Permissions" COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_PERMISSION="Permissions"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_PLUGINS="Plugins"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_PLUGINS_LABEL="Plugins<br /><small>source string is used in these plugins</small>"
COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_PUBLISHING="Publishing" 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_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" 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_MIN_LENGTH_ONLY_FOUR_TEXT_FIELD="Min Length (only 4 text_field)"
COM_COMPONENTBUILDER_MODEL_AFTER_MODELLING="Model (after modelling)" COM_COMPONENTBUILDER_MODEL_AFTER_MODELLING="Model (after modelling)"
COM_COMPONENTBUILDER_MODEL_BEFORE_MODELLING="Model (before modelling)" COM_COMPONENTBUILDER_MODEL_BEFORE_MODELLING="Model (before modelling)"
COM_COMPONENTBUILDER_MODULE="Module"
COM_COMPONENTBUILDER_MODULES="Modules"
COM_COMPONENTBUILDER_NAME="Name" COM_COMPONENTBUILDER_NAME="Name"
COM_COMPONENTBUILDER_NAME_ASC="Name (Asc)" COM_COMPONENTBUILDER_NAME_ASC="Name (Asc)"
COM_COMPONENTBUILDER_NAME_DESC="Name (Desc)" 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_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_CLEARING_THE_TMP_FOLDER="Please wait! Clearing the tmp folder"
COM_COMPONENTBUILDER_PLEASE_WAIT_LOADING="Please wait, loading" COM_COMPONENTBUILDER_PLEASE_WAIT_LOADING="Please wait, loading"
COM_COMPONENTBUILDER_PLUGIN="Plugin"
COM_COMPONENTBUILDER_PLUGINS="Plugins"
COM_COMPONENTBUILDER_PROPERTIES="Properties" COM_COMPONENTBUILDER_PROPERTIES="Properties"
COM_COMPONENTBUILDER_PROPERTIESBR_SMALLHERE_YOU_CAN_SET_THE_PROPERTIES_FOR_THIS_FIELDSMALL="Properties<br /><small>Here you can set the properties for this field.</small>" COM_COMPONENTBUILDER_PROPERTIESBR_SMALLHERE_YOU_CAN_SET_THE_PROPERTIES_FOR_THIS_FIELDSMALL="Properties<br /><small>Here you can set the properties for this field.</small>"
COM_COMPONENTBUILDER_PROPERTY="Property" 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_UPDATE_ALL_OUT_DATED_SNIPPETS="Update All Out Dated Snippets"
COM_COMPONENTBUILDER_UP_TO_DATE="Up to date" COM_COMPONENTBUILDER_UP_TO_DATE="Up to date"
COM_COMPONENTBUILDER_USAGE="Usage" 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="Use Batch"
COM_COMPONENTBUILDER_USE_BATCH_DESC="Allows users in this group to use batch copy/update method." COM_COMPONENTBUILDER_USE_BATCH_DESC="Allows users in this group to use batch copy/update method."
COM_COMPONENTBUILDER_USE_KEY="Use Key" COM_COMPONENTBUILDER_USE_KEY="Use Key"

View File

@ -28,7 +28,9 @@ $fields_tab_layout = 'fields_' . $layout_path_array[1];
$fields = $displayData->get($fields_tab_layout) ?: array( $fields = $displayData->get($fields_tab_layout) ?: array(
'source', 'source',
'translation', 'translation',
'components' 'components',
'modules',
'plugins'
); );
$hiddenFields = $displayData->get('hidden_fields') ?: array(); $hiddenFields = $displayData->get('hidden_fields') ?: array();

View File

@ -0,0 +1,176 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
* @github Joomla Component Builder <https://github.com/vdm-io/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 = '&amp;ref=' . $values['view'] . '&amp;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 .= '&amp;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[] = '<a id="'.$button_code_name.'Create" class="btn btn-small btn-success hasTooltip" title="'.JText::sprintf('PLG_CONTENT_COMPONENTBUILDERLANGUAGETABS_CREATE_NEW_S', $button_label).'" style="border-radius: 0px 4px 4px 0px; padding: 4px 4px 4px 7px;"
href="index.php?option=com_componentbuilder&amp;view=language&amp;layout=edit'.$ref.'" >
<span class="icon-new icon-white"></span></a>';
}
// 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[] = '<a id="'.$button_code_name.'Edit" class="btn btn-small hasTooltip" title="'.JText::sprintf('PLG_CONTENT_COMPONENTBUILDERLANGUAGETABS_EDIT_S', $button_label).'" style="display: none; padding: 4px 4px 4px 7px;" href="#" >
<span class="icon-edit"></span></a>';
// 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 '<div class="input-append">' .$html . implode('',$button).'</div>';
}
}
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;
}
}

View File

@ -36,33 +36,43 @@ class JFormFieldLang extends JFormFieldList
protected function getOptions() protected function getOptions()
{ {
$db = JFactory::getDBO(); $db = JFactory::getDBO();
$query = $db->getQuery(true); $query = $db->getQuery(true);
$query->select($db->quoteName(array('a.langtag','a.name'),array('langtag','language_name'))); $query->select($db->quoteName(array('a.langtag','a.name'),array('langtag','language_name')));
$query->from($db->quoteName('#__componentbuilder_language', 'a')); $query->from($db->quoteName('#__componentbuilder_language', 'a'));
$query->where($db->quoteName('a.published') . ' >= 1'); $query->where($db->quoteName('a.published') . ' >= 1');
$query->order('a.langtag ASC'); $query->order('a.langtag ASC');
$db->setQuery((string)$query); $db->setQuery((string)$query);
$items = $db->loadObjectList(); $items = $db->loadObjectList();
// make sure the English GB is added // add the main language
$wasAdded = false; $main_lang = trim(JComponentHelper::getParams('com_componentbuilder')->get('language', 'en-GB'));
$options = array(); // make sure the main language is added
if ($items) $wasAdded = false;
{ $options = array();
$options[] = JHtml::_('select.option', '', 'Select an option'); if ($items)
foreach($items as $item)
{
$options[] = JHtml::_('select.option', trim($item->langtag), $item->language_name . ' (' .$item->langtag.')');
if ('en-GB' === trim($item->langtag))
{ {
$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 (it must default to $main_lang)
} if (!$wasAdded)
// now add it if not already added {
if (!$wasAdded) if ('en-GB' === $main_lang)
{ {
$options[] = JHtml::_('select.option', 'en-GB', 'English GB (en-GB)'); $options[] = JHtml::_('select.option', $main_lang, 'English GB (' . $main_lang . ')');
} }
return $options; else
{
$options[] = JHtml::_('select.option', $main_lang, 'Main Language (' . $main_lang . ')');
}
}
return $options;
} }
} }

View File

@ -100,15 +100,34 @@
readonly="true" readonly="true"
disabled="true" disabled="true"
/> />
<!-- Plugins Field. Type: Joomlaplugins. (custom) -->
<field
type="joomlaplugins"
name="plugins"
label="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_PLUGINS_LABEL"
class="list_class span12"
multiple="true"
default="0"
button="true"
/>
<!-- Modules Field. Type: Joomlamodules. (custom) -->
<field
type="joomlamodules"
name="modules"
label="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_MODULES_LABEL"
class="list_class span12"
multiple="true"
default="0"
button="true"
/>
<!-- Components Field. Type: Components. (custom) --> <!-- Components Field. Type: Components. (custom) -->
<field <field
type="components" type="components"
name="components" name="components"
label="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_COMPONENTS_LABEL" label="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_COMPONENTS_LABEL"
class="list_class" class="list_class span12"
multiple="true" multiple="true"
default="0" default="0"
required="true"
button="false" button="false"
/> />
<!-- Translation Field. Type: Subform. (joomla) --> <!-- Translation Field. Type: Subform. (joomla) -->
@ -141,7 +160,7 @@
label="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_LANGUAGE_LABEL" label="COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_LANGUAGE_LABEL"
class="list_class" class="list_class"
multiple="false" multiple="false"
default="0" default="en-GB"
required="true" required="true"
button="false" button="false"
/> />

View File

@ -29,7 +29,9 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin
'fullwidth' => array( 'fullwidth' => array(
'source', 'source',
'translation', 'translation',
'components' 'components',
'modules',
'plugins'
) )
) )
); );
@ -905,6 +907,18 @@ class ComponentbuilderModelLanguage_translation extends JModelAdmin
$data['translation'] = ''; $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. // Set the components string to JSON string.
if (isset($data['components'])) if (isset($data['components']))
{ {

View File

@ -104,50 +104,13 @@ class ComponentbuilderModelLanguage_translations extends JModelList
continue; continue;
} }
} // escape all strings if not being exported
} if (!isset($_export))
// show all languages that are already set for this string
if (!isset($_export) && ComponentbuilderHelper::checkArray($items))
{
foreach ($items as $nr => &$item)
{ {
$langBucket = array(); $item->source = ComponentbuilderHelper::htmlEscape($item->source, 'UTF-8', true, 150);
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 = ' - <small>' . JText::_('COM_COMPONENTBUILDER_USED_IN') . ' ' . count($item->components) . '</small>';
}
// load the languages to the string
if (ComponentbuilderHelper::checkArray($langBucket))
{
$item->source = '<small><em>(' . implode(', ', $langBucket) . ')</em></small> ' . ComponentbuilderHelper::htmlEscape($item->source, 'UTF-8', true, 150) . $componentCounter;
}
else
{
$item->source = '<small><em>(' . JText::_('COM_COMPONENTBUILDER_NOTRANSLATION') . ')</em></small> ' . 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)) if (isset($_export) && $_export && ComponentbuilderHelper::checkArray($items))
{ {
@ -157,6 +120,8 @@ class ComponentbuilderModelLanguage_translations extends JModelList
{ {
// remove some values completely // remove some values completely
unset($item->components); unset($item->components);
unset($item->modules);
unset($item->plugins);
unset($item->params); unset($item->params);
unset($item->published); unset($item->published);
unset($item->created_by); unset($item->created_by);
@ -331,6 +296,11 @@ class ComponentbuilderModelLanguage_translations extends JModelList
continue; 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 the values we don't want exported.
unset($item->asset_id); unset($item->asset_id);
unset($item->checked_out); unset($item->checked_out);
@ -344,49 +314,7 @@ class ComponentbuilderModelLanguage_translations extends JModelList
array_unshift($items,$headers); array_unshift($items,$headers);
} }
// show all languages that are already set for this string // prep the lang strings for export
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 = ' - <small>' . JText::_('COM_COMPONENTBUILDER_USED_IN') . ' ' . count($item->components) . '</small>';
}
// load the languages to the string
if (ComponentbuilderHelper::checkArray($langBucket))
{
$item->source = '<small><em>(' . implode(', ', $langBucket) . ')</em></small> ' . ComponentbuilderHelper::htmlEscape($item->source, 'UTF-8', true, 150) . $componentCounter;
}
else
{
$item->source = '<small><em>(' . JText::_('COM_COMPONENTBUILDER_NOTRANSLATION') . ')</em></small> ' . ComponentbuilderHelper::htmlEscape($item->source, 'UTF-8', true, 150) . $componentCounter;
}
}
}
// prep the lang strings for export
if (isset($_export) && $_export && ComponentbuilderHelper::checkArray($items)) if (isset($_export) && $_export && ComponentbuilderHelper::checkArray($items))
{ {
// insure we have the same order in the languages // insure we have the same order in the languages
@ -395,6 +323,8 @@ class ComponentbuilderModelLanguage_translations extends JModelList
{ {
// remove some values completely // remove some values completely
unset($item->components); unset($item->components);
unset($item->modules);
unset($item->plugins);
unset($item->params); unset($item->params);
unset($item->published); unset($item->published);
unset($item->created_by); unset($item->created_by);

View File

@ -1104,6 +1104,8 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_language_translation` (
`id` INT(11) NOT NULL AUTO_INCREMENT, `id` INT(11) NOT NULL AUTO_INCREMENT,
`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.',
`components` TEXT NOT NULL, `components` TEXT NOT NULL,
`modules` TEXT NOT NULL,
`plugins` TEXT NOT NULL,
`source` MEDIUMTEXT NOT NULL, `source` MEDIUMTEXT NOT NULL,
`translation` TEXT NOT NULL, `translation` TEXT NOT NULL,
`params` 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 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), (1, 'af-ZA', 'Afrikaans', '', 1, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(2, 'sq-AL', 'Albanian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 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', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 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', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 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', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 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', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (6, 'eu-ES', 'Basque', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(7, 'be-BY', 'Belarusian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (7, 'be-BY', 'Belarusian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(8, 'bn-BD', 'Bengali', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (8, 'bn-BD', 'Bengali', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(9, 'bs-BA', 'Bosnian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (9, 'bs-BA', 'Bosnian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(10, 'bg-BG', 'Bulgarian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (10, 'bg-BG', 'Bulgarian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(11, 'ca-ES', 'Catalan', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 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', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 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', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 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', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (14, 'hr-HR', 'Croatian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(15, 'cs-CZ', 'Czech', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (15, 'cs-CZ', 'Czech', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(16, 'da-DK', 'Danish', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 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', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 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', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (18, 'nl-NL', 'Dutch', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(19, 'dz-BT', 'Dzongkha', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 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', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 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', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 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', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 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', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 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', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 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', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (25, 'eo-XX', 'Esperanto', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(26, 'et-EE', 'Estonian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (26, 'et-EE', 'Estonian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(27, 'fi-FI', 'Finnish', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (27, 'fi-FI', 'Finnish', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(28, 'nl-BE', 'Flemish', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 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', '2018-09-14 10:39:11', 2, '', 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', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 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', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (31, 'gl-ES', 'Galician', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(32, 'ka-GE', 'Georgian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 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', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 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', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 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', '2018-09-14 10:39:11', 2, '', 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', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 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', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 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', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (38, 'el-GR', 'Greek', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(39, 'he-IL', 'Hebrew', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (39, 'he-IL', 'Hebrew', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(40, 'hi-IN', 'Hindi', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (40, 'hi-IN', 'Hindi', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(41, 'hu-HU', 'Hungarian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (41, 'hu-HU', 'Hungarian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(42, 'ga-IE', 'Irish', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (42, 'ga-IE', 'Irish', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(43, 'it-IT', 'Italian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (43, 'it-IT', 'Italian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(44, 'ja-JP', 'Japanese', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (44, 'ja-JP', 'Japanese', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(45, 'km-KH', 'Khmer', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (45, 'km-KH', 'Khmer', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(46, 'ko-KR', 'Korean', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (46, 'ko-KR', 'Korean', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(47, 'lv-LV', 'Latvian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (47, 'lv-LV', 'Latvian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(48, 'mk-MK', 'Macedonian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (48, 'mk-MK', 'Macedonian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(49, 'ms-MY', 'Malay', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (49, 'ms-MY', 'Malay', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(50, 'srp-ME', 'Montenegrin', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 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', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 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', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 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', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (53, 'fa-IR', 'Persian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(54, 'pl-PL', 'Polish', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 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', '2018-09-14 10:39:11', 2, '', 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', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 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', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 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', '2019-10-11 11:55:13', 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', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 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', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 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', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (61, 'si-LK', 'Sinhala', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(62, 'sk-SK', 'Slovak', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (62, 'sk-SK', 'Slovak', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(63, 'sl-SI', 'Slovenian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (63, 'sl-SI', 'Slovenian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(64, 'es-ES', 'Spanish', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 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', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 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', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (66, 'sw-KE', 'Swahili', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(67, 'sv-SE', 'Swedish', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (67, 'sv-SE', 'Swedish', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(68, 'sy-IQ', 'Syriac', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (68, 'sy-IQ', 'Syriac', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(69, 'ta-IN', 'Tamil', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (69, 'ta-IN', 'Tamil', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(70, 'th-TH', 'Thai', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (70, 'th-TH', 'Thai', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(71, 'tr-TR', 'Turkish', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (71, 'tr-TR', 'Turkish', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(72, 'tk-TM', 'Turkmen', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (72, 'tk-TM', 'Turkmen', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(73, 'uk-UA', 'Ukrainian', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (73, 'uk-UA', 'Ukrainian', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(74, 'ug-CN', 'Uyghur', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (74, 'ug-CN', 'Uyghur', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(75, 'vi-VN', 'Vietnamese', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (75, 'vi-VN', 'Vietnamese', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(76, 'cy-GB', 'Welsh', '', 1, '2018-04-19 13:43:44', '2018-09-14 10:39:11', 2, '', 1), (76, 'cy-GB', 'Welsh', '', 2, '2018-04-19 13:43:44', '2020-03-19 13:41:00', 3, '', 1),
(77, 'lt-LT', 'Lithuanian', '', 1, '2018-09-14 10:39:11', '0000-00-00 00:00:00', 1, '', 2); (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` -- Dumping data for table `#__componentbuilder_help_document`

View File

@ -0,0 +1 @@
ALTER TABLE `#__componentbuilder_joomla_module` ADD `target` TINYINT(1) NOT NULL DEFAULT 0 AFTER `system_name`;

View File

@ -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`;

View File

@ -61,15 +61,98 @@ $edit = "index.php?option=com_componentbuilder&view=language_translations&task=l
<?php endif; ?> <?php endif; ?>
</td> </td>
<td class="nowrap"> <td class="nowrap">
<div class="name"> <div>
<?php if ($canDo->get('language_translation.edit')): ?> <?php if ($canDo->get('language_translation.edit')): ?>
<a href="<?php echo $edit; ?>&id=<?php echo $item->id; ?>"><?php echo $item->source; ?></a> <a href="<?php echo $edit; ?>&id=<?php echo $item->id; ?>"><?php echo $item->source; ?></a>
<?php if ($item->checked_out): ?> <?php if ($item->checked_out): ?>
<?php echo JHtml::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'language_translations.', $canCheckin); ?> <?php echo JHtml::_('jgrid.checkedout', $i, $userChkOut->name, $item->checked_out_time, 'language_translations.', $canCheckin); ?>
<?php endif; ?>
<?php else: ?>
<?php echo $item->source; ?>
<?php endif; ?> <?php endif; ?>
<?php else: ?>
<?php echo $item->source; ?>
<?php endif; ?>
<?php
$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'];
}
}
}
}
// 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 = '<br />' . JText::_('COM_COMPONENTBUILDER_USED_IN') . ' ' . implode('<br />', $counterUsedin);
}
// load the languages to the string
if (ComponentbuilderHelper::checkArray($langBucket))
{
echo '<br /><small>' . JText::_('COM_COMPONENTBUILDER_ALREADY_TRANSLATED_INTO') . ' <em>(' . implode(', ', $langBucket) . ')</em>' . $numbersUsedin . '</small>';
}
else
{
echo '<br /><small><em>(' . JText::_('COM_COMPONENTBUILDER_NOTRANSLATION') . ')</em>' . $numbersUsedin . '</small>';
}
?>
</div> </div>
</td> </td>
<td class="center"> <td class="center">

View File

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.2" method="upgrade"> <extension type="component" version="3.2" method="upgrade">
<name>COM_COMPONENTBUILDER</name> <name>COM_COMPONENTBUILDER</name>
<creationDate>13th March, 2020</creationDate> <creationDate>24th March, 2020</creationDate>
<author>Llewellyn van der Merwe</author> <author>Llewellyn van der Merwe</author>
<authorEmail>llewellyn@joomlacomponentbuilder.com</authorEmail> <authorEmail>llewellyn@joomlacomponentbuilder.com</authorEmail>
<authorUrl>http://www.joomlacomponentbuilder.com</authorUrl> <authorUrl>http://www.joomlacomponentbuilder.com</authorUrl>
<copyright>Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved.</copyright> <copyright>Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license> <license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<version>2.10.12</version> <version>2.10.13</version>
<description><![CDATA[ <description><![CDATA[
<h1>Component Builder (v.2.10.12)</h1> <h1>Component Builder (v.2.10.13)</h1>
<div style="clear: both;"></div> <div style="clear: both;"></div>
<p>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. <p>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.

View File

@ -951,4 +951,21 @@
<maintainerurl>http://www.joomlacomponentbuilder.com</maintainerurl> <maintainerurl>http://www.joomlacomponentbuilder.com</maintainerurl>
<targetplatform name="joomla" version="3.*"/> <targetplatform name="joomla" version="3.*"/>
</update> </update>
<update>
<name>Component Builder</name>
<description>Builds Complex Joomla Components</description>
<element>com_componentbuilder</element>
<type>component</type>
<version>2.10.13</version>
<infourl title="Component Builder!">http://www.joomlacomponentbuilder.com</infourl>
<downloads>
<downloadurl type="full" format="zip">http://domain.com/demo.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>http://www.joomlacomponentbuilder.com</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
</updates> </updates>

View File

@ -6166,9 +6166,9 @@ class com_componentbuilderInstallerScript
$language_translation->type_title = 'Componentbuilder Language_translation'; $language_translation->type_title = 'Componentbuilder Language_translation';
$language_translation->type_alias = 'com_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->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->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. // Set the object into the content types table.
$language_translation_Inserted = $db->insertObject('#__content_types', $language_translation); $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_title = 'Componentbuilder Language_translation';
$language_translation->type_alias = 'com_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->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->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. // Check if language_translation type is already in content_type DB.
$language_translation_id = null; $language_translation_id = null;
@ -9115,7 +9115,7 @@ class com_componentbuilderInstallerScript
echo '<a target="_blank" href="http://www.joomlacomponentbuilder.com" title="Component Builder"> echo '<a target="_blank" href="http://www.joomlacomponentbuilder.com" title="Component Builder">
<img src="components/com_componentbuilder/assets/images/vdm-component.jpg"/> <img src="components/com_componentbuilder/assets/images/vdm-component.jpg"/>
</a> </a>
<h3>Upgrade to Version 2.10.12 Was Successful! Let us know if anything is not working as expected.</h3>'; <h3>Upgrade to Version 2.10.13 Was Successful! Let us know if anything is not working as expected.</h3>';
// Set db if not set already. // Set db if not set already.
if (!isset($db)) if (!isset($db))

View File

@ -5603,7 +5603,7 @@ abstract class ComponentbuilderHelper
/** /**
* Change to nice fancy date * Change to nice fancy date
*/ */
public static function fancyDate($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) 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) 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) 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) 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)) if (!self::isValidTimeStamp($date))
{ {
$date = strtotime($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) * set the date as 2004/05/03 (for charts)
*/ */
public static function setYearMonthDay($date) public static function setYearMonthDay($date, $spacer = '/')
{ {
if (!self::isValidTimeStamp($date)) if (!self::isValidTimeStamp($date))
{ {
$date = strtotime($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) public static function isValidTimeStamp($timestamp)
{ {