Bug #23914 ยป tceformsSprites.diff
t3lib/class.t3lib_tceforms.php (Arbeitskopie) | ||
---|---|---|
case 'flex':
|
||
$item = $this->getSingleField_typeFlex($table,$field,$row,$PA);
|
||
break;
|
||
case 'tree':
|
||
$treeClass = t3lib_div::makeInstance('t3lib_TCEforms_Tree');
|
||
$item = $treeClass->renderField($table ,$field, $row, $PA, $this);
|
||
break;
|
||
default:
|
||
$item = $this->getSingleField_typeUnknown($table,$field,$row,$PA);
|
||
break;
|
||
... | ... | |
$styleAttrValue = $this->optionTagStyle($p[2]);
|
||
if ($sM) {
|
||
list($selectIconFile,$selectIconInfo) = $this->getIcon($p[2]);
|
||
if (!empty($selectIconInfo)) {
|
||
$selectedStyle = ' style="background: #fff url(' . $selectIconFile . ') 0% 50% no-repeat; padding: 1px 1px 1px 24px; -webkit-background-size: 0;"';
|
||
}
|
||
if (!empty($selectIconInfo)) {
|
||
$selectedStyle = ' style="background: #fff url(' . $selectIconFile . ') 0% 50% no-repeat; padding: 1px 1px 1px 24px;"';
|
||
} else {
|
||
$selectedStyle = ' classes="' . t3lib_iconWorks::getSpriteIconClasses($p[2]) . '"';
|
||
}
|
||
}
|
||
}
|
||
... | ... | |
}
|
||
}
|
||
// If there is an icon for the selector box (rendered in table under)...:
|
||
// If there is an icon for the selector box (rendered in selicon-table below)...:
|
||
// if there is an icon ($p[2]), icons shoulhd be shown, and, if only selected are visible, is it selected
|
||
if ($p[2] && !$suppressIcons && (!$onlySelectedIconShown || $sM)) {
|
||
list($selIconFile,$selIconInfo)=$this->getIcon($p[2]);
|
||
$iOnClick = $this->elName($PA['itemFormElName']) . '.selectedIndex=' . $c . '; ' .
|
||
$this->elName($PA['itemFormElName']) . '.style.backgroundImage=' . $this->elName($PA['itemFormElName']) . '.options[' . $c .'].style.backgroundImage; ' .
|
||
implode('',$PA['fieldChangeFunc']).$this->blur().'return false;';
|
||
if(!empty($selIconInfo)) {
|
||
$iOnClick = $this->elName($PA['itemFormElName']) . '.selectedIndex=' . $c . '; ' .
|
||
$this->elName($PA['itemFormElName']) . '.style.backgroundImage=' . $this->elName($PA['itemFormElName']) . '.options[' . $c .'].style.backgroundImage; ' .
|
||
implode('',$PA['fieldChangeFunc']).$this->blur().'return false;';
|
||
} else {
|
||
$iOnClick = $this->elName($PA['itemFormElName']) . '.selectedIndex=' . $c . '; ' .
|
||
$this->elName($PA['itemFormElName']) . '.class=' . $this->elName($PA['itemFormElName']) . '.options[' . $c .'].class; ' .
|
||
implode('',$PA['fieldChangeFunc']).$this->blur().'return false;';
|
||
}
|
||
$selicons[]=array(
|
||
(!$onlySelectedIconShown ? '<a href="#" onclick="'.htmlspecialchars($iOnClick).'">' : '').
|
||
'<img src="'.$selIconFile.'" '.$selIconInfo[3].' vspace="2" border="0" title="'.htmlspecialchars($p[0]).'" alt="'.htmlspecialchars($p[0]).'" />'.
|
||
$this->featureIconFallback($p[2], htmlspecialchars($p[0]), htmlspecialchars($p[0])) .
|
||
(!$onlySelectedIconShown ? '</a>' : ''),
|
||
$c,$sM);
|
||
$onChangeIcon = 'this.style.backgroundImage=this.options[this.selectedIndex].style.backgroundImage;';
|
||
}
|
||
$c++;
|
||
}
|
||
... | ... | |
}
|
||
// Icon:
|
||
$selIconFile = '';
|
||
if ($p[2]) {
|
||
list($selIconFile,$selIconInfo) = $this->getIcon($p[2]);
|
||
$selIcon = $p[2];
|
||
} else {
|
||
$selIcon = t3lib_iconWorks::getSpriteIcon('empty-empty');
|
||
}
|
||
// Compile row:
|
||
... | ... | |
<tr id="' . $rowId . '" class="'.($sM ? 'c-selectedItem' : 'c-unselectedItem').'" onclick="'.htmlspecialchars($onClick).'" style="cursor: pointer;">
|
||
<td width="12"><input type="checkbox"'.$this->insertDefStyle('check').' name="'.htmlspecialchars($PA['itemFormElName'].'['.$c.']').'" value="'.htmlspecialchars($p[1]).'"'.$sM.' onclick="'.htmlspecialchars($sOnChange).'"'.$PA['onFocus'].' /></td>
|
||
<td class="c-labelCell" onclick="'.htmlspecialchars($onClickCell).'">'.
|
||
($selIconFile ? '<img src="'.$selIconFile.'" '.$selIconInfo[3].' vspace="2" border="0" class="absmiddle" style="margin-right: 4px;" alt="" />' : '').
|
||
$this->featureIconFallback($selIcon) .
|
||
$label .
|
||
'</td>
|
||
<td class="c-descr" onclick="'.htmlspecialchars($onClickCell).'">' . (strcmp($p[3],'') ? $help : '') . '</td>
|
||
... | ... | |
if (!$TCA[$theTableNames]['ctrl']['adminOnly']) {
|
||
// Icon:
|
||
$icon = '../'.TYPO3_mainDir.t3lib_iconWorks::skinImg($this->backPath,t3lib_iconWorks::getIcon($theTableNames, array()),'',1);
|
||
$icon = t3lib_iconWorks::mapRecordTypeToSpriteIconName($theTableNames, array());
|
||
// Add description texts:
|
||
if ($this->edit_showFieldHelp) {
|
||
... | ... | |
foreach($theTypes as $theTypeArrays) {
|
||
// Icon:
|
||
$icon = $theTypeArrays[1]!='--div--' ? '../'.TYPO3_mainDir.t3lib_iconWorks::skinImg($this->backPath,t3lib_iconWorks::getIcon('pages', array('doktype' => $theTypeArrays[1])),'',1) : '';
|
||
$icon = t3lib_iconWorks::mapRecordTypeToSpriteIconName('pages', array('doktype' => $theTypeArrays[1]));
|
||
// Item configuration:
|
||
$items[] = array(
|
||
... | ... | |
$items[] = array(
|
||
rtrim($theTypeArrays[0], ':'),
|
||
$theTypeArrays[1],
|
||
'',
|
||
'empty-empty',
|
||
$descr
|
||
);
|
||
}
|
||
... | ... | |
// Icons:
|
||
$icons = array(
|
||
'ALLOW' => '../'.TYPO3_mainDir.t3lib_iconWorks::skinImg($this->backPath,'gfx/icon_ok2.gif','',1),
|
||
'DENY' => '../'.TYPO3_mainDir.t3lib_iconWorks::skinImg($this->backPath,'gfx/icon_fatalerror.gif','',1),
|
||
'ALLOW' => 'status-status-permission-granted',
|
||
'DENY' => 'status-status-permission-denied',
|
||
);
|
||
// Traverse types:
|
||
... | ... | |
}
|
||
break;
|
||
case 'languages':
|
||
$items = array_merge($items,t3lib_BEfunc::getSystemLanguages());
|
||
$items = array_merge($items, t3lib_BEfunc::getSystemLanguages());
|
||
break;
|
||
case 'custom':
|
||
// Initialize:
|
||
... | ... | |
// Icon:
|
||
if ($itemCfg[1]) {
|
||
list($icon) = $this->getIcon($itemCfg[1]);
|
||
if ($icon) $icon = '../'.TYPO3_mainDir.$icon;
|
||
if ($icon) $icon = $icon;
|
||
} else $icon = '';
|
||
// Add item to be selected:
|
||
... | ... | |
// Icon:
|
||
$icon = $GLOBALS['LANG']->moduleLabels['tabs_images'][$theMod.'_tab'];
|
||
if ($icon) {
|
||
$icon = '../'.substr($icon,strlen(PATH_site));
|
||
$icon = '../' . substr($icon,strlen(PATH_site));
|
||
}
|
||
// Description texts:
|
||
... | ... | |
$iParts = t3lib_div::trimExplode(',',$row[$iField],1);
|
||
$icon = '../'.$iPath.'/'.trim($iParts[0]);
|
||
} elseif (t3lib_div::inList('singlebox,checkbox',$fieldValue['config']['renderMode'])) {
|
||
$icon = '../'.TYPO3_mainDir.t3lib_iconWorks::skinImg($this->backPath,t3lib_iconWorks::getIcon($f_table, $row),'',1);
|
||
$icon = t3lib_iconWorks::mapRecordTypeToSpriteIconName($f_table, $row);
|
||
} else $icon = '';
|
||
// Add the item:
|
||
... | ... | |
'</label>' .
|
||
'<span' . $fieldAttributes . '>' .
|
||
$content['ITEM'] .
|
||
$content['HELP_ICON'] .
|
||
'</span>' .
|
||
'</span>';
|
||
}
|
||
... | ... | |
// Icon + clickmenu:
|
||
$absFilePath = t3lib_div::getFileAbsFileName($config['config']['uploadfolder'] ? $config['config']['uploadfolder'] . '/' . $imgPath : $imgPath);
|
||
$fI = pathinfo($imgPath);
|
||
$fileIcon = t3lib_BEfunc::getFileIcon(strtolower($fI['extension']));
|
||
$fileIcon = '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/fileicons/'.$fileIcon,'width="18" height="16"').' class="absmiddle" title="'.htmlspecialchars($fI['basename'].($absFilePath && @is_file($absFilePath) ? ' ('.t3lib_div::formatSize(filesize($absFilePath)).'bytes)' : ' - FILE NOT FOUND!')).'" alt="" />';
|
||
$fileInformation = pathinfo($imgPath);
|
||
$fileIcon = t3lib_iconWorks::getSpriteIconForFile($imgPath,
|
||
array('title' =>
|
||
htmlspecialchars($fileInformation['basename'] .
|
||
($absFilePath && @is_file($absFilePath) ?
|
||
' (' .t3lib_div::formatSize(filesize($absFilePath)) . 'bytes)' :
|
||
' - FILE NOT FOUND!')
|
||
)
|
||
)
|
||
);
|
||
$imgs[] = '<span class="nobr">'.t3lib_BEfunc::thumbCode($rowCopy,$table,$field,$this->backPath,'thumbs.php',$config['config']['uploadfolder'],0,' align="middle"').
|
||
($absFilePath ? $this->getClickMenu($fileIcon, $absFilePath) : $fileIcon).
|
||
... | ... | |
public function addStyleSheet($key, $href, $title='', $relation='stylesheet') {
|
||
$GLOBALS['SOBE']->doc->addStyleSheet($key, $href, $title, $relation);
|
||
}
|
||
protected function featureIconFallback($icon, $alt = '', $title = '') {
|
||
$iconArray = $this->getIcon($icon);
|
||
if(is_file(PATH_typo3 . $iconArray[0])) {
|
||
return '<img src="' . $iconArray[0] . '" alt="' . $alt . '" ' . ($title ? 'title="' . $title . '"' : '') . ' />';
|
||
} else {
|
||
return t3lib_iconWorks::getSpriteIcon($icon,array('alt'=> $alt, 'title'=> $title));
|
||
}
|
||
}
|
||
}
|
||