Skip to content

Commit

Permalink
Merge pull request #9 from contao-themes-net/php8
Browse files Browse the repository at this point in the history
add support for php 8
  • Loading branch information
MDevster authored Jul 26, 2021
2 parents 421a5a4 + c6c4e86 commit 307c7a1
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 18 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Changelog

## [1.5.0](https://github.com/contao-themes-net/convert-theme-bundle/tree/1.5.0) – 2021-07-26

- [feature] add support for php 8
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"donate": "https://contao-themes.net/sponsoring.html"
},
"require": {
"php": "^5.6 || ^7.0",
"php": "^5.6 || ^7.0 || ^8.0",
"contao/core-bundle": "^4.4",
"terminal42/contao-folderpage": "^2.0",
"pdir/contao-theme-helper-bundle": "^1.0",
Expand Down
2 changes: 1 addition & 1 deletion src/Module/ConvertThemeSetup.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class ConvertThemeSetup extends \BackendModule
{
const VERSION = '1.4.0';
const VERSION = '1.5.0';

protected $strTemplate = 'be_converttheme_setup';

Expand Down
19 changes: 9 additions & 10 deletions src/Resources/contao/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
* Available tags for Zero One Theme
*/

if (empty($GLOBALS['tl_config']['theme_tags'])) {
if (!isset($GLOBALS['tl_config']['theme_tags'])) {
$GLOBALS['tl_config']['theme_tags'] = [];
$GLOBALS['tl_config']['theme_tags'][] = '-';
}

if (!empty($GLOBALS['tl_config']['theme_tags']) && \is_array($GLOBALS['tl_config']['theme_tags'])) {
if (isset($GLOBALS['tl_config']['theme_tags']) && \is_array($GLOBALS['tl_config']['theme_tags'])) {
$GLOBALS['tl_config']['theme_tags'] = array_merge($GLOBALS['tl_config']['theme_tags'], [
'Convert01/01',
'Convert01/02',
Expand Down Expand Up @@ -49,8 +49,9 @@
* Load default styles for every page
*/

if($GLOBALS['CONVERT_STYLES'])
if (!isset($GLOBALS['CONVERT_STYLES'])) {
$GLOBALS['CONVERT_STYLES'] = [];
}

$GLOBALS['CONVERT_STYLES'][] = 'variables';
$GLOBALS['CONVERT_STYLES'][] = 'mixins';
Expand All @@ -62,12 +63,10 @@
/**
* Backend Modules
*/
array_insert($GLOBALS['BE_MOD']['contaoThemesNet'], 1, array
(
'convertThemeSetup' => array
(
array_insert($GLOBALS['BE_MOD']['contaoThemesNet'], 1, [
'convertThemeSetup' => [
'callback' => 'ContaoThemesNet\\ConvertThemeBundle\\Module\\ConvertThemeSetup',
'tables' => array(),
'tables' => [],
'stylesheet' => 'bundles/contaothemesnetconverttheme/scss/backend.css'
),
));
],
]);
10 changes: 4 additions & 6 deletions src/Resources/contao/templates/frontend/fe_page_convert.html5
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
<meta property="og:title" content="<?php echo $this->pageTitle; ?> - <?php echo $this->mainTitle; ?>"/>
<meta property="og:description" content="<?php echo $this->description; ?>"/>
<meta property="og:url" content="{{env::url}}/{{env::request}}"/>
<?php if($GLOBALS['og:image']) echo '<meta property="og:image" content="'.$GLOBALS['og:image'].'" />'; ?>
<?php if($GLOBALS['og:image:width']) echo '<meta property="og:image:width" content="'.$GLOBALS['og:image:width'].'" />'; ?>
<?php if($GLOBALS['og:image:height']) echo '<meta property="og:image:height" content="'.$GLOBALS['og:image:height'].'" />'; ?>
<?php if(isset($GLOBALS['og:image'])) echo '<meta property="og:image" content="'.$GLOBALS['og:image'].'" />'; ?>
<?php if(isset($GLOBALS['og:image:width'])) echo '<meta property="og:image:width" content="'.$GLOBALS['og:image:width'].'" />'; ?>
<?php if(isset($GLOBALS['og:image:height'])) echo '<meta property="og:image:height" content="'.$GLOBALS['og:image:height'].'" />'; ?>

<link rel="shortcut icon" href="files/convert/img/favicon.ico" type="image/x-icon"/>

Expand All @@ -25,7 +25,7 @@
$hash = hash('ripemd160', implode(" ,",$GLOBALS['CONVERT_STYLES']));
$file = new \File('var/cache/convert/scss/' . $hash . '.scss');

// add 0.1 to end of array
// add convert to end of array
$GLOBALS['CONVERT_STYLES'][] = '_convert';
$GLOBALS['CONVERT_STYLES'] = array_unique($GLOBALS['CONVERT_STYLES']);

Expand All @@ -42,8 +42,6 @@
$combiner->add($file->path);
echo $combiner->getCombinedFile(); ?>">



<?= $this->head ?>
<?php $this->endblock(); ?>

Expand Down

0 comments on commit 307c7a1

Please sign in to comment.