Add Joomla 6 build option. Fix the template and layout linker for packages. Add native module builder for Joomla 4/5. Refactor dynamic get methods into dedicated classes. Move Joomla DB handling into compiler injector flow. Fix auto-check(in) method for Joomla 4/5 compatibility. Migrates view HTML classes to use getModel() directly instead of the deprecated magic get() calls to model methods. Refactores event handling (contentPrepare, titlePrepare, contentBeforeDisplay, contentAfterDisplay) to use Joomla 5's native event dispatcher via the model's new getDispatcher() method. Updates table classes to properly support NULL values, both in the store() method and in table variable definitions. #1245. Extractes the setAutoCheckIn() and setCheckInCall() logic into a dedicated CheckInNow class for cleaner design. Replace all direct $app->input property calls with the recommended $app->getInput() method across the entire codebase. Add Joomla 6 build option :). Fix Custom Rule Validation Bug. Unpublish Joomla 6 Backward Compatibility Plugin. Refactors the Compiler Model by dropping deprecated calls and adopting Joomla 5+ conventions. Refactors Compiler Controller to remove deprecated usage and follow Joomla 5+ best practices. Adds check to ensure expert mode subforms in the Demo Component remain set and unchanged when user lacks edit permissions. Improves validation handling of Fields by ensuring field validation rules are properly registered. Replace StringHelper with the correct Super Power key so it loads in the Compiler Controller. Add functionality to add component changelog into the package if configured. Refactor PHP classes for building HTML view files in admin and site views to align with Joomla 5+ standards. Fix issues in the site view HtmlView caused by the refactor, including missing class calls and outdated function references. Fix issue where the DatabaseSchemaCheckAll pulled all Component Builder tables into DB on install. #1253. Fix issue in the Dynamic Get when the value key is 0 it wouldn't add the 'WHERE' statement to the generated code. #1254. Change radio buttons with a empty option to save Datatype CHAR instead of TINYINT as other radio buttons. #1252. Add extra xml details to Modules built with JCB that adds advance options to the module. #1248. Remove setDocumentTitle method from the admin view since it is not being used by Joomla. #1255. Refactor compiler Move file update to classes. Refactor compiler Move plugin and module fields and rules files mover to classes. Fix issue where custom powers was not added to PowerloaderHelper. #1256. Fix normalization issue when compiling on Windows systems. #1219. Fix installer issue on Joomla 6 where components containing multiple plugins failed during installation. Completely refactors the Compiler Dashboard to align with Joomla 5+ architecture and Bootstrap 5 standards. Add a default VARCHAR(36) length to easily create fields intended to store GUID values. Update the file uploader in the Demo Component for more dynamic file display and naming. Update the SQL file dump generator to handle large SQL dumps in batches, ensuring safe and reliable database imports. Update example hints in the field expert mode options.
192 lines
4.9 KiB
PHP
192 lines
4.9 KiB
PHP
<?php
|
|
/**
|
|
* @package Joomla.Component.Builder
|
|
*
|
|
* @created 4th September 2022
|
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
|
*/
|
|
|
|
// No direct access to this JCB template file (EVER)
|
|
defined('_JCB_TEMPLATE') or die;
|
|
?>
|
|
###BOM###
|
|
namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Site\View\###SViews###;
|
|
|
|
###SITE_VIEWS_HTML_HEADER######SITE_GET_MODULE_JIMPORT###
|
|
|
|
// No direct access to this file
|
|
\defined('_JEXEC') or die;###LICENSE_LOCKED_DEFINED###
|
|
|
|
/**
|
|
* ###Component### Html View class for the ###SViews###
|
|
*
|
|
* @since 1.6
|
|
*/
|
|
class HtmlView extends BaseHtmlView
|
|
{
|
|
/**
|
|
* The app class
|
|
*
|
|
* @var Joomla___a6ee04f5_33c7_4a9b_aa6d_6a03f3715a88___Power
|
|
* @since 5.2.1
|
|
*/
|
|
public Joomla___a6ee04f5_33c7_4a9b_aa6d_6a03f3715a88___Power $app;
|
|
|
|
/**
|
|
* The input class
|
|
*
|
|
* @var Joomla___59106b64_dd51_4280_be0a_1b9b9ebb7161___Power
|
|
* @since 5.2.1
|
|
*/
|
|
public Joomla___59106b64_dd51_4280_be0a_1b9b9ebb7161___Power $input;
|
|
|
|
/**
|
|
* The params registry
|
|
*
|
|
* @var Joomla___a87c432d_b5b4_428e_b7ff_14b51664c624___Power
|
|
* @since 5.2.1
|
|
*/
|
|
public Joomla___a87c432d_b5b4_428e_b7ff_14b51664c624___Power $params;
|
|
|
|
/**
|
|
* The user object.
|
|
*
|
|
* @var Joomla___effdaf6d_2275_425d_9f52_d4952e564d34___Power
|
|
* @since 3.10.11
|
|
*/
|
|
public Joomla___effdaf6d_2275_425d_9f52_d4952e564d34___Power $user;
|
|
|
|
/**
|
|
* The items from the model
|
|
*
|
|
* @var mixed
|
|
* @since 3.10.11
|
|
*/
|
|
public mixed $items;
|
|
|
|
/**
|
|
* The toolbar object
|
|
*
|
|
* @var Toolbar
|
|
* @since 3.10.11
|
|
*/
|
|
public Toolbar $toolbar;
|
|
|
|
/**
|
|
* The styles url array
|
|
*
|
|
* @var array
|
|
* @since 5.0.0
|
|
*/
|
|
protected array $styles;
|
|
|
|
/**
|
|
* The scripts url array
|
|
*
|
|
* @var array
|
|
* @since 5.0.0
|
|
*/
|
|
protected array $scripts;
|
|
|
|
/**
|
|
* The actions object
|
|
*
|
|
* @var object
|
|
* @since 3.10.11
|
|
*/
|
|
public object $canDo;
|
|
|
|
/**
|
|
* Display the view
|
|
*
|
|
* @param string $tpl The name of the template file to parse; automatically searches through the template paths.
|
|
*
|
|
* @return void
|
|
* @throws \Exception
|
|
* @since 1.6
|
|
*/
|
|
public function display($tpl = null): void
|
|
{
|
|
// get application
|
|
$this->app ??= Joomla___39403062_84fb_46e0_bac4_0023f766e827___Power::getApplication();
|
|
// get input
|
|
$this->input ??= method_exists($this->app, 'getInput') ? $this->app->getInput() : $this->app->input;
|
|
// set params
|
|
$this->params ??= method_exists($this->app, 'getParams')
|
|
? $this->app->getParams()
|
|
: Joomla___aeb8e463_291f_4445_9ac4_34b637c12dbd___Power::getParams('com_###component###');
|
|
$this->menu = $this->app->getMenu()->getActive();
|
|
// get the user object
|
|
$this->user ??= $this->getCurrentUser();
|
|
// Load module values
|
|
$model = $this->getModel();
|
|
$this->styles = $model->getStyles() ?? [];
|
|
$this->scripts = $model->getScripts() ?? [];###SITE_DIPLAY_METHOD###
|
|
|
|
parent::display($tpl);
|
|
}###SITE_EXTRA_DIPLAY_METHODS###
|
|
|
|
/**
|
|
* Add the page title and toolbar.
|
|
*
|
|
* @return void
|
|
* @since 1.6
|
|
*/
|
|
protected function addToolbar(): void
|
|
{###SITE_CUSTOM_BUTTONS###
|
|
|
|
// set help url for this view if found
|
|
$this->help_url = ###Component###Helper::getHelpUrl('###sviews###');
|
|
if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url))
|
|
{
|
|
Joomla___0c1a176a_304f_433a_8233_37d01ff87815___Power::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url);
|
|
}
|
|
|
|
// add the toolbar if it's not already loaded
|
|
$this->toolbar ??= $this->getDocument()->getToolbar();
|
|
}
|
|
|
|
/**
|
|
* Prepare some document related stuff.
|
|
*
|
|
* @return void
|
|
* @since 1.6
|
|
*/
|
|
protected function _prepareDocument(): void
|
|
{###SITE_LIBRARIES_LOADER######SITE_UIKIT_LOADER######SITE_GOOGLECHART_LOADER######SITE_FOOTABLE_LOADER######SITE_DOCUMENT_METADATA######SITE_DOCUMENT_CUSTOM_PHP###
|
|
// add styles
|
|
foreach ($this->styles as $style)
|
|
{
|
|
Joomla___34690c75_1090_47eb_8c06_7228dc7eedd6___Power::_('stylesheet', $style, ['version' => 'auto']);
|
|
}###SITE_DOCUMENT_CUSTOM_CSS###
|
|
// add scripts
|
|
foreach ($this->scripts as $script)
|
|
{
|
|
Joomla___34690c75_1090_47eb_8c06_7228dc7eedd6___Power::_('script', $script, ['version' => 'auto']);
|
|
}###SITE_DOCUMENT_CUSTOM_JS######SITE_JAVASCRIPT_FOR_BUTTONS###
|
|
}
|
|
|
|
/**
|
|
* Escapes a value for output in a view script.
|
|
*
|
|
* @param mixed $var The output to escape.
|
|
* @param bool $shorten The switch to shorten.
|
|
* @param int $length The shorting length.
|
|
*
|
|
* @return mixed The escaped value.
|
|
* @since 1.6
|
|
*/
|
|
public function escape($var, bool $shorten = false, int $length = 40)
|
|
{
|
|
if (!is_string($var))
|
|
{
|
|
return $var;
|
|
}
|
|
|
|
return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset ?? 'UTF-8', $shorten, $length);
|
|
}###SITE_GET_MODULE###
|
|
}
|