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 { ...@@ -36,9 +36,12 @@ class AbstractViewHelper extends AbstractBackendViewHelper {
/** /**
* Returns an instance of the page renderer * Returns an instance of the page renderer
* *
* @deprecated Implent the following migration if the extension just needs to support > 7.5.
* @return PageRenderer * @return PageRenderer
*/ */
public function getPageRenderer() { public function getPageRenderer() {
// Migration
// return $this->objectManager->get(\TYPO3\CMS\Core\Page\PageRenderer::class);
if (TYPO3_MODE === 'BE') { if (TYPO3_MODE === 'BE') {
$pageRenderer = $this->getDocInstance()->getPageRenderer(); $pageRenderer = $this->getDocInstance()->getPageRenderer();
} else { } else {
......
...@@ -54,6 +54,11 @@ class ExtendedIfViewHelper extends AbstractConditionViewHelper { ...@@ -54,6 +54,11 @@ class ExtendedIfViewHelper extends AbstractConditionViewHelper {
$condition, $or = FALSE, $or2 = FALSE, $or3 = FALSE, $or4 = FALSE, $condition, $or = FALSE, $or2 = FALSE, $or3 = FALSE, $or4 = FALSE,
$and = TRUE, $and2 = TRUE, $and3 = TRUE, $and4 = TRUE, $negate = 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; $conditionResult = ($condition || $or || $or2 || $or3 || $or4) && $and && $and2 && $and3 && $and4;
if ($negate ? !$conditionResult : $conditionResult) { if ($negate ? !$conditionResult : $conditionResult) {
return $this->renderThenChild(); return $this->renderThenChild();
...@@ -61,6 +66,37 @@ class ExtendedIfViewHelper extends AbstractConditionViewHelper { ...@@ -61,6 +66,37 @@ class ExtendedIfViewHelper extends AbstractConditionViewHelper {
return $this->renderElseChild(); 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 ...@@ -65,7 +65,7 @@ class LocalizationFactory extends \TYPO3\CMS\Core\Localization\LocalizationFacto
$data = $this->cacheInstance->get($hash); $data = $this->cacheInstance->get($hash);
if ($data !== FALSE) { if ($data !== FALSE) {
$this->store->setData($fileReference, $languageKey, $data); $this->store->setData($fileReference, $languageKey, $data);
return $this->store->getData($fileReference, $languageKey); return $this->store->getDataByLanguage($fileReference, $languageKey);
} }
$this->store->setConfiguration($fileReference, $languageKey, $charset); $this->store->setConfiguration($fileReference, $languageKey, $charset);
......
...@@ -12,92 +12,90 @@ ...@@ -12,92 +12,90 @@
<f:be.container enableClickMenu="FALSE" loadExtJs="FALSE"> <f:be.container enableClickMenu="FALSE" loadExtJs="FALSE">
<div class="typo3-fullDoc"> <div class="typo3-fullDoc">
<div id="typo3-docheader"> <div id="typo3-docheader">
<div id="typo3-docheader-row2"> <div class="typo3-docheader-functions">
<div class="docheader-row2-left"> <f:be.menus.actionMenu>
<f:be.menus.actionMenuItem label="{f:translate(key:'function.general.general')}"
controller="General"
action="general" />
<f:be.menus.actionMenuItem label="{f:translate(key:'function.langfile.edit')}"
controller="EditFile"
action="editFile"
arguments="{buttonType: 0}" />
<f:be.menus.actionMenuItem label="{f:translate(key:'function.const.edit.edit')}"
controller="EditConstant"
action="editConstant" />
<f:if condition="{defaultLanguagePermission}">
<f:be.menus.actionMenuItem label="{f:translate(key:'function.const.add.add')}"
controller="AddConstant"
action="addConstant" />
<f:be.menus.actionMenuItem label="{f:translate(key:'function.const.delete.delete')}"
controller="DeleteConstant"
action="deleteConstant" />
<f:be.menus.actionMenuItem label="{f:translate(key:'function.const.rename.rename')}"
controller="RenameConstant"
action="renameConstant" />
</f:if>
<f:be.menus.actionMenuItem label="{f:translate(key:'function.const.search.search')}"
controller="SearchConstant"
action="searchConstant" />
<f:be.menus.actionMenuItem label="{f:translate(key:'function.const.treeview.treeview')}"
controller="ViewTree"
action="viewTree" />
<f:if condition="{editingMode} == 'extension'">
<f:be.menus.actionMenuItem label="{f:translate(key:'function.backupMgr.backupMgr')}"
controller="ManageBackups"
action="manageBackups" />
</f:if>
</f:be.menus.actionMenu>
<f:if condition="{tinyMCELoaded}">
<f:be.menus.actionMenu> <f:be.menus.actionMenu>
<f:be.menus.actionMenuItem label="{f:translate(key:'function.general.general')}" <f:if condition="{tinyMCESelected}">
controller="General" <f:then>
action="general" /> <f:be.menus.actionMenuItem label="{f:translate(key:'select.insertMode.normal')}"
<f:be.menus.actionMenuItem label="{f:translate(key:'function.langfile.edit')}" controller="General"
controller="EditFile" action="switchInsertMode"
action="editFile" arguments="{tinyMCE: 0}" />
arguments="{buttonType: 0}" /> <f:be.menus.actionMenuItem label="{f:translate(key:'select.insertMode.tinyMCE')}"
<f:be.menus.actionMenuItem label="{f:translate(key:'function.const.edit.edit')}" controller="General"
controller="EditConstant" action="switchInsertMode"
action="editConstant" /> arguments="{tinyMCE: 1}"
<f:if condition="{defaultLanguagePermission}"> additionalAttributes="{selected: 'selected'}" />
<f:be.menus.actionMenuItem label="{f:translate(key:'function.const.add.add')}" </f:then>
controller="AddConstant" <f:else>
action="addConstant" /> <f:be.menus.actionMenuItem label="{f:translate(key:'select.insertMode.normal')}"
<f:be.menus.actionMenuItem label="{f:translate(key:'function.const.delete.delete')}" controller="General"
controller="DeleteConstant" action="switchInsertMode"
action="deleteConstant" /> arguments="{tinyMCE: 0}"
<f:be.menus.actionMenuItem label="{f:translate(key:'function.const.rename.rename')}" additionalAttributes="{selected: 'selected'}" />
controller="RenameConstant" <f:be.menus.actionMenuItem label="{f:translate(key:'select.insertMode.tinyMCE')}"
action="renameConstant" /> controller="General"
</f:if> action="switchInsertMode"
<f:be.menus.actionMenuItem label="{f:translate(key:'function.const.search.search')}" arguments="{tinyMCE: 1}" />
controller="SearchConstant" </f:else>
action="searchConstant" />
<f:be.menus.actionMenuItem label="{f:translate(key:'function.const.treeview.treeview')}"
controller="ViewTree"
action="viewTree" />
<f:if condition="{editingMode} == 'extension'">
<f:be.menus.actionMenuItem label="{f:translate(key:'function.backupMgr.backupMgr')}"
controller="ManageBackups"
action="manageBackups" />
</f:if> </f:if>
</f:be.menus.actionMenu> </f:be.menus.actionMenu>
<f:if condition="{tinyMCELoaded}"> </f:if>
<f:be.menus.actionMenu> <f:if condition="{canChangeEditingModes}">
<f:if condition="{tinyMCESelected}"> <f:be.menus.actionMenu>
<f:for each="{editingModeOptions}" key="editingModeOption" as="editingModeLabel">
<f:if condition="{editingMode} == {editingModeOption}">
<f:then> <f:then>
<f:be.menus.actionMenuItem label="{f:translate(key:'select.insertMode.normal')}" <f:be.menus.actionMenuItem label="{editingModeLabel}"
controller="General"
action="switchInsertMode"
arguments="{tinyMCE: 0}" />
<f:be.menus.actionMenuItem label="{f:translate(key:'select.insertMode.tinyMCE')}"
controller="General" controller="General"
action="switchInsertMode" action="switchEditingMode"
arguments="{tinyMCE: 1}" arguments="{editingMode: editingModeOption}"
additionalAttributes="{selected: 'selected'}" /> additionalAttributes="{selected: 'selected'}" />
</f:then> </f:then>
<f:else> <f:else>
<f:be.menus.actionMenuItem label="{f:translate(key:'select.insertMode.normal')}" <f:be.menus.actionMenuItem label="{editingModeLabel}"
controller="General" controller="General"
action="switchInsertMode" action="switchEditingMode"
arguments="{tinyMCE: 0}" arguments="{editingMode: editingModeOption}" />
additionalAttributes="{selected: 'selected'}" />
<f:be.menus.actionMenuItem label="{f:translate(key:'select.insertMode.tinyMCE')}"
controller="General"
action="switchInsertMode"
arguments="{tinyMCE: 1}" />
</f:else> </f:else>
</f:if> </f:if>
</f:be.menus.actionMenu> </f:for>
</f:if> </f:be.menus.actionMenu>
<f:if condition="{canChangeEditingModes}"> </f:if>
<f:be.menus.actionMenu>
<f:for each="{editingModeOptions}" key="editingModeOption" as="editingModeLabel">
<f:if condition="{editingMode} == {editingModeOption}">
<f:then>
<f:be.menus.actionMenuItem label="{editingModeLabel}"
controller="General"
action="switchEditingMode"
arguments="{editingMode: editingModeOption}"
additionalAttributes="{selected: 'selected'}" />
</f:then>
<f:else>
<f:be.menus.actionMenuItem label="{editingModeLabel}"
controller="General"
action="switchEditingMode"
arguments="{editingMode: editingModeOption}" />
</f:else>
</f:if>
</f:for>
</f:be.menus.actionMenu>
</f:if>
</div>
</div> </div>
</div> </div>
......
...@@ -82,16 +82,16 @@ ...@@ -82,16 +82,16 @@
<f:translate key="function.general.metaInfo.author" /> <f:translate key="function.general.metaInfo.author" />
</legend> </legend>
<div> <div>
<label for="name" class="tx-lfeditor-label"> <label class="tx-lfeditor-label">
<f:translate key="function.general.metaInfo.author.name" /> <f:translate key="function.general.metaInfo.author.name" />
<f:form.textfield id="name" name="authorName" value="{infos.default.meta.authorName}" class="tx-lfeditor-input" />
</label> </label>
<f:form.textfield id="name" name="authorName" value="{infos.default.meta.authorName}" class="tx-lfeditor-input" />
</div> </div>
<div> <div>
<label for="email" class="tx-lfeditor-label"> <label class="tx-lfeditor-label">
<f:translate key="function.general.metaInfo.author.email" /> <f:translate key="function.general.metaInfo.author.email" />
<f:form.textfield id="email" name="authorEmail" value="{infos.default.meta.authorEmail}" class="tx-lfeditor-input" />
</label> </label>
<f:form.textfield id="email" name="authorEmail" value="{infos.default.meta.authorEmail}" class="tx-lfeditor-input" />
</div> </div>
</fieldset> </fieldset>
<fieldset class="bgColor4"> <fieldset class="bgColor4">
......
...@@ -12,11 +12,12 @@ ...@@ -12,11 +12,12 @@
<f:translate key="function.const.search.search" /> <f:translate key="function.const.search.search" />
</h2> </h2>
<f:form id="contentForm" action="searchConstantSearch"> <f:form id="contentForm" action="searchConstantSearch">
<f:form.checkbox id="caseSensitive" name="caseSensitive" value="1" checked="{searchCaseSensitive}" <label>
class="tx-lfeditor-checkBox-bottom" /> <f:form.checkbox id="caseSensitive" name="caseSensitive" value="1" checked="{searchCaseSensitive}"
<label for="caseSensitive"> class="tx-lfeditor-checkBox-bottom" />
<f:translate key="function.search.caseSensitiveCheckbox" /> <f:translate key="function.search.caseSensitiveCheckbox" />
</label> </label>
<p> <p>
<f:form.textfield name="searchStr" value="{searchString}" class="tx-lfeditor-wideField" /> <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')}" /> <f:form.submit id="tx-lfeditor-button-submit" value="{f:translate(key:'button.search')}" />
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
} }
#typo3-inner-docbody { #typo3-inner-docbody {
max-width: 920px; max-width: 995px;
} }
#typo3-inner-docbody input[type=text][type=submit] { #typo3-inner-docbody input[type=text][type=submit] {
...@@ -43,7 +43,7 @@ fieldset.tx-lfeditor-fieldset, fieldset.tx-lfeditor-fieldset fieldset { ...@@ -43,7 +43,7 @@ fieldset.tx-lfeditor-fieldset, fieldset.tx-lfeditor-fieldset fieldset {
} }
fieldset.tx-lfeditor-fleft, fieldset.tx-lfeditor-fright { fieldset.tx-lfeditor-fleft, fieldset.tx-lfeditor-fright {
width: 46%; width: 48%;
} }
fieldset.tx-lfeditor-fleft { fieldset.tx-lfeditor-fleft {
...@@ -60,6 +60,8 @@ fieldset.tx-lfeditor-fieldset legend { ...@@ -60,6 +60,8 @@ fieldset.tx-lfeditor-fieldset legend {
padding-right: 5px; padding-right: 5px;
font-weight: bold; font-weight: bold;
border: 1px solid #AAA; border: 1px solid #AAA;
width: auto;
margin: 0;
} }
.tx-lfeditor-constantMaxWidth400 { .tx-lfeditor-constantMaxWidth400 {
...@@ -75,7 +77,7 @@ fieldset.tx-lfeditor-fieldset p input { ...@@ -75,7 +77,7 @@ fieldset.tx-lfeditor-fieldset p input {
} }
fieldset.tx-lfeditor-fieldset p { fieldset.tx-lfeditor-fieldset p {
max-width: 410px; max-width: 100%;
max-height: 100px; max-height: 100px;
overflow-y: scroll; overflow-y: scroll;
} }
...@@ -199,7 +201,7 @@ fieldset.tx-lfeditor-fieldset fieldset dd { ...@@ -199,7 +201,7 @@ fieldset.tx-lfeditor-fieldset fieldset dd {
.tx-lfeditor-textarea { .tx-lfeditor-textarea {
margin: 0; margin: 0;
width: 420px; width: 100%;
} }
.tx-lfeditor-fieldset #metaType { .tx-lfeditor-fieldset #metaType {
...@@ -273,4 +275,9 @@ fieldset.tx-lfeditor-fieldset fieldset ul.tx-lfeditor-treeview li { ...@@ -273,4 +275,9 @@ fieldset.tx-lfeditor-fieldset fieldset ul.tx-lfeditor-treeview li {
.handle-highlight { .handle-highlight {
color: #0078DE; color: #0078DE;
background: #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: ...@@ -49,7 +49,7 @@ Following functions are implemented in this module:
'CGLcompliance_note' => '', 'CGLcompliance_note' => '',
'constraints' => array( 'constraints' => array(
'depends' => array( 'depends' => array(
'php' => '5.3.0-5.6.99', 'php' => '5.5.0-5.6.99',
'typo3' => '6.2.0-7.99.99', 'typo3' => '6.2.0-7.99.99',
), ),
'conflicts' => array( '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