-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/feature/v8compatibility' into de…
…velop
- Loading branch information
Showing
10 changed files
with
172 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
Classes/ViewHelpers/Condition/IsCoreVersion8ViewHelper.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
declare(strict_types = 1); | ||
|
||
namespace JosefGlatz\BeuserFastswitch\ViewHelpers\Condition; | ||
|
||
use TYPO3\CMS\Core\Utility\VersionNumberUtility; | ||
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractConditionViewHelper; | ||
|
||
/** | ||
* Class IsCoreVersionViewHelper | ||
* | ||
* @TODO: TYPO3_8-7 support removal: ViewHelper can be removed | ||
*/ | ||
class IsCoreVersion8ViewHelper extends AbstractConditionViewHelper | ||
{ | ||
/** | ||
* Main method of this ViewHelper to check if current TYPO3 version matches 8.7 | ||
* | ||
* @param null $arguments | ||
* @return bool | ||
*/ | ||
protected static function evaluateCondition($arguments = null): bool | ||
{ | ||
$constraintVersionMax = 8999999; | ||
$constraintVersionMin = 8000000; | ||
|
||
return VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) < $constraintVersionMax | ||
&& VersionNumberUtility::convertVersionNumberToInteger(TYPO3_version) > $constraintVersionMin; | ||
} | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
public function render() | ||
{ | ||
if (static::evaluateCondition($this->arguments)) { | ||
return $this->renderThenChild(); | ||
} | ||
return $this->renderElseChild(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<html xmlns:core="http://typo3.org/ns/TYPO3/CMS/Core/ViewHelpers" | ||
xmlns:be="http://typo3.org/ns/TYPO3/CMS/Backend/ViewHelpers" | ||
xmlns:bu="http://typo3.org/ns/TYPO3/CMS/Beuser/ViewHelpers" | ||
xmlns:buf="http://typo3.org/ns/JosefGlatz/BeuserFastswitch/ViewHelpers" | ||
data-namespace-typo3-fluid="true"> | ||
<f:comment><!-- @TODO: TYPO3_8-7 support removal: Fluid partial can be completely dropped --></f:comment> | ||
<f:if condition="{users}"> | ||
<f:then> | ||
<f:for each="{users}" as="user"> | ||
<div class="beuser-fastswitch__useritem"> | ||
<div class="beuser-fastswitch__useritem-icon"> | ||
<a href="#" | ||
class="t3js-contextmenutrigger" | ||
data-table="be_users" | ||
data-uid="{user.uid}" | ||
title="Open contextmenu for user id={user.uid}"> | ||
<be:avatar backendUser="{user.uid}" showIcon="TRUE"/> | ||
</a> | ||
</div> | ||
<a class="beuser-fastswitch__useritem-title" | ||
href="{bu:editRecord(parameters: 'edit[be_users][{user.1.uid}]=edit&returnUrl={returnUrl}')}" | ||
target="_new" | ||
title="{f:translate(key: 'toolbar.beuser.fastswitch.dropdown.user.userNameTitle', arguments: {0:user.username})}{f:if(condition: '{user.description}', then: ' ({user.description})')}"> | ||
<div class="dropdown-table-title-ellipsis">{user.realName}</div> | ||
<span class="text-muted dropdown-table-title-ellipsis">{user.username}</span> | ||
</a> | ||
<div class="beuser-fastswitch__useritem-actions"> | ||
<f:render section="Info" arguments="{user: user}"/> | ||
<f:render section="Switch" arguments="{user: user}"/> | ||
</div> | ||
</div> | ||
</f:for> | ||
</f:then> | ||
</f:if> | ||
|
||
<f:section name="Info"> | ||
<a class="dropdown-table-actions-btn dropdown-table-actions-btn-edit" href="#" | ||
onclick="top.launchView('be_users', '{user.uid}'); return false;" | ||
title="{f:translate(key: 'toolbar.beuser.fastswitch.dropdown.user.btn.info', arguments: {0:user.username})}"> | ||
<core:icon identifier="actions-document-info" alternativeMarkupIdentifier="inline"/> | ||
</a> | ||
</f:section> | ||
|
||
<f:section name="Switch"> | ||
<buf:switchUser backendUser="{user}" class="dropdown-table-actions-btn dropdown-table-actions-btn-delete"/> | ||
</f:section> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,21 @@ | ||
<html xmlns:buf="http://typo3.org/ns/JosefGlatz/BeuserFastswitch/ViewHelpers" | ||
data-namespace-typo3-fluid="true"> | ||
<f:if condition="{users}"> | ||
<f:then> | ||
<f:render partial="UserList" arguments="{users: users}"/> | ||
<f:comment><!-- @TODO: TYPO3_8-7 support removal: Fluid condition can be removed --></f:comment> | ||
<buf:condition.isCoreVersion8> | ||
<f:then> | ||
<f:render partial="TYPO3_8-7/UserList" arguments="{users: users}"/> | ||
</f:then> | ||
<f:else> | ||
<f:render partial="UserList" arguments="{users: users}"/> | ||
</f:else> | ||
</buf:condition.isCoreVersion8> | ||
</f:then> | ||
<f:else> | ||
<p> | ||
{f:translate(key: 'toolbar.beuser.fastswitch.dropdown.noUsers')} | ||
</p> | ||
</f:else> | ||
</f:if> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
[ | ||
'depends' => | ||
[ | ||
'typo3' => '9.5.0-9.5.99', | ||
'typo3' => '8.7.0-9.5.99', | ||
], | ||
'conflicts' => | ||
[ | ||
|