Commit 3f10a613 authored by Fabian Galinski's avatar Fabian Galinski 😾
Browse files

[FEATURE] Compatibility for TYPO3 7

parent cd72120d
......@@ -36,9 +36,12 @@ class AbstractViewHelper extends AbstractBackendViewHelper {
/**
* Returns an instance of the page renderer
*
* @deprecated Implent the following migration if the extension just needs to support > 7.5.
* @return PageRenderer
*/
public function getPageRenderer() {
// Migration
// return $this->objectManager->get(\TYPO3\CMS\Core\Page\PageRenderer::class);
if (TYPO3_MODE === 'BE') {
$pageRenderer = $this->getDocInstance()->getPageRenderer();
} else {
......
......@@ -54,6 +54,11 @@ class ExtendedIfViewHelper extends AbstractConditionViewHelper {
$condition, $or = FALSE, $or2 = FALSE, $or3 = FALSE, $or4 = FALSE,
$and = TRUE, $and2 = TRUE, $and3 = TRUE, $and4 = TRUE, $negate = FALSE
) {
if ($this->evaluateConditionFunctionExists()) {
return parent::render();
}
// @todo Remove the following part if only > 7.5 support.
$conditionResult = ($condition || $or || $or2 || $or3 || $or4) && $and && $and2 && $and3 && $and4;
if ($negate ? !$conditionResult : $conditionResult) {
return $this->renderThenChild();
......@@ -61,6 +66,37 @@ class ExtendedIfViewHelper extends AbstractConditionViewHelper {
return $this->renderElseChild();
}
}
/**
* This method decides if the condition is TRUE or FALSE. It can be overriden in extending viewhelpers to adjust functionality.
*
* @param array $arguments ViewHelper arguments to evaluate the condition for this ViewHelper, allows for flexiblity in overriding this method.
* @return bool
*/
static protected function evaluateCondition($arguments = NULL) {
$conditionResult = (
isset($arguments['condition']) && $arguments['condition'] ||
isset($arguments['or']) && $arguments['or'] ||
isset($arguments['or2']) && $arguments['or2'] ||
isset($arguments['or3']) && $arguments['or3'] ||
isset($arguments['or4']) && $arguments['or4']
) && isset($arguments['and']) && $arguments['and'] &&
isset($arguments['and2']) && $arguments['and2'] &&
isset($arguments['and3']) && $arguments['and3'] &&
isset($arguments['and4']) && $arguments['and4'];
return isset($arguments['negate']) && $arguments['negate'] ? !$conditionResult : $conditionResult;
}
/**
* Returns true, if the function evaluateCondition exists in the AbstractConditionViewHelper class.
*
* @deprecated Remove this function if only > 7.5 support.
* @return boolean
*/
protected function evaluateConditionFunctionExists() {
return method_exists('TYPO3\CMS\Fluid\Core\ViewHelper\AbstractConditionViewHelper', 'evaluateCondition');
}
}
?>
\ No newline at end of file
......@@ -65,7 +65,7 @@ class LocalizationFactory extends \TYPO3\CMS\Core\Localization\LocalizationFacto
$data = $this->cacheInstance->get($hash);
if ($data !== FALSE) {
$this->store->setData($fileReference, $languageKey, $data);
return $this->store->getData($fileReference, $languageKey);
return $this->store->getDataByLanguage($fileReference, $languageKey);
}
$this->store->setConfiguration($fileReference, $languageKey, $charset);
......
......@@ -12,8 +12,7 @@
<f:be.container enableClickMenu="FALSE" loadExtJs="FALSE">
<div class="typo3-fullDoc">
<div id="typo3-docheader">
<div id="typo3-docheader-row2">
<div class="docheader-row2-left">
<div class="typo3-docheader-functions">
<f:be.menus.actionMenu>
<f:be.menus.actionMenuItem label="{f:translate(key:'function.general.general')}"
controller="General"
......@@ -99,7 +98,6 @@
</f:if>
</div>
</div>
</div>
<div id="typo3-docbody">
<div id="typo3-inner-docbody">
......
......@@ -82,16 +82,16 @@
<f:translate key="function.general.metaInfo.author" />
</legend>
<div>
<label for="name" class="tx-lfeditor-label">
<label class="tx-lfeditor-label">
<f:translate key="function.general.metaInfo.author.name" />
</label>
<f:form.textfield id="name" name="authorName" value="{infos.default.meta.authorName}" class="tx-lfeditor-input" />
</label>
</div>
<div>
<label for="email" class="tx-lfeditor-label">
<label class="tx-lfeditor-label">
<f:translate key="function.general.metaInfo.author.email" />
</label>
<f:form.textfield id="email" name="authorEmail" value="{infos.default.meta.authorEmail}" class="tx-lfeditor-input" />
</label>
</div>
</fieldset>
<fieldset class="bgColor4">
......
......@@ -12,11 +12,12 @@
<f:translate key="function.const.search.search" />
</h2>
<f:form id="contentForm" action="searchConstantSearch">
<label>
<f:form.checkbox id="caseSensitive" name="caseSensitive" value="1" checked="{searchCaseSensitive}"
class="tx-lfeditor-checkBox-bottom" />
<label for="caseSensitive">
<f:translate key="function.search.caseSensitiveCheckbox" />
</label>
<p>
<f:form.textfield name="searchStr" value="{searchString}" class="tx-lfeditor-wideField" />
<f:form.submit id="tx-lfeditor-button-submit" value="{f:translate(key:'button.search')}" />
......
......@@ -8,7 +8,7 @@
}
#typo3-inner-docbody {
max-width: 920px;
max-width: 995px;
}
#typo3-inner-docbody input[type=text][type=submit] {
......@@ -43,7 +43,7 @@ fieldset.tx-lfeditor-fieldset, fieldset.tx-lfeditor-fieldset fieldset {
}
fieldset.tx-lfeditor-fleft, fieldset.tx-lfeditor-fright {
width: 46%;
width: 48%;
}
fieldset.tx-lfeditor-fleft {
......@@ -60,6 +60,8 @@ fieldset.tx-lfeditor-fieldset legend {
padding-right: 5px;
font-weight: bold;
border: 1px solid #AAA;
width: auto;
margin: 0;
}
.tx-lfeditor-constantMaxWidth400 {
......@@ -75,7 +77,7 @@ fieldset.tx-lfeditor-fieldset p input {
}
fieldset.tx-lfeditor-fieldset p {
max-width: 410px;
max-width: 100%;
max-height: 100px;
overflow-y: scroll;
}
......@@ -199,7 +201,7 @@ fieldset.tx-lfeditor-fieldset fieldset dd {
.tx-lfeditor-textarea {
margin: 0;
width: 420px;
width: 100%;
}
.tx-lfeditor-fieldset #metaType {
......@@ -274,3 +276,8 @@ fieldset.tx-lfeditor-fieldset fieldset ul.tx-lfeditor-treeview li {
color: #0078DE;
background: #0078DE;
}
.uppercase {
padding-bottom: 6px;
border-bottom: 1px solid #CDCDCD;
}
\ No newline at end of file
{
"name": "sgalinski/lfeditor",
"type": "typo3-cms-extension",
"description": "Language File Editor",
"homepage": "https://www.sgalinski.de",
"license": ["GPL-2.0+"],
"version": "3.2.0",
"support": {
"issues": "https://forge.typo3.org/projects/extension-lfeditor"
},
"require": {
"typo3/cms-core": "*"
},
"replace": {
"lfeditor": "*"
},
"autoload": {
"psr-4": {
"SGalinski\\Lfeditor\\Controller": "Classes/"
}
}
}
......@@ -49,7 +49,7 @@ Following functions are implemented in this module:
'CGLcompliance_note' => '',
'constraints' => array(
'depends' => array(
'php' => '5.3.0-5.6.99',
'php' => '5.5.0-5.6.99',
'typo3' => '6.2.0-7.99.99',
),
'conflicts' => array(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment