Project

General

Profile

Bug #17907 » class.t3lib_tsfebeuserauth.diff

Administrator Admin, 2007-12-11 20:08

View differences:

/opt/lampp/htdocs/typo3_src-4.1.3.orig/t3lib/class.t3lib_tsfebeuserauth.php 2007-10-22 02:26:45.000000000 +0200
<?php
<?php
/***************************************************************
* Copyright notice
*
......
$header='
<tr class="typo3-adminPanel-hRow" style="background-color:#9ba1a8;">
<td colspan="4" style="white-space:nowrap">'.
$this->extItemLink('top','<img src="'.TYPO3_mainDir.'gfx/ol/'.($this->uc['TSFE_adminConfig']['display_top']?'minus':'plus').'bullet.gif" width="18" height="16" style="vertical-align:middle; border=0px" alt="" /><strong>'.$this->extFw($this->extGetLL('adminOptions')).'</strong>').
<td colspan="4" nowrap="nowrap">'.
$this->extItemLink('top','<img src="'.TYPO3_mainDir.'gfx/ol/'.($this->uc['TSFE_adminConfig']['display_top']?'minus':'plus').'bullet.gif" width="18" height="16" align="absmiddle" border="0" alt="" /><strong>'.$this->extFw($this->extGetLL('adminOptions')).'</strong>').
$this->extFw(': '.$this->user['username']).'
<img src="clear.gif" width="40" height="1" alt="" />
<input type="hidden" name="TSFE_ADMIN_PANEL[display_top]" value="'.$this->uc['TSFE_adminConfig']['display_top'].'" />'.($this->extNeedUpdate?'<input type="submit" value="'.$this->extGetLL('update').'" />':'').'</td>
......
$query = !t3lib_div::_GET('id') ? ('<input type="hidden" name="id" value="'.$GLOBALS['TSFE']->id.'" />'.chr(10)) : '';
// the dummy field is needed for Firefox: to force a page reload on submit with must change the form value with JavaScript (see "onsubmit" attribute of the "form" element")
$query.= '<input type="hidden" name="TSFE_ADMIN_PANEL[DUMMY]" value="" />';
$query.= '<input type="hidden" name="TSFE_ADMIN_PANEL[DUMMY]" value="">';
foreach (t3lib_div::_GET() as $k => $v) {
if ($k != 'TSFE_ADMIN_PANEL') {
if (is_array($v)) {
$query.=$this->extPrintFeAdminDialogHiddenFields($k,$v);
} else {
$query.='<input type="hidden" name="'.$k.'" value="'.htmlspecialchars($v).'" />'.chr(10);
$query.='<input type="hidden" name="'.$k.'" value="'.htmlspecialchars($v).'">'.chr(10);
}
}
}
......
ADMIN PANEL
-->
<a name="TSFE_ADMIN"></a>
<form id="TSFE_ADMIN_PANEL_FORM" action="'.htmlspecialchars(t3lib_div::getIndpEnv('SCRIPT_NAME')).'#TSFE_ADMIN" method="get" style="margin:0;" onsubmit="document.forms.TSFE_ADMIN_PANEL_FORM[\'TSFE_ADMIN_PANEL[DUMMY]\'].value=Math.random().toString().substring(2,8)">'.
<form name="TSFE_ADMIN_PANEL_FORM" action="'.htmlspecialchars(t3lib_div::getIndpEnv('SCRIPT_NAME')).'#TSFE_ADMIN" method="get" style="margin:0;" onsubmit="document.forms.TSFE_ADMIN_PANEL_FORM[\'TSFE_ADMIN_PANEL[DUMMY]\'].value=Math.random().toString().substring(2,8)">'.
$query.
' <table border="0" cellpadding="0" cellspacing="0" class="typo3-adminPanel" style="background-color:#f6f2e6; border: 1px solid black; z-index:0; position:absolute;">'.$header.$out.'
</table>
......
// TSFEtypo3FormFieldSet()
function TSFEtypo3FormFieldSet(theField, evallist, is_in, checkbox, checkboxValue) { //
var theFObj = new evalFunc_dummy (evallist,is_in, checkbox, checkboxValue);
var theValue = document.getElementById("TSFE_ADMIN_PANEL_FORM")[theField].value;
var theValue = document.TSFE_ADMIN_PANEL_FORM[theField].value;
if (checkbox && theValue==checkboxValue) {
document.getElementById("TSFE_ADMIN_PANEL_FORM")[theField+"_hr"].value="";
document.getElementById("TSFE_ADMIN_PANEL_FORM")[theField+"_cb"].checked = "";
document.TSFE_ADMIN_PANEL_FORM[theField+"_hr"].value="";
document.TSFE_ADMIN_PANEL_FORM[theField+"_cb"].checked = "";
} else {
document.getElementById("TSFE_ADMIN_PANEL_FORM")[theField+"_hr"].value = evalFunc.outputObjValue(theFObj, theValue);
document.getElementById("TSFE_ADMIN_PANEL_FORM")[theField+"_cb"].checked = "on";
document.TSFE_ADMIN_PANEL_FORM[theField+"_hr"].value = evalFunc.outputObjValue(theFObj, theValue);
document.TSFE_ADMIN_PANEL_FORM[theField+"_cb"].checked = "on";
}
}
// TSFEtypo3FormFieldGet()
function TSFEtypo3FormFieldGet(theField, evallist, is_in, checkbox, checkboxValue, checkbox_off) { //
var theFObj = new evalFunc_dummy (evallist,is_in, checkbox, checkboxValue);
if (checkbox_off) {
document.getElementById("TSFE_ADMIN_PANEL_FORM")[theField].value=checkboxValue;
document.TSFE_ADMIN_PANEL_FORM[theField].value=checkboxValue;
}else{
document.getElementById("TSFE_ADMIN_PANEL_FORM")[theField].value = evalFunc.evalObjValue(theFObj, document.getElementById("TSFE_ADMIN_PANEL_FORM")[theField+"_hr"].value);
document.TSFE_ADMIN_PANEL_FORM[theField].value = evalFunc.evalObjValue(theFObj, document.TSFE_ADMIN_PANEL_FORM[theField+"_hr"].value);
}
TSFEtypo3FormFieldSet(theField, evallist, is_in, checkbox, checkboxValue);
}
/*]]>*/
</script>';
if($this->extJSCODE) {
'<script type="text/javascript">'.$this->extJSCODE.'</script>';
}
</script>
<script language="javascript" type="text/javascript">'.$this->extJSCODE.'</script>';
}
return "\n\n\n\n".$out;
return "\n\n\n\n".$out.'<br />';
}
/**
......
if (is_array($v)) {
$out.=$this->extPrintFeAdminDialogHiddenFields($key.'['.$k.']',$v);
} else {
$out.='<input type="hidden" name="'.$key.'['.$k.']" value="'.htmlspecialchars($v).'" />'.chr(10);
$out.='<input type="hidden" name="'.$key.'['.$k.']" value="'.htmlspecialchars($v).'">'.chr(10);
}
}
return $out;
......
$this->extGetTreeList($GLOBALS['TSFE']->id, $depth,0,$this->getPagePermsClause(1));
reset($this->extPageInTreeInfo);
while(list(,$row)=each($this->extPageInTreeInfo)) {
$outTable.='<tr><td style="white-space:nowrap"><img src="clear.gif" width="'.(($depth+1-$row[2])*18).'" height="1" alt="" /><img src="'.TYPO3_mainDir.'gfx/i/pages.gif" width="18" height="16" style="vertical-align:middle; border=0px" alt="" />'.$this->extFw($row[1]).'</td><td><img src="clear.gif" width="10" height="1" alt="" /></td><td>'.$this->extFw($this->extGetNumberOfCachedPages($row[0])).'</td></tr>';
$outTable.='<tr><td nowrap="nowrap"><img src="clear.gif" width="'.(($depth+1-$row[2])*18).'" height="1" alt="" /><img src="'.TYPO3_mainDir.'gfx/i/pages.gif" width="18" height="16" align="absmiddle" border="0" alt="" />'.$this->extFw($row[1]).'</td><td><img src="clear.gif" width="10" height="1" alt="" /></td><td>'.$this->extFw($this->extGetNumberOfCachedPages($row[0])).'</td></tr>';
}
$outTable='<br /><table border="0" cellpadding="0" cellspacing="0">'.$outTable.'</table>';
$outTable.='<input type="submit" name="TSFE_ADMIN_PANEL[action][clearCache]" value="'.$this->extGetLL('cache_doit').'" />';
......
$this->extGetTreeList($GLOBALS['TSFE']->id, $depth,0,$this->getPagePermsClause(1));
reset($this->extPageInTreeInfo);
while(list(,$row)=each($this->extPageInTreeInfo)) {
$outTable.='<tr><td style="white-space:nowrap"><img src="clear.gif" width="'.(($depth+1-$row[2])*18).'" height="1" alt="" /><img src="'.TYPO3_mainDir.'gfx/i/pages.gif" width="18" height="16" style="vertical-align:middle; border=0px" alt="" />'.$this->extFw($row[1]).'</td><td><img src="clear.gif" width="10" height="1" alt="" /></td><td>'.$this->extFw('...').'</td></tr>';
$outTable.='<tr><td nowrap="nowrap"><img src="clear.gif" width="'.(($depth+1-$row[2])*18).'" height="1" alt="" /><img src="'.TYPO3_mainDir.'gfx/i/pages.gif" width="18" height="16" align="absmiddle" border="0" alt="" />'.$this->extFw($row[1]).'</td><td><img src="clear.gif" width="10" height="1" alt="" /></td><td>'.$this->extFw('...').'</td></tr>';
}
$outTable='<br /><table border="0" cellpadding="0" cellspacing="0">'.$outTable.'</table>';
$outTable.='<input type="submit" name="TSFE_ADMIN_PANEL[action][publish]" value="'.$this->extGetLL('publish_doit').'" />';
......
$content.=$this->extGetItem('tsdebug_displayQueries', '<input type="hidden" name="TSFE_ADMIN_PANEL[tsdebug_displayQueries]" value="0" /><input type="checkbox" name="TSFE_ADMIN_PANEL[tsdebug_displayQueries]" value="1"'.($this->uc['TSFE_adminConfig']['tsdebug_displayQueries']?' checked="checked"':'').' />');
$content.=$this->extGetItem('tsdebug_forceTemplateParsing', '<input type="hidden" name="TSFE_ADMIN_PANEL[tsdebug_forceTemplateParsing]" value="0" /><input type="checkbox" name="TSFE_ADMIN_PANEL[tsdebug_forceTemplateParsing]" value="1"'.($this->uc['TSFE_adminConfig']['tsdebug_forceTemplateParsing']?' checked="checked"':'').' />');
$out.='<tr><td colspan="4" style="white-space:nowrap"><table border="0" cellpadding="0" cellspacing="0">'.$content.'</table></td></tr>';
$out.='<tr><td colspan="4" nowrap="nowrap"><table border="0" cellpadding="0" cellspacing="0">'.$content.'</table></td></tr>';
$GLOBALS['TT']->printConf['flag_tree'] = $this->extGetFeAdminValue('tsdebug','tree');
$GLOBALS['TT']->printConf['allTime'] = $this->extGetFeAdminValue('tsdebug','displayTimes');
......
* @see extGetItem()
*/
function extGetHead($pre) {
$out.='<img src="'.TYPO3_mainDir.'gfx/ol/blank.gif" width="18" height="16" style="vertical-align:middle; border=0px" alt="" />';
$out.='<img src="'.TYPO3_mainDir.'gfx/ol/'.($this->uc['TSFE_adminConfig']['display_'.$pre]?'minus':'plus').'bullet.gif" width="18" height="16" style="vertical-align:middle; border=0px" alt="" />';
$out.='<img src="'.TYPO3_mainDir.'gfx/ol/blank.gif" width="18" height="16" align="absmiddle" border="0" alt="" />';
$out.='<img src="'.TYPO3_mainDir.'gfx/ol/'.($this->uc['TSFE_adminConfig']['display_'.$pre]?'minus':'plus').'bullet.gif" width="18" height="16" align="absmiddle" border="0" alt="" />';
$out.=$this->extFw($this->extGetLL($pre));
$out=$this->extItemLink($pre,$out);
return '
<tr class="typo3-adminPanel-itemHRow" style="background-color:#abbbb4;">
<td colspan="4" style="border-top:dashed 1px #007a8c;white-space:nowrap">'.$out.'<input type="hidden" name="TSFE_ADMIN_PANEL[display_'.$pre.']" value="'.$this->uc['TSFE_adminConfig']['display_'.$pre].'" /></td>
<td colspan="4" nowrap="nowrap" style="border-top:dashed 1px #007a8c;">'.$out.'<input type="hidden" name="TSFE_ADMIN_PANEL[display_'.$pre.']" value="'.$this->uc['TSFE_adminConfig']['display_'.$pre].'" /></td>
</tr>';
}
......
*/
function extItemLink($pre,$str) {
return '<a href="#" style="text-decoration:none;" onclick="'.
htmlspecialchars('document.getElementById("TSFE_ADMIN_PANEL_FORM")[\'TSFE_ADMIN_PANEL[display_'.$pre.']\'].value='.($this->uc['TSFE_adminConfig']['display_'.$pre]?'0':'1').'; document.getElementById("TSFE_ADMIN_PANEL_FORM").submit(); return false;').
htmlspecialchars('document.TSFE_ADMIN_PANEL_FORM[\'TSFE_ADMIN_PANEL[display_'.$pre.']\'].value='.($this->uc['TSFE_adminConfig']['display_'.$pre]?'0':'1').'; document.TSFE_ADMIN_PANEL_FORM.submit(); return false;').
'">'.$str.'</a>';
}
......
return '
<tr class="typo3-adminPanel-itemRow">
<td><img src="clear.gif" width="50" height="1" alt="" /></td>
<td style="white-space:nowrap">'.($pre ? $this->extFw($this->extGetLL($pre)) : '&nbsp;').'</td>
<td nowrap="nowrap">'.($pre ? $this->extFw($this->extGetLL($pre)) : '&nbsp;').'</td>
<td><img src="clear.gif" width="40" height="1" alt="" /></td>
<td>'.$element.'</td>
</tr>';
......
* @return string
*/
function extFw($str) {
return '<span style="font-family: verdana, arial; font-size: 1em; font-color:#000">'.$str.'</span>';
return '<font face="verdana,arial" size="1" color="black">'.$str.'</font>';
}
/**
(1-1/2)