diff --git a/README.md b/README.md index a77d2f9f3..52eed3198 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save 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.12.4) 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.12.5) with **ALL** its features and **ALL** concepts totally open-source and free! > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) @@ -143,13 +143,13 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 3rd January, 2021 -+ *Version*: 2.12.4 ++ *Last Build*: 6th January, 2021 ++ *Version*: 2.12.5 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **291460** -+ *Field count*: **1609** -+ *File count*: **1934** ++ *Line count*: **291576** ++ *Field count*: **1611** ++ *File count*: **1935** + *Folder count*: **322** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). diff --git a/admin/README.txt b/admin/README.txt index a77d2f9f3..52eed3198 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -12,7 +12,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save 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.12.4) 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.12.5) with **ALL** its features and **ALL** concepts totally open-source and free! > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) @@ -143,13 +143,13 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 3rd January, 2021 -+ *Version*: 2.12.4 ++ *Last Build*: 6th January, 2021 ++ *Version*: 2.12.5 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **291460** -+ *Field count*: **1609** -+ *File count*: **1934** ++ *Line count*: **291576** ++ *Field count*: **1611** ++ *File count*: **1935** + *Folder count*: **322** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). diff --git a/admin/controllers/ajax.json.php b/admin/controllers/ajax.json.php index 9b3e2907a..3a4a4de4f 100644 --- a/admin/controllers/ajax.json.php +++ b/admin/controllers/ajax.json.php @@ -45,6 +45,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy $this->registerTask('getAjaxDisplay', 'ajax'); $this->registerTask('getLinked', 'ajax'); $this->registerTask('checkAliasField', 'ajax'); + $this->registerTask('checkCategoryField', 'ajax'); $this->registerTask('templateDetails', 'ajax'); $this->registerTask('getLayoutDetails', 'ajax'); $this->registerTask('dbTableColumns', 'ajax'); @@ -768,6 +769,44 @@ class ComponentbuilderControllerAjax extends JControllerLegacy } } break; + case 'checkCategoryField': + try + { + $returnRaw = $jinput->get('raw', false, 'BOOLEAN'); + $typeValue = $jinput->get('type', NULL, 'ALNUM'); + if($typeValue && $user->id != 0) + { + $result = $this->getModel('ajax')->checkCategoryField($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; case 'templateDetails': try { diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index fdb75582b..1b09a000e 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -23390,27 +23390,27 @@ class Interpretation extends Fields ); } $catArray = array(); + // loop over all the admin views foreach ($this->componentData->admin_views as $view) { // set custom menu - $menus .= $this->addCustomSubMenu($view, $codeName, $lang); - $nameSingle = ComponentbuilderHelper::safeString( - $view['settings']->name_single + $menus .= $this->addCustomSubMenu( + $view, $codeName, $lang ); - $nameList = ComponentbuilderHelper::safeString( - $view['settings']->name_list - ); - $nameUpper = ComponentbuilderHelper::safeString( + $nameSingleCode = $view['settings']->name_single_code; + $nameListCode = $view['settings']->name_list_code; + $nameUpper = ComponentbuilderHelper::safeString( $view['settings']->name_list, 'U' ); + // check if view is set to be in the sub-menu if (isset($view['submenu']) && $view['submenu'] == 1) { // setup access defaults $tab = ""; $coreLoad = false; - if (isset($this->permissionCore[$nameSingle])) + if (isset($this->permissionCore[$nameSingleCode])) { - $core = $this->permissionCore[$nameSingle]; + $core = $this->permissionCore[$nameSingleCode]; $coreLoad = true; } // check if the item has permissions. @@ -23420,14 +23420,14 @@ class Interpretation extends Fields $this->permissionBuilder['global'][$core['core.access']] ) && in_array( - $nameSingle, + $nameSingleCode, $this->permissionBuilder['global'][$core['core.access']] )) { $menus .= PHP_EOL . $this->_t(2) . "if (\$user->authorise('" . $core['core.access'] . "', 'com_" . $codeName - . "') && \$user->authorise('" . $nameSingle + . "') && \$user->authorise('" . $nameSingleCode . ".submenu', 'com_" . $codeName . "'))"; $menus .= PHP_EOL . $this->_t(2) . "{"; // add tab to lines to follow @@ -23436,33 +23436,38 @@ class Interpretation extends Fields $menus .= PHP_EOL . $this->_t(2) . $tab . "JHtmlSidebar::addEntry(JText:" . ":_('" . $lang . "_" . $nameUpper . "'), 'index.php?option=com_" . $codeName - . "&view=" . $nameList . "', \$submenu === '" - . $nameList . "');"; + . "&view=" . $nameListCode . "', \$submenu === '" + . $nameListCode . "');"; $this->setLangContent( $this->lang, $lang . "_" . $nameUpper, $view['settings']->name_list ); // check if category has another name - if (isset($this->catOtherName[$nameList]) + if (isset($this->catOtherName[$nameListCode]) && ComponentbuilderHelper::checkArray( - $this->catOtherName[$nameList] + $this->catOtherName[$nameListCode] )) { - $otherViews = $this->catOtherName[$nameList]['views']; + $otherViews + = $this->catOtherName[$nameListCode]['views']; } else { - $otherViews = $nameList; + $otherViews = $nameListCode; } - if (isset($this->categoryBuilder[$nameList]) + // first check if category sub-menu should be added + // then check if view has category, if true add sub-menu for it + if ($view['settings']->add_category_submenu == 1 + && isset($this->categoryBuilder[$nameListCode]) && ComponentbuilderHelper::checkArray( - $this->categoryBuilder[$nameList] + $this->categoryBuilder[$nameListCode] ) && !in_array($otherViews, $catArray)) { // get the extension array $_extension_array = (array) explode( - '.', $this->categoryBuilder[$nameList]['extension'] + '.', + $this->categoryBuilder[$nameListCode]['extension'] ); // set the menu selection if (isset($_extension_array[1])) @@ -23476,9 +23481,9 @@ class Interpretation extends Fields // now load the menus $menus .= PHP_EOL . $this->_t(2) . $tab . "JHtmlSidebar::addEntry(JText:" . ":_('" - . $this->categoryBuilder[$nameList]['name'] + . $this->categoryBuilder[$nameListCode]['name'] . "'), 'index.php?option=com_categories&view=categories&extension=" - . $this->categoryBuilder[$nameList]['extension'] + . $this->categoryBuilder[$nameListCode]['extension'] . "', \$submenu === '" . $_menu . "');"; // make sure we add a category only once $catArray[] = $otherViews; @@ -23490,7 +23495,7 @@ class Interpretation extends Fields $this->permissionBuilder['global'][$core['core.access']] ) && in_array( - $nameSingle, + $nameSingleCode, $this->permissionBuilder['global'][$core['core.access']] )) { @@ -23508,13 +23513,13 @@ class Interpretation extends Fields . "JHtmlSidebar::addEntry(JText:" . ":_('" . $lang . "_" . $nameUpper . "_FIELDS'), 'index.php?option=com_fields&context=com_" - . $codeName . "." . $nameSingle + . $codeName . "." . $nameSingleCode . "', \$submenu === 'fields.fields');"; $menus .= PHP_EOL . $this->_t(3) . "JHtmlSidebar::addEntry(JText:" . ":_('" . $lang . "_" . $nameUpper . "_FIELDS_GROUPS'), 'index.php?option=com_fields&view=groups&context=com_" - . $codeName . "." . $nameSingle + . $codeName . "." . $nameSingleCode . "', \$submenu === 'fields.groups');"; $menus .= PHP_EOL . $this->_t(2) . "}"; $this->setLangContent( @@ -23527,9 +23532,10 @@ class Interpretation extends Fields $view['settings']->name_list . ' Field Groups' ); // build uninstall script for fields - $this->uninstallScriptBuilder[$nameSingle] = 'com_' - . $codeName . '.' . $nameSingle; - $this->uninstallScriptFields[$nameSingle] = $nameSingle; + $this->uninstallScriptBuilder[$nameSingleCode] = 'com_' + . $codeName . '.' . $nameSingleCode; + $this->uninstallScriptFields[$nameSingleCode] + = $nameSingleCode; } } if (isset($this->lastCustomSubMenu) diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index 2352fc8ce..97ccf25f3 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -484,6 +484,9 @@ COM_COMPONENTBUILDER_ADMIN_VIEW_ADDTABLES_LABEL="Tables" COM_COMPONENTBUILDER_ADMIN_VIEW_ADDTABS="Addtabs" COM_COMPONENTBUILDER_ADMIN_VIEW_ADDTABS_DESCRIPTION="Setup tabs for this view." COM_COMPONENTBUILDER_ADMIN_VIEW_ADDTABS_LABEL="Tabs" +COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_CATEGORY_SUBMENU="Add Category Submenu" +COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_CATEGORY_SUBMENU_DESCRIPTION="Do you want to add the category to the sub-menu?" +COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_CATEGORY_SUBMENU_LABEL="Add Category Sub-menu" COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_CSS_VIEW="Add Css View" COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_CSS_VIEWS="Add Css Views" COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_CSS_VIEWS_LABEL="Add CSS (views)" @@ -945,6 +948,8 @@ COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_ALIAS_BUILDER_DEFAULT_DESCRIPTION="The defa COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_ALIAS_BUILDER_DEFAULT_LABEL="Default Alias Behaviour" COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_BEGINNER_IMPORT_DESCRIPTION="
Please do not change this area unless you would like to add special import to this view that goes beyond the default import concept that Component Builder already does automatic if this view is set to have import & export in the component area where this view is linked to the component.
" COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_BEGINNER_IMPORT_LABEL="Beginners notice." +COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_CATEGORY_MENU_SWITCH_DESCRIPTION="You can now choose whether this view's category is added to the sub-menu." +COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_CATEGORY_MENU_SWITCH_LABEL="Category Menu Switch" COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_CREATE_EDIT_BUTTONS_DESCRIPTION="Some Shortcut ButtonsThe Component Builder for [Joomla](https://extensions.joomla.org/extension/component-builder/) is highly advanced tool that is truly able to build extremely complex components in a fraction of the time.
diff --git a/componentbuilder_update_server.xml b/componentbuilder_update_server.xml
index 38a19473d..b81b232a6 100644
--- a/componentbuilder_update_server.xml
+++ b/componentbuilder_update_server.xml
@@ -1019,4 +1019,21 @@