diff --git a/README.md b/README.md index 182ffb13c..a9172ecc4 100644 --- a/README.md +++ b/README.md @@ -144,11 +144,11 @@ 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*: 21st April, 2020 ++ *Last Build*: 23rd April, 2020 + *Version*: 2.11.0 + *Copyright*: Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **280799** ++ *Line count*: **280795** + *Field count*: **1514** + *File count*: **1769** + *Folder count*: **286** diff --git a/admin/README.txt b/admin/README.txt index 182ffb13c..a9172ecc4 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -144,11 +144,11 @@ 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*: 21st April, 2020 ++ *Last Build*: 23rd April, 2020 + *Version*: 2.11.0 + *Copyright*: Copyright (C) 2015 - 2020 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **280799** ++ *Line count*: **280795** + *Field count*: **1514** + *File count*: **1769** + *Folder count*: **286** diff --git a/admin/compiler/joomla_3/JViewLegacy_custom_admin.php b/admin/compiler/joomla_3/JViewLegacy_custom_admin.php index 2fb8a3545..ca93739a1 100644 --- a/admin/compiler/joomla_3/JViewLegacy_custom_admin.php +++ b/admin/compiler/joomla_3/JViewLegacy_custom_admin.php @@ -48,9 +48,7 @@ class ###Component###View###SView### extends JViewLegacy * Setting the toolbar */ protected function addToolBar() - { - // hide the main menu - $this->app->input->set('hidemainmenu', true); + {###HIDEMAINMENU### // set the title if (isset($this->item->name) && $this->item->name) { @@ -62,11 +60,7 @@ class ###Component###View###SView### extends JViewLegacy $title = JText::_('COM_###COMPONENT###_###SVIEW###'); } // add title to the page - JToolbarHelper::title($title,'###ICOMOON###'); - // add the back button - // JToolBarHelper::custom('###sview###.back', 'undo-2', '', 'COM_###COMPONENT###_BACK', false); - // add cpanel button - JToolBarHelper::custom('###sview###.dashboard', 'grid-2', '', 'COM_###COMPONENT###_DASH', false);###CUSTOM_ADMIN_CUSTOM_BUTTONS### + JToolbarHelper::title($title,'###ICOMOON###');###CUSTOM_ADMIN_CUSTOM_BUTTONS### // set help url for this view if found $help_url = ###Component###Helper::getHelpUrl('###sviews###'); diff --git a/admin/compiler/joomla_3/JViewLegacy_list_custom_admin.php b/admin/compiler/joomla_3/JViewLegacy_list_custom_admin.php index 9d712fed8..4546acc6c 100644 --- a/admin/compiler/joomla_3/JViewLegacy_list_custom_admin.php +++ b/admin/compiler/joomla_3/JViewLegacy_list_custom_admin.php @@ -48,15 +48,9 @@ class ###Component###View###SViews### extends JViewLegacy * Setting the toolbar */ protected function addToolBar() - { - // hide the main menu - $this->app->input->set('hidemainmenu', true); + {###HIDEMAINMENU### // add title to the page - JToolbarHelper::title(JText::_('COM_###COMPONENT###_###SVIEWS###'),'###ICOMOON###'); - // add the back button - // JToolBarHelper::custom('###sviews###.back', 'undo-2', '', 'COM_###COMPONENT###_BACK', false); - // add cpanel button - JToolBarHelper::custom('###sviews###.dashboard', 'grid-2', '', 'COM_###COMPONENT###_DASH', false);###CUSTOM_ADMIN_CUSTOM_BUTTONS### + JToolbarHelper::title(JText::_('COM_###COMPONENT###_###SVIEWS###'),'###ICOMOON###');###CUSTOM_ADMIN_CUSTOM_BUTTONS### // set help url for this view if found $help_url = ###Component###Helper::getHelpUrl('###sviews###'); diff --git a/admin/helpers/compiler/b_Structure.php b/admin/helpers/compiler/b_Structure.php index 147bcfb32..ff9fb50e3 100644 --- a/admin/helpers/compiler/b_Structure.php +++ b/admin/helpers/compiler/b_Structure.php @@ -349,6 +349,13 @@ class Structure extends Get */ public $dynamicDashboard = false; + /** + * The default view type + * + * @var string + */ + public $dynamicDashboardType; + /** * Constructor */ @@ -1696,6 +1703,8 @@ class Structure extends Get = ComponentbuilderHelper::safeString( $dashboard['settings']->{$keys[$t]} ); + $this->dynamicDashboardType + = $targets[$t]; } else { diff --git a/admin/helpers/compiler/e_Interpretation.php b/admin/helpers/compiler/e_Interpretation.php index c9d94c75b..d573e9de8 100644 --- a/admin/helpers/compiler/e_Interpretation.php +++ b/admin/helpers/compiler/e_Interpretation.php @@ -5359,6 +5359,8 @@ class Interpretation extends Fields // validate selection $validateSelection = 'true'; } + // reset buttons + $buttons = array(); // if site add buttons to view if ($this->target === 'site') { @@ -5405,11 +5407,28 @@ class Interpretation extends Fields break; } } + // add some buttons if custom admin view + elseif (1 == $type) + { + // add this button only if this is not the default view + if ($this->dynamicDashboardType !== 'custom_admin_views' + || ($this->dynamicDashboardType === 'custom_admin_views' + && $this->dynamicDashboard !== $viewName)) + { + $buttons[] = $tab . $this->_t(2) + . "//" . $this->setLine(__LINE__) . " add cpanel button"; + $buttons[] = $tab . $this->_t(2) + . "JToolBarHelper::custom('" . $viewName . "." + . "dashboard', 'grid-2', '', 'COM_" + . $this->fileContentStatic[$this->hhh + . 'COMPONENT' . $this->hhh] + . "_DASH', false);"; + } + } // check if custom button should be added if (isset($view['settings']->add_custom_button) && $view['settings']->add_custom_button == 1) { - $buttons = array(); $this->onlyFunctionButton = array(); $functionNames = array(); if (isset($view['settings']->custom_buttons) @@ -5592,27 +5611,26 @@ class Interpretation extends Fields ); } } - // return buttons if they were build - if (ComponentbuilderHelper::checkArray($buttons)) - { - // set the custom get form method JAVASCRIPT_FOR_BUTTONS - $this->fileContentDynamic[$view['settings']->code][$this->hhh - . $TARGET . '_JAVASCRIPT_FOR_BUTTONS' . $this->hhh] - = $this->setJavaScriptForButtons(); - // insure the form is added (only if not form exist) - if (isset($view['settings']->default) - && strpos( - $view['settings']->default, '