Commit 1b804743 authored by fgalinski's avatar fgalinski
Browse files

[FEATURE] Provides the compatibility for TYPO3 6.2

Resolves: #57341


git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/lfeditor/trunk@85420 735d13b6-9817-0410-8766-e36946ffe9aa
parent 45968958
......@@ -47,8 +47,8 @@ $EM_CONF[$_EXTKEY] = array(
'CGLcompliance_note' => '',
'constraints' => array(
'depends' => array(
'php' => '5.2.0-5.4.99',
'typo3' => '4.5.5-6.1.99',
'php' => '5.2.0-5.5.99',
'typo3' => '4.5.5-6.2.99',
),
'conflicts' => array(
),
......
......@@ -23,9 +23,6 @@
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/** t3lib_install */
require_once(PATH_t3lib . 'class.t3lib_install.php');
/**
* include some general functions only usable for the 'lfeditor' module
*/
......
......@@ -158,15 +158,19 @@ class tx_lfeditor_mod1_template {
$content .= '<fieldset class="bgColor4">' . $preMsg . '</fieldset>';
}
// Generate the module token for TYPO3 6.2
$token = self::generateModuleToken();
// generate result content
$content .= '<input type="hidden" name="constant" value="" />';
foreach ($resultArray as $langKey => $data) {
$content .= '<fieldset class="bgColor4"> <legend class="bgColor3">' .
$langKey . '</legend> <dl>';
foreach ($data as $label => $value) {
$content .= '<dt>';
$content .= '<a href="#" title="' . $label . '" ' .
'onclick="submitRedirectForm(\'constant\', \'' . $label . '\');">' .
'onclick="submitRedirectForm(\'constant\', \'' . $label . '\',\'' . $token . '\');">' .
$label . '</a></dt>';
$content .= '<dd>' . htmlspecialchars($value) . '</dd>';
}
......@@ -226,6 +230,9 @@ class tx_lfeditor_mod1_template {
$content .= '<dl class="tx-lfeditor-treeview">';
}
// Generate the module token for TYPO3 6.2
$token = self::generateModuleToken();
// recursive loop
$branches = array_keys($tree[$curDim]);
$numBranches[$curDim] = count($tree[$curDim]);
......@@ -308,8 +315,8 @@ class tx_lfeditor_mod1_template {
) . 'res/images/join' . $picAdd . '.gif" alt="join' . $picAdd . '" ' .
'style="margin-left: ' . $lineSpace . 'px; margin-right: 5px;" /> ';
$cont .= '<a href="#" title="' . $branches[$curBranch] . '" ' .
'onclick="submitRedirectForm(\'constant\', \'' . $branches[$curBranch] . '\');"> ' .
$name . '</a>';
'onclick="submitRedirectForm(\'constant\', \'' . $branches[$curBranch] . '\',
\'' . $token . '\');"> ' . $name . '</a>';
$content .= '<dd>' . $cont . '</dd>';
}
}
......@@ -405,7 +412,10 @@ class tx_lfeditor_mod1_template {
$content .= '<textarea class="tx-lfeditor-textarea" ' .
'rows="' . $textAreaRows . '" cols="80" ' .
'name="newLang[' . $lang . '][' . $constant . ']" lang="' . $textareaLanguage . '" x:lang="' . $textareaLanguage . '">';
$content .= preg_replace('/<br.*>/U', "\n", $localLang[$lang][$constant]);
if ($localLang[$lang]) {
$content .= preg_replace('/<br.*>/U', "\n", $localLang[$lang][$constant]);
}
$content .= '</textarea> </fieldset>';
}
......@@ -694,12 +704,15 @@ class tx_lfeditor_mod1_template {
}
$content .= '</tr></thead>';
// Generate the module token for TYPO3 6.2
$token = self::generateModuleToken();
// table data
$content .= '<tbody>';
foreach ($infos as $langKey => $info) {
// language shortcut
$content .= '<tr><td class="bgColor4"><a href="#" title="' . $langKey . '" ' .
'onclick="submitRedirectForm(\'language\',\'' . $langKey . '\');">' .
'onclick="submitRedirectForm(\'language\',\'' . $langKey . '\', \'' . $token . '\');">' .
$langKey . '</a></td>';
// state and constant information
......@@ -1071,6 +1084,22 @@ class tx_lfeditor_mod1_template {
return $content;
}
/**
* Generates and returns a module token for the form moduleCall and the action user_txlfeditorM1
*
* @return string
*/
protected static function generateModuleToken() {
$token = '';
if (t3lib_div::compat_version('6.2')) {
$token = '\u0026moduleToken=' . \TYPO3\CMS\Core\FormProtection\FormProtectionFactory::get()->generateToken(
'moduleCall', 'user_txlfeditorM1'
);
}
return $token;
}
}
// Default-Code for using XCLASS (dont touch)
......
......@@ -118,6 +118,9 @@ class typo3Lib {
public static function writeLocalconf($addLine, $value) {
$localconf = PATH_typo3conf . 'localconf.php';
/** t3lib_install */
require_once(PATH_t3lib . 'class.t3lib_install.php');
// get current content
$lines = file_get_contents($localconf);
if (empty($lines)) {
......
......@@ -4,10 +4,11 @@
.docheader-funcmenu select {
margin-top: 4px;
color: black;
}
#typo3-inner-docbody {
max-width: 900px;
max-width: 920px;
}
#typo3-inner-docbody input[type=text] {
......@@ -35,7 +36,7 @@ fieldset.tx-lfeditor-fieldset, fieldset.tx-lfeditor-fieldset fieldset {
}
fieldset.tx-lfeditor-fleft, fieldset.tx-lfeditor-fright {
width: 47%;
width: 46%;
}
fieldset.tx-lfeditor-fleft {
......@@ -54,6 +55,15 @@ fieldset.tx-lfeditor-fieldset legend {
border: 1px solid #AAA;
}
fieldset.tx-lfeditor-fieldset p,
fieldset.tx-lfeditor-fieldset p input {
margin: 0;
}
#typo3-inner-docbody fieldset.tx-lfeditor-fieldset p label {
vertical-align: middle;
}
fieldset.tx-lfeditor-fieldset fieldset dt {
font-weight: bold;
}
......@@ -149,6 +159,10 @@ fieldset.tx-lfeditor-fieldset fieldset dd {
margin-bottom: 5px;
}
#tx-lfeditor-caseSensitiveBox input {
margin: 0;
}
.tx-lfeditor-defaultTranslation {
padding-left: 5px;
padding-right: 5px;
......@@ -157,6 +171,7 @@ fieldset.tx-lfeditor-fieldset fieldset dd {
}
.tx-lfeditor-textarea {
margin: 0;
width: 420px;
}
......
......@@ -8,8 +8,8 @@ function submitBackupForm(filename, langFile, del, restore, deleteAll, origDiff)
document.mainForm.submit();
}
function submitRedirectForm(label, value) {
document.mainForm.elements[label].value = value;
function submitRedirectForm(label, value, token) {
document.mainForm.elements[label].value = value + token;
document.mainForm.submit();
}
......
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