[TYPO3-dev] BE RTE questions

StephenBungert stephenbungert at yahoo.de
Tue Dec 8 21:14:22 CET 2009


For an extension I am writing I used the hooks in class.tx_rtehtmlarea_pi3 to
add a new tab to the link browser, looking at the mod3 php  I can see how
the title box and width and height are made and have added those to my tab,
now I want to show records from my extension.

1> Is there away of making a page tree that allows you to select records? I
see how the page tree is added but looking in the API I can't see how I can
tell it to allow me to select db records.

I started trying to build my own interface, getting the records my self and
creating the fields from scratch. I have a record (a book), and each book
has associated pages (records from a second table). I want to just show
books that the backend user is allowed to see (because he is the author),
the BE user then selects a book and then I want to show pages that are part
of the selected book. Then when you click on the page a link to it is
created.

Is there some kind of function that allows you to control the creation of
the tree or specify that you want to select records with it?

If this is not possible, I shall keep going with my own approach - I have
learnt quite a lot about the rte and how parts of TYPO3 function :-)

What would be good, if I have to build my own record selector, is to know
what page is the site root. I have the content element id and from this I
have found the page that the rte is on, but how can I find the site root
from this page? I need to know it so that I can use the uid in my queries.

2> My classes modifyMenuDefinition method looks like this at the moment:

		public function modifyMenuDefinition($menuDefinition) {
			// Menus seem to be the tabs at the tob of the popup. Array keys:
			// sActive - 1 marks tab as active, otherwise empty. Still can't get it
to add the correct class to the td
			// label - The tabs title Text
			// url - defaut seems to be #.
			// addParams - seems to be an onclick event handler, example:  
onclick="jumpToUrl('?act=page&editorNo=data[tt_content][166][bodytext]&contentTypo3Language=false&contentTypo3Charset=utf-8');return
false;"
			
			$active = false;
			
			// Set active status of the tab of it is selected
			if ($this->parentObj->act == 'gamebook') {
				$active = 1;
			}
			
			$menuDefinition['gamebook'] = array(
				'sActive' => $active,
				'label' => 'Gamebook',
				'url' => '#',
				'addParams' =>
'onclick="jumpToUrl(\'?act=gamebook&editorNo=data[tt_content][166][bodytext]&contentTypo3Language=false&contentTypo3Charset=utf-8\');return
false;"'
			);
			return $menuDefinition;
		}

I check to see if it is active and set the sActive ele to 1, like I saw
other tabs in the link browser doing, but my tab, even when selected, is
never has the correct class. Other tabs when selected have the class
'tabSelected' (if I remember correctly) and mine always has just 'tab', so
it never looks selected, even though it is. What do I have to do in addition
to what I have already done to get the class changing when my tab is
selected?

-----
-- 
Stephen Bungert
-- 
View this message in context: http://old.nabble.com/BE-RTE-questions-tp26699970p26699970.html
Sent from the TYPO3 Dev mailing list archive at Nabble.com.





More information about the TYPO3-dev mailing list