Stable release of v3.2.0-beta1

Move beta to main repo. Fix #1053 so that the right and left tabs display correctly in Joomla 4&5.
This commit is contained in:
2024-03-02 22:10:30 +02:00
parent 3c91a5cdbb
commit d1e1a56671
1786 changed files with 73608 additions and 37437 deletions

View File

@@ -12,7 +12,7 @@ Joomla.submitbutton = function(task)
{
if (task == ''){
return false;
} else {
} else {
var action = task.split('.');
if (action[1] == 'cancel' || action[1] == 'close' || document.formvalidator.isValid(document.getElementById("adminForm"))){
Joomla.submitform(task, document.getElementById("adminForm"));

View File

@@ -12,9 +12,12 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use Joomla\CMS\HTML\HTMLHelper as Html;
?>
<div class="uk-alert uk-alert-danger" data-uk-alert>
<h2><?php echo JText::_('COM_COMPONENTBUILDER_ERROR'); ?></h2>
<h2><?php echo Text::_('COM_COMPONENTBUILDER_ERROR'); ?></h2>
</div>

View File

@@ -12,7 +12,16 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\HTML\HTMLHelper as Html;
use Joomla\CMS\Layout\FileLayout;
use Joomla\CMS\MVC\View\HtmlView;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Toolbar\ToolbarHelper;
use VDM\Joomla\Utilities\StringHelper;
/**
* Componentbuilder Html View class for the Api
@@ -21,13 +30,13 @@ class ComponentbuilderViewApi extends HtmlView
{
// Overwriting JView display method
function display($tpl = null)
{
{
// get combined params of both component and menu
$this->app = JFactory::getApplication();
$this->app = Factory::getApplication();
$this->params = $this->app->getParams();
$this->menu = $this->app->getMenu()->getActive();
// get the user object
$this->user = JFactory::getUser();
$this->user = Factory::getUser();
// Initialise variables.
$this->item = $this->get('Item');
// do not load the display
@@ -36,13 +45,13 @@ class ComponentbuilderViewApi extends HtmlView
// Set the toolbar
$this->addToolBar();
// set the document
// Set the html view document stuff
$this->_prepareDocument();
// Check for errors.
if (count($errors = $this->get('Errors')))
{
throw new Exception(implode(PHP_EOL, $errors), 500);
throw new \Exception(implode(PHP_EOL, $errors), 500);
}
parent::display($tpl);
@@ -57,12 +66,12 @@ class ComponentbuilderViewApi extends HtmlView
// Only load jQuery if needed. (default is true)
if ($this->params->get('add_jquery_framework', 1) == 1)
{
JHtml::_('jquery.framework');
Html::_('jquery.framework');
}
// Load the header checker class.
require_once( JPATH_COMPONENT_SITE.'/helpers/headercheck.php' );
// Initialize the header checker.
$HeaderCheck = new componentbuilderHeaderCheck;
$HeaderCheck = new componentbuilderHeaderCheck();
// Load uikit options.
$uikit = $this->params->get('uikit_load');
@@ -74,15 +83,15 @@ class ComponentbuilderViewApi extends HtmlView
// The uikit css.
if ((!$HeaderCheck->css_loaded('uikit.min') || $uikit == 1) && $uikit != 2 && $uikit != 3)
{
JHtml::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit'.$style.$size.'.css', ['version' => 'auto']);
Html::_('stylesheet', 'media/com_componentbuilder/uikit-v2/css/uikit'.$style.$size.'.css', ['version' => 'auto']);
}
// The uikit js.
if ((!$HeaderCheck->js_loaded('uikit.min') || $uikit == 1) && $uikit != 2 && $uikit != 3)
{
JHtml::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit'.$size.'.js', ['version' => 'auto']);
}
Html::_('script', 'media/com_componentbuilder/uikit-v2/js/uikit'.$size.'.js', ['version' => 'auto']);
}
// add the document default css file
JHtml::_('stylesheet', 'components/com_componentbuilder/assets/css/api.css', ['version' => 'auto']);
Html::_('stylesheet', 'components/com_componentbuilder/assets/css/api.css', ['version' => 'auto']);
}
/**
@@ -93,12 +102,12 @@ class ComponentbuilderViewApi extends HtmlView
// set help url for this view if found
$this->help_url = ComponentbuilderHelper::getHelpUrl('api');
if (ComponentbuilderHelper::checkString($this->help_url))
if (StringHelper::check($this->help_url))
{
JToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url);
ToolbarHelper::help('COM_COMPONENTBUILDER_HELP_MANAGER', false, $this->help_url);
}
// now initiate the toolbar
$this->toolbar = JToolbar::getInstance();
$this->toolbar = Toolbar::getInstance();
}
/**
@@ -111,6 +120,16 @@ class ComponentbuilderViewApi extends HtmlView
public function escape($var, $sorten = false, $length = 40)
{
// use the helper htmlEscape method instead.
return ComponentbuilderHelper::htmlEscape($var, $this->_charset, $sorten, $length);
return StringHelper::html($var, $this->_charset, $sorten, $length);
}
/**
* Get the Document (helper method toward Joomla 4 and 5)
*/
public function getDocument()
{
$this->document ??= JFactory::getDocument();
return $this->document;
}
}