Public Member Functions | |
init () | |
Constructor for the class. | |
main () | |
Main function, rendering the palette form. | |
printContent () | |
Outputting the accumulated content to screen. | |
Public Attributes | |
$content | |
$backRef | |
$formRef | |
$doc | |
$formName | |
$GPbackref | |
$inData | |
$prependFormFieldNames | |
$rec |
|
Constructor for the class.
Definition at line 247 of file alt_palette.php. 00247 { 00248 00249 // Setting GPvars, etc. 00250 $this->formName = t3lib_div::_GP('formName'); 00251 $this->GPbackref = t3lib_div::_GP('backRef'); 00252 $this->inData = t3lib_div::_GP('inData'); 00253 $this->prependFormFieldNames = t3lib_div::_GP('prependFormFieldNames'); 00254 $this->rec = t3lib_div::_GP('rec'); 00255 00256 // Making references: 00257 $this->backRef = $this->GPbackref ? $this->GPbackref : 'window.opener'; 00258 # $this->backRef = 'top.content.list_frame.view_frame'; 00259 00260 $this->formRef = $this->backRef.'.document.'.$this->formName; 00261 00262 // Start template object: 00263 $this->doc = t3lib_div::makeInstance('template'); 00264 $this->doc->bodyTagMargins['x']=0; 00265 $this->doc->bodyTagMargins['y']=0; 00266 $this->doc->form='<form action="#" method="post" name="'.htmlspecialchars($this->formName).'" onsubmit="return false;">'; 00267 $this->doc->docType = 'xhtml_trans'; 00268 $this->doc->backPath = ''; 00269 00270 // In case the palette is opened in a SEPARATE window (as the case is with frontend editing) then another body-tag id should be used (so we don't get the background image for the palette shown!) 00271 if (!$this->GPbackref) $this->doc->bodyTagId.= '-vert'; 00272 00273 // Setting JavaScript functions for the header: 00274 $this->doc->JScode = $this->doc->wrapScriptTags(' 00275 var serialNumber = ""; 00276 function timeout_func() { // 00277 if ('.$this->backRef.' && '.$this->backRef.'.document && '.$this->formRef.') { 00278 if ('.$this->formRef.'["_serialNumber"]) { 00279 if (serialNumber) { 00280 if ('.$this->formRef.'["_serialNumber"].value != serialNumber) {closePal(); return false;} 00281 } else { 00282 serialNumber = '.$this->formRef.'["_serialNumber"].value; 00283 } 00284 } 00285 window.setTimeout("timeout_func();",1*1000); 00286 } else closePal(); 00287 } 00288 function closePal() { // 00289 '.($this->GPbackref?'document.location="alt_topmenu_dummy.php";':'close();').' 00290 } 00291 timeout_func(); 00292 onBlur="alert();"; 00293 '); 00294 }
|
|
Main function, rendering the palette form.
Definition at line 301 of file alt_palette.php. References table(). 00301 { 00302 00303 $this->content=''; 00304 $this->content.=$this->doc->startPage('TYPO3 Edit Palette'); 00305 00306 $inData = explode(':',$this->inData); 00307 00308 // Begin edit: 00309 if (is_array($inData) && count($inData)==3) { 00310 00311 // Create the TCEforms object: 00312 $tceforms = $this->GPbackref ? new formRender() : new formRender_vert(); 00313 $tceforms->initDefaultBEMode(); 00314 $tceforms->palFieldTemplate='###FIELD_PALETTE###'; 00315 $tceforms->palettesCollapsed=0; 00316 $tceforms->isPalettedoc=$this->backRef; 00317 00318 $tceforms->formName = $this->formName; 00319 $tceforms->prependFormFieldNames = $this->prependFormFieldNames; 00320 00321 // Initialize other data: 00322 $table=$inData[0]; 00323 $theUid=$inData[1]; 00324 $thePalNum = $inData[2]; 00325 $this->rec['uid']=$theUid; 00326 00327 // Getting the palette fields rendered: 00328 $panel.=$tceforms->getPaletteFields($table,$this->rec,$thePalNum,'',implode(',',array_keys($this->rec))); 00329 $formContent=$panel; 00330 00331 // Add all the content, including JavaScript as needed. 00332 $this->content.=$tceforms->printNeededJSFunctions_top().$formContent.$tceforms->printNeededJSFunctions(); 00333 } 00334 }
|
|
Outputting the accumulated content to screen.
Definition at line 341 of file alt_palette.php. 00341 { 00342 echo $this->content.$this->doc->endPage(); 00343 }
|
|
Definition at line 227 of file alt_palette.php. |
|
Definition at line 226 of file alt_palette.php. |
|
Definition at line 229 of file alt_palette.php. |
|
Definition at line 232 of file alt_palette.php. |
|
Definition at line 228 of file alt_palette.php. |
|
Definition at line 233 of file alt_palette.php. |
|
Definition at line 234 of file alt_palette.php. |
|
Definition at line 235 of file alt_palette.php. |
|
Definition at line 236 of file alt_palette.php. |