[TYPO3-german] TS Werte einer Extension in Flexform Userfunc

Stephan Helten stephan.helten at engage.de
Mon Jul 4 19:15:24 CEST 2011


Hi,

vielleicht hilft dir diese Klasse, die ich mal geschrieben habe:

<?php
/**
 * @author Stephan Helten <Stephan.Helten at engage.de>
 * Date: 13.04.11
 * Time: 09:55
 */

require_once (PATH_t3lib.'class.t3lib_page.php');
require_once (PATH_t3lib.'class.t3lib_tstemplate.php');
require_once (PATH_t3lib.'class.t3lib_tsparser_ext.php');

class Tx_EngPageteaser_ItemProcFuncs_PageteaserTemplateRootPath {

    /**
     * @var array
     */
    private $conf;

    private function loadTS($pageUid) {
        $sysPageObj = t3lib_div::makeInstance('t3lib_pageSelect');
        $rootLine = $sysPageObj->getRootLine($pageUid);
        $TSObj = t3lib_div::makeInstance('t3lib_tsparser_ext');
        $TSObj->tt_track = 0;
        $TSObj->init();
        $TSObj->runThroughTemplates($rootLine);
        $TSObj->generateConfig();
        $this->conf =
$TSObj->setup['plugin.']['tx_engpageteaser.']['settings.'];
    }

    public function getItems(&$params, &$pObj) {
        // Get pageId for typoscript root path
        $pid = $params["row"]["pid"];
        $this->loadTS($pid);

        if (is_array($this->conf["pageTeaserTemplates."])) {
            foreach ($this->conf["pageTeaserTemplates."] AS $idx => $data) {
                if (is_array($data)) {
                    $name = $data["name"];
                    $templateRootPath = $data["templateRootPath"];
                    $icon = $data["icon"];
                    if (isset($name) && isset($templateRootPath)) {
                        if (isset($icon)) {
                            $params['items'][] = array($name,
$templateRootPath, $icon);
                        } else {
                            $params['items'][] = array($name,
$templateRootPath);
                        }
                    }
                }
            }
        }
    }
}

Gruß

Stephan

-----Ursprüngliche Nachricht-----
Von: typo3-german-bounces at lists.typo3.org
[mailto:typo3-german-bounces at lists.typo3.org] Im Auftrag von
b.riezler at pixel-ink.de
Gesendet: Montag, 4. Juli 2011 15:46
An: typo3-german at lists.typo3.org
Betreff: [TYPO3-german] TS Werte einer Extension in Flexform Userfunc

Hi,

ich hab hier aktuell das Problem, dass ich in einer Flexform userFunc auf
den TS Wert einer Extension zugreifen muss,
komm aber nicht drauf wie ich ohne großen overload an den Wert komme.

Hat jemand viel. Nen Tipp parat.

Vielen Dank schon mal und Gruß
Benjamin
_______________________________________________
TYPO3-german mailing list
TYPO3-german at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-german



More information about the TYPO3-german mailing list