Project

General

Profile

Bug #18429 ยป 0007832.patch

Administrator Admin, 2008-03-17 18:01

View differences:

t3lib/class.t3lib_tceforms.php (Arbeitskopie)
$item.= '<b>'.$this->getLanguageIcon($table,$row,'v'.$lKey).$lKey.':</b>';
}
$tabIdentString = 'TCEFORMS:flexform:'.$PA['itemFormElName'].$PA['_lang'];
$tabIdentStringMD5 = $GLOBALS['TBE_TEMPLATE']->getDynTabMenuId($tabIdentString);
$tabParts = array();
foreach ($tabsToTraverse as $sheet) {
list ($dataStruct, $sheet) = t3lib_div::resolveSheetDefInDS($dataStructArray,$sheet);
// Add tab/sheet to the dynNestedStack:
$this->pushToDynNestedStack('tab', $tabIdentStringMD5.'-'.(++$sheetIndex));
// Render sheet:
if (is_array($dataStruct['ROOT']) && is_array($dataStruct['ROOT']['el'])) {
......
# $item = '<div style=" position:absolute;">'.$item.'</div>';
//visibility:hidden;
} else $sheetContent='Data Structure ERROR: No ROOT element found for sheet "'.$sheet.'".';
} else {
$sheetContent='Data Structure ERROR: No ROOT element found for sheet "'.$sheet.'".';
}
// Add to tab:
$tabParts[] = array(
......
'linkTitle' => ($dataStruct['ROOT']['TCEforms']['sheetShortDescr'] ? $this->sL($dataStruct['ROOT']['TCEforms']['sheetShortDescr']) : ''),
'content' => $sheetContent
);
// Remove tab/sheet to the dynNestedStack:
$this->popFromDynNestedStack('tab', $tabIdentStringMD5.'-'.$sheetIndex);
}
if (is_array($dataStructArray['sheets'])) {
......
);
// Makes a "Add new" link:
$onClickInsert = 'new Insertion.Bottom($("'.$idTagPrefix.'"), unescape("'.rawurlencode($newElementTemplate).'").replace(/'.$idTagPrefix.'-/g,"'.$idTagPrefix.'-idx"+Math.floor(Math.random()*100000+1)+"-")); setActionStatus("'.$idTagPrefix.'"); return false;'; // Maybe there is a better way to do this than store the HTML for the new element in rawurlencoded format - maybe it even breaks with certain charsets? But for now this works...
$onClickInsert = 'TBE_EDITOR.addDynamicFlexformSection("'.$idTagPrefix.'", "'.rawurlencode($newElementTemplate).'"); return false;'; // Maybe there is a better way to do this than store the HTML for the new element in rawurlencoded format - maybe it even breaks with certain charsets? But for now this works...
$newElementsLinks[]= '<a href="#" onclick="'.htmlspecialchars($onClickInsert).'"><img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/new_el.gif','width="11" height="12"').' alt="New" title="New" align="absmiddle" />'.htmlspecialchars(t3lib_div::fixed_lgd_cs($this->sL($nCfg['tx_templavoila']['title']),30)).'</a>';
}
......
// Create on-click actions.
# $onClickCopy = 'new Insertion.After($("'.$idTagPrefix.'"), getOuterHTML("'.$idTagPrefix.'").replace(/'.$idTagPrefix.'-/g,"'.$idTagPrefix.'-copy"+Math.floor(Math.random()*100000+1)+"-")); return false;'; // Copied elements doesn't work (well) in Safari while they do in Firefox and MSIE! UPDATE: It turned out that copying doesn't work for any browser, simply because the data from the copied form never gets submitted to the server for some reason! So I decided to simply disable copying for now. If it's requested by customers we can look to enable it again and fix the issue. There is one un-fixable problem though; Copying an element like this will violate integrity if files are attached inside that element because the file reference doesn't get an absolute path prefixed to it which would be required to have TCEmain generate a new copy of the file.
$onClickRemove = 'if (confirm("Are you sure?")){$("'.$idTagPrefix.'").hide();setActionStatus("'.$idPrefix.'");} return false;';
$onClickRemove = 'if (confirm("Are you sure?")){TBE_EDITOR.removeDynamicFlexformSection("'.$idPrefix.'","'.$idTagPrefix.'");} return false;';
$onClickToggle = 'flexFormToggle("'.$idTagPrefix.'"); return false;';
$onMove = 'flexFormSortable("'.$idPrefix.'")';
typo3/jsfunc.tbe_editor.js (Arbeitskopie)
}
}
return false;
}
},
addDynamicFlexformSection: function(objectPrefix, data) {
var newObjectId = objectPrefix+'-idx'+(Math.random()*100000+1);
new Insertion.Bottom(
$(objectPrefix),
unescape(data).replace(
new RegExp('/('+objectPrefix+'-)/g'),
newObjectId+'-'
)
);
setActionStatus(objectPrefix);
},
removeDynamicFlexformSection: function(objectPrefix, objectId) {
var element = $(objectId);
if (Object.isElement(element)) {
element.hide();
setActionStatus("'.$idPrefix.'")
}
}
};
function typoSetup () {
    (1-1/1)