Index: classes/class.tx_templavoila_icons.php new file mode 100644 =================================================================== --- classes/class.tx_templavoila_icons.php (revision 35991) +++ classes/class.tx_templavoila_icons.php (working copy) @@ -0,0 +1,128 @@ + +* All rights reserved +* +* This script is part of the Typo3 project. The Typo3 project is +* free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* The GNU General Public License can be found at +* http://www.gnu.org/copyleft/gpl.html. +* +* This script is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* This copyright notice MUST APPEAR in all copies of the script! +***************************************************************/ + +/** + * Class which adds an additional layer for icon creation + * + */ +final class tx_templavoila_icons { + + static $oldIcons = array( + 'actions-view-go-back' => array('file' => 'gfx/goback.gif', 'attributes' => 'width="14" height="14"'), + 'actions-document-new' => array('file' => 'gfx/new_el.gif'), + 'actions-insert-record' => array('file' => 'gfx/insert3.gif'), + 'actions-edit-hide'=> array('file' => 'gfx/button_hide.gif'), + 'actions-edit-unhide'=> array('file' => 'gfx/button_unhide.gif'), + 'actions-document-view' => array('file' => 'gfx/zoom.gif', 'attributes' => 'width="12" height="12"'), + 'actions-system-list-open' => array('file' => 'gfx/list.gif', 'attributes' => 'width="11" height="11"'), + 'actions-document-history-open' => array('file' => 'gfx/history2.gif', 'attributes' => 'width="13" height="12"'), + 'actions-page-move' => array('file' => 'gfx/move_page.gif', 'attributes' => 'width="11" height="12"'), + 'actions-page-new' => array('file' => 'gfx/new_page.gif', 'attributes' => 'width="13" height="12"'), + 'actions-document-open' => array('file' => 'gfx/edit2.gif', 'attributes' => 'width="11" height="12"'), + 'actions-edit-delete' => array('file' => 'gfx/deletedok.gif'), + 'actions-edit-copy' => array('file' => 'gfx/clip_copy.gif'), + 'actions-edit-copy-release' => array('file' => 'gfx/clip_copy_h.gif'), + 'actions-edit-cut' => array('file' => 'gfx/clip_cut.gif'), + 'actions-edit-cut-release' => array('file' => 'gfx/clip_cut_h.gif'), + 'actions-system-list-open' => array('file' => 'mod/web/list/list.gif'), + 'apps-pagetree-page-shortcut' => array('file' => 'gfx/shortcut.gif'), + 'actions-move-up' => array('file' => 'gfx/pilup.gif'), + 'actions-move-down' => array('file' => 'gfx/pildown.gif'), + 'actions-view-table-expand' => array('file' => 'gfx/plusbullet_list.gif'), + 'actions-view-table-collapse' => array('file' => 'gfx/minusbullet_list.gif'), + ); + + static $useOldIcons = null; + static $reInit = true; + + public static function init() { + + if(self::$useOldIcons !== null && self::$reInit == false) { + return; + } + + if(version_compare(TYPO3_version,'4.4','<') || self::$useOldIcons) { + self::$useOldIcons = true; + if (is_array($GLOBALS['TBE_STYLES']['spritemanager']['singleIcons'])) { + foreach($GLOBALS['TBE_STYLES']['spritemanager']['singleIcons'] as $name => $file) { + if (!isset(self::$oldIcons[$name])) { + self::$oldIcons[$name] = array('file' => $file); + } + } + } + } else { + self::$useOldIcons = false; + } + self::$reInit = true; + } + + /** + * + * @param string $iconName + * @param array $options + * @param array $overlays + * @return string + */ + public static function getIcon($iconName, $options = array(), $overlays = array()) { + + self::init(); + + if (self::$useOldIcons) { + $alt = isset($options['alt']) ? ' alt="' . $options['alt'] .'"': ' alt=""'; + $title = isset($options['title']) ? ' alt="' . $options['title'] .'"': ''; + $wHattribs = isset(self::$oldIcons[$iconName]['attributes']) ? self::$oldIcons[$iconName]['attributes'] : ''; + return ''; + } else { + return t3lib_iconWorks::getSpriteIcon($iconName, $options, $overlays); + } + } + + /** + * + * @param string $table + * @param array $row + * @param array $options + * @return string + */ + public static function getIconForRecord($table, $row, $options = array()) { + + if (self::$useOldIcons === null) { + self::init(); + } + if (self::$useOldIcons) { + + if($table == 'pages') { + $title = htmlspecialchars(t3lib_div::fixed_lgd_cs(t3lib_BEfunc::getRecordTitle('pages', $row), 50)); + } else { + $title = '[' . $table . ':'.$row['uid']; + } + + return ''; + } else { + return t3lib_iconWorks::getSpriteIconForRecord($table, $row, $options); + } + } + +} +?> \ No newline at end of file Index: cm1/index.php =================================================================== --- cm1/index.php (revision 35991) +++ cm1/index.php (working copy) @@ -524,12 +524,7 @@ class tx_templavoila_cm1 extends t3lib_SCbase { // Back if ($this->returnUrl) { - if(version_compare(TYPO3_version,'4.4','>')) { - $backIcon = t3lib_iconWorks::getSpriteIcon('actions-view-go-back'); - } else { - $backIcon = 'doc->backPath,'gfx/goback.gif','width="14" height="14"') . ' alt="" />'; - } - + $backIcon = tx_templavoila_icons::getIcon('actions-view-go-back'); $buttons['back'] = '' . $backIcon . ''; Index: cm2/index.php =================================================================== --- cm2/index.php (revision 35991) +++ cm2/index.php (working copy) @@ -248,12 +248,7 @@ class tx_templavoila_cm2 extends t3lib_SCbase { // Back if ($this->returnUrl) { - if(version_compare(TYPO3_version,'4.4','>')) { - $backIcon = t3lib_iconWorks::getSpriteIcon('actions-view-go-back'); - } else { - $backIcon = 'doc->backPath,'gfx/goback.gif','width="14" height="14"') . ' alt="" />'; - } - + $backIcon = tx_templavoila_icons::getIcon('actions-view-go-back'); $buttons['back'] = '' . $backIcon . ''; Index: ext_autoload.php =================================================================== --- ext_autoload.php (revision 35991) +++ ext_autoload.php (working copy) @@ -20,6 +20,7 @@ return array( 'tx_templavoila_datastructure_dbbase' => $extensionPath . 'classes/class.tx_templavoila_datastructure_dbbase.php', 'tx_templavoila_datastructure_staticbase' => $extensionPath . 'classes/class.tx_templavoila_datastructure_staticbase.php', 'tx_templavoila_div' => $extensionPath . 'classes/class.tx_templavoila_div.php', + 'tx_templavoila_icons' => $extensionPath . 'classes/class.tx_templavoila_icons.php', 'tx_templavoila_label' => $extensionPath . 'classes/class.tx_templavoila_label.php', 'tx_templavoila_template' => $extensionPath . 'classes/class.tx_templavoila_template.php', 'tx_templavoila_templaterepository' => $extensionPath . 'classes/class.tx_templavoila_templateRepository.php', Index: ext_localconf.php =================================================================== --- ext_localconf.php (revision 35991) +++ ext_localconf.php (working copy) @@ -243,6 +243,7 @@ if(t3lib_div::int_from_ver(TYPO3_version) < 4003000) { $list = include(t3lib_extMgm::extPath('templavoila') . '/ext_autoload.php'); require_once $list['tx_templavoila_api']; require_once $list['tx_templavoila_div']; + require_once $list['tx_templavoila_icons']; require_once $list['tx_templavoila_datastructure']; require_once $list['tx_templavoila_datastructure_dbbase']; require_once $list['tx_templavoila_datastructure_staticbase']; @@ -250,4 +251,4 @@ if(t3lib_div::int_from_ver(TYPO3_version) < 4003000) { require_once $list['tx_templavoila_template']; require_once $list['tx_templavoila_templaterepository']; } -?> +?> \ No newline at end of file Index: ext_tables.php =================================================================== --- ext_tables.php (revision 35991) +++ ext_tables.php (working copy) @@ -192,7 +192,7 @@ if ($_EXTCONF['enable.']['selectDataStructure']) { $TCA['tt_content']['ctrl']['requestUpdate'] .= 'tx_templavoila_ds'; } -$TCA['tt_content']['types'][$_EXTKEY . '_pi1']['showitem'] = +$TCA['tt_content']['types'][$_EXTKEY . '_pi1']['showitem'] = 'CType;;4;;1-1-1, hidden, header;;' . (($_EXTCONF['enable.']['renderFCEHeader']) ? '3' : '' ) . ';;2-2-2, linkToTop;;;;3-3-3, --div--;LLL:EXT:templavoila/locallang_db.xml:tt_content.CType_pi1,' . (($_EXTCONF['enable.']['selectDataStructure']) ? 'tx_templavoila_ds,' : '') . 'tx_templavoila_to,tx_templavoila_flex;;;;2-2-2, --div--;LLL:EXT:cms/locallang_tca.xml:pages.tabs.access, starttime, endtime, fe_group'; @@ -303,5 +303,30 @@ if (TYPO3_MODE=='BE') { ); t3lib_extMgm::addLLrefForTCAdescr('_MOD_web_func','EXT:wizard_crpages/locallang_csh.xml'); } - +if (TYPO3_MODE=='BE') { + if(version_compare(TYPO3_version,'4.4','>')) { + $icons = array( + 'paste' => t3lib_extMgm::extRelPath('templavoila') . 'mod1/clip_pasteafter.gif', + 'pasteSubRef' => t3lib_extMgm::extRelPath('templavoila') . 'mod1/clip_pastesubref.gif', + 'makelocalcopy' => t3lib_extMgm::extRelPath('templavoila') . 'mod1/makelocalcopy.gif', + 'clip_ref' => t3lib_extMgm::extRelPath('templavoila') . 'mod1/clip_ref.gif', + 'clip_ref-release' => t3lib_extMgm::extRelPath('templavoila') . 'mod1/clip_ref_h.gif', + 'unlink' => t3lib_extMgm::extRelPath('templavoila') . 'mod1/unlink.png' + ); + t3lib_SpriteManager::addSingleIcons($icons, $_EXTKEY); + } else { + $icons = array( + 'extensions-templavoila-paste' => t3lib_extMgm::extRelPath('templavoila') . 'mod1/clip_pasteafter.gif', + 'extensions-templavoila-pasteSubRef' => t3lib_extMgm::extRelPath('templavoila') . 'mod1/clip_pastesubref.gif', + 'extensions-templavoila-makelocalcopy' => t3lib_extMgm::extRelPath('templavoila') . 'mod1/makelocalcopy.gif', + 'extensions-templavoila-clip_ref' => t3lib_extMgm::extRelPath('templavoila') . 'mod1/clip_ref.gif', + 'extensions-templavoila-clip_ref-release' => t3lib_extMgm::extRelPath('templavoila') . 'mod1/clip_ref_h.gif', + 'extensions-templavoila-unlink' => t3lib_extMgm::extRelPath('templavoila') . 'mod1/unlink.png' + ); + $GLOBALS['TBE_STYLES']['spritemanager']['singleIcons'] = array_merge( + (array) $GLOBALS['TBE_STYLES']['spritemanager']['singleIcons'], + $icons + ); + } +} ?> \ No newline at end of file Index: mod1/class.tx_templavoila_mod1_clipboard.php =================================================================== --- mod1/class.tx_templavoila_mod1_clipboard.php (revision 35991) +++ mod1/class.tx_templavoila_mod1_clipboard.php (working copy) @@ -151,9 +151,9 @@ class tx_templavoila_mod1_clipboard { } - $copyIcon = 'pObj->doc->backPath,'gfx/clip_copy'.($clipActive_copy ? '_h':'').'.gif','').' title="'.$LANG->getLL ('copyrecord').'" border="0" alt="" />'; - $cutIcon = 'pObj->doc->backPath,'gfx/clip_cut'.($clipActive_cut ? '_h':'').'.gif','').' title="'.$LANG->getLL ('cutrecord').'" border="0" alt="" />'; - $refIcon = 'pObj->doc->backPath,t3lib_extMgm::extRelPath('templavoila').'mod1/clip_ref'.($clipActive_ref ? '_h':'').'.gif','').' title="'.$LANG->getLL ('createreference').'" vspace="2" hspace="2" alt="" />'; + $copyIcon = tx_templavoila_icons::getIcon('actions-edit-copy'. ($clipActive_copy ? '-release':''), array('title' => $LANG->getLL ('copyrecord'))); + $cutIcon = tx_templavoila_icons::getIcon('actions-edit-cut'. ($clipActive_cut ? '-release':''), array('title' => $LANG->getLL ('cutrecord'))); + $refIcon = tx_templavoila_icons::getIcon('extensions-templavoila-clip_ref'. ($clipActive_ref ? '-release':''), array('title' => $LANG->getLL ('createreference'))); $removeElement = '&CB[removeAll]=normal'; $setElement = '&CB[el]['.rawurlencode('tt_content|'.$elementRecord['uid']).']='.rawurlencode($this->pObj->apiObj->flexform_getStringFromPointer($elementPointer)); @@ -223,8 +223,8 @@ class tx_templavoila_mod1_clipboard { // Prepare the ingredients for the different buttons: $pasteMode = isset ($this->t3libClipboardObj->clipData['normal']['flexMode']) ? $this->t3libClipboardObj->clipData['normal']['flexMode'] : ($this->t3libClipboardObj->clipData['normal']['mode'] == 'copy' ? 'copy' : 'cut'); - $pasteAfterIcon = 'pObj->doc->backPath,'gfx/clip_pasteafter.gif','').' title="'.$LANG->getLL ('pasterecord').'" alt="" />'; - $pasteSubRefIcon = ''; + $pasteAfterIcon = tx_templavoila_icons::getIcon('extensions-templavoila-paste', array('title' => $LANG->getLL ('pasterecord'))); + $pasteSubRefIcon = tx_templavoila_icons::getIcon('extensions-templavoila-pasteSubRef', array('title' => $LANG->getLL ('pastefce_andreferencesubs'))); $sourcePointerString = $this->pObj->apiObj->flexform_getStringFromPointer ($clipboardElementPointer); $destinationPointerString = $this->pObj->apiObj->flexform_getStringFromPointer ($destinationPointer); @@ -280,7 +280,7 @@ class tx_templavoila_mod1_clipboard { // Prepare buttons: $cutButton = $this->element_getSelectButtons($elementPointerString, 'ref'); - $recordIcon = 'doc->backPath, t3lib_iconWorks::getIcon('tt_content', $row),'').' border="0" title="[tt_content:'.$row['uid'].'" alt="" />'; + $recordIcon = tx_templavoila_icons::getIconForRecord('tt_content', $row); $recordButton = $this->pObj->doc->wrapClickMenuOnIcon($recordIcon, 'tt_content', $row['uid'], 1, '&callingScriptId='.rawurlencode($this->pObj->doc->scriptID), 'new,copy,cut,pasteinto,pasteafter,delete'); @@ -311,7 +311,7 @@ class tx_templavoila_mod1_clipboard { } $label = $LANG->getLL('rendernonusedelements_deleteall'); $deleteAll = ''. - 'doc->backPath,'gfx/garbage.gif','width="11" height="12"').' title="'.htmlspecialchars($label).'" alt="" />'. + tx_templavoila_icons::getIcon('actions-edit-delete', array('title' => htmlspecialchars($label))). htmlspecialchars($label). ''; } @@ -366,7 +366,7 @@ class tx_templavoila_mod1_clipboard { $this->deleteUids[] = $uid; $params = '&cmd[tt_content]['.$uid.'][delete]=1'; return ''. - 'doc->backPath,'gfx/garbage.gif','width="11" height="12"').' title="'.$LANG->getLL('renderreferencecount_delete',1).'" alt="" />'. + tx_templavoila_icons::getIcon('actions-edit-delete', array('title' => $LANG->getLL('renderreferencecount_delete',1))). ''; } else { return ''; Index: mod1/class.tx_templavoila_mod1_recordlist.php =================================================================== --- mod1/class.tx_templavoila_mod1_recordlist.php (revision 35991) +++ mod1/class.tx_templavoila_mod1_recordlist.php (working copy) @@ -89,13 +89,13 @@ class tx_templavoila_mod1_recordlist extends localRecordList { case 'fwd': $href = $this->returnUrl . '&SET[recordsView_start]='.($pointer-$this->iLimit).'&SET[recordsView_table]='.$table; $content = ''. - 'backPath,'gfx/pilup.gif','width="14" height="14"').' alt="" />'. + tx_templavoila_icons::getIcon('actions-move-up'). ' [1 - '.$pointer.']'; break; case 'rwd': $href = $this->returnUrl . '&SET[recordsView_start]='.$pointer.'&SET[recordsView_table]='.$table; $content = ''. - 'backPath,'gfx/pildown.gif','width="14" height="14"').' alt="" />'. + tx_templavoila_icons::getIcon('actions-move-down'). ' ['.($pointer+1).' - '.$this->totalItems.']'; break; } Index: mod1/class.tx_templavoila_mod1_sidebar.php =================================================================== --- mod1/class.tx_templavoila_mod1_sidebar.php (revision 35991) +++ mod1/class.tx_templavoila_mod1_sidebar.php (working copy) @@ -182,15 +182,17 @@ class tx_templavoila_mod1_sidebar { // Create the whole sidebar: switch ($this->position) { case 'left': + $minusIcon = tx_templavoila_icons::getIcon('actions-view-table-collapse'); + $plusIcon = tx_templavoila_icons::getIcon('actions-view-table-expand'); $sideBar = '