Fixed the site view menu not being build as a result of new feature that builds edit site view menu.

This commit is contained in:
Llewellyn van der Merwe 2019-04-14 22:20:01 +02:00
parent a817bae010
commit 44451f1017
No known key found for this signature in database
GPG Key ID: CAD7B16D27AF28C5
8 changed files with 32 additions and 20 deletions

View File

@ -146,7 +146,7 @@ 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*: 9th April, 2019
+ *Last Build*: 14th April, 2019
+ *Version*: 2.9.15
+ *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt

View File

@ -146,7 +146,7 @@ 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*: 9th April, 2019
+ *Last Build*: 14th April, 2019
+ *Version*: 2.9.15
+ *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt

View File

@ -0,0 +1 @@
###SITE_MENU_XML###

View File

@ -600,10 +600,9 @@
"rename": false,
"type": "menu"
},
"default.xml": {
"edit.xml": {
"path": "c0mp0n3nt/site/views/VIEW/tmpl",
"rename": "new",
"newName": "edit.xml",
"rename": false,
"type": "admin_menu"
},
"module_forms.xml": {

View File

@ -1160,8 +1160,12 @@ class Structure extends Get
*/
public function buildDynamique($target, $type, $fileName = false, $config = false)
{
// did we build the files (any number)
$build_status = false;
// check that we have the target values
if (ComponentbuilderHelper::checkArray($target))
{
// search the target
foreach ($target as $main => $name)
{
// make sure it is lower case
@ -1169,7 +1173,7 @@ class Structure extends Get
// setup the files
foreach ($this->joomlaVersionData->move->dynamic->{$main} as $item => $details)
{
if ($details->type == $type)
if ($details->type === $type)
{
// set destination path
$path = '';
@ -1228,12 +1232,13 @@ class Structure extends Get
}
// store the new files
$this->newFiles['dynamic'][$name][] = $newFIle;
// we have build atleast one
$build_status = true;
}
}
}
return true;
}
return false;
return $build_status;
}
/**

View File

@ -1473,10 +1473,10 @@ class Interpretation extends Fields
public function setAdminViewMenu(&$viewName_single, &$view)
{
$xml = '';
// build the file
// build the file target values
$target = array('site' => $viewName_single);
$done = $this->buildDynamique($target, 'admin_menu');
if ($done)
// build the edit.xml file
if ($this->buildDynamique($target, 'admin_menu'))
{
// set the lang
$lang = ComponentbuilderHelper::safeString('com_' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '_menu_' . $viewName_single, 'U');
@ -1493,16 +1493,20 @@ class Interpretation extends Fields
$xml .= PHP_EOL . $this->_t(1) . '</layout>';
$xml .= PHP_EOL . '</metadata>';
}
else
{
$this->app->enqueueMessage(JText::sprintf('<hr /><p>Site menu for <b>%s</b> was not build.</p>', $viewName_single), 'Warning');
}
return $xml;
}
public function setCustomViewMenu(&$view)
{
$xml = '';
// build the file
// build the file target values
$target = array('site' => $view['settings']->code);
$done = $this->buildDynamique($target, 'menu');
if ($done)
// build the default.xml file
if ($this->buildDynamique($target, 'menu'))
{
// set the lang
$lang = ComponentbuilderHelper::safeString('com_' . $this->fileContentStatic[$this->hhh . 'component' . $this->hhh] . '_menu_' . $view['settings']->code, 'U');
@ -1560,6 +1564,10 @@ class Interpretation extends Fields
}
$xml .= PHP_EOL . '</metadata>';
}
else
{
$this->app->enqueueMessage(JText::sprintf('<hr /><p>Site menu for <b>%s</b> was not build.</p>', $view['settings']->code), 'Warning');
}
return $xml;
}
@ -1573,10 +1581,9 @@ class Interpretation extends Fields
$target = ComponentbuilderHelper::getBetween($field, 'display="', '"');
if (!ComponentbuilderHelper::checkString($target) || $target === 'menu')
{
$field = str_replace('display="menu"', '', $field);
// we load fields that have options
if (strpos($field, 'Option Set. -->') !== false && strpos($field, $menuSetter) === false && !ComponentbuilderHelper::checkString($target))
// we update fields that have options if not only added to menu
if ($target !== 'menu' && strpos($field, 'Option Set. -->') !== false && strpos($field, $menuSetter) === false && !ComponentbuilderHelper::checkString($target))
{
// we add the global option
$field = str_replace('Option Set. -->', $this->setLine(__LINE__) . ' Global & Option Set. -->' . PHP_EOL . $this->_t(3) . '<option value="">' . PHP_EOL . $this->_t(4) . 'JGLOBAL_USE_GLOBAL</option>', $field);

View File

@ -5212,8 +5212,8 @@ Project duration: **###projectWeekTime### weeks** or **###projectMonthTime### mo
* Ethereum: 0x9548144662b47327c954f3e214edb96662d51218
</code></div>"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_README_LABEL="Demo README (with all place-holders)"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_UPDATE_SERVER_NOTE_FTP_DESCRIPTION="During compilation the file will be moved to the FTP folder. You still need to point the above <b>update server</b> url to the xml file on your FTP server for it to work correctly."
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_UPDATE_SERVER_NOTE_FTP_LABEL="Select the FTP server used for your update server."
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_UPDATE_SERVER_NOTE_FTP_DESCRIPTION="During compilation the file will be moved to the server. You still need to point the above <b>update server</b> url to the xml file location on your server for it to work correctly."
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_UPDATE_SERVER_NOTE_FTP_LABEL="Select the server used for your update server."
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_UPDATE_SERVER_NOTE_OTHER_DESCRIPTION="Not really sure what other options to add.... so let me know. For now this option does not really do anything except adding the link above to your component as an update server. So it really could be called the manual option, since you will need to set the update server your self. You still need to point the above <b>update server</b> url to the manually created xml file for it to work correctly."
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_UPDATE_SERVER_NOTE_OTHER_LABEL="The Other Options"
COM_COMPONENTBUILDER_JOOMLA_COMPONENT_NOTE_UPDATE_SERVER_NOTE_ZIP_DESCRIPTION="The update server XML file will be added to the zipped package during compilation. You still need to point the above <b>update server</b> url to the xml wherever you have placed the files online."

View File

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