Skip to content

Commit

Permalink
v1.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
AlekVolsk committed Jul 22, 2021
1 parent a5c1a97 commit e02b6a6
Show file tree
Hide file tree
Showing 39 changed files with 1,309 additions and 1,307 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Attributes

![Last Update](https://img.shields.io/badge/last_update-2021.07.01-28A5F5.svg?style=for-the-badge)
![Version](https://img.shields.io/badge/VERSION-1.3.2-0366d6.svg?style=for-the-badge)
![Last Update](https://img.shields.io/badge/last_update-2021.07.22-28A5F5.svg?style=for-the-badge)
![Version](https://img.shields.io/badge/VERSION-1.3.3-0366d6.svg?style=for-the-badge)
![Joomla](https://img.shields.io/badge/joomla-3.7+-1A3867.svg?style=for-the-badge)
![Php](https://img.shields.io/badge/php-5.6+-8892BF.svg?style=for-the-badge)

Expand Down
4 changes: 2 additions & 2 deletions README.ru.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Атрибуты

![Last Update](https://img.shields.io/badge/last_update-2021.07.01-28A5F5.svg?style=for-the-badge)
![Version](https://img.shields.io/badge/VERSION-1.3.2-0366d6.svg?style=for-the-badge)
![Last Update](https://img.shields.io/badge/last_update-2021.07.22-28A5F5.svg?style=for-the-badge)
![Version](https://img.shields.io/badge/VERSION-1.3.3-0366d6.svg?style=for-the-badge)
![Joomla](https://img.shields.io/badge/joomla-3.7+-1A3867.svg?style=for-the-badge)
![Php](https://img.shields.io/badge/php-5.6+-8892BF.svg?style=for-the-badge)

Expand Down
14 changes: 7 additions & 7 deletions com_attrs/access.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<access component="com_attrs">
<section name="component">
<action name="core.admin" title="JACTION_ADMIN" description="JACTION_ADMIN_COMPONENT_DESC"/>
<action name="core.manage" title="JACTION_MANAGE" description="JACTION_MANAGE_COMPONENT_DESC"/>
</section>
</access>
<?xml version="1.0" encoding="utf-8" ?>
<access component="com_attrs">
<section name="component">
<action name="core.admin" title="JACTION_ADMIN" description="JACTION_ADMIN_COMPONENT_DESC"/>
<action name="core.manage" title="JACTION_MANAGE" description="JACTION_MANAGE_COMPONENT_DESC"/>
</section>
</access>
28 changes: 14 additions & 14 deletions com_attrs/attrs.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\CMS\Language\Text;
use Symfony\Component\Yaml\Exception\RuntimeException;

if (!Factory::getUser()->authorise('core.manage', 'com_attrs')) {
throw new RuntimeException(Text::_('JERROR_ALERTNOAUTHOR'), 403);
}

$controller = BaseController::getInstance('attrs');
$controller->execute(Factory::getApplication()->input->get('task'));
$controller->redirect();
<?php defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\CMS\Language\Text;
use Symfony\Component\Yaml\Exception\RuntimeException;

if (!Factory::getUser()->authorise('core.manage', 'com_attrs')) {
throw new RuntimeException(Text::_('JERROR_ALERTNOAUTHOR'), 403);
}

$controller = BaseController::getInstance('attrs');
$controller->execute(Factory::getApplication()->input->get('task'));
$controller->redirect();
98 changes: 49 additions & 49 deletions com_attrs/attrs.xml
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
<?xml version="1.0"?>
<extension type="component" version="3.7.0" method="upgrade">
<name>COM_ATTRS</name>
<version>1.3.2</version>
<creationDate>July 2021</creationDate>
<author>Aleksey A. Morozov</author>
<authorEmail>alekvolsk@yandex.ru</authorEmail>
<authorUrl>https://alekvolsk.pw</authorUrl>
<copyright>© Aleksey A. Morozov. All right reserved.</copyright>
<license>GNU General Public License version 3 or later; see http://www.gnu.org/licenses/gpl-3.0.txt</license>
<description>COM_ATTRS_DESC</description>
<install>
<sql>
<file driver="mysql" charset="utf8">sql/install.mysql.utf8.sql</file>
</sql>
</install>
<uninstall>
<sql>
<file driver="mysql" charset="utf8">sql/uninstall.mysql.utf8.sql</file>
</sql>
</uninstall>
<update>
<schemas>
<schemapath type="mysql">sql/updates/mysql</schemapath>
</schemas>
</update>
<administration>
<menu>COM_ATTRS</menu>
<files folder="admin">
<filename>attrs.php</filename>
<filename>controller.php</filename>
<filename>config.xml</filename>
<filename>access.xml</filename>
<folder>controllers</folder>
<folder>layouts</folder>
<folder>helpers</folder>
<folder>models</folder>
<folder>sql</folder>
<folder>tables</folder>
<folder>views</folder>
</files>
<languages folder="admin">
<language tag="en-GB">language/en-GB/en-GB.com_attrs.ini</language>
<language tag="en-GB">language/en-GB/en-GB.com_attrs.sys.ini</language>
<language tag="ru-RU">language/ru-RU/ru-RU.com_attrs.ini</language>
<language tag="ru-RU">language/ru-RU/ru-RU.com_attrs.sys.ini</language>
</languages>
</administration>
</extension>
<?xml version="1.0"?>
<extension type="component" version="3.7.0" method="upgrade">
<name>COM_ATTRS</name>
<version>1.3.3</version>
<creationDate>July 2021</creationDate>
<author>Aleksey A. Morozov</author>
<authorEmail>alekvolsk@yandex.ru</authorEmail>
<authorUrl>https://alekvolsk.pw</authorUrl>
<copyright>© Aleksey A. Morozov. All right reserved.</copyright>
<license>GNU General Public License version 3 or later; see http://www.gnu.org/licenses/gpl-3.0.txt</license>
<description>COM_ATTRS_DESC</description>
<install>
<sql>
<file driver="mysql" charset="utf8">sql/install.mysql.utf8.sql</file>
</sql>
</install>
<uninstall>
<sql>
<file driver="mysql" charset="utf8">sql/uninstall.mysql.utf8.sql</file>
</sql>
</uninstall>
<update>
<schemas>
<schemapath type="mysql">sql/updates/mysql</schemapath>
</schemas>
</update>
<administration>
<menu>COM_ATTRS</menu>
<files folder="admin">
<filename>attrs.php</filename>
<filename>controller.php</filename>
<filename>config.xml</filename>
<filename>access.xml</filename>
<folder>controllers</folder>
<folder>layouts</folder>
<folder>helpers</folder>
<folder>models</folder>
<folder>sql</folder>
<folder>tables</folder>
<folder>views</folder>
</files>
<languages folder="admin">
<language tag="en-GB">language/en-GB/en-GB.com_attrs.ini</language>
<language tag="en-GB">language/en-GB/en-GB.com_attrs.sys.ini</language>
<language tag="ru-RU">language/ru-RU/ru-RU.com_attrs.ini</language>
<language tag="ru-RU">language/ru-RU/ru-RU.com_attrs.sys.ini</language>
</languages>
</administration>
</extension>
12 changes: 6 additions & 6 deletions com_attrs/config.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<config>
<fieldset name="permissions" label="JCONFIG_PERMISSIONS_LABEL" description="JCONFIG_PERMISSIONS_DESC">
<field name="rules" type="rules" label="JCONFIG_PERMISSIONS_LABEL" class="inputbox" validate="rules" filter="rules" component="com_attrs" section="component"/>
</fieldset>
</config>
<?xml version="1.0"?>
<config>
<fieldset name="permissions" label="JCONFIG_PERMISSIONS_LABEL" description="JCONFIG_PERMISSIONS_DESC">
<field name="rules" type="rules" label="JCONFIG_PERMISSIONS_LABEL" class="inputbox" validate="rules" filter="rules" component="com_attrs" section="component"/>
</fieldset>
</config>
64 changes: 32 additions & 32 deletions com_attrs/controller.php
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
<?php defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\MVC\Controller\BaseController;

class AttrsController extends BaseController
{

function display($cachable = false, $urlparams = [])
{
$this->default_view = 'items';
parent::display($cachable, $urlparams);
return $this;
}

public function getAjax()
{
$input = Factory::getApplication()->input;
$model = $this->getModel('ajax');
$action = $input->getCmd('action');
$reflection = new ReflectionClass($model);
$methods = $reflection->getMethods(ReflectionMethod::IS_PUBLIC);
$methodList = [];
foreach ($methods as $method) {
$methodList[] = $method->name;
}
if (in_array($action, $methodList)) {
$model->$action();
}
exit;
}
}
<?php defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\MVC\Controller\BaseController;

class AttrsController extends BaseController
{

function display($cachable = false, $urlparams = [])
{
$this->default_view = 'items';
parent::display($cachable, $urlparams);
return $this;
}

public function getAjax()
{
$input = Factory::getApplication()->input;
$model = $this->getModel('ajax');
$action = $input->getCmd('action');
$reflection = new ReflectionClass($model);
$methods = $reflection->getMethods(ReflectionMethod::IS_PUBLIC);
$methodList = [];
foreach ($methods as $method) {
$methodList[] = $method->name;
}
if (in_array($action, $methodList)) {
$model->$action();
}
exit;
}
}
38 changes: 19 additions & 19 deletions com_attrs/controllers/item.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<?php defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\MVC\Controller\FormController;

class AttrsControllerItem extends FormController
{

function __construct($config = [])
{
$this->view_list = 'items';
parent::__construct($config);
}

protected function allowEdit($data = [], $key = 'id')
{
return Factory::getUser()->authorise('core.manage', 'com_attrs');
}
}
<?php defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\MVC\Controller\FormController;

class AttrsControllerItem extends FormController
{

function __construct($config = [])
{
$this->view_list = 'items';
parent::__construct($config);
}

protected function allowEdit($data = [], $key = 'id')
{
return Factory::getUser()->authorise('core.manage', 'com_attrs');
}
}
32 changes: 16 additions & 16 deletions com_attrs/controllers/items.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<?php defined('_JEXEC') or die;

use Joomla\CMS\MVC\Controller\AdminController;

class AttrsControllerItems extends AdminController
{
function __construct($config = [])
{
parent::__construct($config);
}

public function getModel($name = 'Item', $prefix = 'AttrsModel', $config = ['ignore_request' => true])
{
return parent::getModel($name, $prefix, $config);
}
}
<?php defined('_JEXEC') or die;

use Joomla\CMS\MVC\Controller\AdminController;

class AttrsControllerItems extends AdminController
{
function __construct($config = [])
{
parent::__construct($config);
}

public function getModel($name = 'Item', $prefix = 'AttrsModel', $config = ['ignore_request' => true])
{
return parent::getModel($name, $prefix, $config);
}
}
Loading

0 comments on commit e02b6a6

Please sign in to comment.