Release of v3.2.4-beta3

Fix the missing edit button on fields in the related views. Fix the dashboard display. Place the search option back in the use field of the related views. Fix the namespace issue that broken the linker.
This commit is contained in:
2024-09-20 02:59:16 +02:00
parent 112961dabf
commit c103c93e06
14 changed files with 187 additions and 57 deletions

View File

@@ -329,10 +329,11 @@ final class ConfigFieldsets
$field['custom_value']
))
{
// add array if found
if ((strpos((string) $field['custom_value'], '["') !== false)
&& (strpos((string) $field['custom_value'], '"]')
!== false))
// add array or object if found
if (((strpos((string) $field['custom_value'], '["') !== false)
&& (strpos((string) $field['custom_value'], '"]') !== false)) ||
((strpos((string) $field['custom_value'], '{"') !== false)
&& (strpos((string) $field['custom_value'], '"}') !== false)))
{
// load the Global checkin defautls
$this->extensionsparams->add('component', '"' . $fieldName

View File

@@ -154,7 +154,7 @@ final class InputButton implements InputButtonInterface
. "\$button_code_name = \$this->getAttribute('name');";
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " get the input from url";
$addButton[] = Indent::_(3) . "\$app = Factory::getApplication();";
$addButton[] = Indent::_(3) . "\$app = Joomla__"."_39403062_84fb_46e0_bac4_0023f766e827___Power::getApplication();";
$addButton[] = Indent::_(3) . "\$jinput = \$app->input;";
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " get the view name & id";
@@ -181,7 +181,7 @@ final class InputButton implements InputButtonInterface
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " get the return value.";
$addButton[] = Indent::_(4)
. "\$_uri = (string) \Joomla\CMS\Uri\Uri::getInstance();";
. "\$_uri = (string) Joomla__"."_eecc143e_b5cf_4c33_ba4d_97da1df61422___Power::getInstance();";
$addButton[] = Indent::_(4)
. "\$_return = urlencode(base64_encode(\$_uri));";
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
@@ -206,7 +206,7 @@ final class InputButton implements InputButtonInterface
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " get the return value.";
$addButton[] = Indent::_(4)
. "\$_uri = (string) \Joomla\CMS\Uri\Uri::getInstance();";
. "\$_uri = (string) Joomla__"."_eecc143e_b5cf_4c33_ba4d_97da1df61422___Power::getInstance();";
$addButton[] = Indent::_(4)
. "\$_return = urlencode(base64_encode(\$_uri));";
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
@@ -231,7 +231,7 @@ final class InputButton implements InputButtonInterface
. "\$button_label = ucfirst(strtolower(\$button_label));";
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " get user object";
$addButton[] = Indent::_(3) . "\$user = Factory::getApplication()->getIdentity();";
$addButton[] = Indent::_(3) . "\$user = Joomla__"."_39403062_84fb_46e0_bac4_0023f766e827___Power::getApplication()->getIdentity();";
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " only add if user allowed to create " . $fieldData['view'];
// check if the item has permissions.
@@ -272,7 +272,11 @@ final class InputButton implements InputButtonInterface
$addButton[] = Indent::_(4) . "\$script[] = \"";
$addButton[] = Indent::_(5) . "document.addEventListener('DOMContentLoaded', function() {";
$addButton[] = Indent::_(6)
. "document.getElementById('jform_\".\$button_code_name.\"').addEventListener('change', function(e) {";
. "let \".\$button_code_name.\"Field = document.getElementById('jform_\".\$button_code_name.\"');";
$addButton[] = Indent::_(6)
. "if (!\".\$button_code_name.\"Field) { return; }";
$addButton[] = Indent::_(6)
. "\".\$button_code_name.\"Field.addEventListener('change', function(e) {";
$addButton[] = Indent::_(7) . "e.preventDefault();";
$addButton[] = Indent::_(7)
. "let \".\$button_code_name.\"Value = this.value;";
@@ -280,7 +284,7 @@ $addButton[] = Indent::_(4) . "\$script[] = \"";
. "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);";
$addButton[] = Indent::_(6) . "});";
$addButton[] = Indent::_(6)
. "let \".\$button_code_name.\"Value = document.getElementById('jform_\".\$button_code_name.\"').value;";
. "let \".\$button_code_name.\"Value = \".\$button_code_name.\"Field.value;";
$addButton[] = Indent::_(6)
. "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);";
$addButton[] = Indent::_(5) . "});";
@@ -324,7 +328,7 @@ $addButton[] = Indent::_(4) . "\$script[] = \"";
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " Load the needed script.";
$addButton[] = Indent::_(4)
. "\$document = Factory::getApplication()->getDocument();";
. "\$document = Joomla__"."_39403062_84fb_46e0_bac4_0023f766e827___Power::getApplication()->getDocument();";
$addButton[] = Indent::_(4)
. "\$document->addScriptDeclaration(implode(' ',\$script));";
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)

View File

@@ -154,7 +154,7 @@ final class InputButton implements InputButtonInterface
. "\$button_code_name = \$this->getAttribute('name');";
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " get the input from url";
$addButton[] = Indent::_(3) . "\$app = Factory::getApplication();";
$addButton[] = Indent::_(3) . "\$app = Joomla__"."_39403062_84fb_46e0_bac4_0023f766e827___Power::getApplication();";
$addButton[] = Indent::_(3) . "\$jinput = \$app->input;";
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " get the view name & id";
@@ -181,7 +181,7 @@ final class InputButton implements InputButtonInterface
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " get the return value.";
$addButton[] = Indent::_(4)
. "\$_uri = (string) \Joomla\CMS\Uri\Uri::getInstance();";
. "\$_uri = (string) Joomla__"."_eecc143e_b5cf_4c33_ba4d_97da1df61422___Power::getInstance();";
$addButton[] = Indent::_(4)
. "\$_return = urlencode(base64_encode(\$_uri));";
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
@@ -206,7 +206,7 @@ final class InputButton implements InputButtonInterface
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " get the return value.";
$addButton[] = Indent::_(4)
. "\$_uri = (string) \Joomla\CMS\Uri\Uri::getInstance();";
. "\$_uri = (string) Joomla__"."_eecc143e_b5cf_4c33_ba4d_97da1df61422___Power::getInstance();";
$addButton[] = Indent::_(4)
. "\$_return = urlencode(base64_encode(\$_uri));";
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
@@ -231,7 +231,7 @@ final class InputButton implements InputButtonInterface
. "\$button_label = ucfirst(strtolower(\$button_label));";
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " get user object";
$addButton[] = Indent::_(3) . "\$user = Factory::getApplication()->getIdentity();";
$addButton[] = Indent::_(3) . "\$user = Joomla__"."_39403062_84fb_46e0_bac4_0023f766e827___Power::getApplication()->getIdentity();";
$addButton[] = Indent::_(3) . "//" . Line::_(__Line__, __Class__)
. " only add if user allowed to create " . $fieldData['view'];
// check if the item has permissions.
@@ -272,7 +272,11 @@ final class InputButton implements InputButtonInterface
$addButton[] = Indent::_(4) . "\$script[] = \"";
$addButton[] = Indent::_(5) . "document.addEventListener('DOMContentLoaded', function() {";
$addButton[] = Indent::_(6)
. "document.getElementById('jform_\".\$button_code_name.\"').addEventListener('change', function(e) {";
. "let \".\$button_code_name.\"Field = document.getElementById('jform_\".\$button_code_name.\"');";
$addButton[] = Indent::_(6)
. "if (!\".\$button_code_name.\"Field) { return; }";
$addButton[] = Indent::_(6)
. "\".\$button_code_name.\"Field.addEventListener('change', function(e) {";
$addButton[] = Indent::_(7) . "e.preventDefault();";
$addButton[] = Indent::_(7)
. "let \".\$button_code_name.\"Value = this.value;";
@@ -280,7 +284,7 @@ $addButton[] = Indent::_(4) . "\$script[] = \"";
. "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);";
$addButton[] = Indent::_(6) . "});";
$addButton[] = Indent::_(6)
. "let \".\$button_code_name.\"Value = document.getElementById('jform_\".\$button_code_name.\"').value;";
. "let \".\$button_code_name.\"Value = \".\$button_code_name.\"Field.value;";
$addButton[] = Indent::_(6)
. "\".\$button_code_name.\"Button(\".\$button_code_name.\"Value);";
$addButton[] = Indent::_(5) . "});";
@@ -324,7 +328,7 @@ $addButton[] = Indent::_(4) . "\$script[] = \"";
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)
. " Load the needed script.";
$addButton[] = Indent::_(4)
. "\$document = Factory::getApplication()->getDocument();";
. "\$document = Joomla__"."_39403062_84fb_46e0_bac4_0023f766e827___Power::getApplication()->getDocument();";
$addButton[] = Indent::_(4)
. "\$document->addScriptDeclaration(implode(' ',\$script));";
$addButton[] = Indent::_(4) . "//" . Line::_(__Line__, __Class__)

View File

@@ -1588,7 +1588,7 @@ class Infusion extends Interpretation
// DASHBOARDICONACCESS
CFactory::_('Compiler.Builder.Content.Multi')->set(CFactory::_('Config')->component_code_name . '|DASHBOARDICONACCESS',
$this->setDashboardIconAccess()
CFactory::_('Compiler.Builder.Permission.Dashboard')->build()
);
// DASH_MODEL_METHODS

View File

@@ -21424,6 +21424,15 @@ class Interpretation extends Fields
}
public function setDashboardDisplayData()
{
if (CFactory::_('Config')->get('joomla_version', 3) == 3)
{
return $this->setDashboardDisplayDataJ3();
}
return $this->setDashboardDisplayDataJ4();
}
public function setDashboardDisplayDataJ3()
{
// display array reset
$display = [];
@@ -21435,13 +21444,7 @@ class Interpretation extends Fields
$row_class = 'row-fluid';
$form_class = 'form-horizontal';
$uitab = 'bootstrap';
if (CFactory::_('Config')->get('joomla_version', 3) != 3)
{
$width_class = 'col-md-';
$row_class = 'row';
$form_class = 'main-card';
$uitab = 'uitab';
}
// check if we have custom tabs
if (CFactory::_('Component')->isArray('dashboard_tab'))
{
@@ -21574,6 +21577,120 @@ class Interpretation extends Fields
return PHP_EOL . implode(PHP_EOL, $display);
}
public function setDashboardDisplayDataJ4()
{
// display array reset
$display = [];
$mainAccordianName = 'cPanel';
$builder = [];
$tab = Indent::_(3);
$loadTabs = false;
$width_class = 'col-md-';
$row_class = 'row';
$form_class = 'main-card';
$uitab = 'uitab';
// check if we have custom tabs
if (CFactory::_('Component')->isArray('dashboard_tab'))
{
// build the tabs and accordians
foreach (CFactory::_('Component')->get('dashboard_tab') as $data)
{
$builder[$data['name']][$data['header']]
= CFactory::_('Placeholder')->update_(
$data['html']
);
}
// since we have custom tabs we must load the tab structure around the cpanel
$display[] = '<div id="j-main-container">';
$display[] = Indent::_(1) . '<div class="' . $form_class . '">';
$display[] = Indent::_(1)
. "<?php echo Html::_('{$uitab}.startTabSet', 'cpanel_tab', array('active' => 'cpanel')); ?>";
$display[] = PHP_EOL . Indent::_(2)
. "<?php echo Html::_('{$uitab}.addTab', 'cpanel_tab', 'cpanel', Text:"
. ":_('cPanel', true)); ?>";
$display[] = Indent::_(2) . '<div class="' . $row_class . '">';
// change the name of the main tab
$mainAccordianName = 'Control Panel';
$loadTabs = true;
}
else
{
$display[] = '<div id="j-main-container">';
$display[] = Indent::_(1) . '<div class="' . $form_class . '" style="padding: 20px;">';
$display[] = Indent::_(2) . '<div class="' . $row_class . '">';
}
// set dashboard display
$display[] = $tab . '<div class="' . $width_class . '9">';
$display[] = $tab . Indent::_(1)
. "<?php echo \$this->loadTemplate('main');?>";
$display[] = $tab . "</div>";
$display[] = $tab . '<div class="' . $width_class . '3">';
$display[] = $tab . Indent::_(1)
. "<?php echo \$this->loadTemplate('vdm');?>";
$display[] = $tab . "</div>";
if ($loadTabs)
{
$display[] = Indent::_(2) . "</div>";
$display[] = Indent::_(2)
. "<?php echo Html::_('{$uitab}.endTab'); ?>";
// load the new tabs
foreach ($builder as $tabname => $accordians)
{
$alias = StringHelper::safe($tabname);
$display[] = PHP_EOL . Indent::_(2)
. "<?php echo Html::_('{$uitab}.addTab', 'cpanel_tab', '"
. $alias . "', Text:" . ":_('" . $tabname
. "', true)); ?>";
$display[] = Indent::_(2) . '<div class="' . $row_class . '">';
$display[] = $tab . '<div class="' . $width_class . '12">';
$slidecounter = 1;
foreach ($accordians as $accordianname => $html)
{
$ac_alias = StringHelper::safe(
$accordianname
);
$counterName = StringHelper::safe(
$slidecounter
);
$tempName = $alias . '_' . $ac_alias;
$display[] = $tab . Indent::_(1)
. "<?php echo \$this->loadTemplate('" . $tempName
. "');?>";
$slidecounter++;
// build the template file
$target = array('custom_admin' => CFactory::_('Config')->component_code_name);
CFactory::_('Utilities.Structure')->build($target, 'template', $tempName);
// set the file data
$TARGET = StringHelper::safe(
CFactory::_('Config')->build_target, 'U'
);
// SITE_TEMPLATE_BODY <<<DYNAMIC>>>
CFactory::_('Compiler.Builder.Content.Multi')->set(CFactory::_('Config')->component_code_name . '_' . $tempName . '|CUSTOM_ADMIN_TEMPLATE_BODY', PHP_EOL . $html);
// SITE_TEMPLATE_CODE_BODY <<<DYNAMIC>>>
CFactory::_('Compiler.Builder.Content.Multi')->set(CFactory::_('Config')->component_code_name . '_' . $tempName . '|CUSTOM_ADMIN_TEMPLATE_CODE_BODY', '');
}
$display[] = $tab . "</div>";
$display[] = Indent::_(2) . "</div>";
$display[] = Indent::_(2)
. "<?php echo Html::_('{$uitab}.endTab'); ?>";
}
$display[] = PHP_EOL . Indent::_(1)
. "<?php echo Html::_('{$uitab}.endTabSet'); ?>";
}
else
{
$display[] = Indent::_(2) . "</div>";
}
$display[] = Indent::_(1) . "</div>";
$display[] = "</div>";
// return the display
return PHP_EOL . implode(PHP_EOL, $display);
}
public function addCustomDashboardIcons(&$view, &$counter)
{
$icon = '';

View File

@@ -492,7 +492,7 @@ class Power implements PowerInterface
$this->active[$guid]->file_name = array_pop($src_array);
// namespace array
$namespace_array = [...$path_array, ...$src_array];
$namespace_array = array_merge($path_array, $src_array);
}
else
{
@@ -534,12 +534,12 @@ class Power implements PowerInterface
// set the actual class namespace
$this->active[$guid]->_namespace = implode('\\', $namespace_array);
// set global namespaces for autoloader
$this->namespace[implode('.', $path_array)] = $path_array;
// get the parent folder (the first value in array)
$prefix_folder = implode('.', $path_array);
// set global namespaces for autoloader
$this->namespace[$prefix_folder] = $path_array;
// make sub folders if still found
$sub_folder = '';
if (ArrayHelper::check($src_array))