primo commit
This commit is contained in:
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/* @package Joomla
|
||||
* @copyright Copyright (C) Open Source Matters. All rights reserved.
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
|
||||
* @extension Phoca Extension
|
||||
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
|
||||
*/
|
||||
defined('_JEXEC') or die();
|
||||
use Joomla\CMS\MVC\Controller\FormController;
|
||||
use Joomla\CMS\Factory;
|
||||
jimport('joomla.application.component.controllerform');
|
||||
|
||||
class PhocaDownloadCpControllerPhocaDownloadStyle extends FormController
|
||||
{
|
||||
protected $option = 'com_phocadownload';
|
||||
|
||||
|
||||
function __construct($config=array()) {
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
protected function allowAdd($data = array()) {
|
||||
$user = Factory::getUser();
|
||||
$allow = null;
|
||||
$allow = $user->authorise('core.create', 'com_phocadownload');
|
||||
if ($allow === null) {
|
||||
return parent::allowAdd($data);
|
||||
} else {
|
||||
return $allow;
|
||||
}
|
||||
}
|
||||
|
||||
protected function allowEdit($data = array(), $key = 'id') {
|
||||
$user = Factory::getUser();
|
||||
$allow = null;
|
||||
$allow = $user->authorise('core.edit', 'com_phocadownload');
|
||||
if ($allow === null) {
|
||||
return parent::allowEdit($data, $key);
|
||||
} else {
|
||||
return $allow;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user