Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
services
t3o sites
typo3.org
typo3_roadmap
Commits
1a0745a2
Commit
1a0745a2
authored
Feb 24, 2016
by
Oliver Hader
Browse files
[TASK] Integrate TYPO3 & PHP version matrix
parent
d6030e87
Changes
3
Hide whitespace changes
Inline
Side-by-side
Classes/ViewHelpers/Condition/InArrayViewHelper.php
0 → 100644
View file @
1a0745a2
<?php
class
Tx_Typo3Roadmap_ViewHelpers_Condition_InArrayViewHelper
extends
Tx_Fluid_Core_ViewHelper_AbstractConditionViewHelper
{
/**
* @param string $needle
* @param array $array
* @param null $arrayPath
* @return string
*/
public
function
render
(
$needle
,
array
$array
,
$arrayPath
=
null
)
{
if
(
$this
->
inArray
(
$needle
,
$array
,
$arrayPath
))
{
return
$this
->
renderThenChild
();
}
else
{
return
$this
->
renderElseChild
();
}
}
/**
* @param string $needle
* @param array $array
* @param $arrayPath
* @return bool
*/
protected
function
inArray
(
$needle
,
array
$array
,
$arrayPath
)
{
foreach
(
$array
as
$key
=>
$value
)
{
if
(
$arrayPath
!==
null
)
{
$arrayValue
=
Tx_Extbase_Reflection_ObjectAccess
::
getPropertyPath
(
$value
,
$arrayPath
);
if
(
$needle
===
$arrayValue
)
{
return
true
;
}
}
elseif
(
$needle
===
$value
)
{
return
true
;
}
}
return
false
;
}
}
\ No newline at end of file
Resources/Private/Templates/Roadmap.html
View file @
1a0745a2
{namespace roadmap=Tx_Typo3Roadmap_ViewHelpers}
<h3>
Charts
</h3>
<div
id=
"charts"
style=
"height: 300px;"
></div>
...
...
@@ -38,5 +38,38 @@
</div>
<h3>
PHP Compatibility Chart
</h3>
<f:format.html>
{phpTable}
</f:format.html>
<table
border=
"1"
>
<thead>
<tr>
<th>
PHP versions
</th>
<f:for
each=
"{majorVersions}"
as=
"majorVersion"
>
<th>
<strong>
TYPO3 {majorVersion.title}
</strong><br>
{f:format.date(date:majorVersion.developmentstart,format:'Y')}
- {f:format.date(date:majorVersion.regularsupport,format:'Y')}
</th>
</f:for>
</tr>
</thead>
<tbody>
<f:for
each=
"{phpVersions}"
as=
"phpVersion"
>
<tr>
<td>
PHP {phpVersion.version}
</td>
<f:for
each=
"{majorVersions}"
as=
"majorVersion"
>
<td>
<roadmap:condition.inArray
needle=
"{phpVersion.uid}"
array=
"{majorVersion.phpVersions}"
arrayPath=
"uid"
>
<f:then>
yes
</f:then>
<f:else>
no
</f:else>
</roadmap:condition.inArray>
</td>
</f:for>
</tr>
</f:for>
</tbody>
</table>
pi1/class.tx_typo3roadmap_pi1.php
View file @
1a0745a2
...
...
@@ -79,15 +79,17 @@ class tx_typo3roadmap_pi1 extends tslib_pibase
$this
->
pi_loadLL
();
$this
->
initializeView
();
$this
->
db
=
$GLOBALS
[
'TYPO3_DB'
];
$this
->
pageRenderer
=
$
GLOBALS
[
'TSFE'
]
->
getPageRenderer
();
$this
->
pageRenderer
=
$
this
->
getFrontendController
()
->
getPageRenderer
();
$majorVersions
=
$this
->
getMajorVersions
();
$phpVersions
=
$this
->
getAllAvailablePHPVersions
();
$this
->
renderCharts
(
$majorVersions
);
$this
->
view
->
assign
(
'majors'
,
$majorVersions
);
$this
->
view
->
assign
(
'ceUid'
,
$this
->
cObj
->
data
[
'uid'
]);
$this
->
view
->
assign
(
'php
Table'
,
$this
->
renderPHPCompatibilityMatrix
(
$this
->
getAllAvailablePHP
Versions
()
,
$
major
Versions
)
)
;
$this
->
view
->
assign
(
'phpVersions
'
,
$
php
Versions
);
$this
->
view
->
assign
(
'majorVersions'
,
$majorVersions
);
$content
.
=
$this
->
view
->
render
();
...
...
@@ -118,6 +120,11 @@ class tx_typo3roadmap_pi1 extends tslib_pibase
'sorting'
);
foreach
(
$rows
as
$index
=>
$singleRow
)
{
foreach
(
$singleRow
as
$fieldName
=>
$fieldValue
)
{
if
(
t3lib_div
::
testInt
(
$fieldValue
))
{
$rows
[
$index
][
$fieldName
]
=
(
int
)
$fieldValue
;
}
}
$rows
[
$index
][
'minorversions'
]
=
$this
->
getMinorVersions
(
$singleRow
[
'uid'
]);
$rows
[
$index
][
'phpVersions'
]
=
$this
->
getSupportedPHPVersions
(
$singleRow
[
'uid'
]);
}
...
...
@@ -144,6 +151,10 @@ class tx_typo3roadmap_pi1 extends tslib_pibase
return
$rows
;
}
/**
* @param int $majorVersion
* @return array
*/
protected
function
getSupportedPHPVersions
(
$majorVersion
)
{
$rows
=
$this
->
db
->
exec_SELECTgetRows
(
...
...
@@ -344,6 +355,13 @@ class tx_typo3roadmap_pi1 extends tslib_pibase
return
$data
;
}
/**
* @param array $allVersions
* @param array $majorVersions
* @return string
*
* @deprecated Not used anymore
*/
protected
function
renderPHPCompatibilityMatrix
(
array
$allVersions
,
array
$majorVersions
)
{
$content
=
'<table border="1">'
;
...
...
@@ -356,4 +374,12 @@ class tx_typo3roadmap_pi1 extends tslib_pibase
return
$content
;
}
/**
* @return tslib_fe
*/
protected
function
getFrontendController
()
{
return
$GLOBALS
[
'TSFE'
];
}
}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment