Skip to content

Commit

Permalink
v1.2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
AlekVolsk committed Sep 7, 2019
1 parent 4b6fb83 commit 95c9b1d
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 26 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-2019.08.13-28A5F5.svg?style=for-the-badge)
![Version](https://img.shields.io/badge/VERSION-1.2.4-0366d6.svg?style=for-the-badge)
![Last Update](https://img.shields.io/badge/last_update-2019.09.08-28A5F5.svg?style=for-the-badge)
![Version](https://img.shields.io/badge/VERSION-1.2.5-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-2019.08.13-28A5F5.svg?style=for-the-badge)
![Version](https://img.shields.io/badge/VERSION-1.2.4-0366d6.svg?style=for-the-badge)
![Last Update](https://img.shields.io/badge/last_update-2019.09.08-28A5F5.svg?style=for-the-badge)
![Version](https://img.shields.io/badge/VERSION-1.2.5-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
6 changes: 3 additions & 3 deletions com_attrs/attrs.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0"?>
<extension type="component" version="3.7.0" method="upgrade">
<name>COM_ATTRS</name>
<version>1.2.4</version>
<creationDate>August 2019</creationDate>
<version>1.2.5</version>
<creationDate>September 2019</creationDate>
<author>Aleksey A. Morozov</author>
<authorEmail>[email protected]</authorEmail>
<authorUrl>https://alekvolsk.pw</authorUrl>
Expand Down Expand Up @@ -44,4 +44,4 @@
<language tag="ru-RU">language/ru-RU/ru-RU.com_attrs.sys.ini</language>
</languages>
</administration>
</extension>
</extension>
20 changes: 10 additions & 10 deletions com_attrs/helpers/attrs.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@

class AttrsHelper
{
public const ATTR_DEST_SYSTEM = 'system';
public const ATTR_DEST_MENU = 'menu';
public const ATTR_DEST_USERS = 'users';
public const ATTR_DEST_CONTACTS = 'contacts';
public const ATTR_DEST_ARTICLES = 'articles';
public const ATTR_DEST_CATEGORIES = 'categories';
public const ATTR_DEST_MODULES = 'modules';
public const ATTR_DEST_PLUGINS = 'plugins';
public const ATTR_DEST_FIELDS = 'fields';
public const ATTR_DEST_TAGS = 'tags';
const ATTR_DEST_SYSTEM = 'system';
const ATTR_DEST_MENU = 'menu';
const ATTR_DEST_USERS = 'users';
const ATTR_DEST_CONTACTS = 'contacts';
const ATTR_DEST_ARTICLES = 'articles';
const ATTR_DEST_CATEGORIES = 'categories';
const ATTR_DEST_MODULES = 'modules';
const ATTR_DEST_PLUGINS = 'plugins';
const ATTR_DEST_FIELDS = 'fields';
const ATTR_DEST_TAGS = 'tags';

public static function isPublished($attrName)
{
Expand Down
4 changes: 2 additions & 2 deletions language/en-GB/en-GB.pkg_attrs.sys.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PKG_ATTRS="Attributes"
PKG_ATTRS_DESC="An extension package that implements additional attributes for system elements, menus, materials, categories, content."
PKG_ATTRS_JOOMLA_COMPATIBLE="<p>To install %s upgrade Joomla version to %s or later.</p>"
PKG_ATTRS_PHP_COMPATIBLE="<p>To install %s upgrade PHP version to %s or later.</p>"
J_JOOMLA_COMPATIBLE="<p>To install %s upgrade Joomla version to %s or later.</p>"
J_PHP_COMPATIBLE="<p>To install %s upgrade PHP version to %s or later.</p>"
4 changes: 2 additions & 2 deletions language/ru-RU/ru-RU.pkg_attrs.sys.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PKG_ATTRS="Атрибуты"
PKG_ATTRS_DESC="Пакет расширений, реализующий дополнительные атрибуты для элементов системы, меню, материалов, категорий, контента."
PKG_ATTRS_JOOMLA_COMPATIBLE="<p>Для установки %s обновите пожалуйста версию Joomla до %s или выше.</p>"
PKG_ATTRS_PHP_COMPATIBLE="<p>Для установки %s обновите пожалуйста версию PHP до %s или выше.</p>"
J_JOOMLA_COMPATIBLE="<p>Для установки %s обновите пожалуйста версию Joomla до %s или выше.</p>"
J_PHP_COMPATIBLE="<p>Для установки %s обновите пожалуйста версию PHP до %s или выше.</p>"
4 changes: 2 additions & 2 deletions pkg_attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<extension version="3.7.0" type="package" method="upgrade">
<name>PKG_ATTRS</name>
<packagename>attrs</packagename>
<version>1.2.4</version>
<creationDate>August 2019</creationDate>
<version>1.2.5</version>
<creationDate>September 2019</creationDate>
<author>Aleksey A. Morozov</author>
<authorEmail>[email protected]</authorEmail>
<authorUrl>https://alekvolsk.pw</authorUrl>
Expand Down
12 changes: 9 additions & 3 deletions pkg_script.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@ function preflight($type, $parent)
return true;
}

$minJoomlaVersion = $parent->get('manifest')->attributes()->version[0];

if (!class_exists('Joomla\CMS\Version')) {
JFactory::getApplication()->enqueueMessage(JText::sprintf('J_JOOMLA_COMPATIBLE', JText::_($parent->get('manifest')->name[0]), $minJoomlaVersion), 'error');
return false;
}

$msg = '';
$ver = new Version();
$name = Text::_($parent->manifest->name[0]);
$minPhpVersion = $parent->manifest->php_minimum[0];
$name = Text::_($parent->get('manifest')->name[0]);
$minPhpVersion = $parent->get('manifest')->php_minimum[0];

$minJoomlaVersion = $parent->manifest->attributes()->version[0];
if (version_compare($ver->getShortVersion(), $minJoomlaVersion, 'lt')) {
$msg .= Text::sprintf('PKG_SNIPPET_JOOMLA_COMPATIBLE', $name, $minJoomlaVersion);
}
Expand Down

0 comments on commit 95c9b1d

Please sign in to comment.