[TYPO3-hci] BE vs FE

Tapio Markula tapio.markula at dnainternet.net
Mon Aug 7 13:37:03 CEST 2006


Waldemar Kornewald wrote:

 > News items was just an example. My suggestion is to move the "Create
 > new record" function to the top and make it easily accessible. That
 > would make all operations easier, not just news items.


easy to implement

function viewPageIcon($id,$backPath,$addParams='')	{
		global $BE_USER;
		$confProperties = 
t3lib_BEfunc::getModTSconfig($this->pageinfo['uid'],'mod.skin_grey_2');
		$typesForDisablePageIconButtons = 
t3lib_div::trimExplode(',',strtolower($confProperties['properties']['disablePageIconButtons']),1);
		$disablePageIconButtons = array_flip($typesForDisablePageIconButtons);
		
		$str = '';
			// If access to Web>List for user, then link to that module.
		if ($BE_USER->check('modules','web_list') && 
!isset($disablePageIconButtons['web_list'])) {
		 
$href=$backPath.'db_list.php?id='.$id.'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'));
			$str.= '<a href="'.htmlspecialchars($href).'">'.
					'<img'.t3lib_iconWorks::skinImg($backPath,'gfx/list.gif','').' 
title="'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showList',1).'"'.($addParams?' 
'.trim($addParams):'').' alt="" />'.
					'</a>';
			}
			// Make link to view page
		if(!isset($disablePageIconButtons['view_page']))
			$str.= '<a href="#" 
onclick="'.htmlspecialchars(t3lib_BEfunc::viewOnClick($id,$backPath,t3lib_BEfunc::BEgetRootLine($id))).'">'.
				'<img'.t3lib_iconWorks::skinImg($backPath,'gfx/zoom.gif','').' 
title="'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showPage',1).'"'.($addParams?' 
'.trim($addParams):"").' alt="" />'.
				'</a>';
			// Create new record (general)
		if(!isset($disablePageIconButtons['new_record']))
			$str.= '<a 
href="'.htmlspecialchars($this->backPath.'db_new.php?id='.$id.'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))).'">'.
			 
'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/new_el.gif','').' 
title="'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_list.php:newRecordGeneral',1).'" 
  alt="" />'.
				'</a>';
			
		return $str;
	}


adds new item to after view page to the top-left corner - exactly
what you wanted! Lets possibility to remove that too!



More information about the TYPO3-team-hci mailing list