Fixed gh-394 so to be able to target the component instead of a single view.

This commit is contained in:
Llewellyn van der Merwe 2019-05-06 03:05:15 +02:00
parent d7b555e7af
commit a23f1fe79a
No known key found for this signature in database
GPG Key ID: CAD7B16D27AF28C5
7 changed files with 48 additions and 30 deletions

View File

@ -146,11 +146,11 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015 + *First Build*: 30th April, 2015
+ *Last Build*: 2nd May, 2019 + *Last Build*: 6th May, 2019
+ *Version*: 2.9.16 + *Version*: 2.9.16
+ *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt + *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **205393** + *Line count*: **205396**
+ *Field count*: **1130** + *Field count*: **1130**
+ *File count*: **1342** + *File count*: **1342**
+ *Folder count*: **209** + *Folder count*: **209**

View File

@ -146,11 +146,11 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015 + *First Build*: 30th April, 2015
+ *Last Build*: 2nd May, 2019 + *Last Build*: 6th May, 2019
+ *Version*: 2.9.16 + *Version*: 2.9.16
+ *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt + *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **205393** + *Line count*: **205396**
+ *Field count*: **1130** + *Field count*: **1130**
+ *File count*: **1342** + *File count*: **1342**
+ *Folder count*: **209** + *Folder count*: **209**

View File

@ -2700,7 +2700,10 @@ class Fields extends Structure
$otherViews = $view_name_list; $otherViews = $view_name_list;
$otherView = $view_name_single; $otherView = $view_name_single;
} }
$this->categoryBuilder[$view_name_list] = array('code' => $name, 'name' => $listLangName); // get the xml extension name
$_extension = $this->setPlaceholders(ComponentbuilderHelper::getBetween($field['settings']->xml, 'extension="', '"'), $this->placeholders);
// load the category builder
$this->categoryBuilder[$view_name_list] = array('code' => $name, 'name' => $listLangName, 'extension' => $_extension);
// also set code name for title alias fix // also set code name for title alias fix
$this->catCodeBuilder[$view_name_single] = array('code' => $name, 'views' => $otherViews, 'view' => $otherView); $this->catCodeBuilder[$view_name_single] = array('code' => $name, 'views' => $otherViews, 'view' => $otherView);
} }

View File

@ -13464,7 +13464,19 @@ class Interpretation extends Fields
} }
if (isset($this->categoryBuilder[$nameList]) && ComponentbuilderHelper::checkArray($this->categoryBuilder[$nameList]) && !in_array($otherViews, $catArray)) if (isset($this->categoryBuilder[$nameList]) && ComponentbuilderHelper::checkArray($this->categoryBuilder[$nameList]) && !in_array($otherViews, $catArray))
{ {
$menus .= PHP_EOL . $this->_t(2) . $tab . "JHtmlSidebar::addEntry(JText:" . ":_('" . $this->categoryBuilder[$nameList]['name'] . "'), 'index.php?option=com_categories&view=categories&extension=com_" . $codeName . "." . $otherViews . "', \$submenu === 'categories." . $otherViews . "');"; // get the extention array
$_extetion_array = explode('.', $this->categoryBuilder[$nameList]['extension']);
// set the meny selection
if (isset($_extetion_array[1]))
{
$_menu = "categories." . trim($_extetion_array[1]);
}
else
{
$_menu = "categories";
}
// now load the menus
$menus .= PHP_EOL . $this->_t(2) . $tab . "JHtmlSidebar::addEntry(JText:" . ":_('" . $this->categoryBuilder[$nameList]['name'] . "'), 'index.php?option=com_categories&view=categories&extension=" . $this->categoryBuilder[$nameList]['extension'] . "', \$submenu === '" . $_menu ."');";
// make sure we add a category only once // make sure we add a category only once
$catArray[] = $otherViews; $catArray[] = $otherViews;
} }

View File

@ -599,6 +599,9 @@ function getFieldOptions(fieldtype, db){
jQuery('#jform_store').val(result.database.store); jQuery('#jform_store').val(result.database.store);
jQuery('#jform_store').trigger("liszt:updated"); jQuery('#jform_store').trigger("liszt:updated");
jQuery('#jform_store').trigger("change"); jQuery('#jform_store').trigger("change");
// update null_switch (hmmm)
// jQuery('#jform_null_switch').val(result.database.null_switch);
// jQuery('#jform_null_switch').trigger("change");
} }
} }
}) })

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.2" method="upgrade"> <extension type="component" version="3.2" method="upgrade">
<name>COM_COMPONENTBUILDER</name> <name>COM_COMPONENTBUILDER</name>
<creationDate>2nd May, 2019</creationDate> <creationDate>6th May, 2019</creationDate>
<author>Llewellyn van der Merwe</author> <author>Llewellyn van der Merwe</author>
<authorEmail>llewellyn@joomlacomponentbuilder.com</authorEmail> <authorEmail>llewellyn@joomlacomponentbuilder.com</authorEmail>
<authorUrl>http://www.joomlacomponentbuilder.com</authorUrl> <authorUrl>http://www.joomlacomponentbuilder.com</authorUrl>