Skip to content

Commit 51a1dc7

Browse files
committed
Merge branch 'version/2.0.0'
2 parents 6afc386 + 939c1be commit 51a1dc7

21 files changed

+1028
-22
lines changed

build.default.properties

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#####################################################
2+
## This project is using the ##
3+
## PHP code quality project (phpcq) ##
4+
## ##
5+
## https://github.com/phpcq/phpcq ##
6+
#####################################################
7+
8+
9+
phpcs.standard=${basedir}/vendor/phpcq/coding-standard/phpcs/PhpCodeQuality/ruleset.xml
10+
phpmd.ruleset=${basedir}/vendor/phpcq/coding-standard/phpmd/ruleset.xml

build.xml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
This project is using the PHP code quality project (PHPCQ).
4+
5+
For documentation visit:
6+
https://github.com/phpcq/phpcq
7+
8+
-->
9+
<project name="semantic_html5" default="build">
10+
<!-- override properties here -->
11+
<!-- <property name="" value="" /> -->
12+
13+
<!-- import the main tasks definition -->
14+
<import file="vendor/phpcq/phpcq/phpcq.main.xml"/>
15+
16+
<!--
17+
Overwrite individual targets - you can leave them empty to stop a called target from having any effect.
18+
In this example, we disable all tasks in the the verify task.
19+
-->
20+
<!-- <target name="verify" /> -->
21+
</project>

composer.json

+14-22
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,8 @@
77
"license":"LGPL-3.0+",
88
"authors":[
99
{
10-
"name":"Andreas Isaak",
11-
"email":"[email protected]",
12-
"homepage":"http://www.men-at-work.de",
13-
"role":"Developer"
14-
},
15-
{
16-
"name":"Patrick Kahl",
17-
"email":"[email protected]",
18-
"homepage":"http://www.men-at-work.de",
10+
"name":"David Maack",
11+
"email":"[email protected]",
1912
"role":"Developer"
2013
}
2114
],
@@ -27,27 +20,26 @@
2720
},
2821
"require":{
2922
"php":">=5.3",
30-
"contao/core":">=2.11,<4",
31-
"contao-community-alliance/composer-installer":"*",
23+
"contao/core-bundle":"~3.5 || ~4.2",
24+
"contao-community-alliance/composer-plugin": "~2.4 || ~3.0",
3225
"menatwork/contao-multicolumnwizard":"~3.2"
3326
},
34-
"autoload":{
35-
"classmap":["system/"]
36-
},
27+
"require-dev":{
28+
"phpcq/phpcq": "~1.0"
29+
},
30+
"autoload": {
31+
"psr-4": {
32+
"SemanticHTML5\\": "src/"
33+
}
34+
},
3735
"replace":{
3836
"contao-legacy/semantic_html5":"*"
3937
},
4038
"extra":{
4139
"contao":{
4240
"sources":{
43-
"system/modules/semantic_html5":"system/modules/semantic_html5"
44-
},
45-
"transifex": {
46-
"project": "semantic_html5",
47-
"prefix": "",
48-
"languages_cto": "system/modules/semantic_html5/languages",
49-
"languages_tx": ".tx"
41+
"contao":"system/modules/semantic_html5"
5042
}
5143
}
5244
}
53-
}
45+
}

contao/config/autoload.ini

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
;;
2+
; Configure what you want the autoload creator to register
3+
;;
4+
register_namespaces = true
5+
register_classes = true
6+
register_templates = true

contao/config/autoload.php

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
/**
4+
* Contao Open Source CMS
5+
* Copyright (c) 2005-2015 Leo Feyer
6+
*
7+
* @package semantic_html5
8+
* @copyright MEN AT WORK 2016
9+
* @author David Maack <[email protected]>
10+
* @license LGPL-3.0+
11+
*/
12+
13+
14+
/**
15+
* Register the templates
16+
*/
17+
TemplateLoader::addFiles(array(
18+
'ce_semantic_html5_end' => 'system/modules/semantic_html5/templates',
19+
'ce_semantic_html5_start' => 'system/modules/semantic_html5/templates',
20+
'be_semantic_html5_colorizejs' => 'system/modules/semantic_html5/templates',
21+
));

contao/config/config.php

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
3+
/**
4+
* Contao Open Source CMS
5+
* Copyright (c) 2005-2015 Leo Feyer
6+
*
7+
* @package semantic_html5
8+
* @copyright MEN AT WORK 2016
9+
* @author David Maack <[email protected]>
10+
* @license LGPL-3.0+
11+
*/
12+
13+
/**
14+
*
15+
* Config
16+
*/
17+
$GLOBALS['TL_HTML5']['tags'] = array(
18+
'tl_content' => array('article', 'aside', 'div', 'footer', 'header', 'section')
19+
);
20+
21+
$GLOBALS['TL_HTML5']['copyFields'] = array(
22+
'tl_content' => array('protected', 'groups', 'guests', 'start', 'stop')
23+
);
24+
25+
/**
26+
* Content Element
27+
*/
28+
$GLOBALS['TL_CTE']['html5']['sHtml5Start'] = 'SemanticHTML5\Elements\Start';
29+
$GLOBALS['TL_CTE']['html5']['sHtml5End'] = 'SemanticHTML5\Elements\End';
30+
31+
/**
32+
* Hooks
33+
*/
34+
$GLOBALS['TL_HOOKS']['getContentElement'][] = array('SemanticHTML5\Backend\Callbacks', 'addColorizeJs');
35+
36+
/**
37+
* Wrapper
38+
*/
39+
$GLOBALS['TL_WRAPPERS']['start'][] = 'sHtml5Start';
40+
$GLOBALS['TL_WRAPPERS']['stop'][] = 'sHtml5End';

contao/config/runonce.php

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
/**
4+
* Contao Open Source CMS
5+
* Copyright (c) 2005-2015 Leo Feyer
6+
*
7+
* @package semantic_html5
8+
* @copyright MEN AT WORK 2016
9+
* @author David Maack <[email protected]>
10+
* @license LGPL-3.0+
11+
*/
12+
13+
if (\Database::getInstance()->fieldExists('sh5_tag', 'tl_content')) {
14+
\Database::getInstance()->execute("UPDATE `tl_content` set type = 'sHtml5Start' WHERE type = 'semantic_html5' AND sh5_tag = 'start'");
15+
\Database::getInstance()->execute("UPDATE `tl_content` set type = 'sHtml5End' WHERE type = 'semantic_html5' AND sh5_tag = 'end'");
16+
}

contao/dca/tl_article.php

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
/**
4+
* Contao Open Source CMS
5+
* Copyright (c) 2005-2015 Leo Feyer
6+
*
7+
* @package semantic_html5
8+
* @copyright MEN AT WORK 2016
9+
* @author David Maack <[email protected]>
10+
* @license LGPL-3.0+
11+
*/
12+
13+
/**
14+
* Callbacks
15+
*/
16+
$GLOBALS['TL_DCA']['tl_article']['config']['oncopy_callback'][] = array('SemanticHTML5\Backend\Callbacks', 'oncopyArticleCallback');

contao/dca/tl_content.php

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<?php
2+
3+
/**
4+
* Contao Open Source CMS
5+
* Copyright (c) 2005-2015 Leo Feyer
6+
*
7+
* @package semantic_html5
8+
* @copyright MEN AT WORK 2016
9+
* @author David Maack <[email protected]>
10+
* @license LGPL-3.0+
11+
*/
12+
13+
/**
14+
* Palettes
15+
*/
16+
$GLOBALS['TL_DCA']['tl_content']['palettes']['sHtml5Start'] = '{type_legend},type,headline;{html5_legend},sh5_type,sh5_additional;{protected_legend:hide},protected;{expert_legend:hide},guests,invisible,cssID,space';
17+
18+
19+
/**
20+
* Callbacks
21+
*/
22+
$GLOBALS['TL_DCA']['tl_content']['config']['onsubmit_callback'][] = array('SemanticHTML5\Backend\Callbacks', 'onsubmitCallback');
23+
$GLOBALS['TL_DCA']['tl_content']['config']['ondelete_callback'][] = array('SemanticHTML5\Backend\Callbacks', 'ondeleteCallback');
24+
$GLOBALS['TL_DCA']['tl_content']['config']['oncopy_callback'][] = array('SemanticHTML5\Backend\Callbacks', 'oncopyContentCallback');
25+
26+
/**
27+
* Fields
28+
*/
29+
$GLOBALS['TL_DCA']['tl_content']['fields']['sh5_type'] = array(
30+
'label' => &$GLOBALS['TL_LANG']['tl_content']['sh5_type'],
31+
'inputType' => 'select',
32+
'options_callback' => array('SemanticHTML5\Backend\Callbacks', 'getHtml5Tags'),
33+
'eval' => array(
34+
'submitOnChange' => true,
35+
'mandatory' => true,
36+
'includeBlankOption' => true
37+
),
38+
'sql' => "varchar(64) NOT NULL default ''"
39+
);
40+
41+
$GLOBALS['TL_DCA']['tl_content']['fields']['sh5_additional'] = array(
42+
'label' => &$GLOBALS['TL_LANG']['tl_content']['sh5_additional'],
43+
'exclude' => true,
44+
'inputType' => 'multiColumnWizard',
45+
'sql' => "blob NULL",
46+
'eval' => array(
47+
'tl_class' => 'clr',
48+
'columnFields' => array(
49+
'property' => array(
50+
'label' => &$GLOBALS['TL_LANG']['tl_content']['sh5_additional']['property'],
51+
'inputType' => 'text',
52+
'eval' => array(
53+
'style' => 'width:290px',
54+
'nospace' => true,
55+
'rgxp' => 'alnum'
56+
)
57+
),
58+
'value' => array(
59+
'label' => &$GLOBALS['TL_LANG']['tl_content']['sh5_additional']['value'],
60+
'inputType' => 'text',
61+
'eval' => array(
62+
'style' => 'width:290px'
63+
)
64+
),
65+
),
66+
),
67+
);
68+
69+
$GLOBALS['TL_DCA']['tl_content']['fields']['sh5_pid'] = array(
70+
'inputType' => 'text',
71+
'sql' => "int(10) unsigned NOT NULL default '0'"
72+
);

contao/dca/tl_page.php

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
/**
4+
* Contao Open Source CMS
5+
* Copyright (c) 2005-2015 Leo Feyer
6+
*
7+
* @package semantic_html5
8+
* @copyright MEN AT WORK 2016
9+
* @author David Maack <[email protected]>
10+
* @license LGPL-3.0+
11+
*/
12+
13+
/**
14+
* Callbacks
15+
*/
16+
$GLOBALS['TL_DCA']['tl_page']['config']['oncopy_callback'][] = array('SemanticHTML5\Backend\Callbacks', 'oncopyPageCallback');

contao/languages/de/default.php

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
/**
4+
* Contao Open Source CMS
5+
* Copyright (c) 2005-2015 Leo Feyer
6+
*
7+
* @package semantic_html5
8+
* @copyright MEN AT WORK 2016
9+
* @author David Maack <[email protected]>
10+
* @license LGPL-3.0+
11+
*/
12+
13+
/**
14+
* CE-Elements
15+
*/
16+
$GLOBALS['TL_LANG']['CTE']['sHtml5Start'] = array('Start-Element', '');
17+
$GLOBALS['TL_LANG']['CTE']['sHtml5End'] = array('End-Element', '');
18+
$GLOBALS['TL_LANG']['CTE']['html5'] = 'HTML5-Element';

contao/languages/de/tl_content.php

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
/**
4+
* Contao Open Source CMS
5+
* Copyright (c) 2005-2015 Leo Feyer
6+
*
7+
* @package semantic_html5
8+
* @copyright MEN AT WORK 2016
9+
* @author David Maack <[email protected]>
10+
* @license LGPL-3.0+
11+
*/
12+
13+
/**
14+
* Fields
15+
*/
16+
$GLOBALS['TL_LANG']['tl_content']['sh5_type'] = array('HTML5-Elemente', 'Bitte wählen Sie den HTML5-Elementtyp aus.');
17+
$GLOBALS['TL_LANG']['tl_content']['sh5_additional'] = array('Weitere Eigenschaften', 'Hier können Sie weitere Eigenschaften eingeben, z.B. "data-rel"');
18+
$GLOBALS['TL_LANG']['tl_content']['sh5_additional']['property'] = 'Eigenschaft';
19+
$GLOBALS['TL_LANG']['tl_content']['sh5_additional']['value'] = 'Wert';
20+
21+
/**
22+
* Legends
23+
*/
24+
$GLOBALS['TL_LANG']['tl_content']['html5_legend'] = 'HTML5-Elemente';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<script>
2+
(function(){
3+
var element = document.getElementById('li_<?= $this->id ?>').firstElementChild;
4+
var children = element.children;
5+
var style = element.currentStyle || window.getComputedStyle(element);
6+
var pLeft = parseFloat(style.paddingLeft, 10);
7+
var newNode = document.createElement("DIV");
8+
9+
newNode.setAttribute(
10+
'style',
11+
'border-left: 3px solid <?= $this->color; ?>;\n\
12+
padding-left: ' + (pLeft - 3) + 'px;'
13+
);
14+
15+
//move all child noes to the new div
16+
while (children.length) {
17+
newNode.appendChild(children[0]);
18+
}
19+
//append the new div
20+
element.appendChild(newNode);
21+
})();
22+
</script>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
</<?php echo $this->sh5_type; ?>>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<<?php echo $this->sh5_type; ?> class="<?php echo $this->class; ?> block"<?php echo $this->cssID; ?><?php if ($this->style): ?> style="<?php echo $this->style; ?>"<?php endif; ?><?php echo $this->sh5_additional; ?>>
2+
<?php if ($this->headline): ?>
3+
<<?php echo $this->hl; ?>><?php echo $this->headline; ?></<?php echo $this->hl; ?>>
4+
<?php endif; ?>

0 commit comments

Comments
 (0)