[TYPO3-dev] Typo3 4.5.2 and label_userFunc

Stephan Helten stephan.helten at engage.de
Mon Jul 4 20:58:06 CEST 2011


Hi,

this works for me:

The Label class:

class Tx_EngPersons_Label_AddressGroupLabel {
    function getUserLabel(&$params, &$pObj)
    {
        $addressGroup =
$this->getAddressGroupRepository()->findByUid($params["row"]["uid"]);

        $label = $addressGroup->getName();
        while ($addressGroup = $addressGroup->getAddressGroupParent()) {
            $label = $addressGroup->getName()." -> ".$label;
        }

        $params['title'] = $label;
    }

    /**
     * @return Tx_EngPersons_Domain_Repository_AddressGroupRepository
     */
    function getAddressGroupRepository() {
        return
t3lib_div::makeInstance('tx_engpersons_domain_repository_addressgroupreposit
ory');
    }
}

In TCA:

$TCA['tx_engpersons_domain_model_addressgroup'] = array(
	'ctrl' => array(
		'label_userFunc'	=>
'tx_engpersons_label_addressgrouplabel->getUserLabel',
...

In ext_autoload.php:

$extensionClassesPath = t3lib_extMgm::extPath('eng_persons') . 'Classes/';
return array(
	'tx_engpersons_label_addressgrouplabel' => $extensionClassesPath .
'Label/AddressGroupLabel.php',
);

regards

Stephan

-----Ursprüngliche Nachricht-----
Von: typo3-dev-bounces at lists.typo3.org
[mailto:typo3-dev-bounces at lists.typo3.org] Im Auftrag von Éric Thibault
Gesendet: Montag, 4. Juli 2011 20:42
An: typo3-dev at lists.typo3.org
Betreff: [TYPO3-dev] Typo3 4.5.2 and label_userFunc

Hello to all of you!

I was using the label_userFunc inside my extension's ext_tables.php with
Typo3 4.1.9 and everything worked great... But now with my Typo3 4.5.2,
nothing works anymore?!?!?!

I used to follow the instructions on this page for label_userFunc
(http://typo3.org/documentation/document-library/core-documentation/doc_core
_api/4.3.0/view/4/2/#id2517078) and it used to work!

As my Germen is just good enough to ask for a beer, this page
(http://www.typo3.net/forum/beitraege/extensions_schreiben/102411/ ) seams
to talk about problems with label_userFunc?

I realy do need to have custom labels for my customers!

Best regards!




_______________________________________________
TYPO3-dev mailing list
TYPO3-dev at lists.typo3.org
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-dev





More information about the TYPO3-dev mailing list