--- typo3/template.php (revision 2741)
+++ typo3/template.php (working copy)
@@ -310,27 +310,68 @@
*
* @param integer The page id
* @param string The current "BACK_PATH" (the back relative to the typo3/ directory)
* @param string Additional parameters for the image tag(s)
* @return string HTML string with linked icon(s)
*/
- function viewPageIcon($id,$backPath,$addParams='hspace="3"') {
- global $BE_USER;
- $str = '';
+ function viewPageIcon($id,$backPath,$addParams='') {
+ global $BE_USER;
+ $str='';
+ $this->modSharedTSconfig = t3lib_BEfunc::getModTSconfig($id,'mod.SHARED');
+ if(isset($this->modSharedTSconfig['properties']['disablePageIconButtons'])) {
+ $this->disablePageIconButtons = t3lib_div::trimExplode(',',strtolower($this->modSharedTSconfig['properties']['disablePageIconButtons']),1);
+ if(is_array($this->disablePageIconButtons))
+ $this->disablePageIconButtons = array_flip($this->disablePageIconButtons);
+ }
// If access to Web>List for user, then link to that module.
- if ($BE_USER->check('modules','web_list')) {
+ if ($BE_USER->check('modules','web_list') && !isset($this->disablePageIconButtons['web_list'])) {
$href=$backPath.'db_list.php?id='.$id.'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'));
- $str.= ''.
- ''.
+ $strItems['web_list'] = ''.
+ ''.
'';
- }
+ }
// Make link to view page
- $str.= ''.
- ''.
+ if(!isset($this->disablePageIconButtons['view_page']))
+ $strItems['view_page'] = ''.
+ ''.
'';
- return $str;
+ // Create new record (general)
+ if(!isset($this->disablePageIconButtons['new_record']))
+ $strItems['new_record']= ''.
+ 'backPath,'gfx/new_el.gif','').' title="'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_list.php:newRecordGeneral',1).'" alt="" />'.
+ '';
+ // Create new page (pages)
+ if(isset($this->disablePageIconButtons['new_page']))
+ $strItems['new_page']= ''.
+ 'backPath,'gfx/new_page.gif','').' title="'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_list.php:newRecordGeneral',1).' (pages)" alt="" />'.
+ '';
+
+ if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/template.php']['addViewPageIcons']) && is_array ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/template.php']['addViewPageIcons'])) {
+ foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/template.php']['addViewPageIcons'] as $classRef) {
+ $hookObj= &t3lib_div::getUserObj($classRef);
+ if (method_exists($hookObj, 'addViewPageIcons'))
+ $hookObj->addViewPageIcons($strItems,$id,$backPath,$this,$this->disablePageIconButtons);
+ }
+ }
+
+ $defaultOrderList='web_list,view_page,new_record';
+ if($this->modSharedTSconfig['properties']['viewPageIconsOrder'])
+ $orderList=$this->modSharedTSconfig['properties']['viewPageIconsOrder'];
+ else $orderList=$defaultOrderList;
+ $orderList = t3lib_div::trimExplode(',',strtolower($orderList),1);
+
+ if(isset($strItems) && is_array($strItems) && is_array($orderList)) {
+ $str = '';
+ $orderList=array_flip($orderList);
+ foreach($orderList as $strItem => $item) {
+ if(array_key_exists($strItem,$strItems))
+ $str .= $strItems[$strItem];
+ }
+ $str .= '';
+ }
+ return $str;
}
/**
* Returns a URL with a command to TYPO3 Core Engine (tce_db.php)
* See description of the API elsewhere.
*