2021-03-05 03:08:47 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* @package Joomla.Component.Builder
|
|
|
|
*
|
|
|
|
* @created 30th April, 2015
|
2024-03-09 19:52:51 +00:00
|
|
|
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
|
|
|
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
2021-03-05 03:08:47 +00:00
|
|
|
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
|
|
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
|
|
|
*/
|
|
|
|
|
|
|
|
// 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');
|
|
|
|
|
|
|
|
###CUSTOM_ADMIN_VIEWS_MODEL_HEADER###
|
|
|
|
|
|
|
|
/**
|
2022-05-25 08:30:55 +00:00
|
|
|
* ###Component### List Model for ###SViews###
|
2021-03-05 03:08:47 +00:00
|
|
|
*/
|
2022-05-25 08:30:55 +00:00
|
|
|
class ###Component###Model###SViews### extends ListModel
|
2021-03-05 03:08:47 +00:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Model user data.
|
|
|
|
*
|
|
|
|
* @var strings
|
|
|
|
*/
|
|
|
|
protected $user;
|
|
|
|
protected $userId;
|
|
|
|
protected $guest;
|
|
|
|
protected $groups;
|
|
|
|
protected $levels;
|
|
|
|
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()
|
|
|
|
{
|
|
|
|
// Get the current user for authorisation checks
|
2024-03-09 19:52:51 +00:00
|
|
|
$this->user = Factory::getUser();
|
2021-03-05 03:08:47 +00:00
|
|
|
$this->userId = $this->user->get('id');
|
|
|
|
$this->guest = $this->user->get('guest');
|
|
|
|
$this->groups = $this->user->get('groups');
|
2024-03-09 19:52:51 +00:00
|
|
|
$this->authorisedGroups = $this->user->getAuthorisedGroups();
|
2021-03-05 03:08:47 +00:00
|
|
|
$this->levels = $this->user->getAuthorisedViewLevels();
|
2024-03-09 19:52:51 +00:00
|
|
|
$this->app = Factory::getApplication();
|
2021-03-05 03:08:47 +00:00
|
|
|
$this->input = $this->app->input;
|
2024-03-09 19:52:51 +00:00
|
|
|
$this->initSet = true;###CUSTOM_ADMIN_GET_LIST_QUERY###
|
2021-03-05 03:08:47 +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()
|
|
|
|
{
|
2024-03-09 19:52:51 +00:00
|
|
|
$user = Factory::getUser();
|
2021-03-05 03:08:47 +00:00
|
|
|
// check if this user has permission to access items
|
|
|
|
if (!$user->authorise('###sviews###.access', 'com_###component###'))
|
|
|
|
{
|
2024-03-09 19:52:51 +00:00
|
|
|
$app = Factory::getApplication();
|
|
|
|
$app->enqueueMessage(Text::_('Not authorised!'), 'error');
|
2021-03-05 03:08:47 +00:00
|
|
|
// redirect away if not a correct (TODO for now we go to default view)
|
|
|
|
$app->redirect('index.php?option=com_###component###');
|
|
|
|
return false;
|
|
|
|
}###LICENSE_LOCKED_CHECK######CUSTOM_ADMIN_BEFORE_GET_ITEMS###
|
|
|
|
// load parent items
|
|
|
|
$items = parent::getItems();
|
|
|
|
|
|
|
|
// Get the global params
|
2024-03-09 19:52:51 +00:00
|
|
|
$globalParams = ComponentHelper::getParams('com_###component###', true);###CUSTOM_ADMIN_GET_ITEMS######CUSTOM_ADMIN_AFTER_GET_ITEMS###
|
2021-03-05 03:08:47 +00:00
|
|
|
|
|
|
|
// return items
|
|
|
|
return $items;
|
|
|
|
}###CUSTOM_ADMIN_CUSTOM_METHODS######LICENSE_LOCKED_SET_BOOL######CUSTOM_ADMIN_CUSTOM_BUTTONS_METHOD###
|
|
|
|
}
|