Release of tipafriend_plus 0.1.4 tipafriend_plus_0-1-4
authorNicole Cordes <cordes@cps-it.de>
Mon, 13 May 2013 18:22:15 +0000 (20:22 +0200)
committerNicole Cordes <cordes@cps-it.de>
Mon, 13 May 2013 18:22:15 +0000 (20:22 +0200)
ext_emconf.php
pi1/class.tx_tipafriendplus_pi1.php

index 97dbb30..22bd0ef 100644 (file)
@@ -3,7 +3,7 @@
 /***************************************************************
  * Extension Manager/Repository config file for ext "tipafriend_plus".
  *
- * Auto generated 13-05-2013 20:20
+ * Auto generated 13-05-2013 20:21
  *
  * Manual updates:
  * Only the data in the array - everything else is removed by next
@@ -15,7 +15,7 @@ $EM_CONF[$_EXTKEY] = array(
        'description' => 'Send a tip (link to typo3-page) to somebody. Based on Tip-A-Friend.',
        'category' => 'plugin',
        'shy' => 0,
-       'version' => '0.1.3',
+       'version' => '0.1.4',
        'dependencies' => '',
        'conflicts' => '',
        'priority' => '',
@@ -41,7 +41,7 @@ $EM_CONF[$_EXTKEY] = array(
                'suggests' => array(
                ),
        ),
-       '_md5_values_when_last_written' => 'a:21:{s:9:"ChangeLog";s:4:"7f67";s:12:"ext_icon.gif";s:4:"3b63";s:17:"ext_localconf.php";s:4:"92c0";s:14:"ext_tables.php";s:4:"7d2b";s:28:"ext_typoscript_constants.txt";s:4:"6d7b";s:24:"ext_typoscript_setup.txt";s:4:"3fd8";s:15:"flexform_ds.xml";s:4:"38e5";s:13:"locallang.xml";s:4:"6037";s:16:"locallang_db.xml";s:4:"67b5";s:17:"locallang_tca.xml";s:4:"0f54";s:10:"README.txt";s:4:"9fa9";s:14:"doc/manual.sxw";s:4:"eb20";s:19:"doc/wizard_form.dat";s:4:"9960";s:20:"doc/wizard_form.html";s:4:"b82d";s:14:"pi1/ce_wiz.gif";s:4:"02b6";s:35:"pi1/class.tx_tipafriendplus_pi1.php";s:4:"cb09";s:43:"pi1/class.tx_tipafriendplus_pi1_wizicon.php";s:4:"c8fe";s:13:"pi1/clear.gif";s:4:"cc11";s:17:"pi1/locallang.xml";s:4:"faf1";s:28:"pi1/tipafriend_plus_css.tmpl";s:4:"9aa6";s:23:"res/tipafriend_plus.css";s:4:"9608";}',
+       '_md5_values_when_last_written' => 'a:21:{s:9:"ChangeLog";s:4:"7f67";s:12:"ext_icon.gif";s:4:"3b63";s:17:"ext_localconf.php";s:4:"92c0";s:14:"ext_tables.php";s:4:"7d2b";s:28:"ext_typoscript_constants.txt";s:4:"6d7b";s:24:"ext_typoscript_setup.txt";s:4:"3fd8";s:15:"flexform_ds.xml";s:4:"38e5";s:13:"locallang.xml";s:4:"6037";s:16:"locallang_db.xml";s:4:"67b5";s:17:"locallang_tca.xml";s:4:"0f54";s:10:"README.txt";s:4:"9fa9";s:14:"doc/manual.sxw";s:4:"eb20";s:19:"doc/wizard_form.dat";s:4:"9960";s:20:"doc/wizard_form.html";s:4:"b82d";s:14:"pi1/ce_wiz.gif";s:4:"02b6";s:35:"pi1/class.tx_tipafriendplus_pi1.php";s:4:"24cf";s:43:"pi1/class.tx_tipafriendplus_pi1_wizicon.php";s:4:"c8fe";s:13:"pi1/clear.gif";s:4:"cc11";s:17:"pi1/locallang.xml";s:4:"faf1";s:28:"pi1/tipafriend_plus_css.tmpl";s:4:"9aa6";s:23:"res/tipafriend_plus.css";s:4:"9608";}',
 );
 
 ?>
\ No newline at end of file
index 2bba79c..04c9926 100644 (file)
@@ -47,40 +47,22 @@ class tx_tipafriendplus_pi1 extends tslib_pibase {
         * @param       array           $conf: The PlugIn configuration
         * @return      The content that is displayed on the website
         */
-       function main_old($content,$conf)       {
-               $this->conf=$conf;
-               $this->pi_setPiVarDefaults();
-               $this->pi_loadLL();
-               
-
-       $var = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tipafriend_plus.']['PIDtipForm'];
-       $html = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tipafriend_plus.']['htmlmail'];
 
-               $content=$var.'
-                       Hallo
-               '.$html;
-       
-               return $content;
-       }
-       
-               function main($content,$conf)   {
+        function main($content,$conf)  {
                
        // code inserted to use free Captcha
                if (t3lib_extMgm::isLoaded('sr_freecap') ) {
              require_once(t3lib_extMgm::extPath('sr_freecap').'pi2/class.tx_srfreecap_pi2.php');
              $this->freeCap = t3lib_div::makeInstance('tx_srfreecap_pi2');
     }
-
        // code inserted to use free Captcha
+    
+    $this->conf = $conf;
     $this->pi_initPIflexForm();         
          $this->pi_loadLL();
                        
-               $this->conf = $conf;
-
                $this->config['code'] = $this->cObj->stdWrap($this->conf['code'],$this->conf['code.']);
 
-//$tmpl_file = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tipafriend_plus.']['templateFile'];
-
                        // template is read.
     $this->templateCode = $this->cObj->fileResource($this->conf['templateFile']);
                        // globally substituted markers, fonts and colors.
@@ -232,8 +214,16 @@ class tx_tipafriendplus_pi1 extends tslib_pibase {
 
                        $markerArray['###MESSAGE###']=htmlspecialchars($tipData['message']);
                        $markerArray['###RECIPIENT###']=htmlspecialchars($tipData['recipient']);
-                       $markerArray['###YOUR_EMAIL###']=htmlspecialchars($tipData['email']);
-                       $markerArray['###YOUR_NAME###']=htmlspecialchars($tipData['name']);
+                       
+                       // Pre-fill form data if FE user in logged in
+      if (!$this->postvars && $GLOBALS['TSFE']->loginUser) {
+            $markerArray['###YOUR_EMAIL###'] = $GLOBALS['TSFE']->fe_user->user['email'];
+            $markerArray['###YOUR_NAME###'] = $GLOBALS['TSFE']->fe_user->user['name'];
+      } else {
+            $markerArray['###YOUR_EMAIL###']=htmlspecialchars($tipData['email']);
+            $markerArray['###YOUR_NAME###']=htmlspecialchars($tipData['name']);
+      } 
+      
                        $markerArray['###HTML_MESSAGE###']=$tipData['html_message'] ? 'checked' : '';
                        $markerArray['###CAPTCHA_HTML###']=$captchaHTMLoutput;
 
@@ -418,22 +408,10 @@ class tx_tipafriendplus_pi1 extends tslib_pibase {
     $markerArray['###TAF_LINK###']= $this->pi_getLL('link');
                
                
-
-                       // Substitute
+               // Substitute
                $content= $this->cObj->substituteMarkerArrayCached($subpart,$markerArray,array(),$wrappedSubpartArray);
     return $content;
        }
-
-
-
-
-
-
-       function getCaptchaElements()   {
-               $code = substr(md5(uniqid()),0,10);
-
-               return array($code,$code);
-       }
        
        
 }