Compare commits

..

9 Commits

83 changed files with 572 additions and 828 deletions

View File

@ -1,4 +1,4 @@
# Demo (2.1.0)
# Demo (2.0.3)
![Demo image](https://raw.githubusercontent.com/namibia/demo-joomla-3-component/master/admin/assets/images/vdm-component.jpg "The Demo")
@ -10,8 +10,8 @@ Just a basic demo of the most basic implementations of the [Joomla](http://www.j
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Demo](https://www.vdm.io/)
+ *First Build*: 18th October, 2016
+ *Last Build*: 27th May, 2022
+ *Version*: 2.1.0
+ *Last Build*: 18th October, 2021
+ *Version*: 2.0.3
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
@ -23,8 +23,8 @@ 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*: **16868**
+ *File count*: **157**
+ *Line count*: **16813**
+ *File count*: **156**
+ *Folder count*: **57**
**31 Hours** or **4 Eight Hour Days** (the actual time the author spent)

View File

@ -1,4 +1,4 @@
# Demo (2.1.0)
# Demo (2.0.3)
![Demo image](https://raw.githubusercontent.com/namibia/demo-joomla-3-component/master/admin/assets/images/vdm-component.jpg "The Demo")
@ -10,8 +10,8 @@ Just a basic demo of the most basic implementations of the [Joomla](http://www.j
+ *Author*: [Llewellyn van der Merwe](mailto:joomla@vdm.io)
+ *Name*: [Demo](https://www.vdm.io/)
+ *First Build*: 18th October, 2016
+ *Last Build*: 27th May, 2022
+ *Version*: 2.1.0
+ *Last Build*: 18th October, 2021
+ *Version*: 2.0.3
+ *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
@ -23,8 +23,8 @@ 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*: **16868**
+ *File count*: **157**
+ *Line count*: **16813**
+ *File count*: **156**
+ *Folder count*: **57**
**31 Hours** or **4 Eight Hour Days** (the actual time the author spent)

View File

@ -2,8 +2,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage admin.css

View File

@ -2,8 +2,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage dashboard.css

View File

@ -2,8 +2,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage look.css

View File

@ -2,8 +2,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage looks.css

View File

@ -2,8 +2,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage admin.js

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage controller.php
@ -21,13 +21,12 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\Utilities\ArrayHelper;
/**
* General Controller of Demo component
*/
class DemoController extends BaseController
class DemoController extends JControllerLegacy
{
/**
* Constructor.

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage demo.php
@ -21,13 +21,10 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Controller\AdminController;
use Joomla\Utilities\ArrayHelper;
/**
* Demo Admin Controller
* Demo Controller
*/
class DemoControllerDemo extends AdminController
class DemoControllerDemo extends JControllerAdmin
{
}

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage import.php
@ -21,13 +21,12 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\Utilities\ArrayHelper;
/**
* Demo Import Base Controller
* Demo Import Controller
*/
class DemoControllerImport extends BaseController
class DemoControllerImport extends JControllerLegacy
{
/**
* Import an spreadsheet.

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage look.php
@ -21,13 +21,12 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Controller\FormController;
use Joomla\Utilities\ArrayHelper;
/**
* Look Form Controller
* Look Controller
*/
class DemoControllerLook extends FormController
class DemoControllerLook extends JControllerForm
{
/**
* Current or most recently performed task.

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage looks.php
@ -21,13 +21,12 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Controller\AdminController;
use Joomla\Utilities\ArrayHelper;
/**
* Looks Admin Controller
* Looks Controller
*/
class DemoControllerLooks extends AdminController
class DemoControllerLooks extends JControllerAdmin
{
/**
* The prefix to use with controller messages.

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage demo.php
@ -21,8 +21,6 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// Access check.
if (!JFactory::getUser()->authorise('core.manage', 'com_demo'))
{
@ -35,8 +33,8 @@ $document->addStyleSheet('components/com_demo/assets/css/admin.css');
$document->addScript('components/com_demo/assets/js/admin.js');
// require helper files
JLoader::register('DemoHelper', __DIR__ . '/helpers/demo.php');
JLoader::register('JHtmlBatch_', __DIR__ . '/helpers/html/batch_.php');
JLoader::register('DemoHelper', __DIR__ . '/helpers/demo.php');
JLoader::register('JHtmlBatch_', __DIR__ . '/helpers/html/batch_.php');
// Get an instance of the controller prefixed by Demo
$controller = JControllerLegacy::getInstance('Demo');

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage demo.php
@ -1893,4 +1893,3 @@ abstract class DemoHelper
return implode($key);
}
}

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage headercheck.php

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage batch_.php

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage batchselection.php

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage details_above.php

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage details_fullwidth.php

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage details_under.php

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage metadata.php

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage more_left.php

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage more_right.php

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage publishing.php

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage trashhelper.php

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage demo.php
@ -21,13 +21,10 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Model\ListModel;
use Joomla\Utilities\ArrayHelper;
/**
* Demo List Model
* Demo Model
*/
class DemoModelDemo extends ListModel
class DemoModelDemo extends JModelList
{
public function getIcons()
{

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage import.php
@ -21,16 +21,15 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Model\BaseDatabaseModel;
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
use Joomla\Utilities\ArrayHelper;
use PhpOffice\PhpSpreadsheet\IOFactory;
/**
* Demo Import Base Database Model
* Demo Import Model
*/
class DemoModelImport extends BaseDatabaseModel
class DemoModelImport extends JModelLegacy
{
// set uploading values
protected $use_streams = false;

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage look.php
@ -21,15 +21,14 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Model\AdminModel;
use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;
/**
* Demo Look Admin Model
* Demo Look Model
*/
class DemoModelLook extends AdminModel
class DemoModelLook extends JModelAdmin
{
/**
* The tab layout fields array.

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage looks.php
@ -21,13 +21,12 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Model\ListModel;
use Joomla\Utilities\ArrayHelper;
/**
* Looks List Model
* Looks Model
*/
class DemoModelLooks extends ListModel
class DemoModelLooks extends JModelList
{
public function __construct($config = array())
{
@ -119,7 +118,7 @@ class DemoModelLooks extends ListModel
*/
public function getItems()
{
// Check in items
// check in items
$this->checkInNow();
// load parent items
@ -492,19 +491,17 @@ class DemoModelLooks extends ListModel
// Get a db connection.
$db = JFactory::getDbo();
// Reset query.
// reset query
$query = $db->getQuery(true);
$query->select('*');
$query->from($db->quoteName('#__demo_look'));
// Only select items that are checked out.
$query->where($db->quoteName('checked_out') . '!=0');
$db->setQuery($query, 0, 1);
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
// Get Yesterdays date.
// Get Yesterdays date
$date = JFactory::getDate()->modify($time)->toSql();
// Reset query.
// reset query
$query = $db->getQuery(true);
// Fields to update.
@ -519,7 +516,7 @@ class DemoModelLooks extends ListModel
$db->quoteName('checked_out_time') . '<\''.$date.'\''
);
// Check table.
// Check table
$query->update($db->quoteName('#__demo_look'))->set($fields)->where($conditions);
$db->setQuery($query);

View File

@ -1 +0,0 @@

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage look.php
@ -21,7 +21,6 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Table\Table;
use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;
@ -29,7 +28,7 @@ use Joomla\Utilities\ArrayHelper;
/**
* Looks Table class
*/
class DemoTableLook extends Table
class DemoTableLook extends JTable
{
/**
* Ensure the params and metadata in json encoded in the bind method
@ -49,7 +48,7 @@ class DemoTableLook extends Table
parent::__construct('#__demo_look', 'id', $db);
// Adding History Options
JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_demo.look'));
// JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_demo.look'));
}
public function bind($array, $ignore = '')

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage default.php
@ -22,7 +22,6 @@
defined('_JEXEC') or die('Restricted access');
?>
<div id="j-main-container">
<div class="span9">

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage default_main.php

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage default_vdm.php

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage view.html.php
@ -21,8 +21,6 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
/**
* Demo View class
*/
@ -66,10 +64,10 @@ class DemoViewDemo extends JViewLegacy
JToolBarHelper::title(JText::_('COM_DEMO_DASHBOARD'), 'grid-2');
// set help url for this view if found
$this->help_url = DemoHelper::getHelpUrl('demo');
if (DemoHelper::checkString($this->help_url))
$help_url = DemoHelper::getHelpUrl('demo');
if (DemoHelper::checkString($help_url))
{
JToolbarHelper::help('COM_DEMO_HELP_MANAGER', false, $this->help_url);
JToolbarHelper::help('COM_DEMO_HELP_MANAGER', false, $help_url);
}
if ($canDo->get('core.admin') || $canDo->get('core.options'))

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage default.php

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage view.html.php
@ -21,12 +21,10 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\View\HtmlView;
/**
* Demo Import Html View
* Demo Import View
*/
class DemoViewImport extends HtmlView
class DemoViewImport extends JViewLegacy
{
protected $headerList;
protected $hasPackage = false;
@ -95,10 +93,10 @@ class DemoViewImport extends HtmlView
}
// set help url for this view if found
$this->help_url = DemoHelper::getHelpUrl('import');
if (DemoHelper::checkString($this->help_url))
$help_url = DemoHelper::getHelpUrl('import');
if (DemoHelper::checkString($help_url))
{
JToolbarHelper::help('COM_DEMO_HELP_MANAGER', false, $this->help_url);
JToolbarHelper::help('COM_DEMO_HELP_MANAGER', false, $help_url);
}
}
}

View File

@ -2,8 +2,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage submitbutton.js

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage edit.php
@ -27,7 +27,7 @@ JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.keepalive');
$componentParams = $this->params; // will be removed just use $this->params instead
?>
<script type="text/javascript">
<!-- <script type="text/javascript">
// waiting spinner
var outerDiv = jQuery('body');
jQuery('<div id="loading"></div>')
@ -49,7 +49,7 @@ $componentParams = $this->params; // will be removed just use $this->params inst
jQuery('#loading').hide();
});
</script>
<div id="demo_loader" style="display: none;">
<div id="demo_loader" style="display: none;"> -->
<form action="<?php echo JRoute::_('index.php?option=com_demo&layout=edit&id='. (int) $this->item->id . $this->referral); ?>" method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<?php echo JLayoutHelper::render('look.details_above', $this); ?>

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage view.html.php
@ -21,12 +21,10 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\View\HtmlView;
/**
* Look Html View class
* Look View class
*/
class DemoViewLook extends HtmlView
class DemoViewLook extends JViewLegacy
{
/**
* display method of View
@ -160,10 +158,10 @@ class DemoViewLook extends HtmlView
}
JToolbarHelper::divider();
// set help url for this view if found
$this->help_url = DemoHelper::getHelpUrl('look');
if (DemoHelper::checkString($this->help_url))
$help_url = DemoHelper::getHelpUrl('look');
if (DemoHelper::checkString($help_url))
{
JToolbarHelper::help('COM_DEMO_HELP_MANAGER', false, $this->help_url);
JToolbarHelper::help('COM_DEMO_HELP_MANAGER', false, $help_url);
}
}

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage default.php

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage default_batch_body.php

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage default_batch_footer.php

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage default_body.php

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage default_foot.php

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage default_head.php

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage default_toolbar.php

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage view.html.php
@ -21,12 +21,10 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\View\HtmlView;
/**
* Demo Html View class for the Looks
* Demo View class for the Looks
*/
class DemoViewLooks extends HtmlView
class DemoViewLooks extends JViewLegacy
{
/**
* Looks view display method
@ -34,11 +32,11 @@ class DemoViewLooks extends HtmlView
*/
function display($tpl = null)
{
if ($this->getLayout() !== 'modal')
{
// Include helper submenu
DemoHelper::addSubmenu('looks');
}
// if ($this->getLayout() !== 'modal')
// {
// // Include helper submenu
// DemoHelper::addSubmenu('looks');
// }
// Assign data to the view
$this->items = $this->get('Items');
@ -157,10 +155,10 @@ class DemoViewLooks extends HtmlView
}
// set help url for this view if found
$this->help_url = DemoHelper::getHelpUrl('looks');
if (DemoHelper::checkString($this->help_url))
$help_url = DemoHelper::getHelpUrl('looks');
if (DemoHelper::checkString($help_url))
{
JToolbarHelper::help('COM_DEMO_HELP_MANAGER', false, $this->help_url);
JToolbarHelper::help('COM_DEMO_HELP_MANAGER', false, $help_url);
}
// add the options comp button

View File

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="4" method="upgrade">
<extension type="component" version="4.0" method="upgrade">
<name>COM_DEMO</name>
<creationDate>27th May, 2022</creationDate>
<creationDate>18th October, 2021</creationDate>
<author>Llewellyn van der Merwe</author>
<authorEmail>joomla@vdm.io</authorEmail>
<authorUrl>https://www.vdm.io/</authorUrl>
<copyright>Copyright (C) 2015. All Rights Reserved</copyright>
<license>GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html</license>
<version>2.1.0</version>
<version>2.0.3</version>
<description><![CDATA[
<h1>Demo (v.2.1.0)</h1>
<h1>Demo (v.2.0.3)</h1>
<div style="clear: both;"></div>
<p>Just a basic demo of the most basic implementations of the [Joomla](http://www.joomla.org) Component Builder's ability.</p>
<p>Created by <a href="https://www.vdm.io/" target="_blank">Llewellyn van der Merwe</a><br /><small>Development started 18th October, 2016</small></p>

View File

@ -7,7 +7,7 @@
<version>2.0.0</version>
<infourl title="Demo!">https://www.vdm.io/</infourl>
<downloads>
<downloadurl type="full" format="zip">https://git.vdm.dev/joomla/Demo-Component/archive/v2.0.0.zip</downloadurl>
<downloadurl type="full" format="zip">https://github.com/namibia/demo-joomla-3-component/archive/v2.0.0.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
@ -24,7 +24,7 @@
<version>2.0.2</version>
<infourl title="Demo!">https://www.vdm.io/</infourl>
<downloads>
<downloadurl type="full" format="zip">https://git.vdm.dev/joomla/Demo-Component/archive/v2.0.2.zip</downloadurl>
<downloadurl type="full" format="zip">https://github.com/namibia/demo-joomla-3-component/archive/master.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
@ -41,7 +41,7 @@
<version>2.0.3</version>
<infourl title="Demo!">https://www.vdm.io/</infourl>
<downloads>
<downloadurl type="full" format="zip">https://git.vdm.dev/joomla/Demo-Component/archive/v2.0.3.zip</downloadurl>
<downloadurl type="full" format="zip">http://domain.com/demo.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
@ -55,16 +55,16 @@
<description>Demo Component</description>
<element>com_demo</element>
<type>component</type>
<version>2.1.0</version>
<version>2.0.3</version>
<infourl title="Demo!">https://www.vdm.io/</infourl>
<downloads>
<downloadurl type="full" format="zip">https://git.vdm.dev/joomla/Demo-Component/archive/v2.1.0.zip</downloadurl>
<downloadurl type="full" format="zip">http://domain.com/demo.zip</downloadurl>
</downloads>
<tags>
<tag>stable</tag>
</tags>
<maintainer>Llewellyn van der Merwe</maintainer>
<maintainerurl>https://www.vdm.io/</maintainerurl>
<targetplatform name="joomla" version="3.*"/>
<targetplatform name="joomla" version="4.*"/>
</update>
</updates>

View File

@ -1,157 +0,0 @@
/*----------------------------------------------------------------------------------| www.vdm.io |----/
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@created 18th October, 2016
@package Demo
@subpackage look.js
@author Llewellyn van der Merwe <https://www.vdm.io/>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
/------------------------------------------------------------------------------------------------------*/
// Some Global Values
jform_vvvvvvvvvv_required = false;
jform_vvvvvvvvvw_required = false;
jform_vvvvvvvvvx_required = false;
// Initial Script
jQuery(document).ready(function()
{
var add_vvvvvvv = jQuery("#jform_add input[type='radio']:checked").val();
vvvvvvv(add_vvvvvvv);
});
// the vvvvvvv function
function vvvvvvv(add_vvvvvvv)
{
// set the function logic
if (add_vvvvvvv == 1)
{
jQuery('#jform_dateofbirth').closest('.control-group').show();
// add required attribute to dateofbirth field
if (jform_vvvvvvvvvv_required)
{
updateFieldRequired('dateofbirth',0);
jQuery('#jform_dateofbirth').prop('required','required');
jQuery('#jform_dateofbirth').attr('aria-required',true);
jQuery('#jform_dateofbirth').addClass('required');
jform_vvvvvvvvvv_required = false;
}
jQuery('#jform_email').closest('.control-group').show();
// add required attribute to email field
if (jform_vvvvvvvvvw_required)
{
updateFieldRequired('email',0);
jQuery('#jform_email').prop('required','required');
jQuery('#jform_email').attr('aria-required',true);
jQuery('#jform_email').addClass('required');
jform_vvvvvvvvvw_required = false;
}
jQuery('#jform_image').closest('.control-group').show();
jQuery('#jform_mobile_phone').closest('.control-group').show();
// add required attribute to mobile_phone field
if (jform_vvvvvvvvvx_required)
{
updateFieldRequired('mobile_phone',0);
jQuery('#jform_mobile_phone').prop('required','required');
jQuery('#jform_mobile_phone').attr('aria-required',true);
jQuery('#jform_mobile_phone').addClass('required');
jform_vvvvvvvvvx_required = false;
}
jQuery('#jform_website').closest('.control-group').show();
}
else
{
jQuery('#jform_dateofbirth').closest('.control-group').hide();
// remove required attribute from dateofbirth field
if (!jform_vvvvvvvvvv_required)
{
updateFieldRequired('dateofbirth',1);
jQuery('#jform_dateofbirth').removeAttr('required');
jQuery('#jform_dateofbirth').removeAttr('aria-required');
jQuery('#jform_dateofbirth').removeClass('required');
jform_vvvvvvvvvv_required = true;
}
jQuery('#jform_email').closest('.control-group').hide();
// remove required attribute from email field
if (!jform_vvvvvvvvvw_required)
{
updateFieldRequired('email',1);
jQuery('#jform_email').removeAttr('required');
jQuery('#jform_email').removeAttr('aria-required');
jQuery('#jform_email').removeClass('required');
jform_vvvvvvvvvw_required = true;
}
jQuery('#jform_image').closest('.control-group').hide();
jQuery('#jform_mobile_phone').closest('.control-group').hide();
// remove required attribute from mobile_phone field
if (!jform_vvvvvvvvvx_required)
{
updateFieldRequired('mobile_phone',1);
jQuery('#jform_mobile_phone').removeAttr('required');
jQuery('#jform_mobile_phone').removeAttr('aria-required');
jQuery('#jform_mobile_phone').removeClass('required');
jform_vvvvvvvvvx_required = true;
}
jQuery('#jform_website').closest('.control-group').hide();
}
}
// update fields required
function updateFieldRequired(name, status) {
// check if not_required exist
if (jQuery('#jform_not_required').length > 0) {
var not_required = jQuery('#jform_not_required').val().split(",");
if(status == 1)
{
not_required.push(name);
}
else
{
not_required = removeFieldFromNotRequired(not_required, name);
}
jQuery('#jform_not_required').val(fixNotRequiredArray(not_required).toString());
}
}
// remove field from not_required
function removeFieldFromNotRequired(array, what) {
return array.filter(function(element){
return element !== what;
});
}
// fix not required array
function fixNotRequiredArray(array) {
var seen = {};
return removeEmptyFromNotRequiredArray(array).filter(function(item) {
return seen.hasOwnProperty(item) ? false : (seen[item] = true);
});
}
// remove empty from not_required array
function removeEmptyFromNotRequiredArray(array) {
return array.filter(function (el) {
// remove ( 一_一) as well - lol
return (el.length > 0 && '一_一' !== el);
});
}
// the isSet function
function isSet(val)
{
if ((val != undefined) && (val != null) && 0 !== val.length){
return true;
}
return false;
}

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage script.php
@ -328,26 +328,26 @@ class com_demoInstallerScript
}
// Get the biggest rule column in the assets table at this point.
$get_rule_length = "SELECT CHAR_LENGTH(`rules`) as rule_size FROM #__assets ORDER BY rule_size DESC LIMIT 1";
$db->setQuery($get_rule_length);
if ($db->execute())
{
$rule_length = $db->loadResult();
// Check the size of the rules column
if ($rule_length < 5120)
{
// Revert the assets table rules column back to the default
$revert_rule = "ALTER TABLE `#__assets` CHANGE `rules` `rules` varchar(5120) NOT NULL COMMENT 'JSON encoded access control.';";
$db->setQuery($revert_rule);
$db->execute();
$app->enqueueMessage(JText::_('Reverted the <b>#__assets</b> table rules column back to its default size of varchar(5120)'));
}
else
{
// $get_rule_length = "SELECT CHAR_LENGTH(`rules`) as rule_size FROM #__assets ORDER BY rule_size DESC LIMIT 1";
// $db->setQuery($get_rule_length);
// if ($db->execute())
// {
// $rule_length = $db->loadResult();
// // Check the size of the rules column
// if ($rule_length < 5120)
// {
// // Revert the assets table rules column back to the default
// $revert_rule = "ALTER TABLE `#__assets` CHANGE `rules` `rules` varchar(5120) NOT NULL COMMENT 'JSON encoded access control.';";
// $db->setQuery($revert_rule);
// $db->execute();
// $app->enqueueMessage(JText::_('Reverted the <b>#__assets</b> table rules column back to its default size of varchar(5120)'));
// }
// else
// {
$app->enqueueMessage(JText::_('Could not revert the <b>#__assets</b> table rules column back to its default size of varchar(5120), since there is still one or more components that still requires the column to be larger.'));
}
}
// $app->enqueueMessage(JText::_('Could not revert the <b>#__assets</b> table rules column back to its default size of varchar(5120), since there is still one or more components that still requires the column to be larger.'));
// }
// }
// Set db if not set already.
if (!isset($db))
@ -480,31 +480,31 @@ class com_demoInstallerScript
$db = JFactory::getDbo();
// Create the look content type object.
$look = new stdClass();
$look->type_title = 'Demo Look';
$look->type_alias = 'com_demo.look';
$look->table = '{"special": {"dbtable": "#__demo_look","key": "id","type": "Look","prefix": "demoTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
$look->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "alias","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "metadata","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "metakey","core_metadesc": "metadesc","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","description":"description","website":"website","image":"image","dateofbirth":"dateofbirth","mobile_phone":"mobile_phone","email":"email","add":"add","alias":"alias"}}';
$look->router = 'DemoHelperRoute::getLookRoute';
$look->content_history_options = '{"formFile": "administrator/components/com_demo/models/forms/look.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","add"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}';
// $look = new stdClass();
// $look->type_title = 'Demo Look';
// $look->type_alias = 'com_demo.look';
// $look->table = '{"special": {"dbtable": "#__demo_look","key": "id","type": "Look","prefix": "demoTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
// $look->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "alias","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "metadata","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "metakey","core_metadesc": "metadesc","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","description":"description","website":"website","image":"image","dateofbirth":"dateofbirth","mobile_phone":"mobile_phone","email":"email","add":"add","alias":"alias"}}';
// $look->router = 'DemoHelperRoute::getLookRoute';
// $look->content_history_options = '{"formFile": "administrator/components/com_demo/models/forms/look.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","add"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}';
// Set the object into the content types table.
$look_Inserted = $db->insertObject('#__content_types', $look);
// // Set the object into the content types table.
// $look_Inserted = $db->insertObject('#__content_types', $look);
// Install the global extenstion assets permission.
$query = $db->getQuery(true);
// Field to update.
$fields = array(
$db->quoteName('rules') . ' = ' . $db->quote('{"site.looks.access":{"1":1}}'),
);
// Condition.
$conditions = array(
$db->quoteName('name') . ' = ' . $db->quote('com_demo')
);
$query->update($db->quoteName('#__assets'))->set($fields)->where($conditions);
$db->setQuery($query);
$allDone = $db->execute();
// // Install the global extenstion assets permission.
// $query = $db->getQuery(true);
// // Field to update.
// $fields = array(
// $db->quoteName('rules') . ' = ' . $db->quote('{"site.looks.access":{"1":1}}'),
// );
// // Condition.
// $conditions = array(
// $db->quoteName('name') . ' = ' . $db->quote('com_demo')
// );
// $query->update($db->quoteName('#__assets'))->set($fields)->where($conditions);
// $db->setQuery($query);
// $allDone = $db->execute();
// Install the global extension params.
$query = $db->getQuery(true);
@ -521,156 +521,156 @@ class com_demoInstallerScript
$allDone = $db->execute();
// Get Application object
$app = JFactory::getApplication();
// Get Application object
$app = JFactory::getApplication();
$app->enqueueMessage('This is a demo component developed in <a href="http://vdm.bz/component-builder" taget="_balnk" title="Joomla Component Builder">JCB</a>! You can build more components like this with JCB, checkout our page on <a href="https://github.com/vdm-io/Joomla-Component-Builder" taget="_balnk" title="Joomla Component Builder">github</a> for more info. The future of <a href="http://vdm.bz/component-builder" taget="_balnk" title="Joomla Component Builder">Joomla Component Development</a> is Here!', 'Info');
// Get the biggest rule column in the assets table at this point.
$get_rule_length = "SELECT CHAR_LENGTH(`rules`) as rule_size FROM #__assets ORDER BY rule_size DESC LIMIT 1";
$db->setQuery($get_rule_length);
if ($db->execute())
{
$rule_length = $db->loadResult();
// Check the size of the rules column
if ($rule_length <= 5600)
{
// Fix the assets table rules column size
$fix_rules_size = "ALTER TABLE `#__assets` CHANGE `rules` `rules` TEXT NOT NULL COMMENT 'JSON encoded access control. Enlarged to TEXT by JCB';";
$db->setQuery($fix_rules_size);
$db->execute();
$app->enqueueMessage(JText::_('The <b>#__assets</b> table rules column was resized to the TEXT datatype for the components possible large permission rules.'));
}
}
echo '<a target="_blank" href="https://www.vdm.io/" title="Demo">
<img src="components/com_demo/assets/images/vdm-component.jpg"/>
</a>';
// $get_rule_length = "SELECT CHAR_LENGTH(`rules`) as rule_size FROM #__assets ORDER BY rule_size DESC LIMIT 1";
// $db->setQuery($get_rule_length);
// if ($db->execute())
// {
// $rule_length = $db->loadResult();
// // Check the size of the rules column
// if ($rule_length <= 5600)
// {
// // Fix the assets table rules column size
// $fix_rules_size = "ALTER TABLE `#__assets` CHANGE `rules` `rules` TEXT NOT NULL COMMENT 'JSON encoded access control. Enlarged to TEXT by JCB';";
// $db->setQuery($fix_rules_size);
// $db->execute();
// $app->enqueueMessage(JText::_('The <b>#__assets</b> table rules column was resized to the TEXT datatype for the components possible large permission rules.'));
// }
// }
// echo '<a target="_blank" href="https://www.vdm.io/" title="Demo">
// <img src="components/com_demo/assets/images/vdm-component.jpg"/>
// </a>';
// Set db if not set already.
if (!isset($db))
{
$db = JFactory::getDbo();
}
// Create the demo action logs extensions object.
$demo_action_logs_extensions = new stdClass();
$demo_action_logs_extensions->extension = 'com_demo';
// // Set db if not set already.
// if (!isset($db))
// {
// $db = JFactory::getDbo();
// }
// // Create the demo action logs extensions object.
// $demo_action_logs_extensions = new stdClass();
// $demo_action_logs_extensions->extension = 'com_demo';
// Set the object into the action logs extensions table.
$demo_action_logs_extensions_Inserted = $db->insertObject('#__action_logs_extensions', $demo_action_logs_extensions);
// $demo_action_logs_extensions_Inserted = $db->insertObject('#__action_logs_extensions', $demo_action_logs_extensions);
// Set db if not set already.
if (!isset($db))
{
$db = JFactory::getDbo();
}
// Create the look action log config object.
$look_action_log_config = new stdClass();
$look_action_log_config->type_title = 'LOOK';
$look_action_log_config->type_alias = 'com_demo.look';
$look_action_log_config->id_holder = 'id';
$look_action_log_config->title_holder = 'name';
$look_action_log_config->table_name = '#__demo_look';
$look_action_log_config->text_prefix = 'COM_DEMO';
// // Set db if not set already.
// if (!isset($db))
// {
// $db = JFactory::getDbo();
// }
// // Create the look action log config object.
// $look_action_log_config = new stdClass();
// $look_action_log_config->type_title = 'LOOK';
// $look_action_log_config->type_alias = 'com_demo.look';
// $look_action_log_config->id_holder = 'id';
// $look_action_log_config->title_holder = 'name';
// $look_action_log_config->table_name = '#__demo_look';
// $look_action_log_config->text_prefix = 'COM_DEMO';
// Set the object into the action log config table.
$look_Inserted = $db->insertObject('#__action_log_config', $look_action_log_config);
// // Set the object into the action log config table.
// $look_Inserted = $db->insertObject('#__action_log_config', $look_action_log_config);
}
// do any updates needed
if ($type === 'update')
{
// Get The Database object
$db = JFactory::getDbo();
// $db = JFactory::getDbo();
// Create the look content type object.
$look = new stdClass();
$look->type_title = 'Demo Look';
$look->type_alias = 'com_demo.look';
$look->table = '{"special": {"dbtable": "#__demo_look","key": "id","type": "Look","prefix": "demoTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
$look->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "alias","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "metadata","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "metakey","core_metadesc": "metadesc","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","description":"description","website":"website","image":"image","dateofbirth":"dateofbirth","mobile_phone":"mobile_phone","email":"email","add":"add","alias":"alias"}}';
$look->router = 'DemoHelperRoute::getLookRoute';
$look->content_history_options = '{"formFile": "administrator/components/com_demo/models/forms/look.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","add"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}';
// // Create the look content type object.
// $look = new stdClass();
// $look->type_title = 'Demo Look';
// $look->type_alias = 'com_demo.look';
// $look->table = '{"special": {"dbtable": "#__demo_look","key": "id","type": "Look","prefix": "demoTable","config": "array()"},"common": {"dbtable": "#__ucm_content","key": "ucm_id","type": "Corecontent","prefix": "JTable","config": "array()"}}';
// $look->field_mappings = '{"common": {"core_content_item_id": "id","core_title": "name","core_state": "published","core_alias": "alias","core_created_time": "created","core_modified_time": "modified","core_body": "null","core_hits": "hits","core_publish_up": "null","core_publish_down": "null","core_access": "access","core_params": "params","core_featured": "null","core_metadata": "metadata","core_language": "null","core_images": "null","core_urls": "null","core_version": "version","core_ordering": "ordering","core_metakey": "metakey","core_metadesc": "metadesc","core_catid": "null","core_xreference": "null","asset_id": "asset_id"},"special": {"name":"name","description":"description","website":"website","image":"image","dateofbirth":"dateofbirth","mobile_phone":"mobile_phone","email":"email","add":"add","alias":"alias"}}';
// $look->router = 'DemoHelperRoute::getLookRoute';
// $look->content_history_options = '{"formFile": "administrator/components/com_demo/models/forms/look.xml","hideFields": ["asset_id","checked_out","checked_out_time","version"],"ignoreChanges": ["modified_by","modified","checked_out","checked_out_time","version","hits"],"convertToInt": ["published","ordering","add"],"displayLookup": [{"sourceColumn": "created_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"},{"sourceColumn": "access","targetTable": "#__viewlevels","targetColumn": "id","displayColumn": "title"},{"sourceColumn": "modified_by","targetTable": "#__users","targetColumn": "id","displayColumn": "name"}]}';
// Check if look type is already in content_type DB.
$look_id = null;
$query = $db->getQuery(true);
$query->select($db->quoteName(array('type_id')));
$query->from($db->quoteName('#__content_types'));
$query->where($db->quoteName('type_alias') . ' LIKE '. $db->quote($look->type_alias));
$db->setQuery($query);
$db->execute();
// // Check if look type is already in content_type DB.
// $look_id = null;
// $query = $db->getQuery(true);
// $query->select($db->quoteName(array('type_id')));
// $query->from($db->quoteName('#__content_types'));
// $query->where($db->quoteName('type_alias') . ' LIKE '. $db->quote($look->type_alias));
// $db->setQuery($query);
// $db->execute();
// Set the object into the content types table.
if ($db->getNumRows())
{
$look->type_id = $db->loadResult();
$look_Updated = $db->updateObject('#__content_types', $look, 'type_id');
}
else
{
$look_Inserted = $db->insertObject('#__content_types', $look);
}
// // Set the object into the content types table.
// if ($db->getNumRows())
// {
// $look->type_id = $db->loadResult();
// $look_Updated = $db->updateObject('#__content_types', $look, 'type_id');
// }
// else
// {
// $look_Inserted = $db->insertObject('#__content_types', $look);
// }
echo '<a target="_blank" href="https://www.vdm.io/" title="Demo">
<img src="components/com_demo/assets/images/vdm-component.jpg"/>
</a>
<h3>Upgrade to Version 2.1.0 Was Successful! Let us know if anything is not working as expected.</h3>';
<h3>Upgrade to Version 2.0.3 Was Successful! Let us know if anything is not working as expected.</h3>';
// Set db if not set already.
if (!isset($db))
{
$db = JFactory::getDbo();
}
// Create the demo action logs extensions object.
$demo_action_logs_extensions = new stdClass();
$demo_action_logs_extensions->extension = 'com_demo';
// if (!isset($db))
// {
// $db = JFactory::getDbo();
// }
// // Create the demo action logs extensions object.
// $demo_action_logs_extensions = new stdClass();
// $demo_action_logs_extensions->extension = 'com_demo';
// Check if demo action log extension is already in action logs extensions DB.
$query = $db->getQuery(true);
$query->select($db->quoteName(array('id')));
$query->from($db->quoteName('#__action_logs_extensions'));
$query->where($db->quoteName('extension') . ' LIKE '. $db->quote($demo_action_logs_extensions->extension));
$db->setQuery($query);
$db->execute();
// // Check if demo action log extension is already in action logs extensions DB.
// $query = $db->getQuery(true);
// $query->select($db->quoteName(array('id')));
// $query->from($db->quoteName('#__action_logs_extensions'));
// $query->where($db->quoteName('extension') . ' LIKE '. $db->quote($demo_action_logs_extensions->extension));
// $db->setQuery($query);
// $db->execute();
// Set the object into the action logs extensions table if not found.
if (!$db->getNumRows())
{
$demo_action_logs_extensions_Inserted = $db->insertObject('#__action_logs_extensions', $demo_action_logs_extensions);
}
// // Set the object into the action logs extensions table if not found.
// if (!$db->getNumRows())
// {
// $demo_action_logs_extensions_Inserted = $db->insertObject('#__action_logs_extensions', $demo_action_logs_extensions);
// }
// Set db if not set already.
if (!isset($db))
{
$db = JFactory::getDbo();
}
// Create the look action log config object.
$look_action_log_config = new stdClass();
$look_action_log_config->id = null;
$look_action_log_config->type_title = 'LOOK';
$look_action_log_config->type_alias = 'com_demo.look';
$look_action_log_config->id_holder = 'id';
$look_action_log_config->title_holder = 'name';
$look_action_log_config->table_name = '#__demo_look';
$look_action_log_config->text_prefix = 'COM_DEMO';
// // Set db if not set already.
// if (!isset($db))
// {
// $db = JFactory::getDbo();
// }
// // Create the look action log config object.
// $look_action_log_config = new stdClass();
// $look_action_log_config->id = null;
// $look_action_log_config->type_title = 'LOOK';
// $look_action_log_config->type_alias = 'com_demo.look';
// $look_action_log_config->id_holder = 'id';
// $look_action_log_config->title_holder = 'name';
// $look_action_log_config->table_name = '#__demo_look';
// $look_action_log_config->text_prefix = 'COM_DEMO';
// Check if look action log config is already in action_log_config DB.
$query = $db->getQuery(true);
$query->select($db->quoteName(array('id')));
$query->from($db->quoteName('#__action_log_config'));
$query->where($db->quoteName('type_alias') . ' LIKE '. $db->quote($look_action_log_config->type_alias));
$db->setQuery($query);
$db->execute();
// // Check if look action log config is already in action_log_config DB.
// $query = $db->getQuery(true);
// $query->select($db->quoteName(array('id')));
// $query->from($db->quoteName('#__action_log_config'));
// $query->where($db->quoteName('type_alias') . ' LIKE '. $db->quote($look_action_log_config->type_alias));
// $db->setQuery($query);
// $db->execute();
// Set the object into the content types table.
if ($db->getNumRows())
{
$look_action_log_config->id = $db->loadResult();
$look_action_log_config_Updated = $db->updateObject('#__action_log_config', $look_action_log_config, 'id');
}
else
{
$look_action_log_config_Inserted = $db->insertObject('#__action_log_config', $look_action_log_config);
}
// // Set the object into the content types table.
// if ($db->getNumRows())
// {
// $look_action_log_config->id = $db->loadResult();
// $look_action_log_config_Updated = $db->updateObject('#__action_log_config', $look_action_log_config, 'id');
// }
// else
// {
// $look_action_log_config_Inserted = $db->insertObject('#__action_log_config', $look_action_log_config);
// }
}
return true;
}

View File

@ -2,8 +2,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage look.css

View File

@ -2,8 +2,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage looking.css

View File

@ -2,8 +2,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage looks.css

View File

@ -2,8 +2,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage site.css

View File

@ -2,8 +2,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage site.js

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage controller.php
@ -21,13 +21,12 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\Utilities\ArrayHelper;
/**
* Demo Component Base Controller
* Demo Component Controller
*/
class DemoController extends BaseController
class DemoController extends JControllerLegacy
{
/**
* Method to display a view.

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage look.php
@ -21,13 +21,12 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Controller\FormController;
use Joomla\Utilities\ArrayHelper;
/**
* Look Form Controller
* Look Controller
*/
class DemoControllerLook extends FormController
class DemoControllerLook extends JControllerForm
{
/**
* Current or most recently performed task.

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage demo.php
@ -21,8 +21,6 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// Set the component css/js
$document = JFactory::getDocument();
$document->addStyleSheet('components/com_demo/assets/css/site.css');
@ -30,7 +28,7 @@ $document->addScript('components/com_demo/assets/js/site.js');
// Require helper files
JLoader::register('DemoHelper', __DIR__ . '/helpers/demo.php');
JLoader::register('DemoHelperRoute', __DIR__ . '/helpers/route.php');
JLoader::register('DemoHelperRoute', __DIR__ . '/helpers/route.php');
// Get an instance of the controller prefixed by Demo
$controller = JControllerLegacy::getInstance('Demo');

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage category.php

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage demo.php
@ -1701,4 +1701,3 @@ abstract class DemoHelper
return implode($key);
}
}

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage headercheck.php

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage route.php

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage details_above.php

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage details_fullwidth.php

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage details_under.php

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage metadata.php

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage more_left.php

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage more_right.php

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage publishing.php

View File

@ -2,8 +2,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage look.js

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage look.php
@ -21,15 +21,14 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Model\AdminModel;
use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;
/**
* Demo Look Admin Model
* Demo Look Model
*/
class DemoModelLook extends AdminModel
class DemoModelLook extends JModelAdmin
{
/**
* The tab layout fields array.

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage looking.php
@ -21,13 +21,12 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Model\ItemModel;
use Joomla\Utilities\ArrayHelper;
/**
* Demo Looking Item Model
* Demo Looking Model
*/
class DemoModelLooking extends ItemModel
class DemoModelLooking extends JModelItem
{
/**
* Model context string.

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage looks.php
@ -21,13 +21,12 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\Model\ListModel;
use Joomla\Utilities\ArrayHelper;
/**
* Demo List Model for Looks
* Demo Model for Looks
*/
class DemoModelLooks extends ListModel
class DemoModelLooks extends JModelList
{
/**
* Model user data.

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage router.php
@ -21,239 +21,183 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\Component\Router\RouterView;
use Joomla\CMS\Component\Router\RouterViewConfiguration;
use Joomla\CMS\Component\Router\Rules\MenuRules;
use Joomla\CMS\Component\Router\Rules\StandardRules;
use Joomla\CMS\Component\Router\Rules\NomenuRules;
use Joomla\CMS\Factory;
use Joomla\CMS\Menu\SiteMenu;
/**
* Routing class from com_demo
*
* @since 3.3
*/
class DemoRouter extends JComponentRouterBase
class DemoRouter extends RouterView
{
/**
* Build the route for the com_demo component
* The database driver
*
* @param array &$query An array of URL arguments
*
* @return array The URL arguments to use to assemble the subsequent URL.
*
* @since 3.3
* @var \JDatabaseDriver
* @since 1.0
*/
public function build(&$query)
protected $db;
/**
* Search Component router constructor
*
* @param CMSApplication $app The application object
* @param SiteMenu $menu The menu object to work with
*/
public function __construct($app = null, $menu = null)
{
$segments = array();
$this->db = Factory::getDbo();
// Get a menu item based on Itemid or currently active
$params = JComponentHelper::getParams('com_demo');
if (empty($query['Itemid']))
{
$menuItem = $this->menu->getActive();
}
else
{
$menuItem = $this->menu->getItem($query['Itemid']);
}
$looks = new RouterViewConfiguration('looks');
$this->registerView($looks);
$mView = (empty($menuItem->query['view'])) ? null : $menuItem->query['view'];
$mId = (empty($menuItem->query['id'])) ? null : $menuItem->query['id'];
$look = (new RouterViewConfiguration('look'))
->setParent($looks)
->setKey('id');
$this->registerView($look);
if (isset($query['view']))
{
$view = $query['view'];
$looking = (new RouterViewConfiguration('looking'))
->setParent($look, 'id')
->setKey('id');
if (empty($query['Itemid']) && !(isset($view) && isset($query['id']) && ($view === 'look' || $view === 'looks' || $view === 'looking')))
{
$segments[] = $query['view'];
}
$this->registerView($looking);
unset($query['view']);
}
// Are we dealing with a item that is attached to a menu item?
if (isset($view) && ($mView == $view) and (isset($query['id'])) and ($mId == (int) $query['id']))
{
unset($query['view']);
unset($query['catid']);
unset($query['id']);
return $segments;
}
$export = (new RouterViewConfiguration('export'))
->setKey('cms_version');
$this->registerView($export);
if (isset($view) && isset($query['id']) && ($view === 'look' || $view === 'looks' || $view === 'looking'))
{
if ($mId != (int) $query['id'] || $mView != $view)
{
if (($view === 'look' || $view === 'looks' || $view === 'looking'))
{
$segments[] = $view;
$id = explode(':', $query['id']);
if (count($id) == 2)
{
$segments[] = $id[1];
}
else
{
$segments[] = $id[0];
}
}
}
unset($query['id']);
}
$total = count($segments);
parent::__construct($app, $menu);
for ($i = 0; $i < $total; $i++)
{
$segments[$i] = str_replace(':', '-', $segments[$i]);
}
return $segments;
$this->attachRule(new MenuRules($this));
$this->attachRule(new StandardRules($this));
$this->attachRule(new NomenuRules($this));
}
/**
* Parse the segments of a URL.
* Method to get the segment(s) for looks
*
* @param array &$segments The segments of the URL to parse.
* @param string $id ID of the looks to retrieve the segments for
* @param array $query The request that is built right now
*
* @return array The URL attributes to be used by the application.
*
* @since 3.3
* @return array|string The segments of this item
*/
public function parse(&$segments)
{
$count = count($segments);
$vars = array();
// Handle View and Identifier
switch($segments[0])
{
case 'look':
$vars['view'] = 'look';
if (is_numeric($segments[$count-1]))
{
$vars['id'] = (int) $segments[$count-1];
}
break;
case 'looks':
$vars['view'] = 'looks';
if (is_numeric($segments[$count-1]))
{
$vars['id'] = (int) $segments[$count-1];
}
elseif ($segments[$count-1])
{
$id = $this->getVar('look', $segments[$count-1], 'alias', 'id');
if($id)
{
$vars['id'] = $id;
}
}
break;
case 'looking':
$vars['view'] = 'looking';
if (is_numeric($segments[$count-1]))
{
$vars['id'] = (int) $segments[$count-1];
}
elseif ($segments[$count-1])
{
$id = $this->getVar('look', $segments[$count-1], 'alias', 'id');
if($id)
{
$vars['id'] = $id;
}
}
break;
}
return $vars;
}
protected function getVar($table, $where = null, $whereString = null, $what = null, $category = false, $operator = '=', $main = 'demo')
public function getLooksSegment($id, $query)
{
if(!$where || !$what || !$whereString)
{
return false;
}
// Get a db connection.
$db = JFactory::getDbo();
// Create a new query object.
$query = $db->getQuery(true);
$query->select($db->quoteName(array($what)));
if ('categories' == $table || 'category' == $table || $category)
{
$getTable = '#__categories';
$query->from($db->quoteName($getTable));
// we need this to target the components categories (TODO will keep an eye on this)
$query->where($db->quoteName('extension') . ' LIKE '. $db->quote((string)'com_' . $main . '%'));
}
else
{
// we must check if the table exist (TODO not ideal)
$tables = $db->getTableList();
$app = JFactory::getApplication();
$prefix = $app->get('dbprefix');
$check = $prefix.$main.'_'.$table;
if (in_array($check, $tables))
{
$getTable = '#__'.$main.'_'.$table;
$query->from($db->quoteName($getTable));
}
else
{
return false;
}
}
if (is_numeric($where))
{
return false;
}
elseif ($this->checkString($where))
{
// we must first check if this table has the column
$columns = $db->getTableColumns($getTable);
if (isset($columns[$whereString]))
{
$query->where($db->quoteName($whereString) . ' '.$operator.' '. $db->quote((string)$where));
}
else
{
return false;
}
}
else
{
return false;
}
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
return $db->loadResult();
}
return false;
return $this->getLookSegment($id, $query);
}
protected function checkString($string)
/**
* Method to get the segment(s) for looks
*
* @param string $segment Segment of the contact to retrieve the ID for
* @param array $query The request that is parsed right now
*
* @return mixed The id of this item or false
*/
public function getLooksId($segment, $query)
{
if (isset($string) && is_string($string) && strlen($string) > 0)
{
return true;
}
return false;
return $this->getLookId($segment, $query);
}
}
function DemoBuildRoute(&$query)
{
$router = new DemoRouter;
return $router->build($query);
}
/**
* Method to get the segment(s) for a look
*
* @param string $id ID of the application to retrieve the segments for
* @param array $query The request that is built right now
*
* @return array|string The segments of this item
*/
public function getLookSegment($id, $query)
{
if (!strpos($id, ':'))
{
$dbquery = $this->db->getQuery(true);
$dbquery->select($this->db->quoteName('alias'))
->from($this->db->quoteName('#__demo_look'))
->where('id = ' . $dbquery->q((int) $id));
$this->db->setQuery($dbquery);
function DemoParseRoute($segments)
{
$router = new DemoRouter;
$id .= ':' . $this->db->loadResult();
}
return $router->parse($segments);
list($void, $segment) = explode(':', $id, 2);
return array($void => $segment);
}
/**
* Method to get the segment(s) for a look
*
* @param string $segment Segment of the application to retrieve the ID for
* @param array $query The request that is parsed right now
*
* @return mixed The id of this item or false
*/
public function getLookId($segment, $query)
{
$query = $this->db->getQuery(true);
$query->select($this->db->quoteName('id'))
->from($this->db->quoteName('#__demo_look'))
->where('alias = ' . $this->db->quote($segment));
$this->db->setQuery($query);
return (int) $this->db->loadResult();
}
/**
* Method to get the segment(s) for a looking
*
* @param string $id ID of the looking to retrieve the segments for
* @param array $query The request that is built right now
*
* @return array|string The segments of this item
*/
public function getLookingSegment($id, $query)
{
if (!strpos($id, ':'))
{
$dbquery = $this->db->getQuery(true);
$dbquery->select($this->db->quoteName('alias'))
->from($this->db->quoteName('#__demo_look'))
->where('id = ' . $dbquery->q((int) $id));
$this->db->setQuery($dbquery);
$id .= ':' . $this->db->loadResult();
}
list($void, $segment) = explode(':', $id, 2);
return array($void => $segment);
}
/**
* Method to get the segment(s) for a looking
*
* @param string $segment Segment of the looking to retrieve the ID for
* @param array $query The request that is parsed right now
*
* @return mixed The id of this item or false
*/
public function getLookingId($segment, $query)
{
$dbQuery = $this->db->getQuery(true);
$dbQuery->select($this->db->quoteName('id'))
->from($this->db->quoteName('#__demo_look'))
->where(
[
$this->db->quoteName('alias') . ' = ' . $this->db->quote($segment),
$this->db->quoteName('id') . ' = ' . (int) $query['id'],
]
);;
$this->db->setQuery($dbQuery);
return (int) $this->db->loadResult();
}
}

View File

@ -2,8 +2,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage submitbutton.js

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage edit.php

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage view.html.php
@ -21,12 +21,10 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\View\HtmlView;
/**
* Look Html View class
* Look View class
*/
class DemoViewLook extends HtmlView
class DemoViewLook extends JViewLegacy
{
/**
* display method of View
@ -159,10 +157,10 @@ class DemoViewLook extends HtmlView
}
JToolbarHelper::divider();
// set help url for this view if found
$this->help_url = DemoHelper::getHelpUrl('look');
if (DemoHelper::checkString($this->help_url))
$help_url = DemoHelper::getHelpUrl('look');
if (DemoHelper::checkString($help_url))
{
JToolbarHelper::help('COM_DEMO_HELP_MANAGER', false, $this->help_url);
JToolbarHelper::help('COM_DEMO_HELP_MANAGER', false, $help_url);
}
// now initiate the toolbar
$this->toolbar = JToolbar::getInstance();

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage default.php

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage view.html.php
@ -21,12 +21,10 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\View\HtmlView;
/**
* Demo Html View class for the Looking
* Demo View class for the Looking
*/
class DemoViewLooking extends HtmlView
class DemoViewLooking extends JViewLegacy
{
// Overwriting JView display method
function display($tpl = null)
@ -115,12 +113,12 @@ class DemoViewLooking extends HtmlView
// The uikit css.
if ((!$HeaderCheck->css_loaded('uikit.min') || $uikit == 1) && $uikit != 2 && $uikit != 3)
{
JHtml::_('stylesheet', 'media/com_demo/uikit-v2/css/uikit'.$style.$size.'.css', ['version' => 'auto']);
$this->document->addStyleSheet(JURI::root(true) .'/media/com_demo/uikit-v2/css/uikit'.$style.$size.'.css', (DemoHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
}
// The uikit js.
if ((!$HeaderCheck->js_loaded('uikit.min') || $uikit == 1) && $uikit != 2 && $uikit != 3)
{
JHtml::_('script', 'media/com_demo/uikit-v2/js/uikit'.$size.'.js', ['version' => 'auto']);
$this->document->addScript(JURI::root(true) .'/media/com_demo/uikit-v2/js/uikit'.$size.'.js', (DemoHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
}
// Load the needed uikit components in this view.
@ -136,13 +134,13 @@ class DemoViewLooking extends HtmlView
if (File::exists(JPATH_ROOT.'/media/com_demo/uikit-v2/css/components/'.$name.$style.$size.'.css'))
{
// load the css.
JHtml::_('stylesheet', 'media/com_demo/uikit-v2/css/components/'.$name.$style.$size.'.css', ['version' => 'auto']);
$this->document->addStyleSheet(JURI::root(true) .'/media/com_demo/uikit-v2/css/components/'.$name.$style.$size.'.css', (DemoHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
}
// check if the JavaScript file exists.
if (File::exists(JPATH_ROOT.'/media/com_demo/uikit-v2/js/components/'.$name.$size.'.js'))
{
// load the js.
JHtml::_('script', 'media/com_demo/uikit-v2/js/components/'.$name.$size.'.js', ['version' => 'auto'], ['type' => 'text/javascript', 'async' => 'async']);
$this->document->addScript(JURI::root(true) .'/media/com_demo/uikit-v2/js/components/'.$name.$size.'.js', (DemoHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (DemoHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);
}
}
}
@ -202,10 +200,10 @@ class DemoViewLooking extends HtmlView
{
// set help url for this view if found
$this->help_url = DemoHelper::getHelpUrl('looking');
if (DemoHelper::checkString($this->help_url))
$help_url = DemoHelper::getHelpUrl('looking');
if (DemoHelper::checkString($help_url))
{
JToolbarHelper::help('COM_DEMO_HELP_MANAGER', false, $this->help_url);
JToolbarHelper::help('COM_DEMO_HELP_MANAGER', false, $help_url);
}
// now initiate the toolbar
$this->toolbar = JToolbar::getInstance();

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage default.php

View File

@ -3,8 +3,8 @@
Vast Development Method
/-------------------------------------------------------------------------------------------------------/
@version 2.1.0
@build 27th May, 2022
@version 2.0.3
@build 18th October, 2021
@created 18th October, 2016
@package Demo
@subpackage view.html.php
@ -21,12 +21,10 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\MVC\View\HtmlView;
/**
* Demo Html View class for the Looks
* Demo View class for the Looks
*/
class DemoViewLooks extends HtmlView
class DemoViewLooks extends JViewLegacy
{
// Overwriting JView display method
function display($tpl = null)
@ -79,12 +77,12 @@ class DemoViewLooks extends HtmlView
// The uikit css.
if ((!$HeaderCheck->css_loaded('uikit.min') || $uikit == 1) && $uikit != 2 && $uikit != 3)
{
JHtml::_('stylesheet', 'media/com_demo/uikit-v2/css/uikit'.$style.$size.'.css', ['version' => 'auto']);
$this->document->addStyleSheet(JURI::root(true) .'/media/com_demo/uikit-v2/css/uikit'.$style.$size.'.css', (DemoHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
}
// The uikit js.
if ((!$HeaderCheck->js_loaded('uikit.min') || $uikit == 1) && $uikit != 2 && $uikit != 3)
{
JHtml::_('script', 'media/com_demo/uikit-v2/js/uikit'.$size.'.js', ['version' => 'auto']);
$this->document->addScript(JURI::root(true) .'/media/com_demo/uikit-v2/js/uikit'.$size.'.js', (DemoHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
}
// Load the needed uikit components in this view.
@ -100,13 +98,13 @@ class DemoViewLooks extends HtmlView
if (File::exists(JPATH_ROOT.'/media/com_demo/uikit-v2/css/components/'.$name.$style.$size.'.css'))
{
// load the css.
JHtml::_('stylesheet', 'media/com_demo/uikit-v2/css/components/'.$name.$style.$size.'.css', ['version' => 'auto']);
$this->document->addStyleSheet(JURI::root(true) .'/media/com_demo/uikit-v2/css/components/'.$name.$style.$size.'.css', (DemoHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
}
// check if the JavaScript file exists.
if (File::exists(JPATH_ROOT.'/media/com_demo/uikit-v2/js/components/'.$name.$size.'.js'))
{
// load the js.
JHtml::_('script', 'media/com_demo/uikit-v2/js/components/'.$name.$size.'.js', ['version' => 'auto'], ['type' => 'text/javascript', 'async' => 'async']);
$this->document->addScript(JURI::root(true) .'/media/com_demo/uikit-v2/js/components/'.$name.$size.'.js', (DemoHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (DemoHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);
}
}
}
@ -137,10 +135,10 @@ class DemoViewLooks extends HtmlView
{
// set help url for this view if found
$this->help_url = DemoHelper::getHelpUrl('looks');
if (DemoHelper::checkString($this->help_url))
$help_url = DemoHelper::getHelpUrl('looks');
if (DemoHelper::checkString($help_url))
{
JToolbarHelper::help('COM_DEMO_HELP_MANAGER', false, $this->help_url);
JToolbarHelper::help('COM_DEMO_HELP_MANAGER', false, $help_url);
}
// now initiate the toolbar
$this->toolbar = JToolbar::getInstance();