Release of v3.2.1-rc3
Improved the Schema Table update engine (more). Fix autoloader timing, and loading. Implement the Joomla Powers in JCB code, to move away from JClasses. Remove many of the SQL updates, to only use the Schema updates of table columns to avoid collusion. Fix the admin.css file loading on dashboard. #1112.
This commit is contained in:
@ -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.1-rc2) 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.1-rc3) 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)
|
||||
|
||||
@ -145,10 +145,10 @@ TODO
|
||||
+ *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder)
|
||||
+ *First Build*: 30th April, 2015
|
||||
+ *Last Build*: 30th April, 2024
|
||||
+ *Version*: 3.2.1-rc2
|
||||
+ *Version*: 3.2.1-rc3
|
||||
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
|
||||
+ *Line count*: **761457**
|
||||
+ *Line count*: **761639**
|
||||
+ *Field count*: **2097**
|
||||
+ *File count*: **5294**
|
||||
+ *Folder count*: **471**
|
||||
|
@ -27,6 +27,27 @@ namespace ###NAMESPACEPREFIX###\Component\###ComponentNamespace###\Administrator
|
||||
*/
|
||||
class ###Component###Model extends ListModel
|
||||
{
|
||||
/**
|
||||
* The styles array.
|
||||
*
|
||||
* @var array
|
||||
* @since 4.3
|
||||
*/
|
||||
protected array $styles = [
|
||||
'administrator/components/com_###component###/assets/css/admin.css',
|
||||
'administrator/components/com_###component###/assets/css/dashboard.css'
|
||||
];
|
||||
|
||||
/**
|
||||
* The scripts array.
|
||||
*
|
||||
* @var array
|
||||
* @since 4.3
|
||||
*/
|
||||
protected array $scripts = [
|
||||
'administrator/components/com_###component###/assets/js/admin.js'
|
||||
];
|
||||
|
||||
public function getIcons()
|
||||
{
|
||||
// load user for access menus
|
||||
@ -221,5 +242,49 @@ class ###Component###Model extends ListModel
|
||||
}
|
||||
}
|
||||
return $icons;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the styles that have to be included on the view
|
||||
*
|
||||
* @return array styles files
|
||||
* @since 4.3
|
||||
*/
|
||||
public function getStyles(): array
|
||||
{
|
||||
return $this->styles;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to set the styles that have to be included on the view
|
||||
*
|
||||
* @return void
|
||||
* @since 4.3
|
||||
*/
|
||||
public function setStyles(string $path): void
|
||||
{
|
||||
$this->styles[] = $path;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the script that have to be included on the view
|
||||
*
|
||||
* @return array script files
|
||||
* @since 4.3
|
||||
*/
|
||||
public function getScripts(): array
|
||||
{
|
||||
return $this->scripts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to set the script that have to be included on the view
|
||||
*
|
||||
* @return void
|
||||
* @since 4.3
|
||||
*/
|
||||
public function setScript(string $path): void
|
||||
{
|
||||
$this->scripts[] = $path;
|
||||
}###DASH_MODEL_METHODS###
|
||||
}
|
||||
|
@ -35,6 +35,8 @@ class HtmlView extends BaseHtmlView
|
||||
{
|
||||
// Assign data to the view
|
||||
$this->icons = $this->get('Icons');
|
||||
$this->styles = $this->get('Styles');
|
||||
$this->scripts = $this->get('Scripts');
|
||||
$this->contributors = ###Component###Helper::getContributors();
|
||||
|
||||
// get the manifest details of the component
|
||||
@ -90,11 +92,17 @@ 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");
|
||||
|
||||
// add dashboard style sheets
|
||||
Html::_('stylesheet', "administrator/components/com_###component###/assets/css/dashboard.css", ['version' => 'auto']);
|
||||
// add styles
|
||||
foreach ($this->styles as $style)
|
||||
{
|
||||
Html::_('stylesheet', $style, ['version' => 'auto']);
|
||||
}
|
||||
// add scripts
|
||||
foreach ($this->scripts as $script)
|
||||
{
|
||||
Html::_('script', $script, ['version' => 'auto']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -143,25 +143,30 @@ class JFormFieldDynamicget extends JFormFieldList
|
||||
*/
|
||||
protected function getOptions()
|
||||
{
|
||||
$db = JFactory::getDBO();
|
||||
$query = $db->getQuery(true);
|
||||
$query->select($db->quoteName(array('a.id','a.name','a.gettype'),array('id','dynamic_get_name','type')));
|
||||
$query->from($db->quoteName('#__componentbuilder_dynamic_get', 'a'));
|
||||
$query->where($db->quoteName('a.published') . ' = 1');
|
||||
$query->order('a.name ASC');
|
||||
$db->setQuery((string)$query);
|
||||
$items = $db->loadObjectList();
|
||||
$options = array();
|
||||
if ($items)
|
||||
{
|
||||
$options[] = JHtml::_('select.option', '', 'Select an option');
|
||||
$model = ComponentbuilderHelper::getModel('dynamic_gets');
|
||||
foreach($items as $item)
|
||||
{
|
||||
$type = $model->selectionTranslation($item->type,'gettype');
|
||||
$options[] = JHtml::_('select.option', $item->id, $item->dynamic_get_name . ' (' . JText::_($type) . ')' );
|
||||
}
|
||||
}
|
||||
// Get the user object.
|
||||
$user = Factory::getUser();
|
||||
// Get the databse object.
|
||||
$db = Factory::getDBO();
|
||||
$query = $db->getQuery(true);
|
||||
$query->select($db->quoteName(array('a.id','a.name','a.gettype'),array('id','dynamic_get_name','type')));
|
||||
$query->from($db->quoteName('#__componentbuilder_dynamic_get', 'a'));
|
||||
$query->where($db->quoteName('a.published') . ' = 1');
|
||||
$query->order('a.name ASC');
|
||||
$db->setQuery((string)$query);
|
||||
$items = $db->loadObjectList();
|
||||
$options = [];
|
||||
if ($items)
|
||||
{
|
||||
if ($this->multiple === false)
|
||||
{
|
||||
$options[] = Html::_('select.option', '', Text::_('COM_COMPONENTBUILDER_SELECT_AN_OPTION'));
|
||||
}
|
||||
foreach($items as $item)
|
||||
{
|
||||
$type = $model->selectionTranslation($item->type,'gettype');
|
||||
$options[] = Html::_('select.option', $item->id, $item->dynamic_get_name . ' (' . Text::_($type) . ')' );
|
||||
}
|
||||
}
|
||||
return $options;
|
||||
}
|
||||
}
|
||||
|
@ -133,7 +133,7 @@
|
||||
label="COM_COMPONENTBUILDER_LAYOUT_DYNAMIC_GET_LABEL"
|
||||
description="COM_COMPONENTBUILDER_LAYOUT_DYNAMIC_GET_DESCRIPTION"
|
||||
multiple="false"
|
||||
default=""
|
||||
default="0"
|
||||
required="false"
|
||||
button="true"
|
||||
/>
|
||||
|
@ -133,7 +133,7 @@
|
||||
label="COM_COMPONENTBUILDER_TEMPLATE_DYNAMIC_GET_LABEL"
|
||||
description="COM_COMPONENTBUILDER_TEMPLATE_DYNAMIC_GET_DESCRIPTION"
|
||||
multiple="false"
|
||||
default=""
|
||||
default="0"
|
||||
required="false"
|
||||
button="true"
|
||||
/>
|
||||
|
Reference in New Issue
Block a user