Resolved gh-364 to allow greater depth and ensure that all custom code placeholders are always update/replaced at any depth layer. Tweaked the editURL method to also handle access control permissions.

This commit is contained in:
Llewellyn van der Merwe 2019-01-22 00:58:22 +02:00
parent 4e2c51c303
commit 5c2f0aec63
No known key found for this signature in database
GPG Key ID: CAD7B16D27AF28C5
7 changed files with 22 additions and 18 deletions

View File

@ -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*: 14th January, 2019
+ *Last Build*: 21st January, 2019
+ *Version*: 2.9.8
+ *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **195803**
+ *Line count*: **195813**
+ *Field count*: **1087**
+ *File count*: **1275**
+ *Folder count*: **201**

View File

@ -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*: 14th January, 2019
+ *Last Build*: 21st January, 2019
+ *Version*: 2.9.8
+ *Copyright*: Copyright (C) 2015 - 2018 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **195803**
+ *Line count*: **195813**
+ *Field count*: **1087**
+ *File count*: **1275**
+ *Folder count*: **201**

View File

@ -4915,7 +4915,7 @@ class Get
// when the custom code is loaded
if ($loaded === true)
{
$string = $this->insertCustomCode($string, $debug);
$string = $this->insertCustomCode($bucket, $string, $debug);
}
// if debug
if ($debug)
@ -4936,19 +4936,13 @@ class Get
* @return string on success
*
*/
protected function insertCustomCode($string, $debug = 0)
protected function insertCustomCode($ids, $string, $debug = 0)
{
$code = array();
// if debug
if ($debug)
{
echo '$this->customCode:';
var_dump($this->customCode);
}
// load the code
foreach ($this->customCode as $item)
foreach ($ids as $id)
{
$this->buildCustomCodePlaceholders($item, $code, $debug);
$this->buildCustomCodePlaceholders($this->customCodeMemory[$id], $code, $debug);
}
// if debug
if ($debug)

View File

@ -3895,8 +3895,13 @@ abstract class ComponentbuilderHelper
* @return string On success the edit url
*
*/
public static function getEditURL(&$item, $view, $views, $ref = '', $component = 'com_componentbuilder', $jRoute = true)
public static function getEditURL(&$item, $view, $views, $ref = '', $component = 'com_componentbuilder', $jRoute = true)
{
// make sure the user has access to view
if (!JFactory::getUser()->authorise($view. '.access', $component))
{
return false;
}
// build record
$record = new stdClass();
// check that we have the ID

View File

@ -3703,7 +3703,7 @@ COM_COMPONENTBUILDER_CUSTOM_CODE_NOTE_PLACEHOLDERS_EXPLAINED_DESCRIPTION="<div c
<div id='usedin-c' style='display:none;'><h2>Admin Views</h2><div id='area-c'></div></div>
<div id='usedin-d' style='display:none;'><h2>Admin Fields Relations</h2><div id='area-d'></div></div>
<div id='usedin-e' style='display:none;'><h2>Custom Admin Views</h2><div id='area-e'></div></div>
<div id='usedin-f' style='display:none;'><h2>Site Views</h2><div id='area-r'></div></div>
<div id='usedin-f' style='display:none;'><h2>Site Views</h2><div id='area-f'></div></div>
<div id='usedin-g' style='display:none;'><h2>Fields</h2><div id='area-g'></div></div>
<div id='usedin-h' style='display:none;'><h2>Fieldtypes</h2><div id='area-h'></div></div>
<div id='usedin-i' style='display:none;'><h2>Dynamic Gets</h2><div id='area-i'></div></div>

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>14th January, 2019</creationDate>
<creationDate>21st January, 2019</creationDate>
<author>Llewellyn van der Merwe</author>
<authorEmail>llewellyn@joomlacomponentbuilder.com</authorEmail>
<authorUrl>http://www.joomlacomponentbuilder.com</authorUrl>

View File

@ -3895,8 +3895,13 @@ abstract class ComponentbuilderHelper
* @return string On success the edit url
*
*/
public static function getEditURL(&$item, $view, $views, $ref = '', $component = 'com_componentbuilder', $jRoute = true)
public static function getEditURL(&$item, $view, $views, $ref = '', $component = 'com_componentbuilder', $jRoute = true)
{
// make sure the user has access to view
if (!JFactory::getUser()->authorise($view. '.access', $component))
{
return false;
}
// build record
$record = new stdClass();
// check that we have the ID