Skip to content

Commit

Permalink
Merge tag '2.0.4' into master
Browse files Browse the repository at this point in the history
Maintenance release.

This release has:
  Hotfix move contents of database.sql to dca files
  • Loading branch information
baumannsven committed Jul 3, 2018
2 parents 4c3fa90 + 0f19484 commit 0c732d7
Show file tree
Hide file tree
Showing 17 changed files with 260 additions and 254 deletions.
14 changes: 10 additions & 4 deletions .travis.yml
@@ -1,17 +1,19 @@
language: php

php:
- "5.4"
- "5.5"
- "5.6"
- "7.0"
- "7.2"
- "7.1"
- "7.0"
- "5.6"

env:
- CONTAO_VERSION=~3.5.5

sudo: false

before_install:
- echo "memory_limit = -1" > travis.php.ini && phpenv config-add travis.php.ini

install:
- travis_retry composer self-update && composer --version
- travis_retry composer require contao/core $CONTAO_VERSION --no-update
Expand All @@ -22,3 +24,7 @@ script: ant -keep-going
# Hack to make things work again - we can not use a shallow repository.
git:
depth: 2147483647

cache:
directories:
- vendor
20 changes: 10 additions & 10 deletions composer.json
Expand Up @@ -9,7 +9,7 @@
],
"type": "contao-module",
"homepage": "http://now.metamodel.me/",
"license": "LGPL-3.0+",
"license": "LGPL-3.0-or-later",
"authors": [
{
"name": "Christian Schiffler",
Expand All @@ -31,18 +31,18 @@
"source": "https://github.com/MetaModels/attribute_timestamp"
},
"require": {
"php": ">=5.4",
"php": "^5.6 || ^7.0",
"contao/core": "^3.5.5",
"contao-community-alliance/composer-plugin": "~2.0",
"contao-community-alliance/dc-general": "~2.0@beta",
"contao-community-alliance/events-contao-bindings": "~3.5",
"metamodels/attribute_numeric": "~2.0",
"metamodels/core": "~2.0@alpha"
"contao-community-alliance/composer-plugin": "^2.0",
"contao-community-alliance/dc-general": "^2.0@beta",
"contao-community-alliance/events-contao-bindings": "^3.5",
"metamodels/attribute_numeric": "^2.0",
"metamodels/core": "^2.0"
},
"require-dev": {
"cyberspectrum/contao-toolbox": "~0.6",
"phpcq/all-tasks": "~1.1",
"metamodels/base-unit-tests": "~1.0"
"cyberspectrum/contao-toolbox": "^0.7",
"phpcq/all-tasks": "^1.2",
"metamodels/base-unit-tests": "^1.0"
},
"autoload": {
"psr-0": {
Expand Down
13 changes: 8 additions & 5 deletions contao/config/autoload.php
Expand Up @@ -3,7 +3,7 @@
/**
* This file is part of MetaModels/attribute_timestamp.
*
* (c) 2012-2016 The MetaModels team.
* (c) 2012-2018 The MetaModels team.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -16,14 +16,17 @@
* @author Stefan Heimes <stefan_heimes@hotmail.com>
* @author Andreas Isaak <info@andreas-isaak.de>
* @author David Greminger <david.greminger@1up.io>
* @copyright 2012-2016 The MetaModels team.
* @author Sven Baumann <baumann.sv@gmail.com>
* @copyright 2012-2018 The MetaModels team.
* @license https://github.com/MetaModels/attribute_timestamp/blob/master/LICENSE LGPL-3.0
* @filesource
*/

/**
* Register the templates
*/
TemplateLoader::addFiles(array(
'mm_attr_timestamp' => 'system/modules/metamodelsattribute_timestamp/templates',
));
\Contao\TemplateLoader::addFiles(
[
'mm_attr_timestamp' => 'system/modules/metamodelsattribute_timestamp/templates',
]
);
24 changes: 0 additions & 24 deletions contao/config/database.sql

This file was deleted.

18 changes: 9 additions & 9 deletions contao/config/event_listeners.php
Expand Up @@ -3,7 +3,7 @@
/**
* This file is part of MetaModels/attribute_timestamp.
*
* (c) 2012-2016 The MetaModels team.
* (c) 2012-2018 The MetaModels team.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -17,7 +17,8 @@
* @author David Greminger <david.greminger@1up.io>
* @author David Molineus <david.molineus@netzmacht.de>
* @author Richard Henkenjohann <richardhenkenjohann@googlemail.com>
* @copyright 2012-2016 The MetaModels team.
* @author Sven Baumann <baumann.sv@gmail.com>
* @copyright 2012-2018 The MetaModels team.
* @license https://github.com/MetaModels/attribute_timestamp/blob/master/LICENSE LGPL-3.0
* @filesource
*/
Expand All @@ -28,17 +29,16 @@
use MetaModels\Events\MetaModelsBootEvent;
use MetaModels\MetaModelsEvents;

return array
(
MetaModelsEvents::SUBSYSTEM_BOOT => array(
return [
MetaModelsEvents::SUBSYSTEM_BOOT => [
function (MetaModelsBootEvent $event) {
new BootSubscriber($event->getServiceContainer());
}
),
MetaModelsEvents::ATTRIBUTE_FACTORY_CREATE => array(
],
MetaModelsEvents::ATTRIBUTE_FACTORY_CREATE => [
function (CreateAttributeFactoryEvent $event) {
$factory = $event->getFactory();
$factory->addTypeFactory(new AttributeTypeFactory());
}
)
);
]
];
37 changes: 20 additions & 17 deletions contao/dca/tl_metamodel_attribute.php
Expand Up @@ -3,7 +3,7 @@
/**
* This file is part of MetaModels/attribute_timestamp.
*
* (c) 2012-2016 The MetaModels team.
* (c) 2012-2018 The MetaModels team.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -16,30 +16,33 @@
* @author Stefan Heimes <stefan_heimes@hotmail.com>
* @author Andreas Isaak <info@andreas-isaak.de>
* @author David Greminger <david.greminger@1up.io>
* @copyright 2012-2016 The MetaModels team.
* @author Ingolf Steinhardt <info@e-spin.de>
* @author Sven Baumann <baumann.sv@gmail.com>
* @copyright 2012-2018 The MetaModels team.
* @license https://github.com/MetaModels/attribute_timestamp/blob/master/LICENSE LGPL-3.0
* @filesource
*/

/**
* Table tl_metamodel_attribute
*/
$GLOBALS['TL_DCA']['tl_metamodel_attribute']['metapalettes']['timestamp extends _simpleattribute_'] = array(
'timesettings' => array('timetype'),
);
$GLOBALS['TL_DCA']['tl_metamodel_attribute']['metapalettes']['timestamp extends _simpleattribute_'] = [
'timesettings' => ['timetype'],
];

$GLOBALS['TL_DCA']['tl_metamodel_attribute']['fields']['timetype'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_metamodel_attribute']['timetype'],
'exclude' => true,
'inputType' => 'select',
'reference' => &$GLOBALS['TL_LANG']['tl_metamodel_attribute']['timetypeOptions'],
'options' => array(
$GLOBALS['TL_DCA']['tl_metamodel_attribute']['fields']['timetype'] = [
'label' => &$GLOBALS['TL_LANG']['tl_metamodel_attribute']['timetype'],
'exclude' => true,
'inputType' => 'select',
'reference' => &$GLOBALS['TL_LANG']['tl_metamodel_attribute']['timetypeOptions'],
'options' => [
'time',
'date',
'datim',
),
'eval' => array(
'doNotSaveEmpty' => true,
'tl_class' => 'w50',
),
);
],
'sql' => 'varchar(64) NOT NULL default \'\'',
'eval' => [
'doNotSaveEmpty' => true,
'tl_class' => 'w50',
],
];
21 changes: 11 additions & 10 deletions contao/dca/tl_metamodel_dcasetting.php
Expand Up @@ -3,7 +3,7 @@
/**
* This file is part of MetaModels/attribute_timestamp.
*
* (c) 2012-2016 The MetaModels team.
* (c) 2012-2018 The MetaModels team.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -16,20 +16,21 @@
* @author Stefan Heimes <stefan_heimes@hotmail.com>
* @author Andreas Isaak <info@andreas-isaak.de>
* @author David Greminger <david.greminger@1up.io>
* @copyright 2012-2016 The MetaModels team.
* @author Sven Baumann <baumann.sv@gmail.com>
* @copyright 2012-2018 The MetaModels team.
* @license https://github.com/MetaModels/attribute_timestamp/blob/master/LICENSE LGPL-3.0
* @filesource
*/

$GLOBALS['TL_DCA']['tl_metamodel_dcasetting']['metasubselectpalettes']['attr_id']['timestamp'] = array(
'presentation' => array(
$GLOBALS['TL_DCA']['tl_metamodel_dcasetting']['metasubselectpalettes']['attr_id']['timestamp'] = [
'presentation' => [
'tl_class',
),
'functions' => array(
],
'functions' => [
'mandatory',
),
'overview' => array(
],
'overview' => [
'filterable',
'searchable',
),
);
],
];
29 changes: 16 additions & 13 deletions contao/dca/tl_metamodel_rendersetting.php
Expand Up @@ -3,7 +3,7 @@
/**
* This file is part of MetaModels/attribute_timestamp.
*
* (c) 2012-2016 The MetaModels team.
* (c) 2012-2018 The MetaModels team.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -15,23 +15,26 @@
* @author Christian Schiffler <c.schiffler@cyberspectrum.de>
* @author Stefan Heimes <stefan_heimes@hotmail.com>
* @author David Greminger <david.greminger@1up.io>
* @copyright 2012-2016 The MetaModels team.
* @author Ingolf Steinhardt <info@e-spin.de>
* @author Sven Baumann <baumann.sv@gmail.com>
* @copyright 2012-2018 The MetaModels team.
* @license https://github.com/MetaModels/attribute_timestamp/blob/master/LICENSE LGPL-3.0
* @filesource
*/

/**
* Table tl_metamodel_attribute
*/
$GLOBALS['TL_DCA']['tl_metamodel_rendersetting']['metapalettes']['timestamp extends default'] = array(
'timesettings' => array('timeformat'),
);
$GLOBALS['TL_DCA']['tl_metamodel_rendersetting']['metapalettes']['timestamp extends default'] = [
'timesettings' => ['timeformat'],
];

$GLOBALS['TL_DCA']['tl_metamodel_rendersetting']['fields']['timeformat'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_metamodel_rendersetting']['timeformat'],
'exclude' => true,
'inputType' => 'text',
'eval' => array(
'tl_class' => 'w50',
),
);
$GLOBALS['TL_DCA']['tl_metamodel_rendersetting']['fields']['timeformat'] = [
'label' => &$GLOBALS['TL_LANG']['tl_metamodel_rendersetting']['timeformat'],
'exclude' => true,
'inputType' => 'text',
'sql' => 'varchar(64) NOT NULL default \'\'',
'eval' => [
'tl_class' => 'w50',
],
];
2 changes: 1 addition & 1 deletion contao/templates/mm_attr_timestamp.html5
@@ -1 +1 @@
<span class="text<?php echo $this->additional_class; ?>"><?php echo $this->parsedDate; ?></span>
<span class="text<?= $this->additional_class; ?>"><?= $this->parsedDate; ?></span>
2 changes: 1 addition & 1 deletion contao/templates/mm_attr_timestamp.text
@@ -1 +1 @@
<?php echo $this->parsedDate; ?>
<?= $this->parsedDate; ?>
2 changes: 1 addition & 1 deletion contao/templates/mm_attr_timestamp.xhtml
@@ -1 +1 @@
<span class="text<?php echo $this->additional_class; ?>"><?php echo $this->parsedDate; ?></span>
<span class="text<?= $this->additional_class; ?>"><?= $this->parsedDate; ?></span>
7 changes: 4 additions & 3 deletions src/MetaModels/Attribute/Timestamp/AttributeTypeFactory.php
Expand Up @@ -3,7 +3,7 @@
/**
* This file is part of MetaModels/attribute_timestamp.
*
* (c) 2012-2016 The MetaModels team.
* (c) 2012-2018 The MetaModels team.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -13,7 +13,8 @@
* @package MetaModels
* @subpackage AttributeTimestamp
* @author Christian Schiffler <c.schiffler@cyberspectrum.de>
* @copyright 2012-2016 The MetaModels team.
* @author Sven Baumann <baumann.sv@gmail.com>
* @copyright 2012-2018 The MetaModels team.
* @license https://github.com/MetaModels/attribute_timestamp/blob/master/LICENSE LGPL-3.0
* @filesource
*/
Expand All @@ -35,6 +36,6 @@ public function __construct()
parent::__construct();
$this->typeName = 'timestamp';
$this->typeIcon = 'system/modules/metamodelsattribute_timestamp/html/timestamp.png';
$this->typeClass = 'MetaModels\Attribute\Timestamp\Timestamp';
$this->typeClass = Timestamp::class;
}
}
11 changes: 6 additions & 5 deletions src/MetaModels/Attribute/Timestamp/BootSubscriber.php
Expand Up @@ -3,7 +3,7 @@
/**
* This file is part of MetaModels/attribute_timestamp.
*
* (c) 2012-2016 The MetaModels team.
* (c) 2012-2018 The MetaModels team.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand All @@ -15,7 +15,8 @@
* @author Christian Schiffler <c.schiffler@cyberspectrum.de>
* @author David Molineus <david.molineus@netzmacht.de>
* @author Richard Henkenjohann <richardhenkenjohann@googlemail.com>
* @copyright 2012-2016 The MetaModels team.
* @author Sven Baumann <baumann.sv@gmail.com>
* @copyright 2012-2018 The MetaModels team.
* @license https://github.com/MetaModels/attribute_timestamp/blob/master/LICENSE LGPL-3.0
* @filesource
*/
Expand Down Expand Up @@ -44,11 +45,11 @@ protected function registerEventsInDispatcher()
$this
->addListener(
EncodePropertyValueFromWidgetEvent::NAME,
array($this, 'handleEncodePropertyValueFromWidget')
[$this, 'handleEncodePropertyValueFromWidget']
)
->addListener(
DecodePropertyValueForWidgetEvent::NAME,
array($this, 'handleDecodePropertyValueForWidgetEvent')
[$this, 'handleDecodePropertyValueForWidgetEvent']
);
}

Expand Down Expand Up @@ -90,7 +91,7 @@ public function handleDecodePropertyValueForWidgetEvent(DecodePropertyValueForWi
$dispatcher = $event->getEnvironment()->getEventDispatcher();
$value = $event->getValue();

if (is_numeric($value)) {
if (\is_numeric($value)) {
$dateEvent = new ParseDateEvent($value, $attribute->getDateTimeFormatString());
$dispatcher->dispatch(ContaoEvents::DATE_PARSE, $dateEvent);

Expand Down

0 comments on commit 0c732d7

Please sign in to comment.