[TYPO3-ect] Ext-JS 1.0.1

Steffen Kamper steffen at sk-typo3.de
Wed Jul 11 23:01:10 CEST 2007


Hi Matthias,

"Matthias Stuebner" <news at contratec.de> schrieb im Newsbeitrag 
news:mailman.1.1184177174.11309.typo3-team-extension-coordination at lists.netfielders.de...
> On Mon, 9 Jul 2007 18:05:31 +0200, Steffen Kamper wrote:
>
>> i built a little extension as new CType, displaying 4 rte-fields in 
>> tabs -
>> it was very easy to build and it works well.
>
> Is there an option to get the hands on that sample ext., to have a first
> impression how easy/difficult it is to implement this?
> -- 
> br Matthias

it's no secret, but i won't put it in TER because it's only a playground.
I also extended tt_content what i normally dislike, just to test arround.

The code is minimal, so i can show it here:

 $data = $this->cObj->data;

        $tabs=intval($data['tx_skextjstest_tabs']);
        $tabCaption=explode(chr(10),$data['tx_skextjstest_tabheaders']);

        $content1='<div 
id="contenttab0">'.$this->pi_RTEcssText($data['bodytext']) .'</div>';
        $content2.='<div 
id="contenttab1">'.$this->pi_RTEcssText($data['tx_skextjstest_bodytext1']) 
.'</div>';
        $content3.='<div 
id="contenttab2">'.$this->pi_RTEcssText($data['tx_skextjstest_bodytext2']) 
.'</div>';
        $content4.='<div 
id="contenttab3">'.$this->pi_RTEcssText($data['tx_skextjstest_bodytext3']) 
.'</div>';

        #now the big moment comes :-)
        // include the file
        require_once(t3lib_extMgm::extPath("extjs")."class.tx_extjs.php");
        // define, which adapter to use
        tx_extjs::setAdapter('yui');
        // define, which css-template to use
        tx_extjs::setResource('default');
        tx_extjs::setCompressed(TRUE);

        tx_extjs::includeLib();

        #GO GO GO
        $GLOBALS['TSFE']->additionalHeaderData[$this->prefixId] =
         "  <script type=\"text/javascript\">
            var TabsExample = {
                init : function(){
                // basic tabs 1, built from existing content
                var tabs = new Ext.TabPanel('tabs1');
                tabs.addTab('contenttab0', '".trim($tabCaption[0])."');
                tabs.addTab('contenttab1', '".trim($tabCaption[1])."');
                tabs.addTab('contenttab2', '".trim($tabCaption[2])."');
                tabs.addTab('contenttab3', '".trim($tabCaption[3])."');

                tabs.activate('contenttab0');



            }
        }
        Ext.EventManager.onDocumentReady(TabsExample.init, TabsExample, 
true);";

  return $this->pi_wrapInBaseClass('<div 
id="tabs1">'.$content1.$content2.$content3.$content4.'</div>');

vg  Steffen 




More information about the TYPO3-team-extension-coordination mailing list