Stable release of v3.2.0-beta5

Add custom file file mapping for Joomla 4 and 5.
This commit is contained in:
Robot 2024-03-09 21:41:29 +02:00
parent 5675f186cd
commit 91e922b993
Signed by untrusted user: Robot
GPG Key ID: 14DECD44E7E1BB95
28 changed files with 207 additions and 93 deletions

View File

@ -1,3 +1,7 @@
# v3.2.0-beta5
- Add custom file file mapping for Joomla 4 and 5
# v3.2.0-beta4
- Add Preferred Joomla Version to Components

View File

@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo
Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have!
You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.2.0-beta4) with **ALL** its features and **ALL** concepts totally open-source and free!
You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.2.0-beta5) with **ALL** its features and **ALL** concepts totally open-source and free!
> Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
@ -144,13 +144,13 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 7th March, 2024
+ *Version*: 3.2.0-beta4
+ *Last Build*: 9th March, 2024
+ *Version*: 3.2.0-beta5
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **741812**
+ *Line count*: **742015**
+ *Field count*: **2078**
+ *File count*: **5204**
+ *File count*: **5205**
+ *Folder count*: **462**
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com).

View File

@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo
Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have!
You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.2.0-beta4) with **ALL** its features and **ALL** concepts totally open-source and free!
You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (3.2.0-beta5) with **ALL** its features and **ALL** concepts totally open-source and free!
> Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45)
@ -144,13 +144,13 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder)
+ *First Build*: 30th April, 2015
+ *Last Build*: 7th March, 2024
+ *Version*: 3.2.0-beta4
+ *Last Build*: 9th March, 2024
+ *Version*: 3.2.0-beta5
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **741812**
+ *Line count*: **742015**
+ *Field count*: **2078**
+ *File count*: **5204**
+ *File count*: **5205**
+ *Folder count*: **462**
> This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](https://www.joomlacomponentbuilder.com).

View File

@ -141,7 +141,7 @@ class HtmlView extends BaseHtmlView
* @since 1.6
*/
protected function _prepareDocument(): void
{
{###JQUERY###
$this->getDocument()->setTitle(Text::_('COM_###COMPONENT###_###VIEWS###'));
// add styles
foreach ($this->styles as $style)

View File

@ -126,7 +126,7 @@ class HtmlView extends BaseHtmlView
* @since 1.6
*/
protected function _prepareDocument(): void
{
{###JQUERY###
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_###COMPONENT###_###VIEW###_NEW' : 'COM_###COMPONENT###_###VIEW###_EDIT'));
// add styles

View File

@ -28,7 +28,7 @@ namespace ###NAMESPACEPREFIX###\Component\###ComponentNameSpace###\Site\View\###
class HtmlView extends BaseHtmlView
{
/**
* Display the view
* ###View### view display method
*
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
*
@ -42,8 +42,9 @@ class HtmlView extends BaseHtmlView
// Assign the variables
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$this->script = $this->get('Script');
$this->state = $this->get('State');
$this->styles = $this->get('Styles');
$this->scripts = $this->get('Scripts');
// get action permissions
$this->canDo = ###Component###Helper::getActions('###view###', $this->item);
// get input
@ -93,9 +94,8 @@ class HtmlView extends BaseHtmlView
* @since 1.6
*/
protected function addToolbar(): void
{###ADDTOOLBAR###
// now initiate the toolbar
$this->toolbar = Toolbar::getInstance();
{
###ADDTOOLBAR###
}
/**
@ -125,14 +125,18 @@ class HtmlView extends BaseHtmlView
* @since 1.6
*/
protected function _prepareDocument(): void
{
{###JQUERY###
$isNew = ($this->item->id < 1);
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_###COMPONENT###_###VIEW###_NEW' : 'COM_###COMPONENT###_###VIEW###_EDIT'));
// the default style of this view
Html::_('stylesheet', "components/com_###component###/assets/css/###view###.css", ['version' => 'auto']);###AJAXTOKE######LINKEDVIEWTABLESCRIPTS###
// default javascript of this view
Html::_('script', $this->script, ['version' => 'auto']);
Html::_('script', "components/com_###component###/views/###view###/submitbutton.js", ['version' => 'auto']);###DOCUMENT_CUSTOM_PHP###
Text::script('view not acceptable. Error');
// add styles
foreach ($this->styles as $style)
{
Html::_('stylesheet', $style, ['version' => 'auto']);
}###AJAXTOKE######LINKEDVIEWTABLESCRIPTS###
// add scripts
foreach ($this->scripts as $script)
{
Html::_('script', $script, ['version' => 'auto']);
}###DOCUMENT_CUSTOM_PHP###
}
}

View File

@ -1335,7 +1335,6 @@ COM_COMPONENTBUILDER_BECOME_A_CONTRIBUTOR="Become a Contributor"
COM_COMPONENTBUILDER_BEHAVIOUR="Behaviour"
COM_COMPONENTBUILDER_BEHIND="Behind"
COM_COMPONENTBUILDER_BEHIND_MEANS_YOUR_BLOCAL_SNIPPETB_WITH_THE_SAME_NAME_LIBRARY_AND_TYPE_HAS_A_BOLDER_MODIFIED_DATEB_THEN_THE_COMMUNITY_SNIPPET_WITH_THE_SAME_NAME_LIBRARY_AND_TYPE="Behind means your <b>local snippet</b> (with the same name, library and type) has a <b>older modified date</b> then the community snippet (with the same name, library and type)."
COM_COMPONENTBUILDER_BETA_RELEASE="Beta Release"
COM_COMPONENTBUILDER_BE_A_PART_OF_JCB="Be a Part of JCB"
COM_COMPONENTBUILDER_BE_CAUTIOUS_DO_NOT_CONTINUE_UNLESS_YOU_TRUST_THE_ORIGIN_OF_THIS_PACKAGE="Be cautious! Do not continue unless you trust the origin of this package!"
COM_COMPONENTBUILDER_BFIELD_TYPEB_IDS_MISMATCH_IN_BSB="<b>Field type</b> id:%s mismatch in <b>%s</b>."
@ -7862,6 +7861,7 @@ COM_COMPONENTBUILDER_POWER_VERSION_DESC="A count of the number of times this Pow
COM_COMPONENTBUILDER_POWER_VERSION_LABEL="Version"
COM_COMPONENTBUILDER_POWER_YES="Yes"
COM_COMPONENTBUILDER_PPOWER_BGUIDSB_NOT_FOUNDP="<p>Power <b>guid:%s</b> not found!</p>"
COM_COMPONENTBUILDER_PRE_RELEASE="Pre Release"
COM_COMPONENTBUILDER_PROPERTIES="Properties"
COM_COMPONENTBUILDER_PROPERTIESBR_SMALLHERE_YOU_CAN_SET_THE_PROPERTIES_FOR_THIS_FIELDSMALL="Properties<br /><small>Here you can set the properties for this field.</small>"
COM_COMPONENTBUILDER_PROPERTY="Property"

View File

@ -24,11 +24,11 @@ use Joomla\CMS\Layout\LayoutHelper;
<?php echo Html::_('bootstrap.startTabSet', $displayData['id'] . '_tab', array('active' => $displayData['active'] . '-noticeboard')); ?>
<?php echo Html::_('bootstrap.addTab', $displayData['id'] . '_tab', 'vdm-noticeboard', Text::_('COM_COMPONENTBUILDER_VDM_BOARD', true)); ?>
<?php echo LayoutHelper::render('jcbnoticeboardvdm', null); ?>
<div><?php echo ComponentbuilderHelper::getDynamicContent('banner', '728-90'); ?></div>
<div class="p-md-3"><?php echo ComponentbuilderHelper::getDynamicContent('banner', '728-90'); ?></div>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.addTab', $displayData['id'] . '_tab', 'pro-noticeboard', Text::_('COM_COMPONENTBUILDER_JCB_PRO_BOARD', true)); ?>
<?php echo LayoutHelper::render('jcbnoticeboardpro', null); ?>
<div><?php echo ComponentbuilderHelper::getDynamicContent('banner', '728-90'); ?></div>
<div class="p-md-3"><?php echo ComponentbuilderHelper::getDynamicContent('banner', '728-90'); ?></div>
<?php echo Html::_('bootstrap.endTab'); ?>
<?php echo Html::_('bootstrap.endTabSet'); ?>
</div>

View File

@ -21,11 +21,12 @@ use VDM\Joomla\Utilities\StringHelper;
$table_id = (isset($displayData['id'])) ? $displayData['id'] : StringHelper::random(7);
$name = (isset($displayData['name'])) ? $displayData['name'] : false;
$table_class = (isset($displayData['table_class'])) ? $displayData['table_class'] : 'uk-table';
$table_container_class = (isset($displayData['table_container_class'])) ? $displayData['table_container_class'] : 'uk-overflow-auto';
$headers = (isset($displayData['headers'])) ? $displayData['headers'] : [Text::_('COM_COMPONENTBUILDER_NO'), Text::_('COM_COMPONENTBUILDER_HEADERS'), Text::_('COM_COMPONENTBUILDER_FOUND')];
$items = (isset($displayData['items'])) ? $displayData['items'] : 6;
?>
<div class="uk-overflow-auto">
<div class="<?php echo $$table_container_class; ?>">
<table id="<?php echo $table_id; ?>" class="<?php echo $table_class; ?>">
<thead>
<?php if (is_array($headers)): ?>

View File

@ -321,7 +321,7 @@ class ComponentbuilderModelAjax extends ListModel
// now check if this version is out dated
if ($current_version === $local_version)
{
return ['notice' => '<small><span style="color:green;"><span class="icon-shield"></span>' . Text::_('COM_COMPONENTBUILDER_UP_TO_DATE') . '</span></small>'];
return ['notice' => '<small><span style="color:green;"><span class="icon-shield"></span>&nbsp;' . Text::_('COM_COMPONENTBUILDER_UP_TO_DATE') . '</span></small>'];
}
else
{
@ -332,14 +332,14 @@ class ComponentbuilderModelAjax extends ListModel
($local_array[0] == $current_array[0] && $local_array[1] > $current_array[1]) ||
($local_array[0] == $current_array[0] && $local_array[1] == $current_array[1] && $local_array[2] > $current_array[2]))
{
return ['notice' => '<small><span style="color:#F7B033;"><span class="icon-wrench"></span>' . Text::_('COM_COMPONENTBUILDER_BETA_RELEASE') . '</span></small>'];
return ['notice' => '<small><span style="color:#F7B033;"><span class="icon-wrench"></span>&nbsp;' . Text::_('COM_COMPONENTBUILDER_PRE_RELEASE') . '</span></small>'];
}
else
{
// download link of the latest version
$download = "https://git.vdm.dev/api/v1/repos/joomla/Component-Builder/archive/" . $tags[0]->name . ".zip";
return ['notice' => '<small><span style="color:red;"><span class="icon-warning-circle"></span>' . Text::_('COM_COMPONENTBUILDER_OUT_OF_DATE') . '!</span> <a style="color:green;" href="' .
return ['notice' => '<small><span style="color:red;"><span class="icon-warning-circle"></span>&nbsp;' . Text::_('COM_COMPONENTBUILDER_OUT_OF_DATE') . '!</span> <a style="color:green;" href="' .
$download . '" title="' . Text::_('COM_COMPONENTBUILDER_YOU_CAN_DIRECTLY_DOWNLOAD_THE_LATEST_UPDATE_OR_USE_THE_JOOMLA_UPDATE_AREA') . '">' . Text::_('COM_COMPONENTBUILDER_DOWNLOAD_UPDATE') . '!</a></small>'];
}
}

View File

@ -40,14 +40,14 @@ class JFormFieldDbtables extends JFormFieldList
protected function getOptions()
{
// get db object
$db = JFactory::getDBO();
$db = Factory::getDBO();
// get all tables
$tables= $db->getTableList();
// get config
$config = JFactory::getConfig();
$dbprefix = version_compare(JVERSION,'3.0','lt') ? $config->getValue('config.dbprefix') : $config->get('dbprefix');
$config = Factory::getConfig();
$dbprefix = \version_compare(JVERSION,'3.0','lt') ? $config->getValue('config.dbprefix') : $config->get('dbprefix');
$options = array();
$options[] = JHtml::_('select.option', '', 'Select an option');
$options[] = Html::_('select.option', '', 'Select an option');
for ($i=0; $i < count($tables); $i++)
{
//only tables with primary key
@ -55,7 +55,7 @@ class JFormFieldDbtables extends JFormFieldList
if ($db->loadResult())
{
$key = $i+1;
$options[$key] = new stdClass;
$options[$key] = new \stdClass;
$options[$key]->value = str_replace($dbprefix, '', $tables[$i]);
$options[$key]->text = $tables[$i];
}

View File

@ -961,7 +961,8 @@ class ComponentbuilderModelJoomla_component extends AdminModel
'component_dashboard' => 'joomla_component',
'component_files_folders' => 'joomla_component',
'component_placeholders' => 'joomla_component',
'custom_code' => 'component'
'custom_code' => 'component',
'component_router' => 'joomla_component'
);
foreach($_tablesArray as $_updateTable => $_key)
{
@ -1010,7 +1011,8 @@ class ComponentbuilderModelJoomla_component extends AdminModel
'component_dashboard' => 'joomla_component',
'component_files_folders' => 'joomla_component',
'component_placeholders' => 'joomla_component',
'custom_code' => 'component'
'custom_code' => 'component',
'component_router' => 'joomla_component'
);
foreach($_tablesArray as $_updateTable => $_key)
{

View File

@ -326,7 +326,7 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_power` (
`add_head` TINYINT(1) NOT NULL DEFAULT 0,
`add_licensing_template` TINYINT(1) NOT NULL DEFAULT 1,
`approved` TINYINT(1) NOT NULL DEFAULT 0,
`approved_paths` TEXT NOT NULL,
`approved_paths` TEXT NULL,
`composer` TEXT NULL,
`description` TEXT NULL,
`extends` VARCHAR(36) NOT NULL DEFAULT '',
@ -1177,11 +1177,11 @@ CREATE TABLE IF NOT EXISTS `#__componentbuilder_fieldtype` (
CREATE TABLE IF NOT EXISTS `#__componentbuilder_language_translation` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`asset_id` INT(10) unsigned NOT NULL DEFAULT 0 COMMENT 'FK to the #__assets table.',
`components` TEXT NOT NULL,
`modules` TEXT NOT NULL,
`plugins` TEXT NOT NULL,
`components` TEXT NULL,
`modules` TEXT NULL,
`plugins` TEXT NULL,
`source` MEDIUMTEXT NOT NULL,
`translation` TEXT NOT NULL,
`translation` TEXT NULL,
`params` text NULL,
`published` TINYINT(3) NOT NULL DEFAULT 1,
`created_by` INT(10) unsigned NOT NULL DEFAULT 0,
@ -2528,7 +2528,8 @@ INSERT INTO `#__componentbuilder_library_files_folders_urls` (`id`, `addfiles`,
(8, '{}', '{}', '{\"addurls2\":{\"url\":\"https:\\/\\/cdn.datatables.net\\/1.10.21\\/js\\/jquery.dataTables.min.js\",\"type\":2},\"addurls1\":{\"url\":\"https:\\/\\/cdn.datatables.net\\/1.10.21\\/css\\/dataTables.uikit.min.css\",\"type\":2}}', 11, '', 1, '2020-06-27 21:34:44', '0000-00-00 00:00:00', 1, '', 7),
(9, '{}', '{}', '{\"addurls3\":{\"url\":\"http:\\/\\/code.jquery.com\\/ui\\/1.11.1\\/themes\\/smoothness\\/jquery-ui.css\",\"type\":2},\"addurls0\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/jquery-ui-timepicker-addon\\/1.6.3\\/jquery-ui-timepicker-addon.min.css\",\"type\":2},\"addurls1\":{\"url\":\"http:\\/\\/code.jquery.com\\/ui\\/1.11.1\\/jquery-ui.min.js\",\"type\":2},\"addurls2\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/jquery-ui-timepicker-addon\\/1.6.3\\/jquery-ui-timepicker-addon.min.js\",\"type\":2}}', 12, '', 1, '2020-06-29 00:00:44', '2020-06-29 04:32:57', 4, '', 8),
(10, '{}', '{}', '{\"addurls0\":{\"url\":\"https:\\/\\/cdn.datatables.net\\/v\\/dt\\/jszip-2.5.0\\/dt-1.11.5\\/b-2.2.2\\/b-colvis-2.2.2\\/b-html5-2.2.2\\/b-print-2.2.2\\/cr-1.5.5\\/date-1.1.2\\/fc-4.0.2\\/fh-3.2.2\\/kt-2.6.4\\/r-2.2.9\\/rg-1.1.4\\/rr-1.2.8\\/sc-2.0.5\\/sb-1.3.2\\/sp-2.0.0\\/sl-1.3.4\\/sr-1.1.0\\/datatables.min.css\",\"type\":3},\"addurls1\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/pdfmake\\/0.1.36\\/pdfmake.min.js\",\"type\":3},\"addurls2\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/pdfmake\\/0.1.36\\/vfs_fonts.js\",\"type\":3},\"addurls3\":{\"url\":\"https:\\/\\/cdn.datatables.net\\/v\\/dt\\/jszip-2.5.0\\/dt-1.11.5\\/b-2.2.2\\/b-colvis-2.2.2\\/b-html5-2.2.2\\/b-print-2.2.2\\/cr-1.5.5\\/date-1.1.2\\/fc-4.0.2\\/fh-3.2.2\\/kt-2.6.4\\/r-2.2.9\\/rg-1.1.4\\/rr-1.2.8\\/sc-2.0.5\\/sb-1.3.2\\/sp-2.0.0\\/sl-1.3.4\\/sr-1.1.0\\/datatables.min.js\",\"type\":3}}', 13, '', 1, '2022-10-17 20:56:24', '0000-00-00 00:00:00', 1, '', 9),
(11, '{}', '{}', '{\"addurls0\":{\"url\":\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/nouislider\\/dist\\/nouislider.min.css\",\"type\":2},\"addurls1\":{\"url\":\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/nouislider\\/dist\\/nouislider.min.js\",\"type\":2}}', 14, '', 1, '2023-06-26 15:02:42', '2023-07-24 18:11:41', 3, '', 10);
(11, '{}', '{}', '{\"addurls0\":{\"url\":\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/nouislider\\/dist\\/nouislider.min.css\",\"type\":2},\"addurls1\":{\"url\":\"https:\\/\\/cdn.jsdelivr.net\\/npm\\/nouislider\\/dist\\/nouislider.min.js\",\"type\":2}}', 14, '', 1, '2023-06-26 15:02:42', '2023-07-24 18:11:41', 3, '', 10),
(12, '{}', '{}', '{\"addurls4\":{\"url\":\"https:\\/\\/cdn.datatables.net\\/v\\/bs5\\/jszip-3.10.1\\/dt-2.0.2\\/b-3.0.1\\/b-colvis-3.0.1\\/b-html5-3.0.1\\/b-print-3.0.1\\/cr-2.0.0\\/date-1.5.2\\/fc-5.0.0\\/fh-4.0.1\\/kt-2.12.0\\/r-3.0.0\\/rg-1.5.0\\/rr-1.5.0\\/sc-2.4.1\\/sb-1.7.0\\/sp-2.3.0\\/sl-2.0.0\\/sr-1.4.0\\/datatables.min.css\",\"type\":3},\"addurls1\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/pdfmake\\/0.2.7\\/pdfmake.min.js\",\"type\":3},\"addurls2\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/pdfmake\\/0.2.7\\/vfs_fonts.js\",\"type\":3},\"addurls3\":{\"url\":\"https:\\/\\/cdn.datatables.net\\/v\\/bs5\\/jszip-3.10.1\\/dt-2.0.2\\/b-3.0.1\\/b-colvis-3.0.1\\/b-html5-3.0.1\\/b-print-3.0.1\\/cr-2.0.0\\/date-1.5.2\\/fc-5.0.0\\/fh-4.0.1\\/kt-2.12.0\\/r-3.0.0\\/rg-1.5.0\\/rr-1.5.0\\/sc-2.4.1\\/sb-1.7.0\\/sp-2.3.0\\/sl-2.0.0\\/sr-1.4.0\\/datatables.min.js\",\"type\":3}}', 15, '', 1, '2024-03-09 16:27:28', '2024-03-09 16:29:30', 2, '', 9);
CREATE TABLE IF NOT EXISTS `#__componentbuilder_external_code` (

View File

@ -0,0 +1 @@
ALTER TABLE `#__componentbuilder_joomla_component` ADD `preferred_joomla_version` INT(11) NOT NULL DEFAULT 3 AFTER `php_site_event`;

View File

@ -657,7 +657,7 @@ class ComponentbuilderViewCompiler extends HtmlView
// add the document default css file
Html::_('stylesheet', 'administrator/components/com_componentbuilder/assets/css/compiler.css', ['version' => 'auto']);
// Set the Custom JS script to view
$this->document->addScriptDeclaration("
$this->getDocument()->addScriptDeclaration("
function getComponentDetails_server(id) {
let getUrl = JRouter(\"index.php?option=com_componentbuilder&task=ajax.getComponentDetails&format=json&raw=true\");
let request = new URLSearchParams();

View File

@ -215,9 +215,9 @@ class ComponentbuilderViewJoomla_component extends HtmlView
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/lightbox.min.js', ['version' => 'auto']);
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/components/notify.min.js', ['version' => 'auto']);
// add var key
$this->document->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
$this->getDocument()->addScriptDeclaration("var vastDevMod = '" . $this->get('VDM') . "';");
// add return_here
$this->document->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) \JUri::getInstance())) . "';");
$this->getDocument()->addScriptDeclaration("var return_here = '" . urlencode(base64_encode((string) \JUri::getInstance())) . "';");
Text::script('view not acceptable. Error');
}

View File

@ -17,11 +17,12 @@ use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
use VDM\Joomla\Utilities\ArrayHelper;
Html::addIncludePath(JPATH_COMPONENT.'/helpers/html');
Html::_('behavior.formvalidator');
Html::_('formbehavior.chosen', 'select');
Html::_('behavior.keepalive');
use Joomla\CMS\Session\Session;
use VDM\Joomla\Utilities\ArrayHelper;
// allow main menu selection
$this->app->input->set('hidemainmenu', false);
@ -159,7 +160,7 @@ $search_value = $this->form->getField('search_value');
const searchTables = <?php echo json_encode($this->item['tables']); ?>;
// the search Ajax URLs
const UrlAjax = '<?php echo $url_base; ?>&format=json&raw=true&<?php echo \JSession::getFormToken(); ?>=1&task=ajax.';
const UrlAjax = '<?php echo $url_base; ?>&format=json&raw=true&<?php echo Session::getFormToken(); ?>=1&task=ajax.';
// the search URL
const UrlSearch = '<?php echo $url_search; ?>';

View File

@ -24,6 +24,7 @@ use Joomla\CMS\Filesystem\File;
use VDM\Joomla\Componentbuilder\Search\Factory as SearchFactory;
use Joomla\CMS\Form\Form;
use VDM\Joomla\Utilities\ArrayHelper;
use VDM\Joomla\Utilities\FormHelper;
use VDM\Joomla\Utilities\StringHelper;
/**
@ -149,7 +150,7 @@ class ComponentbuilderViewSearch extends HtmlView
2 => 'COM_COMPONENTBUILDER_REPLACE',
0 => 'COM_COMPONENTBUILDER_CLEAR'];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes, $options);
$xml = FormHelper::xml($attributes, $options);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'search');
@ -170,7 +171,7 @@ class ComponentbuilderViewSearch extends HtmlView
'autocomplete' => true,
'default' => $this->urlvalues['search_value']];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes);
$xml = FormHelper::xml($attributes);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'search');
@ -192,7 +193,7 @@ class ComponentbuilderViewSearch extends HtmlView
'showon' => 'type_search:2',
'default' => $this->urlvalues['replace_value']];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes);
$xml = FormHelper::xml($attributes);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'search');
@ -227,7 +228,7 @@ class ComponentbuilderViewSearch extends HtmlView
'whole_word' => 'COM_COMPONENTBUILDER_WHOLE_WORD',
'regex_search' => 'COM_COMPONENTBUILDER_REGEX_SEARCH'];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes, $options);
$xml = FormHelper::xml($attributes, $options);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'settings');
@ -253,7 +254,7 @@ class ComponentbuilderViewSearch extends HtmlView
$options[(int) $component->id] = $this->escape($component->name);
}
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes, $options);
$xml = FormHelper::xml($attributes, $options);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'settings');
@ -277,7 +278,7 @@ class ComponentbuilderViewSearch extends HtmlView
$options[$table] = $this->escape($table);
}
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes, $options);
$xml = FormHelper::xml($attributes, $options);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'settings');
@ -296,7 +297,7 @@ class ComponentbuilderViewSearch extends HtmlView
'filter' => 'raw',
'editor' => 'codemirror|none'];
// add to form
$xml = ComponentbuilderHelper::getFieldXML($attributes, $options);
$xml = FormHelper::xml($attributes, $options);
if ($xml instanceof SimpleXMLElement)
{
$form->setField($xml, null, true, 'view');

View File

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.10" method="upgrade">
<name>COM_COMPONENTBUILDER</name>
<creationDate>7th March, 2024</creationDate>
<creationDate>9th March, 2024</creationDate>
<author>Llewellyn van der Merwe</author>
<authorEmail>joomla@vdm.io</authorEmail>
<authorUrl>https://dev.vdm.io</authorUrl>
<copyright>Copyright (C) 2015 Vast Development Method. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<version>3.2.0-beta4</version>
<version>3.2.0-beta5</version>
<description><![CDATA[
<h1>Component Builder (v.3.2.0-beta4)</h1>
<h1>Component Builder (v.3.2.0-beta5)</h1>
<div style="clear: both;"></div>
<p>The Component Builder for [Joomla](https://extensions.joomla.org/extension/component-builder/) is highly advanced tool that is truly able to build extremely complex components in a fraction of the time.

View File

@ -1595,4 +1595,22 @@
<maintainerurl>https://dev.vdm.io</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
<update>
<name>Component Builder</name>
<description>Builds Complex Joomla Components</description>
<element>pkg_component_builder</element>
<type>package</type>
<client>site</client>
<version>3.2.0-beta5</version>
<infourl title="Component Builder!">https://dev.vdm.io</infourl>
<downloads>
<downloadurl type="full" format="zip">https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v3.2.0-beta5.zip</downloadurl>
</downloads>
<tags>
<tag>beta</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>https://dev.vdm.io</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
</update>
</updates>

View File

@ -645,21 +645,48 @@ final class CustomFieldTypeFile
$core_fields = $this->corefield->get();
$extends = $this->extends;
$found = null;
foreach ($core_fields as $core_field)
{
$field = strtolower((string) $core_field);
if ($extends === $field)
{
$this->fieldmap[$extends] = $core_field;
return $core_field;
$found = $core_field;
break;
}
}
$this->fieldmap[$extends] = StringHelper::safe($extends, 'F');
$extends = $found ?? StringHelper::safe($extends, 'F');
return $this->fieldmap[$extends];
if ($this->config->get('joomla_version', 3) != 3)
{
$fix = strtolower($extends);
if ('checkboxes' === $fix)
{
$extends = 'CheckboxesField';
}
elseif ('list' === $fix)
{
$extends = 'FormField';
}
elseif ('radio' === $fix)
{
$extends = 'RadioField';
}
elseif ('combo' === $fix)
{
$extends = 'ComboField';
}
elseif (strpos($extends, 'Field') === false)
{
$extends = StringHelper::safe($extends, 'F') . 'Field';
}
}
$this->fieldmap[$this->extends] = $extends;
return $extends;
}
/**

View File

@ -600,6 +600,13 @@ class Infusion extends Interpretation
)
);
// AJAXTOKE <<<DYNAMIC>>>
CFactory::_('Compiler.Builder.Content.Multi')->set($nameSingleCode . '|AJAXTOKE',
$this->setAjaxToke(
$nameSingleCode
)
);
// add css to front end
if (isset($view['edit_create_site_view'])
&& is_numeric($view['edit_create_site_view'])
@ -681,6 +688,13 @@ class Infusion extends Interpretation
)
);
// JQUERY <<<DYNAMIC>>>
CFactory::_('Compiler.Builder.Content.Multi')->set($nameSingleCode . '|JQUERY',
$this->setJquery(
$nameSingleCode
)
);
// Trigger Event: jcb_ce_onAfterBuildAdminEditViewContent
CFactory::_('Event')->trigger(
'jcb_ce_onAfterBuildAdminEditViewContent',[&$view, &$nameSingleCode, &$nameListCode]
@ -1015,6 +1029,13 @@ class Infusion extends Interpretation
)
);
// JQUERY <<<DYNAMIC>>>
CFactory::_('Compiler.Builder.Content.Multi')->set($nameListCode . '|JQUERY',
$this->setJquery(
$nameSingleCode
)
);
// Trigger Event: jcb_ce_onAfterBuildAdminListViewContent
CFactory::_('Event')->trigger(
'jcb_ce_onAfterBuildAdminListViewContent', [&$view, &$nameSingleCode, &$nameListCode]

View File

@ -5654,7 +5654,7 @@ class Interpretation extends Fields
. " Add the needed Javascript to insure that the buttons work.";
$script[] = Indent::_(2) . "Html::_('behavior.framework', true);";
$script[] = Indent::_(2)
. "\$this->document->addScriptDeclaration(\"Joomla.submitbutton = function(task){if (task == ''){ return false; } else { Joomla.submitform(task); return true; }}\");";
. "\$this->getDocument()->addScriptDeclaration(\"Joomla.submitbutton = function(task){if (task == ''){ return false; } else { Joomla.submitform(task); return true; }}\");";
// return the script
return PHP_EOL . implode(PHP_EOL, $script);
@ -5780,7 +5780,7 @@ class Interpretation extends Fields
$script = PHP_EOL . Indent::_(2) . "//" . Line::_(
__LINE__,__CLASS__
) . " Set the Custom JS script to view" . PHP_EOL
. Indent::_(2) . '$this->document->addScriptDeclaration("';
. Indent::_(2) . '$this->getDocument()->addScriptDeclaration("';
$jsDocument = PHP_EOL . Indent::_(3) . str_replace(
'"', '\"', implode(
PHP_EOL . Indent::_(3),
@ -17760,6 +17760,19 @@ class Interpretation extends Fields
return $methods;
}
public function setJquery(&$view)
{
$addJQuery = '';
if (true) // TODO we just add it everywhere for now.
{
$addJQuery .= PHP_EOL . Indent::_(2) . "//" . Line::_(__Line__, __Class__)
. " Load jQuery";
$addJQuery .= PHP_EOL . Indent::_(2) . "Html::_('jquery.framework');";
}
return $addJQuery;
}
/**
* build filter functions
*

View File

@ -73,7 +73,7 @@ final class Load
{
return $this->model->value(
$this->load->value(
["a.${field}" => $field],
["a.{$field}" => $field],
['a' => 'power'],
$this->prefix($keys)
),

View File

@ -55,10 +55,9 @@ class Insert implements InsertInterface
/**
* Database object to query local DB
*
* @var \JDatabaseDriver
* @since 3.2.0
**/
protected \JDatabaseDriver $db;
protected $db;
/**
* Constructor
@ -66,17 +65,16 @@ class Insert implements InsertInterface
* @param Config|null $config The search config object.
* @param Table|null $table The search table object.
* @param Model|null $model The search get model object.
* @param \JDatabaseDriver|null $db The database object.
*
* @since 3.2.0
*/
public function __construct(?Config $config = null, ?Table $table = null,
?Model $model = null, ?\JDatabaseDriver $db = null)
?Model $model = null)
{
$this->config = $config ?: Factory::_('Config');
$this->table = $table ?: Factory::_('Table');
$this->model = $model ?: Factory::_('Insert.Model');
$this->db = $db ?: JoomlaFactory::getDbo();
$this->db = JoomlaFactory::getDbo();
}
/**

View File

@ -119,13 +119,35 @@ class Load extends Model implements ModelInterface
*/
protected function validateAfter(&$value, ?string $field = null, ?string $table = null): bool
{
// Start note to self
// Yes we don't search in the field->xml (field) PHP because the xml is messy
// first of all we need to change that storage method :((( seriously
// and the actual PHP is stored in the xml as base64 with a [__.o0=base64=Oo.__] key in front of it
// if I can go back and drag you around by your ear... I will, but okay you did not know better.
// Listen you have tried to fix this a few times already (I lost count) and by the time you realize how it works
// two hours have been wasted, and you usually only then realize why it's not fixed in the first place... o boy... just walk now!
// since unless you have three days don't even look further, this is a huge issue/mess
// and while I agree it needs fixing, it will not take a few hours... but days
// End note to self
// check values
if (StringHelper::check($value) || ArrayHelper::check($value, true))
{
return true;
}
// remove empty values
return false;
// Start another note to self
// If you're still here
// the problem is not opening the PHP in the xml,
// it is storing it with the updated changes... if any are made via the search-update methods
// so the only way to fix this is to change the whole way the xml values in the field table is stored.
// Yes, that is right... all the way back to the field view... and then to update all places you open that xml values
// and get the values out of the xml string and use them, and if you've forgotten, that is nearly everywhere,
// and so let the refactoring of the foundation begin... there I saved you another 3 hours.
// End another note to self
}
/**

View File

@ -75,9 +75,9 @@ abstract class FormHelper
// element was not returned
return;
}
switch (get_class($node))
if ($node instanceof \stdClass)
{
case 'stdClass':
if (property_exists($node, 'comment'))
{
self::comment($xml, $node->comment);
@ -86,13 +86,13 @@ abstract class FormHelper
{
self::append($xml, $node->fieldXML);
}
break;
case 'SimpleXMLElement':
}
elseif ($node instanceof \SimpleXMLElement)
{
$domXML = \dom_import_simplexml($xml);
$domNode = \dom_import_simplexml($node);
$domXML->appendChild($domXML->ownerDocument->importNode($domNode, true));
$xml = \simplexml_import_dom($domXML);
break;
}
}
@ -127,7 +127,7 @@ abstract class FormHelper
{
foreach ($attributes as $key => $value)
{
$xml->addAttribute($key, $value);
$xml->addAttribute($key, $value ?? '');
}
}
@ -145,7 +145,7 @@ abstract class FormHelper
foreach ($options as $key => $value)
{
$addOption = $xml->addChild('option');
$addOption->addAttribute('value', $key);
$addOption->addAttribute('value', $key ?? '');
$addOption[] = $value;
}
}

View File

@ -9618,7 +9618,7 @@ class Com_ComponentbuilderInstallerScript
echo '<div style="background-color: #fff;" class="alert alert-info"><a target="_blank" href="https://dev.vdm.io" title="Component Builder">
<img src="components/com_componentbuilder/assets/images/vdm-component.jpg"/>
</a>
<h3>Upgrade to Version 3.2.0-beta4 Was Successful! Let us know if anything is not working as expected.</h3></div>';
<h3>Upgrade to Version 3.2.0-beta5 Was Successful! Let us know if anything is not working as expected.</h3></div>';
// Set db if not set already.
if (!isset($db))