This commit is contained in:
Llewellyn van der Merwe 2021-10-18 23:12:54 +02:00
parent 64390bd418
commit 664e59972f
Signed by: Llewellyn
GPG Key ID: EFC0C720A240551C
9 changed files with 22 additions and 26 deletions

View File

@ -23,7 +23,7 @@ due to [Automated Component Builder](https://www.vdm.io/joomla-component-builder
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
> never making one mistake or taking any coffee break.)
+ *Line count*: **16817**
+ *Line count*: **16813**
+ *File count*: **156**
+ *Folder count*: **57**

View File

@ -23,7 +23,7 @@ due to [Automated Component Builder](https://www.vdm.io/joomla-component-builder
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
> never making one mistake or taking any coffee break.)
+ *Line count*: **16817**
+ *Line count*: **16813**
+ *File count*: **156**
+ *Folder count*: **57**

View File

@ -10,7 +10,7 @@ CREATE TABLE IF NOT EXISTS `#__demo_look` (
`mobile_phone` VARCHAR(64) NOT NULL DEFAULT '',
`name` VARCHAR(255) NOT NULL DEFAULT '',
`website` VARCHAR(255) NOT NULL DEFAULT '',
`params` text NOT NULL,
`params` text NULL,
`published` TINYINT(3) NOT NULL DEFAULT 1,
`created_by` INT(10) unsigned NOT NULL DEFAULT 0,
`modified_by` INT(10) unsigned NOT NULL DEFAULT 0,

View File

@ -332,7 +332,7 @@ class DemoTableLook extends JTable
$this->alias = $this->name;
}
$this->alias = JApplication::stringURLSafe($this->alias);
$this->alias = JApplicationHelper::stringURLSafe($this->alias);
if (trim(str_replace('-', '', $this->alias)) == '')
{

View File

@ -22,8 +22,7 @@
defined('_JEXEC') or die('Restricted access');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('behavior.formvalidator');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
$componentParams = $this->params; // will be removed just use $this->params instead

View File

@ -21,7 +21,6 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.multiselect');
JHtml::_('dropdown.init');
JHtml::_('formbehavior.chosen', '.multipleAccessLevels', null, array('placeholder_text_multiple' => '- ' . JText::_('COM_DEMO_FILTER_SELECT_ACCESS') . ' -'));

View File

@ -23,7 +23,8 @@ defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
JHTML::_('behavior.modal');
use Joomla\CMS\Installer\Adapter\ComponentAdapter;
JHTML::_('bootstrap.renderModal');
/**
* Script File of Demo Component
@ -35,23 +36,23 @@ class com_demoInstallerScript
*
* @param JAdapterInstance $parent The object responsible for running this script
*/
public function __construct(JAdapterInstance $parent) {}
public function __construct(ComponentAdapter $parent) {}
/**
* Called on installation
*
* @param JAdapterInstance $parent The object responsible for running this script
* @param ComponentAdapter $parent The object responsible for running this script
*
* @return boolean True on success
*/
public function install(JAdapterInstance $parent) {}
public function install(ComponentAdapter $parent) {}
/**
* Called on uninstallation
*
* @param JAdapterInstance $parent The object responsible for running this script
* @param ComponentAdapter $parent The object responsible for running this script
*/
public function uninstall(JAdapterInstance $parent)
public function uninstall(ComponentAdapter $parent)
{
// Get Application object
$app = JFactory::getApplication();
@ -408,21 +409,21 @@ class com_demoInstallerScript
/**
* Called on update
*
* @param JAdapterInstance $parent The object responsible for running this script
* @param ComponentAdapter $parent The object responsible for running this script
*
* @return boolean True on success
*/
public function update(JAdapterInstance $parent){}
public function update(ComponentAdapter $parent){}
/**
* Called before any type of action
*
* @param string $type Which action is happening (install|uninstall|discover_install|update)
* @param JAdapterInstance $parent The object responsible for running this script
* @param ComponentAdapter $parent The object responsible for running this script
*
* @return boolean True on success
*/
public function preflight($type, JAdapterInstance $parent)
public function preflight($type, ComponentAdapter $parent)
{
// get application
$app = JFactory::getApplication();
@ -461,11 +462,11 @@ class com_demoInstallerScript
* Called after any type of action
*
* @param string $type Which action is happening (install|uninstall|discover_install|update)
* @param JAdapterInstance $parent The object responsible for running this script
* @param ComponentAdapter $parent The object responsible for running this script
*
* @return boolean True on success
*/
public function postflight($type, JAdapterInstance $parent)
public function postflight($type, ComponentAdapter $parent)
{
// get application
$app = JFactory::getApplication();
@ -505,7 +506,7 @@ class com_demoInstallerScript
$db->setQuery($query);
$allDone = $db->execute();
// Install the global extenstion params.
// Install the global extension params.
$query = $db->getQuery(true);
// Field to update.
$fields = array(

View File

@ -142,14 +142,14 @@ class DemoModelLooking extends JModelItem
}
// Load the JEvent Dispatcher
JPluginHelper::importPlugin('content');
$this->_dispatcher = JEventDispatcher::getInstance();
$this->_dispatcher = JFactory::getApplication();
// Check if item has params, or pass whole item.
$params = (isset($data->params) && DemoHelper::checkJson($data->params)) ? json_decode($data->params) : $data;
// Make sure the content prepare plugins fire on description
$_description = new stdClass();
$_description->text =& $data->description; // value must be in text
// Since all values are now in text (Joomla Limitation), we also add the field name (description) to context
$this->_dispatcher->trigger("onContentPrepare", array('com_demo.looking.description', &$_description, &$params, 0));
$this->_dispatcher->triggerEvent("onContentPrepare", array('com_demo.looking.description', &$_description, &$params, 0));
// Checking if description has uikit components that must be loaded.
$this->uikitComp = DemoHelper::getUikitComp($data->description,$this->uikitComp);

View File

@ -22,12 +22,9 @@
defined('_JEXEC') or die('Restricted access');
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
JHtml::_('behavior.formvalidator');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
JHtml::_('behavior.tabstate');
JHtml::_('behavior.calendar');
?>
<div class="demo-look">
<?php echo $this->toolbar->render(); ?>