2016-01-30 20:28:43 +00:00
|
|
|
<?php
|
2018-08-07 13:27:08 +00:00
|
|
|
/**
|
|
|
|
* @package Joomla.Component.Builder
|
|
|
|
*
|
|
|
|
* @created 30th April, 2015
|
|
|
|
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
|
|
|
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
2021-01-03 16:49:35 +00:00
|
|
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
2018-08-07 13:27:08 +00:00
|
|
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
|
|
|
*/
|
2016-01-30 20:28:43 +00:00
|
|
|
|
|
|
|
// No direct access to this file
|
|
|
|
defined('_JEXEC') or die('Restricted access');
|
|
|
|
?>
|
|
|
|
###BOM###
|
|
|
|
|
|
|
|
// No direct access to this file
|
|
|
|
defined('_JEXEC') or die('Restricted access');
|
|
|
|
|
2020-10-21 03:10:19 +00:00
|
|
|
###CUSTOM_ADMIN_VIEWS_MODEL_HEADER###
|
2020-05-21 23:38:20 +00:00
|
|
|
|
2016-01-30 20:28:43 +00:00
|
|
|
/**
|
|
|
|
* ###Component### Model for ###SViews###
|
|
|
|
*/
|
|
|
|
class ###Component###Model###SViews### extends JModelList
|
|
|
|
{
|
2017-12-14 23:10:47 +00:00
|
|
|
/**
|
2016-01-30 20:28:43 +00:00
|
|
|
* Model user data.
|
|
|
|
*
|
2017-12-14 23:10:47 +00:00
|
|
|
* @var strings
|
2016-01-30 20:28:43 +00:00
|
|
|
*/
|
2017-12-14 23:10:47 +00:00
|
|
|
protected $user;
|
|
|
|
protected $userId;
|
|
|
|
protected $guest;
|
|
|
|
protected $groups;
|
|
|
|
protected $levels;
|
2016-01-30 20:28:43 +00:00
|
|
|
protected $app;
|
|
|
|
protected $input;
|
|
|
|
protected $uikitComp;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Method to build an SQL query to load the list data.
|
|
|
|
*
|
|
|
|
* @return string An SQL query
|
|
|
|
*/
|
|
|
|
protected function getListQuery()
|
|
|
|
{
|
2017-12-14 23:10:47 +00:00
|
|
|
// Get the current user for authorisation checks
|
2017-12-15 01:10:10 +00:00
|
|
|
$this->user = JFactory::getUser();
|
|
|
|
$this->userId = $this->user->get('id');
|
|
|
|
$this->guest = $this->user->get('guest');
|
|
|
|
$this->groups = $this->user->get('groups');
|
2017-12-14 23:10:47 +00:00
|
|
|
$this->authorisedGroups = $this->user->getAuthorisedGroups();
|
2017-12-15 01:10:10 +00:00
|
|
|
$this->levels = $this->user->getAuthorisedViewLevels();
|
|
|
|
$this->app = JFactory::getApplication();
|
|
|
|
$this->input = $this->app->input;
|
|
|
|
$this->initSet = true; ###CUSTOM_ADMIN_GET_LIST_QUERY###
|
2016-01-30 20:28:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Method to get an array of data items.
|
|
|
|
*
|
|
|
|
* @return mixed An array of data items on success, false on failure.
|
|
|
|
*/
|
|
|
|
public function getItems()
|
|
|
|
{
|
2017-12-14 23:10:47 +00:00
|
|
|
$user = JFactory::getUser();
|
|
|
|
// check if this user has permission to access items
|
|
|
|
if (!$user->authorise('###sviews###.access', 'com_###component###'))
|
|
|
|
{
|
2016-07-12 21:07:55 +00:00
|
|
|
$app = JFactory::getApplication();
|
|
|
|
$app->enqueueMessage(JText::_('Not authorised!'), 'error');
|
2016-01-30 20:28:43 +00:00
|
|
|
// redirect away if not a correct (TODO for now we go to default view)
|
2016-07-12 21:07:55 +00:00
|
|
|
$app->redirect('index.php?option=com_###component###');
|
2016-01-30 20:28:43 +00:00
|
|
|
return false;
|
2018-09-11 20:28:17 +00:00
|
|
|
}###LICENSE_LOCKED_CHECK######CUSTOM_ADMIN_BEFORE_GET_ITEMS###
|
2016-01-30 20:28:43 +00:00
|
|
|
// load parent items
|
|
|
|
$items = parent::getItems();
|
|
|
|
|
|
|
|
// Get the global params
|
2018-09-11 20:28:17 +00:00
|
|
|
$globalParams = JComponentHelper::getParams('com_###component###', true);###CUSTOM_ADMIN_GET_ITEMS######CUSTOM_ADMIN_AFTER_GET_ITEMS###
|
2016-01-30 20:28:43 +00:00
|
|
|
|
|
|
|
// return items
|
|
|
|
return $items;
|
2018-09-11 20:28:17 +00:00
|
|
|
}###CUSTOM_ADMIN_CUSTOM_METHODS######LICENSE_LOCKED_SET_BOOL######CUSTOM_ADMIN_CUSTOM_BUTTONS_METHOD###
|
2016-01-30 20:28:43 +00:00
|
|
|
}
|