Release of v5.1.0
Add [AllowDynamicProperties] in the base view class for J5. Move the _prepareDocument above the display call in the base view class. Remove all backward compatibility issues, so JCB will not need the [Backward Compatibility] plugin to run. Added new import powers for custom import of spreadsheets. Move the setDocument and _prepareDocument above the display in the site view and custom admin view. Update the trashhelper layout to work in Joomla 5. Add AllowDynamicProperties (Joomla 4+5) to view class to allow Custom Dynamic Get methods to work without issues. Fix Save failed issue in dynamicGet. #1148. Move all [TEXT, EDITOR, TEXTAREA] fields from [NOT NULL] to [NULL]. Add the DateHelper class and improve the date methods. Add simple SessionHelper class. Add first classes for the new import engine. Improve the [VDM Registry] to be Joomla Registry Compatible. Move all registries to the [VDM Registry] class. Fix Checked Out to be null and not 0. (#1194). Fix created_by, modified_by, checked_out fields in the compiler of the SQL. (#1194). Update all core date fields in table class. (#1188). Update created_by, modified_by, checked_out fields in table class. Implementation of the decentralized Super-Power CORE repository network. (#1190). Fix the noticeboard to display Llewellyn's Joomla Social feed. Started compiling JCB5 on Joomla 5 with PHP 8.2. Add init_defaults option for dynamic form selection setup (to int new items with default values dynamically). Update all JCB 5 tables to utf8mb4_unicode_ci collation if misaligned. Move all internal ID linking to GUID inside of JCB 5. Updated the admin-tab-fields in add-fields view. #1205. Remove Custom Import Tab from admin view. Improved the customcode and placeholder search features.
This commit is contained in:
@ -35,6 +35,9 @@ class ###Component###View###SView### extends HtmlView
|
||||
$this->user = Factory::getUser();
|
||||
// get global action permissions
|
||||
$this->canDo = ###Component###Helper::getActions('###sview###');###CUSTOM_ADMIN_DIPLAY_METHOD###
|
||||
|
||||
// Display the template
|
||||
parent::display($tpl);
|
||||
}###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS###
|
||||
|
||||
/**
|
||||
|
@ -72,11 +72,11 @@ class ###Component###View###View### extends HtmlView
|
||||
throw new Exception(implode("\n", $errors), 500);
|
||||
}
|
||||
|
||||
// Display the template
|
||||
parent::display($tpl);
|
||||
|
||||
// Set the document
|
||||
$this->setDocument();
|
||||
|
||||
// Display the template
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
|
||||
@ -113,6 +113,11 @@ class ###Component###View###View### extends HtmlView
|
||||
*/
|
||||
protected function setDocument()
|
||||
{
|
||||
// Load Core
|
||||
Html::_('behavior.core');
|
||||
// Load jQuery
|
||||
Html::_('jquery.framework');
|
||||
|
||||
$isNew = ($this->item->id < 1);
|
||||
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_###COMPONENT###_###VIEW###_NEW' : 'COM_###COMPONENT###_###VIEW###_EDIT'));
|
||||
Html::_('stylesheet', "administrator/components/com_###component###/assets/css/###view###.css", ['version' => 'auto']);###AJAXTOKE######LINKEDVIEWTABLESCRIPTS###
|
||||
|
@ -72,11 +72,11 @@ class ###Component###View###View### extends HtmlView
|
||||
throw new Exception(implode("\n", $errors), 500);
|
||||
}
|
||||
|
||||
// Display the template
|
||||
parent::display($tpl);
|
||||
|
||||
// Set the document
|
||||
$this->setDocument();
|
||||
|
||||
// Display the template
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
|
||||
@ -114,6 +114,11 @@ class ###Component###View###View### extends HtmlView
|
||||
*/
|
||||
protected function setDocument()
|
||||
{
|
||||
// Load Core
|
||||
Html::_('behavior.core');
|
||||
// Load jQuery
|
||||
Html::_('jquery.framework');
|
||||
|
||||
$isNew = ($this->item->id < 1);
|
||||
$this->getDocument()->setTitle(Text::_($isNew ? 'COM_###COMPONENT###_###VIEW###_NEW' : 'COM_###COMPONENT###_###VIEW###_EDIT'));
|
||||
// only add the ISIS template css & js if needed (default is 1 = true)
|
||||
|
@ -65,11 +65,11 @@ class ###Component###View###Views### extends HtmlView
|
||||
throw new Exception(implode("\n", $errors), 500);
|
||||
}
|
||||
|
||||
// Display the template
|
||||
parent::display($tpl);
|
||||
|
||||
// Set the document
|
||||
$this->setDocument();
|
||||
|
||||
// Display the template
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -151,6 +151,11 @@ class ###Component###View###Views### extends HtmlView
|
||||
*/
|
||||
protected function setDocument()
|
||||
{
|
||||
// Load Core
|
||||
Html::_('behavior.core');
|
||||
// Load jQuery
|
||||
Html::_('jquery.framework');
|
||||
|
||||
if (!isset($this->document))
|
||||
{
|
||||
$this->document = Factory::getDocument();
|
||||
|
@ -35,6 +35,9 @@ class ###Component###View###SViews### extends HtmlView
|
||||
$this->user = Factory::getUser();
|
||||
// get global action permissions
|
||||
$this->canDo = ###Component###Helper::getActions('###sview###');###CUSTOM_ADMIN_DIPLAY_METHOD###
|
||||
|
||||
// Display the template
|
||||
parent::display($tpl);
|
||||
}###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS###
|
||||
|
||||
/**
|
||||
|
@ -33,6 +33,9 @@ class ###Component###View###SViews### extends HtmlView
|
||||
$this->menu = $this->app->getMenu()->getActive();
|
||||
// get the user object
|
||||
$this->user = Factory::getUser();###SITE_DIPLAY_METHOD###
|
||||
|
||||
// Display the template
|
||||
parent::display($tpl);
|
||||
}###SITE_EXTRA_DIPLAY_METHODS###
|
||||
|
||||
/**
|
||||
|
@ -33,6 +33,9 @@ class ###Component###View###SView### extends HtmlView
|
||||
$this->menu = $this->app->getMenu()->getActive();
|
||||
// get the user object
|
||||
$this->user = Factory::getUser();###SITE_DIPLAY_METHOD###
|
||||
|
||||
// Display the template
|
||||
parent::display($tpl);
|
||||
}###SITE_EXTRA_DIPLAY_METHODS###
|
||||
|
||||
/**
|
||||
|
@ -25,6 +25,7 @@ namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
#[\AllowDynamicProperties]
|
||||
class HtmlView extends BaseHtmlView
|
||||
{
|
||||
/**
|
||||
@ -89,9 +90,10 @@ class HtmlView extends BaseHtmlView
|
||||
* @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)
|
||||
public function display($tpl = null): void
|
||||
{
|
||||
// Assign data to the view
|
||||
$this->items = $this->get('Items');
|
||||
|
@ -109,13 +109,22 @@ class ###View###Controller extends FormController
|
||||
*/
|
||||
protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
|
||||
{
|
||||
// get the referral options (old method use return instead see parent)
|
||||
// get int-defaults (to int new items with default values dynamically)
|
||||
$init_defaults = $this->input->get('init_defaults', null, 'STRING');
|
||||
|
||||
// get the referral options (old method use init_defaults or return instead see parent)
|
||||
$ref = $this->input->get('ref', 0, 'string');
|
||||
$refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// get redirect info.
|
||||
$append = parent::getRedirectToItemAppend($recordId, $urlVar);
|
||||
|
||||
// set int-defaults
|
||||
if (!empty($init_defaults))
|
||||
{
|
||||
$append = '&init_defaults='. (string) $init_defaults . $append;
|
||||
}
|
||||
|
||||
// set the referral options
|
||||
if ($refid && $ref)
|
||||
{
|
||||
|
@ -25,6 +25,7 @@ namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
#[\AllowDynamicProperties]
|
||||
class HtmlView extends BaseHtmlView
|
||||
{
|
||||
/**
|
||||
@ -113,9 +114,10 @@ class HtmlView extends BaseHtmlView
|
||||
* @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)
|
||||
public function display($tpl = null): void
|
||||
{
|
||||
// set params
|
||||
$this->params = ComponentHelper::getParams('com_###component###');
|
||||
|
@ -25,6 +25,7 @@ namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
#[\AllowDynamicProperties]
|
||||
class HtmlView extends BaseHtmlView
|
||||
{
|
||||
/**
|
||||
@ -65,9 +66,10 @@ class HtmlView extends BaseHtmlView
|
||||
* @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)
|
||||
public function display($tpl = null): void
|
||||
{
|
||||
// get component params
|
||||
$this->params = ComponentHelper::getParams('com_###component###');
|
||||
@ -82,6 +84,8 @@ class HtmlView extends BaseHtmlView
|
||||
|
||||
// Set the html view document stuff
|
||||
$this->_prepareDocument();
|
||||
|
||||
parent::display($tpl);
|
||||
}###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS###
|
||||
|
||||
/**
|
||||
|
@ -105,9 +105,12 @@ class ###SViews###Model extends ListModel
|
||||
];
|
||||
|
||||
/**
|
||||
* A custom property for UIKit components. (not used unless you load v2)
|
||||
* A custom property for UI Kit components.
|
||||
*
|
||||
* @var mixed Property for storing UI Kit component-related data or objects.
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected $uikitComp;
|
||||
protected $uikitComp = [];
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
|
@ -25,6 +25,7 @@ namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
#[\AllowDynamicProperties]
|
||||
class HtmlView extends BaseHtmlView
|
||||
{
|
||||
/**
|
||||
@ -33,9 +34,10 @@ class HtmlView extends BaseHtmlView
|
||||
* @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)
|
||||
public function display($tpl = null): void
|
||||
{
|
||||
// get component params
|
||||
$this->params = ComponentHelper::getParams('com_###component###');
|
||||
@ -50,6 +52,8 @@ class HtmlView extends BaseHtmlView
|
||||
|
||||
// Set the html view document stuff
|
||||
$this->_prepareDocument();
|
||||
|
||||
parent::display($tpl);
|
||||
}###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS###
|
||||
|
||||
/**
|
||||
|
@ -115,10 +115,10 @@ class ###SView###Model extends ItemModel
|
||||
/**
|
||||
* A custom property for UI Kit components.
|
||||
*
|
||||
* @var array|null Property for storing UI Kit component-related data or objects.
|
||||
* @var mixed Property for storing UI Kit component-related data or objects.
|
||||
* @since 3.2.0
|
||||
*/
|
||||
protected ?array $uikitComp;
|
||||
protected $uikitComp = [];
|
||||
|
||||
/**
|
||||
* @var object item
|
||||
|
@ -25,13 +25,17 @@ namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
#[\AllowDynamicProperties]
|
||||
class HtmlView extends BaseHtmlView
|
||||
{
|
||||
/**
|
||||
* View display method
|
||||
*
|
||||
* @return void
|
||||
* @throws \Exception
|
||||
* @since 1.6
|
||||
*/
|
||||
function display($tpl = null)
|
||||
function display($tpl = null): void
|
||||
{
|
||||
// Assign data to the view
|
||||
$this->icons = $this->get('Icons');
|
||||
@ -93,7 +97,7 @@ class HtmlView extends BaseHtmlView
|
||||
// set page title
|
||||
$this->getDocument()->setTitle(Text::_('COM_###COMPONENT###_DASHBOARD'));
|
||||
// add manifest to page JavaScript
|
||||
$this->getDocument()->addScriptDeclaration("var manifest = JSON.parse('" . json_encode($this->manifest) . "');", "text/javascript");
|
||||
$this->getDocument()->addScriptDeclaration("var manifest = JSON.parse(" . json_encode($this->manifest) . ");", "text/javascript");
|
||||
// add styles
|
||||
foreach ($this->styles as $style)
|
||||
{
|
||||
|
@ -109,13 +109,22 @@ class ###View###Controller extends FormController
|
||||
*/
|
||||
protected function getRedirectToItemAppend($recordId = null, $urlVar = 'id')
|
||||
{
|
||||
// get the referral options (old method use return instead see parent)
|
||||
// get int-defaults (to int new items with default values dynamically)
|
||||
$init_defaults = $this->input->get('init_defaults', null, 'STRING');
|
||||
|
||||
// get the referral options (old method use init_defaults or return instead see parent)
|
||||
$ref = $this->input->get('ref', 0, 'string');
|
||||
$refid = $this->input->get('refid', 0, 'int');
|
||||
|
||||
// get redirect info.
|
||||
$append = parent::getRedirectToItemAppend($recordId, $urlVar);
|
||||
|
||||
// set int-defaults
|
||||
if (!empty($init_defaults))
|
||||
{
|
||||
$append = '&init_defaults='. (string) $init_defaults . $append;
|
||||
}
|
||||
|
||||
// set the referral options
|
||||
if ($refid && $ref)
|
||||
{
|
||||
|
@ -81,9 +81,10 @@ class HtmlView extends BaseHtmlView
|
||||
* @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)
|
||||
public function display($tpl = null): void
|
||||
{
|
||||
// get combined params of both component and menu
|
||||
$this->app ??= Factory::getApplication();
|
||||
@ -93,6 +94,8 @@ class HtmlView extends BaseHtmlView
|
||||
$this->scripts = $this->get('Scripts');
|
||||
// get the user object
|
||||
$this->user ??= $this->app->getIdentity();###SITE_DIPLAY_METHOD###
|
||||
|
||||
parent::display($tpl);
|
||||
}###SITE_EXTRA_DIPLAY_METHODS###
|
||||
|
||||
/**
|
||||
|
@ -65,9 +65,10 @@ class HtmlView extends BaseHtmlView
|
||||
* @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)
|
||||
public function display($tpl = null): void
|
||||
{
|
||||
// get combined params of both component and menu
|
||||
$this->app ??= Factory::getApplication();
|
||||
@ -77,6 +78,8 @@ class HtmlView extends BaseHtmlView
|
||||
$this->scripts = $this->get('Scripts') ?? [];
|
||||
// get the user object
|
||||
$this->user ??= $this->getCurrentUser();###SITE_DIPLAY_METHOD###
|
||||
|
||||
parent::display($tpl);
|
||||
}###SITE_EXTRA_DIPLAY_METHODS###
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user