Antwort
 
LinkBack Themen-Optionen Thema durchsuchen Thema bewerten Ansicht
  #1  
Alt 19.03.08, 17:00
Forum Stammgast
 
Registriert seit: 13.08.07
Ort: Brüel
Alter: 21
Beiträge: 132
Denny1987 eine Nachricht über ICQ schicken Denny1987 eine Nachricht über Skype™ schicken
Beitrag $this->cObj->stdWrap + Extension + Hook

Guten Abend Typo3ler

ich habe eine Extension erstellt die auf Den Hook registrationProcess_beforeConfirmCreate von sr_feuser_register zugreift. Nun kommt mein Problem ich machte einfach meine Variablen mit $this->cObj->stdWrap über TypoScript ansprechen. Habe mir dafür auch ein cObj in meiner extension erzeugt ($this->cObj = t3lib_div::makeInstance('tslib_cObj');) nur leider wird das TypoScript nicht ausgeführt

PHP-Code:
<?php
/***************************************************************
*  Copyright notice
*
*  (c) 2008 Denny Schäfer <d.schaefer@adgame-media.com>
*  All rights reserved
*
*  This script is part of the TYPO3 project. The TYPO3 project is
*  free software; you can redistribute it and/or modify
*  it under the terms of the GNU General Public License as published by
*  the Free Software Foundation; either version 2 of the License, or
*  (at your option) any later version.
*
*  The GNU General Public License can be found at
*  http://www.gnu.org/copyleft/gpl.html.
*
*  This script is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU General Public License for more details.
*
*  This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/

require_once(PATH_tslib.'class.tslib_pibase.php');


/**
 * Plugin 'Password generator' for the 'ad_password' extension.
 *
 * @author    Denny Schäfer <d.schaefer@adgame-media.com>
 * @package    TYPO3
 * @subpackage    tx_adpassword
 */
class tx_adpassword_pi1 extends tslib_pibase {
    var 
$prefixId      'tx_adpassword_pi1';        // Same as class name
    
var $scriptRelPath 'pi1/class.tx_adpassword_pi1.php';    // Path to this script relative to the extension dir.
    
var $extKey        'ad_password';    // The extension key.
    
var $pi_checkCHash true;
    var 
$cObj;
    
    
/**
     * The main method of the PlugIn
     *
     * @param    string        $content: The PlugIn content
     * @param    array        $conf: The PlugIn configuration
     * @return    The content that is displayed on the website
     */
    
    
function registrationProcess_beforeConfirmCreate (&$recordArray, &$invokingObj) {
        
$this->conf=$conf;
        
$this->pi_setPiVarDefaults();
        
$this->pi_loadLL();
        
        
//t3lib_div::debug($GLOBALS['TSFE']);
        //t3lib_div::debug($recordArray);
        //t3lib_div::debug($invokingObj);
        
        
$this->cObj t3lib_div::makeInstance('tslib_cObj');

        
$length 8;
        
        
$dummy array_merge(range('0''9'), range('a''z'), range('A''Z'), array());
        
        
mt_srand((double)microtime()*1000000);
        
        for (
$i 1$i <= (count($dummy)*2); $i++) {
            
$swap mt_rand(0,count($dummy)-1);
            
$tmp $dummy[$swap];
            
$dummy[$swap] = $dummy[0];
            
$dummy[0] = $tmp;
        }

        
$recordArray['INTRO_TEXT'] = $this->cObj->stdWrap($this->pi_getLL('intro_text'),$this->conf['intro_text.']);
        
$recordArray['PASSWORD'] = $this->cObj->stdWrap(substr(implode('',$dummy),0,$length),$this->conf['std_wrap_password.']);
        
        return 
$recordArray;
    }
}

if (
defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/ad_password/pi1/class.tx_adpassword_pi1.php'])    {
    include_once(
$TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/ad_password/pi1/class.tx_adpassword_pi1.php']);
}

?>
Typoscript-Code:
1:
2:
3:
4:
plugin.tx_adpassword_pi1 {
intro_text.wrap = <p>|</p>
std_wrap_password.wrap = <p>|</p>
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
Mit Zitat antworten
  #2  
Alt 19.03.08, 22:42
Benutzerbild von robelix
Forum Stammgast
 
Registriert seit: 03.12.06
Beiträge: 169

In einem Hook kriegst du nicht automatisch den passenden $conf übergeben, also muss man es selber laden:
$this->conf = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_adpassword_pi1.'];
__________________
mysql> SELECT question FROM life, universe, everything WHERE answer=42;
Empty set (2079460347 sec)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
Mit Zitat antworten
  #3  
Alt 19.03.08, 22:53
Forum Stammgast
 
Registriert seit: 13.08.07
Ort: Brüel
Alter: 21
Beiträge: 132
Denny1987 eine Nachricht über ICQ schicken Denny1987 eine Nachricht über Skype™ schicken
Beitrag

Guten Abend,

danke für die Konkrete Antwort auf meine Frage , werde es gleich morgen ausprobieren.


So es hat geklappt Dicken Dank. Was jetzt aber nicht so richtig hinhaut ist das mein Text jetzt mit "<p>TEXT</p>" ausgegeben wird anstatt "TEXT". Liegt das jetzt an dem HOOK oder an meiner Extension ??? Wäre über jede Antwort erfreut.

Geändert von Denny1987 (20.03.08 um 08:46 Uhr). Grund: Update
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
Mit Zitat antworten
  #4  
Alt 31.03.08, 16:00
Forum Stammgast
 
Registriert seit: 02.01.08
Alter: 28
Beiträge: 114

intro_text.wrap = <p>|</p>
std_wrap_password.wrap = <p>|</p>

ist das nicht ne Doppelung???

Nutzt du TemplaVoila??? Dann hast du vielleicht beim Mappen was falsch gemacht....

Geändert von Seraph1980 (31.03.08 um 16:26 Uhr).
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Wong this Post!Spurl this Post!Reddit! Diesen Post bei linksilo.de bookmarken!
Mit Zitat antworten
Antwort


Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht Thema bewerten
Thema bewerten:

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge anzufügen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

vB Code ist An.
Smileys sind An.
[IMG] Code ist An.
HTML-Code ist Aus.
Trackbacks are An
Pingbacks are An
Refbacks are An


Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
CobJ TEXT Mehrsprachigkeit Asimock TYPO3 4.x Fragen und Probleme 2 14.03.08 17:20
stdWrap 3.8.0 und 4.1.5 janosch TYPO3 3.x Fragen und Probleme 4 19.02.08 12:08
Probleme mit $this->cObj->IMAGE() typonewbe Extension modifizieren oder neu erstellen 2 20.09.07 16:14
Bilder mit cObj->IMAGE skallieren? typonewbe Extension modifizieren oder neu erstellen 0 19.07.07 16:57
cObj->RECORDS() Bildgröße anpassen maxhb Extension modifizieren oder neu erstellen 1 12.01.07 08:40


Alle Zeitangaben in WEZ +1. Es ist jetzt 08:45 Uhr.


Powered by vBulletin® Version 3.6.8 Patch Level 2 (Deutsch)
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Template-Modifikationen durch TMS