// Close
$buttons['close'] = '<a href="#" onclick="' . htmlspecialchars('jumpToUrl(unescape(\'' . rawurlencode($this->P['returnUrl']) . '\')); return false;') . '">' .
- '<img' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/closedok.gif') . ' class="c-inputButton" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.closeDoc', 1) . '" alt="" />' .
- '</a>';
+ t3lib_iconWorks::getSpriteIcon('actions-document-close', array('title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.closeDoc', TRUE))) .
+ '</a>';
// Save
$buttons['save'] = '<input type="image" class="c-inputButton" name="savedok"' . t3lib_iconWorks::skinImg($this->doc->backPath, 'gfx/savedok.gif') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', 1) . '" />';
$row = t3lib_BEfunc::getRecord($this->P['table'],$this->P['uid']);
// If the save/close button was pressed, then redirect the screen:
- if ($_POST['saveandclosedok_x']) {
- header('Location: '.t3lib_div::locationHeaderUrl($this->P['returnUrl']));
- exit;
+ if ($_POST['saveandclosedok_x']) {
+ t3lib_utility_Http::redirect($this->P['returnUrl']);
}
}
} else { // If nothing has been submitted, load the $bodyText variable from the selected database row:
// Default:
if ($vv['type']=='select' || $vv['type']=='radio') {
- $thisLine[2]=str_replace(chr(10),', ',str_replace(',','',$vv['options']));
+ $thisLine[2]=str_replace(LF,', ',str_replace(',','',$vv['options']));
} elseif ($vv['type']=='check') {
if ($vv['default']) $thisLine[2]=1;
} elseif (strcmp(trim($vv['default']),'')) {
}
// Compile the final line:
- $inLines[]=ereg_replace("[\n\r]*",'',implode(' | ',$thisLine));
+ $inLines[]=preg_replace("/[\n\r]*/",'',implode(' | ',$thisLine));
}
}
// Finally, implode the lines into a string, and return it:
- return implode(chr(10),$inLines);
+ return implode(LF,$inLines);
}
/**
function cfgString2CfgArray($cfgStr) {
// Traverse the number of form elements:
- $tLines=explode(chr(10),$cfgStr);
+ $tLines=explode(LF,$cfgStr);
foreach($tLines as $k => $v) {
// Initialize:
if ($confData['type']) {
if (count($typeParts)==1) {
- $confData['fieldname'] = substr(ereg_replace('[^a-zA-Z0-9_]','',str_replace(' ','_',trim($parts[0]))),0,30);
+ $confData['fieldname'] = substr(preg_replace('/[^a-zA-Z0-9_]/','',str_replace(' ','_',trim($parts[0]))),0,30);
// Attachment names...
if ($confData['type']=='file') {
switch((string)$confData['type']) {
case 'select':
case 'radio':
- $confData['default'] = implode(chr(10),t3lib_div::trimExplode(',',$parts[2]));
+ $confData['default'] = implode(LF,t3lib_div::trimExplode(',',$parts[2]));
break;
default:
$confData['default'] = trim($parts[2]);