diff --git a/README.md b/README.md index dcaac0216..0532b82a2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Component Builder (2.4.1) +# Component Builder (2.4.2) This is a [Joomla 3.x](http://www.joomla.org/) component. @@ -8,7 +8,7 @@ The Component Builder for [Joomla](http://www.joomla.org/) that is highly advanc Whether you're a seasoned [Joomla](http://www.joomla.org/) 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.4.1) 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.4.2) with **ALL** its features and **ALL** concepts totally open-source and free! Once installed upgrades are quick and easy via the default Joomla upgrade area. @@ -105,13 +105,13 @@ Component Builder is mapped as a component in itself on my local development env + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](http://vdm.bz/component-builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 1st April, 2017 -+ *Version*: 2.4.1 ++ *Last Build*: 6th April, 2017 ++ *Version*: 2.4.2 + *Copyright*: Copyright (C) 2015. All Rights Reserved + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html -+ *Line count*: **96852** -+ *File count*: **581** -+ *Folder count*: **107** ++ *Line count*: **105639** ++ *File count*: **639** ++ *Folder count*: **115** > This **component** was build with a Joomla [Automated Component Builder](http://vdm.bz/component-builder). > Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io) diff --git a/admin/README.txt b/admin/README.txt index dcaac0216..0532b82a2 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -1,4 +1,4 @@ -# Component Builder (2.4.1) +# Component Builder (2.4.2) This is a [Joomla 3.x](http://www.joomla.org/) component. @@ -8,7 +8,7 @@ The Component Builder for [Joomla](http://www.joomla.org/) that is highly advanc Whether you're a seasoned [Joomla](http://www.joomla.org/) 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.4.1) 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.4.2) with **ALL** its features and **ALL** concepts totally open-source and free! Once installed upgrades are quick and easy via the default Joomla upgrade area. @@ -105,13 +105,13 @@ Component Builder is mapped as a component in itself on my local development env + *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io) + *Name*: [Component Builder](http://vdm.bz/component-builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 1st April, 2017 -+ *Version*: 2.4.1 ++ *Last Build*: 6th April, 2017 ++ *Version*: 2.4.2 + *Copyright*: Copyright (C) 2015. All Rights Reserved + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html -+ *Line count*: **96852** -+ *File count*: **581** -+ *Folder count*: **107** ++ *Line count*: **105639** ++ *File count*: **639** ++ *Folder count*: **115** > This **component** was build with a Joomla [Automated Component Builder](http://vdm.bz/component-builder). > Developed by [Llewellyn van der Merwe](mailto:joomla@vdm.io) diff --git a/admin/access.xml b/admin/access.xml index 4bf60b30b..cf8ae56ff 100644 --- a/admin/access.xml +++ b/admin/access.xml @@ -113,6 +113,29 @@ + + + + + + + + + + + + + + + + + + + + + + + @@ -243,6 +266,24 @@ +
+ + + + + + + +
+
+ + + + + + + +
diff --git a/admin/assets/css/admin.css b/admin/assets/css/admin.css index 03bbb02d6..b20c2bc7c 100644 --- a/admin/assets/css/admin.css +++ b/admin/assets/css/admin.css @@ -9,8 +9,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage admin.css diff --git a/admin/assets/css/custom_code.css b/admin/assets/css/custom_code.css index b4b088076..5a1ec04dc 100644 --- a/admin/assets/css/custom_code.css +++ b/admin/assets/css/custom_code.css @@ -9,8 +9,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 81 of this MVC - @build 1st March, 2017 + @version @update number 82 of this MVC + @build 3rd April, 2017 @created 11th October, 2016 @package Component Builder @subpackage custom_code.css diff --git a/admin/assets/css/custom_codes.css b/admin/assets/css/custom_codes.css index 346222347..d3cee09a1 100644 --- a/admin/assets/css/custom_codes.css +++ b/admin/assets/css/custom_codes.css @@ -9,8 +9,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 81 of this MVC - @build 1st March, 2017 + @version @update number 82 of this MVC + @build 3rd April, 2017 @created 11th October, 2016 @package Component Builder @subpackage custom_codes.css diff --git a/admin/assets/css/dashboard.css b/admin/assets/css/dashboard.css index 9b05bc3aa..0bfad228c 100644 --- a/admin/assets/css/dashboard.css +++ b/admin/assets/css/dashboard.css @@ -9,8 +9,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage dashboard.css diff --git a/admin/assets/css/help_document.css b/admin/assets/css/help_document.css index 982d7a0cd..a1d7c013c 100644 --- a/admin/assets/css/help_document.css +++ b/admin/assets/css/help_document.css @@ -10,7 +10,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 6 of this MVC - @build 17th October, 2016 + @build 18th October, 2016 @created 4th March, 2016 @package Component Builder @subpackage help_document.css diff --git a/admin/assets/css/help_documents.css b/admin/assets/css/help_documents.css index 03e4a4295..300e648f9 100644 --- a/admin/assets/css/help_documents.css +++ b/admin/assets/css/help_documents.css @@ -10,7 +10,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 6 of this MVC - @build 17th October, 2016 + @build 18th October, 2016 @created 4th March, 2016 @package Component Builder @subpackage help_documents.css diff --git a/admin/assets/css/joomla_component.css b/admin/assets/css/joomla_component.css index a7cffa02e..995ab078b 100644 --- a/admin/assets/css/joomla_component.css +++ b/admin/assets/css/joomla_component.css @@ -9,8 +9,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 311 of this MVC - @build 1st April, 2017 + @version @update number 318 of this MVC + @build 5th April, 2017 @created 6th May, 2015 @package Component Builder @subpackage joomla_component.css diff --git a/admin/assets/css/joomla_components.css b/admin/assets/css/joomla_components.css index a4176b676..13f47756a 100644 --- a/admin/assets/css/joomla_components.css +++ b/admin/assets/css/joomla_components.css @@ -9,8 +9,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 311 of this MVC - @build 1st April, 2017 + @version @update number 318 of this MVC + @build 5th April, 2017 @created 6th May, 2015 @package Component Builder @subpackage joomla_components.css diff --git a/admin/assets/css/language.css b/admin/assets/css/language.css new file mode 100644 index 000000000..95309ab6b --- /dev/null +++ b/admin/assets/css/language.css @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/ + __ __ _ _____ _ _ __ __ _ _ _ + \ \ / / | | | __ \ | | | | | \/ | | | | | | | + \ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| | + \ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` | + \ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| | + \/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_| + | | + |_| +/-------------------------------------------------------------------------------------------------------------------------------/ + + @version @update number 3 of this MVC + @build 3rd April, 2017 + @created 3rd April, 2017 + @package Component Builder + @subpackage language.css + @author Llewellyn van der Merwe + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +/* CSS Document */ + + diff --git a/admin/assets/css/language_translation.css b/admin/assets/css/language_translation.css new file mode 100644 index 000000000..8810a3e85 --- /dev/null +++ b/admin/assets/css/language_translation.css @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/ + __ __ _ _____ _ _ __ __ _ _ _ + \ \ / / | | | __ \ | | | | | \/ | | | | | | | + \ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| | + \ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` | + \ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| | + \/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_| + | | + |_| +/-------------------------------------------------------------------------------------------------------------------------------/ + + @version @update number 37 of this MVC + @build 5th April, 2017 + @created 3rd April, 2017 + @package Component Builder + @subpackage language_translation.css + @author Llewellyn van der Merwe + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +/* CSS Document */ + + diff --git a/admin/assets/css/language_translations.css b/admin/assets/css/language_translations.css new file mode 100644 index 000000000..851949bcb --- /dev/null +++ b/admin/assets/css/language_translations.css @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/ + __ __ _ _____ _ _ __ __ _ _ _ + \ \ / / | | | __ \ | | | | | \/ | | | | | | | + \ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| | + \ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` | + \ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| | + \/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_| + | | + |_| +/-------------------------------------------------------------------------------------------------------------------------------/ + + @version @update number 37 of this MVC + @build 5th April, 2017 + @created 3rd April, 2017 + @package Component Builder + @subpackage language_translations.css + @author Llewellyn van der Merwe + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +/* CSS Document */ + + diff --git a/admin/assets/css/languages.css b/admin/assets/css/languages.css new file mode 100644 index 000000000..581d6aa11 --- /dev/null +++ b/admin/assets/css/languages.css @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/ + __ __ _ _____ _ _ __ __ _ _ _ + \ \ / / | | | __ \ | | | | | \/ | | | | | | | + \ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| | + \ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` | + \ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| | + \/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_| + | | + |_| +/-------------------------------------------------------------------------------------------------------------------------------/ + + @version @update number 3 of this MVC + @build 3rd April, 2017 + @created 3rd April, 2017 + @package Component Builder + @subpackage languages.css + @author Llewellyn van der Merwe + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +/* CSS Document */ + + diff --git a/admin/assets/images/icons/language_translations.png b/admin/assets/images/icons/language_translations.png new file mode 100644 index 000000000..94873206e Binary files /dev/null and b/admin/assets/images/icons/language_translations.png differ diff --git a/admin/compiler/joomla_3/component.xml b/admin/compiler/joomla_3/component.xml index a51f9eb84..e729a86db 100644 --- a/admin/compiler/joomla_3/component.xml +++ b/admin/compiler/joomla_3/component.xml @@ -60,8 +60,7 @@ - language/en-GB/en-GB.com_###component###.ini - language/en-GB/en-GB.com_###component###.sys.ini + ###SITE_LANGUAGES### @@ -86,8 +85,7 @@ - language/en-GB/en-GB.com_###component###.ini - language/en-GB/en-GB.com_###component###.sys.ini + ###ADMIN_LANGUAGES### ###UPDATESERVER### diff --git a/admin/compiler/joomla_3/settings.json b/admin/compiler/joomla_3/settings.json index 878ecefbc..9e5cd8796 100644 --- a/admin/compiler/joomla_3/settings.json +++ b/admin/compiler/joomla_3/settings.json @@ -170,18 +170,6 @@ "rename": false, "type": "file" }, - "en-GB.com_admin.ini": { - "naam":"en-GB.com_admin.ini", - "path": "c0mp0n3nt/admin/language/en-GB", - "rename": "admin", - "type": "file" - }, - "en-GB.com_admin.sys.ini": { - "naam":"en-GB.com_admin.sys.ini", - "path": "c0mp0n3nt/admin/language/en-GB", - "rename": "admin", - "type": "file" - }, "install.mysql.utf8.sql": { "naam":"install.mysql.utf8.sql", "path": "c0mp0n3nt/admin/sql", @@ -219,18 +207,6 @@ "rename": false, "type": "file" }, - "en-GB.com_site.ini": { - "naam":"en-GB.com_site.ini", - "path": "c0mp0n3nt/site/language/en-GB", - "rename": "site", - "type": "file" - }, - "en-GB.com_site.sys.ini": { - "naam":"en-GB.com_site.sys.ini", - "path": "c0mp0n3nt/site/language/en-GB", - "rename": "site", - "type": "file" - }, "headercheck.php": { "naam":"headercheck.php", "path": "c0mp0n3nt/site/helpers", diff --git a/admin/componentbuilder.php b/admin/componentbuilder.php index 90cddbad7..6600da4f9 100644 --- a/admin/componentbuilder.php +++ b/admin/componentbuilder.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage componentbuilder.php @@ -44,7 +44,10 @@ $document->addScript('components/com_componentbuilder/assets/js/admin.js'); // require helper files JLoader::register('ComponentbuilderHelper', dirname(__FILE__) . '/helpers/componentbuilder.php'); -JLoader::register('JHtmlBatch_', dirname(__FILE__) . '/helpers/html/batch_.php'); +JLoader::register('JHtmlBatch_', dirname(__FILE__) . '/helpers/html/batch_.php'); + +// Triger the Global Admin Event +ComponentbuilderHelper::globalEvent($document); // import joomla controller library jimport('joomla.application.component.controller'); diff --git a/admin/config.xml b/admin/config.xml index 2d9335ac8..82e1ac334 100644 --- a/admin/config.xml +++ b/admin/config.xml @@ -61,6 +61,19 @@ + + 'snippets', 'field' => 'fields', 'fieldtype' => 'fieldtypes', + 'language_translation' => 'language_translations', + 'language' => 'languages', 'help_document' => 'help_documents' ); // check if this is a list view diff --git a/admin/controllers/ajax.json.php b/admin/controllers/ajax.json.php index 01a3db4d2..50c0da44b 100644 --- a/admin/controllers/ajax.json.php +++ b/admin/controllers/ajax.json.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage ajax.json.php @@ -57,7 +57,9 @@ class ComponentbuilderControllerAjax extends JControllerLegacy $this->registerTask('viewTableColumns', 'ajax'); $this->registerTask('checkFunctionName', 'ajax'); $this->registerTask('usedin', 'ajax'); - $this->registerTask('fieldOptions', 'ajax'); + $this->registerTask('fieldOptions', 'ajax'); + $this->registerTask('getBuildTable', 'ajax'); + $this->registerTask('getButton', 'ajax'); } public function ajax() @@ -687,6 +689,83 @@ class ComponentbuilderControllerAjax extends JControllerLegacy echo "(".json_encode($e).");"; } } + break; + case 'getBuildTable': + try + { + $returnRaw = $jinput->get('raw', false, 'BOOLEAN'); + $idNameValue = $jinput->get('idName', NULL, 'CMD'); + $objectValue = $jinput->get('object', NULL, 'STRING'); + if($idNameValue && $objectValue && $user->id != 0) + { + $result = $this->getModel('ajax')->getBuildTable($idNameValue, $objectValue); + } + else + { + $result = false; + } + if($callback = $jinput->get('callback', null, 'CMD')) + { + echo $callback . "(".json_encode($result).");"; + } + elseif($returnRaw) + { + echo json_encode($result); + } + else + { + echo "(".json_encode($result).");"; + } + } + catch(Exception $e) + { + if($callback = $jinput->get('callback', null, 'CMD')) + { + echo $callback."(".json_encode($e).");"; + } + else + { + echo "(".json_encode($e).");"; + } + } + break; + case 'getButton': + try + { + $returnRaw = $jinput->get('raw', false, 'BOOLEAN'); + $typeValue = $jinput->get('type', NULL, 'WORD'); + if($typeValue && $user->id != 0) + { + $result = $this->getModel('ajax')->getButton($typeValue); + } + else + { + $result = false; + } + if($callback = $jinput->get('callback', null, 'CMD')) + { + echo $callback . "(".json_encode($result).");"; + } + elseif($returnRaw) + { + echo json_encode($result); + } + else + { + echo "(".json_encode($result).");"; + } + } + catch(Exception $e) + { + if($callback = $jinput->get('callback', null, 'CMD')) + { + echo $callback."(".json_encode($e).");"; + } + else + { + echo "(".json_encode($e).");"; + } + } break; } } diff --git a/admin/controllers/componentbuilder.php b/admin/controllers/componentbuilder.php index 88a662e27..53f5007ef 100644 --- a/admin/controllers/componentbuilder.php +++ b/admin/controllers/componentbuilder.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage componentbuilder.php diff --git a/admin/controllers/custom_code.php b/admin/controllers/custom_code.php index b772871cb..bb3a1b148 100644 --- a/admin/controllers/custom_code.php +++ b/admin/controllers/custom_code.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 81 of this MVC - @build 1st March, 2017 + @version @update number 82 of this MVC + @build 3rd April, 2017 @created 11th October, 2016 @package Component Builder @subpackage custom_code.php diff --git a/admin/controllers/custom_codes.php b/admin/controllers/custom_codes.php index 6dc75d3b1..d4e4664ca 100644 --- a/admin/controllers/custom_codes.php +++ b/admin/controllers/custom_codes.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 81 of this MVC - @build 1st March, 2017 + @version @update number 82 of this MVC + @build 3rd April, 2017 @created 11th October, 2016 @package Component Builder @subpackage custom_codes.php diff --git a/admin/controllers/help.php b/admin/controllers/help.php index eec752953..b33c360a5 100644 --- a/admin/controllers/help.php +++ b/admin/controllers/help.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage help.php diff --git a/admin/controllers/help_document.php b/admin/controllers/help_document.php index e7a5d3383..1389b5741 100644 --- a/admin/controllers/help_document.php +++ b/admin/controllers/help_document.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 6 of this MVC - @build 17th October, 2016 + @build 18th October, 2016 @created 4th March, 2016 @package Component Builder @subpackage help_document.php diff --git a/admin/controllers/help_documents.php b/admin/controllers/help_documents.php index 892240596..7f4065f2c 100644 --- a/admin/controllers/help_documents.php +++ b/admin/controllers/help_documents.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 6 of this MVC - @build 17th October, 2016 + @build 18th October, 2016 @created 4th March, 2016 @package Component Builder @subpackage help_documents.php diff --git a/admin/controllers/import.php b/admin/controllers/import.php index 7be5cf42b..70fbd9a38 100644 --- a/admin/controllers/import.php +++ b/admin/controllers/import.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage import.php diff --git a/admin/controllers/import_joomla_components.php b/admin/controllers/import_joomla_components.php index 978adcfc0..dd5d1d6c1 100644 --- a/admin/controllers/import_joomla_components.php +++ b/admin/controllers/import_joomla_components.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage import_joomla_components.php diff --git a/admin/controllers/joomla_component.php b/admin/controllers/joomla_component.php index 3da08775a..f31a3c84b 100644 --- a/admin/controllers/joomla_component.php +++ b/admin/controllers/joomla_component.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 311 of this MVC - @build 1st April, 2017 + @version @update number 318 of this MVC + @build 5th April, 2017 @created 6th May, 2015 @package Component Builder @subpackage joomla_component.php diff --git a/admin/controllers/joomla_components.php b/admin/controllers/joomla_components.php index c03546916..11127a42b 100644 --- a/admin/controllers/joomla_components.php +++ b/admin/controllers/joomla_components.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 311 of this MVC - @build 1st April, 2017 + @version @update number 318 of this MVC + @build 5th April, 2017 @created 6th May, 2015 @package Component Builder @subpackage joomla_components.php diff --git a/admin/controllers/language.php b/admin/controllers/language.php new file mode 100644 index 000000000..aef23b27d --- /dev/null +++ b/admin/controllers/language.php @@ -0,0 +1,326 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// import Joomla controllerform library +jimport('joomla.application.component.controllerform'); + +/** + * Language Controller + */ +class ComponentbuilderControllerLanguage extends JControllerForm +{ + /** + * Current or most recently performed task. + * + * @var string + * @since 12.2 + * @note Replaces _task. + */ + protected $task; + + public function __construct($config = array()) + { + $this->view_list = 'Languages'; // safeguard for setting the return view listing to the main view. + parent::__construct($config); + } + + /** + * Method override to check if you can add a new record. + * + * @param array $data An array of input data. + * + * @return boolean + * + * @since 1.6 + */ + protected function allowAdd($data = array()) + { + // Access check. + $access = JFactory::getUser()->authorise('language.access', 'com_componentbuilder'); + if (!$access) + { + return false; + } + // In the absense of better information, revert to the component permissions. + return JFactory::getUser()->authorise('language.create', $this->option); + } + + /** + * Method override to check if you can edit an existing record. + * + * @param array $data An array of input data. + * @param string $key The name of the key for the primary key. + * + * @return boolean + * + * @since 1.6 + */ + protected function allowEdit($data = array(), $key = 'id') + { + // get user object. + $user = JFactory::getUser(); + // get record id. + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + + + // Access check. + $access = ($user->authorise('language.access', 'com_componentbuilder.language.' . (int) $recordId) && $user->authorise('language.access', 'com_componentbuilder')); + if (!$access) + { + return false; + } + + if ($recordId) + { + // The record has been set. Check the record permissions. + $permission = $user->authorise('language.edit', 'com_componentbuilder.language.' . (int) $recordId); + if (!$permission) + { + if ($user->authorise('language.edit.own', 'com_componentbuilder.language.' . $recordId)) + { + // Now test the owner is the user. + $ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0; + if (empty($ownerId)) + { + // Need to do a lookup from the model. + $record = $this->getModel()->getItem($recordId); + + if (empty($record)) + { + return false; + } + $ownerId = $record->created_by; + } + + // If the owner matches 'me' then allow. + if ($ownerId == $user->id) + { + if ($user->authorise('language.edit.own', 'com_componentbuilder')) + { + return true; + } + } + } + return false; + } + } + // Since there is no permission, revert to the component permissions. + return $user->authorise('language.edit', $this->option); + } + + /** + * Gets the URL arguments to append to an item redirect. + * + * @param integer $recordId The primary key id for the item. + * @param string $urlVar The name of the URL variable for the id. + * + * @return string The arguments to append to the redirect URL. + * + * @since 12.2 + */ + protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id') + { + $tmpl = $this->input->get('tmpl'); + $layout = $this->input->get('layout', 'edit', 'string'); + + $ref = $this->input->get('ref', 0, 'string'); + $refid = $this->input->get('refid', 0, 'int'); + + // Setup redirect info. + + $append = ''; + + if ($refid) + { + $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; + } + elseif ($ref) + { + $append .= '&ref='.(string)$ref; + } + + if ($tmpl) + { + $append .= '&tmpl=' . $tmpl; + } + + if ($layout) + { + $append .= '&layout=' . $layout; + } + + if ($recordId) + { + $append .= '&' . $urlVar . '=' . $recordId; + } + + return $append; + } + + /** + * Method to run batch operations. + * + * @param object $model The model. + * + * @return boolean True if successful, false otherwise and internal error is set. + * + * @since 2.5 + */ + public function batch($model = null) + { + JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + + // Set the model + $model = $this->getModel('Language', '', array()); + + // Preset the redirect + $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=languages' . $this->getRedirectToListAppend(), false)); + + return parent::batch($model); + } + + /** + * Method to cancel an edit. + * + * @param string $key The name of the primary key of the URL variable. + * + * @return boolean True if access level checks pass, false otherwise. + * + * @since 12.2 + */ + public function cancel($key = null) + { + // get the referal details + $this->ref = $this->input->get('ref', 0, 'word'); + $this->refid = $this->input->get('refid', 0, 'int'); + + $cancel = parent::cancel($key); + + if ($cancel) + { + if ($this->refid) + { + $redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid; + + // Redirect to the item screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + elseif ($this->ref) + { + $redirect = '&view='.(string)$this->ref; + + // Redirect to the list screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + } + else + { + // Redirect to the items screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . '&view=' . $this->view_list, false + ) + ); + } + return $cancel; + } + + /** + * Method to save a record. + * + * @param string $key The name of the primary key of the URL variable. + * @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions). + * + * @return boolean True if successful, false otherwise. + * + * @since 12.2 + */ + public function save($key = null, $urlVar = null) + { + // get the referal details + $this->ref = $this->input->get('ref', 0, 'word'); + $this->refid = $this->input->get('refid', 0, 'int'); + + if ($this->ref || $this->refid) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } + + $saved = parent::save($key, $urlVar); + + if ($this->refid && $saved) + { + $redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid; + + // Redirect to the item screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + elseif ($this->ref && $saved) + { + $redirect = '&view='.(string)$this->ref; + + // Redirect to the list screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + return $saved; + } + + /** + * Function that allows child controller access to model data + * after the data has been saved. + * + * @param JModel &$model The data model object. + * @param array $validData The validated data. + * + * @return void + * + * @since 11.1 + */ + protected function postSaveHook(JModelLegacy $model, $validData = array()) + { + return; + } + +} diff --git a/admin/controllers/language_translation.php b/admin/controllers/language_translation.php new file mode 100644 index 000000000..f4b1c9e7e --- /dev/null +++ b/admin/controllers/language_translation.php @@ -0,0 +1,326 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// import Joomla controllerform library +jimport('joomla.application.component.controllerform'); + +/** + * Language_translation Controller + */ +class ComponentbuilderControllerLanguage_translation extends JControllerForm +{ + /** + * Current or most recently performed task. + * + * @var string + * @since 12.2 + * @note Replaces _task. + */ + protected $task; + + public function __construct($config = array()) + { + $this->view_list = 'Language_translations'; // safeguard for setting the return view listing to the main view. + parent::__construct($config); + } + + /** + * Method override to check if you can add a new record. + * + * @param array $data An array of input data. + * + * @return boolean + * + * @since 1.6 + */ + protected function allowAdd($data = array()) + { + // Access check. + $access = JFactory::getUser()->authorise('language_translation.access', 'com_componentbuilder'); + if (!$access) + { + return false; + } + // In the absense of better information, revert to the component permissions. + return JFactory::getUser()->authorise('language_translation.create', $this->option); + } + + /** + * Method override to check if you can edit an existing record. + * + * @param array $data An array of input data. + * @param string $key The name of the key for the primary key. + * + * @return boolean + * + * @since 1.6 + */ + protected function allowEdit($data = array(), $key = 'id') + { + // get user object. + $user = JFactory::getUser(); + // get record id. + $recordId = (int) isset($data[$key]) ? $data[$key] : 0; + + + // Access check. + $access = ($user->authorise('language_translation.access', 'com_componentbuilder.language_translation.' . (int) $recordId) && $user->authorise('language_translation.access', 'com_componentbuilder')); + if (!$access) + { + return false; + } + + if ($recordId) + { + // The record has been set. Check the record permissions. + $permission = $user->authorise('language_translation.edit', 'com_componentbuilder.language_translation.' . (int) $recordId); + if (!$permission) + { + if ($user->authorise('language_translation.edit.own', 'com_componentbuilder.language_translation.' . $recordId)) + { + // Now test the owner is the user. + $ownerId = (int) isset($data['created_by']) ? $data['created_by'] : 0; + if (empty($ownerId)) + { + // Need to do a lookup from the model. + $record = $this->getModel()->getItem($recordId); + + if (empty($record)) + { + return false; + } + $ownerId = $record->created_by; + } + + // If the owner matches 'me' then allow. + if ($ownerId == $user->id) + { + if ($user->authorise('language_translation.edit.own', 'com_componentbuilder')) + { + return true; + } + } + } + return false; + } + } + // Since there is no permission, revert to the component permissions. + return $user->authorise('language_translation.edit', $this->option); + } + + /** + * Gets the URL arguments to append to an item redirect. + * + * @param integer $recordId The primary key id for the item. + * @param string $urlVar The name of the URL variable for the id. + * + * @return string The arguments to append to the redirect URL. + * + * @since 12.2 + */ + protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id') + { + $tmpl = $this->input->get('tmpl'); + $layout = $this->input->get('layout', 'edit', 'string'); + + $ref = $this->input->get('ref', 0, 'string'); + $refid = $this->input->get('refid', 0, 'int'); + + // Setup redirect info. + + $append = ''; + + if ($refid) + { + $append .= '&ref='.(string)$ref.'&refid='.(int)$refid; + } + elseif ($ref) + { + $append .= '&ref='.(string)$ref; + } + + if ($tmpl) + { + $append .= '&tmpl=' . $tmpl; + } + + if ($layout) + { + $append .= '&layout=' . $layout; + } + + if ($recordId) + { + $append .= '&' . $urlVar . '=' . $recordId; + } + + return $append; + } + + /** + * Method to run batch operations. + * + * @param object $model The model. + * + * @return boolean True if successful, false otherwise and internal error is set. + * + * @since 2.5 + */ + public function batch($model = null) + { + JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN')); + + // Set the model + $model = $this->getModel('Language_translation', '', array()); + + // Preset the redirect + $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=language_translations' . $this->getRedirectToListAppend(), false)); + + return parent::batch($model); + } + + /** + * Method to cancel an edit. + * + * @param string $key The name of the primary key of the URL variable. + * + * @return boolean True if access level checks pass, false otherwise. + * + * @since 12.2 + */ + public function cancel($key = null) + { + // get the referal details + $this->ref = $this->input->get('ref', 0, 'word'); + $this->refid = $this->input->get('refid', 0, 'int'); + + $cancel = parent::cancel($key); + + if ($cancel) + { + if ($this->refid) + { + $redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid; + + // Redirect to the item screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + elseif ($this->ref) + { + $redirect = '&view='.(string)$this->ref; + + // Redirect to the list screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + } + else + { + // Redirect to the items screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . '&view=' . $this->view_list, false + ) + ); + } + return $cancel; + } + + /** + * Method to save a record. + * + * @param string $key The name of the primary key of the URL variable. + * @param string $urlVar The name of the URL variable if different from the primary key (sometimes required to avoid router collisions). + * + * @return boolean True if successful, false otherwise. + * + * @since 12.2 + */ + public function save($key = null, $urlVar = null) + { + // get the referal details + $this->ref = $this->input->get('ref', 0, 'word'); + $this->refid = $this->input->get('refid', 0, 'int'); + + if ($this->ref || $this->refid) + { + // to make sure the item is checkedin on redirect + $this->task = 'save'; + } + + $saved = parent::save($key, $urlVar); + + if ($this->refid && $saved) + { + $redirect = '&view='.(string)$this->ref.'&layout=edit&id='.(int)$this->refid; + + // Redirect to the item screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + elseif ($this->ref && $saved) + { + $redirect = '&view='.(string)$this->ref; + + // Redirect to the list screen. + $this->setRedirect( + JRoute::_( + 'index.php?option=' . $this->option . $redirect, false + ) + ); + } + return $saved; + } + + /** + * Function that allows child controller access to model data + * after the data has been saved. + * + * @param JModel &$model The data model object. + * @param array $validData The validated data. + * + * @return void + * + * @since 11.1 + */ + protected function postSaveHook(JModelLegacy $model, $validData = array()) + { + return; + } + +} diff --git a/admin/controllers/language_translations.php b/admin/controllers/language_translations.php new file mode 100644 index 000000000..af6d29edc --- /dev/null +++ b/admin/controllers/language_translations.php @@ -0,0 +1,111 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// import Joomla controlleradmin library +jimport('joomla.application.component.controlleradmin'); + +/** + * Language_translations Controller + */ +class ComponentbuilderControllerLanguage_translations extends JControllerAdmin +{ + protected $text_prefix = 'COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS'; + /** + * Proxy for getModel. + * @since 2.5 + */ + public function getModel($name = 'Language_translation', $prefix = 'ComponentbuilderModel', $config = array()) + { + $model = parent::getModel($name, $prefix, array('ignore_request' => true)); + + return $model; + } + + public function exportData() + { + // Check for request forgeries + JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + // check if export is allowed for this user. + $user = JFactory::getUser(); + if ($user->authorise('language_translation.export', 'com_componentbuilder') && $user->authorise('core.export', 'com_componentbuilder')) + { + // Get the input + $input = JFactory::getApplication()->input; + $pks = $input->post->get('cid', array(), 'array'); + // Sanitize the input + JArrayHelper::toInteger($pks); + // Get the model + $model = $this->getModel('Language_translations'); + // get the data to export + $data = $model->getExportData($pks); + if (ComponentbuilderHelper::checkArray($data)) + { + // now set the data to the spreadsheet + $date = JFactory::getDate(); + ComponentbuilderHelper::xls($data,'Language_translations_'.$date->format('jS_F_Y'),'Language translations exported ('.$date->format('jS F, Y').')','language translations'); + } + } + // Redirect to the list screen with error. + $message = JText::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); + $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=language_translations', false), $message, 'error'); + return; + } + + + public function importData() + { + // Check for request forgeries + JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + // check if import is allowed for this user. + $user = JFactory::getUser(); + if ($user->authorise('language_translation.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder')) + { + // Get the import model + $model = $this->getModel('Language_translations'); + // get the headers to import + $headers = $model->getExImPortHeaders(); + if (ComponentbuilderHelper::checkObject($headers)) + { + // Load headers to session. + $session = JFactory::getSession(); + $headers = json_encode($headers); + $session->set('language_translation_VDM_IMPORTHEADERS', $headers); + $session->set('backto_VDM_IMPORT', 'language_translations'); + $session->set('dataType_VDM_IMPORTINTO', 'language_translation'); + // Redirect to import view. + $message = JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_LANGUAGE_TRANSLATIONS'); + $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import', false), $message); + return; + } + } + // Redirect to the list screen with error. + $message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); + $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=language_translations', false), $message, 'error'); + return; + } +} diff --git a/admin/controllers/languages.php b/admin/controllers/languages.php new file mode 100644 index 000000000..62ec59cd5 --- /dev/null +++ b/admin/controllers/languages.php @@ -0,0 +1,111 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// import Joomla controlleradmin library +jimport('joomla.application.component.controlleradmin'); + +/** + * Languages Controller + */ +class ComponentbuilderControllerLanguages extends JControllerAdmin +{ + protected $text_prefix = 'COM_COMPONENTBUILDER_LANGUAGES'; + /** + * Proxy for getModel. + * @since 2.5 + */ + public function getModel($name = 'Language', $prefix = 'ComponentbuilderModel', $config = array()) + { + $model = parent::getModel($name, $prefix, array('ignore_request' => true)); + + return $model; + } + + public function exportData() + { + // Check for request forgeries + JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + // check if export is allowed for this user. + $user = JFactory::getUser(); + if ($user->authorise('language.export', 'com_componentbuilder') && $user->authorise('core.export', 'com_componentbuilder')) + { + // Get the input + $input = JFactory::getApplication()->input; + $pks = $input->post->get('cid', array(), 'array'); + // Sanitize the input + JArrayHelper::toInteger($pks); + // Get the model + $model = $this->getModel('Languages'); + // get the data to export + $data = $model->getExportData($pks); + if (ComponentbuilderHelper::checkArray($data)) + { + // now set the data to the spreadsheet + $date = JFactory::getDate(); + ComponentbuilderHelper::xls($data,'Languages_'.$date->format('jS_F_Y'),'Languages exported ('.$date->format('jS F, Y').')','languages'); + } + } + // Redirect to the list screen with error. + $message = JText::_('COM_COMPONENTBUILDER_EXPORT_FAILED'); + $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=languages', false), $message, 'error'); + return; + } + + + public function importData() + { + // Check for request forgeries + JSession::checkToken() or die(JText::_('JINVALID_TOKEN')); + // check if import is allowed for this user. + $user = JFactory::getUser(); + if ($user->authorise('language.import', 'com_componentbuilder') && $user->authorise('core.import', 'com_componentbuilder')) + { + // Get the import model + $model = $this->getModel('Languages'); + // get the headers to import + $headers = $model->getExImPortHeaders(); + if (ComponentbuilderHelper::checkObject($headers)) + { + // Load headers to session. + $session = JFactory::getSession(); + $headers = json_encode($headers); + $session->set('language_VDM_IMPORTHEADERS', $headers); + $session->set('backto_VDM_IMPORT', 'languages'); + $session->set('dataType_VDM_IMPORTINTO', 'language'); + // Redirect to import view. + $message = JText::_('COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_LANGUAGES'); + $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=import', false), $message); + return; + } + } + // Redirect to the list screen with error. + $message = JText::_('COM_COMPONENTBUILDER_IMPORT_FAILED'); + $this->setRedirect(JRoute::_('index.php?option=com_componentbuilder&view=languages', false), $message, 'error'); + return; + } +} diff --git a/admin/helpers/compiler.php b/admin/helpers/compiler.php index c8b003306..031efecc5 100644 --- a/admin/helpers/compiler.php +++ b/admin/helpers/compiler.php @@ -136,7 +136,7 @@ class Compiler extends Infusion */ private function setLine($nr) { - if ($this->loadLineNr) + if ($this->debugLinenr) { return ' [Compiler '.$nr.']'; } @@ -152,9 +152,7 @@ class Compiler extends Infusion protected function updateFiles() { if (isset($this->newFiles['static']) && ComponentbuilderHelper::checkArray($this->newFiles['static']) && isset($this->newFiles['dynamic']) && ComponentbuilderHelper::checkArray($this->newFiles['dynamic'])) - { - // we don't update lang now since we will still posible add custom code - $langCheck = 'en-GB.com_'.$this->fileContentStatic['###component###'].'.'; + { // get the bom file $bom = file_get_contents($this->bomPath); // first we do the static files @@ -162,12 +160,6 @@ class Compiler extends Infusion { if (JFile::exists($static['path'])) { - // skip lang files and store for later - if (strpos($static['path'], $langCheck)) - { - $this->langFiles[] = $static; - continue; - } $this->fileContentStatic['###FILENAME###'] = $static['name']; $php = ''; if (ComponentbuilderHelper::checkFileType($static['name'],'php')) diff --git a/admin/helpers/compiler/a_Get.php b/admin/helpers/compiler/a_Get.php index ca090fac7..2cc42e2b9 100644 --- a/admin/helpers/compiler/a_Get.php +++ b/admin/helpers/compiler/a_Get.php @@ -160,14 +160,21 @@ class Get * * @var boolean */ - public $loadLineNr = false; + public $debugLinenr = false; + + /* + * The percentage when a language should be added + * + * @var boolean + */ + public $percentageLanguageAdd = 0; /** - * The Language prefix + * The Placholder Language prefix * * @var string */ - public $langPrefix = 'COM_'; + public $langPrefix; /** * The Language content @@ -176,6 +183,34 @@ class Get */ public $langContent = array(); + /** + * The Languages bucket + * + * @var array + */ + public $languages = array('en-GB' => array()); + + /** + * The Multi Languages bucket + * + * @var array + */ + public $multiLangString = array(); + + /** + * The new lang to add + * + * @var array + */ + protected $newLangStrings = array(); + + /** + * The existing lang to update + * + * @var array + */ + protected $existingLangStrings = array(); + /** * The Component Code Name * @@ -460,7 +495,7 @@ class Get if ($name_code = ComponentbuilderHelper::getVar('joomla_component', $this->componentID, 'id', 'name_code')) { // set lang prefix - $this->langPrefix .= ComponentbuilderHelper::safeString($name_code,'U'); + $this->langPrefix = 'COM_'.ComponentbuilderHelper::safeString($name_code,'U'); // set component code name $this->componentCodeName = ComponentbuilderHelper::safeString($name_code); // set if placeholders should be added to customcode @@ -468,7 +503,7 @@ class Get $this->addPlaceholders = ((int) $config['addPlaceholders'] == 0) ? false : (((int) $config['addPlaceholders'] == 1) ? true : $global); // set if line numbers should be added to comments $global = ((int) ComponentbuilderHelper::getVar('joomla_component', $this->componentID, 'id', 'debug_linenr') == 1) ? true:false; - $this->loadLineNr = ((int) $config['debugLinenr'] == 0) ? false : (((int) $config['debugLinenr'] == 1) ? true : $global); + $this->debugLinenr = ((int) $config['debugLinenr'] == 0) ? false : (((int) $config['debugLinenr'] == 1) ? true : $global); // set the current user $this->user = JFactory::getUser(); // Get a db connection. @@ -483,7 +518,9 @@ class Get } // get the component data $this->componentData = $this->getComponentData(); - + // set the percentage when a language can be added + $this->percentageLanguageAdd = (int) $this->params->get('percentagelanguageadd', 50); + return true; } } @@ -500,7 +537,7 @@ class Get */ private function setLine($nr) { - if ($this->loadLineNr) + if ($this->debugLinenr) { return ' [Get '.$nr.']'; } @@ -2979,6 +3016,230 @@ class Get unset($this->$remove); } + /** + * Get the other languages + * + * @param array $values The lang strings to get + * + * + * @return void + * + */ + public function getMultiLangStrings($values) + { + // Create a new query object. + $query = $this->db->getQuery(true); + $query->from($this->db->quoteName('#__componentbuilder_language_translation','a')); + if (ComponentbuilderHelper::checkArray($values)) + { + $query->select($this->db->quoteName(array('a.id','a.translation','a.entranslation','a.components'))); + $query->where($this->db->quoteName('a.entranslation') . ' IN (' . implode(',',array_map(function($a){ return $this->db->quote($a); }, $values)) . ')'); + $query->where($this->db->quoteName('a.published') . ' >= 1'); + $this->db->setQuery($query); + $this->db->execute(); + if ($this->db->getNumRows()) + { + return $this->db->loadAssocList('entranslation'); + } + } + return false; + } + + /** + * Set the Current language values to DB + * + * + * @return void + * + */ + public function setLangPlaceholders(&$strings) + { + $counterInsert = 0; + $counterUpdate = 0; + $today = JFactory::getDate()->toSql(); + foreach ($this->languages['en-GB'] as $area => $placeholders) + { + foreach ($placeholders as $placeholder => $string) + { + // to keep or remove + $remove = false; + // build the tranlations + if (ComponentbuilderHelper::checkString($string) && isset($this->multiLangString[$string])) + { + // make sure we have converted the string to array + if (isset($this->multiLangString[$string]['translation']) && ComponentbuilderHelper::checkJson($this->multiLangString[$string]['translation'])) + { + $this->multiLangString[$string]['translation'] = json_decode($this->multiLangString[$string]['translation'], true); + } + // if we have an array continue + if (isset($this->multiLangString[$string]['translation']) + && ComponentbuilderHelper::checkArray($this->multiLangString[$string]['translation']) + && isset($this->multiLangString[$string]['translation']['translation']) + && isset($this->multiLangString[$string]['translation']['language']) + && ComponentbuilderHelper::checkArray($this->multiLangString[$string]['translation']['language']) + && ComponentbuilderHelper::checkArray($this->multiLangString[$string]['translation']['translation'])) + { + // great lets build the multi languages strings + foreach ($this->multiLangString[$string]['translation']['translation'] as $at => $lang) + { + $_tag = $this->multiLangString[$string]['translation']['language'][$at]; + // build arrays + if (!isset($this->languages[$_tag])) + { + $this->languages[$_tag] = array(); + } + if (!isset($this->languages[$_tag][$area])) + { + $this->languages[$_tag][$area] = array(); + } + $this->languages[$_tag][$area][$placeholder] = $lang; + } + } + else + { + // remove this string not to be checked again + $remove = true; + } + } + // do the database managment + 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'])) + { + $components = (array) json_decode($this->multiLangString[$string]['components'], true); + if (in_array($this->componentID, $components)) + { + continue; + } + else + { + $components[] = $this->componentID; + } + } + else + { + $components = array($this->componentID); + } + // start the bucket for this lang + $this->existingLangStrings[$counterUpdate] = array(); + $this->existingLangStrings[$counterUpdate]['id'] = (int) $id; + $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)); + + $counterUpdate++; + + // load to db + $this->setExistingLangStrings(50); + // remove string if needed + if ($remove) + { + unset($this->multiLangString[$string]); + } + } + 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); // 'entranslation' + $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' + + $counterInsert++; + + // load to db + $this->setNewLangStrings(100); + } + // only set the string once + unset($strings[$key]); + } + } + } + // just to make sure all is done + $this->setExistingLangStrings(); + $this->setNewLangStrings(); + } + + /** + * store the language placeholders + * + * @param int $when To set when to update + * + * @return void + * + */ + protected function setNewLangStrings($when = 1) + { + if (count($this->newLangStrings) >= $when) + { + // Create a new query object. + $query = $this->db->getQuery(true); + $continue = false; + // Insert columns. + $columns = array('components','entranslation','published','created','created_by','version','access'); + // Prepare the insert query. + $query->insert($this->db->quoteName('#__componentbuilder_language_translation')); + $query->columns($this->db->quoteName($columns)); + foreach($this->newLangStrings as $values) + { + if (count($values) == 7) + { + $query->values(implode(',', $values)); + $continue = true; + } + else + { + // TODO line mismatch... should not happen + } + } + // clear the values array + $this->newLangStrings = array(); + if (!$continue) + { + return false; // insure we dont continue if no values were loaded + } + // Set the query using our newly populated query object and execute it. + $this->db->setQuery($query); + $this->db->execute(); + } + } + + /** + * update the language placeholders + * + * @param int $when To set when to update + * + * @return void + * + */ + protected function setExistingLangStrings($when = 1) + { + if (count($this->existingLangStrings) >= $when) + { + foreach($this->existingLangStrings as $values) + { + // Create a new query object. + $query = $this->db->getQuery(true); + // Prepare the update query. + $query->update($this->db->quoteName('#__componentbuilder_language_translation'))->set($values['fields'])->where($values['conditions']); + // Set the query using our newly populated query object and execute it. + $this->db->setQuery($query); + $this->db->execute(); + } + // clear the values array + $this->existingLangStrings = array(); + } + } + /** * get the custom code from the system * diff --git a/admin/helpers/compiler/b_Structure.php b/admin/helpers/compiler/b_Structure.php index 7e6c79fb5..1bf2e3438 100644 --- a/admin/helpers/compiler/b_Structure.php +++ b/admin/helpers/compiler/b_Structure.php @@ -359,7 +359,7 @@ class Structure extends Get */ private function setLine($nr) { - if ($this->loadLineNr) + if ($this->debugLinenr) { return ' [Structure '.$nr.']'; } diff --git a/admin/helpers/compiler/c_Fields.php b/admin/helpers/compiler/c_Fields.php index a6514a582..e4f48e6bc 100644 --- a/admin/helpers/compiler/c_Fields.php +++ b/admin/helpers/compiler/c_Fields.php @@ -351,7 +351,7 @@ class Fields extends Structure */ private function setLine($nr) { - if ($this->loadLineNr) + if ($this->debugLinenr) { return ' [Fields '.$nr.']'; } @@ -1790,7 +1790,7 @@ class Fields extends Structure // set the custom builder if (ComponentbuilderHelper::checkArray($custom) && $typeName != 'category' && $typeName != 'repeatable') { - $this->customBuilder[$listViewName][] = array('type' => $typeName, 'code' => $name, 'lang' => $listLangName, 'custom' => $custom); + $this->customBuilder[$listViewName][] = array('type' => $typeName, 'code' => $name, 'lang' => $listLangName, 'custom' => $custom, 'method' => $field['settings']->store); // set the custom fields needed in content type data if (!isset($this->customFieldLinksBuilder[$viewName])) { diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index d71b70880..4fad6b74e 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -75,7 +75,7 @@ class Interpretation extends Fields */ private function setLine($nr) { - if ($this->loadLineNr) + if ($this->debugLinenr) { return ' [Interpretation '.$nr.']'; } @@ -5092,20 +5092,14 @@ class Interpretation extends Fields if (isset($this->langContent['admin']) && ComponentbuilderHelper::checkArray($this->langContent['admin'])) { ksort($this->langContent['admin']); - foreach ($this->langContent['admin'] as $key => $value) - { - if (strlen($key) > 0) - { - if (!isset($lang)) - { - $lang = ''; - } - $lang .= $key.'="'.$value.'"'.PHP_EOL; - } - } - return $lang; + // load to global languages + $this->languages['en-GB']['admin'] = $this->langContent['admin']; + // remove tmp array + unset($this->langContent['admin']); + + return true; } - return ''; + return false; } public function setLangSite() @@ -5141,20 +5135,14 @@ class Interpretation extends Fields if (isset($this->langContent['site']) && ComponentbuilderHelper::checkArray($this->langContent['site'])) { ksort($this->langContent['site']); - foreach ($this->langContent['site'] as $key => $value) - { - if (strlen($key) > 0) - { - if (!isset($lang)) - { - $lang = ''; - } - $lang .= $key.'="'.$value.'"'.PHP_EOL; - } - } - return $lang; + // load to global languages + $this->languages['en-GB']['site'] = $this->langContent['site']; + // remove tmp array + unset($this->langContent['site']); + + return true; } - return ''; + return false; } public function setLangSiteSys() @@ -5165,20 +5153,14 @@ class Interpretation extends Fields if (isset($this->langContent['sitesys']) && ComponentbuilderHelper::checkArray($this->langContent['sitesys'])) { ksort($this->langContent['sitesys']); - foreach ($this->langContent['sitesys'] as $key => $value) - { - if (strlen($key) > 0) - { - if (!isset($lang)) - { - $lang = ''; - } - $lang .= $key.'="'.$value.'"'.PHP_EOL; - } - } - return $lang; + // load to global languages + $this->languages['en-GB']['sitesys'] = $this->langContent['sitesys']; + // remove tmp array + unset($this->langContent['sitesys']); + + return true; } - return ''; + return false; } public function setLangAdminSys() @@ -5186,20 +5168,14 @@ class Interpretation extends Fields if (isset($this->langContent['adminsys']) && ComponentbuilderHelper::checkArray($this->langContent['adminsys'])) { ksort($this->langContent['adminsys']); - foreach ($this->langContent['adminsys'] as $key => $value) - { - if (strlen($key) > 0) - { - if (!isset($lang)) - { - $lang = ''; - } - $lang .= $key.'="'.$value.'"'.PHP_EOL; - } - } - return $lang; + // load to global languages + $this->languages['en-GB']['adminsys'] = $this->langContent['adminsys']; + // remove tmp array + unset($this->langContent['adminsys']); + + return true; } - return ''; + return false; } public function setCustomAdminViewListLink($view,$viewName_list) @@ -7206,7 +7182,7 @@ class Interpretation extends Fields $query .= PHP_EOL."\t\t\tif (\$db->getNumRows())"; $query .= PHP_EOL."\t\t\t{"; $query .= PHP_EOL."\t\t\t\t\$items = \$db->loadObjectList();"; - $query .= $this->setGetItemsMethodStringFix($viewName_single,$this->fileContentStatic['###Component###'],"\t\t",true); + $query .= $this->setGetItemsMethodStringFix($viewName_single, $this->fileContentStatic['###Component###'], "\t\t", true); // add custom php to getitems method after all $query .= $this->getCustomScriptBuilder('php_getitems_after_all', $viewName_single, PHP_EOL.PHP_EOL."\t\t"); $query .= PHP_EOL."\t\t\t\treturn \$items;"; @@ -7572,7 +7548,8 @@ class Interpretation extends Fields && ComponentbuilderHelper::checkArray($this->customBuilderList[$viewName_list]) && in_array($filter['code'],$this->customBuilderList[$viewName_list]) && isset($filter['custom']['table']) - && ComponentbuilderHelper::checkString($filter['custom']['table'])) + && ComponentbuilderHelper::checkString($filter['custom']['table']) + && $filter['method'] == 0) { $query .= PHP_EOL.PHP_EOL."\t\t//".$this->setLine(__LINE__)." From the ".ComponentbuilderHelper::safeString(ComponentbuilderHelper::safeString($filter['custom']['table'],'w'))." table."; $query .= PHP_EOL."\t\t\$query->select(\$db->quoteName('".$filter['custom']['db'].".".$filter['custom']['text']."','".$filter['code']."_".$filter['custom']['text']."'));"; @@ -10643,7 +10620,7 @@ class Interpretation extends Fields return $checkin; } - public function setGetItemsMethodStringFix($view,$Component,$tab = '',$export = false) + public function setGetItemsMethodStringFix($view, $Component, $tab = '', $export = false) { // add the fix if this view has the need for it $fix = ''; @@ -10849,7 +10826,15 @@ class Interpretation extends Fields { // TODO we check if this works well. $fix .= PHP_EOL."\t".$tab."\t\t\t//".$this->setLine(__LINE__)." convert ".$item['name']; - $fix .= PHP_EOL."\t".$tab."\t\t\t\$item->".$item['name']." = ".$Component."Helper::jsonToString(\$item->".$item['name'].", ', ', '".$item['name']."');"; + if (isset($item['custom']['table'])) + { + $keyTableNAme = str_replace('#__'.$this->fileContentStatic['###component###'] .'_', '', $item['custom']['table']); + $fix .= PHP_EOL."\t".$tab."\t\t\t\$item->".$item['name']." = ".$Component."Helper::jsonToString(\$item->".$item['name'].", ', ', '".$keyTableNAme."');"; + } + else + { + $fix .= PHP_EOL."\t".$tab."\t\t\t\$item->".$item['name']." = ".$Component."Helper::jsonToString(\$item->".$item['name'].", ', ', '".$item['name']."');"; + } } else { diff --git a/admin/helpers/compiler/f_Infusion.php b/admin/helpers/compiler/f_Infusion.php index c462b82e4..ec8c49554 100644 --- a/admin/helpers/compiler/f_Infusion.php +++ b/admin/helpers/compiler/f_Infusion.php @@ -61,7 +61,7 @@ class Infusion extends Interpretation */ private function setLine($nr) { - if ($this->loadLineNr) + if ($this->debugLinenr) { return ' [Infusion '.$nr.']'; } @@ -1067,33 +1067,128 @@ class Infusion extends Interpretation * @return boolean on success * */ - public function setLangFileData() { - // First we build the strings - $lang = array(); - // ###LANG_ADMIN### - $lang['###LANG_ADMIN###'] = $this->setLangAdmin(); - // ###LANG_ADMIN_SYS### - $lang['###LANG_ADMIN_SYS###'] = $this->setLangAdminSys(); - // ###LANG_SITE### - $lang['###LANG_SITE###'] = $this->setLangSite(); - // ###LANG_SITE_SYS### - $lang['###LANG_SITE_SYS###'] = $this->setLangSiteSys(); - // now we insert the values into the files - if (ComponentbuilderHelper::checkArray($this->langFiles)) + $values = array(); + $mainLangLoader = array(); + // check the admin lang is set + if ($this->setLangAdmin()) { - foreach ($this->langFiles as $file) + $values[] = array_values($this->languages['en-GB']['admin']); + $mainLangLoader['admin'] = count($this->languages['en-GB']['admin']); + } + // check the admin system lang is set + if ($this->setLangAdminSys()) + { + $values[] = array_values($this->languages['en-GB']['adminsys']); + $mainLangLoader['adminsys'] = count($this->languages['en-GB']['adminsys']); + } + // check the site lang is set + if (!$this->removeSiteFolder && $this->setLangSite()) + { + $values[] = array_values($this->languages['en-GB']['site']); + $mainLangLoader['site'] = count($this->languages['en-GB']['site']); + } + // check the site system lang is set + if (!$this->removeSiteFolder && $this->setLangSiteSys()) + { + $values[] = array_values($this->languages['en-GB']['sitesys']); + $mainLangLoader['sitesys'] = count($this->languages['en-GB']['sitesys']); + } + $values = array_unique(ComponentbuilderHelper::mergeArrays($values)); + // 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); + // path to INI file + $getPAth = $this->templatePath . '/en-GB.com_admin.ini'; + // now we insert the values into the files + if (ComponentbuilderHelper::checkArray($this->languages)) + { + $langXML = array(); + foreach ($this->languages as $tag => $areas) { - $string = file_get_contents($file['path']); - // load the data - $answer = $this->setPlaceholders($string, $lang, 3); - // add to zip array - $this->writeFile($file['path'],$answer); - // set the line counter - $this->lineCount = $this->lineCount + substr_count($answer, PHP_EOL); + foreach ($areas as $area => $languageStrings) + { + // force load if debug lines are added + if (!$this->debugLinenr) + { + // check if we sould install this translation + $dif = bcdiv(count($languageStrings), $mainLangLoader[$area]); + $percentage = bcmul($dif, 100); + if ($percentage < $this->percentageLanguageAdd) + { + // dont add + continue; + } + } + $p = 'admin'; + $t = ''; + if (strpos($area, 'site') !== false) + { + if ($this->removeSiteFolder) + { + continue; + } + $p = 'site'; + } + if (strpos($area, 'sys') !== false) + { + $t = '.sys'; + } + // build the path to to place the lang file + $path = $this->componentPath.'/'.$p.'/language/'.$tag; + if (!JFolder::exists($path)) + { + JFolder::create($path); + // count the folder created + $this->folderCount++; + } + // build the file name + $fileName = $tag . '.com_' . $this->componentCodeName . $t . '.ini'; + // move the file to its place + JFile::copy($getPAth, $path.'/'.$fileName); + // count the file created + $this->fileCount++; + // add content to it + $lang = ''; + foreach ($languageStrings as $place => $string) + { + $lang .= $place.'="'.$string.'"'.PHP_EOL; + } + // add to language file + $this->writeFile($path.'/'.$fileName, $lang); + // set the line counter + $this->lineCount = $this->lineCount + substr_count($lang, PHP_EOL); + // build xml strings + if (!isset($langXML[$p])) + { + $langXML[$p] = array(); + } + $langXML[$p][] = 'language/'.$tag.'/'.$fileName.''; + } + } + // load the lang xml + if (ComponentbuilderHelper::checkArray($langXML)) + { + $replace = array(); + if (isset($langXML['admin']) && ComponentbuilderHelper::checkArray($langXML['admin'])) + { + $replace['###ADMIN_LANGUAGES###'] = implode(PHP_EOL."\t\t\t", $langXML['admin']); + } + if (!$this->removeSiteFolder && isset($langXML['site']) && ComponentbuilderHelper::checkArray($langXML['site'])) + { + $replace['###SITE_LANGUAGES###'] = implode(PHP_EOL."\t\t", $langXML['site']); + } + // build xml path + $xmlPath = $this->componentPath . '/'. $this->fileContentStatic['###component###']. '.xml'; + // get the content in xml + $componentXML = file_get_contents($xmlPath); + // update the xml content + $componentXML = $this->setPlaceholders($componentXML, $replace); + // store the values back to xml + $this->writeFile($xmlPath,$componentXML); } } } - } diff --git a/admin/helpers/componentbuilder.php b/admin/helpers/componentbuilder.php index 078102755..924dbf430 100644 --- a/admin/helpers/componentbuilder.php +++ b/admin/helpers/componentbuilder.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage componentbuilder.php @@ -30,7 +30,16 @@ defined('_JEXEC') or die('Restricted access'); * Componentbuilder component helper. */ abstract class ComponentbuilderHelper -{ +{ + + /** + * The Global Admin Event Method. + **/ + public static function globalEvent($document) + { + // the Session keeps track of all data related to the current session of this user + self::loadSession(); + } /* * Autoloader @@ -1065,7 +1074,64 @@ abstract class ComponentbuilderHelper } return false; } - + + /** + * set the session defaults if not set + **/ + protected static function setSessionDefaults() + { + // noting for now + return true; + } + + /** + * the Butler + **/ + public static $session = array(); + + /** + * the Butler Assistant + **/ + protected static $localSession = array(); + + /** + * start a session if not already set, and load with data + **/ + public static function loadSession() + { + if (!isset(self::$session) || !self::checkObject(self::$session)) + { + self::$session = JFactory::getSession(); + } + // set the defaults + self::setSessionDefaults(); + } + + /** + * give Session more to keep + **/ + public static function set($key, $value) + { + // set to local memory to speed up program + self::$localSession[$key] = $value; + // load to session for later use + return self::$session->set($key, self::$localSession[$key]); + } + + /** + * get info from Session + **/ + public static function get($key, $default = null) + { + // check if in local memory + if (!isset(self::$localSession[$key])) + { + // set to local memory to speed up program + self::$localSession[$key] = self::$session->get($key, $default); + } + return self::$localSession[$key]; + } + /** * Load the Component xml manifest. **/ @@ -1245,6 +1311,14 @@ abstract class ComponentbuilderHelper JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_FIELDTYPES'), 'index.php?option=com_componentbuilder&view=fieldtypes', $submenu === 'fieldtypes'); JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_FIELDTYPE_FIELDTYPE_CATEGORY'), 'index.php?option=com_categories&view=categories&extension=com_componentbuilder.fieldtypes', $submenu === 'categories.fieldtypes'); } + if ($user->authorise('language_translation.access', 'com_componentbuilder') && $user->authorise('language_translation.submenu', 'com_componentbuilder')) + { + JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_LANGUAGE_TRANSLATIONS'), 'index.php?option=com_componentbuilder&view=language_translations', $submenu === 'language_translations'); + } + if ($user->authorise('language.access', 'com_componentbuilder') && $user->authorise('language.submenu', 'com_componentbuilder')) + { + JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_LANGUAGES'), 'index.php?option=com_componentbuilder&view=languages', $submenu === 'languages'); + } if ($user->authorise('help_document.access', 'com_componentbuilder') && $user->authorise('help_document.submenu', 'com_componentbuilder')) { JHtmlSidebar::addEntry(JText::_('COM_COMPONENTBUILDER_SUBMENU_HELP_DOCUMENTS'), 'index.php?option=com_componentbuilder&view=help_documents', $submenu === 'help_documents'); diff --git a/admin/helpers/headercheck.php b/admin/helpers/headercheck.php index fc172fef1..f8517fff5 100644 --- a/admin/helpers/headercheck.php +++ b/admin/helpers/headercheck.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage headercheck.php diff --git a/admin/helpers/html/batch_.php b/admin/helpers/html/batch_.php index a2d2596d6..03b237dcd 100644 --- a/admin/helpers/html/batch_.php +++ b/admin/helpers/html/batch_.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage batch_.php diff --git a/admin/helpers/indenter.php b/admin/helpers/indenter.php index d4c894712..a164d2241 100644 --- a/admin/helpers/indenter.php +++ b/admin/helpers/indenter.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage indenter.php diff --git a/admin/helpers/js.php b/admin/helpers/js.php index 055494c81..55e8c07d6 100644 --- a/admin/helpers/js.php +++ b/admin/helpers/js.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage js.php diff --git a/admin/helpers/minify.php b/admin/helpers/minify.php index 146b4253a..0798db9ac 100644 --- a/admin/helpers/minify.php +++ b/admin/helpers/minify.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage minify.php diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index e5bdc54d2..46274e908 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -696,6 +696,7 @@ COM_COMPONENTBUILDER_ADMIN_VIEW_ZOOM_IN="Zoom In" COM_COMPONENTBUILDER_ADMIN_VIEW_ZOOM_OUT="Zoom Out" COM_COMPONENTBUILDER_ALL_IS_GOOD_PLEASE_CHECK_AGAIN_LATTER="All is good, please check again latter." COM_COMPONENTBUILDER_ALL_IS_GOOD_THERE_IN_NO_NOTICE_AT_THIS_TIME="All is good, there in no notice at this time." +COM_COMPONENTBUILDER_ALL_UNSAVED_WORK_WILL_BE_LOST_ARE_YOU_SURE_YOU_WANT_TO_CONTINUE="All unsaved work will be lost, are you sure you want to continue?" 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="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!" COM_COMPONENTBUILDER_AUTHOR="Author" COM_COMPONENTBUILDER_A_FEW_CLOSED_ISSUES_FROM_GITHUB_IS_LOADING="A few closed issues from Github is loading" @@ -844,6 +845,8 @@ COM_COMPONENTBUILDER_CONFIG_NOTE_CUSTOM_FOLDER_PATH_LABEL="Moving The Custom Fol COM_COMPONENTBUILDER_CONFIG_NOTE_GIT_FOLDER_PATH_DESCRIPTION="You must set the folder where all the components should be deployed for git. You will have to still do your git commit and other git commands yourself. Each component will create their own folder inside this git folder." COM_COMPONENTBUILDER_CONFIG_NOTE_GIT_FOLDER_PATH_LABEL="Adding git to your compiler method" COM_COMPONENTBUILDER_CONFIG_ONLY_EXTRA="Only Extra" +COM_COMPONENTBUILDER_CONFIG_PERCENTAGELANGUAGEADD_DESCRIPTION="Select percentage any language should be translated before the system should add the language to the component during compilation." +COM_COMPONENTBUILDER_CONFIG_PERCENTAGELANGUAGEADD_LABEL="Add Language if %? ready." COM_COMPONENTBUILDER_CONFIG_UIKIT_DESC="The Parameters for the uikit are set here.
Uikit is a lightweight and modular front-end framework for developing fast and powerful web interfaces. For more info visit http://getuikit.com/" COM_COMPONENTBUILDER_CONFIG_UIKIT_LABEL="Uikit Settings" @@ -1489,6 +1492,7 @@ COM_COMPONENTBUILDER_DASHBOARD_HELP_DOCUMENTS="Help Documents

" COM_COMPONENTBUILDER_DASHBOARD_HELP_DOCUMENT_ADD="Add Help Document

" COM_COMPONENTBUILDER_DASHBOARD_JOOMLA_COMPONENTS="Joomla Components

" COM_COMPONENTBUILDER_DASHBOARD_JOOMLA_COMPONENT_ADD="Add Joomla Component

" +COM_COMPONENTBUILDER_DASHBOARD_LANGUAGE_TRANSLATIONS="Language Translations

" COM_COMPONENTBUILDER_DASHBOARD_LAYOUTS="Layouts

" COM_COMPONENTBUILDER_DASHBOARD_LAYOUT_ADD="Add Layout

" COM_COMPONENTBUILDER_DASHBOARD_SITE_VIEWS="Site Views

" @@ -2266,6 +2270,8 @@ COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_FIELDS="Select the file to import da COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_FIELDTYPES="Select the file to import data to fieldtypes." COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_HELP_DOCUMENTS="Select the file to import data to help_documents." COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_JOOMLA_COMPONENTS="Select the file to import data to joomla_components." +COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_LANGUAGES="Select the file to import data to languages." +COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_LANGUAGE_TRANSLATIONS="Select the file to import data to language_translations." COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_LAYOUTS="Select the file to import data to layouts." COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_SITE_VIEWS="Select the file to import data to site_views." COM_COMPONENTBUILDER_IMPORT_SELECT_FILE_FOR_SNIPPETS="Select the file to import data to snippets." @@ -2934,6 +2940,7 @@ COM_COMPONENTBUILDER_JOOMLA_COMPONENT_THUMBS_UP="Thumbs Up" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_TITLE_DESCRIPTION="Enter contributor's title in relation to this component" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_TITLE_HINT="Contributor's Role" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_TITLE_LABEL="Job Title" +COM_COMPONENTBUILDER_JOOMLA_COMPONENT_TRANSLATION="Translation" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_TREE="Tree" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_TREE_TWO="Tree 2" COM_COMPONENTBUILDER_JOOMLA_COMPONENT_UNARCHIVE="Unarchive" @@ -3000,6 +3007,154 @@ COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS="- Keep Original Access -" COM_COMPONENTBUILDER_KEEP_ORIGINAL_CATEGORY="- Keep Original Category -" COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE="- Keep Original State -" COM_COMPONENTBUILDER_KEY="Key" +COM_COMPONENTBUILDER_LANGUAGE="Language" +COM_COMPONENTBUILDER_LANGUAGES="Languages" +COM_COMPONENTBUILDER_LANGUAGES_ACCESS="Languages Access" +COM_COMPONENTBUILDER_LANGUAGES_ACCESS_DESC="Allows the users in this group to access access languages" +COM_COMPONENTBUILDER_LANGUAGES_BATCH_OPTIONS="Batch process the selected Languages" +COM_COMPONENTBUILDER_LANGUAGES_BATCH_TIP="All changes will be applied to all selected Languages" +COM_COMPONENTBUILDER_LANGUAGES_BATCH_USE="Languages Batch Use" +COM_COMPONENTBUILDER_LANGUAGES_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch languages" +COM_COMPONENTBUILDER_LANGUAGES_CREATE="Languages Create" +COM_COMPONENTBUILDER_LANGUAGES_CREATE_DESC="Allows the users in this group to create create languages" +COM_COMPONENTBUILDER_LANGUAGES_DELETE="Languages Delete" +COM_COMPONENTBUILDER_LANGUAGES_DELETE_DESC="Allows the users in this group to delete delete languages" +COM_COMPONENTBUILDER_LANGUAGES_EDIT="Languages Edit" +COM_COMPONENTBUILDER_LANGUAGES_EDIT_DESC="Allows the users in this group to edit the language" +COM_COMPONENTBUILDER_LANGUAGES_EDIT_OWN="Languages Edit Own" +COM_COMPONENTBUILDER_LANGUAGES_EDIT_OWN_DESC="Allows the users in this group to edit edit own languages created by them" +COM_COMPONENTBUILDER_LANGUAGES_EDIT_STATE="Languages Edit State" +COM_COMPONENTBUILDER_LANGUAGES_EDIT_STATE_DESC="Allows the users in this group to update the state of the language" +COM_COMPONENTBUILDER_LANGUAGES_EDIT_VERSION="Languages Edit Version" +COM_COMPONENTBUILDER_LANGUAGES_EDIT_VERSION_DESC="Allows users in this group to edit versions of version languages" +COM_COMPONENTBUILDER_LANGUAGES_EXPORT="Languages Export" +COM_COMPONENTBUILDER_LANGUAGES_EXPORT_DESC="Allows the users in this group to export export languages" +COM_COMPONENTBUILDER_LANGUAGES_IMPORT="Languages Import" +COM_COMPONENTBUILDER_LANGUAGES_IMPORT_DESC="Allows the users in this group to import import languages" +COM_COMPONENTBUILDER_LANGUAGES_N_ITEMS_ARCHIVED="%s Languages archived." +COM_COMPONENTBUILDER_LANGUAGES_N_ITEMS_ARCHIVED_1="%s Language archived." +COM_COMPONENTBUILDER_LANGUAGES_N_ITEMS_CHECKED_IN_0="No Language successfully checked in." +COM_COMPONENTBUILDER_LANGUAGES_N_ITEMS_CHECKED_IN_1="%d Language successfully checked in." +COM_COMPONENTBUILDER_LANGUAGES_N_ITEMS_CHECKED_IN_MORE="%d Languages successfully checked in." +COM_COMPONENTBUILDER_LANGUAGES_N_ITEMS_DELETED="%s Languages deleted." +COM_COMPONENTBUILDER_LANGUAGES_N_ITEMS_DELETED_1="%s Language deleted." +COM_COMPONENTBUILDER_LANGUAGES_N_ITEMS_FEATURED="%s Languages featured." +COM_COMPONENTBUILDER_LANGUAGES_N_ITEMS_FEATURED_1="%s Language featured." +COM_COMPONENTBUILDER_LANGUAGES_N_ITEMS_PUBLISHED="%s Languages published." +COM_COMPONENTBUILDER_LANGUAGES_N_ITEMS_PUBLISHED_1="%s Language published." +COM_COMPONENTBUILDER_LANGUAGES_N_ITEMS_TRASHED="%s Languages trashed." +COM_COMPONENTBUILDER_LANGUAGES_N_ITEMS_TRASHED_1="%s Language trashed." +COM_COMPONENTBUILDER_LANGUAGES_N_ITEMS_UNFEATURED="%s Languages unfeatured." +COM_COMPONENTBUILDER_LANGUAGES_N_ITEMS_UNFEATURED_1="%s Language unfeatured." +COM_COMPONENTBUILDER_LANGUAGES_N_ITEMS_UNPUBLISHED="%s Languages unpublished." +COM_COMPONENTBUILDER_LANGUAGES_N_ITEMS_UNPUBLISHED_1="%s Language unpublished." +COM_COMPONENTBUILDER_LANGUAGES_SUBMENU="Languages Submenu" +COM_COMPONENTBUILDER_LANGUAGES_SUBMENU_DESC="Allows the users in this group to update the submenu of the language" +COM_COMPONENTBUILDER_LANGUAGE_CREATED_BY_DESC="The user that created this Language." +COM_COMPONENTBUILDER_LANGUAGE_CREATED_BY_LABEL="Created By" +COM_COMPONENTBUILDER_LANGUAGE_CREATED_DATE_DESC="The date this Language was created." +COM_COMPONENTBUILDER_LANGUAGE_CREATED_DATE_LABEL="Created Date" +COM_COMPONENTBUILDER_LANGUAGE_DETAILS="Details" +COM_COMPONENTBUILDER_LANGUAGE_EDIT="Editing the Language" +COM_COMPONENTBUILDER_LANGUAGE_ERROR_UNIQUE_ALIAS="Another Language has the same alias." +COM_COMPONENTBUILDER_LANGUAGE_ID="Id" +COM_COMPONENTBUILDER_LANGUAGE_LANGTAG="Langtag" +COM_COMPONENTBUILDER_LANGUAGE_LANGTAG_DESCRIPTION="Enter the language tag – example: en-GB for English (UK). This should be the exact prefix used for the language installed or to be installed." +COM_COMPONENTBUILDER_LANGUAGE_LANGTAG_HINT="en-GB" +COM_COMPONENTBUILDER_LANGUAGE_LANGTAG_LABEL="Language Tag" +COM_COMPONENTBUILDER_LANGUAGE_MODIFIED_BY_DESC="The last user that modified this Language." +COM_COMPONENTBUILDER_LANGUAGE_MODIFIED_BY_LABEL="Modified By" +COM_COMPONENTBUILDER_LANGUAGE_MODIFIED_DATE_DESC="The date this Language was modified." +COM_COMPONENTBUILDER_LANGUAGE_MODIFIED_DATE_LABEL="Modified Date" +COM_COMPONENTBUILDER_LANGUAGE_NAME="Name" +COM_COMPONENTBUILDER_LANGUAGE_NAME_DESCRIPTION="Enter Name Here" +COM_COMPONENTBUILDER_LANGUAGE_NAME_HINT="Name Here" +COM_COMPONENTBUILDER_LANGUAGE_NAME_LABEL="Name" +COM_COMPONENTBUILDER_LANGUAGE_NEW="A New Language" +COM_COMPONENTBUILDER_LANGUAGE_ORDERING_LABEL="Ordering" +COM_COMPONENTBUILDER_LANGUAGE_PERMISSION="Permissions" +COM_COMPONENTBUILDER_LANGUAGE_PUBLISHING="Publishing" +COM_COMPONENTBUILDER_LANGUAGE_SAVE_WARNING="Alias already existed so a number was added at the end. You can re-edit the Language to customise the alias." +COM_COMPONENTBUILDER_LANGUAGE_STATUS="Status" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION="Language Translation" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS="Language Translations" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_ACCESS="Language Translations Access" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_ACCESS_DESC="Allows the users in this group to access access language translations" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_BATCH_OPTIONS="Batch process the selected Language Translations" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_BATCH_TIP="All changes will be applied to all selected Language Translations" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_BATCH_USE="Language Translations Batch Use" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_BATCH_USE_DESC="Allows users in this group to use batch copy/update method of batch language translations" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_CREATE="Language Translations Create" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_CREATE_DESC="Allows the users in this group to create create language translations" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_DASHBOARD_LIST="Language Translations Dashboard List" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_DASHBOARD_LIST_DESC="Allows the users in this group to update the dashboard list of the language translation" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_DELETE="Language Translations Delete" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_DELETE_DESC="Allows the users in this group to delete delete language translations" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT="Language Translations Edit" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT_DESC="Allows the users in this group to edit the language translation" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT_OWN="Language Translations Edit Own" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT_OWN_DESC="Allows the users in this group to edit edit own language translations created by them" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT_STATE="Language Translations Edit State" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT_STATE_DESC="Allows the users in this group to update the state of the language translation" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT_VERSION="Language Translations Edit Version" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EDIT_VERSION_DESC="Allows users in this group to edit versions of version language translations" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EXPORT="Language Translations Export" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_EXPORT_DESC="Allows the users in this group to export export language translations" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_IMPORT="Language Translations Import" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_IMPORT_DESC="Allows the users in this group to import import language translations" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_N_ITEMS_ARCHIVED="%s Language Translations archived." +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_N_ITEMS_ARCHIVED_1="%s Language Translation archived." +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_N_ITEMS_CHECKED_IN_0="No Language Translation successfully checked in." +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_N_ITEMS_CHECKED_IN_1="%d Language Translation successfully checked in." +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_N_ITEMS_CHECKED_IN_MORE="%d Language Translations successfully checked in." +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_N_ITEMS_DELETED="%s Language Translations deleted." +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_N_ITEMS_DELETED_1="%s Language Translation deleted." +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_N_ITEMS_FEATURED="%s Language Translations featured." +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_N_ITEMS_FEATURED_1="%s Language Translation featured." +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_N_ITEMS_PUBLISHED="%s Language Translations published." +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_N_ITEMS_PUBLISHED_1="%s Language Translation published." +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_N_ITEMS_TRASHED="%s Language Translations trashed." +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_N_ITEMS_TRASHED_1="%s Language Translation trashed." +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_N_ITEMS_UNFEATURED="%s Language Translations unfeatured." +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_N_ITEMS_UNFEATURED_1="%s Language Translation unfeatured." +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_N_ITEMS_UNPUBLISHED="%s Language Translations unpublished." +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_N_ITEMS_UNPUBLISHED_1="%s Language Translation unpublished." +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_SUBMENU="Language Translations Submenu" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_SUBMENU_DESC="Allows the users in this group to update the submenu of the language translation" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_COMPONENTS="Components" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_COMPONENTS_LABEL="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." +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_CREATED_DATE_LABEL="Created Date" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_DETAILS="Details" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_EDIT="Editing the Language Translation" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_ENTRANSLATION="Entranslation" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_ENTRANSLATION_HINT="Automatically generated!" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_ENTRANSLATION_LABEL="English String" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_ERROR_UNIQUE_ALIAS="Another Language Translation has the same alias." +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_ID="Id" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_LANGUAGE="Language" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_LANGUAGE_LABEL="Language" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_MODIFIED_BY_DESC="The last user that modified this Language Translation." +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_NEW="A New Language Translation" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_ORDERING_LABEL="Ordering" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_PERMISSION="Permissions" +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_STATUS="Status" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_TRANSLATION="Translation" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_TRANSLATION_DESCRIPTION="The translation strings." +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_TRANSLATION_HINT="Translated String Here" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_TRANSLATION_LABEL="Translated String" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_TRANSLATION_SELECT="add/edit" +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_VERSION_DESC="A count of the number of times this Language Translation has been revised." +COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_VERSION_LABEL="Revision" +COM_COMPONENTBUILDER_LANGUAGE_VERSION_DESC="A count of the number of times this Language has been revised." +COM_COMPONENTBUILDER_LANGUAGE_VERSION_LABEL="Revision" COM_COMPONENTBUILDER_LAYOUT="Layout" COM_COMPONENTBUILDER_LAYOUTS="Layouts" COM_COMPONENTBUILDER_LAYOUTS_ACCESS="Layouts Access" @@ -3108,6 +3263,7 @@ COM_COMPONENTBUILDER_NEW="New" COM_COMPONENTBUILDER_NEW_ISSUE="New Issue" COM_COMPONENTBUILDER_NEW_NOTICE="New Notice" COM_COMPONENTBUILDER_NO="No" +COM_COMPONENTBUILDER_NOTRANSLATION="no-translation" COM_COMPONENTBUILDER_NO_ACCESS_GRANTED="No Access Granted!" COM_COMPONENTBUILDER_NO_COMPONENTS_WERE_SELECTED_PLEASE_MAKE_A_SELECTION_AND_TRY_AGAIN="No components were selected, please make a selection and try again!" COM_COMPONENTBUILDER_OPENED_BY="opened by" @@ -3676,6 +3832,8 @@ COM_COMPONENTBUILDER_SUBMENU_FIELDS="Fields" COM_COMPONENTBUILDER_SUBMENU_FIELDTYPES="Fieldtypes" COM_COMPONENTBUILDER_SUBMENU_HELP_DOCUMENTS="Help Documents" COM_COMPONENTBUILDER_SUBMENU_JOOMLA_COMPONENTS="Joomla Components" +COM_COMPONENTBUILDER_SUBMENU_LANGUAGES="Languages" +COM_COMPONENTBUILDER_SUBMENU_LANGUAGE_TRANSLATIONS="Language Translations" COM_COMPONENTBUILDER_SUBMENU_LAYOUTS="Layouts" COM_COMPONENTBUILDER_SUBMENU_SITE_VIEWS="Site Views" COM_COMPONENTBUILDER_SUBMENU_SNIPPETS="Snippets" @@ -3793,6 +3951,7 @@ COM_COMPONENTBUILDER_THE_README_IS_LOADING="The readme is loading" COM_COMPONENTBUILDER_THE_WIKI_IS_LOADING="The wiki is loading" COM_COMPONENTBUILDER_THIS_PACKAGE_HAS_NO_KEY="This package has no key." COM_COMPONENTBUILDER_TO_CHANGE_THE_PACKAGE_OWNER_DEFAULTS_OPEN_THE_BJCB_GLOBAL_OPTIONSB_GO_TO_THE_BCOMPANYB_TAB_AND_ADD_THE_CORRECT_COMPANY_DETAILS_THERE="To change the package owner defaults. Open the JCB Global Options, go to the Company tab and add the correct company details there." +COM_COMPONENTBUILDER_TRANSLATION="Translation" 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/language/en-GB/en-GB.com_componentbuilder.sys.ini b/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini index d24b1ef28..16073e5f2 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.sys.ini @@ -10,6 +10,7 @@ COM_COMPONENTBUILDER_MENU_FIELDS="Fields" COM_COMPONENTBUILDER_MENU_FIELDTYPES="Fieldtypes" COM_COMPONENTBUILDER_MENU_HELP_DOCUMENTS="Help Documents" COM_COMPONENTBUILDER_MENU_JOOMLA_COMPONENTS="Joomla Components" +COM_COMPONENTBUILDER_MENU_LANGUAGE_TRANSLATIONS="Language Translations" COM_COMPONENTBUILDER_MENU_LAYOUTS="Layouts" COM_COMPONENTBUILDER_MENU_SITE_VIEWS="Site Views" COM_COMPONENTBUILDER_MENU_SNIPPETS="Snippets" diff --git a/admin/layouts/admin_view/css_fullwidth.php b/admin/layouts/admin_view/css_fullwidth.php index 11d5b5391..b4ebdc91b 100644 --- a/admin/layouts/admin_view/css_fullwidth.php +++ b/admin/layouts/admin_view/css_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage css_fullwidth.php diff --git a/admin/layouts/admin_view/custom_buttons_fullwidth.php b/admin/layouts/admin_view/custom_buttons_fullwidth.php index ff43fc867..f253beeaa 100644 --- a/admin/layouts/admin_view/custom_buttons_fullwidth.php +++ b/admin/layouts/admin_view/custom_buttons_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage custom_buttons_fullwidth.php diff --git a/admin/layouts/admin_view/custom_buttons_left.php b/admin/layouts/admin_view/custom_buttons_left.php index dc5d0d26f..9de95d142 100644 --- a/admin/layouts/admin_view/custom_buttons_left.php +++ b/admin/layouts/admin_view/custom_buttons_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage custom_buttons_left.php diff --git a/admin/layouts/admin_view/custom_import_fullwidth.php b/admin/layouts/admin_view/custom_import_fullwidth.php index eae11be2d..e9b3ff196 100644 --- a/admin/layouts/admin_view/custom_import_fullwidth.php +++ b/admin/layouts/admin_view/custom_import_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage custom_import_fullwidth.php diff --git a/admin/layouts/admin_view/fields_fullwidth.php b/admin/layouts/admin_view/fields_fullwidth.php index f44d4a62c..8de3171cc 100644 --- a/admin/layouts/admin_view/fields_fullwidth.php +++ b/admin/layouts/admin_view/fields_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage fields_fullwidth.php @@ -28,7 +28,7 @@ defined('_JEXEC') or die('Restricted access'); // set the defaults -$items = $displayData->vxwfields; +$items = $displayData->vxxfields; $user = JFactory::getUser(); $id = $displayData->item->id; $edit = "index.php?option=com_componentbuilder&view=fields&task=field.edit"; diff --git a/admin/layouts/admin_view/javascript_fullwidth.php b/admin/layouts/admin_view/javascript_fullwidth.php index a96e80fb6..91d07f9bb 100644 --- a/admin/layouts/admin_view/javascript_fullwidth.php +++ b/admin/layouts/admin_view/javascript_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage javascript_fullwidth.php diff --git a/admin/layouts/admin_view/linked_components_fullwidth.php b/admin/layouts/admin_view/linked_components_fullwidth.php index b4f33fd35..a751ee17f 100644 --- a/admin/layouts/admin_view/linked_components_fullwidth.php +++ b/admin/layouts/admin_view/linked_components_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage linked_components_fullwidth.php @@ -28,7 +28,7 @@ defined('_JEXEC') or die('Restricted access'); // set the defaults -$items = $displayData->vxxlinked_components; +$items = $displayData->vxylinked_components; $user = JFactory::getUser(); $id = $displayData->item->id; $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=joomla_component.edit"; diff --git a/admin/layouts/admin_view/mysql_fullwidth.php b/admin/layouts/admin_view/mysql_fullwidth.php index 7b130cd8e..4cfc2861c 100644 --- a/admin/layouts/admin_view/mysql_fullwidth.php +++ b/admin/layouts/admin_view/mysql_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage mysql_fullwidth.php diff --git a/admin/layouts/admin_view/mysql_left.php b/admin/layouts/admin_view/mysql_left.php index d83fe5089..bc380e97b 100644 --- a/admin/layouts/admin_view/mysql_left.php +++ b/admin/layouts/admin_view/mysql_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage mysql_left.php diff --git a/admin/layouts/admin_view/php_fullwidth.php b/admin/layouts/admin_view/php_fullwidth.php index d0670dc13..c1ff6cb9e 100644 --- a/admin/layouts/admin_view/php_fullwidth.php +++ b/admin/layouts/admin_view/php_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage php_fullwidth.php diff --git a/admin/layouts/admin_view/publishing.php b/admin/layouts/admin_view/publishing.php index ac7bd7ed5..1fe0300c0 100644 --- a/admin/layouts/admin_view/publishing.php +++ b/admin/layouts/admin_view/publishing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage publishing.php diff --git a/admin/layouts/admin_view/publlshing.php b/admin/layouts/admin_view/publlshing.php index 645c15dea..bc1f6ea4c 100644 --- a/admin/layouts/admin_view/publlshing.php +++ b/admin/layouts/admin_view/publlshing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage publlshing.php diff --git a/admin/layouts/admin_view/settings_above.php b/admin/layouts/admin_view/settings_above.php index 08b04d555..828a1b076 100644 --- a/admin/layouts/admin_view/settings_above.php +++ b/admin/layouts/admin_view/settings_above.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage settings_above.php diff --git a/admin/layouts/admin_view/settings_left.php b/admin/layouts/admin_view/settings_left.php index 34c517325..1d71b17c7 100644 --- a/admin/layouts/admin_view/settings_left.php +++ b/admin/layouts/admin_view/settings_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage settings_left.php diff --git a/admin/layouts/admin_view/settings_right.php b/admin/layouts/admin_view/settings_right.php index c594449b2..77a1177ee 100644 --- a/admin/layouts/admin_view/settings_right.php +++ b/admin/layouts/admin_view/settings_right.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage settings_right.php diff --git a/admin/layouts/admin_view/settings_under.php b/admin/layouts/admin_view/settings_under.php index 7e4dab1cc..fe3e75b4e 100644 --- a/admin/layouts/admin_view/settings_under.php +++ b/admin/layouts/admin_view/settings_under.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage settings_under.php diff --git a/admin/layouts/batchselection.php b/admin/layouts/batchselection.php index 03a2ec9b2..eff3fdddb 100644 --- a/admin/layouts/batchselection.php +++ b/admin/layouts/batchselection.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage batchselection.php diff --git a/admin/layouts/custom_admin_view/custom_buttons_fullwidth.php b/admin/layouts/custom_admin_view/custom_buttons_fullwidth.php index f7f756db8..5d75a628d 100644 --- a/admin/layouts/custom_admin_view/custom_buttons_fullwidth.php +++ b/admin/layouts/custom_admin_view/custom_buttons_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage custom_buttons_fullwidth.php diff --git a/admin/layouts/custom_admin_view/custom_buttons_left.php b/admin/layouts/custom_admin_view/custom_buttons_left.php index dc5d0d26f..9de95d142 100644 --- a/admin/layouts/custom_admin_view/custom_buttons_left.php +++ b/admin/layouts/custom_admin_view/custom_buttons_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage custom_buttons_left.php diff --git a/admin/layouts/custom_admin_view/custom_script_fullwidth.php b/admin/layouts/custom_admin_view/custom_script_fullwidth.php index e3f999510..cebee10c4 100644 --- a/admin/layouts/custom_admin_view/custom_script_fullwidth.php +++ b/admin/layouts/custom_admin_view/custom_script_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage custom_script_fullwidth.php diff --git a/admin/layouts/custom_admin_view/details_above.php b/admin/layouts/custom_admin_view/details_above.php index 264848d0a..3f064604e 100644 --- a/admin/layouts/custom_admin_view/details_above.php +++ b/admin/layouts/custom_admin_view/details_above.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_above.php diff --git a/admin/layouts/custom_admin_view/details_fullwidth.php b/admin/layouts/custom_admin_view/details_fullwidth.php index c91590b8f..c24c2ba43 100644 --- a/admin/layouts/custom_admin_view/details_fullwidth.php +++ b/admin/layouts/custom_admin_view/details_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_fullwidth.php diff --git a/admin/layouts/custom_admin_view/details_left.php b/admin/layouts/custom_admin_view/details_left.php index a4f5f96a4..1f5caf41d 100644 --- a/admin/layouts/custom_admin_view/details_left.php +++ b/admin/layouts/custom_admin_view/details_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_left.php diff --git a/admin/layouts/custom_admin_view/details_right.php b/admin/layouts/custom_admin_view/details_right.php index 0fa65a8dc..4de395545 100644 --- a/admin/layouts/custom_admin_view/details_right.php +++ b/admin/layouts/custom_admin_view/details_right.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_right.php diff --git a/admin/layouts/custom_admin_view/details_rightside.php b/admin/layouts/custom_admin_view/details_rightside.php index b30841fc7..8c85ecf0f 100644 --- a/admin/layouts/custom_admin_view/details_rightside.php +++ b/admin/layouts/custom_admin_view/details_rightside.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_rightside.php diff --git a/admin/layouts/custom_admin_view/details_under.php b/admin/layouts/custom_admin_view/details_under.php index 077cf1fbd..96e3a455f 100644 --- a/admin/layouts/custom_admin_view/details_under.php +++ b/admin/layouts/custom_admin_view/details_under.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_under.php diff --git a/admin/layouts/custom_admin_view/linked_components_fullwidth.php b/admin/layouts/custom_admin_view/linked_components_fullwidth.php index 212c58bb6..0b20b8ee1 100644 --- a/admin/layouts/custom_admin_view/linked_components_fullwidth.php +++ b/admin/layouts/custom_admin_view/linked_components_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage linked_components_fullwidth.php @@ -28,7 +28,7 @@ defined('_JEXEC') or die('Restricted access'); // set the defaults -$items = $displayData->vyhlinked_components; +$items = $displayData->vyilinked_components; $user = JFactory::getUser(); $id = $displayData->item->id; $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=joomla_component.edit"; diff --git a/admin/layouts/custom_admin_view/publishing.php b/admin/layouts/custom_admin_view/publishing.php index ac7bd7ed5..1fe0300c0 100644 --- a/admin/layouts/custom_admin_view/publishing.php +++ b/admin/layouts/custom_admin_view/publishing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage publishing.php diff --git a/admin/layouts/custom_admin_view/publlshing.php b/admin/layouts/custom_admin_view/publlshing.php index 645c15dea..bc1f6ea4c 100644 --- a/admin/layouts/custom_admin_view/publlshing.php +++ b/admin/layouts/custom_admin_view/publlshing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage publlshing.php diff --git a/admin/layouts/custom_code/details_above.php b/admin/layouts/custom_code/details_above.php index 9a164298b..5b62b76e5 100644 --- a/admin/layouts/custom_code/details_above.php +++ b/admin/layouts/custom_code/details_above.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_above.php diff --git a/admin/layouts/custom_code/details_fullwidth.php b/admin/layouts/custom_code/details_fullwidth.php index 3524ff8b0..bb5c2da75 100644 --- a/admin/layouts/custom_code/details_fullwidth.php +++ b/admin/layouts/custom_code/details_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_fullwidth.php diff --git a/admin/layouts/custom_code/details_left.php b/admin/layouts/custom_code/details_left.php index c6597c1d4..77129a2f6 100644 --- a/admin/layouts/custom_code/details_left.php +++ b/admin/layouts/custom_code/details_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_left.php diff --git a/admin/layouts/custom_code/details_right.php b/admin/layouts/custom_code/details_right.php index 96bb80458..7d9ef9c64 100644 --- a/admin/layouts/custom_code/details_right.php +++ b/admin/layouts/custom_code/details_right.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_right.php diff --git a/admin/layouts/custom_code/details_under.php b/admin/layouts/custom_code/details_under.php index 077cf1fbd..96e3a455f 100644 --- a/admin/layouts/custom_code/details_under.php +++ b/admin/layouts/custom_code/details_under.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_under.php diff --git a/admin/layouts/custom_code/publishing.php b/admin/layouts/custom_code/publishing.php index ac7bd7ed5..1fe0300c0 100644 --- a/admin/layouts/custom_code/publishing.php +++ b/admin/layouts/custom_code/publishing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage publishing.php diff --git a/admin/layouts/custom_code/publlshing.php b/admin/layouts/custom_code/publlshing.php index 645c15dea..bc1f6ea4c 100644 --- a/admin/layouts/custom_code/publlshing.php +++ b/admin/layouts/custom_code/publlshing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage publlshing.php diff --git a/admin/layouts/dynamic_get/abacus_fullwidth.php b/admin/layouts/dynamic_get/abacus_fullwidth.php index 3baf78849..9f0492d7e 100644 --- a/admin/layouts/dynamic_get/abacus_fullwidth.php +++ b/admin/layouts/dynamic_get/abacus_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage abacus_fullwidth.php diff --git a/admin/layouts/dynamic_get/abacus_left.php b/admin/layouts/dynamic_get/abacus_left.php index ca6c66f7b..169f0c05d 100644 --- a/admin/layouts/dynamic_get/abacus_left.php +++ b/admin/layouts/dynamic_get/abacus_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage abacus_left.php diff --git a/admin/layouts/dynamic_get/custom_script_fullwidth.php b/admin/layouts/dynamic_get/custom_script_fullwidth.php index a0c6e2281..625aac840 100644 --- a/admin/layouts/dynamic_get/custom_script_fullwidth.php +++ b/admin/layouts/dynamic_get/custom_script_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage custom_script_fullwidth.php diff --git a/admin/layouts/dynamic_get/gettable_above.php b/admin/layouts/dynamic_get/gettable_above.php index 6505e9b25..4d9449915 100644 --- a/admin/layouts/dynamic_get/gettable_above.php +++ b/admin/layouts/dynamic_get/gettable_above.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage gettable_above.php diff --git a/admin/layouts/dynamic_get/gettable_fullwidth.php b/admin/layouts/dynamic_get/gettable_fullwidth.php index dcb2420b8..21eb17078 100644 --- a/admin/layouts/dynamic_get/gettable_fullwidth.php +++ b/admin/layouts/dynamic_get/gettable_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage gettable_fullwidth.php diff --git a/admin/layouts/dynamic_get/gettable_left.php b/admin/layouts/dynamic_get/gettable_left.php index ebf11f644..9eba07e3e 100644 --- a/admin/layouts/dynamic_get/gettable_left.php +++ b/admin/layouts/dynamic_get/gettable_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage gettable_left.php diff --git a/admin/layouts/dynamic_get/gettable_right.php b/admin/layouts/dynamic_get/gettable_right.php index 527062936..27abac9f6 100644 --- a/admin/layouts/dynamic_get/gettable_right.php +++ b/admin/layouts/dynamic_get/gettable_right.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage gettable_right.php diff --git a/admin/layouts/dynamic_get/gettable_under.php b/admin/layouts/dynamic_get/gettable_under.php index c8de0faff..451da57a0 100644 --- a/admin/layouts/dynamic_get/gettable_under.php +++ b/admin/layouts/dynamic_get/gettable_under.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage gettable_under.php diff --git a/admin/layouts/dynamic_get/publishing.php b/admin/layouts/dynamic_get/publishing.php index ac7bd7ed5..1fe0300c0 100644 --- a/admin/layouts/dynamic_get/publishing.php +++ b/admin/layouts/dynamic_get/publishing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage publishing.php diff --git a/admin/layouts/dynamic_get/publlshing.php b/admin/layouts/dynamic_get/publlshing.php index 645c15dea..bc1f6ea4c 100644 --- a/admin/layouts/dynamic_get/publlshing.php +++ b/admin/layouts/dynamic_get/publlshing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage publlshing.php diff --git a/admin/layouts/field/details_fullwidth.php b/admin/layouts/field/details_fullwidth.php index f55b9c050..6967ef60c 100644 --- a/admin/layouts/field/details_fullwidth.php +++ b/admin/layouts/field/details_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_fullwidth.php diff --git a/admin/layouts/field/details_left.php b/admin/layouts/field/details_left.php index 38f7a80e2..7b7a1ec59 100644 --- a/admin/layouts/field/details_left.php +++ b/admin/layouts/field/details_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_left.php diff --git a/admin/layouts/field/details_right.php b/admin/layouts/field/details_right.php index 6a16301c4..ea93a4174 100644 --- a/admin/layouts/field/details_right.php +++ b/admin/layouts/field/details_right.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_right.php diff --git a/admin/layouts/field/details_under.php b/admin/layouts/field/details_under.php index 077cf1fbd..96e3a455f 100644 --- a/admin/layouts/field/details_under.php +++ b/admin/layouts/field/details_under.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_under.php diff --git a/admin/layouts/field/linked_admin_views_fullwidth.php b/admin/layouts/field/linked_admin_views_fullwidth.php index 3903e6af5..955df3af1 100644 --- a/admin/layouts/field/linked_admin_views_fullwidth.php +++ b/admin/layouts/field/linked_admin_views_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage linked_admin_views_fullwidth.php @@ -28,7 +28,7 @@ defined('_JEXEC') or die('Restricted access'); // set the defaults -$items = $displayData->vzzlinked_admin_views; +$items = $displayData->waalinked_admin_views; $user = JFactory::getUser(); $id = $displayData->item->id; $edit = "index.php?option=com_componentbuilder&view=admin_views&task=admin_view.edit"; diff --git a/admin/layouts/field/publishing.php b/admin/layouts/field/publishing.php index ac7bd7ed5..1fe0300c0 100644 --- a/admin/layouts/field/publishing.php +++ b/admin/layouts/field/publishing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage publishing.php diff --git a/admin/layouts/field/publlshing.php b/admin/layouts/field/publlshing.php index 645c15dea..bc1f6ea4c 100644 --- a/admin/layouts/field/publlshing.php +++ b/admin/layouts/field/publlshing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage publlshing.php diff --git a/admin/layouts/field/scripts_left.php b/admin/layouts/field/scripts_left.php index 2dd987515..4ea0e84f3 100644 --- a/admin/layouts/field/scripts_left.php +++ b/admin/layouts/field/scripts_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage scripts_left.php diff --git a/admin/layouts/field/scripts_right.php b/admin/layouts/field/scripts_right.php index ea30e9451..41a734d04 100644 --- a/admin/layouts/field/scripts_right.php +++ b/admin/layouts/field/scripts_right.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage scripts_right.php diff --git a/admin/layouts/fieldtype/details_left.php b/admin/layouts/fieldtype/details_left.php index 8c1bcd1b7..74eb83aaa 100644 --- a/admin/layouts/fieldtype/details_left.php +++ b/admin/layouts/fieldtype/details_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_left.php diff --git a/admin/layouts/fieldtype/details_right.php b/admin/layouts/fieldtype/details_right.php index f1007ccf5..4dd4c52d2 100644 --- a/admin/layouts/fieldtype/details_right.php +++ b/admin/layouts/fieldtype/details_right.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_right.php diff --git a/admin/layouts/fieldtype/fields_fullwidth.php b/admin/layouts/fieldtype/fields_fullwidth.php index eb5751c68..7c8045988 100644 --- a/admin/layouts/fieldtype/fields_fullwidth.php +++ b/admin/layouts/fieldtype/fields_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage fields_fullwidth.php @@ -28,7 +28,7 @@ defined('_JEXEC') or die('Restricted access'); // set the defaults -$items = $displayData->waafields; +$items = $displayData->wabfields; $user = JFactory::getUser(); $id = $displayData->item->id; $edit = "index.php?option=com_componentbuilder&view=fields&task=field.edit"; diff --git a/admin/layouts/fieldtype/publishing.php b/admin/layouts/fieldtype/publishing.php index ac7bd7ed5..1fe0300c0 100644 --- a/admin/layouts/fieldtype/publishing.php +++ b/admin/layouts/fieldtype/publishing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage publishing.php diff --git a/admin/layouts/fieldtype/publlshing.php b/admin/layouts/fieldtype/publlshing.php index 645c15dea..bc1f6ea4c 100644 --- a/admin/layouts/fieldtype/publlshing.php +++ b/admin/layouts/fieldtype/publlshing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage publlshing.php diff --git a/admin/layouts/help_document/details_above.php b/admin/layouts/help_document/details_above.php index 3bcda896b..5bbfb8ac2 100644 --- a/admin/layouts/help_document/details_above.php +++ b/admin/layouts/help_document/details_above.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_above.php diff --git a/admin/layouts/help_document/details_fullwidth.php b/admin/layouts/help_document/details_fullwidth.php index cda72317c..bc9c67e5e 100644 --- a/admin/layouts/help_document/details_fullwidth.php +++ b/admin/layouts/help_document/details_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_fullwidth.php diff --git a/admin/layouts/help_document/details_left.php b/admin/layouts/help_document/details_left.php index ffb3770b3..e1441b6c6 100644 --- a/admin/layouts/help_document/details_left.php +++ b/admin/layouts/help_document/details_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_left.php diff --git a/admin/layouts/help_document/details_right.php b/admin/layouts/help_document/details_right.php index 82cd9bd74..884f572fe 100644 --- a/admin/layouts/help_document/details_right.php +++ b/admin/layouts/help_document/details_right.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_right.php diff --git a/admin/layouts/help_document/details_under.php b/admin/layouts/help_document/details_under.php index 077cf1fbd..96e3a455f 100644 --- a/admin/layouts/help_document/details_under.php +++ b/admin/layouts/help_document/details_under.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_under.php diff --git a/admin/layouts/help_document/publishing.php b/admin/layouts/help_document/publishing.php index ac7bd7ed5..1fe0300c0 100644 --- a/admin/layouts/help_document/publishing.php +++ b/admin/layouts/help_document/publishing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage publishing.php diff --git a/admin/layouts/help_document/publlshing.php b/admin/layouts/help_document/publlshing.php index c12466cef..363f91221 100644 --- a/admin/layouts/help_document/publlshing.php +++ b/admin/layouts/help_document/publlshing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage publlshing.php diff --git a/admin/layouts/joomla_component/admin_views_fullwidth.php b/admin/layouts/joomla_component/admin_views_fullwidth.php index f9b760903..5aa7e1a34 100644 --- a/admin/layouts/joomla_component/admin_views_fullwidth.php +++ b/admin/layouts/joomla_component/admin_views_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage admin_views_fullwidth.php diff --git a/admin/layouts/joomla_component/custom_admin_views_fullwidth.php b/admin/layouts/joomla_component/custom_admin_views_fullwidth.php index ced6a27dc..07b98c3df 100644 --- a/admin/layouts/joomla_component/custom_admin_views_fullwidth.php +++ b/admin/layouts/joomla_component/custom_admin_views_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage custom_admin_views_fullwidth.php diff --git a/admin/layouts/joomla_component/details_above.php b/admin/layouts/joomla_component/details_above.php index 264848d0a..3f064604e 100644 --- a/admin/layouts/joomla_component/details_above.php +++ b/admin/layouts/joomla_component/details_above.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_above.php diff --git a/admin/layouts/joomla_component/details_left.php b/admin/layouts/joomla_component/details_left.php index 71b659b05..69372c951 100644 --- a/admin/layouts/joomla_component/details_left.php +++ b/admin/layouts/joomla_component/details_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_left.php diff --git a/admin/layouts/joomla_component/details_right.php b/admin/layouts/joomla_component/details_right.php index 3397127c8..ddf94a7eb 100644 --- a/admin/layouts/joomla_component/details_right.php +++ b/admin/layouts/joomla_component/details_right.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_right.php diff --git a/admin/layouts/joomla_component/details_under.php b/admin/layouts/joomla_component/details_under.php index 077cf1fbd..96e3a455f 100644 --- a/admin/layouts/joomla_component/details_under.php +++ b/admin/layouts/joomla_component/details_under.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_under.php diff --git a/admin/layouts/joomla_component/dynamic_build_beta_fullwidth.php b/admin/layouts/joomla_component/dynamic_build_beta_fullwidth.php index 9414da387..40effb193 100644 --- a/admin/layouts/joomla_component/dynamic_build_beta_fullwidth.php +++ b/admin/layouts/joomla_component/dynamic_build_beta_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage dynamic_build_beta_fullwidth.php diff --git a/admin/layouts/joomla_component/dynamic_integration_fullwidth.php b/admin/layouts/joomla_component/dynamic_integration_fullwidth.php index 15d17127d..439694f82 100644 --- a/admin/layouts/joomla_component/dynamic_integration_fullwidth.php +++ b/admin/layouts/joomla_component/dynamic_integration_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage dynamic_integration_fullwidth.php diff --git a/admin/layouts/joomla_component/libs_helpers_fullwidth.php b/admin/layouts/joomla_component/libs_helpers_fullwidth.php index 9c7737faa..f753b20ef 100644 --- a/admin/layouts/joomla_component/libs_helpers_fullwidth.php +++ b/admin/layouts/joomla_component/libs_helpers_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage libs_helpers_fullwidth.php diff --git a/admin/layouts/joomla_component/mysql_fullwidth.php b/admin/layouts/joomla_component/mysql_fullwidth.php index e662ade84..9059197ee 100644 --- a/admin/layouts/joomla_component/mysql_fullwidth.php +++ b/admin/layouts/joomla_component/mysql_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage mysql_fullwidth.php diff --git a/admin/layouts/joomla_component/php_fullwidth.php b/admin/layouts/joomla_component/php_fullwidth.php index 23e666f77..a0b7178a2 100644 --- a/admin/layouts/joomla_component/php_fullwidth.php +++ b/admin/layouts/joomla_component/php_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage php_fullwidth.php diff --git a/admin/layouts/joomla_component/publishing.php b/admin/layouts/joomla_component/publishing.php index ac7bd7ed5..1fe0300c0 100644 --- a/admin/layouts/joomla_component/publishing.php +++ b/admin/layouts/joomla_component/publishing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage publishing.php diff --git a/admin/layouts/joomla_component/publlshing.php b/admin/layouts/joomla_component/publlshing.php index 645c15dea..bc1f6ea4c 100644 --- a/admin/layouts/joomla_component/publlshing.php +++ b/admin/layouts/joomla_component/publlshing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage publlshing.php diff --git a/admin/layouts/joomla_component/readme_left.php b/admin/layouts/joomla_component/readme_left.php index c2a9e2b0b..02c13d2b2 100644 --- a/admin/layouts/joomla_component/readme_left.php +++ b/admin/layouts/joomla_component/readme_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage readme_left.php diff --git a/admin/layouts/joomla_component/readme_right.php b/admin/layouts/joomla_component/readme_right.php index e2e0938fa..83e1b1c6a 100644 --- a/admin/layouts/joomla_component/readme_right.php +++ b/admin/layouts/joomla_component/readme_right.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage readme_right.php diff --git a/admin/layouts/joomla_component/settings_left.php b/admin/layouts/joomla_component/settings_left.php index f148fe2a2..e7eea69e5 100644 --- a/admin/layouts/joomla_component/settings_left.php +++ b/admin/layouts/joomla_component/settings_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage settings_left.php diff --git a/admin/layouts/joomla_component/settings_right.php b/admin/layouts/joomla_component/settings_right.php index 7892af1f9..27f0d077a 100644 --- a/admin/layouts/joomla_component/settings_right.php +++ b/admin/layouts/joomla_component/settings_right.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage settings_right.php diff --git a/admin/layouts/joomla_component/site_views_fullwidth.php b/admin/layouts/joomla_component/site_views_fullwidth.php index b51ca4aa8..95aae39f2 100644 --- a/admin/layouts/joomla_component/site_views_fullwidth.php +++ b/admin/layouts/joomla_component/site_views_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage site_views_fullwidth.php diff --git a/admin/layouts/joomla_component/translation_fullwidth.php b/admin/layouts/joomla_component/translation_fullwidth.php new file mode 100644 index 000000000..e32ab81a9 --- /dev/null +++ b/admin/layouts/joomla_component/translation_fullwidth.php @@ -0,0 +1,108 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file + +defined('_JEXEC') or die('Restricted access'); + +// set the defaults +$items = $displayData->vwptranslation; +$user = JFactory::getUser(); +$id = $displayData->item->id; +$edit = "index.php?option=com_componentbuilder&view=language_translations&task=language_translation.edit"; + +?> +
+ + + + + + + + + + + $item): ?> + authorise('core.manage', 'com_checkin') || $item->checked_out == $user->id || $item->checked_out == 0; + $userChkOut = JFactory::getUser($item->checked_out); + $canDo = ComponentbuilderHelper::getActions('language_translation',$item,'language_translations'); + ?> + + + published == 1):?> + + published == 0):?> + + published == 2):?> + + published == -2):?> + + + + + + +
+ + + + + +
+ get('language_translation.edit')): ?> + entranslation; ?> + checked_out): ?> + name, $item->checked_out_time, 'language_translations.', $canCheckin); ?> + + +
entranslation; ?>
+ +
+ + + + + + + + + + + + + + + + + id; ?> +
+ +
+ +
+ +
diff --git a/admin/layouts/language/details_left.php b/admin/layouts/language/details_left.php new file mode 100644 index 000000000..601591612 --- /dev/null +++ b/admin/layouts/language/details_left.php @@ -0,0 +1,54 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file + +defined('_JEXEC') or die('Restricted access'); + +$form = $displayData->getForm(); + +$fields = $displayData->get('fields') ?: array( + 'name' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + +foreach ($fields as $field) +{ + $field = is_array($field) ? $field : array($field); + foreach ($field as $f) + { + if ($form->getField($f)) + { + if (in_array($f, $hiddenFields)) + { + $form->setFieldAttribute($f, 'type', 'hidden'); + } + + echo $form->renderField($f); + break; + } + } +} diff --git a/admin/layouts/language/details_right.php b/admin/layouts/language/details_right.php new file mode 100644 index 000000000..c43a25a70 --- /dev/null +++ b/admin/layouts/language/details_right.php @@ -0,0 +1,54 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file + +defined('_JEXEC') or die('Restricted access'); + +$form = $displayData->getForm(); + +$fields = $displayData->get('fields') ?: array( + 'langtag' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + +foreach ($fields as $field) +{ + $field = is_array($field) ? $field : array($field); + foreach ($field as $f) + { + if ($form->getField($f)) + { + if (in_array($f, $hiddenFields)) + { + $form->setFieldAttribute($f, 'type', 'hidden'); + } + + echo $form->renderField($f); + break; + } + } +} diff --git a/admin/layouts/language/index.html b/admin/layouts/language/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/admin/layouts/language/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/layouts/language/publishing.php b/admin/layouts/language/publishing.php new file mode 100644 index 000000000..1fe0300c0 --- /dev/null +++ b/admin/layouts/language/publishing.php @@ -0,0 +1,58 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file + +defined('_JEXEC') or die('Restricted access'); + +$app = JFactory::getApplication(); +$form = $displayData->getForm(); + +$fields = $displayData->get('fields') ?: array( + 'created', + 'created_by', + 'modified', + 'modified_by' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + +foreach ($fields as $field) +{ + $field = is_array($field) ? $field : array($field); + foreach ($field as $f) + { + if ($form->getField($f)) + { + if (in_array($f, $hiddenFields)) + { + $form->setFieldAttribute($f, 'type', 'hidden'); + } + + echo $form->renderField($f); + break; + } + } +} diff --git a/admin/layouts/language/publlshing.php b/admin/layouts/language/publlshing.php new file mode 100644 index 000000000..bc1f6ea4c --- /dev/null +++ b/admin/layouts/language/publlshing.php @@ -0,0 +1,60 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file + +defined('_JEXEC') or die('Restricted access'); + +$app = JFactory::getApplication(); +$form = $displayData->getForm(); + +$fields = $displayData->get('fields') ?: array( + 'published', + 'ordering', + 'access', + 'version', + 'hits', + 'id' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + +foreach ($fields as $field) +{ + $field = is_array($field) ? $field : array($field); + foreach ($field as $f) + { + if ($form->getField($f)) + { + if (in_array($f, $hiddenFields)) + { + $form->setFieldAttribute($f, 'type', 'hidden'); + } + + echo $form->renderField($f); + break; + } + } +} diff --git a/admin/layouts/language_translation/details_above.php b/admin/layouts/language_translation/details_above.php new file mode 100644 index 000000000..f6933bef5 --- /dev/null +++ b/admin/layouts/language_translation/details_above.php @@ -0,0 +1,41 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file + +defined('_JEXEC') or die('Restricted access'); + +$form = $displayData->getForm(); + +$fields = array( + 'components' +); + +?> +
+ renderField($field); + } ?> +
diff --git a/admin/layouts/language_translation/details_fullwidth.php b/admin/layouts/language_translation/details_fullwidth.php new file mode 100644 index 000000000..8867469b5 --- /dev/null +++ b/admin/layouts/language_translation/details_fullwidth.php @@ -0,0 +1,49 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file + +defined('_JEXEC') or die('Restricted access'); + +$form = $displayData->getForm(); + +$fields = $displayData->get('fields') ?: array( + 'entranslation', + 'translation' +); + +?> +
+ +
+
+ getLabel($field); ?> +
+
+ getInput($field); ?> +
+
+ +
diff --git a/admin/layouts/language_translation/index.html b/admin/layouts/language_translation/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/admin/layouts/language_translation/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/layouts/language_translation/publishing.php b/admin/layouts/language_translation/publishing.php new file mode 100644 index 000000000..1fe0300c0 --- /dev/null +++ b/admin/layouts/language_translation/publishing.php @@ -0,0 +1,58 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file + +defined('_JEXEC') or die('Restricted access'); + +$app = JFactory::getApplication(); +$form = $displayData->getForm(); + +$fields = $displayData->get('fields') ?: array( + 'created', + 'created_by', + 'modified', + 'modified_by' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + +foreach ($fields as $field) +{ + $field = is_array($field) ? $field : array($field); + foreach ($field as $f) + { + if ($form->getField($f)) + { + if (in_array($f, $hiddenFields)) + { + $form->setFieldAttribute($f, 'type', 'hidden'); + } + + echo $form->renderField($f); + break; + } + } +} diff --git a/admin/layouts/language_translation/publlshing.php b/admin/layouts/language_translation/publlshing.php new file mode 100644 index 000000000..bc1f6ea4c --- /dev/null +++ b/admin/layouts/language_translation/publlshing.php @@ -0,0 +1,60 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file + +defined('_JEXEC') or die('Restricted access'); + +$app = JFactory::getApplication(); +$form = $displayData->getForm(); + +$fields = $displayData->get('fields') ?: array( + 'published', + 'ordering', + 'access', + 'version', + 'hits', + 'id' +); + +$hiddenFields = $displayData->get('hidden_fields') ?: array(); + +foreach ($fields as $field) +{ + $field = is_array($field) ? $field : array($field); + foreach ($field as $f) + { + if ($form->getField($f)) + { + if (in_array($f, $hiddenFields)) + { + $form->setFieldAttribute($f, 'type', 'hidden'); + } + + echo $form->renderField($f); + break; + } + } +} diff --git a/admin/layouts/layout/custom_script_fullwidth.php b/admin/layouts/layout/custom_script_fullwidth.php index 7e6e62e4e..cd7d9bdc0 100644 --- a/admin/layouts/layout/custom_script_fullwidth.php +++ b/admin/layouts/layout/custom_script_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage custom_script_fullwidth.php diff --git a/admin/layouts/layout/details_fullwidth.php b/admin/layouts/layout/details_fullwidth.php index 2c704d7ff..32b31ceda 100644 --- a/admin/layouts/layout/details_fullwidth.php +++ b/admin/layouts/layout/details_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_fullwidth.php diff --git a/admin/layouts/layout/details_left.php b/admin/layouts/layout/details_left.php index 1e291edb9..848b24273 100644 --- a/admin/layouts/layout/details_left.php +++ b/admin/layouts/layout/details_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_left.php diff --git a/admin/layouts/layout/details_right.php b/admin/layouts/layout/details_right.php index 980877794..0bc6bfafc 100644 --- a/admin/layouts/layout/details_right.php +++ b/admin/layouts/layout/details_right.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_right.php diff --git a/admin/layouts/layout/details_rightside.php b/admin/layouts/layout/details_rightside.php index 0bd6b3b0b..b5b9693ef 100644 --- a/admin/layouts/layout/details_rightside.php +++ b/admin/layouts/layout/details_rightside.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_rightside.php diff --git a/admin/layouts/layout/details_under.php b/admin/layouts/layout/details_under.php index 077cf1fbd..96e3a455f 100644 --- a/admin/layouts/layout/details_under.php +++ b/admin/layouts/layout/details_under.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_under.php diff --git a/admin/layouts/layout/publishing.php b/admin/layouts/layout/publishing.php index ac7bd7ed5..1fe0300c0 100644 --- a/admin/layouts/layout/publishing.php +++ b/admin/layouts/layout/publishing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage publishing.php diff --git a/admin/layouts/layout/publlshing.php b/admin/layouts/layout/publlshing.php index 645c15dea..bc1f6ea4c 100644 --- a/admin/layouts/layout/publlshing.php +++ b/admin/layouts/layout/publlshing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage publlshing.php diff --git a/admin/layouts/site_view/custom_buttons_fullwidth.php b/admin/layouts/site_view/custom_buttons_fullwidth.php index f7f756db8..5d75a628d 100644 --- a/admin/layouts/site_view/custom_buttons_fullwidth.php +++ b/admin/layouts/site_view/custom_buttons_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage custom_buttons_fullwidth.php diff --git a/admin/layouts/site_view/custom_buttons_left.php b/admin/layouts/site_view/custom_buttons_left.php index b43163fd1..8e87487b5 100644 --- a/admin/layouts/site_view/custom_buttons_left.php +++ b/admin/layouts/site_view/custom_buttons_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage custom_buttons_left.php diff --git a/admin/layouts/site_view/custom_buttons_right.php b/admin/layouts/site_view/custom_buttons_right.php index f535522c5..6840c94f8 100644 --- a/admin/layouts/site_view/custom_buttons_right.php +++ b/admin/layouts/site_view/custom_buttons_right.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage custom_buttons_right.php diff --git a/admin/layouts/site_view/details_above.php b/admin/layouts/site_view/details_above.php index 264848d0a..3f064604e 100644 --- a/admin/layouts/site_view/details_above.php +++ b/admin/layouts/site_view/details_above.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_above.php diff --git a/admin/layouts/site_view/details_fullwidth.php b/admin/layouts/site_view/details_fullwidth.php index c91590b8f..c24c2ba43 100644 --- a/admin/layouts/site_view/details_fullwidth.php +++ b/admin/layouts/site_view/details_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_fullwidth.php diff --git a/admin/layouts/site_view/details_left.php b/admin/layouts/site_view/details_left.php index a4f5f96a4..1f5caf41d 100644 --- a/admin/layouts/site_view/details_left.php +++ b/admin/layouts/site_view/details_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_left.php diff --git a/admin/layouts/site_view/details_right.php b/admin/layouts/site_view/details_right.php index 980877794..0bc6bfafc 100644 --- a/admin/layouts/site_view/details_right.php +++ b/admin/layouts/site_view/details_right.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_right.php diff --git a/admin/layouts/site_view/details_rightside.php b/admin/layouts/site_view/details_rightside.php index b30841fc7..8c85ecf0f 100644 --- a/admin/layouts/site_view/details_rightside.php +++ b/admin/layouts/site_view/details_rightside.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_rightside.php diff --git a/admin/layouts/site_view/details_under.php b/admin/layouts/site_view/details_under.php index 077cf1fbd..96e3a455f 100644 --- a/admin/layouts/site_view/details_under.php +++ b/admin/layouts/site_view/details_under.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_under.php diff --git a/admin/layouts/site_view/javascript_css_fullwidth.php b/admin/layouts/site_view/javascript_css_fullwidth.php index 478a46354..b20cad96a 100644 --- a/admin/layouts/site_view/javascript_css_fullwidth.php +++ b/admin/layouts/site_view/javascript_css_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage javascript_css_fullwidth.php diff --git a/admin/layouts/site_view/linked_components_fullwidth.php b/admin/layouts/site_view/linked_components_fullwidth.php index b1d2606e3..16f350a20 100644 --- a/admin/layouts/site_view/linked_components_fullwidth.php +++ b/admin/layouts/site_view/linked_components_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage linked_components_fullwidth.php @@ -28,7 +28,7 @@ defined('_JEXEC') or die('Restricted access'); // set the defaults -$items = $displayData->vyslinked_components; +$items = $displayData->vytlinked_components; $user = JFactory::getUser(); $id = $displayData->item->id; $edit = "index.php?option=com_componentbuilder&view=joomla_components&task=joomla_component.edit"; diff --git a/admin/layouts/site_view/php_fullwidth.php b/admin/layouts/site_view/php_fullwidth.php index f4afec699..a286a4132 100644 --- a/admin/layouts/site_view/php_fullwidth.php +++ b/admin/layouts/site_view/php_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage php_fullwidth.php diff --git a/admin/layouts/site_view/publishing.php b/admin/layouts/site_view/publishing.php index ac7bd7ed5..1fe0300c0 100644 --- a/admin/layouts/site_view/publishing.php +++ b/admin/layouts/site_view/publishing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage publishing.php diff --git a/admin/layouts/site_view/publlshing.php b/admin/layouts/site_view/publlshing.php index 645c15dea..bc1f6ea4c 100644 --- a/admin/layouts/site_view/publlshing.php +++ b/admin/layouts/site_view/publlshing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage publlshing.php diff --git a/admin/layouts/snippet/details_above.php b/admin/layouts/snippet/details_above.php index 3482493fc..9b3e1ad1d 100644 --- a/admin/layouts/snippet/details_above.php +++ b/admin/layouts/snippet/details_above.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_above.php diff --git a/admin/layouts/snippet/details_left.php b/admin/layouts/snippet/details_left.php index 3535aa04b..e56b32385 100644 --- a/admin/layouts/snippet/details_left.php +++ b/admin/layouts/snippet/details_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_left.php diff --git a/admin/layouts/snippet/details_right.php b/admin/layouts/snippet/details_right.php index daf8c8e20..ffaf7eb37 100644 --- a/admin/layouts/snippet/details_right.php +++ b/admin/layouts/snippet/details_right.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_right.php diff --git a/admin/layouts/snippet/publishing.php b/admin/layouts/snippet/publishing.php index ac7bd7ed5..1fe0300c0 100644 --- a/admin/layouts/snippet/publishing.php +++ b/admin/layouts/snippet/publishing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage publishing.php diff --git a/admin/layouts/snippet/publlshing.php b/admin/layouts/snippet/publlshing.php index 645c15dea..bc1f6ea4c 100644 --- a/admin/layouts/snippet/publlshing.php +++ b/admin/layouts/snippet/publlshing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage publlshing.php diff --git a/admin/layouts/template/custom_script_fullwidth.php b/admin/layouts/template/custom_script_fullwidth.php index 7e6e62e4e..cd7d9bdc0 100644 --- a/admin/layouts/template/custom_script_fullwidth.php +++ b/admin/layouts/template/custom_script_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage custom_script_fullwidth.php diff --git a/admin/layouts/template/details_fullwidth.php b/admin/layouts/template/details_fullwidth.php index 9669d0142..9a23e1a00 100644 --- a/admin/layouts/template/details_fullwidth.php +++ b/admin/layouts/template/details_fullwidth.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_fullwidth.php diff --git a/admin/layouts/template/details_left.php b/admin/layouts/template/details_left.php index 1e291edb9..848b24273 100644 --- a/admin/layouts/template/details_left.php +++ b/admin/layouts/template/details_left.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_left.php diff --git a/admin/layouts/template/details_right.php b/admin/layouts/template/details_right.php index 980877794..0bc6bfafc 100644 --- a/admin/layouts/template/details_right.php +++ b/admin/layouts/template/details_right.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_right.php diff --git a/admin/layouts/template/details_rightside.php b/admin/layouts/template/details_rightside.php index 0bd6b3b0b..b5b9693ef 100644 --- a/admin/layouts/template/details_rightside.php +++ b/admin/layouts/template/details_rightside.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_rightside.php diff --git a/admin/layouts/template/details_under.php b/admin/layouts/template/details_under.php index 077cf1fbd..96e3a455f 100644 --- a/admin/layouts/template/details_under.php +++ b/admin/layouts/template/details_under.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage details_under.php diff --git a/admin/layouts/template/publishing.php b/admin/layouts/template/publishing.php index ac7bd7ed5..1fe0300c0 100644 --- a/admin/layouts/template/publishing.php +++ b/admin/layouts/template/publishing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage publishing.php diff --git a/admin/layouts/template/publlshing.php b/admin/layouts/template/publlshing.php index 645c15dea..bc1f6ea4c 100644 --- a/admin/layouts/template/publlshing.php +++ b/admin/layouts/template/publlshing.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage publlshing.php diff --git a/admin/models/admin_view.php b/admin/models/admin_view.php index f74fc1517..e07aac68a 100644 --- a/admin/models/admin_view.php +++ b/admin/models/admin_view.php @@ -293,8 +293,8 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin $item->tags->getTagIds($item->id, 'com_componentbuilder.admin_view'); } } - $this->idvvvy = $item->addfields; - $this->addadmin_viewsvvvz = $item->id; + $this->idvvvz = $item->addfields; + $this->addadmin_viewsvvwa = $item->id; return $item; } @@ -304,7 +304,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin * * @return mixed An array of data items on success, false on failure. */ - public function getVxwfields() + public function getVxxfields() { // Get the user object. $user = JFactory::getUser(); @@ -373,26 +373,26 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin foreach ($items as $nr => &$item) { // convert datatype - $item->datatype = $this->selectionTranslationVxwfields($item->datatype, 'datatype'); + $item->datatype = $this->selectionTranslationVxxfields($item->datatype, 'datatype'); // convert indexes - $item->indexes = $this->selectionTranslationVxwfields($item->indexes, 'indexes'); + $item->indexes = $this->selectionTranslationVxxfields($item->indexes, 'indexes'); // convert null_switch - $item->null_switch = $this->selectionTranslationVxwfields($item->null_switch, 'null_switch'); + $item->null_switch = $this->selectionTranslationVxxfields($item->null_switch, 'null_switch'); // convert store - $item->store = $this->selectionTranslationVxwfields($item->store, 'store'); + $item->store = $this->selectionTranslationVxxfields($item->store, 'store'); } } // Filter by id Repetable Field - $idvvvy = json_decode($this->idvvvy,true); - if (ComponentbuilderHelper::checkArray($items) && isset($idvvvy) && ComponentbuilderHelper::checkArray($idvvvy)) + $idvvvz = json_decode($this->idvvvz,true); + if (ComponentbuilderHelper::checkArray($items) && isset($idvvvz) && ComponentbuilderHelper::checkArray($idvvvz)) { foreach ($items as $nr => &$item) { - if ($item->id && isset($idvvvy['field']) && ComponentbuilderHelper::checkArray($idvvvy['field'])) + if ($item->id && isset($idvvvz['field']) && ComponentbuilderHelper::checkArray($idvvvz['field'])) { - if (!in_array($item->id,$idvvvy['field'])) + if (!in_array($item->id,$idvvvz['field'])) { unset($items[$nr]); continue; @@ -419,7 +419,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin * * @return translatable string */ - public function selectionTranslationVxwfields($value,$name) + public function selectionTranslationVxxfields($value,$name) { // Array of datatype language strings if ($name === 'datatype') @@ -497,7 +497,7 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin * * @return mixed An array of data items on success, false on failure. */ - public function getVxxlinked_components() + public function getVxylinked_components() { // Get the user object. $user = JFactory::getUser(); @@ -537,15 +537,15 @@ class ComponentbuilderModelAdmin_view extends JModelAdmin { $items = $db->loadObjectList(); - // Filter by addadmin_viewsvvvz in this Repetable Field - if (ComponentbuilderHelper::checkArray($items) && isset($this->addadmin_viewsvvvz)) + // Filter by addadmin_viewsvvwa in this Repetable Field + if (ComponentbuilderHelper::checkArray($items) && isset($this->addadmin_viewsvvwa)) { foreach ($items as $nr => &$item) { if (isset($item->addadmin_views) && ComponentbuilderHelper::checkJson($item->addadmin_views)) { $tmpArray = json_decode($item->addadmin_views,true); - if (!in_array($this->addadmin_viewsvvvz, $tmpArray['adminview'])) + if (!in_array($this->addadmin_viewsvvwa, $tmpArray['adminview'])) { unset($items[$nr]); continue; diff --git a/admin/models/ajax.php b/admin/models/ajax.php index 8e4a70aa8..7ee6c651a 100644 --- a/admin/models/ajax.php +++ b/admin/models/ajax.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage ajax.php @@ -1055,5 +1055,225 @@ class ComponentbuilderModelAjax extends JModelList return $field; } return false; + } + + // Used in language_translation + protected $functionArray = array( + 'translation' => 'checkString', + 'language' => 'getLanguageName'); + + protected function checkString($header, $value) + { + return $value; + } + + protected function getLanguageName($header, $value) + { + if ($name = ComponentbuilderHelper::getVar($header, $value, 'langtag', 'name')) + { + return $name . ' (' . $value . ')'; + } + return $value; + } + + protected function setAutoLangZero() + { + // set the headers + $headers = array( + 'translation' => JText::_('COM_COMPONENTBUILDER_TRANSLATION'), + 'language' => JText::_('COM_COMPONENTBUILDER_LANGUAGE') + ); + // loop the array + foreach ($headers as $key => $lang) + { + $this->setLanguage($key,$lang); + } + } + + protected $languageArray = array(); + + protected function setLanguage($key,$lang) + { + $this->languageArray[$key] = $lang; + } + + public function getLanguage() + { + // return the language string that were set + return $this->languageArray; + } + + protected function autoLoader() + { + $functions = range(0,10); + foreach ($functions as $function) + { + $function = 'setAutoLang'.ComponentbuilderHelper::safeString($function, 'f'); + if (method_exists($this, $function)) + { + $this->{$function}(); + } + } + foreach ($functions as $function) + { + $function = 'setAutoFunc'.ComponentbuilderHelper::safeString($function, 'f'); + if (method_exists($this, $function)) + { + $this->{$function}(); + } + } + } + + public function getBuildTable($idName, $oject) + { + if (ComponentbuilderHelper::checkJson($oject) && ComponentbuilderHelper::checkString($idName)) + { + $array = json_decode($oject, true); + if (ComponentbuilderHelper::checkArray($array)) + { + // make sure we run the autoloader to insure all is set + $this->autoLoader(); + // set the target headers + $targetHeaders = $this->getLanguage(); + // start table build + $table = ''; + $rows = array(); + foreach ($array as $header => $values) + { + if (ComponentbuilderHelper::checkArray($values)) + { + $targetHeader = (isset($targetHeaders[$header])) ? $targetHeaders[$header] : ComponentbuilderHelper::safeString($header, 'W'); + $table .= ''; + + foreach ($values as $nr => $value) + { + // set the value for the row + $this->setRows($nr, $this->setValue($header, $value), $rows); + } + } + } + // close header start body + $table .= ''; + // add rows to table + if (ComponentbuilderHelper::checkArray($rows)) + { + foreach ($rows as $row) + { + $table .= ''.$row.''; + } + } + // close the body and table + $table .= '
'.$targetHeader.'
'; + // return the table + return $table; + } + } + return false; + } + + protected function setValue($header, $value) + { + if (array_key_exists($header, $this->functionArray) && method_exists($this, $this->functionArray[$header])) + { + $value = $this->{$this->functionArray[$header]}($header, $value); + } + // if no value are set + if (!ComponentbuilderHelper::checkString($value)) + { + $value = '-'; + } + // make total stand out + if ('total' == $header) + { + $value = ''.$value.''; + } + return $value; + } + + protected function setRows($nr, $value, &$rows) + { + // build rows + if (!isset($rows[$nr])) + { + $rows[$nr] = ''.$value.''; + } + else + { + $rows[$nr] .= ''.$value.''; + } + } + + protected $viewid = array(); + + protected function getViewID($call = 'table') + { + if (!isset($this->viewid[$call])) + { + // get the vdm key + $jinput = JFactory::getApplication()->input; + $vdm = $jinput->get('vdm', null, 'WORD'); + if ($vdm) + { + if ($view = ComponentbuilderHelper::get($vdm)) + { + $current = (array) explode('__', $view); + if (ComponentbuilderHelper::checkString($current[0]) && isset($current[1]) && is_numeric($current[1])) + { + // get the view name & id + $this->viewid[$call] = array( + 'a_id' => (int) $current[1], + 'a_view' => $current[0] + ); + } + } + } + } + if (isset($this->viewid[$call])) + { + return $this->viewid[$call]; + } + return false; + } + + protected $buttonArray = array( + 'language' => true); + + public function getButton($type) + { + if (isset($this->buttonArray[$type])) + { + $user = JFactory::getUser(); + // only add if user allowed to create + if ($user->authorise($type.'.create', 'com_componentbuilder')) + { + // get the input from url + $jinput = JFactory::getApplication()->input; + // get the view name & id + $values = $this->getViewID(); + // check if new item + $ref = ''; + if (!is_null($values['a_id']) && $values['a_id'] > 0 && strlen($values['a_view'])) + { + // only load referal if not new item. + $ref = '&ref=' . $values['a_view'] . '&refid=' . $values['a_id']; + } + // build the button + $button = '
+
+ +
+ +
'; + // return the button attached to input field + return $button; + } + return ''; + } + return false; } } diff --git a/admin/models/componentbuilder.php b/admin/models/componentbuilder.php index ce7dff7de..c564cfa5b 100644 --- a/admin/models/componentbuilder.php +++ b/admin/models/componentbuilder.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage componentbuilder.php @@ -43,7 +43,7 @@ class ComponentbuilderModelComponentbuilder extends JModelList $icons = array(); // view groups array $viewGroups = array( - 'main' => array('png.compiler', 'png.joomla_component.add', 'png.joomla_components', 'png.admin_view.add', 'png.admin_views', 'png.custom_admin_view.add', 'png.custom_admin_views', 'png.site_view.add', 'png.site_views', 'png.template.add', 'png.templates', 'png.layout.add', 'png.layouts', 'png.dynamic_get.add', 'png.dynamic_gets', 'png.custom_codes', 'png.snippet.add', 'png.snippets', 'png.field.add', 'png.fields', 'png.fields.catid', 'png.fieldtype.add', 'png.fieldtypes', 'png.fieldtypes.catid', 'png.help_document.add', 'png.help_documents') + 'main' => array('png.compiler', 'png.joomla_component.add', 'png.joomla_components', 'png.admin_view.add', 'png.admin_views', 'png.custom_admin_view.add', 'png.custom_admin_views', 'png.site_view.add', 'png.site_views', 'png.template.add', 'png.templates', 'png.layout.add', 'png.layouts', 'png.dynamic_get.add', 'png.dynamic_gets', 'png.custom_codes', 'png.snippet.add', 'png.snippets', 'png.field.add', 'png.fields', 'png.fields.catid', 'png.fieldtype.add', 'png.fieldtypes', 'png.fieldtypes.catid', 'png.language_translations', 'png.help_document.add', 'png.help_documents') ); // view access array $viewAccess = array( @@ -107,6 +107,15 @@ class ComponentbuilderModelComponentbuilder extends JModelList 'fieldtypes.submenu' => 'fieldtype.submenu', 'fieldtypes.dashboard_list' => 'fieldtype.dashboard_list', 'fieldtype.dashboard_add' => 'fieldtype.dashboard_add', + 'language_translation.create' => 'language_translation.create', + 'language_translations.access' => 'language_translation.access', + 'language_translation.access' => 'language_translation.access', + 'language_translations.submenu' => 'language_translation.submenu', + 'language_translations.dashboard_list' => 'language_translation.dashboard_list', + 'language.create' => 'language.create', + 'languages.access' => 'language.access', + 'language.access' => 'language.access', + 'languages.submenu' => 'language.submenu', 'help_document.create' => 'help_document.create', 'help_documents.access' => 'help_document.access', 'help_document.access' => 'help_document.access', diff --git a/admin/models/custom_admin_view.php b/admin/models/custom_admin_view.php index f905edd2b..3a9d7ccbb 100644 --- a/admin/models/custom_admin_view.php +++ b/admin/models/custom_admin_view.php @@ -169,7 +169,7 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin $item->tags->getTagIds($item->id, 'com_componentbuilder.custom_admin_view'); } } - $this->addcustom_admin_viewsvvwa = $item->id; + $this->addcustom_admin_viewsvvwb = $item->id; return $item; } @@ -179,7 +179,7 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin * * @return mixed An array of data items on success, false on failure. */ - public function getVyhlinked_components() + public function getVyilinked_components() { // Get the user object. $user = JFactory::getUser(); @@ -219,15 +219,15 @@ class ComponentbuilderModelCustom_admin_view extends JModelAdmin { $items = $db->loadObjectList(); - // Filter by addcustom_admin_viewsvvwa in this Repetable Field - if (ComponentbuilderHelper::checkArray($items) && isset($this->addcustom_admin_viewsvvwa)) + // Filter by addcustom_admin_viewsvvwb in this Repetable Field + if (ComponentbuilderHelper::checkArray($items) && isset($this->addcustom_admin_viewsvvwb)) { foreach ($items as $nr => &$item) { if (isset($item->addcustom_admin_views) && ComponentbuilderHelper::checkJson($item->addcustom_admin_views)) { $tmpArray = json_decode($item->addcustom_admin_views,true); - if (!in_array($this->addcustom_admin_viewsvvwa, $tmpArray['customadminview'])) + if (!in_array($this->addcustom_admin_viewsvvwb, $tmpArray['customadminview'])) { unset($items[$nr]); continue; diff --git a/admin/models/custom_code.php b/admin/models/custom_code.php index fd32e8234..f3c0bab94 100644 --- a/admin/models/custom_code.php +++ b/admin/models/custom_code.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 81 of this MVC - @build 1st March, 2017 + @version @update number 82 of this MVC + @build 3rd April, 2017 @created 11th October, 2016 @package Component Builder @subpackage custom_code.php diff --git a/admin/models/custom_codes.php b/admin/models/custom_codes.php index b361506a2..1a0f38663 100644 --- a/admin/models/custom_codes.php +++ b/admin/models/custom_codes.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 81 of this MVC - @build 1st March, 2017 + @version @update number 82 of this MVC + @build 3rd April, 2017 @created 11th October, 2016 @package Component Builder @subpackage custom_codes.php @@ -280,7 +280,7 @@ class ComponentbuilderModelCustom_codes extends JModelList else { $search = $db->quote('%' . $db->escape($search) . '%'); - $query->where('(a.component LIKE '.$search.' OR g.system_name LIKE '.$search.' OR a.path LIKE '.$search.' OR a.comment_type LIKE '.$search.' OR a.system_name LIKE '.$search.' OR a.function_name LIKE '.$search.')'); + $query->where('(a.component LIKE '.$search.' OR g.system_name LIKE '.$search.' OR a.path LIKE '.$search.' OR a.comment_type LIKE '.$search.' OR a.function_name LIKE '.$search.' OR a.system_name LIKE '.$search.')'); } } diff --git a/admin/models/field.php b/admin/models/field.php index be0385610..56c2136d9 100644 --- a/admin/models/field.php +++ b/admin/models/field.php @@ -131,7 +131,7 @@ class ComponentbuilderModelField extends JModelAdmin $item->tags->getTagIds($item->id, 'com_componentbuilder.field'); } } - $this->addfieldsvvwc = $item->id; + $this->addfieldsvvwd = $item->id; return $item; } @@ -141,7 +141,7 @@ class ComponentbuilderModelField extends JModelAdmin * * @return mixed An array of data items on success, false on failure. */ - public function getVzzlinked_admin_views() + public function getWaalinked_admin_views() { // Get the user object. $user = JFactory::getUser(); @@ -198,15 +198,15 @@ class ComponentbuilderModelField extends JModelAdmin } } - // Filter by addfieldsvvwc in this Repetable Field - if (ComponentbuilderHelper::checkArray($items) && isset($this->addfieldsvvwc)) + // Filter by addfieldsvvwd in this Repetable Field + if (ComponentbuilderHelper::checkArray($items) && isset($this->addfieldsvvwd)) { foreach ($items as $nr => &$item) { if (isset($item->addfields) && ComponentbuilderHelper::checkJson($item->addfields)) { $tmpArray = json_decode($item->addfields,true); - if (!in_array($this->addfieldsvvwc, $tmpArray['field'])) + if (!in_array($this->addfieldsvvwd, $tmpArray['field'])) { unset($items[$nr]); continue; diff --git a/admin/models/fields/adminviewfolderlist.php b/admin/models/fields/adminviewfolderlist.php index 8e7db4e54..a65663056 100644 --- a/admin/models/fields/adminviewfolderlist.php +++ b/admin/models/fields/adminviewfolderlist.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage adminviewfolderlist.php diff --git a/admin/models/fields/adminviews.php b/admin/models/fields/adminviews.php index 4ff076ddc..0deee82d7 100644 --- a/admin/models/fields/adminviews.php +++ b/admin/models/fields/adminviews.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage adminviews.php diff --git a/admin/models/fields/articles.php b/admin/models/fields/articles.php index bffcd2741..e1f3669ba 100644 --- a/admin/models/fields/articles.php +++ b/admin/models/fields/articles.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage articles.php diff --git a/admin/models/fields/component.php b/admin/models/fields/component.php index e76e4058e..2131b605d 100644 --- a/admin/models/fields/component.php +++ b/admin/models/fields/component.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage component.php diff --git a/admin/models/fields/components.php b/admin/models/fields/components.php new file mode 100644 index 000000000..e9bd29291 --- /dev/null +++ b/admin/models/fields/components.php @@ -0,0 +1,170 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// import the list field type +jimport('joomla.form.helper'); +JFormHelper::loadFieldClass('list'); + +/** + * Components Form Field class for the Componentbuilder component + */ +class JFormFieldComponents extends JFormFieldList +{ + /** + * The components field type. + * + * @var string + */ + public $type = 'components'; + /** + * Override to add new button + * + * @return string The field input markup. + * + * @since 3.2 + */ + protected function getInput() + { + // see if we should add buttons + $setButton = $this->getAttribute('button'); + // get html + $html = parent::getInput(); + // if true set button + if ($setButton === 'true') + { + $button = array(); + $script = array(); + $buttonName = $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 referal if not new item. + $ref = '&ref=' . $values['view'] . '&refid=' . $values['id']; + $refJ = '&ref=' . $values['view'] . '&refid=' . $values['id']; + } + $user = JFactory::getUser(); + // only add if user allowed to create joomla_component + if ($user->authorise('core.create', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area. + { + // build Create button + $buttonNamee = trim($buttonName); + $buttonNamee = preg_replace('/_+/', ' ', $buttonNamee); + $buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee); + $buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee); + $buttonNamee = ucfirst(strtolower($buttonNamee)); + $button[] = ' + '; + } + // only add if user allowed to edit joomla_component + if (($buttonName === 'joomla_component' || $buttonName === 'joomla_components') && $user->authorise('core.edit', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area. + { + // build edit button + $buttonNamee = trim($buttonName); + $buttonNamee = preg_replace('/_+/', ' ', $buttonNamee); + $buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee); + $buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee); + $buttonNamee = ucfirst(strtolower($buttonNamee)); + $button[] = ''; + // build script + $script[] = " + jQuery(document).ready(function() { + jQuery('#adminForm').on('change', '#jform_".$buttonName."',function (e) { + e.preventDefault(); + var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val(); + ".$buttonName."Button(".$buttonName."Value); + }); + var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val(); + ".$buttonName."Button(".$buttonName."Value); + }); + function ".$buttonName."Button(value) { + if (value > 0) { + // hide the create button + jQuery('#".$buttonName."Create').hide(); + // show edit button + jQuery('#".$buttonName."Edit').show(); + var url = 'index.php?option=com_componentbuilder&view=joomla_components&task=joomla_component.edit&id='+value+'".$refJ."'; + jQuery('#".$buttonName."Edit').attr('href', url); + } else { + // show the create button + jQuery('#".$buttonName."Create').show(); + // hide edit button + jQuery('#".$buttonName."Edit').hide(); + } + }"; + } + // check if button was created for joomla_component 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. + */ + public function getOptions() + { + $db = JFactory::getDBO(); + $query = $db->getQuery(true); + $query->select($db->quoteName(array('a.id','a.system_name'),array('id','components_system_name'))); + $query->from($db->quoteName('#__componentbuilder_joomla_component', 'a')); + $query->where($db->quoteName('a.published') . ' >= 1'); + $query->order('a.system_name ASC'); + $db->setQuery((string)$query); + $items = $db->loadObjectList(); + $options = array(); + if ($items) + { + foreach($items as $item) + { + $options[] = JHtml::_('select.option', $item->id, $item->components_system_name); + } + } + return $options; + } +} diff --git a/admin/models/fields/customadminviews.php b/admin/models/fields/customadminviews.php index 1cf4313e6..b776547fa 100644 --- a/admin/models/fields/customadminviews.php +++ b/admin/models/fields/customadminviews.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage customadminviews.php diff --git a/admin/models/fields/customfilelist.php b/admin/models/fields/customfilelist.php index 55df68651..a04fb8e9c 100644 --- a/admin/models/fields/customfilelist.php +++ b/admin/models/fields/customfilelist.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage customfilelist.php diff --git a/admin/models/fields/customfolderlist.php b/admin/models/fields/customfolderlist.php index b7a303a57..05430c01c 100644 --- a/admin/models/fields/customfolderlist.php +++ b/admin/models/fields/customfolderlist.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage customfolderlist.php diff --git a/admin/models/fields/customgets.php b/admin/models/fields/customgets.php index 7e1c1d954..0c30ed4e7 100644 --- a/admin/models/fields/customgets.php +++ b/admin/models/fields/customgets.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage customgets.php diff --git a/admin/models/fields/dbtables.php b/admin/models/fields/dbtables.php index 64c1ad7b2..d26f07485 100644 --- a/admin/models/fields/dbtables.php +++ b/admin/models/fields/dbtables.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage dbtables.php diff --git a/admin/models/fields/dynamicget.php b/admin/models/fields/dynamicget.php index b2f0fa58c..aece7f8a8 100644 --- a/admin/models/fields/dynamicget.php +++ b/admin/models/fields/dynamicget.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage dynamicget.php diff --git a/admin/models/fields/dynamicgets.php b/admin/models/fields/dynamicgets.php index 20405d887..9e75af87f 100644 --- a/admin/models/fields/dynamicgets.php +++ b/admin/models/fields/dynamicgets.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage dynamicgets.php diff --git a/admin/models/fields/fields.php b/admin/models/fields/fields.php index e720dc00f..7b693d326 100644 --- a/admin/models/fields/fields.php +++ b/admin/models/fields/fields.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage fields.php diff --git a/admin/models/fields/fieldsmulti.php b/admin/models/fields/fieldsmulti.php index d484d9cd4..115f82171 100644 --- a/admin/models/fields/fieldsmulti.php +++ b/admin/models/fields/fieldsmulti.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage fieldsmulti.php diff --git a/admin/models/fields/fieldtypes.php b/admin/models/fields/fieldtypes.php index b0ea7f761..19c3749e8 100644 --- a/admin/models/fields/fieldtypes.php +++ b/admin/models/fields/fieldtypes.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage fieldtypes.php diff --git a/admin/models/fields/lang.php b/admin/models/fields/lang.php new file mode 100644 index 000000000..b2011d5f0 --- /dev/null +++ b/admin/models/fields/lang.php @@ -0,0 +1,171 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// import the list field type +jimport('joomla.form.helper'); +JFormHelper::loadFieldClass('list'); + +/** + * Lang Form Field class for the Componentbuilder component + */ +class JFormFieldLang extends JFormFieldList +{ + /** + * The lang field type. + * + * @var string + */ + public $type = 'lang'; + /** + * Override to add new button + * + * @return string The field input markup. + * + * @since 3.2 + */ + protected function getInput() + { + // see if we should add buttons + $setButton = $this->getAttribute('button'); + // get html + $html = parent::getInput(); + // if true set button + if ($setButton === 'true') + { + $button = array(); + $script = array(); + $buttonName = $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 referal if not new item. + $ref = '&ref=' . $values['view'] . '&refid=' . $values['id']; + $refJ = '&ref=' . $values['view'] . '&refid=' . $values['id']; + } + $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 + $buttonNamee = trim($buttonName); + $buttonNamee = preg_replace('/_+/', ' ', $buttonNamee); + $buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee); + $buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee); + $buttonNamee = ucfirst(strtolower($buttonNamee)); + $button[] = ' + '; + } + // only add if user allowed to edit language + if (($buttonName === 'language' || $buttonName === 'languages') && $user->authorise('language.edit', 'com_componentbuilder') && $app->isAdmin()) // TODO for now only in admin area. + { + // build edit button + $buttonNamee = trim($buttonName); + $buttonNamee = preg_replace('/_+/', ' ', $buttonNamee); + $buttonNamee = preg_replace('/\s+/', ' ', $buttonNamee); + $buttonNamee = preg_replace("/[^A-Za-z ]/", '', $buttonNamee); + $buttonNamee = ucfirst(strtolower($buttonNamee)); + $button[] = ''; + // build script + $script[] = " + jQuery(document).ready(function() { + jQuery('#adminForm').on('change', '#jform_".$buttonName."',function (e) { + e.preventDefault(); + var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val(); + ".$buttonName."Button(".$buttonName."Value); + }); + var ".$buttonName."Value = jQuery('#jform_".$buttonName."').val(); + ".$buttonName."Button(".$buttonName."Value); + }); + function ".$buttonName."Button(value) { + if (value > 0) { + // hide the create button + jQuery('#".$buttonName."Create').hide(); + // show edit button + jQuery('#".$buttonName."Edit').show(); + var url = 'index.php?option=com_componentbuilder&view=languages&task=language.edit&id='+value+'".$refJ."'; + jQuery('#".$buttonName."Edit').attr('href', url); + } else { + // show the create button + jQuery('#".$buttonName."Create').show(); + // hide edit button + jQuery('#".$buttonName."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. + */ + public 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(); + $options = array(); + if ($items) + { + $options[] = JHtml::_('select.option', '', 'Select an option'); + foreach($items as $item) + { + $options[] = JHtml::_('select.option', $item->langtag, $item->language_name . ' (' .$item->langtag.')'); + } + } + return $options; + } +} diff --git a/admin/models/fields/maingets.php b/admin/models/fields/maingets.php index 15125c414..50d1bf4da 100644 --- a/admin/models/fields/maingets.php +++ b/admin/models/fields/maingets.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage maingets.php diff --git a/admin/models/fields/siteviewfolderlist.php b/admin/models/fields/siteviewfolderlist.php index 420974882..4247c9de1 100644 --- a/admin/models/fields/siteviewfolderlist.php +++ b/admin/models/fields/siteviewfolderlist.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage siteviewfolderlist.php diff --git a/admin/models/fields/siteviews.php b/admin/models/fields/siteviews.php index d2e39b65c..8896cc0c8 100644 --- a/admin/models/fields/siteviews.php +++ b/admin/models/fields/siteviews.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage siteviews.php diff --git a/admin/models/fields/snippets.php b/admin/models/fields/snippets.php index d7537ce78..0bfb3310b 100644 --- a/admin/models/fields/snippets.php +++ b/admin/models/fields/snippets.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage snippets.php diff --git a/admin/models/fieldtype.php b/admin/models/fieldtype.php index ad1ed92b8..f6721a99d 100644 --- a/admin/models/fieldtype.php +++ b/admin/models/fieldtype.php @@ -101,7 +101,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin $item->tags->getTagIds($item->id, 'com_componentbuilder.fieldtype'); } } - $this->fieldtypevvwd = $item->id; + $this->fieldtypevvwe = $item->id; return $item; } @@ -111,7 +111,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin * * @return mixed An array of data items on success, false on failure. */ - public function getWaafields() + public function getWabfields() { // Get the user object. $user = JFactory::getUser(); @@ -131,15 +131,15 @@ class ComponentbuilderModelFieldtype extends JModelAdmin $query->select($db->quoteName('g.name','fieldtype_name')); $query->join('LEFT', $db->quoteName('#__componentbuilder_fieldtype', 'g') . ' ON (' . $db->quoteName('a.fieldtype') . ' = ' . $db->quoteName('g.id') . ')'); - // Filter by fieldtypevvwd global. - $fieldtypevvwd = $this->fieldtypevvwd; - if (is_numeric($fieldtypevvwd )) + // Filter by fieldtypevvwe global. + $fieldtypevvwe = $this->fieldtypevvwe; + if (is_numeric($fieldtypevvwe )) { - $query->where('a.fieldtype = ' . (int) $fieldtypevvwd ); + $query->where('a.fieldtype = ' . (int) $fieldtypevvwe ); } - elseif (is_string($fieldtypevvwd)) + elseif (is_string($fieldtypevvwe)) { - $query->where('a.fieldtype = ' . $db->quote($fieldtypevvwd)); + $query->where('a.fieldtype = ' . $db->quote($fieldtypevvwe)); } else { @@ -195,13 +195,13 @@ class ComponentbuilderModelFieldtype extends JModelAdmin foreach ($items as $nr => &$item) { // convert datatype - $item->datatype = $this->selectionTranslationWaafields($item->datatype, 'datatype'); + $item->datatype = $this->selectionTranslationWabfields($item->datatype, 'datatype'); // convert indexes - $item->indexes = $this->selectionTranslationWaafields($item->indexes, 'indexes'); + $item->indexes = $this->selectionTranslationWabfields($item->indexes, 'indexes'); // convert null_switch - $item->null_switch = $this->selectionTranslationWaafields($item->null_switch, 'null_switch'); + $item->null_switch = $this->selectionTranslationWabfields($item->null_switch, 'null_switch'); // convert store - $item->store = $this->selectionTranslationWaafields($item->store, 'store'); + $item->store = $this->selectionTranslationWabfields($item->store, 'store'); } } @@ -215,7 +215,7 @@ class ComponentbuilderModelFieldtype extends JModelAdmin * * @return translatable string */ - public function selectionTranslationWaafields($value,$name) + public function selectionTranslationWabfields($value,$name) { // Array of datatype language strings if ($name === 'datatype') diff --git a/admin/models/forms/admin_view.js b/admin/models/forms/admin_view.js index b7df20449..1477ea792 100644 --- a/admin/models/forms/admin_view.js +++ b/admin/models/forms/admin_view.js @@ -23,39 +23,39 @@ /-----------------------------------------------------------------------------------------------------------------------------*/ // Some Global Values -jform_vvvvvwwvwp_required = false; -jform_vvvvvwxvwq_required = false; -jform_vvvvvwyvwr_required = false; -jform_vvvvvwzvws_required = false; -jform_vvvvvxavwt_required = false; -jform_vvvvvxbvwu_required = false; -jform_vvvvvxcvwv_required = false; -jform_vvvvvxdvww_required = false; -jform_vvvvvxevwx_required = false; -jform_vvvvvxfvwy_required = false; -jform_vvvvvxgvwz_required = false; -jform_vvvvvxhvxa_required = false; -jform_vvvvvxivxb_required = false; -jform_vvvvvxjvxc_required = false; -jform_vvvvvxkvxd_required = false; -jform_vvvvvxlvxe_required = false; -jform_vvvvvxmvxf_required = false; -jform_vvvvvxnvxg_required = false; -jform_vvvvvxovxh_required = false; -jform_vvvvvxpvxi_required = false; -jform_vvvvvxqvxj_required = false; -jform_vvvvvxrvxk_required = false; -jform_vvvvvxsvxl_required = false; -jform_vvvvvxwvxm_required = false; +jform_vvvvvwwvwq_required = false; +jform_vvvvvwxvwr_required = false; +jform_vvvvvwyvws_required = false; +jform_vvvvvwzvwt_required = false; +jform_vvvvvxavwu_required = false; +jform_vvvvvxbvwv_required = false; +jform_vvvvvxcvww_required = false; +jform_vvvvvxdvwx_required = false; +jform_vvvvvxevwy_required = false; +jform_vvvvvxfvwz_required = false; +jform_vvvvvxgvxa_required = false; +jform_vvvvvxhvxb_required = false; +jform_vvvvvxivxc_required = false; +jform_vvvvvxjvxd_required = false; +jform_vvvvvxkvxe_required = false; +jform_vvvvvxlvxf_required = false; +jform_vvvvvxmvxg_required = false; +jform_vvvvvxnvxh_required = false; +jform_vvvvvxovxi_required = false; +jform_vvvvvxpvxj_required = false; +jform_vvvvvxqvxk_required = false; +jform_vvvvvxrvxl_required = false; +jform_vvvvvxsvxm_required = false; jform_vvvvvxwvxn_required = false; jform_vvvvvxwvxo_required = false; jform_vvvvvxwvxp_required = false; jform_vvvvvxwvxq_required = false; jform_vvvvvxwvxr_required = false; -jform_vvvvvxyvxs_required = false; +jform_vvvvvxwvxs_required = false; jform_vvvvvxyvxt_required = false; jform_vvvvvxyvxu_required = false; jform_vvvvvxyvxv_required = false; +jform_vvvvvxyvxw_required = false; // Initial Script jQuery(document).ready(function() @@ -151,26 +151,26 @@ function vvvvvww(add_css_view_vvvvvww) if (add_css_view_vvvvvww == 1) { jQuery('#jform_css_view').closest('.control-group').show(); - if (jform_vvvvvwwvwp_required) + if (jform_vvvvvwwvwq_required) { updateFieldRequired('css_view',0); jQuery('#jform_css_view').prop('required','required'); jQuery('#jform_css_view').attr('aria-required',true); jQuery('#jform_css_view').addClass('required'); - jform_vvvvvwwvwp_required = false; + jform_vvvvvwwvwq_required = false; } } else { jQuery('#jform_css_view').closest('.control-group').hide(); - if (!jform_vvvvvwwvwp_required) + if (!jform_vvvvvwwvwq_required) { updateFieldRequired('css_view',1); jQuery('#jform_css_view').removeAttr('required'); jQuery('#jform_css_view').removeAttr('aria-required'); jQuery('#jform_css_view').removeClass('required'); - jform_vvvvvwwvwp_required = true; + jform_vvvvvwwvwq_required = true; } } } @@ -182,26 +182,26 @@ function vvvvvwx(add_css_views_vvvvvwx) if (add_css_views_vvvvvwx == 1) { jQuery('#jform_css_views').closest('.control-group').show(); - if (jform_vvvvvwxvwq_required) + if (jform_vvvvvwxvwr_required) { updateFieldRequired('css_views',0); jQuery('#jform_css_views').prop('required','required'); jQuery('#jform_css_views').attr('aria-required',true); jQuery('#jform_css_views').addClass('required'); - jform_vvvvvwxvwq_required = false; + jform_vvvvvwxvwr_required = false; } } else { jQuery('#jform_css_views').closest('.control-group').hide(); - if (!jform_vvvvvwxvwq_required) + if (!jform_vvvvvwxvwr_required) { updateFieldRequired('css_views',1); jQuery('#jform_css_views').removeAttr('required'); jQuery('#jform_css_views').removeAttr('aria-required'); jQuery('#jform_css_views').removeClass('required'); - jform_vvvvvwxvwq_required = true; + jform_vvvvvwxvwr_required = true; } } } @@ -213,26 +213,26 @@ function vvvvvwy(add_javascript_view_file_vvvvvwy) if (add_javascript_view_file_vvvvvwy == 1) { jQuery('#jform_javascript_view_file').closest('.control-group').show(); - if (jform_vvvvvwyvwr_required) + if (jform_vvvvvwyvws_required) { updateFieldRequired('javascript_view_file',0); jQuery('#jform_javascript_view_file').prop('required','required'); jQuery('#jform_javascript_view_file').attr('aria-required',true); jQuery('#jform_javascript_view_file').addClass('required'); - jform_vvvvvwyvwr_required = false; + jform_vvvvvwyvws_required = false; } } else { jQuery('#jform_javascript_view_file').closest('.control-group').hide(); - if (!jform_vvvvvwyvwr_required) + if (!jform_vvvvvwyvws_required) { updateFieldRequired('javascript_view_file',1); jQuery('#jform_javascript_view_file').removeAttr('required'); jQuery('#jform_javascript_view_file').removeAttr('aria-required'); jQuery('#jform_javascript_view_file').removeClass('required'); - jform_vvvvvwyvwr_required = true; + jform_vvvvvwyvws_required = true; } } } @@ -244,26 +244,26 @@ function vvvvvwz(add_javascript_views_file_vvvvvwz) if (add_javascript_views_file_vvvvvwz == 1) { jQuery('#jform_javascript_views_file').closest('.control-group').show(); - if (jform_vvvvvwzvws_required) + if (jform_vvvvvwzvwt_required) { updateFieldRequired('javascript_views_file',0); jQuery('#jform_javascript_views_file').prop('required','required'); jQuery('#jform_javascript_views_file').attr('aria-required',true); jQuery('#jform_javascript_views_file').addClass('required'); - jform_vvvvvwzvws_required = false; + jform_vvvvvwzvwt_required = false; } } else { jQuery('#jform_javascript_views_file').closest('.control-group').hide(); - if (!jform_vvvvvwzvws_required) + if (!jform_vvvvvwzvwt_required) { updateFieldRequired('javascript_views_file',1); jQuery('#jform_javascript_views_file').removeAttr('required'); jQuery('#jform_javascript_views_file').removeAttr('aria-required'); jQuery('#jform_javascript_views_file').removeClass('required'); - jform_vvvvvwzvws_required = true; + jform_vvvvvwzvwt_required = true; } } } @@ -275,26 +275,26 @@ function vvvvvxa(add_javascript_view_footer_vvvvvxa) if (add_javascript_view_footer_vvvvvxa == 1) { jQuery('#jform_javascript_view_footer').closest('.control-group').show(); - if (jform_vvvvvxavwt_required) + if (jform_vvvvvxavwu_required) { updateFieldRequired('javascript_view_footer',0); jQuery('#jform_javascript_view_footer').prop('required','required'); jQuery('#jform_javascript_view_footer').attr('aria-required',true); jQuery('#jform_javascript_view_footer').addClass('required'); - jform_vvvvvxavwt_required = false; + jform_vvvvvxavwu_required = false; } } else { jQuery('#jform_javascript_view_footer').closest('.control-group').hide(); - if (!jform_vvvvvxavwt_required) + if (!jform_vvvvvxavwu_required) { updateFieldRequired('javascript_view_footer',1); jQuery('#jform_javascript_view_footer').removeAttr('required'); jQuery('#jform_javascript_view_footer').removeAttr('aria-required'); jQuery('#jform_javascript_view_footer').removeClass('required'); - jform_vvvvvxavwt_required = true; + jform_vvvvvxavwu_required = true; } } } @@ -306,26 +306,26 @@ function vvvvvxb(add_javascript_views_footer_vvvvvxb) if (add_javascript_views_footer_vvvvvxb == 1) { jQuery('#jform_javascript_views_footer').closest('.control-group').show(); - if (jform_vvvvvxbvwu_required) + if (jform_vvvvvxbvwv_required) { updateFieldRequired('javascript_views_footer',0); jQuery('#jform_javascript_views_footer').prop('required','required'); jQuery('#jform_javascript_views_footer').attr('aria-required',true); jQuery('#jform_javascript_views_footer').addClass('required'); - jform_vvvvvxbvwu_required = false; + jform_vvvvvxbvwv_required = false; } } else { jQuery('#jform_javascript_views_footer').closest('.control-group').hide(); - if (!jform_vvvvvxbvwu_required) + if (!jform_vvvvvxbvwv_required) { updateFieldRequired('javascript_views_footer',1); jQuery('#jform_javascript_views_footer').removeAttr('required'); jQuery('#jform_javascript_views_footer').removeAttr('aria-required'); jQuery('#jform_javascript_views_footer').removeClass('required'); - jform_vvvvvxbvwu_required = true; + jform_vvvvvxbvwv_required = true; } } } @@ -338,13 +338,13 @@ function vvvvvxc(add_php_ajax_vvvvvxc) { jQuery('#jform_ajax_input').closest('.control-group').show(); jQuery('#jform_php_ajaxmethod').closest('.control-group').show(); - if (jform_vvvvvxcvwv_required) + if (jform_vvvvvxcvww_required) { updateFieldRequired('php_ajaxmethod',0); jQuery('#jform_php_ajaxmethod').prop('required','required'); jQuery('#jform_php_ajaxmethod').attr('aria-required',true); jQuery('#jform_php_ajaxmethod').addClass('required'); - jform_vvvvvxcvwv_required = false; + jform_vvvvvxcvww_required = false; } } @@ -352,13 +352,13 @@ function vvvvvxc(add_php_ajax_vvvvvxc) { jQuery('#jform_ajax_input').closest('.control-group').hide(); jQuery('#jform_php_ajaxmethod').closest('.control-group').hide(); - if (!jform_vvvvvxcvwv_required) + if (!jform_vvvvvxcvww_required) { updateFieldRequired('php_ajaxmethod',1); jQuery('#jform_php_ajaxmethod').removeAttr('required'); jQuery('#jform_php_ajaxmethod').removeAttr('aria-required'); jQuery('#jform_php_ajaxmethod').removeClass('required'); - jform_vvvvvxcvwv_required = true; + jform_vvvvvxcvww_required = true; } } } @@ -370,26 +370,26 @@ function vvvvvxd(add_php_getitem_vvvvvxd) if (add_php_getitem_vvvvvxd == 1) { jQuery('#jform_php_getitem').closest('.control-group').show(); - if (jform_vvvvvxdvww_required) + if (jform_vvvvvxdvwx_required) { updateFieldRequired('php_getitem',0); jQuery('#jform_php_getitem').prop('required','required'); jQuery('#jform_php_getitem').attr('aria-required',true); jQuery('#jform_php_getitem').addClass('required'); - jform_vvvvvxdvww_required = false; + jform_vvvvvxdvwx_required = false; } } else { jQuery('#jform_php_getitem').closest('.control-group').hide(); - if (!jform_vvvvvxdvww_required) + if (!jform_vvvvvxdvwx_required) { updateFieldRequired('php_getitem',1); jQuery('#jform_php_getitem').removeAttr('required'); jQuery('#jform_php_getitem').removeAttr('aria-required'); jQuery('#jform_php_getitem').removeClass('required'); - jform_vvvvvxdvww_required = true; + jform_vvvvvxdvwx_required = true; } } } @@ -401,26 +401,26 @@ function vvvvvxe(add_php_getitems_vvvvvxe) if (add_php_getitems_vvvvvxe == 1) { jQuery('#jform_php_getitems').closest('.control-group').show(); - if (jform_vvvvvxevwx_required) + if (jform_vvvvvxevwy_required) { updateFieldRequired('php_getitems',0); jQuery('#jform_php_getitems').prop('required','required'); jQuery('#jform_php_getitems').attr('aria-required',true); jQuery('#jform_php_getitems').addClass('required'); - jform_vvvvvxevwx_required = false; + jform_vvvvvxevwy_required = false; } } else { jQuery('#jform_php_getitems').closest('.control-group').hide(); - if (!jform_vvvvvxevwx_required) + if (!jform_vvvvvxevwy_required) { updateFieldRequired('php_getitems',1); jQuery('#jform_php_getitems').removeAttr('required'); jQuery('#jform_php_getitems').removeAttr('aria-required'); jQuery('#jform_php_getitems').removeClass('required'); - jform_vvvvvxevwx_required = true; + jform_vvvvvxevwy_required = true; } } } @@ -432,26 +432,26 @@ function vvvvvxf(add_php_getitems_after_all_vvvvvxf) if (add_php_getitems_after_all_vvvvvxf == 1) { jQuery('#jform_php_getitems_after_all').closest('.control-group').show(); - if (jform_vvvvvxfvwy_required) + if (jform_vvvvvxfvwz_required) { updateFieldRequired('php_getitems_after_all',0); jQuery('#jform_php_getitems_after_all').prop('required','required'); jQuery('#jform_php_getitems_after_all').attr('aria-required',true); jQuery('#jform_php_getitems_after_all').addClass('required'); - jform_vvvvvxfvwy_required = false; + jform_vvvvvxfvwz_required = false; } } else { jQuery('#jform_php_getitems_after_all').closest('.control-group').hide(); - if (!jform_vvvvvxfvwy_required) + if (!jform_vvvvvxfvwz_required) { updateFieldRequired('php_getitems_after_all',1); jQuery('#jform_php_getitems_after_all').removeAttr('required'); jQuery('#jform_php_getitems_after_all').removeAttr('aria-required'); jQuery('#jform_php_getitems_after_all').removeClass('required'); - jform_vvvvvxfvwy_required = true; + jform_vvvvvxfvwz_required = true; } } } @@ -463,26 +463,26 @@ function vvvvvxg(add_php_getlistquery_vvvvvxg) if (add_php_getlistquery_vvvvvxg == 1) { jQuery('#jform_php_getlistquery').closest('.control-group').show(); - if (jform_vvvvvxgvwz_required) + if (jform_vvvvvxgvxa_required) { updateFieldRequired('php_getlistquery',0); jQuery('#jform_php_getlistquery').prop('required','required'); jQuery('#jform_php_getlistquery').attr('aria-required',true); jQuery('#jform_php_getlistquery').addClass('required'); - jform_vvvvvxgvwz_required = false; + jform_vvvvvxgvxa_required = false; } } else { jQuery('#jform_php_getlistquery').closest('.control-group').hide(); - if (!jform_vvvvvxgvwz_required) + if (!jform_vvvvvxgvxa_required) { updateFieldRequired('php_getlistquery',1); jQuery('#jform_php_getlistquery').removeAttr('required'); jQuery('#jform_php_getlistquery').removeAttr('aria-required'); jQuery('#jform_php_getlistquery').removeClass('required'); - jform_vvvvvxgvwz_required = true; + jform_vvvvvxgvxa_required = true; } } } @@ -494,26 +494,26 @@ function vvvvvxh(add_php_save_vvvvvxh) if (add_php_save_vvvvvxh == 1) { jQuery('#jform_php_save').closest('.control-group').show(); - if (jform_vvvvvxhvxa_required) + if (jform_vvvvvxhvxb_required) { updateFieldRequired('php_save',0); jQuery('#jform_php_save').prop('required','required'); jQuery('#jform_php_save').attr('aria-required',true); jQuery('#jform_php_save').addClass('required'); - jform_vvvvvxhvxa_required = false; + jform_vvvvvxhvxb_required = false; } } else { jQuery('#jform_php_save').closest('.control-group').hide(); - if (!jform_vvvvvxhvxa_required) + if (!jform_vvvvvxhvxb_required) { updateFieldRequired('php_save',1); jQuery('#jform_php_save').removeAttr('required'); jQuery('#jform_php_save').removeAttr('aria-required'); jQuery('#jform_php_save').removeClass('required'); - jform_vvvvvxhvxa_required = true; + jform_vvvvvxhvxb_required = true; } } } @@ -525,26 +525,26 @@ function vvvvvxi(add_php_postsavehook_vvvvvxi) if (add_php_postsavehook_vvvvvxi == 1) { jQuery('#jform_php_postsavehook').closest('.control-group').show(); - if (jform_vvvvvxivxb_required) + if (jform_vvvvvxivxc_required) { updateFieldRequired('php_postsavehook',0); jQuery('#jform_php_postsavehook').prop('required','required'); jQuery('#jform_php_postsavehook').attr('aria-required',true); jQuery('#jform_php_postsavehook').addClass('required'); - jform_vvvvvxivxb_required = false; + jform_vvvvvxivxc_required = false; } } else { jQuery('#jform_php_postsavehook').closest('.control-group').hide(); - if (!jform_vvvvvxivxb_required) + if (!jform_vvvvvxivxc_required) { updateFieldRequired('php_postsavehook',1); jQuery('#jform_php_postsavehook').removeAttr('required'); jQuery('#jform_php_postsavehook').removeAttr('aria-required'); jQuery('#jform_php_postsavehook').removeClass('required'); - jform_vvvvvxivxb_required = true; + jform_vvvvvxivxc_required = true; } } } @@ -556,26 +556,26 @@ function vvvvvxj(add_php_allowedit_vvvvvxj) if (add_php_allowedit_vvvvvxj == 1) { jQuery('#jform_php_allowedit').closest('.control-group').show(); - if (jform_vvvvvxjvxc_required) + if (jform_vvvvvxjvxd_required) { updateFieldRequired('php_allowedit',0); jQuery('#jform_php_allowedit').prop('required','required'); jQuery('#jform_php_allowedit').attr('aria-required',true); jQuery('#jform_php_allowedit').addClass('required'); - jform_vvvvvxjvxc_required = false; + jform_vvvvvxjvxd_required = false; } } else { jQuery('#jform_php_allowedit').closest('.control-group').hide(); - if (!jform_vvvvvxjvxc_required) + if (!jform_vvvvvxjvxd_required) { updateFieldRequired('php_allowedit',1); jQuery('#jform_php_allowedit').removeAttr('required'); jQuery('#jform_php_allowedit').removeAttr('aria-required'); jQuery('#jform_php_allowedit').removeClass('required'); - jform_vvvvvxjvxc_required = true; + jform_vvvvvxjvxd_required = true; } } } @@ -587,26 +587,26 @@ function vvvvvxk(add_php_batchcopy_vvvvvxk) if (add_php_batchcopy_vvvvvxk == 1) { jQuery('#jform_php_batchcopy').closest('.control-group').show(); - if (jform_vvvvvxkvxd_required) + if (jform_vvvvvxkvxe_required) { updateFieldRequired('php_batchcopy',0); jQuery('#jform_php_batchcopy').prop('required','required'); jQuery('#jform_php_batchcopy').attr('aria-required',true); jQuery('#jform_php_batchcopy').addClass('required'); - jform_vvvvvxkvxd_required = false; + jform_vvvvvxkvxe_required = false; } } else { jQuery('#jform_php_batchcopy').closest('.control-group').hide(); - if (!jform_vvvvvxkvxd_required) + if (!jform_vvvvvxkvxe_required) { updateFieldRequired('php_batchcopy',1); jQuery('#jform_php_batchcopy').removeAttr('required'); jQuery('#jform_php_batchcopy').removeAttr('aria-required'); jQuery('#jform_php_batchcopy').removeClass('required'); - jform_vvvvvxkvxd_required = true; + jform_vvvvvxkvxe_required = true; } } } @@ -618,26 +618,26 @@ function vvvvvxl(add_php_batchmove_vvvvvxl) if (add_php_batchmove_vvvvvxl == 1) { jQuery('#jform_php_batchmove').closest('.control-group').show(); - if (jform_vvvvvxlvxe_required) + if (jform_vvvvvxlvxf_required) { updateFieldRequired('php_batchmove',0); jQuery('#jform_php_batchmove').prop('required','required'); jQuery('#jform_php_batchmove').attr('aria-required',true); jQuery('#jform_php_batchmove').addClass('required'); - jform_vvvvvxlvxe_required = false; + jform_vvvvvxlvxf_required = false; } } else { jQuery('#jform_php_batchmove').closest('.control-group').hide(); - if (!jform_vvvvvxlvxe_required) + if (!jform_vvvvvxlvxf_required) { updateFieldRequired('php_batchmove',1); jQuery('#jform_php_batchmove').removeAttr('required'); jQuery('#jform_php_batchmove').removeAttr('aria-required'); jQuery('#jform_php_batchmove').removeClass('required'); - jform_vvvvvxlvxe_required = true; + jform_vvvvvxlvxf_required = true; } } } @@ -649,26 +649,26 @@ function vvvvvxm(add_php_before_publish_vvvvvxm) if (add_php_before_publish_vvvvvxm == 1) { jQuery('#jform_php_before_publish').closest('.control-group').show(); - if (jform_vvvvvxmvxf_required) + if (jform_vvvvvxmvxg_required) { updateFieldRequired('php_before_publish',0); jQuery('#jform_php_before_publish').prop('required','required'); jQuery('#jform_php_before_publish').attr('aria-required',true); jQuery('#jform_php_before_publish').addClass('required'); - jform_vvvvvxmvxf_required = false; + jform_vvvvvxmvxg_required = false; } } else { jQuery('#jform_php_before_publish').closest('.control-group').hide(); - if (!jform_vvvvvxmvxf_required) + if (!jform_vvvvvxmvxg_required) { updateFieldRequired('php_before_publish',1); jQuery('#jform_php_before_publish').removeAttr('required'); jQuery('#jform_php_before_publish').removeAttr('aria-required'); jQuery('#jform_php_before_publish').removeClass('required'); - jform_vvvvvxmvxf_required = true; + jform_vvvvvxmvxg_required = true; } } } @@ -680,26 +680,26 @@ function vvvvvxn(add_php_after_publish_vvvvvxn) if (add_php_after_publish_vvvvvxn == 1) { jQuery('#jform_php_after_publish').closest('.control-group').show(); - if (jform_vvvvvxnvxg_required) + if (jform_vvvvvxnvxh_required) { updateFieldRequired('php_after_publish',0); jQuery('#jform_php_after_publish').prop('required','required'); jQuery('#jform_php_after_publish').attr('aria-required',true); jQuery('#jform_php_after_publish').addClass('required'); - jform_vvvvvxnvxg_required = false; + jform_vvvvvxnvxh_required = false; } } else { jQuery('#jform_php_after_publish').closest('.control-group').hide(); - if (!jform_vvvvvxnvxg_required) + if (!jform_vvvvvxnvxh_required) { updateFieldRequired('php_after_publish',1); jQuery('#jform_php_after_publish').removeAttr('required'); jQuery('#jform_php_after_publish').removeAttr('aria-required'); jQuery('#jform_php_after_publish').removeClass('required'); - jform_vvvvvxnvxg_required = true; + jform_vvvvvxnvxh_required = true; } } } @@ -711,26 +711,26 @@ function vvvvvxo(add_php_before_delete_vvvvvxo) if (add_php_before_delete_vvvvvxo == 1) { jQuery('#jform_php_before_delete').closest('.control-group').show(); - if (jform_vvvvvxovxh_required) + if (jform_vvvvvxovxi_required) { updateFieldRequired('php_before_delete',0); jQuery('#jform_php_before_delete').prop('required','required'); jQuery('#jform_php_before_delete').attr('aria-required',true); jQuery('#jform_php_before_delete').addClass('required'); - jform_vvvvvxovxh_required = false; + jform_vvvvvxovxi_required = false; } } else { jQuery('#jform_php_before_delete').closest('.control-group').hide(); - if (!jform_vvvvvxovxh_required) + if (!jform_vvvvvxovxi_required) { updateFieldRequired('php_before_delete',1); jQuery('#jform_php_before_delete').removeAttr('required'); jQuery('#jform_php_before_delete').removeAttr('aria-required'); jQuery('#jform_php_before_delete').removeClass('required'); - jform_vvvvvxovxh_required = true; + jform_vvvvvxovxi_required = true; } } } @@ -742,26 +742,26 @@ function vvvvvxp(add_php_after_delete_vvvvvxp) if (add_php_after_delete_vvvvvxp == 1) { jQuery('#jform_php_after_delete').closest('.control-group').show(); - if (jform_vvvvvxpvxi_required) + if (jform_vvvvvxpvxj_required) { updateFieldRequired('php_after_delete',0); jQuery('#jform_php_after_delete').prop('required','required'); jQuery('#jform_php_after_delete').attr('aria-required',true); jQuery('#jform_php_after_delete').addClass('required'); - jform_vvvvvxpvxi_required = false; + jform_vvvvvxpvxj_required = false; } } else { jQuery('#jform_php_after_delete').closest('.control-group').hide(); - if (!jform_vvvvvxpvxi_required) + if (!jform_vvvvvxpvxj_required) { updateFieldRequired('php_after_delete',1); jQuery('#jform_php_after_delete').removeAttr('required'); jQuery('#jform_php_after_delete').removeAttr('aria-required'); jQuery('#jform_php_after_delete').removeClass('required'); - jform_vvvvvxpvxi_required = true; + jform_vvvvvxpvxj_required = true; } } } @@ -773,26 +773,26 @@ function vvvvvxq(add_php_document_vvvvvxq) if (add_php_document_vvvvvxq == 1) { jQuery('#jform_php_document').closest('.control-group').show(); - if (jform_vvvvvxqvxj_required) + if (jform_vvvvvxqvxk_required) { updateFieldRequired('php_document',0); jQuery('#jform_php_document').prop('required','required'); jQuery('#jform_php_document').attr('aria-required',true); jQuery('#jform_php_document').addClass('required'); - jform_vvvvvxqvxj_required = false; + jform_vvvvvxqvxk_required = false; } } else { jQuery('#jform_php_document').closest('.control-group').hide(); - if (!jform_vvvvvxqvxj_required) + if (!jform_vvvvvxqvxk_required) { updateFieldRequired('php_document',1); jQuery('#jform_php_document').removeAttr('required'); jQuery('#jform_php_document').removeAttr('aria-required'); jQuery('#jform_php_document').removeClass('required'); - jform_vvvvvxqvxj_required = true; + jform_vvvvvxqvxk_required = true; } } } @@ -804,26 +804,26 @@ function vvvvvxr(add_sql_vvvvvxr) if (add_sql_vvvvvxr == 1) { jQuery('#jform_source').closest('.control-group').show(); - if (jform_vvvvvxrvxk_required) + if (jform_vvvvvxrvxl_required) { updateFieldRequired('source',0); jQuery('#jform_source').prop('required','required'); jQuery('#jform_source').attr('aria-required',true); jQuery('#jform_source').addClass('required'); - jform_vvvvvxrvxk_required = false; + jform_vvvvvxrvxl_required = false; } } else { jQuery('#jform_source').closest('.control-group').hide(); - if (!jform_vvvvvxrvxk_required) + if (!jform_vvvvvxrvxl_required) { updateFieldRequired('source',1); jQuery('#jform_source').removeAttr('required'); jQuery('#jform_source').removeAttr('aria-required'); jQuery('#jform_source').removeClass('required'); - jform_vvvvvxrvxk_required = true; + jform_vvvvvxrvxl_required = true; } } } @@ -835,26 +835,26 @@ function vvvvvxs(source_vvvvvxs,add_sql_vvvvvxs) if (source_vvvvvxs == 2 && add_sql_vvvvvxs == 1) { jQuery('#jform_sql').closest('.control-group').show(); - if (jform_vvvvvxsvxl_required) + if (jform_vvvvvxsvxm_required) { updateFieldRequired('sql',0); jQuery('#jform_sql').prop('required','required'); jQuery('#jform_sql').attr('aria-required',true); jQuery('#jform_sql').addClass('required'); - jform_vvvvvxsvxl_required = false; + jform_vvvvvxsvxm_required = false; } } else { jQuery('#jform_sql').closest('.control-group').hide(); - if (!jform_vvvvvxsvxl_required) + if (!jform_vvvvvxsvxm_required) { updateFieldRequired('sql',1); jQuery('#jform_sql').removeAttr('required'); jQuery('#jform_sql').removeAttr('aria-required'); jQuery('#jform_sql').removeClass('required'); - jform_vvvvvxsvxl_required = true; + jform_vvvvvxsvxm_required = true; } } } @@ -880,123 +880,123 @@ function vvvvvxw(add_custom_import_vvvvvxw) if (add_custom_import_vvvvvxw == 1) { jQuery('#jform_html_import_view').closest('.control-group').show(); - if (jform_vvvvvxwvxm_required) + if (jform_vvvvvxwvxn_required) { updateFieldRequired('html_import_view',0); jQuery('#jform_html_import_view').prop('required','required'); jQuery('#jform_html_import_view').attr('aria-required',true); jQuery('#jform_html_import_view').addClass('required'); - jform_vvvvvxwvxm_required = false; + jform_vvvvvxwvxn_required = false; } jQuery('.note_advanced_import').closest('.control-group').show(); jQuery('#jform_php_import_display').closest('.control-group').show(); - if (jform_vvvvvxwvxn_required) + if (jform_vvvvvxwvxo_required) { updateFieldRequired('php_import_display',0); jQuery('#jform_php_import_display').prop('required','required'); jQuery('#jform_php_import_display').attr('aria-required',true); jQuery('#jform_php_import_display').addClass('required'); - jform_vvvvvxwvxn_required = false; + jform_vvvvvxwvxo_required = false; } jQuery('#jform_php_import_ext').closest('.control-group').show(); - if (jform_vvvvvxwvxo_required) + if (jform_vvvvvxwvxp_required) { updateFieldRequired('php_import_ext',0); jQuery('#jform_php_import_ext').prop('required','required'); jQuery('#jform_php_import_ext').attr('aria-required',true); jQuery('#jform_php_import_ext').addClass('required'); - jform_vvvvvxwvxo_required = false; + jform_vvvvvxwvxp_required = false; } jQuery('#jform_php_import').closest('.control-group').show(); - if (jform_vvvvvxwvxp_required) + if (jform_vvvvvxwvxq_required) { updateFieldRequired('php_import',0); jQuery('#jform_php_import').prop('required','required'); jQuery('#jform_php_import').attr('aria-required',true); jQuery('#jform_php_import').addClass('required'); - jform_vvvvvxwvxp_required = false; + jform_vvvvvxwvxq_required = false; } jQuery('#jform_php_import_save').closest('.control-group').show(); - if (jform_vvvvvxwvxq_required) + if (jform_vvvvvxwvxr_required) { updateFieldRequired('php_import_save',0); jQuery('#jform_php_import_save').prop('required','required'); jQuery('#jform_php_import_save').attr('aria-required',true); jQuery('#jform_php_import_save').addClass('required'); - jform_vvvvvxwvxq_required = false; + jform_vvvvvxwvxr_required = false; } jQuery('#jform_php_import_setdata').closest('.control-group').show(); - if (jform_vvvvvxwvxr_required) + if (jform_vvvvvxwvxs_required) { updateFieldRequired('php_import_setdata',0); jQuery('#jform_php_import_setdata').prop('required','required'); jQuery('#jform_php_import_setdata').attr('aria-required',true); jQuery('#jform_php_import_setdata').addClass('required'); - jform_vvvvvxwvxr_required = false; + jform_vvvvvxwvxs_required = false; } } else { jQuery('#jform_html_import_view').closest('.control-group').hide(); - if (!jform_vvvvvxwvxm_required) + if (!jform_vvvvvxwvxn_required) { updateFieldRequired('html_import_view',1); jQuery('#jform_html_import_view').removeAttr('required'); jQuery('#jform_html_import_view').removeAttr('aria-required'); jQuery('#jform_html_import_view').removeClass('required'); - jform_vvvvvxwvxm_required = true; + jform_vvvvvxwvxn_required = true; } jQuery('.note_advanced_import').closest('.control-group').hide(); jQuery('#jform_php_import_display').closest('.control-group').hide(); - if (!jform_vvvvvxwvxn_required) + if (!jform_vvvvvxwvxo_required) { updateFieldRequired('php_import_display',1); jQuery('#jform_php_import_display').removeAttr('required'); jQuery('#jform_php_import_display').removeAttr('aria-required'); jQuery('#jform_php_import_display').removeClass('required'); - jform_vvvvvxwvxn_required = true; + jform_vvvvvxwvxo_required = true; } jQuery('#jform_php_import_ext').closest('.control-group').hide(); - if (!jform_vvvvvxwvxo_required) + if (!jform_vvvvvxwvxp_required) { updateFieldRequired('php_import_ext',1); jQuery('#jform_php_import_ext').removeAttr('required'); jQuery('#jform_php_import_ext').removeAttr('aria-required'); jQuery('#jform_php_import_ext').removeClass('required'); - jform_vvvvvxwvxo_required = true; + jform_vvvvvxwvxp_required = true; } jQuery('#jform_php_import').closest('.control-group').hide(); - if (!jform_vvvvvxwvxp_required) + if (!jform_vvvvvxwvxq_required) { updateFieldRequired('php_import',1); jQuery('#jform_php_import').removeAttr('required'); jQuery('#jform_php_import').removeAttr('aria-required'); jQuery('#jform_php_import').removeClass('required'); - jform_vvvvvxwvxp_required = true; + jform_vvvvvxwvxq_required = true; } jQuery('#jform_php_import_save').closest('.control-group').hide(); - if (!jform_vvvvvxwvxq_required) + if (!jform_vvvvvxwvxr_required) { updateFieldRequired('php_import_save',1); jQuery('#jform_php_import_save').removeAttr('required'); jQuery('#jform_php_import_save').removeAttr('aria-required'); jQuery('#jform_php_import_save').removeClass('required'); - jform_vvvvvxwvxq_required = true; + jform_vvvvvxwvxr_required = true; } jQuery('#jform_php_import_setdata').closest('.control-group').hide(); - if (!jform_vvvvvxwvxr_required) + if (!jform_vvvvvxwvxs_required) { updateFieldRequired('php_import_setdata',1); jQuery('#jform_php_import_setdata').removeAttr('required'); jQuery('#jform_php_import_setdata').removeAttr('aria-required'); jQuery('#jform_php_import_setdata').removeClass('required'); - jform_vvvvvxwvxr_required = true; + jform_vvvvvxwvxs_required = true; } } } @@ -1023,43 +1023,43 @@ function vvvvvxy(add_custom_button_vvvvvxy) { jQuery('#jform_custom_button').closest('.control-group').show(); jQuery('#jform_php_controller').closest('.control-group').show(); - if (jform_vvvvvxyvxs_required) + if (jform_vvvvvxyvxt_required) { updateFieldRequired('php_controller',0); jQuery('#jform_php_controller').prop('required','required'); jQuery('#jform_php_controller').attr('aria-required',true); jQuery('#jform_php_controller').addClass('required'); - jform_vvvvvxyvxs_required = false; + jform_vvvvvxyvxt_required = false; } jQuery('#jform_php_controller_list').closest('.control-group').show(); - if (jform_vvvvvxyvxt_required) + if (jform_vvvvvxyvxu_required) { updateFieldRequired('php_controller_list',0); jQuery('#jform_php_controller_list').prop('required','required'); jQuery('#jform_php_controller_list').attr('aria-required',true); jQuery('#jform_php_controller_list').addClass('required'); - jform_vvvvvxyvxt_required = false; + jform_vvvvvxyvxu_required = false; } jQuery('#jform_php_model').closest('.control-group').show(); - if (jform_vvvvvxyvxu_required) + if (jform_vvvvvxyvxv_required) { updateFieldRequired('php_model',0); jQuery('#jform_php_model').prop('required','required'); jQuery('#jform_php_model').attr('aria-required',true); jQuery('#jform_php_model').addClass('required'); - jform_vvvvvxyvxu_required = false; + jform_vvvvvxyvxv_required = false; } jQuery('#jform_php_model_list').closest('.control-group').show(); - if (jform_vvvvvxyvxv_required) + if (jform_vvvvvxyvxw_required) { updateFieldRequired('php_model_list',0); jQuery('#jform_php_model_list').prop('required','required'); jQuery('#jform_php_model_list').attr('aria-required',true); jQuery('#jform_php_model_list').addClass('required'); - jform_vvvvvxyvxv_required = false; + jform_vvvvvxyvxw_required = false; } } @@ -1067,40 +1067,40 @@ function vvvvvxy(add_custom_button_vvvvvxy) { jQuery('#jform_custom_button').closest('.control-group').hide(); jQuery('#jform_php_controller').closest('.control-group').hide(); - if (!jform_vvvvvxyvxs_required) + if (!jform_vvvvvxyvxt_required) { updateFieldRequired('php_controller',1); jQuery('#jform_php_controller').removeAttr('required'); jQuery('#jform_php_controller').removeAttr('aria-required'); jQuery('#jform_php_controller').removeClass('required'); - jform_vvvvvxyvxs_required = true; + jform_vvvvvxyvxt_required = true; } jQuery('#jform_php_controller_list').closest('.control-group').hide(); - if (!jform_vvvvvxyvxt_required) + if (!jform_vvvvvxyvxu_required) { updateFieldRequired('php_controller_list',1); jQuery('#jform_php_controller_list').removeAttr('required'); jQuery('#jform_php_controller_list').removeAttr('aria-required'); jQuery('#jform_php_controller_list').removeClass('required'); - jform_vvvvvxyvxt_required = true; + jform_vvvvvxyvxu_required = true; } jQuery('#jform_php_model').closest('.control-group').hide(); - if (!jform_vvvvvxyvxu_required) + if (!jform_vvvvvxyvxv_required) { updateFieldRequired('php_model',1); jQuery('#jform_php_model').removeAttr('required'); jQuery('#jform_php_model').removeAttr('aria-required'); jQuery('#jform_php_model').removeClass('required'); - jform_vvvvvxyvxu_required = true; + jform_vvvvvxyvxv_required = true; } jQuery('#jform_php_model_list').closest('.control-group').hide(); - if (!jform_vvvvvxyvxv_required) + if (!jform_vvvvvxyvxw_required) { updateFieldRequired('php_model_list',1); jQuery('#jform_php_model_list').removeAttr('required'); jQuery('#jform_php_model_list').removeAttr('aria-required'); jQuery('#jform_php_model_list').removeClass('required'); - jform_vvvvvxyvxv_required = true; + jform_vvvvvxyvxw_required = true; } } } diff --git a/admin/models/forms/custom_admin_view.js b/admin/models/forms/custom_admin_view.js index 7fa707405..7ef2bc548 100644 --- a/admin/models/forms/custom_admin_view.js +++ b/admin/models/forms/custom_admin_view.js @@ -23,15 +23,15 @@ /-----------------------------------------------------------------------------------------------------------------------------*/ // Some Global Values -jform_vvvvvxzvxy_required = false; -jform_vvvvvyavxz_required = false; -jform_vvvvvybvya_required = false; -jform_vvvvvycvyb_required = false; -jform_vvvvvydvyc_required = false; -jform_vvvvvyevyd_required = false; -jform_vvvvvyfvye_required = false; +jform_vvvvvxzvxz_required = false; +jform_vvvvvyavya_required = false; +jform_vvvvvybvyb_required = false; +jform_vvvvvycvyc_required = false; +jform_vvvvvydvyd_required = false; +jform_vvvvvyevye_required = false; jform_vvvvvyfvyf_required = false; -jform_vvvvvygvyg_required = false; +jform_vvvvvyfvyg_required = false; +jform_vvvvvygvyh_required = false; // Initial Script jQuery(document).ready(function() @@ -68,26 +68,26 @@ function vvvvvxz(add_php_view_vvvvvxz) if (add_php_view_vvvvvxz == 1) { jQuery('#jform_php_view').closest('.control-group').show(); - if (jform_vvvvvxzvxy_required) + if (jform_vvvvvxzvxz_required) { updateFieldRequired('php_view',0); jQuery('#jform_php_view').prop('required','required'); jQuery('#jform_php_view').attr('aria-required',true); jQuery('#jform_php_view').addClass('required'); - jform_vvvvvxzvxy_required = false; + jform_vvvvvxzvxz_required = false; } } else { jQuery('#jform_php_view').closest('.control-group').hide(); - if (!jform_vvvvvxzvxy_required) + if (!jform_vvvvvxzvxz_required) { updateFieldRequired('php_view',1); jQuery('#jform_php_view').removeAttr('required'); jQuery('#jform_php_view').removeAttr('aria-required'); jQuery('#jform_php_view').removeClass('required'); - jform_vvvvvxzvxy_required = true; + jform_vvvvvxzvxz_required = true; } } } @@ -99,26 +99,26 @@ function vvvvvya(add_php_jview_display_vvvvvya) if (add_php_jview_display_vvvvvya == 1) { jQuery('#jform_php_jview_display').closest('.control-group').show(); - if (jform_vvvvvyavxz_required) + if (jform_vvvvvyavya_required) { updateFieldRequired('php_jview_display',0); jQuery('#jform_php_jview_display').prop('required','required'); jQuery('#jform_php_jview_display').attr('aria-required',true); jQuery('#jform_php_jview_display').addClass('required'); - jform_vvvvvyavxz_required = false; + jform_vvvvvyavya_required = false; } } else { jQuery('#jform_php_jview_display').closest('.control-group').hide(); - if (!jform_vvvvvyavxz_required) + if (!jform_vvvvvyavya_required) { updateFieldRequired('php_jview_display',1); jQuery('#jform_php_jview_display').removeAttr('required'); jQuery('#jform_php_jview_display').removeAttr('aria-required'); jQuery('#jform_php_jview_display').removeClass('required'); - jform_vvvvvyavxz_required = true; + jform_vvvvvyavya_required = true; } } } @@ -130,26 +130,26 @@ function vvvvvyb(add_php_jview_vvvvvyb) if (add_php_jview_vvvvvyb == 1) { jQuery('#jform_php_jview').closest('.control-group').show(); - if (jform_vvvvvybvya_required) + if (jform_vvvvvybvyb_required) { updateFieldRequired('php_jview',0); jQuery('#jform_php_jview').prop('required','required'); jQuery('#jform_php_jview').attr('aria-required',true); jQuery('#jform_php_jview').addClass('required'); - jform_vvvvvybvya_required = false; + jform_vvvvvybvyb_required = false; } } else { jQuery('#jform_php_jview').closest('.control-group').hide(); - if (!jform_vvvvvybvya_required) + if (!jform_vvvvvybvyb_required) { updateFieldRequired('php_jview',1); jQuery('#jform_php_jview').removeAttr('required'); jQuery('#jform_php_jview').removeAttr('aria-required'); jQuery('#jform_php_jview').removeClass('required'); - jform_vvvvvybvya_required = true; + jform_vvvvvybvyb_required = true; } } } @@ -161,26 +161,26 @@ function vvvvvyc(add_php_document_vvvvvyc) if (add_php_document_vvvvvyc == 1) { jQuery('#jform_php_document').closest('.control-group').show(); - if (jform_vvvvvycvyb_required) + if (jform_vvvvvycvyc_required) { updateFieldRequired('php_document',0); jQuery('#jform_php_document').prop('required','required'); jQuery('#jform_php_document').attr('aria-required',true); jQuery('#jform_php_document').addClass('required'); - jform_vvvvvycvyb_required = false; + jform_vvvvvycvyc_required = false; } } else { jQuery('#jform_php_document').closest('.control-group').hide(); - if (!jform_vvvvvycvyb_required) + if (!jform_vvvvvycvyc_required) { updateFieldRequired('php_document',1); jQuery('#jform_php_document').removeAttr('required'); jQuery('#jform_php_document').removeAttr('aria-required'); jQuery('#jform_php_document').removeClass('required'); - jform_vvvvvycvyb_required = true; + jform_vvvvvycvyc_required = true; } } } @@ -192,26 +192,26 @@ function vvvvvyd(add_css_document_vvvvvyd) if (add_css_document_vvvvvyd == 1) { jQuery('#jform_css_document').closest('.control-group').show(); - if (jform_vvvvvydvyc_required) + if (jform_vvvvvydvyd_required) { updateFieldRequired('css_document',0); jQuery('#jform_css_document').prop('required','required'); jQuery('#jform_css_document').attr('aria-required',true); jQuery('#jform_css_document').addClass('required'); - jform_vvvvvydvyc_required = false; + jform_vvvvvydvyd_required = false; } } else { jQuery('#jform_css_document').closest('.control-group').hide(); - if (!jform_vvvvvydvyc_required) + if (!jform_vvvvvydvyd_required) { updateFieldRequired('css_document',1); jQuery('#jform_css_document').removeAttr('required'); jQuery('#jform_css_document').removeAttr('aria-required'); jQuery('#jform_css_document').removeClass('required'); - jform_vvvvvydvyc_required = true; + jform_vvvvvydvyd_required = true; } } } @@ -223,26 +223,26 @@ function vvvvvye(add_js_document_vvvvvye) if (add_js_document_vvvvvye == 1) { jQuery('#jform_js_document').closest('.control-group').show(); - if (jform_vvvvvyevyd_required) + if (jform_vvvvvyevye_required) { updateFieldRequired('js_document',0); jQuery('#jform_js_document').prop('required','required'); jQuery('#jform_js_document').attr('aria-required',true); jQuery('#jform_js_document').addClass('required'); - jform_vvvvvyevyd_required = false; + jform_vvvvvyevye_required = false; } } else { jQuery('#jform_js_document').closest('.control-group').hide(); - if (!jform_vvvvvyevyd_required) + if (!jform_vvvvvyevye_required) { updateFieldRequired('js_document',1); jQuery('#jform_js_document').removeAttr('required'); jQuery('#jform_js_document').removeAttr('aria-required'); jQuery('#jform_js_document').removeClass('required'); - jform_vvvvvyevyd_required = true; + jform_vvvvvyevye_required = true; } } } @@ -255,23 +255,23 @@ function vvvvvyf(add_custom_button_vvvvvyf) { jQuery('#jform_custom_button').closest('.control-group').show(); jQuery('#jform_php_controller').closest('.control-group').show(); - if (jform_vvvvvyfvye_required) + if (jform_vvvvvyfvyf_required) { updateFieldRequired('php_controller',0); jQuery('#jform_php_controller').prop('required','required'); jQuery('#jform_php_controller').attr('aria-required',true); jQuery('#jform_php_controller').addClass('required'); - jform_vvvvvyfvye_required = false; + jform_vvvvvyfvyf_required = false; } jQuery('#jform_php_model').closest('.control-group').show(); - if (jform_vvvvvyfvyf_required) + if (jform_vvvvvyfvyg_required) { updateFieldRequired('php_model',0); jQuery('#jform_php_model').prop('required','required'); jQuery('#jform_php_model').attr('aria-required',true); jQuery('#jform_php_model').addClass('required'); - jform_vvvvvyfvyf_required = false; + jform_vvvvvyfvyg_required = false; } } @@ -279,22 +279,22 @@ function vvvvvyf(add_custom_button_vvvvvyf) { jQuery('#jform_custom_button').closest('.control-group').hide(); jQuery('#jform_php_controller').closest('.control-group').hide(); - if (!jform_vvvvvyfvye_required) + if (!jform_vvvvvyfvyf_required) { updateFieldRequired('php_controller',1); jQuery('#jform_php_controller').removeAttr('required'); jQuery('#jform_php_controller').removeAttr('aria-required'); jQuery('#jform_php_controller').removeClass('required'); - jform_vvvvvyfvye_required = true; + jform_vvvvvyfvyf_required = true; } jQuery('#jform_php_model').closest('.control-group').hide(); - if (!jform_vvvvvyfvyf_required) + if (!jform_vvvvvyfvyg_required) { updateFieldRequired('php_model',1); jQuery('#jform_php_model').removeAttr('required'); jQuery('#jform_php_model').removeAttr('aria-required'); jQuery('#jform_php_model').removeClass('required'); - jform_vvvvvyfvyf_required = true; + jform_vvvvvyfvyg_required = true; } } } @@ -306,26 +306,26 @@ function vvvvvyg(add_css_vvvvvyg) if (add_css_vvvvvyg == 1) { jQuery('#jform_css').closest('.control-group').show(); - if (jform_vvvvvygvyg_required) + if (jform_vvvvvygvyh_required) { updateFieldRequired('css',0); jQuery('#jform_css').prop('required','required'); jQuery('#jform_css').attr('aria-required',true); jQuery('#jform_css').addClass('required'); - jform_vvvvvygvyg_required = false; + jform_vvvvvygvyh_required = false; } } else { jQuery('#jform_css').closest('.control-group').hide(); - if (!jform_vvvvvygvyg_required) + if (!jform_vvvvvygvyh_required) { updateFieldRequired('css',1); jQuery('#jform_css').removeAttr('required'); jQuery('#jform_css').removeAttr('aria-required'); jQuery('#jform_css').removeClass('required'); - jform_vvvvvygvyg_required = true; + jform_vvvvvygvyh_required = true; } } } diff --git a/admin/models/forms/custom_code.js b/admin/models/forms/custom_code.js index c7440f10f..2792477c1 100644 --- a/admin/models/forms/custom_code.js +++ b/admin/models/forms/custom_code.js @@ -9,8 +9,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 81 of this MVC - @build 1st March, 2017 + @version @update number 82 of this MVC + @build 3rd April, 2017 @created 11th October, 2016 @package Component Builder @subpackage custom_code.js @@ -23,10 +23,10 @@ /-----------------------------------------------------------------------------------------------------------------------------*/ // Some Global Values -jform_vvvvvzovzn_required = false; -jform_vvvvvzpvzo_required = false; +jform_vvvvvzovzo_required = false; jform_vvvvvzpvzp_required = false; jform_vvvvvzpvzq_required = false; +jform_vvvvvzpvzr_required = false; // Initial Script jQuery(document).ready(function() @@ -53,13 +53,13 @@ function vvvvvzo(target_vvvvvzo) if (target_vvvvvzo == 2) { jQuery('#jform_function_name').closest('.control-group').show(); - if (jform_vvvvvzovzn_required) + if (jform_vvvvvzovzo_required) { updateFieldRequired('function_name',0); jQuery('#jform_function_name').prop('required','required'); jQuery('#jform_function_name').attr('aria-required',true); jQuery('#jform_function_name').addClass('required'); - jform_vvvvvzovzn_required = false; + jform_vvvvvzovzo_required = false; } jQuery('.note_jcb_placeholder').closest('.control-group').show(); @@ -68,13 +68,13 @@ function vvvvvzo(target_vvvvvzo) else { jQuery('#jform_function_name').closest('.control-group').hide(); - if (!jform_vvvvvzovzn_required) + if (!jform_vvvvvzovzo_required) { updateFieldRequired('function_name',1); jQuery('#jform_function_name').removeAttr('required'); jQuery('#jform_function_name').removeAttr('aria-required'); jQuery('#jform_function_name').removeClass('required'); - jform_vvvvvzovzn_required = true; + jform_vvvvvzovzo_required = true; } jQuery('.note_jcb_placeholder').closest('.control-group').hide(); jQuery('#jform_system_name').closest('.control-group').hide(); @@ -88,70 +88,70 @@ function vvvvvzp(target_vvvvvzp) if (target_vvvvvzp == 1) { jQuery('#jform_component').closest('.control-group').show(); - if (jform_vvvvvzpvzo_required) + if (jform_vvvvvzpvzp_required) { updateFieldRequired('component',0); jQuery('#jform_component').prop('required','required'); jQuery('#jform_component').attr('aria-required',true); jQuery('#jform_component').addClass('required'); - jform_vvvvvzpvzo_required = false; + jform_vvvvvzpvzp_required = false; } jQuery('#jform_path').closest('.control-group').show(); - if (jform_vvvvvzpvzp_required) + if (jform_vvvvvzpvzq_required) { updateFieldRequired('path',0); jQuery('#jform_path').prop('required','required'); jQuery('#jform_path').attr('aria-required',true); jQuery('#jform_path').addClass('required'); - jform_vvvvvzpvzp_required = false; + jform_vvvvvzpvzq_required = false; } jQuery('#jform_from_line').closest('.control-group').show(); jQuery('#jform_hashtarget').closest('.control-group').show(); jQuery('#jform_to_line').closest('.control-group').show(); jQuery('#jform_type').closest('.control-group').show(); - if (jform_vvvvvzpvzq_required) + if (jform_vvvvvzpvzr_required) { updateFieldRequired('type',0); jQuery('#jform_type').prop('required','required'); jQuery('#jform_type').attr('aria-required',true); jQuery('#jform_type').addClass('required'); - jform_vvvvvzpvzq_required = false; + jform_vvvvvzpvzr_required = false; } } else { jQuery('#jform_component').closest('.control-group').hide(); - if (!jform_vvvvvzpvzo_required) + if (!jform_vvvvvzpvzp_required) { updateFieldRequired('component',1); jQuery('#jform_component').removeAttr('required'); jQuery('#jform_component').removeAttr('aria-required'); jQuery('#jform_component').removeClass('required'); - jform_vvvvvzpvzo_required = true; + jform_vvvvvzpvzp_required = true; } jQuery('#jform_path').closest('.control-group').hide(); - if (!jform_vvvvvzpvzp_required) + if (!jform_vvvvvzpvzq_required) { updateFieldRequired('path',1); jQuery('#jform_path').removeAttr('required'); jQuery('#jform_path').removeAttr('aria-required'); jQuery('#jform_path').removeClass('required'); - jform_vvvvvzpvzp_required = true; + jform_vvvvvzpvzq_required = true; } jQuery('#jform_from_line').closest('.control-group').hide(); jQuery('#jform_hashtarget').closest('.control-group').hide(); jQuery('#jform_to_line').closest('.control-group').hide(); jQuery('#jform_type').closest('.control-group').hide(); - if (!jform_vvvvvzpvzq_required) + if (!jform_vvvvvzpvzr_required) { updateFieldRequired('type',1); jQuery('#jform_type').removeAttr('required'); jQuery('#jform_type').removeAttr('aria-required'); jQuery('#jform_type').removeClass('required'); - jform_vvvvvzpvzq_required = true; + jform_vvvvvzpvzr_required = true; } } } diff --git a/admin/models/forms/custom_code.xml b/admin/models/forms/custom_code.xml index 4a04184ed..2957cb13a 100644 --- a/admin/models/forms/custom_code.xml +++ b/admin/models/forms/custom_code.xml @@ -159,43 +159,33 @@
- + - + - - - - - - - + + + + + + + - - + + diff --git a/admin/models/forms/dynamic_get.js b/admin/models/forms/dynamic_get.js index ddd825e8a..cf912dc49 100644 --- a/admin/models/forms/dynamic_get.js +++ b/admin/models/forms/dynamic_get.js @@ -23,24 +23,24 @@ /-----------------------------------------------------------------------------------------------------------------------------*/ // Some Global Values -jform_vvvvvysvyv_required = false; -jform_vvvvvytvyw_required = false; -jform_vvvvvyuvyx_required = false; -jform_vvvvvyvvyy_required = false; -jform_vvvvvywvyz_required = false; -jform_vvvvvyxvza_required = false; -jform_vvvvvzcvzb_required = false; -jform_vvvvvzevzc_required = false; -jform_vvvvvzfvzd_required = false; -jform_vvvvvzhvze_required = false; +jform_vvvvvysvyw_required = false; +jform_vvvvvytvyx_required = false; +jform_vvvvvyuvyy_required = false; +jform_vvvvvyvvyz_required = false; +jform_vvvvvywvza_required = false; +jform_vvvvvyxvzb_required = false; +jform_vvvvvzcvzc_required = false; +jform_vvvvvzevzd_required = false; +jform_vvvvvzfvze_required = false; jform_vvvvvzhvzf_required = false; -jform_vvvvvzivzg_required = false; -jform_vvvvvzjvzh_required = false; -jform_vvvvvzkvzi_required = false; -jform_vvvvvzmvzj_required = false; +jform_vvvvvzhvzg_required = false; +jform_vvvvvzivzh_required = false; +jform_vvvvvzjvzi_required = false; +jform_vvvvvzkvzj_required = false; jform_vvvvvzmvzk_required = false; jform_vvvvvzmvzl_required = false; -jform_vvvvvznvzm_required = false; +jform_vvvvvzmvzm_required = false; +jform_vvvvvznvzn_required = false; // Initial Script jQuery(document).ready(function() @@ -127,26 +127,26 @@ function vvvvvys(gettype_vvvvvys) if (gettype) { jQuery('#jform_getcustom').closest('.control-group').show(); - if (jform_vvvvvysvyv_required) + if (jform_vvvvvysvyw_required) { updateFieldRequired('getcustom',0); jQuery('#jform_getcustom').prop('required','required'); jQuery('#jform_getcustom').attr('aria-required',true); jQuery('#jform_getcustom').addClass('required'); - jform_vvvvvysvyv_required = false; + jform_vvvvvysvyw_required = false; } } else { jQuery('#jform_getcustom').closest('.control-group').hide(); - if (!jform_vvvvvysvyv_required) + if (!jform_vvvvvysvyw_required) { updateFieldRequired('getcustom',1); jQuery('#jform_getcustom').removeAttr('required'); jQuery('#jform_getcustom').removeAttr('aria-required'); jQuery('#jform_getcustom').removeClass('required'); - jform_vvvvvysvyv_required = true; + jform_vvvvvysvyw_required = true; } } } @@ -182,26 +182,26 @@ function vvvvvyt(main_source_vvvvvyt) if (main_source) { jQuery('#jform_view_table_main').closest('.control-group').show(); - if (jform_vvvvvytvyw_required) + if (jform_vvvvvytvyx_required) { updateFieldRequired('view_table_main',0); jQuery('#jform_view_table_main').prop('required','required'); jQuery('#jform_view_table_main').attr('aria-required',true); jQuery('#jform_view_table_main').addClass('required'); - jform_vvvvvytvyw_required = false; + jform_vvvvvytvyx_required = false; } } else { jQuery('#jform_view_table_main').closest('.control-group').hide(); - if (!jform_vvvvvytvyw_required) + if (!jform_vvvvvytvyx_required) { updateFieldRequired('view_table_main',1); jQuery('#jform_view_table_main').removeAttr('required'); jQuery('#jform_view_table_main').removeAttr('aria-required'); jQuery('#jform_view_table_main').removeClass('required'); - jform_vvvvvytvyw_required = true; + jform_vvvvvytvyx_required = true; } } } @@ -237,26 +237,26 @@ function vvvvvyu(main_source_vvvvvyu) if (main_source) { jQuery('#jform_view_selection').closest('.control-group').show(); - if (jform_vvvvvyuvyx_required) + if (jform_vvvvvyuvyy_required) { updateFieldRequired('view_selection',0); jQuery('#jform_view_selection').prop('required','required'); jQuery('#jform_view_selection').attr('aria-required',true); jQuery('#jform_view_selection').addClass('required'); - jform_vvvvvyuvyx_required = false; + jform_vvvvvyuvyy_required = false; } } else { jQuery('#jform_view_selection').closest('.control-group').hide(); - if (!jform_vvvvvyuvyx_required) + if (!jform_vvvvvyuvyy_required) { updateFieldRequired('view_selection',1); jQuery('#jform_view_selection').removeAttr('required'); jQuery('#jform_view_selection').removeAttr('aria-required'); jQuery('#jform_view_selection').removeClass('required'); - jform_vvvvvyuvyx_required = true; + jform_vvvvvyuvyy_required = true; } } } @@ -292,26 +292,26 @@ function vvvvvyv(main_source_vvvvvyv) if (main_source) { jQuery('#jform_db_table_main').closest('.control-group').show(); - if (jform_vvvvvyvvyy_required) + if (jform_vvvvvyvvyz_required) { updateFieldRequired('db_table_main',0); jQuery('#jform_db_table_main').prop('required','required'); jQuery('#jform_db_table_main').attr('aria-required',true); jQuery('#jform_db_table_main').addClass('required'); - jform_vvvvvyvvyy_required = false; + jform_vvvvvyvvyz_required = false; } } else { jQuery('#jform_db_table_main').closest('.control-group').hide(); - if (!jform_vvvvvyvvyy_required) + if (!jform_vvvvvyvvyz_required) { updateFieldRequired('db_table_main',1); jQuery('#jform_db_table_main').removeAttr('required'); jQuery('#jform_db_table_main').removeAttr('aria-required'); jQuery('#jform_db_table_main').removeClass('required'); - jform_vvvvvyvvyy_required = true; + jform_vvvvvyvvyz_required = true; } } } @@ -347,26 +347,26 @@ function vvvvvyw(main_source_vvvvvyw) if (main_source) { jQuery('#jform_db_selection').closest('.control-group').show(); - if (jform_vvvvvywvyz_required) + if (jform_vvvvvywvza_required) { updateFieldRequired('db_selection',0); jQuery('#jform_db_selection').prop('required','required'); jQuery('#jform_db_selection').attr('aria-required',true); jQuery('#jform_db_selection').addClass('required'); - jform_vvvvvywvyz_required = false; + jform_vvvvvywvza_required = false; } } else { jQuery('#jform_db_selection').closest('.control-group').hide(); - if (!jform_vvvvvywvyz_required) + if (!jform_vvvvvywvza_required) { updateFieldRequired('db_selection',1); jQuery('#jform_db_selection').removeAttr('required'); jQuery('#jform_db_selection').removeAttr('aria-required'); jQuery('#jform_db_selection').removeClass('required'); - jform_vvvvvywvyz_required = true; + jform_vvvvvywvza_required = true; } } } @@ -389,26 +389,26 @@ function vvvvvyx(addcalculation_vvvvvyx) if (addcalculation_vvvvvyx == 1) { jQuery('#jform_php_calculation').closest('.control-group').show(); - if (jform_vvvvvyxvza_required) + if (jform_vvvvvyxvzb_required) { updateFieldRequired('php_calculation',0); jQuery('#jform_php_calculation').prop('required','required'); jQuery('#jform_php_calculation').attr('aria-required',true); jQuery('#jform_php_calculation').addClass('required'); - jform_vvvvvyxvza_required = false; + jform_vvvvvyxvzb_required = false; } } else { jQuery('#jform_php_calculation').closest('.control-group').hide(); - if (!jform_vvvvvyxvza_required) + if (!jform_vvvvvyxvzb_required) { updateFieldRequired('php_calculation',1); jQuery('#jform_php_calculation').removeAttr('required'); jQuery('#jform_php_calculation').removeAttr('aria-required'); jQuery('#jform_php_calculation').removeClass('required'); - jform_vvvvvyxvza_required = true; + jform_vvvvvyxvzb_required = true; } } } @@ -555,26 +555,26 @@ function vvvvvzc(main_source_vvvvvzc) if (main_source) { jQuery('#jform_php_custom_get').closest('.control-group').show(); - if (jform_vvvvvzcvzb_required) + if (jform_vvvvvzcvzc_required) { updateFieldRequired('php_custom_get',0); jQuery('#jform_php_custom_get').prop('required','required'); jQuery('#jform_php_custom_get').attr('aria-required',true); jQuery('#jform_php_custom_get').addClass('required'); - jform_vvvvvzcvzb_required = false; + jform_vvvvvzcvzc_required = false; } } else { jQuery('#jform_php_custom_get').closest('.control-group').hide(); - if (!jform_vvvvvzcvzb_required) + if (!jform_vvvvvzcvzc_required) { updateFieldRequired('php_custom_get',1); jQuery('#jform_php_custom_get').removeAttr('required'); jQuery('#jform_php_custom_get').removeAttr('aria-required'); jQuery('#jform_php_custom_get').removeClass('required'); - jform_vvvvvzcvzb_required = true; + jform_vvvvvzcvzc_required = true; } } } @@ -668,26 +668,26 @@ function vvvvvze(add_php_before_getitem_vvvvvze,gettype_vvvvvze) if (add_php_before_getitem && gettype) { jQuery('#jform_php_before_getitem').closest('.control-group').show(); - if (jform_vvvvvzevzc_required) + if (jform_vvvvvzevzd_required) { updateFieldRequired('php_before_getitem',0); jQuery('#jform_php_before_getitem').prop('required','required'); jQuery('#jform_php_before_getitem').attr('aria-required',true); jQuery('#jform_php_before_getitem').addClass('required'); - jform_vvvvvzevzc_required = false; + jform_vvvvvzevzd_required = false; } } else { jQuery('#jform_php_before_getitem').closest('.control-group').hide(); - if (!jform_vvvvvzevzc_required) + if (!jform_vvvvvzevzd_required) { updateFieldRequired('php_before_getitem',1); jQuery('#jform_php_before_getitem').removeAttr('required'); jQuery('#jform_php_before_getitem').removeAttr('aria-required'); jQuery('#jform_php_before_getitem').removeClass('required'); - jform_vvvvvzevzc_required = true; + jform_vvvvvzevzd_required = true; } } } @@ -746,26 +746,26 @@ function vvvvvzf(add_php_after_getitem_vvvvvzf,gettype_vvvvvzf) if (add_php_after_getitem && gettype) { jQuery('#jform_php_after_getitem').closest('.control-group').show(); - if (jform_vvvvvzfvzd_required) + if (jform_vvvvvzfvze_required) { updateFieldRequired('php_after_getitem',0); jQuery('#jform_php_after_getitem').prop('required','required'); jQuery('#jform_php_after_getitem').attr('aria-required',true); jQuery('#jform_php_after_getitem').addClass('required'); - jform_vvvvvzfvzd_required = false; + jform_vvvvvzfvze_required = false; } } else { jQuery('#jform_php_after_getitem').closest('.control-group').hide(); - if (!jform_vvvvvzfvzd_required) + if (!jform_vvvvvzfvze_required) { updateFieldRequired('php_after_getitem',1); jQuery('#jform_php_after_getitem').removeAttr('required'); jQuery('#jform_php_after_getitem').removeAttr('aria-required'); jQuery('#jform_php_after_getitem').removeClass('required'); - jform_vvvvvzfvzd_required = true; + jform_vvvvvzfvze_required = true; } } } @@ -812,45 +812,45 @@ function vvvvvzh(gettype_vvvvvzh) if (gettype) { jQuery('#jform_add_php_after_getitem').closest('.control-group').show(); - if (jform_vvvvvzhvze_required) + if (jform_vvvvvzhvzf_required) { updateFieldRequired('add_php_after_getitem',0); jQuery('#jform_add_php_after_getitem').prop('required','required'); jQuery('#jform_add_php_after_getitem').attr('aria-required',true); jQuery('#jform_add_php_after_getitem').addClass('required'); - jform_vvvvvzhvze_required = false; + jform_vvvvvzhvzf_required = false; } jQuery('#jform_add_php_before_getitem').closest('.control-group').show(); - if (jform_vvvvvzhvzf_required) + if (jform_vvvvvzhvzg_required) { updateFieldRequired('add_php_before_getitem',0); jQuery('#jform_add_php_before_getitem').prop('required','required'); jQuery('#jform_add_php_before_getitem').attr('aria-required',true); jQuery('#jform_add_php_before_getitem').addClass('required'); - jform_vvvvvzhvzf_required = false; + jform_vvvvvzhvzg_required = false; } } else { jQuery('#jform_add_php_after_getitem').closest('.control-group').hide(); - if (!jform_vvvvvzhvze_required) + if (!jform_vvvvvzhvzf_required) { updateFieldRequired('add_php_after_getitem',1); jQuery('#jform_add_php_after_getitem').removeAttr('required'); jQuery('#jform_add_php_after_getitem').removeAttr('aria-required'); jQuery('#jform_add_php_after_getitem').removeClass('required'); - jform_vvvvvzhvze_required = true; + jform_vvvvvzhvzf_required = true; } jQuery('#jform_add_php_before_getitem').closest('.control-group').hide(); - if (!jform_vvvvvzhvzf_required) + if (!jform_vvvvvzhvzg_required) { updateFieldRequired('add_php_before_getitem',1); jQuery('#jform_add_php_before_getitem').removeAttr('required'); jQuery('#jform_add_php_before_getitem').removeAttr('aria-required'); jQuery('#jform_add_php_before_getitem').removeClass('required'); - jform_vvvvvzhvzf_required = true; + jform_vvvvvzhvzg_required = true; } } } @@ -898,26 +898,26 @@ function vvvvvzi(add_php_getlistquery_vvvvvzi,gettype_vvvvvzi) if (add_php_getlistquery && gettype) { jQuery('#jform_php_getlistquery').closest('.control-group').show(); - if (jform_vvvvvzivzg_required) + if (jform_vvvvvzivzh_required) { updateFieldRequired('php_getlistquery',0); jQuery('#jform_php_getlistquery').prop('required','required'); jQuery('#jform_php_getlistquery').attr('aria-required',true); jQuery('#jform_php_getlistquery').addClass('required'); - jform_vvvvvzivzg_required = false; + jform_vvvvvzivzh_required = false; } } else { jQuery('#jform_php_getlistquery').closest('.control-group').hide(); - if (!jform_vvvvvzivzg_required) + if (!jform_vvvvvzivzh_required) { updateFieldRequired('php_getlistquery',1); jQuery('#jform_php_getlistquery').removeAttr('required'); jQuery('#jform_php_getlistquery').removeAttr('aria-required'); jQuery('#jform_php_getlistquery').removeClass('required'); - jform_vvvvvzivzg_required = true; + jform_vvvvvzivzh_required = true; } } } @@ -976,26 +976,26 @@ function vvvvvzj(add_php_before_getitems_vvvvvzj,gettype_vvvvvzj) if (add_php_before_getitems && gettype) { jQuery('#jform_php_before_getitems').closest('.control-group').show(); - if (jform_vvvvvzjvzh_required) + if (jform_vvvvvzjvzi_required) { updateFieldRequired('php_before_getitems',0); jQuery('#jform_php_before_getitems').prop('required','required'); jQuery('#jform_php_before_getitems').attr('aria-required',true); jQuery('#jform_php_before_getitems').addClass('required'); - jform_vvvvvzjvzh_required = false; + jform_vvvvvzjvzi_required = false; } } else { jQuery('#jform_php_before_getitems').closest('.control-group').hide(); - if (!jform_vvvvvzjvzh_required) + if (!jform_vvvvvzjvzi_required) { updateFieldRequired('php_before_getitems',1); jQuery('#jform_php_before_getitems').removeAttr('required'); jQuery('#jform_php_before_getitems').removeAttr('aria-required'); jQuery('#jform_php_before_getitems').removeClass('required'); - jform_vvvvvzjvzh_required = true; + jform_vvvvvzjvzi_required = true; } } } @@ -1054,26 +1054,26 @@ function vvvvvzk(add_php_after_getitems_vvvvvzk,gettype_vvvvvzk) if (add_php_after_getitems && gettype) { jQuery('#jform_php_after_getitems').closest('.control-group').show(); - if (jform_vvvvvzkvzi_required) + if (jform_vvvvvzkvzj_required) { updateFieldRequired('php_after_getitems',0); jQuery('#jform_php_after_getitems').prop('required','required'); jQuery('#jform_php_after_getitems').attr('aria-required',true); jQuery('#jform_php_after_getitems').addClass('required'); - jform_vvvvvzkvzi_required = false; + jform_vvvvvzkvzj_required = false; } } else { jQuery('#jform_php_after_getitems').closest('.control-group').hide(); - if (!jform_vvvvvzkvzi_required) + if (!jform_vvvvvzkvzj_required) { updateFieldRequired('php_after_getitems',1); jQuery('#jform_php_after_getitems').removeAttr('required'); jQuery('#jform_php_after_getitems').removeAttr('aria-required'); jQuery('#jform_php_after_getitems').removeClass('required'); - jform_vvvvvzkvzi_required = true; + jform_vvvvvzkvzj_required = true; } } } @@ -1120,64 +1120,64 @@ function vvvvvzm(gettype_vvvvvzm) if (gettype) { jQuery('#jform_add_php_after_getitems').closest('.control-group').show(); - if (jform_vvvvvzmvzj_required) + if (jform_vvvvvzmvzk_required) { updateFieldRequired('add_php_after_getitems',0); jQuery('#jform_add_php_after_getitems').prop('required','required'); jQuery('#jform_add_php_after_getitems').attr('aria-required',true); jQuery('#jform_add_php_after_getitems').addClass('required'); - jform_vvvvvzmvzj_required = false; + jform_vvvvvzmvzk_required = false; } jQuery('#jform_add_php_before_getitems').closest('.control-group').show(); - if (jform_vvvvvzmvzk_required) + if (jform_vvvvvzmvzl_required) { updateFieldRequired('add_php_before_getitems',0); jQuery('#jform_add_php_before_getitems').prop('required','required'); jQuery('#jform_add_php_before_getitems').attr('aria-required',true); jQuery('#jform_add_php_before_getitems').addClass('required'); - jform_vvvvvzmvzk_required = false; + jform_vvvvvzmvzl_required = false; } jQuery('#jform_add_php_getlistquery').closest('.control-group').show(); - if (jform_vvvvvzmvzl_required) + if (jform_vvvvvzmvzm_required) { updateFieldRequired('add_php_getlistquery',0); jQuery('#jform_add_php_getlistquery').prop('required','required'); jQuery('#jform_add_php_getlistquery').attr('aria-required',true); jQuery('#jform_add_php_getlistquery').addClass('required'); - jform_vvvvvzmvzl_required = false; + jform_vvvvvzmvzm_required = false; } } else { jQuery('#jform_add_php_after_getitems').closest('.control-group').hide(); - if (!jform_vvvvvzmvzj_required) + if (!jform_vvvvvzmvzk_required) { updateFieldRequired('add_php_after_getitems',1); jQuery('#jform_add_php_after_getitems').removeAttr('required'); jQuery('#jform_add_php_after_getitems').removeAttr('aria-required'); jQuery('#jform_add_php_after_getitems').removeClass('required'); - jform_vvvvvzmvzj_required = true; + jform_vvvvvzmvzk_required = true; } jQuery('#jform_add_php_before_getitems').closest('.control-group').hide(); - if (!jform_vvvvvzmvzk_required) + if (!jform_vvvvvzmvzl_required) { updateFieldRequired('add_php_before_getitems',1); jQuery('#jform_add_php_before_getitems').removeAttr('required'); jQuery('#jform_add_php_before_getitems').removeAttr('aria-required'); jQuery('#jform_add_php_before_getitems').removeClass('required'); - jform_vvvvvzmvzk_required = true; + jform_vvvvvzmvzl_required = true; } jQuery('#jform_add_php_getlistquery').closest('.control-group').hide(); - if (!jform_vvvvvzmvzl_required) + if (!jform_vvvvvzmvzm_required) { updateFieldRequired('add_php_getlistquery',1); jQuery('#jform_add_php_getlistquery').removeAttr('required'); jQuery('#jform_add_php_getlistquery').removeAttr('aria-required'); jQuery('#jform_add_php_getlistquery').removeClass('required'); - jform_vvvvvzmvzl_required = true; + jform_vvvvvzmvzm_required = true; } } } @@ -1213,26 +1213,26 @@ function vvvvvzn(gettype_vvvvvzn) if (gettype) { jQuery('#jform_pagination').closest('.control-group').show(); - if (jform_vvvvvznvzm_required) + if (jform_vvvvvznvzn_required) { updateFieldRequired('pagination',0); jQuery('#jform_pagination').prop('required','required'); jQuery('#jform_pagination').attr('aria-required',true); jQuery('#jform_pagination').addClass('required'); - jform_vvvvvznvzm_required = false; + jform_vvvvvznvzn_required = false; } } else { jQuery('#jform_pagination').closest('.control-group').hide(); - if (!jform_vvvvvznvzm_required) + if (!jform_vvvvvznvzn_required) { updateFieldRequired('pagination',1); jQuery('#jform_pagination').removeAttr('required'); jQuery('#jform_pagination').removeAttr('aria-required'); jQuery('#jform_pagination').removeClass('required'); - jform_vvvvvznvzm_required = true; + jform_vvvvvznvzn_required = true; } } } diff --git a/admin/models/forms/field.js b/admin/models/forms/field.js index 143464b45..2a4e9f1a2 100644 --- a/admin/models/forms/field.js +++ b/admin/models/forms/field.js @@ -23,14 +23,14 @@ /-----------------------------------------------------------------------------------------------------------------------------*/ // Some Global Values -jform_vvvvvzsvzr_required = false; -jform_vvvvvztvzs_required = false; -jform_vvvvvzuvzt_required = false; -jform_vvvvvzvvzu_required = false; -jform_vvvvvzyvzv_required = false; -jform_vvvvvzzvzw_required = false; -jform_vvvvwaavzx_required = false; -jform_vvvvwabvzy_required = false; +jform_vvvvvzsvzs_required = false; +jform_vvvvvztvzt_required = false; +jform_vvvvvzuvzu_required = false; +jform_vvvvvzvvzv_required = false; +jform_vvvvvzyvzw_required = false; +jform_vvvvvzzvzx_required = false; +jform_vvvvwaavzy_required = false; +jform_vvvvwabvzz_required = false; // Initial Script jQuery(document).ready(function() @@ -84,26 +84,26 @@ function vvvvvzs(datalenght_vvvvvzs) if (datalenght) { jQuery('#jform_datalenght_other').closest('.control-group').show(); - if (jform_vvvvvzsvzr_required) + if (jform_vvvvvzsvzs_required) { updateFieldRequired('datalenght_other',0); jQuery('#jform_datalenght_other').prop('required','required'); jQuery('#jform_datalenght_other').attr('aria-required',true); jQuery('#jform_datalenght_other').addClass('required'); - jform_vvvvvzsvzr_required = false; + jform_vvvvvzsvzs_required = false; } } else { jQuery('#jform_datalenght_other').closest('.control-group').hide(); - if (!jform_vvvvvzsvzr_required) + if (!jform_vvvvvzsvzs_required) { updateFieldRequired('datalenght_other',1); jQuery('#jform_datalenght_other').removeAttr('required'); jQuery('#jform_datalenght_other').removeAttr('aria-required'); jQuery('#jform_datalenght_other').removeClass('required'); - jform_vvvvvzsvzr_required = true; + jform_vvvvvzsvzs_required = true; } } } @@ -139,26 +139,26 @@ function vvvvvzt(datadefault_vvvvvzt) if (datadefault) { jQuery('#jform_datadefault_other').closest('.control-group').show(); - if (jform_vvvvvztvzs_required) + if (jform_vvvvvztvzt_required) { updateFieldRequired('datadefault_other',0); jQuery('#jform_datadefault_other').prop('required','required'); jQuery('#jform_datadefault_other').attr('aria-required',true); jQuery('#jform_datadefault_other').addClass('required'); - jform_vvvvvztvzs_required = false; + jform_vvvvvztvzt_required = false; } } else { jQuery('#jform_datadefault_other').closest('.control-group').hide(); - if (!jform_vvvvvztvzs_required) + if (!jform_vvvvvztvzt_required) { updateFieldRequired('datadefault_other',1); jQuery('#jform_datadefault_other').removeAttr('required'); jQuery('#jform_datadefault_other').removeAttr('aria-required'); jQuery('#jform_datadefault_other').removeClass('required'); - jform_vvvvvztvzs_required = true; + jform_vvvvvztvzt_required = true; } } } @@ -196,13 +196,13 @@ function vvvvvzu(datatype_vvvvvzu) jQuery('#jform_datadefault').closest('.control-group').show(); jQuery('#jform_datalenght').closest('.control-group').show(); jQuery('#jform_indexes').closest('.control-group').show(); - if (jform_vvvvvzuvzt_required) + if (jform_vvvvvzuvzu_required) { updateFieldRequired('indexes',0); jQuery('#jform_indexes').prop('required','required'); jQuery('#jform_indexes').attr('aria-required',true); jQuery('#jform_indexes').addClass('required'); - jform_vvvvvzuvzt_required = false; + jform_vvvvvzuvzu_required = false; } } @@ -211,13 +211,13 @@ function vvvvvzu(datatype_vvvvvzu) jQuery('#jform_datadefault').closest('.control-group').hide(); jQuery('#jform_datalenght').closest('.control-group').hide(); jQuery('#jform_indexes').closest('.control-group').hide(); - if (!jform_vvvvvzuvzt_required) + if (!jform_vvvvvzuvzu_required) { updateFieldRequired('indexes',1); jQuery('#jform_indexes').removeAttr('required'); jQuery('#jform_indexes').removeAttr('aria-required'); jQuery('#jform_indexes').removeClass('required'); - jform_vvvvvzuvzt_required = true; + jform_vvvvvzuvzu_required = true; } } } @@ -253,26 +253,26 @@ function vvvvvzv(datatype_vvvvvzv) if (datatype) { jQuery('#jform_store').closest('.control-group').show(); - if (jform_vvvvvzvvzu_required) + if (jform_vvvvvzvvzv_required) { updateFieldRequired('store',0); jQuery('#jform_store').prop('required','required'); jQuery('#jform_store').attr('aria-required',true); jQuery('#jform_store').addClass('required'); - jform_vvvvvzvvzu_required = false; + jform_vvvvvzvvzv_required = false; } } else { jQuery('#jform_store').closest('.control-group').hide(); - if (!jform_vvvvvzvvzu_required) + if (!jform_vvvvvzvvzv_required) { updateFieldRequired('store',1); jQuery('#jform_store').removeAttr('required'); jQuery('#jform_store').removeAttr('aria-required'); jQuery('#jform_store').removeClass('required'); - jform_vvvvvzvvzu_required = true; + jform_vvvvvzvvzv_required = true; } } } @@ -356,26 +356,26 @@ function vvvvvzy(add_css_view_vvvvvzy) if (add_css_view_vvvvvzy == 1) { jQuery('#jform_css_view').closest('.control-group').show(); - if (jform_vvvvvzyvzv_required) + if (jform_vvvvvzyvzw_required) { updateFieldRequired('css_view',0); jQuery('#jform_css_view').prop('required','required'); jQuery('#jform_css_view').attr('aria-required',true); jQuery('#jform_css_view').addClass('required'); - jform_vvvvvzyvzv_required = false; + jform_vvvvvzyvzw_required = false; } } else { jQuery('#jform_css_view').closest('.control-group').hide(); - if (!jform_vvvvvzyvzv_required) + if (!jform_vvvvvzyvzw_required) { updateFieldRequired('css_view',1); jQuery('#jform_css_view').removeAttr('required'); jQuery('#jform_css_view').removeAttr('aria-required'); jQuery('#jform_css_view').removeClass('required'); - jform_vvvvvzyvzv_required = true; + jform_vvvvvzyvzw_required = true; } } } @@ -387,26 +387,26 @@ function vvvvvzz(add_css_views_vvvvvzz) if (add_css_views_vvvvvzz == 1) { jQuery('#jform_css_views').closest('.control-group').show(); - if (jform_vvvvvzzvzw_required) + if (jform_vvvvvzzvzx_required) { updateFieldRequired('css_views',0); jQuery('#jform_css_views').prop('required','required'); jQuery('#jform_css_views').attr('aria-required',true); jQuery('#jform_css_views').addClass('required'); - jform_vvvvvzzvzw_required = false; + jform_vvvvvzzvzx_required = false; } } else { jQuery('#jform_css_views').closest('.control-group').hide(); - if (!jform_vvvvvzzvzw_required) + if (!jform_vvvvvzzvzx_required) { updateFieldRequired('css_views',1); jQuery('#jform_css_views').removeAttr('required'); jQuery('#jform_css_views').removeAttr('aria-required'); jQuery('#jform_css_views').removeClass('required'); - jform_vvvvvzzvzw_required = true; + jform_vvvvvzzvzx_required = true; } } } @@ -418,26 +418,26 @@ function vvvvwaa(add_javascript_view_footer_vvvvwaa) if (add_javascript_view_footer_vvvvwaa == 1) { jQuery('#jform_javascript_view_footer').closest('.control-group').show(); - if (jform_vvvvwaavzx_required) + if (jform_vvvvwaavzy_required) { updateFieldRequired('javascript_view_footer',0); jQuery('#jform_javascript_view_footer').prop('required','required'); jQuery('#jform_javascript_view_footer').attr('aria-required',true); jQuery('#jform_javascript_view_footer').addClass('required'); - jform_vvvvwaavzx_required = false; + jform_vvvvwaavzy_required = false; } } else { jQuery('#jform_javascript_view_footer').closest('.control-group').hide(); - if (!jform_vvvvwaavzx_required) + if (!jform_vvvvwaavzy_required) { updateFieldRequired('javascript_view_footer',1); jQuery('#jform_javascript_view_footer').removeAttr('required'); jQuery('#jform_javascript_view_footer').removeAttr('aria-required'); jQuery('#jform_javascript_view_footer').removeClass('required'); - jform_vvvvwaavzx_required = true; + jform_vvvvwaavzy_required = true; } } } @@ -449,26 +449,26 @@ function vvvvwab(add_javascript_views_footer_vvvvwab) if (add_javascript_views_footer_vvvvwab == 1) { jQuery('#jform_javascript_views_footer').closest('.control-group').show(); - if (jform_vvvvwabvzy_required) + if (jform_vvvvwabvzz_required) { updateFieldRequired('javascript_views_footer',0); jQuery('#jform_javascript_views_footer').prop('required','required'); jQuery('#jform_javascript_views_footer').attr('aria-required',true); jQuery('#jform_javascript_views_footer').addClass('required'); - jform_vvvvwabvzy_required = false; + jform_vvvvwabvzz_required = false; } } else { jQuery('#jform_javascript_views_footer').closest('.control-group').hide(); - if (!jform_vvvvwabvzy_required) + if (!jform_vvvvwabvzz_required) { updateFieldRequired('javascript_views_footer',1); jQuery('#jform_javascript_views_footer').removeAttr('required'); jQuery('#jform_javascript_views_footer').removeAttr('aria-required'); jQuery('#jform_javascript_views_footer').removeClass('required'); - jform_vvvvwabvzy_required = true; + jform_vvvvwabvzz_required = true; } } } diff --git a/admin/models/forms/help_document.js b/admin/models/forms/help_document.js index 5d413bae9..c21185390 100644 --- a/admin/models/forms/help_document.js +++ b/admin/models/forms/help_document.js @@ -10,7 +10,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 6 of this MVC - @build 17th October, 2016 + @build 18th October, 2016 @created 4th March, 2016 @package Component Builder @subpackage help_document.js @@ -23,12 +23,12 @@ /-----------------------------------------------------------------------------------------------------------------------------*/ // Some Global Values -jform_vvvvwacwab_required = false; -jform_vvvvwadwac_required = false; -jform_vvvvwaewad_required = false; -jform_vvvvwafwae_required = false; -jform_vvvvwagwaf_required = false; -jform_vvvvwahwag_required = false; +jform_vvvvwacwac_required = false; +jform_vvvvwadwad_required = false; +jform_vvvvwaewae_required = false; +jform_vvvvwafwaf_required = false; +jform_vvvvwagwag_required = false; +jform_vvvvwahwah_required = false; // Initial Script jQuery(document).ready(function() @@ -59,26 +59,26 @@ function vvvvwac(location_vvvvwac) if (location_vvvvwac == 1) { jQuery('#jform_admin_view').closest('.control-group').show(); - if (jform_vvvvwacwab_required) + if (jform_vvvvwacwac_required) { updateFieldRequired('admin_view',0); jQuery('#jform_admin_view').prop('required','required'); jQuery('#jform_admin_view').attr('aria-required',true); jQuery('#jform_admin_view').addClass('required'); - jform_vvvvwacwab_required = false; + jform_vvvvwacwac_required = false; } } else { jQuery('#jform_admin_view').closest('.control-group').hide(); - if (!jform_vvvvwacwab_required) + if (!jform_vvvvwacwac_required) { updateFieldRequired('admin_view',1); jQuery('#jform_admin_view').removeAttr('required'); jQuery('#jform_admin_view').removeAttr('aria-required'); jQuery('#jform_admin_view').removeClass('required'); - jform_vvvvwacwab_required = true; + jform_vvvvwacwac_required = true; } } } @@ -90,26 +90,26 @@ function vvvvwad(location_vvvvwad) if (location_vvvvwad == 2) { jQuery('#jform_site_view').closest('.control-group').show(); - if (jform_vvvvwadwac_required) + if (jform_vvvvwadwad_required) { updateFieldRequired('site_view',0); jQuery('#jform_site_view').prop('required','required'); jQuery('#jform_site_view').attr('aria-required',true); jQuery('#jform_site_view').addClass('required'); - jform_vvvvwadwac_required = false; + jform_vvvvwadwad_required = false; } } else { jQuery('#jform_site_view').closest('.control-group').hide(); - if (!jform_vvvvwadwac_required) + if (!jform_vvvvwadwad_required) { updateFieldRequired('site_view',1); jQuery('#jform_site_view').removeAttr('required'); jQuery('#jform_site_view').removeAttr('aria-required'); jQuery('#jform_site_view').removeClass('required'); - jform_vvvvwadwac_required = true; + jform_vvvvwadwad_required = true; } } } @@ -134,26 +134,26 @@ function vvvvwae(type_vvvvwae) if (type) { jQuery('#jform_url').closest('.control-group').show(); - if (jform_vvvvwaewad_required) + if (jform_vvvvwaewae_required) { updateFieldRequired('url',0); jQuery('#jform_url').prop('required','required'); jQuery('#jform_url').attr('aria-required',true); jQuery('#jform_url').addClass('required'); - jform_vvvvwaewad_required = false; + jform_vvvvwaewae_required = false; } } else { jQuery('#jform_url').closest('.control-group').hide(); - if (!jform_vvvvwaewad_required) + if (!jform_vvvvwaewae_required) { updateFieldRequired('url',1); jQuery('#jform_url').removeAttr('required'); jQuery('#jform_url').removeAttr('aria-required'); jQuery('#jform_url').removeClass('required'); - jform_vvvvwaewad_required = true; + jform_vvvvwaewae_required = true; } } } @@ -189,26 +189,26 @@ function vvvvwaf(type_vvvvwaf) if (type) { jQuery('#jform_article').closest('.control-group').show(); - if (jform_vvvvwafwae_required) + if (jform_vvvvwafwaf_required) { updateFieldRequired('article',0); jQuery('#jform_article').prop('required','required'); jQuery('#jform_article').attr('aria-required',true); jQuery('#jform_article').addClass('required'); - jform_vvvvwafwae_required = false; + jform_vvvvwafwaf_required = false; } } else { jQuery('#jform_article').closest('.control-group').hide(); - if (!jform_vvvvwafwae_required) + if (!jform_vvvvwafwaf_required) { updateFieldRequired('article',1); jQuery('#jform_article').removeAttr('required'); jQuery('#jform_article').removeAttr('aria-required'); jQuery('#jform_article').removeClass('required'); - jform_vvvvwafwae_required = true; + jform_vvvvwafwaf_required = true; } } } @@ -244,26 +244,26 @@ function vvvvwag(type_vvvvwag) if (type) { jQuery('#jform_content-lbl').closest('.control-group').show(); - if (jform_vvvvwagwaf_required) + if (jform_vvvvwagwag_required) { updateFieldRequired('content',0); jQuery('#jform_content').prop('required','required'); jQuery('#jform_content').attr('aria-required',true); jQuery('#jform_content').addClass('required'); - jform_vvvvwagwaf_required = false; + jform_vvvvwagwag_required = false; } } else { jQuery('#jform_content-lbl').closest('.control-group').hide(); - if (!jform_vvvvwagwaf_required) + if (!jform_vvvvwagwag_required) { updateFieldRequired('content',1); jQuery('#jform_content').removeAttr('required'); jQuery('#jform_content').removeAttr('aria-required'); jQuery('#jform_content').removeClass('required'); - jform_vvvvwagwaf_required = true; + jform_vvvvwagwag_required = true; } } } @@ -286,26 +286,26 @@ function vvvvwah(target_vvvvwah) if (target_vvvvwah == 1) { jQuery('#jform_groups').closest('.control-group').show(); - if (jform_vvvvwahwag_required) + if (jform_vvvvwahwah_required) { updateFieldRequired('groups',0); jQuery('#jform_groups').prop('required','required'); jQuery('#jform_groups').attr('aria-required',true); jQuery('#jform_groups').addClass('required'); - jform_vvvvwahwag_required = false; + jform_vvvvwahwah_required = false; } } else { jQuery('#jform_groups').closest('.control-group').hide(); - if (!jform_vvvvwahwag_required) + if (!jform_vvvvwahwah_required) { updateFieldRequired('groups',1); jQuery('#jform_groups').removeAttr('required'); jQuery('#jform_groups').removeAttr('aria-required'); jQuery('#jform_groups').removeClass('required'); - jform_vvvvwahwag_required = true; + jform_vvvvwahwah_required = true; } } } diff --git a/admin/models/forms/joomla_component.js b/admin/models/forms/joomla_component.js index 414da787c..75cc4c3cd 100644 --- a/admin/models/forms/joomla_component.js +++ b/admin/models/forms/joomla_component.js @@ -9,8 +9,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 311 of this MVC - @build 1st April, 2017 + @version @update number 318 of this MVC + @build 5th April, 2017 @created 6th May, 2015 @package Component Builder @subpackage joomla_component.js diff --git a/admin/models/forms/language.js b/admin/models/forms/language.js new file mode 100644 index 000000000..30a7bd0ec --- /dev/null +++ b/admin/models/forms/language.js @@ -0,0 +1,25 @@ +/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/ + __ __ _ _____ _ _ __ __ _ _ _ + \ \ / / | | | __ \ | | | | | \/ | | | | | | | + \ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| | + \ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` | + \ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| | + \/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_| + | | + |_| +/-------------------------------------------------------------------------------------------------------------------------------/ + + @version @update number 3 of this MVC + @build 3rd April, 2017 + @created 3rd April, 2017 + @package Component Builder + @subpackage language.js + @author Llewellyn van der Merwe + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + + diff --git a/admin/models/forms/language.xml b/admin/models/forms/language.xml new file mode 100644 index 000000000..883c0f2b3 --- /dev/null +++ b/admin/models/forms/language.xml @@ -0,0 +1,145 @@ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +
+
\ No newline at end of file diff --git a/admin/models/forms/language_translation.js b/admin/models/forms/language_translation.js new file mode 100644 index 000000000..72000456f --- /dev/null +++ b/admin/models/forms/language_translation.js @@ -0,0 +1,84 @@ +/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/ + __ __ _ _____ _ _ __ __ _ _ _ + \ \ / / | | | __ \ | | | | | \/ | | | | | | | + \ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| | + \ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` | + \ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| | + \/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_| + | | + |_| +/-------------------------------------------------------------------------------------------------------------------------------/ + + @version @update number 37 of this MVC + @build 5th April, 2017 + @created 3rd April, 2017 + @package Component Builder + @subpackage language_translation.js + @author Llewellyn van der Merwe + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + + + +jQuery(document).ready(function($) +{ + // build table of translations + var translation = encodeURIComponent(jQuery('#jform_translation').val()); + if (translation) { + getBuildTable(translation,'jform_translation'); + } + // set button to add more languages + addButton('language','components'); +}); + +function getBuildTable_server(string, idName){ + var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getBuildTable&format=json&vdm="+vastDevMod); + if(token.length > 0 && string.length > 0 && idName.length > 0){ + var request = 'token='+token+'&idName='+idName+'&object='+string; + } + return jQuery.ajax({ + type: 'GET', + url: getUrl, + dataType: 'jsonp', + data: request, + jsonp: 'callback' + }); +} +function getBuildTable(string, idName){ + getBuildTable_server(string, idName).done(function(result) { + jQuery('#table_'+idName).remove(); + if(result){ + addData(result, '#'+idName); + } + }) +} +function addData(result, where){ + jQuery(where).closest('.control-group').parent().append(result); +} +function addButton_server(type){ + var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButton&format=json&vdm="+vastDevMod); + if(token.length > 0 && type.length > 0){ + var request = 'token='+token+'&type='+type; + } + return jQuery.ajax({ + type: 'GET', + url: getUrl, + dataType: 'jsonp', + data: request, + jsonp: 'callback' + }); +} +function addButton(type, where){ + addButton_server(type).done(function(result) { + if(result){ + setButton(result, '#jform_'+where); + } + }); +} +function setButton(result, where){ + jQuery(where).closest('.control-group').append(result); +} diff --git a/admin/models/forms/language_translation.xml b/admin/models/forms/language_translation.xml new file mode 100644 index 000000000..6b6e450d0 --- /dev/null +++ b/admin/models/forms/language_translation.xml @@ -0,0 +1,180 @@ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + +
+
\ No newline at end of file diff --git a/admin/models/forms/layout.js b/admin/models/forms/layout.js index b2c7fabad..3ece76a66 100644 --- a/admin/models/forms/layout.js +++ b/admin/models/forms/layout.js @@ -23,7 +23,7 @@ /-----------------------------------------------------------------------------------------------------------------------------*/ // Some Global Values -jform_vvvvvyrvyu_required = false; +jform_vvvvvyrvyv_required = false; // Initial Script jQuery(document).ready(function() @@ -39,26 +39,26 @@ function vvvvvyr(add_php_view_vvvvvyr) if (add_php_view_vvvvvyr == 1) { jQuery('#jform_php_view').closest('.control-group').show(); - if (jform_vvvvvyrvyu_required) + if (jform_vvvvvyrvyv_required) { updateFieldRequired('php_view',0); jQuery('#jform_php_view').prop('required','required'); jQuery('#jform_php_view').attr('aria-required',true); jQuery('#jform_php_view').addClass('required'); - jform_vvvvvyrvyu_required = false; + jform_vvvvvyrvyv_required = false; } } else { jQuery('#jform_php_view').closest('.control-group').hide(); - if (!jform_vvvvvyrvyu_required) + if (!jform_vvvvvyrvyv_required) { updateFieldRequired('php_view',1); jQuery('#jform_php_view').removeAttr('required'); jQuery('#jform_php_view').removeAttr('aria-required'); jQuery('#jform_php_view').removeClass('required'); - jform_vvvvvyrvyu_required = true; + jform_vvvvvyrvyv_required = true; } } } diff --git a/admin/models/forms/site_view.js b/admin/models/forms/site_view.js index e4f72d3a9..184c6715c 100644 --- a/admin/models/forms/site_view.js +++ b/admin/models/forms/site_view.js @@ -23,16 +23,16 @@ /-----------------------------------------------------------------------------------------------------------------------------*/ // Some Global Values -jform_vvvvvyhvyi_required = false; -jform_vvvvvyivyj_required = false; -jform_vvvvvyjvyk_required = false; -jform_vvvvvykvyl_required = false; -jform_vvvvvylvym_required = false; -jform_vvvvvymvyn_required = false; -jform_vvvvvynvyo_required = false; -jform_vvvvvyovyp_required = false; -jform_vvvvvypvyq_required = false; +jform_vvvvvyhvyj_required = false; +jform_vvvvvyivyk_required = false; +jform_vvvvvyjvyl_required = false; +jform_vvvvvykvym_required = false; +jform_vvvvvylvyn_required = false; +jform_vvvvvymvyo_required = false; +jform_vvvvvynvyp_required = false; +jform_vvvvvyovyq_required = false; jform_vvvvvypvyr_required = false; +jform_vvvvvypvys_required = false; // Initial Script jQuery(document).ready(function() @@ -72,26 +72,26 @@ function vvvvvyh(add_php_view_vvvvvyh) if (add_php_view_vvvvvyh == 1) { jQuery('#jform_php_view').closest('.control-group').show(); - if (jform_vvvvvyhvyi_required) + if (jform_vvvvvyhvyj_required) { updateFieldRequired('php_view',0); jQuery('#jform_php_view').prop('required','required'); jQuery('#jform_php_view').attr('aria-required',true); jQuery('#jform_php_view').addClass('required'); - jform_vvvvvyhvyi_required = false; + jform_vvvvvyhvyj_required = false; } } else { jQuery('#jform_php_view').closest('.control-group').hide(); - if (!jform_vvvvvyhvyi_required) + if (!jform_vvvvvyhvyj_required) { updateFieldRequired('php_view',1); jQuery('#jform_php_view').removeAttr('required'); jQuery('#jform_php_view').removeAttr('aria-required'); jQuery('#jform_php_view').removeClass('required'); - jform_vvvvvyhvyi_required = true; + jform_vvvvvyhvyj_required = true; } } } @@ -103,26 +103,26 @@ function vvvvvyi(add_php_jview_display_vvvvvyi) if (add_php_jview_display_vvvvvyi == 1) { jQuery('#jform_php_jview_display').closest('.control-group').show(); - if (jform_vvvvvyivyj_required) + if (jform_vvvvvyivyk_required) { updateFieldRequired('php_jview_display',0); jQuery('#jform_php_jview_display').prop('required','required'); jQuery('#jform_php_jview_display').attr('aria-required',true); jQuery('#jform_php_jview_display').addClass('required'); - jform_vvvvvyivyj_required = false; + jform_vvvvvyivyk_required = false; } } else { jQuery('#jform_php_jview_display').closest('.control-group').hide(); - if (!jform_vvvvvyivyj_required) + if (!jform_vvvvvyivyk_required) { updateFieldRequired('php_jview_display',1); jQuery('#jform_php_jview_display').removeAttr('required'); jQuery('#jform_php_jview_display').removeAttr('aria-required'); jQuery('#jform_php_jview_display').removeClass('required'); - jform_vvvvvyivyj_required = true; + jform_vvvvvyivyk_required = true; } } } @@ -134,26 +134,26 @@ function vvvvvyj(add_php_jview_vvvvvyj) if (add_php_jview_vvvvvyj == 1) { jQuery('#jform_php_jview').closest('.control-group').show(); - if (jform_vvvvvyjvyk_required) + if (jform_vvvvvyjvyl_required) { updateFieldRequired('php_jview',0); jQuery('#jform_php_jview').prop('required','required'); jQuery('#jform_php_jview').attr('aria-required',true); jQuery('#jform_php_jview').addClass('required'); - jform_vvvvvyjvyk_required = false; + jform_vvvvvyjvyl_required = false; } } else { jQuery('#jform_php_jview').closest('.control-group').hide(); - if (!jform_vvvvvyjvyk_required) + if (!jform_vvvvvyjvyl_required) { updateFieldRequired('php_jview',1); jQuery('#jform_php_jview').removeAttr('required'); jQuery('#jform_php_jview').removeAttr('aria-required'); jQuery('#jform_php_jview').removeClass('required'); - jform_vvvvvyjvyk_required = true; + jform_vvvvvyjvyl_required = true; } } } @@ -165,26 +165,26 @@ function vvvvvyk(add_php_document_vvvvvyk) if (add_php_document_vvvvvyk == 1) { jQuery('#jform_php_document').closest('.control-group').show(); - if (jform_vvvvvykvyl_required) + if (jform_vvvvvykvym_required) { updateFieldRequired('php_document',0); jQuery('#jform_php_document').prop('required','required'); jQuery('#jform_php_document').attr('aria-required',true); jQuery('#jform_php_document').addClass('required'); - jform_vvvvvykvyl_required = false; + jform_vvvvvykvym_required = false; } } else { jQuery('#jform_php_document').closest('.control-group').hide(); - if (!jform_vvvvvykvyl_required) + if (!jform_vvvvvykvym_required) { updateFieldRequired('php_document',1); jQuery('#jform_php_document').removeAttr('required'); jQuery('#jform_php_document').removeAttr('aria-required'); jQuery('#jform_php_document').removeClass('required'); - jform_vvvvvykvyl_required = true; + jform_vvvvvykvym_required = true; } } } @@ -196,26 +196,26 @@ function vvvvvyl(add_css_document_vvvvvyl) if (add_css_document_vvvvvyl == 1) { jQuery('#jform_css_document').closest('.control-group').show(); - if (jform_vvvvvylvym_required) + if (jform_vvvvvylvyn_required) { updateFieldRequired('css_document',0); jQuery('#jform_css_document').prop('required','required'); jQuery('#jform_css_document').attr('aria-required',true); jQuery('#jform_css_document').addClass('required'); - jform_vvvvvylvym_required = false; + jform_vvvvvylvyn_required = false; } } else { jQuery('#jform_css_document').closest('.control-group').hide(); - if (!jform_vvvvvylvym_required) + if (!jform_vvvvvylvyn_required) { updateFieldRequired('css_document',1); jQuery('#jform_css_document').removeAttr('required'); jQuery('#jform_css_document').removeAttr('aria-required'); jQuery('#jform_css_document').removeClass('required'); - jform_vvvvvylvym_required = true; + jform_vvvvvylvyn_required = true; } } } @@ -227,26 +227,26 @@ function vvvvvym(add_js_document_vvvvvym) if (add_js_document_vvvvvym == 1) { jQuery('#jform_js_document').closest('.control-group').show(); - if (jform_vvvvvymvyn_required) + if (jform_vvvvvymvyo_required) { updateFieldRequired('js_document',0); jQuery('#jform_js_document').prop('required','required'); jQuery('#jform_js_document').attr('aria-required',true); jQuery('#jform_js_document').addClass('required'); - jform_vvvvvymvyn_required = false; + jform_vvvvvymvyo_required = false; } } else { jQuery('#jform_js_document').closest('.control-group').hide(); - if (!jform_vvvvvymvyn_required) + if (!jform_vvvvvymvyo_required) { updateFieldRequired('js_document',1); jQuery('#jform_js_document').removeAttr('required'); jQuery('#jform_js_document').removeAttr('aria-required'); jQuery('#jform_js_document').removeClass('required'); - jform_vvvvvymvyn_required = true; + jform_vvvvvymvyo_required = true; } } } @@ -258,26 +258,26 @@ function vvvvvyn(add_css_vvvvvyn) if (add_css_vvvvvyn == 1) { jQuery('#jform_css').closest('.control-group').show(); - if (jform_vvvvvynvyo_required) + if (jform_vvvvvynvyp_required) { updateFieldRequired('css',0); jQuery('#jform_css').prop('required','required'); jQuery('#jform_css').attr('aria-required',true); jQuery('#jform_css').addClass('required'); - jform_vvvvvynvyo_required = false; + jform_vvvvvynvyp_required = false; } } else { jQuery('#jform_css').closest('.control-group').hide(); - if (!jform_vvvvvynvyo_required) + if (!jform_vvvvvynvyp_required) { updateFieldRequired('css',1); jQuery('#jform_css').removeAttr('required'); jQuery('#jform_css').removeAttr('aria-required'); jQuery('#jform_css').removeClass('required'); - jform_vvvvvynvyo_required = true; + jform_vvvvvynvyp_required = true; } } } @@ -290,13 +290,13 @@ function vvvvvyo(add_php_ajax_vvvvvyo) { jQuery('#jform_ajax_input').closest('.control-group').show(); jQuery('#jform_php_ajaxmethod').closest('.control-group').show(); - if (jform_vvvvvyovyp_required) + if (jform_vvvvvyovyq_required) { updateFieldRequired('php_ajaxmethod',0); jQuery('#jform_php_ajaxmethod').prop('required','required'); jQuery('#jform_php_ajaxmethod').attr('aria-required',true); jQuery('#jform_php_ajaxmethod').addClass('required'); - jform_vvvvvyovyp_required = false; + jform_vvvvvyovyq_required = false; } } @@ -304,13 +304,13 @@ function vvvvvyo(add_php_ajax_vvvvvyo) { jQuery('#jform_ajax_input').closest('.control-group').hide(); jQuery('#jform_php_ajaxmethod').closest('.control-group').hide(); - if (!jform_vvvvvyovyp_required) + if (!jform_vvvvvyovyq_required) { updateFieldRequired('php_ajaxmethod',1); jQuery('#jform_php_ajaxmethod').removeAttr('required'); jQuery('#jform_php_ajaxmethod').removeAttr('aria-required'); jQuery('#jform_php_ajaxmethod').removeClass('required'); - jform_vvvvvyovyp_required = true; + jform_vvvvvyovyq_required = true; } } } @@ -323,23 +323,23 @@ function vvvvvyp(add_custom_button_vvvvvyp) { jQuery('#jform_custom_button').closest('.control-group').show(); jQuery('#jform_php_controller').closest('.control-group').show(); - if (jform_vvvvvypvyq_required) + if (jform_vvvvvypvyr_required) { updateFieldRequired('php_controller',0); jQuery('#jform_php_controller').prop('required','required'); jQuery('#jform_php_controller').attr('aria-required',true); jQuery('#jform_php_controller').addClass('required'); - jform_vvvvvypvyq_required = false; + jform_vvvvvypvyr_required = false; } jQuery('#jform_php_model').closest('.control-group').show(); - if (jform_vvvvvypvyr_required) + if (jform_vvvvvypvys_required) { updateFieldRequired('php_model',0); jQuery('#jform_php_model').prop('required','required'); jQuery('#jform_php_model').attr('aria-required',true); jQuery('#jform_php_model').addClass('required'); - jform_vvvvvypvyr_required = false; + jform_vvvvvypvys_required = false; } } @@ -347,22 +347,22 @@ function vvvvvyp(add_custom_button_vvvvvyp) { jQuery('#jform_custom_button').closest('.control-group').hide(); jQuery('#jform_php_controller').closest('.control-group').hide(); - if (!jform_vvvvvypvyq_required) + if (!jform_vvvvvypvyr_required) { updateFieldRequired('php_controller',1); jQuery('#jform_php_controller').removeAttr('required'); jQuery('#jform_php_controller').removeAttr('aria-required'); jQuery('#jform_php_controller').removeClass('required'); - jform_vvvvvypvyq_required = true; + jform_vvvvvypvyr_required = true; } jQuery('#jform_php_model').closest('.control-group').hide(); - if (!jform_vvvvvypvyr_required) + if (!jform_vvvvvypvys_required) { updateFieldRequired('php_model',1); jQuery('#jform_php_model').removeAttr('required'); jQuery('#jform_php_model').removeAttr('aria-required'); jQuery('#jform_php_model').removeClass('required'); - jform_vvvvvypvyr_required = true; + jform_vvvvvypvys_required = true; } } } diff --git a/admin/models/forms/template.js b/admin/models/forms/template.js index da04435a7..e5db6464a 100644 --- a/admin/models/forms/template.js +++ b/admin/models/forms/template.js @@ -23,7 +23,7 @@ /-----------------------------------------------------------------------------------------------------------------------------*/ // Some Global Values -jform_vvvvvyqvyt_required = false; +jform_vvvvvyqvyu_required = false; // Initial Script jQuery(document).ready(function() @@ -39,26 +39,26 @@ function vvvvvyq(add_php_view_vvvvvyq) if (add_php_view_vvvvvyq == 1) { jQuery('#jform_php_view').closest('.control-group').show(); - if (jform_vvvvvyqvyt_required) + if (jform_vvvvvyqvyu_required) { updateFieldRequired('php_view',0); jQuery('#jform_php_view').prop('required','required'); jQuery('#jform_php_view').attr('aria-required',true); jQuery('#jform_php_view').addClass('required'); - jform_vvvvvyqvyt_required = false; + jform_vvvvvyqvyu_required = false; } } else { jQuery('#jform_php_view').closest('.control-group').hide(); - if (!jform_vvvvvyqvyt_required) + if (!jform_vvvvvyqvyu_required) { updateFieldRequired('php_view',1); jQuery('#jform_php_view').removeAttr('required'); jQuery('#jform_php_view').removeAttr('aria-required'); jQuery('#jform_php_view').removeClass('required'); - jform_vvvvvyqvyt_required = true; + jform_vvvvvyqvyu_required = true; } } } diff --git a/admin/models/help_document.php b/admin/models/help_document.php index dae6e4e85..9d8d15a94 100644 --- a/admin/models/help_document.php +++ b/admin/models/help_document.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 6 of this MVC - @build 17th October, 2016 + @build 18th October, 2016 @created 4th March, 2016 @package Component Builder @subpackage help_document.php diff --git a/admin/models/help_documents.php b/admin/models/help_documents.php index 76cc18fdd..535c913a4 100644 --- a/admin/models/help_documents.php +++ b/admin/models/help_documents.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 6 of this MVC - @build 17th October, 2016 + @build 18th October, 2016 @created 4th March, 2016 @package Component Builder @subpackage help_documents.php diff --git a/admin/models/import.php b/admin/models/import.php index 573dd8fad..1147beccd 100644 --- a/admin/models/import.php +++ b/admin/models/import.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage import.php diff --git a/admin/models/import_joomla_components.php b/admin/models/import_joomla_components.php index 74e2f9f88..316f64b77 100644 --- a/admin/models/import_joomla_components.php +++ b/admin/models/import_joomla_components.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage import_joomla_components.php diff --git a/admin/models/joomla_component.php b/admin/models/joomla_component.php index 31f52904b..914e39937 100644 --- a/admin/models/joomla_component.php +++ b/admin/models/joomla_component.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 311 of this MVC - @build 1st April, 2017 + @version @update number 318 of this MVC + @build 5th April, 2017 @created 6th May, 2015 @package Component Builder @subpackage joomla_component.php @@ -222,7 +222,8 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin } $this->idvvvv = $item->addadmin_views; $this->idvvvw = $item->addcustom_admin_views; - $this->idvvvx = $item->addsite_views; + $this->idvvvx = $item->addsite_views; + $this->componentsvvvy = $item->id; return $item; } @@ -509,6 +510,128 @@ class ComponentbuilderModelJoomla_component extends JModelAdmin return $items; } return false; + } + + /** + * Method to get list data. + * + * @return mixed An array of data items on success, false on failure. + */ + public function getVwptranslation() + { + // Get the user object. + $user = JFactory::getUser(); + // Create a new query object. + $db = JFactory::getDBO(); + $query = $db->getQuery(true); + + // Select some fields + $query->select('a.*'); + + // From the componentbuilder_language_translation table + $query->from($db->quoteName('#__componentbuilder_language_translation', 'a')); + + // Join over the asset groups. + $query->select('ag.title AS access_level'); + $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access'); + // Filter by access level. + if ($access = $this->getState('filter.access')) + { + $query->where('a.access = ' . (int) $access); + } + // Implement View Level Access + if (!$user->authorise('core.options', 'com_componentbuilder')) + { + $groups = implode(',', $user->getAuthorisedViewLevels()); + $query->where('a.access IN (' . $groups . ')'); + } + + // Order the results by ordering + $query->order('a.published ASC'); + $query->order('a.ordering ASC'); + + // Load the items + $db->setQuery($query); + $db->execute(); + if ($db->getNumRows()) + { + $items = $db->loadObjectList(); + + // set values to display correctly. + if (ComponentbuilderHelper::checkArray($items)) + { + // get user object. + $user = JFactory::getUser(); + foreach ($items as $nr => &$item) + { + $access = ($user->authorise('language_translation.access', 'com_componentbuilder.language_translation.' . (int) $item->id) && $user->authorise('language_translation.access', 'com_componentbuilder')); + if (!$access) + { + unset($items[$nr]); + continue; + } + + } + } + + // Filter by componentsvvvy Array Field + $componentsvvvy = $this->componentsvvvy; + if (ComponentbuilderHelper::checkArray($items) && $componentsvvvy) + { + foreach ($items as $nr => &$item) + { + if (ComponentbuilderHelper::checkJson($item->components)) + { + $item->components = json_decode($item->components, true); + } + elseif (!isset($item->components) || !ComponentbuilderHelper::checkArray($item->components)) + { + unset($items[$nr]); + continue; + } + if (!in_array($componentsvvvy,$item->components)) + { + unset($items[$nr]); + continue; + } + } + } + else + { + return false; + } + + // 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) && isset($translations['language']) && ComponentbuilderHelper::checkArray($translations['language'])) + { + foreach ($translations['language'] as $language) + { + $langBucket[$language] = $language; + } + } + } + // load the languages to the string + if (ComponentbuilderHelper::checkArray($langBucket)) + { + $item->entranslation = '(' . implode(', ', $langBucket) . ') ' . ComponentbuilderHelper::htmlEscape($item->entranslation, 'UTF-8', true, 150); + } + else + { + $item->entranslation = '(' . JText::_('COM_COMPONENTBUILDER_NOTRANSLATION') . ') ' . ComponentbuilderHelper::htmlEscape($item->entranslation, 'UTF-8', true, 150); + } + } + } + return $items; + } + return false; } /** diff --git a/admin/models/joomla_components.php b/admin/models/joomla_components.php index ddd9dad65..e48641bec 100644 --- a/admin/models/joomla_components.php +++ b/admin/models/joomla_components.php @@ -1,44 +1,44 @@ - @copyright Copyright (C) 2015. All Rights Reserved - @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html - - Builds Complex Joomla Components - -/-----------------------------------------------------------------------------------------------------------------------------*/ - -// No direct access to this file -defined('_JEXEC') or die('Restricted access'); - -// import the Joomla modellist library -jimport('joomla.application.component.modellist'); - -/** - * Joomla_components Model - */ -class ComponentbuilderModelJoomla_components extends JModelList -{ - public function __construct($config = array()) - { - if (empty($config['filter_fields'])) - { - $config['filter_fields'] = array( +/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/ + __ __ _ _____ _ _ __ __ _ _ _ + \ \ / / | | | __ \ | | | | | \/ | | | | | | | + \ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| | + \ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` | + \ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| | + \/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_| + | | + |_| +/-------------------------------------------------------------------------------------------------------------------------------/ + + @version @update number 318 of this MVC + @build 5th April, 2017 + @created 6th May, 2015 + @package Component Builder + @subpackage joomla_components.php + @author Llewellyn van der Merwe + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// import the Joomla modellist library +jimport('joomla.application.component.modellist'); + +/** + * Joomla_components Model + */ +class ComponentbuilderModelJoomla_components extends JModelList +{ + public function __construct($config = array()) + { + if (empty($config['filter_fields'])) + { + $config['filter_fields'] = array( 'a.id','id', 'a.published','published', 'a.ordering','ordering', @@ -49,946 +49,946 @@ class ComponentbuilderModelJoomla_components extends JModelList 'a.component_version','component_version', 'a.short_description','short_description', 'a.companyname','companyname', - 'a.author','author' - ); - } - - parent::__construct($config); + 'a.author','author' + ); + } + + parent::__construct($config); } - public $packagePath = false; - public $packageName = false; - public $zipPath = false; - public $key = array(); - public $info = array( - 'name' => array(), - 'short_description' => array(), - 'component_version' => array(), - 'companyname' => array(), - 'author' => array(), - 'email' => array(), - 'website' => array(), - 'license' => array(), - 'copyright' => array(), - 'getKeyFrom' => null - ); - - protected $params; - protected $tempPath; - protected $customPath; - protected $smartExport = array(); - protected $templateIds = array(); - protected $layoutIds = array(); - protected $customCodeIds = array(); - protected $customCodeM = array(); - protected $fieldTypes = array(); - protected $isRepeatable = array(); - - /** - * Method to build the export package - * - * @return bool on success. - */ - public function getSmartExport($pks) - { - // setup the query - if (ComponentbuilderHelper::checkArray($pks)) - { - // Get the user object. - $user = JFactory::getUser(); - // Create a new query object. - $db = JFactory::getDBO(); - $query = $db->getQuery(true); - - // Select some fields - $query->select(array('a.*')); - - // From the componentbuilder_joomla_component table - $query->from($db->quoteName('#__componentbuilder_joomla_component', 'a')); - $query->where('a.id IN (' . implode(',',$pks) . ')'); - - // Implement View Level Access - if (!$user->authorise('core.options', 'com_componentbuilder')) - { - $groups = implode(',', $user->getAuthorisedViewLevels()); - $query->where('a.access IN (' . $groups . ')'); - } - - // Order the results by ordering - $query->order('a.ordering ASC'); - - // Load the items - $db->setQuery($query); - $db->execute(); - if ($db->getNumRows()) - { - // load the items from db - $items = $db->loadObjectList(); - // check if we have items - if (ComponentbuilderHelper::checkArray($items)) - { - // set the paths - $comConfig = JFactory::getConfig(); - $this->tempPath = $comConfig->get('tmp_path'); - // set params - $this->params = JComponentHelper::getParams('com_componentbuilder'); - // set custom folder path - $this->customPath = $this->params->get('custom_folder_path', JPATH_COMPONENT_ADMINISTRATOR.'/custom'); - // set the package path - if (count($items) == 1) - { - $this->packageName = 'JCB_' . $this->getPackageName($items); - } - else - { - $this->packageName = 'JCB_smartPackage'; - } - $this->packagePath = $this->tempPath . '/' . $this->packageName; - $this->zipPath = $this->packagePath .'.zip'; - if (JFolder::exists($this->packagePath)) - { - // remove if old folder is found - ComponentbuilderHelper::removeFolder($this->packagePath); - } - // create the folders - JFolder::create($this->packagePath); - // Get the basic encription. - $basickey = ComponentbuilderHelper::getCryptKey('basic'); - // Get the encription object. - if ($basickey) - { - $basic = new FOFEncryptAes($basickey, 128); - } - // add custom code - $this->setData($user, $db, 'custom_code', $pks, 'component'); - // start loading the components - $this->smartExport['joomla_component'] = array(); - foreach ($items as $nr => &$item) - { - // check if user has access - $access = ($user->authorise('joomla_component.access', 'com_componentbuilder.joomla_component.' . (int) $item->id) && $user->authorise('joomla_component.access', 'com_componentbuilder')); - if (!$access) - { - unset($items[$nr]); - continue; - } - // build information data set - $this->info['name'][$item->id] = $item->name; - $this->info['short_description'][$item->id] = $item->short_description; - $this->info['component_version'][$item->id] = $item->component_version; - $this->info['companyname'][$item->id] = $item->companyname; - $this->info['author'][$item->id] = $item->author; - $this->info['email'][$item->id] = $item->email; - $this->info['website'][$item->id] = $item->website; - $this->info['license'][$item->id] = $item->license; - $this->info['copyright'][$item->id] = $item->copyright; - // set the keys - if (isset($item->export_key) && ComponentbuilderHelper::checkString($item->export_key)) - { - // keep the key locked for exported data set - $export_key = $item->export_key; - if ($basickey && !is_numeric($item->export_key) && $item->export_key === base64_encode(base64_decode($item->export_key, true))) - { - $export_key = rtrim($basic->decryptString($item->export_key), "\0"); - } - // make sure we have a string - if (strlen($export_key) > 4 ) - { - $this->key[$item->id] = $export_key; - } - } - // build files - $this->moveIt($item->addfiles, 'file'); - // build folders - $this->moveIt($item->addfolders, 'folder'); - // component image - $this->moveIt(array('image' => array($item->image)), 'image'); - // add config fields - $this->setData($user, $db, 'field', $item->addconfig, 'field'); - // add admin views - $this->setData($user, $db, 'admin_view', $item->addadmin_views, 'adminview'); - // add custom admin views - $this->setData($user, $db, 'custom_admin_view', $item->addcustom_admin_views, 'customadminview'); - // add site views - $this->setData($user, $db, 'site_view', $item->addsite_views, 'siteview'); - // set the custom code ID's - $this->setCustomCodeIds($item, 'joomla_component'); - // load to global object - $this->smartExport['joomla_component'][$item->id] = $item; - } - // add templates - if (ComponentbuilderHelper::checkArray($this->templateIds)) - { - $this->setData($user, $db, 'template', array('template' => $this->templateIds), 'template'); - } - // add layouts - if (ComponentbuilderHelper::checkArray($this->layoutIds)) - { - $this->setData($user, $db, 'layout', array('layout' => $this->layoutIds), 'layout'); - } - // add custom code - if (ComponentbuilderHelper::checkArray($this->customCodeIds)) - { - $this->setData($user, $db, 'custom_code', array('custom_code' => $this->customCodeIds), 'custom_code'); - } - // has any data been set - if (ComponentbuilderHelper::checkArray($this->smartExport['joomla_component'])) - { - // set the folder and move the files of each component to the folder - return $this->smartExportBuilder(); - } - } - } - } - return false; - } - - /** - * Method to build the package to export - * - * @return void - */ - protected function smartExportBuilder() - { - // set db data - $data = serialize($this->smartExport); - // lock the data if set - if (ComponentbuilderHelper::checkArray($this->key)) - { - // lock the data - $this->key = md5(implode('', $this->key)); - $locker = new FOFEncryptAes($this->key, 128); - $data = $locker->encryptString($data); - // Set the key owner information - $this->info['getKeyFrom'] = array(); - $this->info['getKeyFrom']['company'] = $this->params->get('export_company', null); - $this->info['getKeyFrom']['owner'] = $this->params->get('export_owner', null); - $this->info['getKeyFrom']['email'] = $this->params->get('export_email', null); - $this->info['getKeyFrom']['website'] = $this->params->get('export_website', null); - $this->info['getKeyFrom']['license'] = $this->params->get('export_license', null); - $this->info['getKeyFrom']['copyright'] = $this->params->get('export_copyright', null); - $this->info['getKeyFrom']['buy_link'] = ($buy_link = $this->params->get('export_buy_link', null)) ? $buy_link . $this->params->get('export_buy_query', '&package=') . $this->packageName : null; - $this->info['getKeyFrom']['package_link'] = ($package_link = $this->params->get('export_package_link', null)) ? $package_link . $this->params->get('export_package_query', '&package=') . $this->packageName : null; - } - else - { - // Set the owner information - $data = base64_encode($data); - } - // set the path - $dbPath = $this->packagePath . '/db.vdm'; - // write the db data to file in package - if (!ComponentbuilderHelper::writeFile($dbPath, wordwrap($data, 128, "\n", true))) - { - return false; - } - // set info data - $locker = new FOFEncryptAes('V4stD3vel0pmEntMethOd@YoUrS3rv!s', 128); - $info = $locker->encryptString(json_encode($this->info)); - // set the path - $infoPath = $this->packagePath . '/info.vdm'; - // write the db data to file in package - if (!ComponentbuilderHelper::writeFile($infoPath, wordwrap($info, 128, "\n", true))) - { - return false; - } - // lock all files - $this->lockFiles(); - // remove old zip files with the same name - if (JFile::exists($this->zipPath)) - { - // remove file if found - JFile::delete($this->zipPath); - } - // zip the folder - if (!ComponentbuilderHelper::zip($this->packagePath, $this->zipPath)) - { - return false; - } - // remove the folder - if (!ComponentbuilderHelper::removeFolder($this->packagePath)) - { - return false; - } - return true; - } - - /** - * Method to lock all files - * - * @return void - */ - protected function lockFiles() - { - // lock the data if set - if (ComponentbuilderHelper::checkString($this->key) && strlen($this->key) == 32) - { - $locker = new FOFEncryptAes($this->key, 128); - // we must first store the current working directory - $joomla = getcwd(); - // setup the type path - $customPath = $this->packagePath . '/custom'; - // go to the custom folder if found - if (JFolder::exists($customPath)) - { - $this->lock($customPath, $locker); - } - // setup the type path - $imagesPath = $this->packagePath . '/images'; - // go to the custom folder if found - if (JFolder::exists($imagesPath)) - { - $this->lock($imagesPath, $locker); - } - // change back to working dir - chdir($joomla); - } - } - - /** - * The Locker - * - * @return void - */ - protected function lock(&$tmpPath, &$locker) - { - // we are changing the working directory to the tmp path (important) - chdir($tmpPath); - // get a list of files in the current directory tree (all) - $files = JFolder::files('.', '.', true, true); - // read in the file content - foreach ($files as $file) - { - // write the encrypted string back to file - if (!ComponentbuilderHelper::writeFile($file, wordwrap($locker->encryptString(file_get_contents($file)), 128, "\n", true))) - { - // we should add error handler here in case file could not be locked - } - } - } - - /** - * Method to move the files and folder to the package folder - * - * @return bool - */ - protected function moveIt($data, $type) - { - // if json convert to array - if (ComponentbuilderHelper::checkJson($data)) - { - $data = json_decode($data, true); - } - // make sure we have an array - if (!ComponentbuilderHelper::checkArray($data) || !isset($data[$type]) || !ComponentbuilderHelper::checkArray($data[$type])) - { - return false; - } - // set the name of the folder - if ('file' === $type || 'folder' === $type) - { - $name = 'custom'; - } - if ('image' === $type) - { - $name = 'images'; - } - // setup the type path - $tmpPath = $this->packagePath . '/' . $name; - // create type path if not set - if (!JFolder::exists($tmpPath)) - { - // create the folders if not found - JFolder::create($tmpPath); - } - // now move it - foreach ($data[$type] as $item) - { - if (ComponentbuilderHelper::checkString($item)) - { - if ('file' === $type) - { - if (!JFile::exists($tmpPath.'/'.$item) && JFile::exists($this->customPath.'/'.$item)) - { - // move the file to its place - JFile::copy($this->customPath.'/'.$item, $tmpPath.'/'.$item,'',true); - } - } - if ('image' === $type) - { - if (!JFile::exists($this->packagePath.'/'.$item) && JFile::exists(JPATH_ROOT.'/'.$item)) - { - // move the file to its place - JFile::copy(JPATH_ROOT.'/'.$item, $this->packagePath.'/'.$item,'',true); - } - } - if ('folder' === $type) - { - if (!JFolder::exists($tmpPath.'/'.$item) && JFolder::exists($this->customPath.'/'.$item)) - { - // move the folder to its place - JFolder::copy($this->customPath.'/'.$item, $tmpPath.'/'.$item,'',true); - } - } - } - } - return true; - } - - /** - * Method to get data of a given table. - * - * @return mixed An array of data items on success, false on failure. - */ - protected function setData(&$user, &$db, $table, $values, $key) - { - // if json convert to array - if (ComponentbuilderHelper::checkJson($values)) - { - $values = json_decode($values, true); - } - // make sure we have an array - if (('custom_code' !== $table && 'component' !== $key && 'custom_get' !== $key) && (!ComponentbuilderHelper::checkArray($values) || !isset($values[$key]) || !ComponentbuilderHelper::checkArray($values[$key]))) - { - return false; - } - elseif (!ComponentbuilderHelper::checkArray($values)) - { - return false; - } - $query = $db->getQuery(true); - - // Select some fields - $query->select(array('a.*')); - - // From the componentbuilder_ANY table - $query->from($db->quoteName('#__componentbuilder_'. $table, 'a')); - if ('custom_code' === $table && 'component' === $key) - { - $query->where('a.component IN (' . implode(',',$values) . ')'); - } - elseif ('custom_get' === $key) - { - $query->where('a.id IN (' . implode(',',$values) . ')'); - } - else - { - $query->where('a.id IN (' . implode(',',$values[$key]) . ')'); - } - - // Implement View Level Access - if (!$user->authorise('core.options', 'com_componentbuilder')) - { - $groups = implode(',', $user->getAuthorisedViewLevels()); - $query->where('a.access IN (' . $groups . ')'); - } - - // Order the results by ordering - $query->order('a.ordering ASC'); - - // Load the items - $db->setQuery($query); - $db->execute(); - if ($db->getNumRows()) - { - $items = $db->loadObjectList(); - // check if we have items - if (ComponentbuilderHelper::checkArray($items)) - { - // set search array - if ('site_view' === $table || 'custom_admin_view' === $table) - { - $searchArray = array('php_view','php_jview','php_jview_display','php_document','js_document','css_document','css'); - } - // reset the global array - if ('template' === $table) - { - $this->templateIds = array(); - } - elseif ('layout' === $table) - { - $this->layoutIds = array(); - } - // start loading the data - if (!isset($this->smartExport[$table])) - { - $this->smartExport[$table] = array(); - } - foreach ($items as $nr => &$item) - { - // set the data per id only once - if (isset($this->smartExport[$table][$item->id])) - { - continue; - } - // load to global object - $this->smartExport[$table][$item->id] = $item; - // set the custom code ID's - $this->setCustomCodeIds($item, $table); - // actions to take if table is admin_view - if ('admin_view' === $table) - { - // add fields - $this->setData($user, $db, 'field', $item->addfields, 'field'); - // admin icon - $this->moveIt(array('image' => array($item->icon)), 'image'); - // admin icon_add - $this->moveIt(array('image' => array($item->icon_add)), 'image'); - // admin icon_category - $this->moveIt(array('image' => array($item->icon_category)), 'image'); - } - // actions to take if table is field - if ('field' === $table) - { - // add field types - $this->setData($user, $db, 'fieldtype', array('fieldtype' => array($item->fieldtype)), 'fieldtype'); - // we must add a repeatable field subfields - if ($this->checkRepeatable($item->fieldtype)) - { - $fields = ComponentbuilderHelper::getBetween(json_decode($item->xml), 'fields="', '"'); - $fieldsSets = array(); - if (strpos($fields, ',') !== false) - { - // multiple fields - $fieldsSets = (array) explode(',', $fields); - } - elseif (is_numeric($fields)) - { - // single field - $fieldsSets[] = (int) $fields; - } - // get fields - if (ComponentbuilderHelper::checkArray($fieldsSets)) - { - $this->setData($user, $db, 'field', array('field' => $fieldsSets), 'field'); - } - } - } - // actions to take if table is site_view and custom_admin_view - if ('site_view' === $table || 'custom_admin_view' === $table) - { - // search for templates & layouts - $this->getTemplateLayout(base64_decode($item->default), $db); - // add search array templates and layouts - foreach ($searchArray as $scripter) - { - if (isset($item->{'add_'.$scripter}) && $item->{'add_'.$scripter} == 1) - { - $this->getTemplateLayout($item->$scripter, $db); - } - } - // add dynamic gets - $this->setData($user, $db, 'dynamic_get', array('dynamic_get' => array($item->main_get)), 'dynamic_get'); - $this->setData($user, $db, 'dynamic_get', $item->custom_get, 'custom_get'); - if ('custom_admin_view' === $table && isset($item->icon)) - { - // view icon - $this->moveIt(array('image' => array($item->icon)), 'image'); - } - // add snippets - $this->setData($user, $db, 'snippet', array('snippet' => array($item->snippet)), 'snippet'); - } - // actions to take if table is template and layout - if ('layout' === $table || 'template' === $table) - { - // search for templates & layouts - $this->getTemplateLayout(base64_decode($item->$table), $db, $user); - // add search array templates and layouts - if (isset($item->add_php_view) && $item->add_php_view == 1) - { - $this->getTemplateLayout($item->php_view, $db, $user); - } - // add dynamic gets - $this->setData($user, $db, 'dynamic_get', array('dynamic_get' => $item->dynamic_get), 'dynamic_get'); - // add snippets - $this->setData($user, $db, 'snippet', array('snippet' => array($item->snippet)), 'snippet'); - } - } - } - } - } - - /** - * Check if a field is a repeatable field - * - * @param string $typeID The type ID - * - * @return bool true on success - * - */ - protected function checkRepeatable($typeID) - { - if(isset($this->isRepeatable[$typeID])) - { - return true; - } - elseif (ComponentbuilderHelper::checkArray($this->isRepeatable)) - { - return false; - } - elseif ($type = $this->getFieldType($typeID)) - { - if ('repeatable' === $type) - { - $this->isRepeatable[$typeID] = true; - return true; - } - } - return false; - } - - /** - * Get the field type - * - * @param string $id The field type id - * - * @return string field type - * - */ - protected function getFieldType($id) - { - if (!isset($this->fieldTypes[$id])) - { - $properties = ComponentbuilderHelper::getVar('fieldtype', $id, 'id', 'properties'); - if (ComponentbuilderHelper::checkJson($properties)) - { - $properties = json_decode($properties, true); - if (isset($properties['name']) && ComponentbuilderHelper::checkArray($properties['name'])) - { - foreach ($properties['name'] as $key => $value) - { - if ('type' === $value) - { - if (isset($properties['example'][$key]) && ComponentbuilderHelper::checkString($properties['example'][$key])) - { - $this->fieldTypes[$id] = $properties['example'][$key]; - break; - } - } - } - } - } - // if not found - if (!isset($this->fieldTypes[$id]) && $name = ComponentbuilderHelper::getVar('fieldtype', $id, 'id', 'name')) - { - $this->fieldTypes[$id] = ComponentbuilderHelper::safeString($name); - } - } - // return the type - if (isset($this->fieldTypes[$id])) - { - return $this->fieldTypes[$id]; - } - return false; - } - - /** - * Set Template and Layout Data - * - * @param string $default The content to check - * - * @return void - * - */ - protected function getTemplateLayout($default, &$db, $user = false) - { - // set the Template data - $temp1 = ComponentbuilderHelper::getAllBetween($default, "\$this->loadTemplate('","')"); - $temp2 = ComponentbuilderHelper::getAllBetween($default, '$this->loadTemplate("','")'); - $templates = array(); - $again = array(); - if (ComponentbuilderHelper::checkArray($temp1) && ComponentbuilderHelper::checkArray($temp2)) - { - $templates = array_merge($temp1,$temp2); - } - else - { - if (ComponentbuilderHelper::checkArray($temp1)) - { - $templates = $temp1; - } - elseif (ComponentbuilderHelper::checkArray($temp2)) - { - $templates = $temp2; - } - } - if (ComponentbuilderHelper::checkArray($templates)) - { - foreach ($templates as $template) - { - $data = $this->getDataWithAlias($template, 'template', $db); - if (ComponentbuilderHelper::checkArray($data)) - { - if (!isset($this->templateIds[$data['id']])) - { - $this->templateIds[$data['id']] = $data['id']; - // call self to get child data - $again[] = $data['html']; - $again[] = $data['php_view']; - } - } - } - } - // set the layout data - $lay1 = ComponentbuilderHelper::getAllBetween($default, "JLayoutHelper::render('","',"); - $lay2 = ComponentbuilderHelper::getAllBetween($default, 'JLayoutHelper::render("','",'); - if (ComponentbuilderHelper::checkArray($lay1) && ComponentbuilderHelper::checkArray($lay2)) - { - $layouts = array_merge($lay1,$lay2); - } - else - { - if (ComponentbuilderHelper::checkArray($lay1)) - { - $layouts = $lay1; - } - elseif (ComponentbuilderHelper::checkArray($lay2)) - { - $layouts = $lay2; - } - } - if (isset($layouts) && ComponentbuilderHelper::checkArray($layouts)) - { - foreach ($layouts as $layout) - { - $data = $this->getDataWithAlias($layout, 'layout', $db); - if (ComponentbuilderHelper::checkArray($data)) - { - if (!isset($this->layoutIds[$data['id']])) - { - $this->layoutIds[$data['id']] = $data['id']; - // call self to get child data - $again[] = $data['html']; - $again[] = $data['php_view']; - } - } - } - } - if (ComponentbuilderHelper::checkArray($again)) - { - foreach ($again as $get) - { - $this->getTemplateLayout($get, $db); - } - } - // Set the Data - if ($user) - { - // add templates - if (ComponentbuilderHelper::checkArray($this->templateIds)) - { - $this->setData($user, $db, 'template', array('template' => $this->templateIds), 'template'); - } - // add layouts - if (ComponentbuilderHelper::checkArray($this->layoutIds)) - { - $this->setData($user, $db, 'layout', array('layout' => $this->layoutIds), 'layout'); - } - } - } - - /** - * Get Data With Alias - * - * @param string $n_ame The alias name - * @param string $table The table where to find the alias - * @param string $view The view code name - * - * @return array The data found with the alias - * - */ - protected function getDataWithAlias($n_ame, $table, &$db) - { - // Create a new query object. - $query = $db->getQuery(true); - $query->select($db->quoteName(array('a.id', 'a.alias', 'a.'.$table, 'a.php_view', 'a.add_php_view'))); - $query->from('#__componentbuilder_'.$table.' AS a'); - $db->setQuery($query); - $rows = $db->loadObjectList(); - foreach ($rows as $row) - { - $k_ey = ComponentbuilderHelper::safeString($row->alias); - $key = preg_replace("/[^A-Za-z]/", '', $k_ey); - $name = preg_replace("/[^A-Za-z]/", '', $n_ame); - if ($k_ey == $n_ame || $key == $name) - { - $php_view = ''; - if ($row->add_php_view == 1) - { - $php_view = base64_decode($row->php_view); - } - $contnent = base64_decode($row->{$table}); - // return to continue the search - return array('id' => $row->id, 'html' => $contnent, 'php_view' => $php_view); - } - } - return false; - } - - /** - * Set the ids of the found custom code - * - * @param object $item The item being searched - * @param string $target The target table - * - * @return void - * - */ - protected function setCustomCodeIds($item, $target) - { - if ($keys = $this->getCodeSearchKeys($target)) - { - foreach ($keys['search'] as $key) - { - if (!isset($keys['not_base64'][$key])) - { - $value = base64_decode($item->{$key}); - } - else - { - $value = $item->{$key}; - } - // search the value to see if it has custom code - $codeArray = ComponentbuilderHelper::getAllBetween($value, '[CUSTOMC' . 'ODE=',']'); - if (ComponentbuilderHelper::checkArray($codeArray)) - { - foreach ($codeArray as $func) - { - // first make sure we have only the function key - if (strpos($func, '+') !== false) - { - $funcArray = explode('+', $func); - $func = $funcArray[0]; - } - if (!isset($this->customCodeM[$func])) - { - $this->customCodeM[$func] = $func; - // if numeric add to ids - if (is_numeric($func)) - { - $this->customCodeIds[$func] = (int) $func; - } - elseif (ComponentbuilderHelper::checkString($func)) - { - if ($funcID = ComponentbuilderHelper::getVar('custom_code', $func, 'function_name', 'id')) - { - $this->customCodeIds[$funcID] = (int) $funcID; - } - } - } - } - } - } - } - } - - /** - * Get the package name - * - * @param array $items of all components - * - * @return string The package name - * - */ - protected function getPackageName(&$items) - { - foreach ($items as $item) - { - if (isset($item->system_name)) - { - return ComponentbuilderHelper::safeString($item->system_name, 'cAmel'); - } - else - { - return ComponentbuilderHelper::safeString($item->name_code); - } - } - } - - /** - * Get the keys of the values to search custom code in - * - * @param string $targe The table targeted - * - * @return array The query options - * - */ - protected function getCodeSearchKeys($target) - { - $targets = array(); - // #__componentbuilder_joomla_component as a - $targets['joomla_component'] = array(); - $targets['joomla_component']['search'] = array('php_preflight_install','php_postflight_install', - 'php_preflight_update','php_postflight_update','php_method_uninstall', - 'php_helper_admin','php_admin_event','php_helper_both','php_helper_site', - 'php_site_event','php_dashboard_methods','dashboard_tab'); - $targets['joomla_component']['not_base64'] = array('dashboard_tab' => 'json'); - - // #__componentbuilder_admin_view as b - $targets['admin_view'] = array(); - $targets['admin_view']['search'] = array('javascript_view_file','javascript_view_footer','javascript_views_file', - 'javascript_views_footer','php_getitem','php_save','php_postsavehook','php_getitems', - 'php_getitems_after_all','php_getlistquery','php_allowedit','php_before_delete', - 'php_after_delete','php_before_publish','php_after_publish','php_batchcopy', - 'php_batchmove','php_document','php_model','php_controller','php_import_display', - 'php_import','php_import_setdata','php_import_save','html_import_view','php_ajaxmethod'); - $targets['admin_view']['not_base64'] = array(); - - // #__componentbuilder_custom_admin_view as c - $targets['custom_admin_view'] = array(); - $targets['custom_admin_view']['search'] = array('default','php_view','php_jview','php_jview_display','php_document', - 'js_document','css_document','css','php_model','php_controller'); - $targets['custom_admin_view']['not_base64'] = array(); - - // #__componentbuilder_site_view as d - $targets['site_view'] = array(); - $targets['site_view']['search'] = array('default','php_view','php_jview','php_jview_display','php_document', - 'js_document','css_document','css','php_ajaxmethod','php_model','php_controller'); - $targets['site_view']['not_base64'] = array(); - - // #__componentbuilder_field as e - $targets['field'] = array(); - $targets['field']['search'] = array('xml','javascript_view_footer','javascript_views_footer'); - $targets['field']['not_base64'] = array('xml' => 'json'); - - // #__componentbuilder_dynamic_get as f - $targets['dynamic_get'] = array(); - $targets['dynamic_get']['search'] = array('php_before_getitem','php_after_getitem','php_before_getitems','php_after_getitems', - 'php_getlistquery'); - $targets['dynamic_get']['not_base64'] = array(); - - // #__componentbuilder_template as g - $targets['template'] = array(); - $targets['template']['search'] = array('php_view','template'); - $targets['template']['not_base64'] = array(); - - // #__componentbuilder_layout as h - $targets['layout'] = array(); - $targets['layout']['search'] = array('php_view','layout'); - $targets['layout']['not_base64'] = array(); - - // return the query string to search - if (isset($targets[$target])) - { - return $targets[$target]; - } - return false; - } - - /** - * Method to auto-populate the model state. - * - * @return void - */ - protected function populateState($ordering = null, $direction = null) - { - $app = JFactory::getApplication(); - - // Adjust the context to support modal layouts. - if ($layout = $app->input->get('layout')) - { - $this->context .= '.' . $layout; - } + public $packagePath = false; + public $packageName = false; + public $zipPath = false; + public $key = array(); + public $info = array( + 'name' => array(), + 'short_description' => array(), + 'component_version' => array(), + 'companyname' => array(), + 'author' => array(), + 'email' => array(), + 'website' => array(), + 'license' => array(), + 'copyright' => array(), + 'getKeyFrom' => null + ); + + protected $params; + protected $tempPath; + protected $customPath; + protected $smartExport = array(); + protected $templateIds = array(); + protected $layoutIds = array(); + protected $customCodeIds = array(); + protected $customCodeM = array(); + protected $fieldTypes = array(); + protected $isRepeatable = array(); + + /** + * Method to build the export package + * + * @return bool on success. + */ + public function getSmartExport($pks) + { + // setup the query + if (ComponentbuilderHelper::checkArray($pks)) + { + // Get the user object. + $user = JFactory::getUser(); + // Create a new query object. + $db = JFactory::getDBO(); + $query = $db->getQuery(true); + + // Select some fields + $query->select(array('a.*')); + + // From the componentbuilder_joomla_component table + $query->from($db->quoteName('#__componentbuilder_joomla_component', 'a')); + $query->where('a.id IN (' . implode(',',$pks) . ')'); + + // Implement View Level Access + if (!$user->authorise('core.options', 'com_componentbuilder')) + { + $groups = implode(',', $user->getAuthorisedViewLevels()); + $query->where('a.access IN (' . $groups . ')'); + } + + // Order the results by ordering + $query->order('a.ordering ASC'); + + // Load the items + $db->setQuery($query); + $db->execute(); + if ($db->getNumRows()) + { + // load the items from db + $items = $db->loadObjectList(); + // check if we have items + if (ComponentbuilderHelper::checkArray($items)) + { + // set the paths + $comConfig = JFactory::getConfig(); + $this->tempPath = $comConfig->get('tmp_path'); + // set params + $this->params = JComponentHelper::getParams('com_componentbuilder'); + // set custom folder path + $this->customPath = $this->params->get('custom_folder_path', JPATH_COMPONENT_ADMINISTRATOR.'/custom'); + // set the package path + if (count($items) == 1) + { + $this->packageName = 'JCB_' . $this->getPackageName($items); + } + else + { + $this->packageName = 'JCB_smartPackage'; + } + $this->packagePath = $this->tempPath . '/' . $this->packageName; + $this->zipPath = $this->packagePath .'.zip'; + if (JFolder::exists($this->packagePath)) + { + // remove if old folder is found + ComponentbuilderHelper::removeFolder($this->packagePath); + } + // create the folders + JFolder::create($this->packagePath); + // Get the basic encription. + $basickey = ComponentbuilderHelper::getCryptKey('basic'); + // Get the encription object. + if ($basickey) + { + $basic = new FOFEncryptAes($basickey, 128); + } + // add custom code + $this->setData($user, $db, 'custom_code', $pks, 'component'); + // start loading the components + $this->smartExport['joomla_component'] = array(); + foreach ($items as $nr => &$item) + { + // check if user has access + $access = ($user->authorise('joomla_component.access', 'com_componentbuilder.joomla_component.' . (int) $item->id) && $user->authorise('joomla_component.access', 'com_componentbuilder')); + if (!$access) + { + unset($items[$nr]); + continue; + } + // build information data set + $this->info['name'][$item->id] = $item->name; + $this->info['short_description'][$item->id] = $item->short_description; + $this->info['component_version'][$item->id] = $item->component_version; + $this->info['companyname'][$item->id] = $item->companyname; + $this->info['author'][$item->id] = $item->author; + $this->info['email'][$item->id] = $item->email; + $this->info['website'][$item->id] = $item->website; + $this->info['license'][$item->id] = $item->license; + $this->info['copyright'][$item->id] = $item->copyright; + // set the keys + if (isset($item->export_key) && ComponentbuilderHelper::checkString($item->export_key)) + { + // keep the key locked for exported data set + $export_key = $item->export_key; + if ($basickey && !is_numeric($item->export_key) && $item->export_key === base64_encode(base64_decode($item->export_key, true))) + { + $export_key = rtrim($basic->decryptString($item->export_key), "\0"); + } + // make sure we have a string + if (strlen($export_key) > 4 ) + { + $this->key[$item->id] = $export_key; + } + } + // build files + $this->moveIt($item->addfiles, 'file'); + // build folders + $this->moveIt($item->addfolders, 'folder'); + // component image + $this->moveIt(array('image' => array($item->image)), 'image'); + // add config fields + $this->setData($user, $db, 'field', $item->addconfig, 'field'); + // add admin views + $this->setData($user, $db, 'admin_view', $item->addadmin_views, 'adminview'); + // add custom admin views + $this->setData($user, $db, 'custom_admin_view', $item->addcustom_admin_views, 'customadminview'); + // add site views + $this->setData($user, $db, 'site_view', $item->addsite_views, 'siteview'); + // set the custom code ID's + $this->setCustomCodeIds($item, 'joomla_component'); + // load to global object + $this->smartExport['joomla_component'][$item->id] = $item; + } + // add templates + if (ComponentbuilderHelper::checkArray($this->templateIds)) + { + $this->setData($user, $db, 'template', array('template' => $this->templateIds), 'template'); + } + // add layouts + if (ComponentbuilderHelper::checkArray($this->layoutIds)) + { + $this->setData($user, $db, 'layout', array('layout' => $this->layoutIds), 'layout'); + } + // add custom code + if (ComponentbuilderHelper::checkArray($this->customCodeIds)) + { + $this->setData($user, $db, 'custom_code', array('custom_code' => $this->customCodeIds), 'custom_code'); + } + // has any data been set + if (ComponentbuilderHelper::checkArray($this->smartExport['joomla_component'])) + { + // set the folder and move the files of each component to the folder + return $this->smartExportBuilder(); + } + } + } + } + return false; + } + + /** + * Method to build the package to export + * + * @return void + */ + protected function smartExportBuilder() + { + // set db data + $data = serialize($this->smartExport); + // lock the data if set + if (ComponentbuilderHelper::checkArray($this->key)) + { + // lock the data + $this->key = md5(implode('', $this->key)); + $locker = new FOFEncryptAes($this->key, 128); + $data = $locker->encryptString($data); + // Set the key owner information + $this->info['getKeyFrom'] = array(); + $this->info['getKeyFrom']['company'] = $this->params->get('export_company', null); + $this->info['getKeyFrom']['owner'] = $this->params->get('export_owner', null); + $this->info['getKeyFrom']['email'] = $this->params->get('export_email', null); + $this->info['getKeyFrom']['website'] = $this->params->get('export_website', null); + $this->info['getKeyFrom']['license'] = $this->params->get('export_license', null); + $this->info['getKeyFrom']['copyright'] = $this->params->get('export_copyright', null); + $this->info['getKeyFrom']['buy_link'] = ($buy_link = $this->params->get('export_buy_link', null)) ? $buy_link . $this->params->get('export_buy_query', '&package=') . $this->packageName : null; + $this->info['getKeyFrom']['package_link'] = ($package_link = $this->params->get('export_package_link', null)) ? $package_link . $this->params->get('export_package_query', '&package=') . $this->packageName : null; + } + else + { + // Set the owner information + $data = base64_encode($data); + } + // set the path + $dbPath = $this->packagePath . '/db.vdm'; + // write the db data to file in package + if (!ComponentbuilderHelper::writeFile($dbPath, wordwrap($data, 128, "\n", true))) + { + return false; + } + // set info data + $locker = new FOFEncryptAes('V4stD3vel0pmEntMethOd@YoUrS3rv!s', 128); + $info = $locker->encryptString(json_encode($this->info)); + // set the path + $infoPath = $this->packagePath . '/info.vdm'; + // write the db data to file in package + if (!ComponentbuilderHelper::writeFile($infoPath, wordwrap($info, 128, "\n", true))) + { + return false; + } + // lock all files + $this->lockFiles(); + // remove old zip files with the same name + if (JFile::exists($this->zipPath)) + { + // remove file if found + JFile::delete($this->zipPath); + } + // zip the folder + if (!ComponentbuilderHelper::zip($this->packagePath, $this->zipPath)) + { + return false; + } + // remove the folder + if (!ComponentbuilderHelper::removeFolder($this->packagePath)) + { + return false; + } + return true; + } + + /** + * Method to lock all files + * + * @return void + */ + protected function lockFiles() + { + // lock the data if set + if (ComponentbuilderHelper::checkString($this->key) && strlen($this->key) == 32) + { + $locker = new FOFEncryptAes($this->key, 128); + // we must first store the current working directory + $joomla = getcwd(); + // setup the type path + $customPath = $this->packagePath . '/custom'; + // go to the custom folder if found + if (JFolder::exists($customPath)) + { + $this->lock($customPath, $locker); + } + // setup the type path + $imagesPath = $this->packagePath . '/images'; + // go to the custom folder if found + if (JFolder::exists($imagesPath)) + { + $this->lock($imagesPath, $locker); + } + // change back to working dir + chdir($joomla); + } + } + + /** + * The Locker + * + * @return void + */ + protected function lock(&$tmpPath, &$locker) + { + // we are changing the working directory to the tmp path (important) + chdir($tmpPath); + // get a list of files in the current directory tree (all) + $files = JFolder::files('.', '.', true, true); + // read in the file content + foreach ($files as $file) + { + // write the encrypted string back to file + if (!ComponentbuilderHelper::writeFile($file, wordwrap($locker->encryptString(file_get_contents($file)), 128, "\n", true))) + { + // we should add error handler here in case file could not be locked + } + } + } + + /** + * Method to move the files and folder to the package folder + * + * @return bool + */ + protected function moveIt($data, $type) + { + // if json convert to array + if (ComponentbuilderHelper::checkJson($data)) + { + $data = json_decode($data, true); + } + // make sure we have an array + if (!ComponentbuilderHelper::checkArray($data) || !isset($data[$type]) || !ComponentbuilderHelper::checkArray($data[$type])) + { + return false; + } + // set the name of the folder + if ('file' === $type || 'folder' === $type) + { + $name = 'custom'; + } + if ('image' === $type) + { + $name = 'images'; + } + // setup the type path + $tmpPath = $this->packagePath . '/' . $name; + // create type path if not set + if (!JFolder::exists($tmpPath)) + { + // create the folders if not found + JFolder::create($tmpPath); + } + // now move it + foreach ($data[$type] as $item) + { + if (ComponentbuilderHelper::checkString($item)) + { + if ('file' === $type) + { + if (!JFile::exists($tmpPath.'/'.$item) && JFile::exists($this->customPath.'/'.$item)) + { + // move the file to its place + JFile::copy($this->customPath.'/'.$item, $tmpPath.'/'.$item,'',true); + } + } + if ('image' === $type) + { + if (!JFile::exists($this->packagePath.'/'.$item) && JFile::exists(JPATH_ROOT.'/'.$item)) + { + // move the file to its place + JFile::copy(JPATH_ROOT.'/'.$item, $this->packagePath.'/'.$item,'',true); + } + } + if ('folder' === $type) + { + if (!JFolder::exists($tmpPath.'/'.$item) && JFolder::exists($this->customPath.'/'.$item)) + { + // move the folder to its place + JFolder::copy($this->customPath.'/'.$item, $tmpPath.'/'.$item,'',true); + } + } + } + } + return true; + } + + /** + * Method to get data of a given table. + * + * @return mixed An array of data items on success, false on failure. + */ + protected function setData(&$user, &$db, $table, $values, $key) + { + // if json convert to array + if (ComponentbuilderHelper::checkJson($values)) + { + $values = json_decode($values, true); + } + // make sure we have an array + if (('custom_code' !== $table && 'component' !== $key && 'custom_get' !== $key) && (!ComponentbuilderHelper::checkArray($values) || !isset($values[$key]) || !ComponentbuilderHelper::checkArray($values[$key]))) + { + return false; + } + elseif (!ComponentbuilderHelper::checkArray($values)) + { + return false; + } + $query = $db->getQuery(true); + + // Select some fields + $query->select(array('a.*')); + + // From the componentbuilder_ANY table + $query->from($db->quoteName('#__componentbuilder_'. $table, 'a')); + if ('custom_code' === $table && 'component' === $key) + { + $query->where('a.component IN (' . implode(',',$values) . ')'); + } + elseif ('custom_get' === $key) + { + $query->where('a.id IN (' . implode(',',$values) . ')'); + } + else + { + $query->where('a.id IN (' . implode(',',$values[$key]) . ')'); + } + + // Implement View Level Access + if (!$user->authorise('core.options', 'com_componentbuilder')) + { + $groups = implode(',', $user->getAuthorisedViewLevels()); + $query->where('a.access IN (' . $groups . ')'); + } + + // Order the results by ordering + $query->order('a.ordering ASC'); + + // Load the items + $db->setQuery($query); + $db->execute(); + if ($db->getNumRows()) + { + $items = $db->loadObjectList(); + // check if we have items + if (ComponentbuilderHelper::checkArray($items)) + { + // set search array + if ('site_view' === $table || 'custom_admin_view' === $table) + { + $searchArray = array('php_view','php_jview','php_jview_display','php_document','js_document','css_document','css'); + } + // reset the global array + if ('template' === $table) + { + $this->templateIds = array(); + } + elseif ('layout' === $table) + { + $this->layoutIds = array(); + } + // start loading the data + if (!isset($this->smartExport[$table])) + { + $this->smartExport[$table] = array(); + } + foreach ($items as $nr => &$item) + { + // set the data per id only once + if (isset($this->smartExport[$table][$item->id])) + { + continue; + } + // load to global object + $this->smartExport[$table][$item->id] = $item; + // set the custom code ID's + $this->setCustomCodeIds($item, $table); + // actions to take if table is admin_view + if ('admin_view' === $table) + { + // add fields + $this->setData($user, $db, 'field', $item->addfields, 'field'); + // admin icon + $this->moveIt(array('image' => array($item->icon)), 'image'); + // admin icon_add + $this->moveIt(array('image' => array($item->icon_add)), 'image'); + // admin icon_category + $this->moveIt(array('image' => array($item->icon_category)), 'image'); + } + // actions to take if table is field + if ('field' === $table) + { + // add field types + $this->setData($user, $db, 'fieldtype', array('fieldtype' => array($item->fieldtype)), 'fieldtype'); + // we must add a repeatable field subfields + if ($this->checkRepeatable($item->fieldtype)) + { + $fields = ComponentbuilderHelper::getBetween(json_decode($item->xml), 'fields="', '"'); + $fieldsSets = array(); + if (strpos($fields, ',') !== false) + { + // multiple fields + $fieldsSets = (array) explode(',', $fields); + } + elseif (is_numeric($fields)) + { + // single field + $fieldsSets[] = (int) $fields; + } + // get fields + if (ComponentbuilderHelper::checkArray($fieldsSets)) + { + $this->setData($user, $db, 'field', array('field' => $fieldsSets), 'field'); + } + } + } + // actions to take if table is site_view and custom_admin_view + if ('site_view' === $table || 'custom_admin_view' === $table) + { + // search for templates & layouts + $this->getTemplateLayout(base64_decode($item->default), $db); + // add search array templates and layouts + foreach ($searchArray as $scripter) + { + if (isset($item->{'add_'.$scripter}) && $item->{'add_'.$scripter} == 1) + { + $this->getTemplateLayout($item->$scripter, $db); + } + } + // add dynamic gets + $this->setData($user, $db, 'dynamic_get', array('dynamic_get' => array($item->main_get)), 'dynamic_get'); + $this->setData($user, $db, 'dynamic_get', $item->custom_get, 'custom_get'); + if ('custom_admin_view' === $table && isset($item->icon)) + { + // view icon + $this->moveIt(array('image' => array($item->icon)), 'image'); + } + // add snippets + $this->setData($user, $db, 'snippet', array('snippet' => array($item->snippet)), 'snippet'); + } + // actions to take if table is template and layout + if ('layout' === $table || 'template' === $table) + { + // search for templates & layouts + $this->getTemplateLayout(base64_decode($item->$table), $db, $user); + // add search array templates and layouts + if (isset($item->add_php_view) && $item->add_php_view == 1) + { + $this->getTemplateLayout($item->php_view, $db, $user); + } + // add dynamic gets + $this->setData($user, $db, 'dynamic_get', array('dynamic_get' => $item->dynamic_get), 'dynamic_get'); + // add snippets + $this->setData($user, $db, 'snippet', array('snippet' => array($item->snippet)), 'snippet'); + } + } + } + } + } + + /** + * Check if a field is a repeatable field + * + * @param string $typeID The type ID + * + * @return bool true on success + * + */ + protected function checkRepeatable($typeID) + { + if(isset($this->isRepeatable[$typeID])) + { + return true; + } + elseif (ComponentbuilderHelper::checkArray($this->isRepeatable)) + { + return false; + } + elseif ($type = $this->getFieldType($typeID)) + { + if ('repeatable' === $type) + { + $this->isRepeatable[$typeID] = true; + return true; + } + } + return false; + } + + /** + * Get the field type + * + * @param string $id The field type id + * + * @return string field type + * + */ + protected function getFieldType($id) + { + if (!isset($this->fieldTypes[$id])) + { + $properties = ComponentbuilderHelper::getVar('fieldtype', $id, 'id', 'properties'); + if (ComponentbuilderHelper::checkJson($properties)) + { + $properties = json_decode($properties, true); + if (isset($properties['name']) && ComponentbuilderHelper::checkArray($properties['name'])) + { + foreach ($properties['name'] as $key => $value) + { + if ('type' === $value) + { + if (isset($properties['example'][$key]) && ComponentbuilderHelper::checkString($properties['example'][$key])) + { + $this->fieldTypes[$id] = $properties['example'][$key]; + break; + } + } + } + } + } + // if not found + if (!isset($this->fieldTypes[$id]) && $name = ComponentbuilderHelper::getVar('fieldtype', $id, 'id', 'name')) + { + $this->fieldTypes[$id] = ComponentbuilderHelper::safeString($name); + } + } + // return the type + if (isset($this->fieldTypes[$id])) + { + return $this->fieldTypes[$id]; + } + return false; + } + + /** + * Set Template and Layout Data + * + * @param string $default The content to check + * + * @return void + * + */ + protected function getTemplateLayout($default, &$db, $user = false) + { + // set the Template data + $temp1 = ComponentbuilderHelper::getAllBetween($default, "\$this->loadTemplate('","')"); + $temp2 = ComponentbuilderHelper::getAllBetween($default, '$this->loadTemplate("','")'); + $templates = array(); + $again = array(); + if (ComponentbuilderHelper::checkArray($temp1) && ComponentbuilderHelper::checkArray($temp2)) + { + $templates = array_merge($temp1,$temp2); + } + else + { + if (ComponentbuilderHelper::checkArray($temp1)) + { + $templates = $temp1; + } + elseif (ComponentbuilderHelper::checkArray($temp2)) + { + $templates = $temp2; + } + } + if (ComponentbuilderHelper::checkArray($templates)) + { + foreach ($templates as $template) + { + $data = $this->getDataWithAlias($template, 'template', $db); + if (ComponentbuilderHelper::checkArray($data)) + { + if (!isset($this->templateIds[$data['id']])) + { + $this->templateIds[$data['id']] = $data['id']; + // call self to get child data + $again[] = $data['html']; + $again[] = $data['php_view']; + } + } + } + } + // set the layout data + $lay1 = ComponentbuilderHelper::getAllBetween($default, "JLayoutHelper::render('","',"); + $lay2 = ComponentbuilderHelper::getAllBetween($default, 'JLayoutHelper::render("','",'); + if (ComponentbuilderHelper::checkArray($lay1) && ComponentbuilderHelper::checkArray($lay2)) + { + $layouts = array_merge($lay1,$lay2); + } + else + { + if (ComponentbuilderHelper::checkArray($lay1)) + { + $layouts = $lay1; + } + elseif (ComponentbuilderHelper::checkArray($lay2)) + { + $layouts = $lay2; + } + } + if (isset($layouts) && ComponentbuilderHelper::checkArray($layouts)) + { + foreach ($layouts as $layout) + { + $data = $this->getDataWithAlias($layout, 'layout', $db); + if (ComponentbuilderHelper::checkArray($data)) + { + if (!isset($this->layoutIds[$data['id']])) + { + $this->layoutIds[$data['id']] = $data['id']; + // call self to get child data + $again[] = $data['html']; + $again[] = $data['php_view']; + } + } + } + } + if (ComponentbuilderHelper::checkArray($again)) + { + foreach ($again as $get) + { + $this->getTemplateLayout($get, $db); + } + } + // Set the Data + if ($user) + { + // add templates + if (ComponentbuilderHelper::checkArray($this->templateIds)) + { + $this->setData($user, $db, 'template', array('template' => $this->templateIds), 'template'); + } + // add layouts + if (ComponentbuilderHelper::checkArray($this->layoutIds)) + { + $this->setData($user, $db, 'layout', array('layout' => $this->layoutIds), 'layout'); + } + } + } + + /** + * Get Data With Alias + * + * @param string $n_ame The alias name + * @param string $table The table where to find the alias + * @param string $view The view code name + * + * @return array The data found with the alias + * + */ + protected function getDataWithAlias($n_ame, $table, &$db) + { + // Create a new query object. + $query = $db->getQuery(true); + $query->select($db->quoteName(array('a.id', 'a.alias', 'a.'.$table, 'a.php_view', 'a.add_php_view'))); + $query->from('#__componentbuilder_'.$table.' AS a'); + $db->setQuery($query); + $rows = $db->loadObjectList(); + foreach ($rows as $row) + { + $k_ey = ComponentbuilderHelper::safeString($row->alias); + $key = preg_replace("/[^A-Za-z]/", '', $k_ey); + $name = preg_replace("/[^A-Za-z]/", '', $n_ame); + if ($k_ey == $n_ame || $key == $name) + { + $php_view = ''; + if ($row->add_php_view == 1) + { + $php_view = base64_decode($row->php_view); + } + $contnent = base64_decode($row->{$table}); + // return to continue the search + return array('id' => $row->id, 'html' => $contnent, 'php_view' => $php_view); + } + } + return false; + } + + /** + * Set the ids of the found custom code + * + * @param object $item The item being searched + * @param string $target The target table + * + * @return void + * + */ + protected function setCustomCodeIds($item, $target) + { + if ($keys = $this->getCodeSearchKeys($target)) + { + foreach ($keys['search'] as $key) + { + if (!isset($keys['not_base64'][$key])) + { + $value = base64_decode($item->{$key}); + } + else + { + $value = $item->{$key}; + } + // search the value to see if it has custom code + $codeArray = ComponentbuilderHelper::getAllBetween($value, '[CUSTOMC' . 'ODE=',']'); + if (ComponentbuilderHelper::checkArray($codeArray)) + { + foreach ($codeArray as $func) + { + // first make sure we have only the function key + if (strpos($func, '+') !== false) + { + $funcArray = explode('+', $func); + $func = $funcArray[0]; + } + if (!isset($this->customCodeM[$func])) + { + $this->customCodeM[$func] = $func; + // if numeric add to ids + if (is_numeric($func)) + { + $this->customCodeIds[$func] = (int) $func; + } + elseif (ComponentbuilderHelper::checkString($func)) + { + if ($funcID = ComponentbuilderHelper::getVar('custom_code', $func, 'function_name', 'id')) + { + $this->customCodeIds[$funcID] = (int) $funcID; + } + } + } + } + } + } + } + } + + /** + * Get the package name + * + * @param array $items of all components + * + * @return string The package name + * + */ + protected function getPackageName(&$items) + { + foreach ($items as $item) + { + if (isset($item->system_name)) + { + return ComponentbuilderHelper::safeString($item->system_name, 'cAmel'); + } + else + { + return ComponentbuilderHelper::safeString($item->name_code); + } + } + } + + /** + * Get the keys of the values to search custom code in + * + * @param string $targe The table targeted + * + * @return array The query options + * + */ + protected function getCodeSearchKeys($target) + { + $targets = array(); + // #__componentbuilder_joomla_component as a + $targets['joomla_component'] = array(); + $targets['joomla_component']['search'] = array('php_preflight_install','php_postflight_install', + 'php_preflight_update','php_postflight_update','php_method_uninstall', + 'php_helper_admin','php_admin_event','php_helper_both','php_helper_site', + 'php_site_event','php_dashboard_methods','dashboard_tab'); + $targets['joomla_component']['not_base64'] = array('dashboard_tab' => 'json'); + + // #__componentbuilder_admin_view as b + $targets['admin_view'] = array(); + $targets['admin_view']['search'] = array('javascript_view_file','javascript_view_footer','javascript_views_file', + 'javascript_views_footer','php_getitem','php_save','php_postsavehook','php_getitems', + 'php_getitems_after_all','php_getlistquery','php_allowedit','php_before_delete', + 'php_after_delete','php_before_publish','php_after_publish','php_batchcopy', + 'php_batchmove','php_document','php_model','php_controller','php_import_display', + 'php_import','php_import_setdata','php_import_save','html_import_view','php_ajaxmethod'); + $targets['admin_view']['not_base64'] = array(); + + // #__componentbuilder_custom_admin_view as c + $targets['custom_admin_view'] = array(); + $targets['custom_admin_view']['search'] = array('default','php_view','php_jview','php_jview_display','php_document', + 'js_document','css_document','css','php_model','php_controller'); + $targets['custom_admin_view']['not_base64'] = array(); + + // #__componentbuilder_site_view as d + $targets['site_view'] = array(); + $targets['site_view']['search'] = array('default','php_view','php_jview','php_jview_display','php_document', + 'js_document','css_document','css','php_ajaxmethod','php_model','php_controller'); + $targets['site_view']['not_base64'] = array(); + + // #__componentbuilder_field as e + $targets['field'] = array(); + $targets['field']['search'] = array('xml','javascript_view_footer','javascript_views_footer'); + $targets['field']['not_base64'] = array('xml' => 'json'); + + // #__componentbuilder_dynamic_get as f + $targets['dynamic_get'] = array(); + $targets['dynamic_get']['search'] = array('php_before_getitem','php_after_getitem','php_before_getitems','php_after_getitems', + 'php_getlistquery'); + $targets['dynamic_get']['not_base64'] = array(); + + // #__componentbuilder_template as g + $targets['template'] = array(); + $targets['template']['search'] = array('php_view','template'); + $targets['template']['not_base64'] = array(); + + // #__componentbuilder_layout as h + $targets['layout'] = array(); + $targets['layout']['search'] = array('php_view','layout'); + $targets['layout']['not_base64'] = array(); + + // return the query string to search + if (isset($targets[$target])) + { + return $targets[$target]; + } + return false; + } + + /** + * Method to auto-populate the model state. + * + * @return void + */ + protected function populateState($ordering = null, $direction = null) + { + $app = JFactory::getApplication(); + + // Adjust the context to support modal layouts. + if ($layout = $app->input->get('layout')) + { + $this->context .= '.' . $layout; + } $system_name = $this->getUserStateFromRequest($this->context . '.filter.system_name', 'filter_system_name'); $this->setState('filter.system_name', $system_name); @@ -1005,54 +1005,54 @@ class ComponentbuilderModelJoomla_components extends JModelList $this->setState('filter.companyname', $companyname); $author = $this->getUserStateFromRequest($this->context . '.filter.author', 'filter_author'); - $this->setState('filter.author', $author); - - $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int'); - $this->setState('filter.sorting', $sorting); - - $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int'); - $this->setState('filter.access', $access); - - $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); - $this->setState('filter.search', $search); - - $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); - $this->setState('filter.published', $published); - - $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', ''); - $this->setState('filter.created_by', $created_by); - - $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created'); - $this->setState('filter.created', $created); - - // List state information. - parent::populateState($ordering, $direction); - } - - /** - * Method to get an array of data items. - * - * @return mixed An array of data items on success, false on failure. - */ - public function getItems() + $this->setState('filter.author', $author); + + $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int'); + $this->setState('filter.sorting', $sorting); + + $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int'); + $this->setState('filter.access', $access); + + $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); + $this->setState('filter.search', $search); + + $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); + $this->setState('filter.published', $published); + + $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', ''); + $this->setState('filter.created_by', $created_by); + + $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created'); + $this->setState('filter.created', $created); + + // List state information. + parent::populateState($ordering, $direction); + } + + /** + * Method to get an array of data items. + * + * @return mixed An array of data items on success, false on failure. + */ + public function getItems() { // check in items $this->checkInNow(); - - // load parent items - $items = parent::getItems(); - - // return items - return $items; - } - - /** - * Method to build an SQL query to load the list data. - * - * @return string An SQL query - */ - protected function getListQuery() - { + + // load parent items + $items = parent::getItems(); + + // return items + return $items; + } + + /** + * Method to build an SQL query to load the list data. + * + * @return string An SQL query + */ + protected function getListQuery() + { // Get the user object. $user = JFactory::getUser(); // Create a new query object. @@ -1124,7 +1124,7 @@ class ComponentbuilderModelJoomla_components extends JModelList $query->order($db->escape($orderCol . ' ' . $orderDirn)); } - return $query; + return $query; } /** @@ -1271,16 +1271,16 @@ class ComponentbuilderModelJoomla_components extends JModelList return $headers; } return false; - } - - /** - * Method to get a store id based on model configuration state. - * - * @return string A store id. - * - */ - protected function getStoreId($id = '') - { + } + + /** + * Method to get a store id based on model configuration state. + * + * @return string A store id. + * + */ + protected function getStoreId($id = '') + { // Compile the store id. $id .= ':' . $this->getState('filter.id'); $id .= ':' . $this->getState('filter.search'); @@ -1293,9 +1293,9 @@ class ComponentbuilderModelJoomla_components extends JModelList $id .= ':' . $this->getState('filter.component_version'); $id .= ':' . $this->getState('filter.short_description'); $id .= ':' . $this->getState('filter.companyname'); - $id .= ':' . $this->getState('filter.author'); - - return parent::getStoreId($id); + $id .= ':' . $this->getState('filter.author'); + + return parent::getStoreId($id); } /** @@ -1349,5 +1349,5 @@ class ComponentbuilderModelJoomla_components extends JModelList } return false; - } -} + } +} diff --git a/admin/models/language.php b/admin/models/language.php new file mode 100644 index 000000000..0351bb6f3 --- /dev/null +++ b/admin/models/language.php @@ -0,0 +1,859 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +use Joomla\Registry\Registry; + +// import Joomla modelform library +jimport('joomla.application.component.modeladmin'); + +/** + * Componentbuilder Language Model + */ +class ComponentbuilderModelLanguage extends JModelAdmin +{ + /** + * @var string The prefix to use with controller messages. + * @since 1.6 + */ + protected $text_prefix = 'COM_COMPONENTBUILDER'; + + /** + * The type alias for this content type. + * + * @var string + * @since 3.2 + */ + public $typeAlias = 'com_componentbuilder.language'; + + /** + * Returns a Table object, always creating it + * + * @param type $type The table type to instantiate + * @param string $prefix A prefix for the table class name. Optional. + * @param array $config Configuration array for model. Optional. + * + * @return JTable A database object + * + * @since 1.6 + */ + public function getTable($type = 'language', $prefix = 'ComponentbuilderTable', $config = array()) + { + return JTable::getInstance($type, $prefix, $config); + } + + /** + * Method to get a single record. + * + * @param integer $pk The id of the primary key. + * + * @return mixed Object on success, false on failure. + * + * @since 1.6 + */ + public function getItem($pk = null) + { + if ($item = parent::getItem($pk)) + { + if (!empty($item->params)) + { + // Convert the params field to an array. + $registry = new Registry; + $registry->loadString($item->params); + $item->params = $registry->toArray(); + } + + if (!empty($item->metadata)) + { + // Convert the metadata field to an array. + $registry = new Registry; + $registry->loadString($item->metadata); + $item->metadata = $registry->toArray(); + } + + if (!empty($item->id)) + { + $item->tags = new JHelperTags; + $item->tags->getTagIds($item->id, 'com_componentbuilder.language'); + } + } + + return $item; + } + + /** + * Method to get the record form. + * + * @param array $data Data for the form. + * @param boolean $loadData True if the form is to load its own data (default case), false if not. + * + * @return mixed A JForm object on success, false on failure + * + * @since 1.6 + */ + public function getForm($data = array(), $loadData = true) + { + // Get the form. + $form = $this->loadForm('com_componentbuilder.language', 'language', array('control' => 'jform', 'load_data' => $loadData)); + + if (empty($form)) + { + return false; + } + + $jinput = JFactory::getApplication()->input; + + // The front end calls this model and uses a_id to avoid id clashes so we need to check for that first. + if ($jinput->get('a_id')) + { + $id = $jinput->get('a_id', 0, 'INT'); + } + // The back end uses id so we use that the rest of the time and set it to 0 by default. + else + { + $id = $jinput->get('id', 0, 'INT'); + } + + $user = JFactory::getUser(); + + // Check for existing item. + // Modify the form based on Edit State access controls. + if ($id != 0 && (!$user->authorise('language.edit.state', 'com_componentbuilder.language.' . (int) $id)) + || ($id == 0 && !$user->authorise('language.edit.state', 'com_componentbuilder'))) + { + // Disable fields for display. + $form->setFieldAttribute('ordering', 'disabled', 'true'); + $form->setFieldAttribute('published', 'disabled', 'true'); + // Disable fields while saving. + $form->setFieldAttribute('ordering', 'filter', 'unset'); + $form->setFieldAttribute('published', 'filter', 'unset'); + } + // If this is a new item insure the greated by is set. + if (0 == $id) + { + // Set the created_by to this user + $form->setValue('created_by', null, $user->id); + } + // Modify the form based on Edit Creaded By access controls. + if (!$user->authorise('core.edit.created_by', 'com_componentbuilder')) + { + // Disable fields for display. + $form->setFieldAttribute('created_by', 'disabled', 'true'); + // Disable fields for display. + $form->setFieldAttribute('created_by', 'readonly', 'true'); + // Disable fields while saving. + $form->setFieldAttribute('created_by', 'filter', 'unset'); + } + // Modify the form based on Edit Creaded Date access controls. + if (!$user->authorise('core.edit.created', 'com_componentbuilder')) + { + // Disable fields for display. + $form->setFieldAttribute('created', 'disabled', 'true'); + // Disable fields while saving. + $form->setFieldAttribute('created', 'filter', 'unset'); + } + // Only load these values if no id is found + if (0 == $id) + { + // Set redirected field name + $redirectedField = $jinput->get('ref', null, 'STRING'); + // Set redirected field value + $redirectedValue = $jinput->get('refid', 0, 'INT'); + if (0 != $redirectedValue && $redirectedField) + { + // Now set the local-redirected field default value + $form->setValue($redirectedField, null, $redirectedValue); + } + } + + return $form; + } + + /** + * Method to get the script that have to be included on the form + * + * @return string script files + */ + public function getScript() + { + return 'administrator/components/com_componentbuilder/models/forms/language.js'; + } + + /** + * Method to test whether a record can be deleted. + * + * @param object $record A record object. + * + * @return boolean True if allowed to delete the record. Defaults to the permission set in the component. + * + * @since 1.6 + */ + protected function canDelete($record) + { + if (!empty($record->id)) + { + if ($record->published != -2) + { + return; + } + + $user = JFactory::getUser(); + // The record has been set. Check the record permissions. + return $user->authorise('language.delete', 'com_componentbuilder.language.' . (int) $record->id); + } + return false; + } + + /** + * Method to test whether a record can have its state edited. + * + * @param object $record A record object. + * + * @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component. + * + * @since 1.6 + */ + protected function canEditState($record) + { + $user = JFactory::getUser(); + $recordId = (!empty($record->id)) ? $record->id : 0; + + if ($recordId) + { + // The record has been set. Check the record permissions. + $permission = $user->authorise('language.edit.state', 'com_componentbuilder.language.' . (int) $recordId); + if (!$permission && !is_null($permission)) + { + return false; + } + } + // In the absense of better information, revert to the component permissions. + return $user->authorise('language.edit.state', 'com_componentbuilder'); + } + + /** + * Method override to check if you can edit an existing record. + * + * @param array $data An array of input data. + * @param string $key The name of the key for the primary key. + * + * @return boolean + * @since 2.5 + */ + protected function allowEdit($data = array(), $key = 'id') + { + // Check specific edit permission then general edit permission. + $user = JFactory::getUser(); + + return $user->authorise('language.edit', 'com_componentbuilder.language.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('language.edit', 'com_componentbuilder'); + } + + /** + * Prepare and sanitise the table data prior to saving. + * + * @param JTable $table A JTable object. + * + * @return void + * + * @since 1.6 + */ + protected function prepareTable($table) + { + $date = JFactory::getDate(); + $user = JFactory::getUser(); + + if (isset($table->name)) + { + $table->name = htmlspecialchars_decode($table->name, ENT_QUOTES); + } + + if (isset($table->alias) && empty($table->alias)) + { + $table->generateAlias(); + } + + if (empty($table->id)) + { + $table->created = $date->toSql(); + // set the user + if ($table->created_by == 0 || empty($table->created_by)) + { + $table->created_by = $user->id; + } + // Set ordering to the last item if not set + if (empty($table->ordering)) + { + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select('MAX(ordering)') + ->from($db->quoteName('#__componentbuilder_language')); + $db->setQuery($query); + $max = $db->loadResult(); + + $table->ordering = $max + 1; + } + } + else + { + $table->modified = $date->toSql(); + $table->modified_by = $user->id; + } + + if (!empty($table->id)) + { + // Increment the items version number. + $table->version++; + } + } + + /** + * Method to get the data that should be injected in the form. + * + * @return mixed The data for the form. + * + * @since 1.6 + */ + protected function loadFormData() + { + // Check the session for previously entered form data. + $data = JFactory::getApplication()->getUserState('com_componentbuilder.edit.language.data', array()); + + if (empty($data)) + { + $data = $this->getItem(); + } + + return $data; + } + + /** + * Method to get the unique fields of this table. + * + * @return mixed An array of field names, boolean false if none is set. + * + * @since 3.0 + */ + protected function getUniqeFields() + { + return false; + } + + /** + * Method to delete one or more records. + * + * @param array &$pks An array of record primary keys. + * + * @return boolean True if successful, false if an error occurs. + * + * @since 12.2 + */ + public function delete(&$pks) + { + if (!parent::delete($pks)) + { + return false; + } + + return true; + } + + /** + * Method to change the published state of one or more records. + * + * @param array &$pks A list of the primary keys to change. + * @param integer $value The value of the published state. + * + * @return boolean True on success. + * + * @since 12.2 + */ + public function publish(&$pks, $value = 1) + { + if (!parent::publish($pks, $value)) + { + return false; + } + + return true; + } + + /** + * Method to perform batch operations on an item or a set of items. + * + * @param array $commands An array of commands to perform. + * @param array $pks An array of item ids. + * @param array $contexts An array of item contexts. + * + * @return boolean Returns true on success, false on failure. + * + * @since 12.2 + */ + public function batch($commands, $pks, $contexts) + { + // Sanitize ids. + $pks = array_unique($pks); + JArrayHelper::toInteger($pks); + + // Remove any values of zero. + if (array_search(0, $pks, true)) + { + unset($pks[array_search(0, $pks, true)]); + } + + if (empty($pks)) + { + $this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED')); + return false; + } + + $done = false; + + // Set some needed variables. + $this->user = JFactory::getUser(); + $this->table = $this->getTable(); + $this->tableClassName = get_class($this->table); + $this->contentType = new JUcmType; + $this->type = $this->contentType->getTypeByTable($this->tableClassName); + $this->canDo = ComponentbuilderHelper::getActions('language'); + $this->batchSet = true; + + if (!$this->canDo->get('core.batch')) + { + $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); + return false; + } + + if ($this->type == false) + { + $type = new JUcmType; + $this->type = $type->getTypeByAlias($this->typeAlias); + } + + $this->tagsObserver = $this->table->getObserverOfClass('JTableObserverTags'); + + if (!empty($commands['move_copy'])) + { + $cmd = JArrayHelper::getValue($commands, 'move_copy', 'c'); + + if ($cmd == 'c') + { + $result = $this->batchCopy($commands, $pks, $contexts); + + if (is_array($result)) + { + foreach ($result as $old => $new) + { + $contexts[$new] = $contexts[$old]; + } + $pks = array_values($result); + } + else + { + return false; + } + } + elseif ($cmd == 'm' && !$this->batchMove($commands, $pks, $contexts)) + { + return false; + } + + $done = true; + } + + if (!$done) + { + $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); + + return false; + } + + // Clear the cache + $this->cleanCache(); + + return true; + } + + /** + * Batch copy items to a new category or current. + * + * @param integer $values The new values. + * @param array $pks An array of row IDs. + * @param array $contexts An array of item contexts. + * + * @return mixed An array of new IDs on success, boolean false on failure. + * + * @since 12.2 + */ + protected function batchCopy($values, $pks, $contexts) + { + if (empty($this->batchSet)) + { + // Set some needed variables. + $this->user = JFactory::getUser(); + $this->table = $this->getTable(); + $this->tableClassName = get_class($this->table); + $this->contentType = new JUcmType; + $this->type = $this->contentType->getTypeByTable($this->tableClassName); + $this->canDo = ComponentbuilderHelper::getActions('language'); + } + + if (!$this->canDo->get('language.create') && !$this->canDo->get('language.batch')) + { + return false; + } + + // get list of uniqe fields + $uniqeFields = $this->getUniqeFields(); + // remove move_copy from array + unset($values['move_copy']); + + // make sure published is set + if (!isset($values['published'])) + { + $values['published'] = 0; + } + elseif (isset($values['published']) && !$this->canDo->get('language.edit.state')) + { + $values['published'] = 0; + } + + $newIds = array(); + + // Parent exists so let's proceed + while (!empty($pks)) + { + // Pop the first ID off the stack + $pk = array_shift($pks); + + $this->table->reset(); + + // only allow copy if user may edit this item. + + if (!$this->user->authorise('language.edit', $contexts[$pk])) + + { + + // Not fatal error + + $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); + + continue; + + } + + // Check that the row actually exists + if (!$this->table->load($pk)) + { + if ($error = $this->table->getError()) + { + // Fatal error + $this->setError($error); + + return false; + } + else + { + // Not fatal error + $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); + continue; + } + } + + $this->table->name = $this->generateUniqe('name',$this->table->name); + + // insert all set values + if (ComponentbuilderHelper::checkArray($values)) + { + foreach ($values as $key => $value) + { + if (strlen($value) > 0 && isset($this->table->$key)) + { + $this->table->$key = $value; + } + } + } + + // update all uniqe fields + if (ComponentbuilderHelper::checkArray($uniqeFields)) + { + foreach ($uniqeFields as $uniqeField) + { + $this->table->$uniqeField = $this->generateUniqe($uniqeField,$this->table->$uniqeField); + } + } + + // Reset the ID because we are making a copy + $this->table->id = 0; + + // TODO: Deal with ordering? + // $this->table->ordering = 1; + + // Check the row. + if (!$this->table->check()) + { + $this->setError($this->table->getError()); + + return false; + } + + if (!empty($this->type)) + { + $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table); + } + + // Store the row. + if (!$this->table->store()) + { + $this->setError($this->table->getError()); + + return false; + } + + // Get the new item ID + $newId = $this->table->get('id'); + + // Add the new ID to the array + $newIds[$pk] = $newId; + } + + // Clean the cache + $this->cleanCache(); + + return $newIds; + } + + /** + * Batch move items to a new category + * + * @param integer $value The new category ID. + * @param array $pks An array of row IDs. + * @param array $contexts An array of item contexts. + * + * @return boolean True if successful, false otherwise and internal error is set. + * + * @since 12.2 + */ + protected function batchMove($values, $pks, $contexts) + { + if (empty($this->batchSet)) + { + // Set some needed variables. + $this->user = JFactory::getUser(); + $this->table = $this->getTable(); + $this->tableClassName = get_class($this->table); + $this->contentType = new JUcmType; + $this->type = $this->contentType->getTypeByTable($this->tableClassName); + $this->canDo = ComponentbuilderHelper::getActions('language'); + } + + if (!$this->canDo->get('language.edit') && !$this->canDo->get('language.batch')) + { + $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); + return false; + } + + // make sure published only updates if user has the permission. + if (isset($values['published']) && !$this->canDo->get('language.edit.state')) + { + unset($values['published']); + } + // remove move_copy from array + unset($values['move_copy']); + + // Parent exists so we proceed + foreach ($pks as $pk) + { + if (!$this->user->authorise('language.edit', $contexts[$pk])) + { + $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); + + return false; + } + + // Check that the row actually exists + if (!$this->table->load($pk)) + { + if ($error = $this->table->getError()) + { + // Fatal error + $this->setError($error); + + return false; + } + else + { + // Not fatal error + $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); + continue; + } + } + + // insert all set values. + if (ComponentbuilderHelper::checkArray($values)) + { + foreach ($values as $key => $value) + { + // Do special action for access. + if ('access' === $key && strlen($value) > 0) + { + $this->table->$key = $value; + } + elseif (strlen($value) > 0 && isset($this->table->$key)) + { + $this->table->$key = $value; + } + } + } + + + // Check the row. + if (!$this->table->check()) + { + $this->setError($this->table->getError()); + + return false; + } + + if (!empty($this->type)) + { + $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table); + } + + // Store the row. + if (!$this->table->store()) + { + $this->setError($this->table->getError()); + + return false; + } + } + + // Clean the cache + $this->cleanCache(); + + return true; + } + + /** + * Method to save the form data. + * + * @param array $data The form data. + * + * @return boolean True on success. + * + * @since 1.6 + */ + public function save($data) + { + $input = JFactory::getApplication()->input; + $filter = JFilterInput::getInstance(); + + // set the metadata to the Item Data + if (isset($data['metadata']) && isset($data['metadata']['author'])) + { + $data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM'); + + $metadata = new JRegistry; + $metadata->loadArray($data['metadata']); + $data['metadata'] = (string) $metadata; + } + + // Set the Params Items to data + if (isset($data['params']) && is_array($data['params'])) + { + $params = new JRegistry; + $params->loadArray($data['params']); + $data['params'] = (string) $params; + } + + // Alter the uniqe field for save as copy + if ($input->get('task') === 'save2copy') + { + // Automatic handling of other uniqe fields + $uniqeFields = $this->getUniqeFields(); + if (ComponentbuilderHelper::checkArray($uniqeFields)) + { + foreach ($uniqeFields as $uniqeField) + { + $data[$uniqeField] = $this->generateUniqe($uniqeField,$data[$uniqeField]); + } + } + } + + if (parent::save($data)) + { + return true; + } + return false; + } + + /** + * Method to generate a uniqe value. + * + * @param string $field name. + * @param string $value data. + * + * @return string New value. + * + * @since 3.0 + */ + protected function generateUniqe($field,$value) + { + + // set field value uniqe + $table = $this->getTable(); + + while ($table->load(array($field => $value))) + { + $value = JString::increment($value); + } + + return $value; + } + + /** + * Method to change the title & alias. + * + * @param string $title The title. + * + * @return array Contains the modified title and alias. + * + */ + protected function _generateNewTitle($title) + { + + // Alter the title + $table = $this->getTable(); + + while ($table->load(array('title' => $title))) + { + $title = JString::increment($title); + } + + return $title; + } +} diff --git a/admin/models/language_translation.php b/admin/models/language_translation.php new file mode 100644 index 000000000..3f36ca357 --- /dev/null +++ b/admin/models/language_translation.php @@ -0,0 +1,897 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +use Joomla\Registry\Registry; + +// import Joomla modelform library +jimport('joomla.application.component.modeladmin'); + +/** + * Componentbuilder Language_translation Model + */ +class ComponentbuilderModelLanguage_translation extends JModelAdmin +{ + /** + * @var string The prefix to use with controller messages. + * @since 1.6 + */ + protected $text_prefix = 'COM_COMPONENTBUILDER'; + + /** + * The type alias for this content type. + * + * @var string + * @since 3.2 + */ + public $typeAlias = 'com_componentbuilder.language_translation'; + + /** + * Returns a Table object, always creating it + * + * @param type $type The table type to instantiate + * @param string $prefix A prefix for the table class name. Optional. + * @param array $config Configuration array for model. Optional. + * + * @return JTable A database object + * + * @since 1.6 + */ + public function getTable($type = 'language_translation', $prefix = 'ComponentbuilderTable', $config = array()) + { + return JTable::getInstance($type, $prefix, $config); + } + + public function getVDM() + { + return $this->vastDevMod; + } + + /** + * Method to get a single record. + * + * @param integer $pk The id of the primary key. + * + * @return mixed Object on success, false on failure. + * + * @since 1.6 + */ + public function getItem($pk = null) + { + if ($item = parent::getItem($pk)) + { + if (!empty($item->params)) + { + // Convert the params field to an array. + $registry = new Registry; + $registry->loadString($item->params); + $item->params = $registry->toArray(); + } + + if (!empty($item->metadata)) + { + // Convert the metadata field to an array. + $registry = new Registry; + $registry->loadString($item->metadata); + $item->metadata = $registry->toArray(); + } + + if (!empty($item->components)) + { + // JSON Decode components. + $item->components = json_decode($item->components); + } + + + if (empty($item->id)) + { + $id = 0; + } + else + { + $id = $item->id; + } + // set the id and view name to session + if ($vdm = ComponentbuilderHelper::get('language_translation__'.$id)) + { + $this->vastDevMod = $vdm; + } + else + { + $this->vastDevMod = ComponentbuilderHelper::randomkey(50); + ComponentbuilderHelper::set($this->vastDevMod, 'language_translation__'.$id); + ComponentbuilderHelper::set('language_translation__'.$id, $this->vastDevMod); + } + + if (!empty($item->id)) + { + $item->tags = new JHelperTags; + $item->tags->getTagIds($item->id, 'com_componentbuilder.language_translation'); + } + } + + return $item; + } + + /** + * Method to get the record form. + * + * @param array $data Data for the form. + * @param boolean $loadData True if the form is to load its own data (default case), false if not. + * + * @return mixed A JForm object on success, false on failure + * + * @since 1.6 + */ + public function getForm($data = array(), $loadData = true) + { + // Get the form. + $form = $this->loadForm('com_componentbuilder.language_translation', 'language_translation', array('control' => 'jform', 'load_data' => $loadData)); + + if (empty($form)) + { + return false; + } + + $jinput = JFactory::getApplication()->input; + + // The front end calls this model and uses a_id to avoid id clashes so we need to check for that first. + if ($jinput->get('a_id')) + { + $id = $jinput->get('a_id', 0, 'INT'); + } + // The back end uses id so we use that the rest of the time and set it to 0 by default. + else + { + $id = $jinput->get('id', 0, 'INT'); + } + + $user = JFactory::getUser(); + + // Check for existing item. + // Modify the form based on Edit State access controls. + if ($id != 0 && (!$user->authorise('language_translation.edit.state', 'com_componentbuilder.language_translation.' . (int) $id)) + || ($id == 0 && !$user->authorise('language_translation.edit.state', 'com_componentbuilder'))) + { + // Disable fields for display. + $form->setFieldAttribute('ordering', 'disabled', 'true'); + $form->setFieldAttribute('published', 'disabled', 'true'); + // Disable fields while saving. + $form->setFieldAttribute('ordering', 'filter', 'unset'); + $form->setFieldAttribute('published', 'filter', 'unset'); + } + // If this is a new item insure the greated by is set. + if (0 == $id) + { + // Set the created_by to this user + $form->setValue('created_by', null, $user->id); + } + // Modify the form based on Edit Creaded By access controls. + if (!$user->authorise('core.edit.created_by', 'com_componentbuilder')) + { + // Disable fields for display. + $form->setFieldAttribute('created_by', 'disabled', 'true'); + // Disable fields for display. + $form->setFieldAttribute('created_by', 'readonly', 'true'); + // Disable fields while saving. + $form->setFieldAttribute('created_by', 'filter', 'unset'); + } + // Modify the form based on Edit Creaded Date access controls. + if (!$user->authorise('core.edit.created', 'com_componentbuilder')) + { + // Disable fields for display. + $form->setFieldAttribute('created', 'disabled', 'true'); + // Disable fields while saving. + $form->setFieldAttribute('created', 'filter', 'unset'); + } + // Only load these values if no id is found + if (0 == $id) + { + // Set redirected field name + $redirectedField = $jinput->get('ref', null, 'STRING'); + // Set redirected field value + $redirectedValue = $jinput->get('refid', 0, 'INT'); + if (0 != $redirectedValue && $redirectedField) + { + // Now set the local-redirected field default value + $form->setValue($redirectedField, null, $redirectedValue); + } + } + + return $form; + } + + /** + * Method to get the script that have to be included on the form + * + * @return string script files + */ + public function getScript() + { + return 'administrator/components/com_componentbuilder/models/forms/language_translation.js'; + } + + /** + * Method to test whether a record can be deleted. + * + * @param object $record A record object. + * + * @return boolean True if allowed to delete the record. Defaults to the permission set in the component. + * + * @since 1.6 + */ + protected function canDelete($record) + { + if (!empty($record->id)) + { + if ($record->published != -2) + { + return; + } + + $user = JFactory::getUser(); + // The record has been set. Check the record permissions. + return $user->authorise('language_translation.delete', 'com_componentbuilder.language_translation.' . (int) $record->id); + } + return false; + } + + /** + * Method to test whether a record can have its state edited. + * + * @param object $record A record object. + * + * @return boolean True if allowed to change the state of the record. Defaults to the permission set in the component. + * + * @since 1.6 + */ + protected function canEditState($record) + { + $user = JFactory::getUser(); + $recordId = (!empty($record->id)) ? $record->id : 0; + + if ($recordId) + { + // The record has been set. Check the record permissions. + $permission = $user->authorise('language_translation.edit.state', 'com_componentbuilder.language_translation.' . (int) $recordId); + if (!$permission && !is_null($permission)) + { + return false; + } + } + // In the absense of better information, revert to the component permissions. + return $user->authorise('language_translation.edit.state', 'com_componentbuilder'); + } + + /** + * Method override to check if you can edit an existing record. + * + * @param array $data An array of input data. + * @param string $key The name of the key for the primary key. + * + * @return boolean + * @since 2.5 + */ + protected function allowEdit($data = array(), $key = 'id') + { + // Check specific edit permission then general edit permission. + $user = JFactory::getUser(); + + return $user->authorise('language_translation.edit', 'com_componentbuilder.language_translation.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('language_translation.edit', 'com_componentbuilder'); + } + + /** + * Prepare and sanitise the table data prior to saving. + * + * @param JTable $table A JTable object. + * + * @return void + * + * @since 1.6 + */ + protected function prepareTable($table) + { + $date = JFactory::getDate(); + $user = JFactory::getUser(); + + if (isset($table->name)) + { + $table->name = htmlspecialchars_decode($table->name, ENT_QUOTES); + } + + if (isset($table->alias) && empty($table->alias)) + { + $table->generateAlias(); + } + + if (empty($table->id)) + { + $table->created = $date->toSql(); + // set the user + if ($table->created_by == 0 || empty($table->created_by)) + { + $table->created_by = $user->id; + } + // Set ordering to the last item if not set + if (empty($table->ordering)) + { + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select('MAX(ordering)') + ->from($db->quoteName('#__componentbuilder_language_translation')); + $db->setQuery($query); + $max = $db->loadResult(); + + $table->ordering = $max + 1; + } + } + else + { + $table->modified = $date->toSql(); + $table->modified_by = $user->id; + } + + if (!empty($table->id)) + { + // Increment the items version number. + $table->version++; + } + } + + /** + * Method to get the data that should be injected in the form. + * + * @return mixed The data for the form. + * + * @since 1.6 + */ + protected function loadFormData() + { + // Check the session for previously entered form data. + $data = JFactory::getApplication()->getUserState('com_componentbuilder.edit.language_translation.data', array()); + + if (empty($data)) + { + $data = $this->getItem(); + } + + return $data; + } + + /** + * Method to get the unique fields of this table. + * + * @return mixed An array of field names, boolean false if none is set. + * + * @since 3.0 + */ + protected function getUniqeFields() + { + return false; + } + + /** + * Method to delete one or more records. + * + * @param array &$pks An array of record primary keys. + * + * @return boolean True if successful, false if an error occurs. + * + * @since 12.2 + */ + public function delete(&$pks) + { + if (!parent::delete($pks)) + { + return false; + } + + return true; + } + + /** + * Method to change the published state of one or more records. + * + * @param array &$pks A list of the primary keys to change. + * @param integer $value The value of the published state. + * + * @return boolean True on success. + * + * @since 12.2 + */ + public function publish(&$pks, $value = 1) + { + if (!parent::publish($pks, $value)) + { + return false; + } + + return true; + } + + /** + * Method to perform batch operations on an item or a set of items. + * + * @param array $commands An array of commands to perform. + * @param array $pks An array of item ids. + * @param array $contexts An array of item contexts. + * + * @return boolean Returns true on success, false on failure. + * + * @since 12.2 + */ + public function batch($commands, $pks, $contexts) + { + // Sanitize ids. + $pks = array_unique($pks); + JArrayHelper::toInteger($pks); + + // Remove any values of zero. + if (array_search(0, $pks, true)) + { + unset($pks[array_search(0, $pks, true)]); + } + + if (empty($pks)) + { + $this->setError(JText::_('JGLOBAL_NO_ITEM_SELECTED')); + return false; + } + + $done = false; + + // Set some needed variables. + $this->user = JFactory::getUser(); + $this->table = $this->getTable(); + $this->tableClassName = get_class($this->table); + $this->contentType = new JUcmType; + $this->type = $this->contentType->getTypeByTable($this->tableClassName); + $this->canDo = ComponentbuilderHelper::getActions('language_translation'); + $this->batchSet = true; + + if (!$this->canDo->get('core.batch')) + { + $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); + return false; + } + + if ($this->type == false) + { + $type = new JUcmType; + $this->type = $type->getTypeByAlias($this->typeAlias); + } + + $this->tagsObserver = $this->table->getObserverOfClass('JTableObserverTags'); + + if (!empty($commands['move_copy'])) + { + $cmd = JArrayHelper::getValue($commands, 'move_copy', 'c'); + + if ($cmd == 'c') + { + $result = $this->batchCopy($commands, $pks, $contexts); + + if (is_array($result)) + { + foreach ($result as $old => $new) + { + $contexts[$new] = $contexts[$old]; + } + $pks = array_values($result); + } + else + { + return false; + } + } + elseif ($cmd == 'm' && !$this->batchMove($commands, $pks, $contexts)) + { + return false; + } + + $done = true; + } + + if (!$done) + { + $this->setError(JText::_('JLIB_APPLICATION_ERROR_INSUFFICIENT_BATCH_INFORMATION')); + + return false; + } + + // Clear the cache + $this->cleanCache(); + + return true; + } + + /** + * Batch copy items to a new category or current. + * + * @param integer $values The new values. + * @param array $pks An array of row IDs. + * @param array $contexts An array of item contexts. + * + * @return mixed An array of new IDs on success, boolean false on failure. + * + * @since 12.2 + */ + protected function batchCopy($values, $pks, $contexts) + { + if (empty($this->batchSet)) + { + // Set some needed variables. + $this->user = JFactory::getUser(); + $this->table = $this->getTable(); + $this->tableClassName = get_class($this->table); + $this->contentType = new JUcmType; + $this->type = $this->contentType->getTypeByTable($this->tableClassName); + $this->canDo = ComponentbuilderHelper::getActions('language_translation'); + } + + if (!$this->canDo->get('language_translation.create') && !$this->canDo->get('language_translation.batch')) + { + return false; + } + + // get list of uniqe fields + $uniqeFields = $this->getUniqeFields(); + // remove move_copy from array + unset($values['move_copy']); + + // make sure published is set + if (!isset($values['published'])) + { + $values['published'] = 0; + } + elseif (isset($values['published']) && !$this->canDo->get('language_translation.edit.state')) + { + $values['published'] = 0; + } + + $newIds = array(); + + // Parent exists so let's proceed + while (!empty($pks)) + { + // Pop the first ID off the stack + $pk = array_shift($pks); + + $this->table->reset(); + + // only allow copy if user may edit this item. + + if (!$this->user->authorise('language_translation.edit', $contexts[$pk])) + + { + + // Not fatal error + + $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); + + continue; + + } + + // Check that the row actually exists + if (!$this->table->load($pk)) + { + if ($error = $this->table->getError()) + { + // Fatal error + $this->setError($error); + + return false; + } + else + { + // Not fatal error + $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); + continue; + } + } + + $this->table->entranslation = $this->generateUniqe('entranslation',$this->table->entranslation); + + // insert all set values + if (ComponentbuilderHelper::checkArray($values)) + { + foreach ($values as $key => $value) + { + if (strlen($value) > 0 && isset($this->table->$key)) + { + $this->table->$key = $value; + } + } + } + + // update all uniqe fields + if (ComponentbuilderHelper::checkArray($uniqeFields)) + { + foreach ($uniqeFields as $uniqeField) + { + $this->table->$uniqeField = $this->generateUniqe($uniqeField,$this->table->$uniqeField); + } + } + + // Reset the ID because we are making a copy + $this->table->id = 0; + + // TODO: Deal with ordering? + // $this->table->ordering = 1; + + // Check the row. + if (!$this->table->check()) + { + $this->setError($this->table->getError()); + + return false; + } + + if (!empty($this->type)) + { + $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table); + } + + // Store the row. + if (!$this->table->store()) + { + $this->setError($this->table->getError()); + + return false; + } + + // Get the new item ID + $newId = $this->table->get('id'); + + // Add the new ID to the array + $newIds[$pk] = $newId; + } + + // Clean the cache + $this->cleanCache(); + + return $newIds; + } + + /** + * Batch move items to a new category + * + * @param integer $value The new category ID. + * @param array $pks An array of row IDs. + * @param array $contexts An array of item contexts. + * + * @return boolean True if successful, false otherwise and internal error is set. + * + * @since 12.2 + */ + protected function batchMove($values, $pks, $contexts) + { + if (empty($this->batchSet)) + { + // Set some needed variables. + $this->user = JFactory::getUser(); + $this->table = $this->getTable(); + $this->tableClassName = get_class($this->table); + $this->contentType = new JUcmType; + $this->type = $this->contentType->getTypeByTable($this->tableClassName); + $this->canDo = ComponentbuilderHelper::getActions('language_translation'); + } + + if (!$this->canDo->get('language_translation.edit') && !$this->canDo->get('language_translation.batch')) + { + $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); + return false; + } + + // make sure published only updates if user has the permission. + if (isset($values['published']) && !$this->canDo->get('language_translation.edit.state')) + { + unset($values['published']); + } + // remove move_copy from array + unset($values['move_copy']); + + // Parent exists so we proceed + foreach ($pks as $pk) + { + if (!$this->user->authorise('language_translation.edit', $contexts[$pk])) + { + $this->setError(JText::_('JLIB_APPLICATION_ERROR_BATCH_CANNOT_EDIT')); + + return false; + } + + // Check that the row actually exists + if (!$this->table->load($pk)) + { + if ($error = $this->table->getError()) + { + // Fatal error + $this->setError($error); + + return false; + } + else + { + // Not fatal error + $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_BATCH_MOVE_ROW_NOT_FOUND', $pk)); + continue; + } + } + + // insert all set values. + if (ComponentbuilderHelper::checkArray($values)) + { + foreach ($values as $key => $value) + { + // Do special action for access. + if ('access' === $key && strlen($value) > 0) + { + $this->table->$key = $value; + } + elseif (strlen($value) > 0 && isset($this->table->$key)) + { + $this->table->$key = $value; + } + } + } + + + // Check the row. + if (!$this->table->check()) + { + $this->setError($this->table->getError()); + + return false; + } + + if (!empty($this->type)) + { + $this->createTagsHelper($this->tagsObserver, $this->type, $pk, $this->typeAlias, $this->table); + } + + // Store the row. + if (!$this->table->store()) + { + $this->setError($this->table->getError()); + + return false; + } + } + + // Clean the cache + $this->cleanCache(); + + return true; + } + + /** + * Method to save the form data. + * + * @param array $data The form data. + * + * @return boolean True on success. + * + * @since 1.6 + */ + public function save($data) + { + $input = JFactory::getApplication()->input; + $filter = JFilterInput::getInstance(); + + // set the metadata to the Item Data + if (isset($data['metadata']) && isset($data['metadata']['author'])) + { + $data['metadata']['author'] = $filter->clean($data['metadata']['author'], 'TRIM'); + + $metadata = new JRegistry; + $metadata->loadArray($data['metadata']); + $data['metadata'] = (string) $metadata; + } + + // Set the components string to JSON string. + if (isset($data['components'])) + { + $data['components'] = (string) json_encode($data['components']); + } + + // Set the Params Items to data + if (isset($data['params']) && is_array($data['params'])) + { + $params = new JRegistry; + $params->loadArray($data['params']); + $data['params'] = (string) $params; + } + + // Alter the uniqe field for save as copy + if ($input->get('task') === 'save2copy') + { + // Automatic handling of other uniqe fields + $uniqeFields = $this->getUniqeFields(); + if (ComponentbuilderHelper::checkArray($uniqeFields)) + { + foreach ($uniqeFields as $uniqeField) + { + $data[$uniqeField] = $this->generateUniqe($uniqeField,$data[$uniqeField]); + } + } + } + + if (parent::save($data)) + { + return true; + } + return false; + } + + /** + * Method to generate a uniqe value. + * + * @param string $field name. + * @param string $value data. + * + * @return string New value. + * + * @since 3.0 + */ + protected function generateUniqe($field,$value) + { + + // set field value uniqe + $table = $this->getTable(); + + while ($table->load(array($field => $value))) + { + $value = JString::increment($value); + } + + return $value; + } + + /** + * Method to change the title & alias. + * + * @param string $title The title. + * + * @return array Contains the modified title and alias. + * + */ + protected function _generateNewTitle($title) + { + + // Alter the title + $table = $this->getTable(); + + while ($table->load(array('title' => $title))) + { + $title = JString::increment($title); + } + + return $title; + } +} diff --git a/admin/models/language_translations.php b/admin/models/language_translations.php new file mode 100644 index 000000000..13a55e38b --- /dev/null +++ b/admin/models/language_translations.php @@ -0,0 +1,427 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// import the Joomla modellist library +jimport('joomla.application.component.modellist'); + +/** + * Language_translations Model + */ +class ComponentbuilderModelLanguage_translations extends JModelList +{ + public function __construct($config = array()) + { + if (empty($config['filter_fields'])) + { + $config['filter_fields'] = array( + 'a.id','id', + 'a.published','published', + 'a.ordering','ordering', + 'a.created_by','created_by', + 'a.modified_by','modified_by', + 'a.entranslation','entranslation' + ); + } + + parent::__construct($config); + } + + /** + * Method to auto-populate the model state. + * + * @return void + */ + protected function populateState($ordering = null, $direction = null) + { + $app = JFactory::getApplication(); + + // Adjust the context to support modal layouts. + if ($layout = $app->input->get('layout')) + { + $this->context .= '.' . $layout; + } + $entranslation = $this->getUserStateFromRequest($this->context . '.filter.entranslation', 'filter_entranslation'); + $this->setState('filter.entranslation', $entranslation); + + $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int'); + $this->setState('filter.sorting', $sorting); + + $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int'); + $this->setState('filter.access', $access); + + $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); + $this->setState('filter.search', $search); + + $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); + $this->setState('filter.published', $published); + + $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', ''); + $this->setState('filter.created_by', $created_by); + + $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created'); + $this->setState('filter.created', $created); + + // List state information. + parent::populateState($ordering, $direction); + } + + /** + * Method to get an array of data items. + * + * @return mixed An array of data items on success, false on failure. + */ + public function getItems() + { + // check in items + $this->checkInNow(); + + // load parent items + $items = parent::getItems(); + + // set values to display correctly. + if (ComponentbuilderHelper::checkArray($items)) + { + // get user object. + $user = JFactory::getUser(); + foreach ($items as $nr => &$item) + { + $access = ($user->authorise('language_translation.access', 'com_componentbuilder.language_translation.' . (int) $item->id) && $user->authorise('language_translation.access', 'com_componentbuilder')); + if (!$access) + { + unset($items[$nr]); + continue; + } + + } + } + // 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) && isset($translations['language']) && ComponentbuilderHelper::checkArray($translations['language'])) + { + foreach ($translations['language'] as $language) + { + $langBucket[$language] = $language; + } + } + } + // load the languages to the string + if (ComponentbuilderHelper::checkArray($langBucket)) + { + $item->entranslation = '(' . implode(', ', $langBucket) . ') ' . ComponentbuilderHelper::htmlEscape($item->entranslation, 'UTF-8', true, 150); + } + else + { + $item->entranslation = '(' . JText::_('COM_COMPONENTBUILDER_NOTRANSLATION') . ') ' . ComponentbuilderHelper::htmlEscape($item->entranslation, 'UTF-8', true, 150); + } + } + } + + // return items + return $items; + } + + /** + * Method to build an SQL query to load the list data. + * + * @return string An SQL query + */ + protected function getListQuery() + { + // Get the user object. + $user = JFactory::getUser(); + // Create a new query object. + $db = JFactory::getDBO(); + $query = $db->getQuery(true); + + // Select some fields + $query->select('a.*'); + + // From the componentbuilder_item table + $query->from($db->quoteName('#__componentbuilder_language_translation', 'a')); + + // Filter by published state + $published = $this->getState('filter.published'); + if (is_numeric($published)) + { + $query->where('a.published = ' . (int) $published); + } + elseif ($published === '') + { + $query->where('(a.published = 0 OR a.published = 1)'); + } + + // Join over the asset groups. + $query->select('ag.title AS access_level'); + $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access'); + // Filter by access level. + if ($access = $this->getState('filter.access')) + { + $query->where('a.access = ' . (int) $access); + } + // Implement View Level Access + if (!$user->authorise('core.options', 'com_componentbuilder')) + { + $groups = implode(',', $user->getAuthorisedViewLevels()); + $query->where('a.access IN (' . $groups . ')'); + } + // Filter by search. + $search = $this->getState('filter.search'); + if (!empty($search)) + { + if (stripos($search, 'id:') === 0) + { + $query->where('a.id = ' . (int) substr($search, 3)); + } + else + { + $search = $db->quote('%' . $db->escape($search) . '%'); + $query->where('(a.entranslation LIKE '.$search.')'); + } + } + + + // Add the list ordering clause. + $orderCol = $this->state->get('list.ordering', 'a.id'); + $orderDirn = $this->state->get('list.direction', 'asc'); + if ($orderCol != '') + { + $query->order($db->escape($orderCol . ' ' . $orderDirn)); + } + + return $query; + } + + /** + * Method to get list export data. + * + * @return mixed An array of data items on success, false on failure. + */ + public function getExportData($pks) + { + // setup the query + if (ComponentbuilderHelper::checkArray($pks)) + { + // Set a value to know this is exporting method. + $_export = true; + // Get the user object. + $user = JFactory::getUser(); + // Create a new query object. + $db = JFactory::getDBO(); + $query = $db->getQuery(true); + + // Select some fields + $query->select('a.*'); + + // From the componentbuilder_language_translation table + $query->from($db->quoteName('#__componentbuilder_language_translation', 'a')); + $query->where('a.id IN (' . implode(',',$pks) . ')'); + // Implement View Level Access + if (!$user->authorise('core.options', 'com_componentbuilder')) + { + $groups = implode(',', $user->getAuthorisedViewLevels()); + $query->where('a.access IN (' . $groups . ')'); + } + + // Order the results by ordering + $query->order('a.ordering ASC'); + + // Load the items + $db->setQuery($query); + $db->execute(); + if ($db->getNumRows()) + { + $items = $db->loadObjectList(); + + // set values to display correctly. + if (ComponentbuilderHelper::checkArray($items)) + { + // get user object. + $user = JFactory::getUser(); + foreach ($items as $nr => &$item) + { + $access = ($user->authorise('language_translation.access', 'com_componentbuilder.language_translation.' . (int) $item->id) && $user->authorise('language_translation.access', 'com_componentbuilder')); + if (!$access) + { + unset($items[$nr]); + continue; + } + + // unset the values we don't want exported. + unset($item->asset_id); + unset($item->checked_out); + unset($item->checked_out_time); + } + } + // Add headers to items array. + $headers = $this->getExImPortHeaders(); + if (ComponentbuilderHelper::checkObject($headers)) + { + 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) && isset($translations['language']) && ComponentbuilderHelper::checkArray($translations['language'])) + { + foreach ($translations['language'] as $language) + { + $langBucket[$language] = $language; + } + } + } + // load the languages to the string + if (ComponentbuilderHelper::checkArray($langBucket)) + { + $item->entranslation = '(' . implode(', ', $langBucket) . ') ' . ComponentbuilderHelper::htmlEscape($item->entranslation, 'UTF-8', true, 150); + } + else + { + $item->entranslation = '(' . JText::_('COM_COMPONENTBUILDER_NOTRANSLATION') . ') ' . ComponentbuilderHelper::htmlEscape($item->entranslation, 'UTF-8', true, 150); + } + } + } + return $items; + } + } + return false; + } + + /** + * Method to get header. + * + * @return mixed An array of data items on success, false on failure. + */ + public function getExImPortHeaders() + { + // Get a db connection. + $db = JFactory::getDbo(); + // get the columns + $columns = $db->getTableColumns("#__componentbuilder_language_translation"); + if (ComponentbuilderHelper::checkArray($columns)) + { + // remove the headers you don't import/export. + unset($columns['asset_id']); + unset($columns['checked_out']); + unset($columns['checked_out_time']); + $headers = new stdClass(); + foreach ($columns as $column => $type) + { + $headers->{$column} = $column; + } + return $headers; + } + return false; + } + + /** + * Method to get a store id based on model configuration state. + * + * @return string A store id. + * + */ + protected function getStoreId($id = '') + { + // Compile the store id. + $id .= ':' . $this->getState('filter.id'); + $id .= ':' . $this->getState('filter.search'); + $id .= ':' . $this->getState('filter.published'); + $id .= ':' . $this->getState('filter.ordering'); + $id .= ':' . $this->getState('filter.created_by'); + $id .= ':' . $this->getState('filter.modified_by'); + $id .= ':' . $this->getState('filter.entranslation'); + + return parent::getStoreId($id); + } + + /** + * Build an SQL query to checkin all items left checked out longer then a set time. + * + * @return a bool + * + */ + protected function checkInNow() + { + // Get set check in time + $time = JComponentHelper::getParams('com_componentbuilder')->get('check_in'); + + if ($time) + { + + // Get a db connection. + $db = JFactory::getDbo(); + // reset query + $query = $db->getQuery(true); + $query->select('*'); + $query->from($db->quoteName('#__componentbuilder_language_translation')); + $db->setQuery($query); + $db->execute(); + if ($db->getNumRows()) + { + // Get Yesterdays date + $date = JFactory::getDate()->modify($time)->toSql(); + // reset query + $query = $db->getQuery(true); + + // Fields to update. + $fields = array( + $db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'', + $db->quoteName('checked_out') . '=0' + ); + + // Conditions for which records should be updated. + $conditions = array( + $db->quoteName('checked_out') . '!=0', + $db->quoteName('checked_out_time') . '<\''.$date.'\'' + ); + + // Check table + $query->update($db->quoteName('#__componentbuilder_language_translation'))->set($fields)->where($conditions); + + $db->setQuery($query); + + $db->execute(); + } + } + + return false; + } +} diff --git a/admin/models/languages.php b/admin/models/languages.php new file mode 100644 index 000000000..8bcf570cc --- /dev/null +++ b/admin/models/languages.php @@ -0,0 +1,375 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// import the Joomla modellist library +jimport('joomla.application.component.modellist'); + +/** + * Languages Model + */ +class ComponentbuilderModelLanguages extends JModelList +{ + public function __construct($config = array()) + { + if (empty($config['filter_fields'])) + { + $config['filter_fields'] = array( + 'a.id','id', + 'a.published','published', + 'a.ordering','ordering', + 'a.created_by','created_by', + 'a.modified_by','modified_by', + 'a.name','name', + 'a.langtag','langtag' + ); + } + + parent::__construct($config); + } + + /** + * Method to auto-populate the model state. + * + * @return void + */ + protected function populateState($ordering = null, $direction = null) + { + $app = JFactory::getApplication(); + + // Adjust the context to support modal layouts. + if ($layout = $app->input->get('layout')) + { + $this->context .= '.' . $layout; + } + $name = $this->getUserStateFromRequest($this->context . '.filter.name', 'filter_name'); + $this->setState('filter.name', $name); + + $langtag = $this->getUserStateFromRequest($this->context . '.filter.langtag', 'filter_langtag'); + $this->setState('filter.langtag', $langtag); + + $sorting = $this->getUserStateFromRequest($this->context . '.filter.sorting', 'filter_sorting', 0, 'int'); + $this->setState('filter.sorting', $sorting); + + $access = $this->getUserStateFromRequest($this->context . '.filter.access', 'filter_access', 0, 'int'); + $this->setState('filter.access', $access); + + $search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search'); + $this->setState('filter.search', $search); + + $published = $this->getUserStateFromRequest($this->context . '.filter.published', 'filter_published', ''); + $this->setState('filter.published', $published); + + $created_by = $this->getUserStateFromRequest($this->context . '.filter.created_by', 'filter_created_by', ''); + $this->setState('filter.created_by', $created_by); + + $created = $this->getUserStateFromRequest($this->context . '.filter.created', 'filter_created'); + $this->setState('filter.created', $created); + + // List state information. + parent::populateState($ordering, $direction); + } + + /** + * Method to get an array of data items. + * + * @return mixed An array of data items on success, false on failure. + */ + public function getItems() + { + // check in items + $this->checkInNow(); + + // load parent items + $items = parent::getItems(); + + // set values to display correctly. + if (ComponentbuilderHelper::checkArray($items)) + { + // get user object. + $user = JFactory::getUser(); + foreach ($items as $nr => &$item) + { + $access = ($user->authorise('language.access', 'com_componentbuilder.language.' . (int) $item->id) && $user->authorise('language.access', 'com_componentbuilder')); + if (!$access) + { + unset($items[$nr]); + continue; + } + + } + } + + // return items + return $items; + } + + /** + * Method to build an SQL query to load the list data. + * + * @return string An SQL query + */ + protected function getListQuery() + { + // Get the user object. + $user = JFactory::getUser(); + // Create a new query object. + $db = JFactory::getDBO(); + $query = $db->getQuery(true); + + // Select some fields + $query->select('a.*'); + + // From the componentbuilder_item table + $query->from($db->quoteName('#__componentbuilder_language', 'a')); + + // Filter by published state + $published = $this->getState('filter.published'); + if (is_numeric($published)) + { + $query->where('a.published = ' . (int) $published); + } + elseif ($published === '') + { + $query->where('(a.published = 0 OR a.published = 1)'); + } + + // Join over the asset groups. + $query->select('ag.title AS access_level'); + $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access'); + // Filter by access level. + if ($access = $this->getState('filter.access')) + { + $query->where('a.access = ' . (int) $access); + } + // Implement View Level Access + if (!$user->authorise('core.options', 'com_componentbuilder')) + { + $groups = implode(',', $user->getAuthorisedViewLevels()); + $query->where('a.access IN (' . $groups . ')'); + } + // Filter by search. + $search = $this->getState('filter.search'); + if (!empty($search)) + { + if (stripos($search, 'id:') === 0) + { + $query->where('a.id = ' . (int) substr($search, 3)); + } + else + { + $search = $db->quote('%' . $db->escape($search) . '%'); + $query->where('(a.name LIKE '.$search.' OR a.langtag LIKE '.$search.')'); + } + } + + + // Add the list ordering clause. + $orderCol = $this->state->get('list.ordering', 'a.id'); + $orderDirn = $this->state->get('list.direction', 'asc'); + if ($orderCol != '') + { + $query->order($db->escape($orderCol . ' ' . $orderDirn)); + } + + return $query; + } + + /** + * Method to get list export data. + * + * @return mixed An array of data items on success, false on failure. + */ + public function getExportData($pks) + { + // setup the query + if (ComponentbuilderHelper::checkArray($pks)) + { + // Set a value to know this is exporting method. + $_export = true; + // Get the user object. + $user = JFactory::getUser(); + // Create a new query object. + $db = JFactory::getDBO(); + $query = $db->getQuery(true); + + // Select some fields + $query->select('a.*'); + + // From the componentbuilder_language table + $query->from($db->quoteName('#__componentbuilder_language', 'a')); + $query->where('a.id IN (' . implode(',',$pks) . ')'); + // Implement View Level Access + if (!$user->authorise('core.options', 'com_componentbuilder')) + { + $groups = implode(',', $user->getAuthorisedViewLevels()); + $query->where('a.access IN (' . $groups . ')'); + } + + // Order the results by ordering + $query->order('a.ordering ASC'); + + // Load the items + $db->setQuery($query); + $db->execute(); + if ($db->getNumRows()) + { + $items = $db->loadObjectList(); + + // set values to display correctly. + if (ComponentbuilderHelper::checkArray($items)) + { + // get user object. + $user = JFactory::getUser(); + foreach ($items as $nr => &$item) + { + $access = ($user->authorise('language.access', 'com_componentbuilder.language.' . (int) $item->id) && $user->authorise('language.access', 'com_componentbuilder')); + if (!$access) + { + unset($items[$nr]); + continue; + } + + // unset the values we don't want exported. + unset($item->asset_id); + unset($item->checked_out); + unset($item->checked_out_time); + } + } + // Add headers to items array. + $headers = $this->getExImPortHeaders(); + if (ComponentbuilderHelper::checkObject($headers)) + { + array_unshift($items,$headers); + } + return $items; + } + } + return false; + } + + /** + * Method to get header. + * + * @return mixed An array of data items on success, false on failure. + */ + public function getExImPortHeaders() + { + // Get a db connection. + $db = JFactory::getDbo(); + // get the columns + $columns = $db->getTableColumns("#__componentbuilder_language"); + if (ComponentbuilderHelper::checkArray($columns)) + { + // remove the headers you don't import/export. + unset($columns['asset_id']); + unset($columns['checked_out']); + unset($columns['checked_out_time']); + $headers = new stdClass(); + foreach ($columns as $column => $type) + { + $headers->{$column} = $column; + } + return $headers; + } + return false; + } + + /** + * Method to get a store id based on model configuration state. + * + * @return string A store id. + * + */ + protected function getStoreId($id = '') + { + // Compile the store id. + $id .= ':' . $this->getState('filter.id'); + $id .= ':' . $this->getState('filter.search'); + $id .= ':' . $this->getState('filter.published'); + $id .= ':' . $this->getState('filter.ordering'); + $id .= ':' . $this->getState('filter.created_by'); + $id .= ':' . $this->getState('filter.modified_by'); + $id .= ':' . $this->getState('filter.name'); + $id .= ':' . $this->getState('filter.langtag'); + + return parent::getStoreId($id); + } + + /** + * Build an SQL query to checkin all items left checked out longer then a set time. + * + * @return a bool + * + */ + protected function checkInNow() + { + // Get set check in time + $time = JComponentHelper::getParams('com_componentbuilder')->get('check_in'); + + if ($time) + { + + // Get a db connection. + $db = JFactory::getDbo(); + // reset query + $query = $db->getQuery(true); + $query->select('*'); + $query->from($db->quoteName('#__componentbuilder_language')); + $db->setQuery($query); + $db->execute(); + if ($db->getNumRows()) + { + // Get Yesterdays date + $date = JFactory::getDate()->modify($time)->toSql(); + // reset query + $query = $db->getQuery(true); + + // Fields to update. + $fields = array( + $db->quoteName('checked_out_time') . '=\'0000-00-00 00:00:00\'', + $db->quoteName('checked_out') . '=0' + ); + + // Conditions for which records should be updated. + $conditions = array( + $db->quoteName('checked_out') . '!=0', + $db->quoteName('checked_out_time') . '<\''.$date.'\'' + ); + + // Check table + $query->update($db->quoteName('#__componentbuilder_language'))->set($fields)->where($conditions); + + $db->setQuery($query); + + $db->execute(); + } + } + + return false; + } +} diff --git a/admin/models/site_view.php b/admin/models/site_view.php index 9350faed0..eb0a0d43c 100644 --- a/admin/models/site_view.php +++ b/admin/models/site_view.php @@ -175,7 +175,7 @@ class ComponentbuilderModelSite_view extends JModelAdmin $item->tags->getTagIds($item->id, 'com_componentbuilder.site_view'); } } - $this->addsite_viewsvvwb = $item->id; + $this->addsite_viewsvvwc = $item->id; return $item; } @@ -185,7 +185,7 @@ class ComponentbuilderModelSite_view extends JModelAdmin * * @return mixed An array of data items on success, false on failure. */ - public function getVyslinked_components() + public function getVytlinked_components() { // Get the user object. $user = JFactory::getUser(); @@ -225,15 +225,15 @@ class ComponentbuilderModelSite_view extends JModelAdmin { $items = $db->loadObjectList(); - // Filter by addsite_viewsvvwb in this Repetable Field - if (ComponentbuilderHelper::checkArray($items) && isset($this->addsite_viewsvvwb)) + // Filter by addsite_viewsvvwc in this Repetable Field + if (ComponentbuilderHelper::checkArray($items) && isset($this->addsite_viewsvvwc)) { foreach ($items as $nr => &$item) { if (isset($item->addsite_views) && ComponentbuilderHelper::checkJson($item->addsite_views)) { $tmpArray = json_decode($item->addsite_views,true); - if (!in_array($this->addsite_viewsvvwb, $tmpArray['siteview'])) + if (!in_array($this->addsite_viewsvvwc, $tmpArray['siteview'])) { unset($items[$nr]); continue; diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql index 2de984f8a..64cbd78e3 100644 --- a/admin/sql/install.mysql.utf8.sql +++ b/admin/sql/install.mysql.utf8.sql @@ -558,9 +558,9 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_custom_code` ( KEY `idx_component` (`component`), KEY `idx_target` (`target`), KEY `idx_type` (`type`), + KEY `idx_to_line` (`to_line`), KEY `idx_function_name` (`function_name`), - KEY `idx_from_line` (`from_line`), - KEY `idx_to_line` (`to_line`) + KEY `idx_from_line` (`from_line`) ) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `#__componentbuilder_snippet` ( @@ -683,6 +683,58 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_fieldtype` ( KEY `idx_catid` (`catid`) ) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; +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, + `entranslation` TEXT NOT NULL, + `translation` TEXT NOT NULL, + `params` text NOT NULL DEFAULT '', + `published` TINYINT(3) NOT NULL DEFAULT 1, + `created_by` INT(10) unsigned NOT NULL DEFAULT 0, + `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, + `created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `checked_out` int(11) unsigned NOT NULL DEFAULT 0, + `checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `version` INT(10) unsigned NOT NULL DEFAULT 1, + `hits` INT(10) unsigned NOT NULL DEFAULT 0, + `access` INT(10) unsigned NOT NULL DEFAULT 0, + `ordering` INT(11) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + KEY `idx_access` (`access`), + KEY `idx_checkout` (`checked_out`), + KEY `idx_createdby` (`created_by`), + KEY `idx_modifiedby` (`modified_by`), + KEY `idx_state` (`published`) +) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `#__componentbuilder_language` ( + `id` INT(11) NOT NULL AUTO_INCREMENT, + `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', + `langtag` VARCHAR(64) NOT NULL DEFAULT '', + `name` VARCHAR(255) NOT NULL DEFAULT '', + `params` text NOT NULL DEFAULT '', + `published` TINYINT(3) NOT NULL DEFAULT 1, + `created_by` INT(10) unsigned NOT NULL DEFAULT 0, + `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, + `created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `checked_out` int(11) unsigned NOT NULL DEFAULT 0, + `checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `version` INT(10) unsigned NOT NULL DEFAULT 1, + `hits` INT(10) unsigned NOT NULL DEFAULT 0, + `access` INT(10) unsigned NOT NULL DEFAULT 0, + `ordering` INT(11) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + KEY `idx_access` (`access`), + KEY `idx_checkout` (`checked_out`), + KEY `idx_createdby` (`created_by`), + KEY `idx_modifiedby` (`modified_by`), + KEY `idx_state` (`published`), + KEY `idx_name` (`name`) +) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; + CREATE TABLE IF NOT EXISTS `#__componentbuilder_help_document` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', @@ -898,7 +950,7 @@ INSERT INTO `#__componentbuilder_fieldtype` (`id`, `catid`, `description`, `name (20, '', 'The spacer form field type provides a visual separator between parameter field elements. It is purely a visual aid and no field value is stored.', 'Spacer', '{\"name\":[\"type\",\"name\",\"label\",\"description\",\"hr\",\"class\"],\"example\":[\"spacer\",\"myspacer\",\"The notice\",\"The notice description\",\"\",\"\"],\"adjustable\":[\"0\",\"1\",\"1\",\"1\",\"1\",\"1\"],\"mandatory\":[\"1\",\"1\",\"0\",\"0\",\"0\",\"0\"],\"translatable\":[\"0\",\"0\",\"1\",\"1\",\"0\",\"0\"],\"description\":[\"(mandatory) must be spacer.\",\"(mandatory) is the unique name of the field.\",\"(optional) (translatable) is the text to use as a spacer.\",\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\",\"(optional) is whether to display a horizontal rule (\'true\' or \'false\'). If this attribute is \'true\', the label attribute will be ignored.\",\"(optional) is a CSS class name for the HTML form field.\"]}', 'provides a visual separator between form fields. It is purely a visual aid and no value is stored.', '', 1, 1, '', ''), (23, '', 'The tel field type is an alias for a text field. Telephone numbers can be validated using the tel rule and filtered using the tel input filter.', 'Tel', '{\"name\":[\"type\",\"name\",\"label\",\"size\",\"maxlength\",\"default\",\"description\",\"class\",\"readonly\",\"disabled\",\"required\",\"filter\",\"validated\",\"message\",\"hint\",\"showon\",\"onchange\"],\"example\":[\"text\",\"phone\",\"Phone\",\"10\",\"50\",\"\",\"Enter phone number\",\"text_area\",\"false\",\"false\",\"false\",\"tel\",\"tel\",\"Error! Please add phone number here.\",\"Your Phone Number\",\"\",\"\"],\"adjustable\":[\"0\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\"],\"mandatory\":[\"1\",\"1\",\"1\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\"],\"translatable\":[\"0\",\"0\",\"1\",\"0\",\"0\",\"0\",\"1\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"1\",\"0\",\"0\"],\"description\":[\"(mandatory) must be text.\",\"(mandatory) is the unique name of the field.\",\"(mandatory) (translatable) is the descriptive title of the field.\",\"(optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.\",\"(optional) limits the number of characters that may be entered.\",\"(optional) (not translatable) is the default value.\",\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\",\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\",\"(optional) The field cannot be changed and will automatically inherit the default value\",\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\",\"(optional) The field must be filled before submitting the form.\",\"(optional) allow the system to save certain html tags or raw data.\",\"(optional) allow the system to validated the input data.\",\"(optional) The error message that will be displayed instead of the default message.\",\"(optional) The placeholder to display inside the text box.\",\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+\",\"(optional) HTML equivalent attribute (javascript use)\"]}', 'provides an input field for a telephone number.', '', 1, 4, '', ''), (24, '', 'The text form field type provides a text box for data entry. If the field has a value saved, this value is displayed when the page is first loaded. If not, the default value (if any) is selected.', 'Text', '{\"name\":[\"type\",\"name\",\"label\",\"size\",\"maxlength\",\"default\",\"description\",\"class\",\"readonly\",\"disabled\",\"required\",\"filter\",\"validate\",\"field\",\"message\",\"hint\",\"showon\",\"onchange\"],\"example\":[\"text\",\"mytextvalue\",\"Enter some text\",\"10\",\"50\",\"Some text\",\"Enter some description\",\"text_area\",\"false\",\"false\",\"false\",\"STRING\",\"\",\"\",\"Error! Please add some text here.\",\"Your Name Here\",\"\",\"\"],\"adjustable\":[\"0\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\"],\"mandatory\":[\"1\",\"1\",\"1\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\"],\"translatable\":[\"0\",\"0\",\"1\",\"0\",\"0\",\"0\",\"1\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"1\",\"0\",\"0\"],\"description\":[\"(mandatory) must be text.\",\"(mandatory) is the unique name of the field.\",\"(mandatory) (translatable) is the descriptive title of the field.\",\"(optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.\",\"(optional) limits the number of characters that may be entered.\",\"(optional) (not translatable) is the default value.\",\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\",\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\",\"(optional) The field cannot be changed and will automatically inherit the default value\",\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\",\"(optional) The field must be filled before submitting the form.\",\"(optional) allow the system to save certain html tags or raw data.\",\"(optional) makes the system validate the data.\",\"(optional) used in validation of \\\"equals\\\" to link the field to match.\",\"(optional) The error message that will be displayed instead of the default message.\",\"(optional) The placeholder to display inside the text box.\",\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+\",\"(optional) HTML equivalent attribute (javascript use)\"]}', 'provides a text box for data entry.', '', 1, 5, '', ''), -(25, '', 'The textarea form field type provides a text area for entry of multi-line text. If the field has a value saved, this value is displayed when the page is first loaded. If not, the default value (if any) is selected.', 'Textarea', '{\"name\":[\"type\",\"name\",\"label\",\"rows\",\"cols\",\"default\",\"description\",\"class\",\"filter\",\"hint\",\"required\",\"showon\",\"onchange\"],\"example\":[\"textarea\",\"mytextarea\",\"Enter some text\",\"10\",\"5\",\"default text\",\"Text Area\",\"text_area\",\"raw\",\"\",\"\",\"\",\"\"],\"adjustable\":[\"0\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\"],\"mandatory\":[\"1\",\"1\",\"1\",\"1\",\"1\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\"],\"translatable\":[\"0\",\"0\",\"1\",\"0\",\"0\",\"0\",\"1\",\"0\",\"0\",\"1\",\"0\",\"0\",\"0\"],\"description\":[\"(mandatory) must be textarea.\",\"(mandatory) is the unique name of the field.\",\"(mandatory) (translatable) is the descriptive title of the field.\",\"(mandatory) is the height of the visible text area in lines. If omitted the width is determined by the browser. The value of rows does not limit the number of lines that may be entered.\",\"(mandatory) is the width of the visible text area in characters. If omitted the width is determined by the browser. The value of cols does not limit the number of characters that may be entered.\",\"(optional) (not translatable) is the default value.\",\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\",\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\",\"(optional) allow the system to save certain html tags or raw data.\",\"(optional) The placeholder to display inside the textarea.\",\"(optional) The field must be filled before submitting the form.\",\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+\",\"(optional) HTML equivalent attribute (javascript use)\"]}', 'provides a text area for entry of multi-line text.', '', 1, 4, '', ''), +(25, '', 'The textarea form field type provides a text area for entry of multi-line text. If the field has a value saved, this value is displayed when the page is first loaded. If not, the default value (if any) is selected.', 'Textarea', '{\"name\":[\"type\",\"name\",\"label\",\"rows\",\"cols\",\"default\",\"description\",\"class\",\"filter\",\"hint\",\"required\",\"readonly\",\"disabled\",\"showon\",\"onchange\"],\"example\":[\"textarea\",\"mytextarea\",\"Enter some text\",\"10\",\"5\",\"default text\",\"Text Area\",\"text_area\",\"raw\",\"\",\"false\",\"false\",\"false\",\"\",\"\"],\"adjustable\":[\"0\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\"],\"mandatory\":[\"1\",\"1\",\"1\",\"1\",\"1\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\"],\"translatable\":[\"0\",\"0\",\"1\",\"0\",\"0\",\"0\",\"1\",\"0\",\"0\",\"1\",\"0\",\"0\",\"0\",\"0\",\"0\"],\"description\":[\"(mandatory) must be textarea.\",\"(mandatory) is the unique name of the field.\",\"(mandatory) (translatable) is the descriptive title of the field.\",\"(mandatory) is the height of the visible text area in lines. If omitted the width is determined by the browser. The value of rows does not limit the number of lines that may be entered.\",\"(mandatory) is the width of the visible text area in characters. If omitted the width is determined by the browser. The value of cols does not limit the number of characters that may be entered.\",\"(optional) (not translatable) is the default value.\",\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\",\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\",\"(optional) allow the system to save certain html tags or raw data.\",\"(optional) The placeholder to display inside the textarea.\",\"(optional) The field must be filled before submitting the form.\",\"(optional) The field cannot be changed and will automatically inherit the default value\",\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\",\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+\",\"(optional) HTML equivalent attribute (javascript use)\"]}', 'provides a text area for entry of multi-line text.', '', 1, 5, '', ''), (26, '', 'The timezones form field type provides a drop down list of time zones. If the field has a value saved, this value is displayed when the page is first loaded. If not, the default value (if any) is selected.', 'Timezone', '{\"name\":[\"type\",\"name\",\"label\",\"default\",\"description\",\"showon\"],\"example\":[\"timezone\",\"timezone\",\"Timezone\",\"\",\"\",\"\"],\"adjustable\":[\"0\",\"1\",\"1\",\"1\",\"1\",\"1\"],\"mandatory\":[\"1\",\"1\",\"1\",\"0\",\"0\",\"0\"],\"translatable\":[\"0\",\"0\",\"1\",\"0\",\"1\",\"0\"],\"description\":[\"(mandatory) must be timezone.\",\"(mandatory) is the unique name of the field.\",\"(mandatory) (translatable) is the descriptive title of the field.\",\"(optional) is the default time zone. For example, use \'-10\' for \'(UTC -10:00) Hawaii\'.\",\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\",\"(optional) show this field on the bases of the value in another field.\"]}', 'provides a drop down list of time zones.', '', 1, 2, '', ''), (27, '', 'This field essentially is a text field with the type of url. If a fully qualified url (that is one with a scheme and domain such as http://example.com) is entered and it uses idn (that is uses characters that are non ascii such as ê or Ψ) it will translat', 'URL', '{\"name\":[\"type\",\"name\",\"label\",\"size\",\"maxlength\",\"default\",\"description\",\"class\",\"readonly\",\"disabled\",\"required\",\"filter\",\"validated\",\"message\",\"hint\",\"showon\",\"onchange\"],\"example\":[\"url\",\"website\",\"Website\",\"10\",\"50\",\"\",\"Enter website address\",\"text_area\",\"\",\"\",\"\",\"url\",\"url\",\"Error! Please add website here.\",\"Your Website Here\",\"\",\"\"],\"adjustable\":[\"0\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\",\"1\"],\"mandatory\":[\"1\",\"1\",\"1\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\"],\"translatable\":[\"0\",\"0\",\"1\",\"0\",\"0\",\"0\",\"1\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"0\",\"1\",\"0\",\"0\"],\"description\":[\"(mandatory) must be url.\",\"(mandatory) is the unique name of the field.\",\"(mandatory) (translatable) is the descriptive title of the field.\",\"(optional) is the width of the text box in characters. If omitted the width is determined by the browser. The value of size does not limit the number of characters that may be entered.\",\"(optional) limits the number of characters that may be entered.\",\"(optional) (not translatable) is the default value.\",\"(optional) (translatable) is text that will be shown as a tooltip when the user moves the mouse over the drop-down box.\",\"(optional) is a CSS class name for the HTML form field. If omitted this will default to \'text_area\'.\",\"(optional) The field cannot be changed and will automatically inherit the default value\",\"(optional) The field cannot be changed and will automatically inherit the default value - it will also not submit\",\"(optional) The field must be filled before submitting the form.\",\"(optional) allow the system to save certain html tags or raw data.\",\"(optional) allow the system to validated the input data.\",\"(optional) The error message that will be displayed instead of the default message.\",\"(optional) The placeholder to display inside the text box.\",\"(optional) Allows you to hide the field based on the value(s) of another field; for Joomla 3.2.4+\",\"(optional) HTML equivalent attribute (javascript use)\"]}', 'provides a URL text input field.', '', 1, 4, '', ''); diff --git a/admin/sql/uninstall.mysql.utf8.sql b/admin/sql/uninstall.mysql.utf8.sql index 45da17ee2..7212c0456 100644 --- a/admin/sql/uninstall.mysql.utf8.sql +++ b/admin/sql/uninstall.mysql.utf8.sql @@ -9,4 +9,6 @@ DROP TABLE IF EXISTS `#__componentbuilder_custom_code`; DROP TABLE IF EXISTS `#__componentbuilder_snippet`; DROP TABLE IF EXISTS `#__componentbuilder_field`; DROP TABLE IF EXISTS `#__componentbuilder_fieldtype`; +DROP TABLE IF EXISTS `#__componentbuilder_language_translation`; +DROP TABLE IF EXISTS `#__componentbuilder_language`; DROP TABLE IF EXISTS `#__componentbuilder_help_document`; diff --git a/admin/sql/updates/mysql/2.4.1.sql b/admin/sql/updates/mysql/2.4.1.sql new file mode 100644 index 000000000..a03ca162e --- /dev/null +++ b/admin/sql/updates/mysql/2.4.1.sql @@ -0,0 +1,51 @@ +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, + `entranslation` TEXT NOT NULL, + `translation` TEXT NOT NULL, + `params` text NOT NULL DEFAULT '', + `published` TINYINT(3) NOT NULL DEFAULT 1, + `created_by` INT(10) unsigned NOT NULL DEFAULT 0, + `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, + `created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `checked_out` int(11) unsigned NOT NULL DEFAULT 0, + `checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `version` INT(10) unsigned NOT NULL DEFAULT 1, + `hits` INT(10) unsigned NOT NULL DEFAULT 0, + `access` INT(10) unsigned NOT NULL DEFAULT 0, + `ordering` INT(11) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + KEY `idx_access` (`access`), + KEY `idx_checkout` (`checked_out`), + KEY `idx_createdby` (`created_by`), + KEY `idx_modifiedby` (`modified_by`), + KEY `idx_state` (`published`) +) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; + +CREATE TABLE IF NOT EXISTS `#__componentbuilder_language` ( + `id` INT(11) NOT NULL AUTO_INCREMENT, + `asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.', + `langtag` VARCHAR(64) NOT NULL DEFAULT '', + `name` VARCHAR(255) NOT NULL DEFAULT '', + `params` text NOT NULL DEFAULT '', + `published` TINYINT(3) NOT NULL DEFAULT 1, + `created_by` INT(10) unsigned NOT NULL DEFAULT 0, + `modified_by` INT(10) unsigned NOT NULL DEFAULT 0, + `created` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `modified` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `checked_out` int(11) unsigned NOT NULL DEFAULT 0, + `checked_out_time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + `version` INT(10) unsigned NOT NULL DEFAULT 1, + `hits` INT(10) unsigned NOT NULL DEFAULT 0, + `access` INT(10) unsigned NOT NULL DEFAULT 0, + `ordering` INT(11) NOT NULL DEFAULT 0, + PRIMARY KEY (`id`), + KEY `idx_access` (`access`), + KEY `idx_checkout` (`checked_out`), + KEY `idx_createdby` (`created_by`), + KEY `idx_modifiedby` (`modified_by`), + KEY `idx_state` (`published`), + KEY `idx_name` (`name`) +) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT CHARSET=utf8; diff --git a/admin/tables/custom_code.php b/admin/tables/custom_code.php index cf8fb28eb..0eb9dfbfb 100644 --- a/admin/tables/custom_code.php +++ b/admin/tables/custom_code.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 81 of this MVC - @build 1st March, 2017 + @version @update number 82 of this MVC + @build 3rd April, 2017 @created 11th October, 2016 @package Component Builder @subpackage custom_code.php diff --git a/admin/tables/help_document.php b/admin/tables/help_document.php index 45217b177..5c4b29858 100644 --- a/admin/tables/help_document.php +++ b/admin/tables/help_document.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 6 of this MVC - @build 17th October, 2016 + @build 18th October, 2016 @created 4th March, 2016 @package Component Builder @subpackage help_document.php diff --git a/admin/tables/joomla_component.php b/admin/tables/joomla_component.php index fed5dd789..bc16cefcb 100644 --- a/admin/tables/joomla_component.php +++ b/admin/tables/joomla_component.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 311 of this MVC - @build 1st April, 2017 + @version @update number 318 of this MVC + @build 5th April, 2017 @created 6th May, 2015 @package Component Builder @subpackage joomla_component.php diff --git a/admin/tables/language.php b/admin/tables/language.php new file mode 100644 index 000000000..57370ff8c --- /dev/null +++ b/admin/tables/language.php @@ -0,0 +1,351 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +use Joomla\Registry\Registry; + +// import Joomla table library +jimport('joomla.database.table'); + +/** + * Languages Table class + */ +class ComponentbuilderTableLanguage extends JTable +{ + /** + * Ensure the params and metadata in json encoded in the bind method + * + * @var array + * @since 3.3 + */ + protected $_jsonEncode = array('params', 'metadata'); + + /** + * Constructor + * + * @param object Database connector object + */ + function __construct(&$db) + { + parent::__construct('#__componentbuilder_language', 'id', $db); + + // Adding History Options + JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_componentbuilder.language')); + } + + public function bind($array, $ignore = '') + { + + if (isset($array['params']) && is_array($array['params'])) + { + $registry = new JRegistry; + $registry->loadArray($array['params']); + $array['params'] = (string) $registry; + } + + if (isset($array['metadata']) && is_array($array['metadata'])) + { + $registry = new JRegistry; + $registry->loadArray($array['metadata']); + $array['metadata'] = (string) $registry; + } + + // Bind the rules. + if (isset($array['rules']) && is_array($array['rules'])) + { + $rules = new JAccessRules($array['rules']); + $this->setRules($rules); + } + return parent::bind($array, $ignore); + } + + /** + * Overload the store method for the Language table. + * + * @param boolean Toggle whether null values should be updated. + * @return boolean True on success, false on failure. + * @since 1.6 + */ + public function store($updateNulls = false) + { + $date = JFactory::getDate(); + $user = JFactory::getUser(); + + if ($this->id) + { + // Existing item + $this->modified = $date->toSql(); + $this->modified_by = $user->get('id'); + } + else + { + // New language. A language created and created_by field can be set by the user, + // so we don't touch either of these if they are set. + if (!(int) $this->created) + { + $this->created = $date->toSql(); + } + if (empty($this->created_by)) + { + $this->created_by = $user->get('id'); + } + } + + if (isset($this->alias)) + { + // Verify that the alias is unique + $table = JTable::getInstance('language', 'ComponentbuilderTable'); + + if ($table->load(array('alias' => $this->alias)) && ($table->id != $this->id || $this->id == 0)) + { + $this->setError(JText::_('COM_COMPONENTBUILDER_LANGUAGE_ERROR_UNIQUE_ALIAS')); + return false; + } + } + + if (isset($this->url)) + { + // Convert IDN urls to punycode + $this->url = JStringPunycode::urlToPunycode($this->url); + } + if (isset($this->website)) + { + // Convert IDN urls to punycode + $this->website = JStringPunycode::urlToPunycode($this->website); + } + + return parent::store($updateNulls); + } + + /** + * Overloaded check method to ensure data integrity. + * + * @return boolean True on success. + */ + public function check() + { + if (isset($this->alias)) + { + // Generate a valid alias + $this->generateAlias(); + + $table = JTable::getInstance('language', 'componentbuilderTable'); + + while ($table->load(array('alias' => $this->alias)) && ($table->id != $this->id || $this->id == 0)) + { + $this->alias = JString::increment($this->alias, 'dash'); + } + } + + /* + * Clean up keywords -- eliminate extra spaces between phrases + * and cr (\r) and lf (\n) characters from string. + * Only process if not empty. + */ + if (!empty($this->metakey)) + { + // Array of characters to remove. + $bad_characters = array("\n", "\r", "\"", "<", ">"); + + // Remove bad characters. + $after_clean = JString::str_ireplace($bad_characters, "", $this->metakey); + + // Create array using commas as delimiter. + $keys = explode(',', $after_clean); + $clean_keys = array(); + + foreach ($keys as $key) + { + // Ignore blank keywords. + if (trim($key)) + { + $clean_keys[] = trim($key); + } + } + + // Put array back together delimited by ", " + $this->metakey = implode(", ", $clean_keys); + } + + // Clean up description -- eliminate quotes and <> brackets + if (!empty($this->metadesc)) + { + // Only process if not empty + $bad_characters = array("\"", "<", ">"); + $this->metadesc = JString::str_ireplace($bad_characters, "", $this->metadesc); + } + + // If we don't have any access rules set at this point just use an empty JAccessRules class + if (!$this->getRules()) + { + $rules = $this->getDefaultAssetValues('com_componentbuilder.language.'.$this->id); + $this->setRules($rules); + } + + // Set ordering + if ($this->published < 0) + { + // Set ordering to 0 if state is archived or trashed + $this->ordering = 0; + } + + return true; + } + + /** + * Gets the default asset values for a component. + * + * @param $string $component The component asset name to search for + * + * @return JAccessRules The JAccessRules object for the asset + */ + protected function getDefaultAssetValues($component, $try = true) + { + // Need to find the asset id by the name of the component. + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select($db->quoteName('id')) + ->from($db->quoteName('#__assets')) + ->where($db->quoteName('name') . ' = ' . $db->quote($component)); + $db->setQuery($query); + $db->execute(); + if ($db->loadRowList()) + { + // asset alread set so use saved rules + $assetId = (int) $db->loadResult(); + return JAccess::getAssetRules($assetId); + } + // try again + elseif ($try) + { + $try = explode('.',$component); + $result = $this->getDefaultAssetValues($try[0], false); + if ($result instanceof JAccessRules) + { + if (isset($try[1])) + { + $_result = (string) $result; + $_result = json_decode($_result); + foreach ($_result as $name => &$rule) + { + $v = explode('.', $name); + if ($try[1] !== $v[0]) + { + // remove since it is not part of this view + unset($_result->$name); + } + else + { + // clear the value since we inherit + $rule = array(); + } + } + // check if there are any view values remaining + if (count($_result)) + { + $_result = json_encode($_result); + $_result = array($_result); + // Instantiate and return the JAccessRules object for the asset rules. + $rules = new JAccessRules; + $rules->mergeCollection($_result); + + return $rules; + } + } + return $result; + } + } + return JAccess::getAssetRules(0); + } + + /** + * Method to compute the default name of the asset. + * The default name is in the form 'table_name.id' + * where id is the value of the primary key of the table. + * + * @return string + * @since 2.5 + */ + protected function _getAssetName() + { + $k = $this->_tbl_key; + return 'com_componentbuilder.language.'.(int) $this->$k; + } + + /** + * Method to return the title to use for the asset table. + * + * @return string + * @since 2.5 + */ + protected function _getAssetTitle() + { + if (isset($this->title)) + { + return $this->title; + } + return ''; + } + + /** + * Get the parent asset id for the record + * + * @return int + * @since 2.5 + */ + protected function _getAssetParentId(JTable $table = NULL, $id = NULL) + { + $asset = JTable::getInstance('Asset'); + $asset->loadByName('com_componentbuilder'); + + return $asset->id; + } + + /** + * Generate a valid alias from title / date. + * Remains public to be able to check for duplicated alias before saving + * + * @return string + */ + public function generateAlias() + { + if (empty($this->alias)) + { + $this->alias = $this->name; + } + + $this->alias = JApplication::stringURLSafe($this->alias); + + if (trim(str_replace('-', '', $this->alias)) == '') + { + $this->alias = JFactory::getDate()->format("Y-m-d-H-i-s"); + } + + return $this->alias; + } + +} diff --git a/admin/tables/language_translation.php b/admin/tables/language_translation.php new file mode 100644 index 000000000..8eda17ee4 --- /dev/null +++ b/admin/tables/language_translation.php @@ -0,0 +1,351 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +use Joomla\Registry\Registry; + +// import Joomla table library +jimport('joomla.database.table'); + +/** + * Language_translations Table class + */ +class ComponentbuilderTableLanguage_translation extends JTable +{ + /** + * Ensure the params and metadata in json encoded in the bind method + * + * @var array + * @since 3.3 + */ + protected $_jsonEncode = array('params', 'metadata'); + + /** + * Constructor + * + * @param object Database connector object + */ + function __construct(&$db) + { + parent::__construct('#__componentbuilder_language_translation', 'id', $db); + + // Adding History Options + JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_componentbuilder.language_translation')); + } + + public function bind($array, $ignore = '') + { + + if (isset($array['params']) && is_array($array['params'])) + { + $registry = new JRegistry; + $registry->loadArray($array['params']); + $array['params'] = (string) $registry; + } + + if (isset($array['metadata']) && is_array($array['metadata'])) + { + $registry = new JRegistry; + $registry->loadArray($array['metadata']); + $array['metadata'] = (string) $registry; + } + + // Bind the rules. + if (isset($array['rules']) && is_array($array['rules'])) + { + $rules = new JAccessRules($array['rules']); + $this->setRules($rules); + } + return parent::bind($array, $ignore); + } + + /** + * Overload the store method for the Language_translation table. + * + * @param boolean Toggle whether null values should be updated. + * @return boolean True on success, false on failure. + * @since 1.6 + */ + public function store($updateNulls = false) + { + $date = JFactory::getDate(); + $user = JFactory::getUser(); + + if ($this->id) + { + // Existing item + $this->modified = $date->toSql(); + $this->modified_by = $user->get('id'); + } + else + { + // New language_translation. A language_translation created and created_by field can be set by the user, + // so we don't touch either of these if they are set. + if (!(int) $this->created) + { + $this->created = $date->toSql(); + } + if (empty($this->created_by)) + { + $this->created_by = $user->get('id'); + } + } + + if (isset($this->alias)) + { + // Verify that the alias is unique + $table = JTable::getInstance('language_translation', 'ComponentbuilderTable'); + + if ($table->load(array('alias' => $this->alias)) && ($table->id != $this->id || $this->id == 0)) + { + $this->setError(JText::_('COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_ERROR_UNIQUE_ALIAS')); + return false; + } + } + + if (isset($this->url)) + { + // Convert IDN urls to punycode + $this->url = JStringPunycode::urlToPunycode($this->url); + } + if (isset($this->website)) + { + // Convert IDN urls to punycode + $this->website = JStringPunycode::urlToPunycode($this->website); + } + + return parent::store($updateNulls); + } + + /** + * Overloaded check method to ensure data integrity. + * + * @return boolean True on success. + */ + public function check() + { + if (isset($this->alias)) + { + // Generate a valid alias + $this->generateAlias(); + + $table = JTable::getInstance('language_translation', 'componentbuilderTable'); + + while ($table->load(array('alias' => $this->alias)) && ($table->id != $this->id || $this->id == 0)) + { + $this->alias = JString::increment($this->alias, 'dash'); + } + } + + /* + * Clean up keywords -- eliminate extra spaces between phrases + * and cr (\r) and lf (\n) characters from string. + * Only process if not empty. + */ + if (!empty($this->metakey)) + { + // Array of characters to remove. + $bad_characters = array("\n", "\r", "\"", "<", ">"); + + // Remove bad characters. + $after_clean = JString::str_ireplace($bad_characters, "", $this->metakey); + + // Create array using commas as delimiter. + $keys = explode(',', $after_clean); + $clean_keys = array(); + + foreach ($keys as $key) + { + // Ignore blank keywords. + if (trim($key)) + { + $clean_keys[] = trim($key); + } + } + + // Put array back together delimited by ", " + $this->metakey = implode(", ", $clean_keys); + } + + // Clean up description -- eliminate quotes and <> brackets + if (!empty($this->metadesc)) + { + // Only process if not empty + $bad_characters = array("\"", "<", ">"); + $this->metadesc = JString::str_ireplace($bad_characters, "", $this->metadesc); + } + + // If we don't have any access rules set at this point just use an empty JAccessRules class + if (!$this->getRules()) + { + $rules = $this->getDefaultAssetValues('com_componentbuilder.language_translation.'.$this->id); + $this->setRules($rules); + } + + // Set ordering + if ($this->published < 0) + { + // Set ordering to 0 if state is archived or trashed + $this->ordering = 0; + } + + return true; + } + + /** + * Gets the default asset values for a component. + * + * @param $string $component The component asset name to search for + * + * @return JAccessRules The JAccessRules object for the asset + */ + protected function getDefaultAssetValues($component, $try = true) + { + // Need to find the asset id by the name of the component. + $db = JFactory::getDbo(); + $query = $db->getQuery(true) + ->select($db->quoteName('id')) + ->from($db->quoteName('#__assets')) + ->where($db->quoteName('name') . ' = ' . $db->quote($component)); + $db->setQuery($query); + $db->execute(); + if ($db->loadRowList()) + { + // asset alread set so use saved rules + $assetId = (int) $db->loadResult(); + return JAccess::getAssetRules($assetId); + } + // try again + elseif ($try) + { + $try = explode('.',$component); + $result = $this->getDefaultAssetValues($try[0], false); + if ($result instanceof JAccessRules) + { + if (isset($try[1])) + { + $_result = (string) $result; + $_result = json_decode($_result); + foreach ($_result as $name => &$rule) + { + $v = explode('.', $name); + if ($try[1] !== $v[0]) + { + // remove since it is not part of this view + unset($_result->$name); + } + else + { + // clear the value since we inherit + $rule = array(); + } + } + // check if there are any view values remaining + if (count($_result)) + { + $_result = json_encode($_result); + $_result = array($_result); + // Instantiate and return the JAccessRules object for the asset rules. + $rules = new JAccessRules; + $rules->mergeCollection($_result); + + return $rules; + } + } + return $result; + } + } + return JAccess::getAssetRules(0); + } + + /** + * Method to compute the default name of the asset. + * The default name is in the form 'table_name.id' + * where id is the value of the primary key of the table. + * + * @return string + * @since 2.5 + */ + protected function _getAssetName() + { + $k = $this->_tbl_key; + return 'com_componentbuilder.language_translation.'.(int) $this->$k; + } + + /** + * Method to return the title to use for the asset table. + * + * @return string + * @since 2.5 + */ + protected function _getAssetTitle() + { + if (isset($this->title)) + { + return $this->title; + } + return ''; + } + + /** + * Get the parent asset id for the record + * + * @return int + * @since 2.5 + */ + protected function _getAssetParentId(JTable $table = NULL, $id = NULL) + { + $asset = JTable::getInstance('Asset'); + $asset->loadByName('com_componentbuilder'); + + return $asset->id; + } + + /** + * Generate a valid alias from title / date. + * Remains public to be able to check for duplicated alias before saving + * + * @return string + */ + public function generateAlias() + { + if (empty($this->alias)) + { + $this->alias = $this->name; + } + + $this->alias = JApplication::stringURLSafe($this->alias); + + if (trim(str_replace('-', '', $this->alias)) == '') + { + $this->alias = JFactory::getDate()->format("Y-m-d-H-i-s"); + } + + return $this->alias; + } + +} diff --git a/admin/views/admin_view/view.html.php b/admin/views/admin_view/view.html.php index d63d663c6..0cd7d170d 100644 --- a/admin/views/admin_view/view.html.php +++ b/admin/views/admin_view/view.html.php @@ -71,10 +71,10 @@ class ComponentbuilderViewAdmin_view extends JViewLegacy } // Get Linked view data - $this->vxwfields = $this->get('Vxwfields'); + $this->vxxfields = $this->get('Vxxfields'); // Get Linked view data - $this->vxxlinked_components = $this->get('Vxxlinked_components'); + $this->vxylinked_components = $this->get('Vxylinked_components'); // Set the toolbar $this->addToolBar(); diff --git a/admin/views/componentbuilder/tmpl/default.php b/admin/views/componentbuilder/tmpl/default.php index 569e21abb..e5e23aac7 100644 --- a/admin/views/componentbuilder/tmpl/default.php +++ b/admin/views/componentbuilder/tmpl/default.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage default.php diff --git a/admin/views/componentbuilder/tmpl/default_closed_issues_the_closed_issues_on_github.php b/admin/views/componentbuilder/tmpl/default_closed_issues_the_closed_issues_on_github.php index 37820dc7e..46fc6f79a 100644 --- a/admin/views/componentbuilder/tmpl/default_closed_issues_the_closed_issues_on_github.php +++ b/admin/views/componentbuilder/tmpl/default_closed_issues_the_closed_issues_on_github.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage default_closed_issues_the_closed_issues_on_github.php diff --git a/admin/views/componentbuilder/tmpl/default_main.php b/admin/views/componentbuilder/tmpl/default_main.php index 4e4587f64..e419ae7e8 100644 --- a/admin/views/componentbuilder/tmpl/default_main.php +++ b/admin/views/componentbuilder/tmpl/default_main.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage default_main.php diff --git a/admin/views/componentbuilder/tmpl/default_open_issues_the_open_issues_on_github.php b/admin/views/componentbuilder/tmpl/default_open_issues_the_open_issues_on_github.php index b484eb23b..f636d8f05 100644 --- a/admin/views/componentbuilder/tmpl/default_open_issues_the_open_issues_on_github.php +++ b/admin/views/componentbuilder/tmpl/default_open_issues_the_open_issues_on_github.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage default_open_issues_the_open_issues_on_github.php diff --git a/admin/views/componentbuilder/tmpl/default_readme_information.php b/admin/views/componentbuilder/tmpl/default_readme_information.php index e192bff73..ff5116e40 100644 --- a/admin/views/componentbuilder/tmpl/default_readme_information.php +++ b/admin/views/componentbuilder/tmpl/default_readme_information.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage default_readme_information.php diff --git a/admin/views/componentbuilder/tmpl/default_vast_development_method_notice_board.php b/admin/views/componentbuilder/tmpl/default_vast_development_method_notice_board.php index 1bd34d2e0..4595feb1a 100644 --- a/admin/views/componentbuilder/tmpl/default_vast_development_method_notice_board.php +++ b/admin/views/componentbuilder/tmpl/default_vast_development_method_notice_board.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage default_vast_development_method_notice_board.php diff --git a/admin/views/componentbuilder/tmpl/default_vdm.php b/admin/views/componentbuilder/tmpl/default_vdm.php index 68f43c122..9f2ff265f 100644 --- a/admin/views/componentbuilder/tmpl/default_vdm.php +++ b/admin/views/componentbuilder/tmpl/default_vdm.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage default_vdm.php diff --git a/admin/views/componentbuilder/view.html.php b/admin/views/componentbuilder/view.html.php index 08a977d20..2a81b1ad3 100644 --- a/admin/views/componentbuilder/view.html.php +++ b/admin/views/componentbuilder/view.html.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage view.html.php diff --git a/admin/views/custom_admin_view/view.html.php b/admin/views/custom_admin_view/view.html.php index 6662e320d..ba5c2f401 100644 --- a/admin/views/custom_admin_view/view.html.php +++ b/admin/views/custom_admin_view/view.html.php @@ -71,7 +71,7 @@ class ComponentbuilderViewCustom_admin_view extends JViewLegacy } // Get Linked view data - $this->vyhlinked_components = $this->get('Vyhlinked_components'); + $this->vyilinked_components = $this->get('Vyilinked_components'); // Set the toolbar $this->addToolBar(); diff --git a/admin/views/custom_code/submitbutton.js b/admin/views/custom_code/submitbutton.js index 2a64e8a96..94b1ab5f5 100644 --- a/admin/views/custom_code/submitbutton.js +++ b/admin/views/custom_code/submitbutton.js @@ -9,8 +9,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 81 of this MVC - @build 1st March, 2017 + @version @update number 82 of this MVC + @build 3rd April, 2017 @created 11th October, 2016 @package Component Builder @subpackage submitbutton.js diff --git a/admin/views/custom_code/tmpl/edit.php b/admin/views/custom_code/tmpl/edit.php index 4f9c1b60a..1432dcf75 100644 --- a/admin/views/custom_code/tmpl/edit.php +++ b/admin/views/custom_code/tmpl/edit.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 81 of this MVC - @build 1st March, 2017 + @version @update number 82 of this MVC + @build 3rd April, 2017 @created 11th October, 2016 @package Component Builder @subpackage edit.php @@ -262,6 +262,7 @@ jQuery('#adminForm').on('change', '#jform_comment_type',function (e) jQuery('#phpjs-comment-info').show(); } }); + // nice little dot trick :) jQuery(document).ready( function($) { var x=0; @@ -273,5 +274,5 @@ jQuery(document).ready( function($) { } $(".loading-dots").text(dots); } , 500); -}); +}); diff --git a/admin/views/custom_code/view.html.php b/admin/views/custom_code/view.html.php index 990b0380a..295535513 100644 --- a/admin/views/custom_code/view.html.php +++ b/admin/views/custom_code/view.html.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 81 of this MVC - @build 1st March, 2017 + @version @update number 82 of this MVC + @build 3rd April, 2017 @created 11th October, 2016 @package Component Builder @subpackage view.html.php diff --git a/admin/views/custom_codes/tmpl/default.php b/admin/views/custom_codes/tmpl/default.php index c7774c40b..d41fe504a 100644 --- a/admin/views/custom_codes/tmpl/default.php +++ b/admin/views/custom_codes/tmpl/default.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 81 of this MVC - @build 1st March, 2017 + @version @update number 82 of this MVC + @build 3rd April, 2017 @created 11th October, 2016 @package Component Builder @subpackage default.php diff --git a/admin/views/custom_codes/tmpl/default_batch_body.php b/admin/views/custom_codes/tmpl/default_batch_body.php index b5503b91e..3350ce19b 100644 --- a/admin/views/custom_codes/tmpl/default_batch_body.php +++ b/admin/views/custom_codes/tmpl/default_batch_body.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 81 of this MVC - @build 1st March, 2017 + @version @update number 82 of this MVC + @build 3rd April, 2017 @created 11th October, 2016 @package Component Builder @subpackage default_batch_body.php diff --git a/admin/views/custom_codes/tmpl/default_batch_footer.php b/admin/views/custom_codes/tmpl/default_batch_footer.php index 8f8f0b1c6..3f6a68132 100644 --- a/admin/views/custom_codes/tmpl/default_batch_footer.php +++ b/admin/views/custom_codes/tmpl/default_batch_footer.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 81 of this MVC - @build 1st March, 2017 + @version @update number 82 of this MVC + @build 3rd April, 2017 @created 11th October, 2016 @package Component Builder @subpackage default_batch_footer.php diff --git a/admin/views/custom_codes/tmpl/default_body.php b/admin/views/custom_codes/tmpl/default_body.php index ebd8a5203..4812d89af 100644 --- a/admin/views/custom_codes/tmpl/default_body.php +++ b/admin/views/custom_codes/tmpl/default_body.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 81 of this MVC - @build 1st March, 2017 + @version @update number 82 of this MVC + @build 3rd April, 2017 @created 11th October, 2016 @package Component Builder @subpackage default_body.php diff --git a/admin/views/custom_codes/tmpl/default_foot.php b/admin/views/custom_codes/tmpl/default_foot.php index 12bea733e..2a0345024 100644 --- a/admin/views/custom_codes/tmpl/default_foot.php +++ b/admin/views/custom_codes/tmpl/default_foot.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 81 of this MVC - @build 1st March, 2017 + @version @update number 82 of this MVC + @build 3rd April, 2017 @created 11th October, 2016 @package Component Builder @subpackage default_foot.php diff --git a/admin/views/custom_codes/tmpl/default_head.php b/admin/views/custom_codes/tmpl/default_head.php index 227fcfbfb..0eaf27831 100644 --- a/admin/views/custom_codes/tmpl/default_head.php +++ b/admin/views/custom_codes/tmpl/default_head.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 81 of this MVC - @build 1st March, 2017 + @version @update number 82 of this MVC + @build 3rd April, 2017 @created 11th October, 2016 @package Component Builder @subpackage default_head.php diff --git a/admin/views/custom_codes/tmpl/default_toolbar.php b/admin/views/custom_codes/tmpl/default_toolbar.php index 9be2ca100..c01b438bc 100644 --- a/admin/views/custom_codes/tmpl/default_toolbar.php +++ b/admin/views/custom_codes/tmpl/default_toolbar.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 81 of this MVC - @build 1st March, 2017 + @version @update number 82 of this MVC + @build 3rd April, 2017 @created 11th October, 2016 @package Component Builder @subpackage default_toolbar.php diff --git a/admin/views/custom_codes/view.html.php b/admin/views/custom_codes/view.html.php index 2b6a3150c..572e2bbd6 100644 --- a/admin/views/custom_codes/view.html.php +++ b/admin/views/custom_codes/view.html.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 81 of this MVC - @build 1st March, 2017 + @version @update number 82 of this MVC + @build 3rd April, 2017 @created 11th October, 2016 @package Component Builder @subpackage view.html.php diff --git a/admin/views/field/view.html.php b/admin/views/field/view.html.php index 5e3c74c8b..ec71e4bf4 100644 --- a/admin/views/field/view.html.php +++ b/admin/views/field/view.html.php @@ -71,7 +71,7 @@ class ComponentbuilderViewField extends JViewLegacy } // Get Linked view data - $this->vzzlinked_admin_views = $this->get('Vzzlinked_admin_views'); + $this->waalinked_admin_views = $this->get('Waalinked_admin_views'); // Set the toolbar $this->addToolBar(); diff --git a/admin/views/fieldtype/view.html.php b/admin/views/fieldtype/view.html.php index cb700a863..114d939c9 100644 --- a/admin/views/fieldtype/view.html.php +++ b/admin/views/fieldtype/view.html.php @@ -71,7 +71,7 @@ class ComponentbuilderViewFieldtype extends JViewLegacy } // Get Linked view data - $this->waafields = $this->get('Waafields'); + $this->wabfields = $this->get('Wabfields'); // Set the toolbar $this->addToolBar(); diff --git a/admin/views/help_document/submitbutton.js b/admin/views/help_document/submitbutton.js index b8f8f0aac..43fc878f4 100644 --- a/admin/views/help_document/submitbutton.js +++ b/admin/views/help_document/submitbutton.js @@ -10,7 +10,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 6 of this MVC - @build 17th October, 2016 + @build 18th October, 2016 @created 4th March, 2016 @package Component Builder @subpackage submitbutton.js diff --git a/admin/views/help_document/tmpl/edit.php b/admin/views/help_document/tmpl/edit.php index 1e348ee3a..2420cfa5e 100644 --- a/admin/views/help_document/tmpl/edit.php +++ b/admin/views/help_document/tmpl/edit.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 6 of this MVC - @build 17th October, 2016 + @build 18th October, 2016 @created 4th March, 2016 @package Component Builder @subpackage edit.php diff --git a/admin/views/help_document/view.html.php b/admin/views/help_document/view.html.php index 950cf867f..914ed2364 100644 --- a/admin/views/help_document/view.html.php +++ b/admin/views/help_document/view.html.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 6 of this MVC - @build 17th October, 2016 + @build 18th October, 2016 @created 4th March, 2016 @package Component Builder @subpackage view.html.php diff --git a/admin/views/help_documents/tmpl/default.php b/admin/views/help_documents/tmpl/default.php index bd97385a4..c475a4f25 100644 --- a/admin/views/help_documents/tmpl/default.php +++ b/admin/views/help_documents/tmpl/default.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 6 of this MVC - @build 17th October, 2016 + @build 18th October, 2016 @created 4th March, 2016 @package Component Builder @subpackage default.php diff --git a/admin/views/help_documents/tmpl/default_batch_body.php b/admin/views/help_documents/tmpl/default_batch_body.php index 1b6e9f603..6ae140a23 100644 --- a/admin/views/help_documents/tmpl/default_batch_body.php +++ b/admin/views/help_documents/tmpl/default_batch_body.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 6 of this MVC - @build 17th October, 2016 + @build 18th October, 2016 @created 4th March, 2016 @package Component Builder @subpackage default_batch_body.php diff --git a/admin/views/help_documents/tmpl/default_batch_footer.php b/admin/views/help_documents/tmpl/default_batch_footer.php index 2d658233d..b17000070 100644 --- a/admin/views/help_documents/tmpl/default_batch_footer.php +++ b/admin/views/help_documents/tmpl/default_batch_footer.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 6 of this MVC - @build 17th October, 2016 + @build 18th October, 2016 @created 4th March, 2016 @package Component Builder @subpackage default_batch_footer.php diff --git a/admin/views/help_documents/tmpl/default_body.php b/admin/views/help_documents/tmpl/default_body.php index dd59f6adb..17d8d6021 100644 --- a/admin/views/help_documents/tmpl/default_body.php +++ b/admin/views/help_documents/tmpl/default_body.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 6 of this MVC - @build 17th October, 2016 + @build 18th October, 2016 @created 4th March, 2016 @package Component Builder @subpackage default_body.php diff --git a/admin/views/help_documents/tmpl/default_foot.php b/admin/views/help_documents/tmpl/default_foot.php index a034d0cc4..6930ef269 100644 --- a/admin/views/help_documents/tmpl/default_foot.php +++ b/admin/views/help_documents/tmpl/default_foot.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 6 of this MVC - @build 17th October, 2016 + @build 18th October, 2016 @created 4th March, 2016 @package Component Builder @subpackage default_foot.php diff --git a/admin/views/help_documents/tmpl/default_head.php b/admin/views/help_documents/tmpl/default_head.php index 5b22f3a96..307cb65f0 100644 --- a/admin/views/help_documents/tmpl/default_head.php +++ b/admin/views/help_documents/tmpl/default_head.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 6 of this MVC - @build 17th October, 2016 + @build 18th October, 2016 @created 4th March, 2016 @package Component Builder @subpackage default_head.php diff --git a/admin/views/help_documents/tmpl/default_toolbar.php b/admin/views/help_documents/tmpl/default_toolbar.php index 9223cd26b..8aa3d9a9a 100644 --- a/admin/views/help_documents/tmpl/default_toolbar.php +++ b/admin/views/help_documents/tmpl/default_toolbar.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 6 of this MVC - @build 17th October, 2016 + @build 18th October, 2016 @created 4th March, 2016 @package Component Builder @subpackage default_toolbar.php diff --git a/admin/views/help_documents/view.html.php b/admin/views/help_documents/view.html.php index c719328be..786c28036 100644 --- a/admin/views/help_documents/view.html.php +++ b/admin/views/help_documents/view.html.php @@ -11,7 +11,7 @@ /-------------------------------------------------------------------------------------------------------------------------------/ @version @update number 6 of this MVC - @build 17th October, 2016 + @build 18th October, 2016 @created 4th March, 2016 @package Component Builder @subpackage view.html.php diff --git a/admin/views/import/tmpl/default.php b/admin/views/import/tmpl/default.php index 796e153da..c1abc58d1 100644 --- a/admin/views/import/tmpl/default.php +++ b/admin/views/import/tmpl/default.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage default.php diff --git a/admin/views/import/view.html.php b/admin/views/import/view.html.php index be6012f12..a57e22402 100644 --- a/admin/views/import/view.html.php +++ b/admin/views/import/view.html.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage view.html.php diff --git a/admin/views/import_joomla_components/tmpl/default.php b/admin/views/import_joomla_components/tmpl/default.php index 908ea3c6b..2809ea5fe 100644 --- a/admin/views/import_joomla_components/tmpl/default.php +++ b/admin/views/import_joomla_components/tmpl/default.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage default.php diff --git a/admin/views/import_joomla_components/view.html.php b/admin/views/import_joomla_components/view.html.php index 1ad378fe1..14b948d37 100644 --- a/admin/views/import_joomla_components/view.html.php +++ b/admin/views/import_joomla_components/view.html.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage view.html.php diff --git a/admin/views/joomla_component/submitbutton.js b/admin/views/joomla_component/submitbutton.js index 6d9c70bae..c864165b8 100644 --- a/admin/views/joomla_component/submitbutton.js +++ b/admin/views/joomla_component/submitbutton.js @@ -9,8 +9,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 311 of this MVC - @build 1st April, 2017 + @version @update number 318 of this MVC + @build 5th April, 2017 @created 6th May, 2015 @package Component Builder @subpackage submitbutton.js diff --git a/admin/views/joomla_component/tmpl/edit.php b/admin/views/joomla_component/tmpl/edit.php index 373f860ec..ad8a0b600 100644 --- a/admin/views/joomla_component/tmpl/edit.php +++ b/admin/views/joomla_component/tmpl/edit.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 311 of this MVC - @build 1st April, 2017 + @version @update number 318 of this MVC + @build 5th April, 2017 @created 6th May, 2015 @package Component Builder @subpackage edit.php @@ -181,6 +181,18 @@ $componentParams = JComponentHelper::getParams('com_componentbuilder'); + canDo->get('language_translation.access')) : ?> + +
+
+
+
+ +
+
+ + + canDo->get('core.delete') || $this->canDo->get('core.edit.created_by') || $this->canDo->get('core.edit.state') || $this->canDo->get('core.edit.created')) : ?>
diff --git a/admin/views/joomla_component/view.html.php b/admin/views/joomla_component/view.html.php index e3506719d..60beea8a0 100644 --- a/admin/views/joomla_component/view.html.php +++ b/admin/views/joomla_component/view.html.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 311 of this MVC - @build 1st April, 2017 + @version @update number 318 of this MVC + @build 5th April, 2017 @created 6th May, 2015 @package Component Builder @subpackage view.html.php @@ -77,7 +77,10 @@ class ComponentbuilderViewJoomla_component extends JViewLegacy $this->vwncustom_admin_views = $this->get('Vwncustom_admin_views'); // Get Linked view data - $this->vwosite_views = $this->get('Vwosite_views'); + $this->vwosite_views = $this->get('Vwosite_views'); + + // Get Linked view data + $this->vwptranslation = $this->get('Vwptranslation'); // Set the toolbar $this->addToolBar(); diff --git a/admin/views/joomla_components/tmpl/default.php b/admin/views/joomla_components/tmpl/default.php index 17bc64b74..65bf238f2 100644 --- a/admin/views/joomla_components/tmpl/default.php +++ b/admin/views/joomla_components/tmpl/default.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 311 of this MVC - @build 1st April, 2017 + @version @update number 318 of this MVC + @build 5th April, 2017 @created 6th May, 2015 @package Component Builder @subpackage default.php diff --git a/admin/views/joomla_components/tmpl/default_batch_body.php b/admin/views/joomla_components/tmpl/default_batch_body.php index eeaa61320..4f2c59b78 100644 --- a/admin/views/joomla_components/tmpl/default_batch_body.php +++ b/admin/views/joomla_components/tmpl/default_batch_body.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 311 of this MVC - @build 1st April, 2017 + @version @update number 318 of this MVC + @build 5th April, 2017 @created 6th May, 2015 @package Component Builder @subpackage default_batch_body.php diff --git a/admin/views/joomla_components/tmpl/default_batch_footer.php b/admin/views/joomla_components/tmpl/default_batch_footer.php index 5b8a1530b..2efba2306 100644 --- a/admin/views/joomla_components/tmpl/default_batch_footer.php +++ b/admin/views/joomla_components/tmpl/default_batch_footer.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 311 of this MVC - @build 1st April, 2017 + @version @update number 318 of this MVC + @build 5th April, 2017 @created 6th May, 2015 @package Component Builder @subpackage default_batch_footer.php diff --git a/admin/views/joomla_components/tmpl/default_body.php b/admin/views/joomla_components/tmpl/default_body.php index 5ff9abc4b..c025e96d2 100644 --- a/admin/views/joomla_components/tmpl/default_body.php +++ b/admin/views/joomla_components/tmpl/default_body.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 311 of this MVC - @build 1st April, 2017 + @version @update number 318 of this MVC + @build 5th April, 2017 @created 6th May, 2015 @package Component Builder @subpackage default_body.php diff --git a/admin/views/joomla_components/tmpl/default_foot.php b/admin/views/joomla_components/tmpl/default_foot.php index cc3a64c8c..4c86cf5a6 100644 --- a/admin/views/joomla_components/tmpl/default_foot.php +++ b/admin/views/joomla_components/tmpl/default_foot.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 311 of this MVC - @build 1st April, 2017 + @version @update number 318 of this MVC + @build 5th April, 2017 @created 6th May, 2015 @package Component Builder @subpackage default_foot.php diff --git a/admin/views/joomla_components/tmpl/default_head.php b/admin/views/joomla_components/tmpl/default_head.php index 09eea54d4..bd946f8af 100644 --- a/admin/views/joomla_components/tmpl/default_head.php +++ b/admin/views/joomla_components/tmpl/default_head.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 311 of this MVC - @build 1st April, 2017 + @version @update number 318 of this MVC + @build 5th April, 2017 @created 6th May, 2015 @package Component Builder @subpackage default_head.php diff --git a/admin/views/joomla_components/tmpl/default_toolbar.php b/admin/views/joomla_components/tmpl/default_toolbar.php index 30d9ae631..d81cb7f83 100644 --- a/admin/views/joomla_components/tmpl/default_toolbar.php +++ b/admin/views/joomla_components/tmpl/default_toolbar.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 311 of this MVC - @build 1st April, 2017 + @version @update number 318 of this MVC + @build 5th April, 2017 @created 6th May, 2015 @package Component Builder @subpackage default_toolbar.php diff --git a/admin/views/joomla_components/view.html.php b/admin/views/joomla_components/view.html.php index 9a4a912be..de0ef0800 100644 --- a/admin/views/joomla_components/view.html.php +++ b/admin/views/joomla_components/view.html.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version @update number 311 of this MVC - @build 1st April, 2017 + @version @update number 318 of this MVC + @build 5th April, 2017 @created 6th May, 2015 @package Component Builder @subpackage view.html.php diff --git a/admin/views/language/submitbutton.js b/admin/views/language/submitbutton.js new file mode 100644 index 000000000..55d835eb0 --- /dev/null +++ b/admin/views/language/submitbutton.js @@ -0,0 +1,49 @@ +/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/ + __ __ _ _____ _ _ __ __ _ _ _ + \ \ / / | | | __ \ | | | | | \/ | | | | | | | + \ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| | + \ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` | + \ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| | + \/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_| + | | + |_| +/-------------------------------------------------------------------------------------------------------------------------------/ + + @version @update number 3 of this MVC + @build 3rd April, 2017 + @created 3rd April, 2017 + @package Component Builder + @subpackage submitbutton.js + @author Llewellyn van der Merwe + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +Joomla.submitbutton = function(task) +{ + if (task == ''){ + return false; + } else { + var isValid=true; + var action = task.split('.'); + if (action[1] != 'cancel' && action[1] != 'close'){ + var forms = $$('form.form-validate'); + for (var i=0;i + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); +JHtml::_('behavior.keepalive'); +$componentParams = JComponentHelper::getParams('com_componentbuilder'); +?> + + diff --git a/admin/views/language/tmpl/index.html b/admin/views/language/tmpl/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/admin/views/language/tmpl/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/views/language/view.html.php b/admin/views/language/view.html.php new file mode 100644 index 000000000..374949377 --- /dev/null +++ b/admin/views/language/view.html.php @@ -0,0 +1,200 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// import Joomla view library +jimport('joomla.application.component.view'); + +/** + * Language View class + */ +class ComponentbuilderViewLanguage extends JViewLegacy +{ + /** + * display method of View + * @return void + */ + public function display($tpl = null) + { + // Check for errors. + if (count($errors = $this->get('Errors'))) + { + JError::raiseError(500, implode('
', $errors)); + return false; + } + + // Assign the variables + $this->form = $this->get('Form'); + $this->item = $this->get('Item'); + $this->script = $this->get('Script'); + $this->state = $this->get('State'); + // get action permissions + $this->canDo = ComponentbuilderHelper::getActions('language',$this->item); + // get input + $jinput = JFactory::getApplication()->input; + $this->ref = $jinput->get('ref', 0, 'word'); + $this->refid = $jinput->get('refid', 0, 'int'); + $this->referral = ''; + if ($this->refid) + { + // return to the item that refered to this item + $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid; + } + elseif($this->ref) + { + // return to the list view that refered to this item + $this->referral = '&ref='.(string)$this->ref; + } + + // Set the toolbar + $this->addToolBar(); + + // Display the template + parent::display($tpl); + + // Set the document + $this->setDocument(); + } + + + /** + * Setting the toolbar + */ + protected function addToolBar() + { + JFactory::getApplication()->input->set('hidemainmenu', true); + $user = JFactory::getUser(); + $userId = $user->id; + $isNew = $this->item->id == 0; + + JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_LANGUAGE_NEW' : 'COM_COMPONENTBUILDER_LANGUAGE_EDIT'), 'pencil-2 article-add'); + // Built the actions for new and existing records. + if ($this->refid || $this->ref) + { + if ($this->canDo->get('language.create') && $isNew) + { + // We can create the record. + JToolBarHelper::save('language.save', 'JTOOLBAR_SAVE'); + } + elseif ($this->canDo->get('language.edit')) + { + // We can save the record. + JToolBarHelper::save('language.save', 'JTOOLBAR_SAVE'); + } + if ($isNew) + { + // Do not creat but cancel. + JToolBarHelper::cancel('language.cancel', 'JTOOLBAR_CANCEL'); + } + else + { + // We can close it. + JToolBarHelper::cancel('language.cancel', 'JTOOLBAR_CLOSE'); + } + } + else + { + if ($isNew) + { + // For new records, check the create permission. + if ($this->canDo->get('language.create')) + { + JToolBarHelper::apply('language.apply', 'JTOOLBAR_APPLY'); + JToolBarHelper::save('language.save', 'JTOOLBAR_SAVE'); + JToolBarHelper::custom('language.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + }; + JToolBarHelper::cancel('language.cancel', 'JTOOLBAR_CANCEL'); + } + else + { + if ($this->canDo->get('language.edit')) + { + // We can save the new record + JToolBarHelper::apply('language.apply', 'JTOOLBAR_APPLY'); + JToolBarHelper::save('language.save', 'JTOOLBAR_SAVE'); + // We can save this record, but check the create permission to see + // if we can return to make a new one. + if ($this->canDo->get('language.create')) + { + JToolBarHelper::custom('language.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + } + } + $canVersion = ($this->canDo->get('core.version') && $this->canDo->get('language.version')); + if ($this->state->params->get('save_history', 1) && $this->canDo->get('language.edit') && $canVersion) + { + JToolbarHelper::versions('com_componentbuilder.language', $this->item->id); + } + if ($this->canDo->get('language.create')) + { + JToolBarHelper::custom('language.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); + } + JToolBarHelper::cancel('language.cancel', 'JTOOLBAR_CLOSE'); + } + } + JToolbarHelper::divider(); + // set help url for this view if found + $help_url = ComponentbuilderHelper::getHelpUrl('language'); + if (ComponentbuilderHelper::checkString($help_url)) + { + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + } + } + + /** + * Escapes a value for output in a view script. + * + * @param mixed $var The output to escape. + * + * @return mixed The escaped value. + */ + public function escape($var) + { + if(strlen($var) > 30) + { + // use the helper htmlEscape method instead and shorten the string + return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30); + } + // use the helper htmlEscape method instead. + return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + } + + /** + * Method to set up the document properties + * + * @return void + */ + protected function setDocument() + { + $isNew = ($this->item->id < 1); + $document = JFactory::getDocument(); + $document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_LANGUAGE_NEW' : 'COM_COMPONENTBUILDER_LANGUAGE_EDIT')); + $document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/language.css"); + $document->addScript(JURI::root() . $this->script); + $document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/language/submitbutton.js"); + JText::script('view not acceptable. Error'); + } +} diff --git a/admin/views/language_translation/submitbutton.js b/admin/views/language_translation/submitbutton.js new file mode 100644 index 000000000..420fa1a6a --- /dev/null +++ b/admin/views/language_translation/submitbutton.js @@ -0,0 +1,49 @@ +/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/ + __ __ _ _____ _ _ __ __ _ _ _ + \ \ / / | | | __ \ | | | | | \/ | | | | | | | + \ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| | + \ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` | + \ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| | + \/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_| + | | + |_| +/-------------------------------------------------------------------------------------------------------------------------------/ + + @version @update number 37 of this MVC + @build 5th April, 2017 + @created 3rd April, 2017 + @package Component Builder + @subpackage submitbutton.js + @author Llewellyn van der Merwe + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +Joomla.submitbutton = function(task) +{ + if (task == ''){ + return false; + } else { + var isValid=true; + var action = task.split('.'); + if (action[1] != 'cancel' && action[1] != 'close'){ + var forms = $$('form.form-validate'); + for (var i=0;i + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html'); +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.formvalidation'); +JHtml::_('formbehavior.chosen', 'select'); +JHtml::_('behavior.keepalive'); +$componentParams = JComponentHelper::getParams('com_componentbuilder'); +?> + + + + diff --git a/admin/views/language_translation/tmpl/index.html b/admin/views/language_translation/tmpl/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/admin/views/language_translation/tmpl/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/views/language_translation/view.html.php b/admin/views/language_translation/view.html.php new file mode 100644 index 000000000..b81265987 --- /dev/null +++ b/admin/views/language_translation/view.html.php @@ -0,0 +1,211 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// import Joomla view library +jimport('joomla.application.component.view'); + +/** + * Language_translation View class + */ +class ComponentbuilderViewLanguage_translation extends JViewLegacy +{ + /** + * display method of View + * @return void + */ + public function display($tpl = null) + { + // Check for errors. + if (count($errors = $this->get('Errors'))) + { + JError::raiseError(500, implode('
', $errors)); + return false; + } + + // Assign the variables + $this->form = $this->get('Form'); + $this->item = $this->get('Item'); + $this->script = $this->get('Script'); + $this->state = $this->get('State'); + // get action permissions + $this->canDo = ComponentbuilderHelper::getActions('language_translation',$this->item); + // get input + $jinput = JFactory::getApplication()->input; + $this->ref = $jinput->get('ref', 0, 'word'); + $this->refid = $jinput->get('refid', 0, 'int'); + $this->referral = ''; + if ($this->refid) + { + // return to the item that refered to this item + $this->referral = '&ref='.(string)$this->ref.'&refid='.(int)$this->refid; + } + elseif($this->ref) + { + // return to the list view that refered to this item + $this->referral = '&ref='.(string)$this->ref; + } + + // Set the toolbar + $this->addToolBar(); + + // Display the template + parent::display($tpl); + + // Set the document + $this->setDocument(); + } + + + /** + * Setting the toolbar + */ + protected function addToolBar() + { + JFactory::getApplication()->input->set('hidemainmenu', true); + $user = JFactory::getUser(); + $userId = $user->id; + $isNew = $this->item->id == 0; + + JToolbarHelper::title( JText::_($isNew ? 'COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_NEW' : 'COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_EDIT'), 'pencil-2 article-add'); + // Built the actions for new and existing records. + if ($this->refid || $this->ref) + { + if ($this->canDo->get('language_translation.create') && $isNew) + { + // We can create the record. + JToolBarHelper::save('language_translation.save', 'JTOOLBAR_SAVE'); + } + elseif ($this->canDo->get('language_translation.edit')) + { + // We can save the record. + JToolBarHelper::save('language_translation.save', 'JTOOLBAR_SAVE'); + } + if ($isNew) + { + // Do not creat but cancel. + JToolBarHelper::cancel('language_translation.cancel', 'JTOOLBAR_CANCEL'); + } + else + { + // We can close it. + JToolBarHelper::cancel('language_translation.cancel', 'JTOOLBAR_CLOSE'); + } + } + else + { + if ($isNew) + { + // For new records, check the create permission. + if ($this->canDo->get('language_translation.create')) + { + JToolBarHelper::apply('language_translation.apply', 'JTOOLBAR_APPLY'); + JToolBarHelper::save('language_translation.save', 'JTOOLBAR_SAVE'); + JToolBarHelper::custom('language_translation.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + }; + JToolBarHelper::cancel('language_translation.cancel', 'JTOOLBAR_CANCEL'); + } + else + { + if ($this->canDo->get('language_translation.edit')) + { + // We can save the new record + JToolBarHelper::apply('language_translation.apply', 'JTOOLBAR_APPLY'); + JToolBarHelper::save('language_translation.save', 'JTOOLBAR_SAVE'); + // We can save this record, but check the create permission to see + // if we can return to make a new one. + if ($this->canDo->get('language_translation.create')) + { + JToolBarHelper::custom('language_translation.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); + } + } + $canVersion = ($this->canDo->get('core.version') && $this->canDo->get('language_translation.version')); + if ($this->state->params->get('save_history', 1) && $this->canDo->get('language_translation.edit') && $canVersion) + { + JToolbarHelper::versions('com_componentbuilder.language_translation', $this->item->id); + } + if ($this->canDo->get('language_translation.create')) + { + JToolBarHelper::custom('language_translation.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); + } + JToolBarHelper::cancel('language_translation.cancel', 'JTOOLBAR_CLOSE'); + } + } + JToolbarHelper::divider(); + // set help url for this view if found + $help_url = ComponentbuilderHelper::getHelpUrl('language_translation'); + if (ComponentbuilderHelper::checkString($help_url)) + { + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + } + } + + /** + * Escapes a value for output in a view script. + * + * @param mixed $var The output to escape. + * + * @return mixed The escaped value. + */ + public function escape($var) + { + if(strlen($var) > 30) + { + // use the helper htmlEscape method instead and shorten the string + return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true, 30); + } + // use the helper htmlEscape method instead. + return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + } + + /** + * Method to set up the document properties + * + * @return void + */ + protected function setDocument() + { + $isNew = ($this->item->id < 1); + $document = JFactory::getDocument(); + $document->setTitle(JText::_($isNew ? 'COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_NEW' : 'COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_EDIT')); + $document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/language_translation.css"); + // Add Ajax Token + $document->addScriptDeclaration("var token = '".JSession::getFormToken()."';"); + $document->addScript(JURI::root() . $this->script); + $document->addScript(JURI::root() . "administrator/components/com_componentbuilder/views/language_translation/submitbutton.js"); + // add JavaScripts + $document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit/js/uikit.min.js' ); + $document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit/js/components/lightbox.min.js', 'text/javascript', true); + $document->addScript( JURI::root(true) .'/media/com_componentbuilder/uikit/js/components/notify.min.js', 'text/javascript', true); + // add the style sheets + $document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit/css/uikit.gradient.min.css' ); + $document->addStyleSheet( JURI::root(true) .'/media/com_componentbuilder/uikit/css/components/notify.gradient.min.css' ); + // add var key + $document->addScriptDeclaration("var vastDevMod = '".$this->get('VDM')."';"); + JText::script('view not acceptable. Error'); + } +} diff --git a/admin/views/language_translations/index.html b/admin/views/language_translations/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/admin/views/language_translations/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/views/language_translations/tmpl/default.php b/admin/views/language_translations/tmpl/default.php new file mode 100644 index 000000000..11654e1ee --- /dev/null +++ b/admin/views/language_translations/tmpl/default.php @@ -0,0 +1,99 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// load tooltip behavior +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); +JHtml::_('formbehavior.chosen', 'select'); + +if ($this->saveOrder) +{ + $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=language_translations.saveOrderAjax&tmpl=component'; + JHtml::_('sortablelist.sortable', 'language_translationList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); +} + +?> + +
+sidebar)): ?> +
+ sidebar; ?> +
+
+ +
+ +items)): ?> + loadTemplate('toolbar');?> +
+ +
+ + loadTemplate('toolbar');?> + + loadTemplate('head');?> + loadTemplate('foot');?> + loadTemplate('body');?> +
+ + canCreate && $this->canEdit) : ?> + JText::_('COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS_BATCH_OPTIONS'), + 'footer' => $this->loadTemplate('batch_footer') + ), + $this->loadTemplate('batch_body') + ); ?> + + + + +
+ + + + \ No newline at end of file diff --git a/admin/views/language_translations/tmpl/default_batch_body.php b/admin/views/language_translations/tmpl/default_batch_body.php new file mode 100644 index 000000000..0ac8e9de9 --- /dev/null +++ b/admin/views/language_translations/tmpl/default_batch_body.php @@ -0,0 +1,32 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +?> + +

+batchDisplay; ?> \ No newline at end of file diff --git a/admin/views/language_translations/tmpl/default_batch_footer.php b/admin/views/language_translations/tmpl/default_batch_footer.php new file mode 100644 index 000000000..66270d853 --- /dev/null +++ b/admin/views/language_translations/tmpl/default_batch_footer.php @@ -0,0 +1,37 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +?> + + + + \ No newline at end of file diff --git a/admin/views/language_translations/tmpl/default_body.php b/admin/views/language_translations/tmpl/default_body.php new file mode 100644 index 000000000..c5524c8ce --- /dev/null +++ b/admin/views/language_translations/tmpl/default_body.php @@ -0,0 +1,108 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +$edit = "index.php?option=com_componentbuilder&view=language_translations&task=language_translation.edit"; + +?> +items as $i => $item): ?> + user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0; + $userChkOut = JFactory::getUser($item->checked_out); + $canDo = ComponentbuilderHelper::getActions('language_translation',$item,'language_translations'); + ?> + + + get('language_translation.edit.state')): ?> + saveOrder) + { + $iconClass = ' inactive'; + } + else + { + $iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); + } + ?> + + + + saveOrder) : ?> + + + + ⋮ + + + + get('language_translation.edit')): ?> + checked_out) : ?> + + id); ?> + + □ + + + id); ?> + + + □ + + + + get('language_translation.edit')): ?> +
+ entranslation; ?> + checked_out): ?> + name, $item->checked_out_time, 'language_translations.', $canCheckin); ?> + +
+ +
entranslation; ?>
+ + + + get('language_translation.edit.state')) : ?> + checked_out) : ?> + + published, $i, 'language_translations.', true, 'cb'); ?> + + published, $i, 'language_translations.', false, 'cb'); ?> + + + published, $i, 'language_translations.', true, 'cb'); ?> + + + published, $i, 'language_translations.', false, 'cb'); ?> + + + + id; ?> + + + \ No newline at end of file diff --git a/admin/views/language_translations/tmpl/default_foot.php b/admin/views/language_translations/tmpl/default_foot.php new file mode 100644 index 000000000..3dab182cd --- /dev/null +++ b/admin/views/language_translations/tmpl/default_foot.php @@ -0,0 +1,32 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +?> + + pagination->getListFooter(); ?> + \ No newline at end of file diff --git a/admin/views/language_translations/tmpl/default_head.php b/admin/views/language_translations/tmpl/default_head.php new file mode 100644 index 000000000..a93413dc1 --- /dev/null +++ b/admin/views/language_translations/tmpl/default_head.php @@ -0,0 +1,61 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +?> + + canEdit&& $this->canState): ?> + + ', 'ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> + + + + + + + ▾ + + + ■ + + + + listDirn, $this->listOrder); ?> + + canState): ?> + + listDirn, $this->listOrder); ?> + + + + + + + + listDirn, $this->listOrder); ?> + + \ No newline at end of file diff --git a/admin/views/language_translations/tmpl/default_toolbar.php b/admin/views/language_translations/tmpl/default_toolbar.php new file mode 100644 index 000000000..eadd766f8 --- /dev/null +++ b/admin/views/language_translations/tmpl/default_toolbar.php @@ -0,0 +1,59 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +?> +
+ +
+ + +
+
+ + pagination->getLimitBox(); ?> +
+
+ + +
+
+ + +
+
+
\ No newline at end of file diff --git a/admin/views/language_translations/tmpl/index.html b/admin/views/language_translations/tmpl/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/admin/views/language_translations/tmpl/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/views/language_translations/view.html.php b/admin/views/language_translations/view.html.php new file mode 100644 index 000000000..4db81f07a --- /dev/null +++ b/admin/views/language_translations/view.html.php @@ -0,0 +1,250 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// import Joomla view library +jimport('joomla.application.component.view'); + +/** + * Componentbuilder View class for the Language_translations + */ +class ComponentbuilderViewLanguage_translations extends JViewLegacy +{ + /** + * Language_translations view display method + * @return void + */ + function display($tpl = null) + { + if ($this->getLayout() !== 'modal') + { + // Include helper submenu + ComponentbuilderHelper::addSubmenu('language_translations'); + } + + // Check for errors. + if (count($errors = $this->get('Errors'))) + { + JError::raiseError(500, implode('
', $errors)); + return false; + } + + // Assign data to the view + $this->items = $this->get('Items'); + $this->pagination = $this->get('Pagination'); + $this->state = $this->get('State'); + $this->user = JFactory::getUser(); + $this->listOrder = $this->escape($this->state->get('list.ordering')); + $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->saveOrder = $this->listOrder == 'ordering'; + // get global action permissions + $this->canDo = ComponentbuilderHelper::getActions('language_translation'); + $this->canEdit = $this->canDo->get('language_translation.edit'); + $this->canState = $this->canDo->get('language_translation.edit.state'); + $this->canCreate = $this->canDo->get('language_translation.create'); + $this->canDelete = $this->canDo->get('language_translation.delete'); + $this->canBatch = $this->canDo->get('core.batch'); + + // We don't need toolbar in the modal window. + if ($this->getLayout() !== 'modal') + { + $this->addToolbar(); + $this->sidebar = JHtmlSidebar::render(); + // load the batch html + if ($this->canCreate && $this->canEdit && $this->canState) + { + $this->batchDisplay = JHtmlBatch_::render(); + } + } + + // Display the template + parent::display($tpl); + + // Set the document + $this->setDocument(); + } + + /** + * Setting the toolbar + */ + protected function addToolBar() + { + JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS'), 'comments-2'); + JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=language_translations'); + JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + + if ($this->canCreate) + { + JToolBarHelper::addNew('language_translation.add'); + } + + // Only load if there are items + if (ComponentbuilderHelper::checkArray($this->items)) + { + if ($this->canEdit) + { + JToolBarHelper::editList('language_translation.edit'); + } + + if ($this->canState) + { + JToolBarHelper::publishList('language_translations.publish'); + JToolBarHelper::unpublishList('language_translations.unpublish'); + JToolBarHelper::archiveList('language_translations.archive'); + + if ($this->canDo->get('core.admin')) + { + JToolBarHelper::checkin('language_translations.checkin'); + } + } + + // Add a batch button + if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) + { + // Get the toolbar object instance + $bar = JToolBar::getInstance('toolbar'); + // set the batch button name + $title = JText::_('JTOOLBAR_BATCH'); + // Instantiate a new JLayoutFile instance and render the batch button + $layout = new JLayoutFile('joomla.toolbar.batch'); + // add the button to the page + $dhtml = $layout->render(array('title' => $title)); + $bar->appendButton('Custom', $dhtml, 'batch'); + } + + if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) + { + JToolbarHelper::deleteList('', 'language_translations.delete', 'JTOOLBAR_EMPTY_TRASH'); + } + elseif ($this->canState && $this->canDelete) + { + JToolbarHelper::trash('language_translations.trash'); + } + + if ($this->canDo->get('core.export') && $this->canDo->get('language_translation.export')) + { + JToolBarHelper::custom('language_translations.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); + } + } + + if ($this->canDo->get('core.import') && $this->canDo->get('language_translation.import')) + { + JToolBarHelper::custom('language_translations.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); + } + + // set help url for this view if found + $help_url = ComponentbuilderHelper::getHelpUrl('language_translations'); + if (ComponentbuilderHelper::checkString($help_url)) + { + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + } + + // add the options comp button + if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) + { + JToolBarHelper::preferences('com_componentbuilder'); + } + + if ($this->canState) + { + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_PUBLISHED'), + 'filter_published', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) + ); + // only load if batch allowed + if ($this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); + } + } + + /** + * Method to set up the document properties + * + * @return void + */ + protected function setDocument() + { + $document = JFactory::getDocument(); + $document->setTitle(JText::_('COM_COMPONENTBUILDER_LANGUAGE_TRANSLATIONS')); + $document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/language_translations.css"); + } + + /** + * Escapes a value for output in a view script. + * + * @param mixed $var The output to escape. + * + * @return mixed The escaped value. + */ + public function escape($var) + { + if(strlen($var) > 50) + { + // use the helper htmlEscape method instead and shorten the string + return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); + } + // use the helper htmlEscape method instead. + return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + } + + /** + * Returns an array of fields the table can be sorted by + * + * @return array Array containing the field name to sort by as the key and display text as value + */ + protected function getSortFields() + { + return array( + 'a.sorting' => JText::_('JGRID_HEADING_ORDERING'), + 'a.published' => JText::_('JSTATUS'), + 'a.entranslation' => JText::_('COM_COMPONENTBUILDER_LANGUAGE_TRANSLATION_ENTRANSLATION_LABEL'), + 'a.id' => JText::_('JGRID_HEADING_ID') + ); + } +} diff --git a/admin/views/languages/index.html b/admin/views/languages/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/admin/views/languages/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/views/languages/tmpl/default.php b/admin/views/languages/tmpl/default.php new file mode 100644 index 000000000..8dc44bb69 --- /dev/null +++ b/admin/views/languages/tmpl/default.php @@ -0,0 +1,99 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// load tooltip behavior +JHtml::_('behavior.tooltip'); +JHtml::_('behavior.multiselect'); +JHtml::_('dropdown.init'); +JHtml::_('formbehavior.chosen', 'select'); + +if ($this->saveOrder) +{ + $saveOrderingUrl = 'index.php?option=com_componentbuilder&task=languages.saveOrderAjax&tmpl=component'; + JHtml::_('sortablelist.sortable', 'languageList', 'adminForm', strtolower($this->listDirn), $saveOrderingUrl); +} + +?> + +
+sidebar)): ?> +
+ sidebar; ?> +
+
+ +
+ +items)): ?> + loadTemplate('toolbar');?> +
+ +
+ + loadTemplate('toolbar');?> + + loadTemplate('head');?> + loadTemplate('foot');?> + loadTemplate('body');?> +
+ + canCreate && $this->canEdit) : ?> + JText::_('COM_COMPONENTBUILDER_LANGUAGES_BATCH_OPTIONS'), + 'footer' => $this->loadTemplate('batch_footer') + ), + $this->loadTemplate('batch_body') + ); ?> + + + + +
+ + + + \ No newline at end of file diff --git a/admin/views/languages/tmpl/default_batch_body.php b/admin/views/languages/tmpl/default_batch_body.php new file mode 100644 index 000000000..faeb701b8 --- /dev/null +++ b/admin/views/languages/tmpl/default_batch_body.php @@ -0,0 +1,32 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +?> + +

+batchDisplay; ?> \ No newline at end of file diff --git a/admin/views/languages/tmpl/default_batch_footer.php b/admin/views/languages/tmpl/default_batch_footer.php new file mode 100644 index 000000000..a82216fd8 --- /dev/null +++ b/admin/views/languages/tmpl/default_batch_footer.php @@ -0,0 +1,37 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +?> + + + + \ No newline at end of file diff --git a/admin/views/languages/tmpl/default_body.php b/admin/views/languages/tmpl/default_body.php new file mode 100644 index 000000000..1d295d47c --- /dev/null +++ b/admin/views/languages/tmpl/default_body.php @@ -0,0 +1,111 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +$edit = "index.php?option=com_componentbuilder&view=languages&task=language.edit"; + +?> +items as $i => $item): ?> + user->authorise('core.manage', 'com_checkin') || $item->checked_out == $this->user->id || $item->checked_out == 0; + $userChkOut = JFactory::getUser($item->checked_out); + $canDo = ComponentbuilderHelper::getActions('language',$item,'languages'); + ?> + + + get('language.edit.state')): ?> + saveOrder) + { + $iconClass = ' inactive'; + } + else + { + $iconClass = ' inactive tip-top" hasTooltip" title="' . JHtml::tooltipText('JORDERINGDISABLED'); + } + ?> + + + + saveOrder) : ?> + + + + ⋮ + + + + get('language.edit')): ?> + checked_out) : ?> + + id); ?> + + □ + + + id); ?> + + + □ + + + + get('language.edit')): ?> +
+ escape($item->name); ?> + checked_out): ?> + name, $item->checked_out_time, 'languages.', $canCheckin); ?> + +
+ +
escape($item->name); ?>
+ + + + escape($item->langtag); ?> + + + get('language.edit.state')) : ?> + checked_out) : ?> + + published, $i, 'languages.', true, 'cb'); ?> + + published, $i, 'languages.', false, 'cb'); ?> + + + published, $i, 'languages.', true, 'cb'); ?> + + + published, $i, 'languages.', false, 'cb'); ?> + + + + id; ?> + + + \ No newline at end of file diff --git a/admin/views/languages/tmpl/default_foot.php b/admin/views/languages/tmpl/default_foot.php new file mode 100644 index 000000000..7bbd92029 --- /dev/null +++ b/admin/views/languages/tmpl/default_foot.php @@ -0,0 +1,32 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +?> + + pagination->getListFooter(); ?> + \ No newline at end of file diff --git a/admin/views/languages/tmpl/default_head.php b/admin/views/languages/tmpl/default_head.php new file mode 100644 index 000000000..caaf19c28 --- /dev/null +++ b/admin/views/languages/tmpl/default_head.php @@ -0,0 +1,64 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +?> + + canEdit&& $this->canState): ?> + + ', 'ordering', $this->listDirn, $this->listOrder, null, 'asc', 'JGRID_HEADING_ORDERING'); ?> + + + + + + + ▾ + + + ■ + + + + listDirn, $this->listOrder); ?> + + + listDirn, $this->listOrder); ?> + + canState): ?> + + listDirn, $this->listOrder); ?> + + + + + + + + listDirn, $this->listOrder); ?> + + \ No newline at end of file diff --git a/admin/views/languages/tmpl/default_toolbar.php b/admin/views/languages/tmpl/default_toolbar.php new file mode 100644 index 000000000..82f13ccf7 --- /dev/null +++ b/admin/views/languages/tmpl/default_toolbar.php @@ -0,0 +1,59 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +?> +
+ +
+ + +
+
+ + pagination->getLimitBox(); ?> +
+
+ + +
+
+ + +
+
+
\ No newline at end of file diff --git a/admin/views/languages/tmpl/index.html b/admin/views/languages/tmpl/index.html new file mode 100644 index 000000000..fa6d84e80 --- /dev/null +++ b/admin/views/languages/tmpl/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/admin/views/languages/view.html.php b/admin/views/languages/view.html.php new file mode 100644 index 000000000..31b1cb252 --- /dev/null +++ b/admin/views/languages/view.html.php @@ -0,0 +1,251 @@ + + @copyright Copyright (C) 2015. All Rights Reserved + @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + + Builds Complex Joomla Components + +/-----------------------------------------------------------------------------------------------------------------------------*/ + +// No direct access to this file +defined('_JEXEC') or die('Restricted access'); + +// import Joomla view library +jimport('joomla.application.component.view'); + +/** + * Componentbuilder View class for the Languages + */ +class ComponentbuilderViewLanguages extends JViewLegacy +{ + /** + * Languages view display method + * @return void + */ + function display($tpl = null) + { + if ($this->getLayout() !== 'modal') + { + // Include helper submenu + ComponentbuilderHelper::addSubmenu('languages'); + } + + // Check for errors. + if (count($errors = $this->get('Errors'))) + { + JError::raiseError(500, implode('
', $errors)); + return false; + } + + // Assign data to the view + $this->items = $this->get('Items'); + $this->pagination = $this->get('Pagination'); + $this->state = $this->get('State'); + $this->user = JFactory::getUser(); + $this->listOrder = $this->escape($this->state->get('list.ordering')); + $this->listDirn = $this->escape($this->state->get('list.direction')); + $this->saveOrder = $this->listOrder == 'ordering'; + // get global action permissions + $this->canDo = ComponentbuilderHelper::getActions('language'); + $this->canEdit = $this->canDo->get('language.edit'); + $this->canState = $this->canDo->get('language.edit.state'); + $this->canCreate = $this->canDo->get('language.create'); + $this->canDelete = $this->canDo->get('language.delete'); + $this->canBatch = $this->canDo->get('core.batch'); + + // We don't need toolbar in the modal window. + if ($this->getLayout() !== 'modal') + { + $this->addToolbar(); + $this->sidebar = JHtmlSidebar::render(); + // load the batch html + if ($this->canCreate && $this->canEdit && $this->canState) + { + $this->batchDisplay = JHtmlBatch_::render(); + } + } + + // Display the template + parent::display($tpl); + + // Set the document + $this->setDocument(); + } + + /** + * Setting the toolbar + */ + protected function addToolBar() + { + JToolBarHelper::title(JText::_('COM_COMPONENTBUILDER_LANGUAGES'), 'comment'); + JHtmlSidebar::setAction('index.php?option=com_componentbuilder&view=languages'); + JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields'); + + if ($this->canCreate) + { + JToolBarHelper::addNew('language.add'); + } + + // Only load if there are items + if (ComponentbuilderHelper::checkArray($this->items)) + { + if ($this->canEdit) + { + JToolBarHelper::editList('language.edit'); + } + + if ($this->canState) + { + JToolBarHelper::publishList('languages.publish'); + JToolBarHelper::unpublishList('languages.unpublish'); + JToolBarHelper::archiveList('languages.archive'); + + if ($this->canDo->get('core.admin')) + { + JToolBarHelper::checkin('languages.checkin'); + } + } + + // Add a batch button + if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState) + { + // Get the toolbar object instance + $bar = JToolBar::getInstance('toolbar'); + // set the batch button name + $title = JText::_('JTOOLBAR_BATCH'); + // Instantiate a new JLayoutFile instance and render the batch button + $layout = new JLayoutFile('joomla.toolbar.batch'); + // add the button to the page + $dhtml = $layout->render(array('title' => $title)); + $bar->appendButton('Custom', $dhtml, 'batch'); + } + + if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete)) + { + JToolbarHelper::deleteList('', 'languages.delete', 'JTOOLBAR_EMPTY_TRASH'); + } + elseif ($this->canState && $this->canDelete) + { + JToolbarHelper::trash('languages.trash'); + } + + if ($this->canDo->get('core.export') && $this->canDo->get('language.export')) + { + JToolBarHelper::custom('languages.exportData', 'download', '', 'COM_COMPONENTBUILDER_EXPORT_DATA', true); + } + } + + if ($this->canDo->get('core.import') && $this->canDo->get('language.import')) + { + JToolBarHelper::custom('languages.importData', 'upload', '', 'COM_COMPONENTBUILDER_IMPORT_DATA', false); + } + + // set help url for this view if found + $help_url = ComponentbuilderHelper::getHelpUrl('languages'); + if (ComponentbuilderHelper::checkString($help_url)) + { + JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $help_url); + } + + // add the options comp button + if ($this->canDo->get('core.admin') || $this->canDo->get('core.options')) + { + JToolBarHelper::preferences('com_componentbuilder'); + } + + if ($this->canState) + { + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_PUBLISHED'), + 'filter_published', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true) + ); + // only load if batch allowed + if ($this->canBatch) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_STATE'), + 'batch[published]', + JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('all' => false)), 'value', 'text', '', true) + ); + } + } + + JHtmlSidebar::addFilter( + JText::_('JOPTION_SELECT_ACCESS'), + 'filter_access', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access')) + ); + + if ($this->canBatch && $this->canCreate && $this->canEdit) + { + JHtmlBatch_::addListSelection( + JText::_('COM_COMPONENTBUILDER_KEEP_ORIGINAL_ACCESS'), + 'batch[access]', + JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text') + ); + } + } + + /** + * Method to set up the document properties + * + * @return void + */ + protected function setDocument() + { + $document = JFactory::getDocument(); + $document->setTitle(JText::_('COM_COMPONENTBUILDER_LANGUAGES')); + $document->addStyleSheet(JURI::root() . "administrator/components/com_componentbuilder/assets/css/languages.css"); + } + + /** + * Escapes a value for output in a view script. + * + * @param mixed $var The output to escape. + * + * @return mixed The escaped value. + */ + public function escape($var) + { + if(strlen($var) > 50) + { + // use the helper htmlEscape method instead and shorten the string + return ComponentbuilderHelper::htmlEscape($var, $this->_charset, true); + } + // use the helper htmlEscape method instead. + return ComponentbuilderHelper::htmlEscape($var, $this->_charset); + } + + /** + * Returns an array of fields the table can be sorted by + * + * @return array Array containing the field name to sort by as the key and display text as value + */ + protected function getSortFields() + { + return array( + 'a.sorting' => JText::_('JGRID_HEADING_ORDERING'), + 'a.published' => JText::_('JSTATUS'), + 'a.name' => JText::_('COM_COMPONENTBUILDER_LANGUAGE_NAME_LABEL'), + 'a.langtag' => JText::_('COM_COMPONENTBUILDER_LANGUAGE_LANGTAG_LABEL'), + 'a.id' => JText::_('JGRID_HEADING_ID') + ); + } +} diff --git a/admin/views/site_view/view.html.php b/admin/views/site_view/view.html.php index 81478b572..bf1557f9c 100644 --- a/admin/views/site_view/view.html.php +++ b/admin/views/site_view/view.html.php @@ -71,7 +71,7 @@ class ComponentbuilderViewSite_view extends JViewLegacy } // Get Linked view data - $this->vyslinked_components = $this->get('Vyslinked_components'); + $this->vytlinked_components = $this->get('Vytlinked_components'); // Set the toolbar $this->addToolBar(); diff --git a/componentbuilder.xml b/componentbuilder.xml index 8a40227c5..29d417bf5 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,15 +1,15 @@ COM_COMPONENTBUILDER - 1st April, 2017 + 6th April, 2017 Llewellyn van der Merwe joomla@vdm.io http://vdm.bz/component-builder Copyright (C) 2015. All Rights Reserved GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html - 2.4.1 + 2.4.2 Component Builder (v.2.4.1) +

Component Builder (v.2.4.2)

The Component Builder for [Joomla](http://www.joomla.org/) that is highly advanced, truly able to build extremely complex components in a fraction of the time. @@ -70,6 +70,7 @@ Whether you're a seasoned [Joomla](http://www.joomla.org/) developer, or have ju

COM_COMPONENTBUILDER_MENU_SNIPPETS COM_COMPONENTBUILDER_MENU_FIELDS COM_COMPONENTBUILDER_MENU_FIELDTYPES + COM_COMPONENTBUILDER_MENU_LANGUAGE_TRANSLATIONS COM_COMPONENTBUILDER_MENU_HELP_DOCUMENTS @@ -92,7 +93,7 @@ Whether you're a seasoned [Joomla](http://www.joomla.org/) developer, or have ju - language/en-GB/en-GB.com_componentbuilder.ini + language/en-GB/en-GB.com_componentbuilder.ini language/en-GB/en-GB.com_componentbuilder.sys.ini diff --git a/componentbuilder_update_server.xml b/componentbuilder_update_server.xml index f7a9ff9a4..86865f36a 100644 --- a/componentbuilder_update_server.xml +++ b/componentbuilder_update_server.xml @@ -220,4 +220,21 @@ http://vdm.bz/component-builder + + Component Builder + Builds Complex Joomla Components + com_componentbuilder + component + 2.4.2 + http://vdm.bz/component-builder + + https://github.com/vdm-io/Joomla-Component-Builder/releases/download/v2.4.2/JCB_v2.4.2.zip + + + stable + + Llewellyn van der Merwe + http://vdm.bz/component-builder + + \ No newline at end of file diff --git a/script.php b/script.php index 495df16cb..8a48ef6b6 100644 --- a/script.php +++ b/script.php @@ -10,8 +10,8 @@ |_| /-------------------------------------------------------------------------------------------------------------------------------/ - @version 2.4.1 - @build 1st April, 2017 + @version 2.4.2 + @build 6th April, 2017 @created 30th April, 2015 @package Component Builder @subpackage script.php @@ -1176,6 +1176,178 @@ class com_componentbuilderInstallerScript } } + // Create a new query object. + $query = $db->getQuery(true); + // Select id from content type table + $query->select($db->quoteName('type_id')); + $query->from($db->quoteName('#__content_types')); + // Where Language_translation alias is found + $query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.language_translation') ); + $db->setQuery($query); + // Execute query to see if alias is found + $db->execute(); + $language_translation_found = $db->getNumRows(); + // Now check if there were any rows + if ($language_translation_found) + { + // Since there are load the needed language_translation type ids + $language_translation_ids = $db->loadColumn(); + // Remove Language_translation from the content type table + $language_translation_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.language_translation') ); + // Create a new query object. + $query = $db->getQuery(true); + $query->delete($db->quoteName('#__content_types')); + $query->where($language_translation_condition); + $db->setQuery($query); + // Execute the query to remove Language_translation items + $language_translation_done = $db->execute(); + if ($language_translation_done); + { + // If succesfully remove Language_translation add queued success message. + $app->enqueueMessage(JText::_('The (com_componentbuilder.language_translation) type alias was removed from the #__content_type table')); + } + + // Remove Language_translation items from the contentitem tag map table + $language_translation_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.language_translation') ); + // Create a new query object. + $query = $db->getQuery(true); + $query->delete($db->quoteName('#__contentitem_tag_map')); + $query->where($language_translation_condition); + $db->setQuery($query); + // Execute the query to remove Language_translation items + $language_translation_done = $db->execute(); + if ($language_translation_done); + { + // If succesfully remove Language_translation add queued success message. + $app->enqueueMessage(JText::_('The (com_componentbuilder.language_translation) type alias was removed from the #__contentitem_tag_map table')); + } + + // Remove Language_translation items from the ucm content table + $language_translation_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_componentbuilder.language_translation') ); + // Create a new query object. + $query = $db->getQuery(true); + $query->delete($db->quoteName('#__ucm_content')); + $query->where($language_translation_condition); + $db->setQuery($query); + // Execute the query to remove Language_translation items + $language_translation_done = $db->execute(); + if ($language_translation_done); + { + // If succesfully remove Language_translation add queued success message. + $app->enqueueMessage(JText::_('The (com_componentbuilder.language_translation) type alias was removed from the #__ucm_content table')); + } + + // Make sure that all the Language_translation items are cleared from DB + foreach ($language_translation_ids as $language_translation_id) + { + // Remove Language_translation items from the ucm base table + $language_translation_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $language_translation_id); + // Create a new query object. + $query = $db->getQuery(true); + $query->delete($db->quoteName('#__ucm_base')); + $query->where($language_translation_condition); + $db->setQuery($query); + // Execute the query to remove Language_translation items + $db->execute(); + + // Remove Language_translation items from the ucm history table + $language_translation_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $language_translation_id); + // Create a new query object. + $query = $db->getQuery(true); + $query->delete($db->quoteName('#__ucm_history')); + $query->where($language_translation_condition); + $db->setQuery($query); + // Execute the query to remove Language_translation items + $db->execute(); + } + } + + // Create a new query object. + $query = $db->getQuery(true); + // Select id from content type table + $query->select($db->quoteName('type_id')); + $query->from($db->quoteName('#__content_types')); + // Where Language alias is found + $query->where( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.language') ); + $db->setQuery($query); + // Execute query to see if alias is found + $db->execute(); + $language_found = $db->getNumRows(); + // Now check if there were any rows + if ($language_found) + { + // Since there are load the needed language type ids + $language_ids = $db->loadColumn(); + // Remove Language from the content type table + $language_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.language') ); + // Create a new query object. + $query = $db->getQuery(true); + $query->delete($db->quoteName('#__content_types')); + $query->where($language_condition); + $db->setQuery($query); + // Execute the query to remove Language items + $language_done = $db->execute(); + if ($language_done); + { + // If succesfully remove Language add queued success message. + $app->enqueueMessage(JText::_('The (com_componentbuilder.language) type alias was removed from the #__content_type table')); + } + + // Remove Language items from the contentitem tag map table + $language_condition = array( $db->quoteName('type_alias') . ' = '. $db->quote('com_componentbuilder.language') ); + // Create a new query object. + $query = $db->getQuery(true); + $query->delete($db->quoteName('#__contentitem_tag_map')); + $query->where($language_condition); + $db->setQuery($query); + // Execute the query to remove Language items + $language_done = $db->execute(); + if ($language_done); + { + // If succesfully remove Language add queued success message. + $app->enqueueMessage(JText::_('The (com_componentbuilder.language) type alias was removed from the #__contentitem_tag_map table')); + } + + // Remove Language items from the ucm content table + $language_condition = array( $db->quoteName('core_type_alias') . ' = ' . $db->quote('com_componentbuilder.language') ); + // Create a new query object. + $query = $db->getQuery(true); + $query->delete($db->quoteName('#__ucm_content')); + $query->where($language_condition); + $db->setQuery($query); + // Execute the query to remove Language items + $language_done = $db->execute(); + if ($language_done); + { + // If succesfully remove Language add queued success message. + $app->enqueueMessage(JText::_('The (com_componentbuilder.language) type alias was removed from the #__ucm_content table')); + } + + // Make sure that all the Language items are cleared from DB + foreach ($language_ids as $language_id) + { + // Remove Language items from the ucm base table + $language_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $language_id); + // Create a new query object. + $query = $db->getQuery(true); + $query->delete($db->quoteName('#__ucm_base')); + $query->where($language_condition); + $db->setQuery($query); + // Execute the query to remove Language items + $db->execute(); + + // Remove Language items from the ucm history table + $language_condition = array( $db->quoteName('ucm_type_id') . ' = ' . $language_id); + // Create a new query object. + $query = $db->getQuery(true); + $query->delete($db->quoteName('#__ucm_history')); + $query->where($language_condition); + $db->setQuery($query); + // Execute the query to remove Language items + $db->execute(); + } + } + // Create a new query object. $query = $db->getQuery(true); // Select id from content type table @@ -1433,7 +1605,7 @@ class com_componentbuilderInstallerScript $custom_code->type_title = 'Componentbuilder Custom_code'; $custom_code->type_alias = 'com_componentbuilder.custom_code'; $custom_code->table = '{"special": {"dbtable": "#__componentbuilder_custom_code","key": "id","type": "Custom_code","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; - $custom_code->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "component","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": {"component":"component","path":"path","target":"target","type":"type","comment_type":"comment_type","system_name":"system_name","function_name":"function_name","from_line":"from_line","hashendtarget":"hashendtarget","not_required":"not_required","code":"code","to_line":"to_line","hashtarget":"hashtarget"}}'; + $custom_code->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "component","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": {"component":"component","path":"path","target":"target","type":"type","comment_type":"comment_type","hashtarget":"hashtarget","code":"code","hashendtarget":"hashendtarget","to_line":"to_line","function_name":"function_name","from_line":"from_line","system_name":"system_name","not_required":"not_required"}}'; $custom_code->router = 'ComponentbuilderHelperRoute::getCustom_codeRoute'; $custom_code->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/custom_code.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","component","target","type","comment_type","not_required"],"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": "component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; @@ -1500,6 +1672,30 @@ class com_componentbuilderInstallerScript // Set the object into the content types table. $fieldtype_category_Inserted = $db->insertObject('#__content_types', $fieldtype_category); + // Create the language_translation content type object. + $language_translation = new stdClass(); + $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": "entranslation","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": {"entranslation":"entranslation","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"}]}'; + + // Set the object into the content types table. + $language_translation_Inserted = $db->insertObject('#__content_types', $language_translation); + + // Create the language content type object. + $language = new stdClass(); + $language->type_title = 'Componentbuilder Language'; + $language->type_alias = 'com_componentbuilder.language'; + $language->table = '{"special": {"dbtable": "#__componentbuilder_language","key": "id","type": "Language","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; + $language->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","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": {"name":"name","langtag":"langtag"}}'; + $language->router = 'ComponentbuilderHelperRoute::getLanguageRoute'; + $language->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/language.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"}]}'; + + // Set the object into the content types table. + $language_Inserted = $db->insertObject('#__content_types', $language); + // Create the help_document content type object. $help_document = new stdClass(); $help_document->type_title = 'Componentbuilder Help_document'; @@ -1518,7 +1714,7 @@ class com_componentbuilderInstallerScript // Field to update. $fields = array( - $db->quoteName('params') . ' = ' . $db->quote('{"autorName":"Llewellyn van der Merwe","autorEmail":"joomla@vdm.io","minify":"0","export_license":"GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html","export_copyright":"Copyright (C) 2015. All Rights Reserved","check_in":"-1 day","save_history":"1","history_limit":"10","uikit_load":"1","uikit_min":"","uikit_style":""}'), + $db->quoteName('params') . ' = ' . $db->quote('{"autorName":"Llewellyn van der Merwe","autorEmail":"joomla@vdm.io","minify":"0","percentagelanguageadd":"50","export_license":"GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html","export_copyright":"Copyright (C) 2015. All Rights Reserved","check_in":"-1 day","save_history":"1","history_limit":"10","uikit_load":"1","uikit_min":"","uikit_style":""}'), ); // Condition. @@ -1748,7 +1944,7 @@ class com_componentbuilderInstallerScript $custom_code->type_title = 'Componentbuilder Custom_code'; $custom_code->type_alias = 'com_componentbuilder.custom_code'; $custom_code->table = '{"special": {"dbtable": "#__componentbuilder_custom_code","key": "id","type": "Custom_code","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; - $custom_code->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "component","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": {"component":"component","path":"path","target":"target","type":"type","comment_type":"comment_type","system_name":"system_name","function_name":"function_name","from_line":"from_line","hashendtarget":"hashendtarget","not_required":"not_required","code":"code","to_line":"to_line","hashtarget":"hashtarget"}}'; + $custom_code->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "component","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": {"component":"component","path":"path","target":"target","type":"type","comment_type":"comment_type","hashtarget":"hashtarget","code":"code","hashendtarget":"hashendtarget","to_line":"to_line","function_name":"function_name","from_line":"from_line","system_name":"system_name","not_required":"not_required"}}'; $custom_code->router = 'ComponentbuilderHelperRoute::getCustom_codeRoute'; $custom_code->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/custom_code.xml","hideFields": ["asset_id","checked_out","checked_out_time","version","not_required"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","component","target","type","comment_type","not_required"],"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": "component","targetTable": "#__componentbuilder_joomla_component","targetColumn": "id","displayColumn": "system_name"}]}'; @@ -1917,6 +2113,64 @@ class com_componentbuilderInstallerScript $fieldtype_category_Inserted = $db->insertObject('#__content_types', $fieldtype_category); } + // Create the language_translation content type object. + $language_translation = new stdClass(); + $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": "entranslation","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": {"entranslation":"entranslation","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"}]}'; + + // Check if language_translation type is already in content_type DB. + $language_translation_id = null; + $query = $db->getQuery(true); + $query->select($db->quoteName(array('type_id'))); + $query->from($db->quoteName('#__content_types')); + $query->where($db->quoteName('type_alias') . ' LIKE '. $db->quote($language_translation->type_alias)); + $db->setQuery($query); + $db->execute(); + + // Set the object into the content types table. + if ($db->getNumRows()) + { + $language_translation->type_id = $db->loadResult(); + $language_translation_Updated = $db->updateObject('#__content_types', $language_translation, 'type_id'); + } + else + { + $language_translation_Inserted = $db->insertObject('#__content_types', $language_translation); + } + + // Create the language content type object. + $language = new stdClass(); + $language->type_title = 'Componentbuilder Language'; + $language->type_alias = 'com_componentbuilder.language'; + $language->table = '{"special": {"dbtable": "#__componentbuilder_language","key": "id","type": "Language","prefix": "componentbuilderTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}'; + $language->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","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": {"name":"name","langtag":"langtag"}}'; + $language->router = 'ComponentbuilderHelperRoute::getLanguageRoute'; + $language->content_history_options = '{"formFile": "administrator/components/com_componentbuilder/models/forms/language.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"}]}'; + + // Check if language type is already in content_type DB. + $language_id = null; + $query = $db->getQuery(true); + $query->select($db->quoteName(array('type_id'))); + $query->from($db->quoteName('#__content_types')); + $query->where($db->quoteName('type_alias') . ' LIKE '. $db->quote($language->type_alias)); + $db->setQuery($query); + $db->execute(); + + // Set the object into the content types table. + if ($db->getNumRows()) + { + $language->type_id = $db->loadResult(); + $language_Updated = $db->updateObject('#__content_types', $language, 'type_id'); + } + else + { + $language_Inserted = $db->insertObject('#__content_types', $language); + } + // Create the help_document content type object. $help_document = new stdClass(); $help_document->type_title = 'Componentbuilder Help_document'; @@ -1950,7 +2204,7 @@ class com_componentbuilderInstallerScript echo ' -

Upgrade to Version 2.4.1 Was Successful! Let us know if anything is not working as expected.

'; +

Upgrade to Version 2.4.2 Was Successful! Let us know if anything is not working as expected.

'; } } }