00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00061 require('init.php');
00062 require('template.php');
00063 require_once(PATH_t3lib.'class.t3lib_tceforms.php');
00064 require_once(PATH_t3lib.'class.t3lib_transferdata.php');
00065 require_once(PATH_t3lib.'class.t3lib_loaddbgroup.php');
00066 $LANG->includeLLFile('EXT:lang/locallang_alt_doc.xml');
00067
00068
00069
00070
00071
00072
00081 class formRender extends t3lib_TCEforms {
00082
00091 function printPalette($palArr) {
00092 $out='';
00093
00094
00095 foreach($palArr as $content) {
00096 $iRow[]='
00097 <td>'.
00098 '<img name="req_'.$content['TABLE'].'_'.$content['ID'].'_'.$content['FIELD'].'" class="c-reqIcon" src="clear.gif" width="10" height="10" alt="" />'.
00099 '<img name="cm_'.$content['TABLE'].'_'.$content['ID'].'_'.$content['FIELD'].'" class="c-cmIcon" src="clear.gif" width="7" height="10" alt="" />'.
00100 '</td>
00101 <td class="c-label">'.
00102 $content['NAME'].' '.
00103 '</td>
00104 <td class="c-csh">'.
00105 $content['ITEM'].$content['HELP_ICON'].
00106 '</td>';
00107 }
00108
00109
00110 $out='
00111
00112
00113
00114 <!--
00115 TCEforms palette, rendered in top frame.
00116 -->
00117 <table border="0" cellpadding="0" cellspacing="0" id="typo3-TCEforms-palette">
00118 <tr>
00119 <td class="c-close">'.
00120 '<a href="#" onclick="closePal();return false;"><img'.t3lib_iconWorks::skinImg('','gfx/close_12h.gif','width="11" height="12"').' title="'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.close',1).'" alt="" /></a>'.
00121 '</td>'.
00122 implode('',$iRow).'
00123 </tr>
00124 </table>
00125
00126 ';
00127
00128
00129 return $out;
00130 }
00131 }
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00154 class formRender_vert extends t3lib_TCEforms {
00155
00163 function printPalette($palArr) {
00164 $out='';
00165 $bgColor=' bgcolor="'.$this->colorScheme[2].'"';
00166
00167
00168 foreach($palArr as $content) {
00169 $iRow[]='
00170 <tr>
00171 <td><img src="clear.gif" width="'.intval($this->paletteMargin).'" height="1" alt="" /></td>
00172 <td'.$bgColor.'> </td>
00173 <td nowrap="nowrap"'.$bgColor.'><font color="'.$this->colorScheme[4].'">'.$content['NAME'].'</font></td>
00174 </tr>';
00175 $iRow[]='
00176 <tr>
00177 <td></td>
00178 <td valign="top"><img name="req_'.$content['TABLE'].'_'.$content['ID'].'_'.$content['FIELD'].'" src="clear.gif" width="10" height="10" vspace="4" alt="" /><img name="cm_'.$content['TABLE'].'_'.$content['ID'].'_'.$content['FIELD'].'" src="clear.gif" width="7" height="10" vspace="4" alt="" /></td>
00179 <td nowrap="nowrap" valign="top">'.$content['ITEM'].$content['HELP_ICON'].'</td>
00180 </tr>';
00181 }
00182
00183
00184 $iRow[]='
00185 <tr>
00186 <td></td>
00187 <td></td>
00188 <td nowrap="nowrap" valign="top">
00189 <br />
00190 <input type="submit" value="'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.close',1).'" onclick="closePal(); return false;" />
00191 </td>
00192 </tr>';
00193
00194
00195 $out='
00196 <table border="0" cellpadding="0" cellspacing="0" id="typo3-TCEforms-palette-vert">
00197 '.implode('',$iRow).'
00198 </table>';
00199
00200
00201 return $out;
00202 }
00203 }
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00223 class SC_alt_palette {
00224
00225
00226 var $content;
00227 var $backRef;
00228 var $formRef;
00229 var $doc;
00230
00231
00232 var $formName;
00233 var $GPbackref;
00234 var $inData;
00235 var $prependFormFieldNames;
00236 var $rec;
00237
00238
00239
00240
00241
00247 function init() {
00248
00249
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
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
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
00271 if (!$this->GPbackref) $this->doc->bodyTagId.= '-vert';
00272
00273
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 }
00295
00301 function main() {
00302
00303 $this->content='';
00304 $this->content.=$this->doc->startPage('TYPO3 Edit Palette');
00305
00306 $inData = explode(':',$this->inData);
00307
00308
00309 if (is_array($inData) && count($inData)==3) {
00310
00311
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
00322 $table=$inData[0];
00323 $theUid=$inData[1];
00324 $thePalNum = $inData[2];
00325 $this->rec['uid']=$theUid;
00326
00327
00328 $panel.=$tceforms->getPaletteFields($table,$this->rec,$thePalNum,'',implode(',',array_keys($this->rec)));
00329 $formContent=$panel;
00330
00331
00332 $this->content.=$tceforms->printNeededJSFunctions_top().$formContent.$tceforms->printNeededJSFunctions();
00333 }
00334 }
00335
00341 function printContent() {
00342 echo $this->content.$this->doc->endPage();
00343 }
00344 }
00345
00346
00347 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_palette.php']) {
00348 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/alt_palette.php']);
00349 }
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363 $SOBE = t3lib_div::makeInstance('SC_alt_palette');
00364 $SOBE->init();
00365 $SOBE->main();
00366 $SOBE->printContent();
00367 ?>