Skip to content

Commit

Permalink
Adopt to the new contao version
Browse files Browse the repository at this point in the history
  • Loading branch information
spotbot2k committed Apr 6, 2021
1 parent 708fdce commit 2ae81ad
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 27 deletions.
24 changes: 1 addition & 23 deletions .php_cs.dist
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,4 @@ This file is part of Contao Webfont Generator Bundle
@license LGPL-3.0-or-later
EOF;
return PhpCsFixer\Config::create()
->setRules([
//'@Symfony' => true,
'@PSR2' => true,
'@PHP71Migration' => true,
'align_multiline_comment' => true,
'combine_consecutive_issets' => true,
'combine_consecutive_unsets' => true,
'compact_nullable_typehint' => true,
'linebreak_after_opening_tag' => true,
'no_null_property_initialization' => true,
'no_superfluous_elseif' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'ordered_class_elements' => true,
'ordered_imports' => true,
'phpdoc_add_missing_param_annotation' => true,
'phpdoc_order' => true,
'phpdoc_types_order' => [
'null_adjustment' => 'always_last',
'sort_algorithm' => 'none',
],
])
;
->setRules(['@PSR12' => true]);
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,8 @@
- ADD: More comments in code

#### 0.8.0
- ADD: Localfallback option, see https://www.paulirish.com/2009/bulletproof-font-face-implementation-syntax/ for details
- ADD: Localfallback option, see https://www.paulirish.com/2009/bulletproof-font-face-implementation-syntax/ for details

#### 1.0.0
- Apply PSR12 fixes only, KISS
- Contao 4.11 Support
2 changes: 1 addition & 1 deletion src/Resources/contao/classes/FontFaces.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function saveFontFaces($value)
\System::log('Database structure is not up to date, fonts can not be generated', __METHOD__, TL_GENERAL);
return;
}

$fontPath = $this->generateFilePath($fontFace->name);
if (file_exists("web/".$fontPath)) {
if (!$this->Files->is_writeable($fontPath)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/contao/classes/FontImport.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function importFont()
$this->Database->prepare('DELETE FROM `tl_fonts` WHERE `pid` = ?')->execute($parentId);
}
}

if (!$parentId) {
\Message::addError($GLOBALS['TL_LANG']['tl_fonts_faces']['parent_record_error']);
continue;
Expand Down
1 change: 1 addition & 0 deletions src/Resources/contao/config/config.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/* Backend module */
$GLOBALS['BE_MOD']['design']['fonts'] = array(
'tables' => array('tl_fonts_faces', 'tl_fonts'),
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/contao/dca/tl_layout.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

$GLOBALS['TL_DCA']['tl_layout']['palettes']['default'] = str_replace('webfonts;', 'webfonts;{fonts_legend},fontfaces;', $GLOBALS['TL_DCA']['tl_layout']['palettes']['default']);
$GLOBALS['TL_DCA']['tl_layout']['palettes']['default'] = str_replace('combineScripts;', 'combineScripts;{fonts_legend},fontfaces;', $GLOBALS['TL_DCA']['tl_layout']['palettes']['default']);

$GLOBALS['TL_DCA']['tl_layout']['fields']['fontfaces'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_layout']['fontfaces'],
Expand Down
2 changes: 2 additions & 0 deletions src/Resources/public/css/webfont-hanken-grotesk.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2ae81ad

Please sign in to comment.