[Typo3-dev] New hook suggestion.
Stig Nørgaard Færch
stig at 8620.dk
Fri Sep 23 17:21:39 CEST 2005
Hi guys
Tell me if it's bad manner to post this here. Hope not.
http://bugs.typo3.org/view.php?id=1481
Currently, if you want to put something in the topmenu frame in the
backend, you will have to do this through Xclassing. The problem is that
many developers have installed the 'extdeveval'-extension which makes
use of Xclassing to display links in the topmenu frame. That means that
other extensions can not access this space.
In this patch I have implemented a hook in alt_topmenu_dummy.php which
makes i possible for multiple extensions to add content to the topmenu.
It's possible to set a placement priority(1-9) through the variable
'priority' of the class which the hook connects to.
This hook is needed if you want to use both 'Roles'-extension and
'extdeveval'-extension.
On bugs.typo3.org you can also see an example-gif from the backend.
Best Regards
Stig N. Færch
___Diff:___
--- alt_topmenu_dummy.php.orig 2005-04-01 16:37:08.000000000 +0200
+++ alt_topmenu_dummy.php 2005-09-23 16:42:33.000000000 +0200
@@ -73,6 +73,7 @@
*/
class SC_alt_topmenu_dummy {
var $content;
+ var $contentArray;
/**
* Main function - making the menu happen.
@@ -129,7 +130,34 @@
// Start page
$TBE_TEMPLATE->docType = 'xhtml_trans';
+ $TBE_TEMPLATE->bodyTagId.= '-iconmenu';
$this->content.=$TBE_TEMPLATE->startPage('Top frame dummy display');
+ $this->content.='
+ <!--
+ Alternative module menu made of links, icons and similar
displayed in top frame:
+ -->
+ <table border="0" cellpadding="0" cellspacing="0" id="typo3-topMenu">
+ <tr>';
+ // Hook for adding content to the topmenu.
+ if (is_array
($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/alt_topmenu_dummy.php']['fetchContentTopmenu']))
{
+ foreach
($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/alt_topmenu_dummy.php']['fetchContentTopmenu']
as $classRef) {
+ $hookObj = &t3lib_div::getUserObj($classRef);
+ if(method_exists($hookObj,'fetchContentTopmenu_processContent')){
+ $this->tempContent= '<td class="c-menu"
style="padding-top:4px;">'.$hookObj->fetchContentTopmenu_processContent($this).'</td>';
+ //Placement priority handling.
+ if(is_int($hookObj->priority) and ($hookObj->priority>=1 and
$hookObj->priority<=9)) {
+ $this->contentArray[$hookObj->priority][] = $this->tempContent;
+ } else {
+ $this->contentArray[5][] = $this->tempContent;
+ }
+ }
+ }
+ }
+ ksort($this->contentArray);
+ foreach ($this->contentArray as $priority => $menucontent)
$this->content.= implode("\n",$menucontent);
+ $this->content.='
+ </tr>
+ </table>';
// End page:
$this->content.=$TBE_TEMPLATE->endPage();
More information about the TYPO3-dev
mailing list