diff --git a/README.md b/README.md index e35a5cde9..8d7cb514a 100644 --- a/README.md +++ b/README.md @@ -143,11 +143,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*: 4th February, 2022 ++ *Last Build*: 5th February, 2022 + *Version*: 2.12.15 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **286257** ++ *Line count*: **286261** + *Field count*: **1580** + *File count*: **1829** + *Folder count*: **256** diff --git a/admin/README.txt b/admin/README.txt index e35a5cde9..8d7cb514a 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -143,11 +143,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*: 4th February, 2022 ++ *Last Build*: 5th February, 2022 + *Version*: 2.12.15 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **286257** ++ *Line count*: **286261** + *Field count*: **1580** + *File count*: **1829** + *Folder count*: **256** diff --git a/admin/models/ajax.php b/admin/models/ajax.php index 78657fe19..5d9ddab42 100644 --- a/admin/models/ajax.php +++ b/admin/models/ajax.php @@ -1803,10 +1803,10 @@ class ComponentbuilderModelAjax extends JModelList $db = JFactory::getDbo(); // Create a new query object. $query = $db->getQuery(true); - $query->select($db->quoteName(array('a.id','a.alias','a.template','b.name','a.dynamic_get'))); + $query->select($db->quoteName(array('a.id', 'a.alias', 'a.template', 'b.name', 'a.dynamic_get'))); $query->from($db->quoteName('#__componentbuilder_template', 'a')); $query->join('LEFT', $db->quoteName('#__componentbuilder_dynamic_get', 'b') . ' ON (' . $db->quoteName('b.id') . ' = ' . $db->quoteName('a.dynamic_get') . ')'); - $query->where($db->quoteName('a.id') . ' != '.(int) $id); + $query->where($db->quoteName('a.id') . ' != '. (int) $id); $query->where($db->quoteName('a.published') . ' = 1'); // Reset the query using our newly populated query object. $db->setQuery($query); @@ -1839,10 +1839,10 @@ class ComponentbuilderModelAjax extends JModelList $templateString[] = "".$result->name." ".$editget."<?php echo \$this->loadTemplate('".ComponentbuilderHelper::safeString($result->alias)."'); ?> ".$edit.""; } // build the table - $table = '

'.JText::_('COM_COMPONENTBUILDER_TEMPLATE_CODE_SNIPPETS').'

'; - $table .= ''; - $table .= ''; - $table .= ''.implode("",$templateString)."
'.JText::_('COM_COMPONENTBUILDER_TO_ADD_SIMPLY_COPY_AND_PAST_THE_SNIPPET_INTO_YOUR_CODE').'
'.JText::_('COM_COMPONENTBUILDER_NAME_OF_DYNAMICGET').''.JText::_('COM_COMPONENTBUILDER_SNIPPET').'
"; + $table = '

' . JText::_('COM_COMPONENTBUILDER_TEMPLATE_CODE_SNIPPETS') . '

'; + $table .= ''; + $table .= ''; + $table .= '' . implode("", $templateString) . "
' . JText::_('COM_COMPONENTBUILDER_TO_ADD_SIMPLY_COPY_AND_PAST_THE_SNIPPET_INTO_YOUR_CODE') . '
' . JText::_('COM_COMPONENTBUILDER_NAME_OF_DYNAMICGET') . '' . JText::_('COM_COMPONENTBUILDER_SNIPPET') . '
"; } return $table; } @@ -1892,34 +1892,38 @@ class ComponentbuilderModelAjax extends JModelList switch ($result->gettype) { case 1: - // single - $layoutString[] = "".$result->name." ".$editget."<?php echo JLayoutHelper::render('".ComponentbuilderHelper::safeString($result->alias)."', \$this->item); ?> ".$edit.""; + // single + $layoutString[] = "" . $result->name . " " . $editget . "<?php echo JLayoutHelper::render('" . ComponentbuilderHelper::safeString($result->alias) . "', \$this->item); ?> " . $edit . ""; break; case 2: - // list - $layoutString[] = "".$result->name." ".$editget."<?php echo JLayoutHelper::render('".ComponentbuilderHelper::safeString($result->alias)."', \$this->items); ?> ".$edit.""; + // list + $layoutString[] = "" . $result->name . " " . $editget . "<?php echo JLayoutHelper::render('" . ComponentbuilderHelper::safeString($result->alias) . "', \$this->items); ?> " . $edit . ""; break; case 3: case 4: - // custom - $result->getcustom = ComponentbuilderHelper::safeString($result->getcustom); - if (substr($result->getcustom, 0, strlen('get')) == 'get') - { - $varName = substr($result->getcustom, strlen('get')); - } - else - { - $varName = $result->getcustom; - } - $layoutString[] = "".$result->name." ".$editget."<?php echo JLayoutHelper::render('".ComponentbuilderHelper::safeString($result->alias)."', \$this->".$varName."); ?> ".$edit.""; + // custom + $result->getcustom = ComponentbuilderHelper::safeString($result->getcustom); + if (substr($result->getcustom, 0, strlen('get')) == 'get') + { + $varName = substr($result->getcustom, strlen('get')); + } + else + { + $varName = $result->getcustom; + } + $layoutString[] = "" . $result->name . " " . $editget . "<?php echo JLayoutHelper::render('" . ComponentbuilderHelper::safeString($result->alias) . "', \$this->" . $varName . "); ?> " . $edit . ""; + break; + default: + // no get + $layoutString[] = "" . JText::_('COM_COMPONENTBUILDER_NONE_SELECTED') . "<?php echo JLayoutHelper::render('" . ComponentbuilderHelper::safeString($result->alias) . "', [?]); ?> " . $edit . ""; break; } } // build the table - $table = '

'.JText::_('COM_COMPONENTBUILDER_LAYOUT_CODE_SNIPPETS').'

'; - $table .= ''; - $table .= ''; - $table .= ''.implode("",$layoutString)."
'.JText::_('COM_COMPONENTBUILDER_TO_ADD_SIMPLY_COPY_AND_PAST_THE_SNIPPET_INTO_YOUR_CODE').'
'.JText::_('COM_COMPONENTBUILDER_NAME_OF_DYNAMICGET').''.JText::_('COM_COMPONENTBUILDER_SNIPPET').'
"; + $table = '

' . JText::_('COM_COMPONENTBUILDER_LAYOUT_CODE_SNIPPETS') . '

'; + $table .= ''; + $table .= ''; + $table .= '' . implode("",$layoutString) . "
' . JText::_('COM_COMPONENTBUILDER_TO_ADD_SIMPLY_COPY_AND_PAST_THE_SNIPPET_INTO_YOUR_CODE') . '
' . JText::_('COM_COMPONENTBUILDER_NAME_OF_DYNAMICGET') . '' . JText::_('COM_COMPONENTBUILDER_SNIPPET') . '
"; } return $table; } diff --git a/componentbuilder.xml b/componentbuilder.xml index 53e07a584..6013ea882 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -1,7 +1,7 @@ COM_COMPONENTBUILDER - 4th February, 2022 + 5th February, 2022 Llewellyn van der Merwe llewellyn@joomlacomponentbuilder.com http://www.joomlacomponentbuilder.com