Project

General

Profile

Bug #17932 » 20071217_csh_popup.diff

Administrator Admin, 2007-12-17 18:14

View differences:

t3lib/class.t3lib_tceforms.php (Arbeitskopie)
*/
function helpTextIcon($table,$field,$force=0) {
if ($this->globalShowHelp && $GLOBALS['TCA_DESCR'][$table]['columns'][$field] && (($this->edit_showFieldHelp=='icon'&&!$this->doLoadTableDescr($table)) || $force)) {
$aOnClick = 'vHWin=window.open(\''.$this->backPath.'view_help.php?tfID='.($table.'.'.$field).'\',\'viewFieldHelp\',\'height=400,width=600,status=0,menubar=0,scrollbars=1\');vHWin.focus();return false;';
return '<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.
'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/helpbubble.gif','width="14" height="14"').' hspace="2" border="0" class="absmiddle"'.($GLOBALS['CLIENT']['FORMSTYLE']?' style="cursor:help;"':'').' alt="" />'.
'</a>';
return t3lib_befunc::cshItem($table,$field,$this->backPath, '', true);
} else {
// Detects fields with no CSH and outputs dummy line to insert into CSH locallang file:
#debug(array("'".$field.".description' => '[FILL IN] ".$table."->".$field."',"),$table);
t3lib/class.t3lib_befunc.php (Arbeitskopie)
* @param string Table name
* @param string Field name
* @param string Back path
* @param boolean Force display of icon nomatter BE_USER setting for help
* @return string HTML content for a help icon/text
*/
function helpTextIcon($table,$field,$BACK_PATH,$force=0) {
function helpTextIcon($table,$field,$BACK_PATH) {
global $TCA_DESCR,$BE_USER;
if (is_array($TCA_DESCR[$table]) && is_array($TCA_DESCR[$table]['columns'][$field]) && ($BE_USER->uc['edit_showFieldHelp']=='icon' || $force)) {
if (is_array($TCA_DESCR[$table]) && is_array($TCA_DESCR[$table]['columns'][$field])) {
$onClick = 'vHWin=window.open(\''.$BACK_PATH.'view_help.php?tfID='.($table.'.'.$field).'\',\'viewFieldHelp\',\'height=400,width=600,status=0,menubar=0,scrollbars=1\');vHWin.focus();return false;';
return '<a href="#" onclick="'.htmlspecialchars($onClick).'">'.
'<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/helpbubble.gif','width="14" height="14"').' hspace="2" border="0" class="typo3-csh-icon" alt="" />'.
'</a>';
$text = t3lib_BEfunc::helpText($table,$field,$BACK_PATH);
return '<span><a class="typo3-csh-link" href="#" onclick="'.htmlspecialchars($onClick).'">'.
'<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/helpbubble.gif','width="14" height="14"').' hspace="2" border="0" class="typo3-csh-icon" alt="" /><span class="typo3-csh-inline">'.$text.'</span></a></span>';
}
}
......
* @param string Table name
* @param string Field name
* @param string Back path
* @param string Additional style-attribute content for wrapping table
* @return string HTML content for help text
* @return string help text
*/
function helpText($table,$field,$BACK_PATH,$styleAttrib='') {
function helpText($table,$field,$BACK_PATH) {
global $TCA_DESCR,$BE_USER;
if (is_array($TCA_DESCR[$table]) && is_array($TCA_DESCR[$table]['columns'][$field]) && $BE_USER->uc['edit_showFieldHelp']=='text') {
$fDat = $TCA_DESCR[$table]['columns'][$field];
if (is_array($TCA_DESCR[$table]) && is_array($TCA_DESCR[$table]['columns'][$field])) {
$data = $TCA_DESCR[$table]['columns'][$field];
// Get Icon:
$editIcon = t3lib_BEfunc::helpTextIcon(
$table,
$field,
$BACK_PATH,
TRUE
);
// Add title?
$onClick = 'vHWin=window.open(\''.$BACK_PATH.'view_help.php?tfID='.($table.'.'.$field).'\',\'viewFieldHelp\',\'height=400,width=600,status=0,menubar=0,scrollbars=1\');vHWin.focus();return false;';
$text =
($fDat['alttitle'] ? '<h4><a href="#" onclick="'.htmlspecialchars($onClick).'">'.$fDat['alttitle'].'</a></h4>' : '').
$fDat['description'];
$text = $data['description'];
// More information to get?
if ($fDat['image_descr'] || $fDat['seeAlso'] || $fDat['details'] || $fDat['syntax']) { // || $fDat['image'];
$text.=' <a href="#" onclick="'.htmlspecialchars($onClick).'">'.
'<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/rel_db.gif','width="13" height="12"').' class="absmiddle typo3-csh-more" alt="" />'.
'</a>';
if ($data['image_descr'] || $data['seeAlso'] || $data['details'] || $data['syntax']) { // || $fDat['image'];
$text.='<img'.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/rel_db.gif','width="13" height="12"').' class="absmiddle" alt="" />';
}
if ($text) {
$text = '<p>'.$text.'</p>';
}
// Additional styles?
$params = $styleAttrib ? ' style="'.$styleAttrib.'"' : '';
// Compile table with CSH information:
return '<table border="0" cellpadding="2" cellspacing="0" class="typo3-csh-inline"'.$params.'>
<tr>
<td valign="top" width="14">'.$editIcon.'</td>
<td valign="top">'.$text.'</td>
</tr>
</table>';
// Add title?
return ($data['alttitle'] ? '<h4>'.$data['alttitle'].'</h4>' : '').$text;
}
}
/**
* API for getting CSH icons/text for use in backend modules.
* TCA_DESCR will be loaded if it isn't already
......
$LANG->loadSingleTableDescription($table);
if (is_array($TCA_DESCR[$table])) {
// Creating CSH icon and short description:
$fullText = t3lib_BEfunc::helpText($table,$field,$BACK_PATH,$styleAttrib);
$icon = t3lib_BEfunc::helpTextIcon($table,$field,$BACK_PATH,$onlyIconMode);
// Creating CSH icon and short description:
$fullText = t3lib_BEfunc::helpText($table,$field,$BACK_PATH);
$icon = t3lib_BEfunc::helpTextIcon($table,$field,$BACK_PATH);
if ($fullText && !$onlyIconMode) {
if ($fullText && !$onlyIconMode && $BE_USER->uc['edit_showFieldHelp'] == 'text') {
// Additional styles?
$params = $styleAttrib ? ' style="'.$styleAttrib.'"' : '';
// Compile table with CSH information:
$fullText = '<table border="0" cellpadding="0" cellspacing="0" class="typo3-csh-inline"'.$params.'>
<tr>
<td valign="top" width="14">'.$icon.'</td>
<td valign="top">'.$fullText.'</td>
</tr>
</table>';
$output = $GLOBALS['LANG']->hscAndCharConv($fullText, false);
} else {
#$output = '<span style="position:absolute; filter: alpha(opacity=50); -moz-opacity: 0.50;">'.$icon.'</span>';
typo3/stylesheet.css (Arbeitskopie)
SPAN.typo3-moduleHeader IMG { vertical-align: middle; margin-right: 4px; }
/* TYPO3 CSH */
TABLE.typo3-csh-inline { border: solid 1px #6f3833; background-color: #af8883; margin: 5px 4px 20px 0px; }
TABLE.typo3-csh-inline { border: solid 1px #6f3833; background-color: #ffffff; margin: 5px 4px 20px 0px; }
TABLE.typo3-csh-inline TR TD H4 { margin-top: 0px; margin-bottom: 0px; }
IMG.typo3-csh-icon { vertical-align: middle; cursor: help; }
A.typo3-csh-link { white-space: normal; }
A.typo3-csh-link span, A.typo3-csh-link a.typo3-csh-more { display: none; }
A.typo3-csh-link:hover span, A.typo3-csh-link:hover span a { display: block; }
A.typo3-csh-link:hover span { position: absolute; margin: 0px 0 0 17px; background: #ffffff; border: 1px solid #555; width: 200px; z-index: 100; }
A.typo3-csh-link:hover h4, A.typo3-csh-link:hover p { margin-top: 0; padding: 2px 5px; }
A.typo3-csh-link:hover p { font-weight: normal; }
/*********************************************
* TypoScript Highlighting:
*********************************************/
(1-1/3)