/**
     * fonction principale
     */
    function main($content, $conf)
    {
        $this->conf = $conf;
        $this->pi_setPiVarDefaults();
        $this->pi_loadLL();
        global $TYPO3_CONF_VARS;
        $this->fabvar = unserialize($TYPO3_CONF_VARS["EXT"]["extConf"]["fab_form_mail"]);
        //		debug ($this->piVars[DATA]);
        //		if( (isset($this->piVars['submit_button'])) && ( (strlen($this->piVars['DATA']['email'])>0) || (strlen($this->piVars['email'])>0) ) )
        // 		vire la premi�e condition: si on appuie sur entr�, $this->piVars['submit_button']="" donc � d�onne...
        if (strlen($this->piVars['DATA']['email']) > 0 || strlen($this->piVars['email']) > 0) {
            //t3lib_div::debug($this->piVars); //Mode DEBUG
            if (strlen($this->piVars['DATA']['email']) > 0) {
                // si formulaire soumis et email saisi
                //test de la presence de l'email dans la table
                $uid = txRecupLib("tx_fabformmail_abonne", "email", "uid", $this->piVars['DATA']['email'], " AND deleted!=1");
                if ($uid) {
                    //utilisateur present dans la table == modif de l'abonnement
                    $content = '<h2>' . $this->pi_getLL("subs_modif", "Subscription Modification") . '</h2>';
                } else {
                    //utilisateur non present == inscription
                    $content .= '<h2>' . $this->pi_getLL("subs_new", "New subscription") . '</h2>';
                    $this->newabonne = true;
                    //
                }
                //formulaire
                $content .= $this->affichageFormulaire($uid, $this->piVars['DATA']['email']);
            } elseif (strlen($this->piVars['email']) > 0) {
                if ($this->piVars['formulaire'] == "abonne") {
                    // enl�e les pages redondantes (si une page parente est deja select., on vire)
                    $this->piVars['DATA']['uidPages'] = $this->CleanPageArbo($this->piVars['DATA']['uidPages']);
                    // on met un formulaire, pour pouvoir revenir en arri�e
                    // le retour en arri�e valide le formulaire avec un javascript
                    $content = '<FORM action="' . $this->pi_getPageLink($GLOBALS["TSFE"]->id) . '" name="' . $this->prefixId . 'fname" method="POST">
	               <INPUT type="hidden" name="' . $this->prefixId . '[DATA][email]" value="' . $this->piVars['email'] . '">';
                    $content .= "<h2>" . $this->pi_getLL("Subscribtion", "Subscription") . "</h2>";
                    //test validit�et recapitulation des infos choisies
                    $content .= $this->affichageChoix($this->piVars['uid'], $this->piVars['email'], $this->piVars['DATA']['uidPages'], $this->piVars['DATA']['typeFrequence'], $this->piVars['DATA']['typeEtat'], $this->piVars['DATA']['typeExtension'], $this->piVars['DATA']['hidden'], $this->piVars['DATA']['newsletter']);
                    //enregistrement
                    $content .= $this->enregistrementAbonnement($this->piVars['uid'], $this->piVars['email'], $this->piVars['DATA']['uidPages'], $this->piVars['DATA']['typeFrequence'], $this->piVars['DATA']['typeEtat'], $this->piVars['DATA']['typeExtension'], $this->piVars['DATA']['hidden'], $this->piVars['DATA']['newsletter']);
                    $content .= "</form>";
                } elseif ($this->piVars['formulaire'] == "desabonne") {
                    $content .= $this->suppressionAbonnement($this->piVars['uid']);
                }
            }
        } else {
            //Affichage de l'invite de connexion par
            //saisie de l'email
            //			$content = $this->insertJavaScript();
            $content .= $this->EnterMailForm();
        }
        return $this->pi_wrapInBaseClass($content);
    }
 function RetEntete($title = "")
 {
     $DStitle = txRecupLib("pages", "uid", "title", $this->conf['pidList']);
     if ($this->marketTitle($DStitle)) {
         $entete = '<H2><img src="' . $this->conf["extCurDir"] . 'picto_fiches.gif" align="middle">&nbsp;&nbsp;' . ($title == "" ? $DStitle : $title) . '</H2>';
     } else {
         $entete = '<H2><img src="' . $this->conf["extCurDir"] . 'picto_documents.gif" align="middle">&nbsp;&nbsp;' . ($title == "" ? $DStitle : $title) . '</H2>';
     }
     return $entete;
 }
 /**
  * [R�up�ation et traitement des champs]
  */
 function getFieldContent($fN)
 {
     $fieldValue = $this->internal["currentRow"][$fN];
     //		debug($fN);
     switch ($fN) {
         case "uid":
             return $this->pi_list_linkSingle($fieldValue, $this->internal["currentRow"]["uid"], 1);
             // The "1" means that the display of single items is CACHED! Set to zero to disable caching.
             break;
         case "small_img":
         case "big_img":
             if (file_exists($this->upload_img_folder . '/' . $fieldValue) && $fieldValue != "") {
                 // contruction du tableau du conf de l'image
                 // car utilisation de la m�hode cObj->IMAGE($conf) pour redimensionnement auto
                 // les param�res addistionnels (Align et maxW notamment, sont plac�s dans le ext_typoscript_setup.txt)
                 $ConfI["file"] = $this->upload_img_folder . '/' . $fieldValue;
                 $ConfI["file."]["maxW"] = $this->conf[$fN . "MaxWidth"];
                 return str_replace(">", ' class="actu' . $fN . '">', $this->cObj->IMAGE($ConfI));
                 //return '<img src="'.$this->upload_img_folder.'/'.$fieldValue.'" align="left" border="0">';
                 // voir http://typo3api.ueckermann.de/classtslib__cObj.html#a69 pour plus d'info sue les param
             } elseif ($fN == "small_img") {
                 //return '<img src="'.$this->conf["extCurDir"].'fleche_puce.gif" class="picto" />';
                 // Diabne veut plus du picto
                 return "";
             } else {
                 return "";
             }
             break;
         case "abstract":
         case "bodytext":
             //return $this->pi_RTEcssText($fieldValue);
             /*
             				modifications apport�s au traitements de la m�hode getFieldContent($fN)
             				la ligne d'origine ci-dessus est g��� automatiquement, mais dans ce cas, les liens (entres autres) ins�� avec le RTE
             				ne sont pas affich� dans le FE correctement bien qu'ils soient enregistr�.
             				Pour que le changement ci-dessous fonctionne, il faut l'associer �la directive plac� dans le gabarit principal suivante:
             				plugin.tx_macledextensionsansunderscores_pi1.RTEcontent_stdWrap.parseFunc < tt_content.text.20.parseFunc */
             return $this->cObj->stdWrap($this->pi_RTEcssText($fieldValue), $this->conf['RTEcontent_stdWrap.']);
             break;
         case "starttime":
             if ($fieldValue == "0") {
                 $fieldValue = $this->internal["currentRow"]["tstamp"];
             }
         case "tstamp":
         case "endtime":
             if ($fieldValue != "0") {
                 return getDateF($fieldValue);
             }
             break;
         case "author":
             $fieldValue = txRecupLib("fe_users", "uid", "name", $fieldValue);
             if (!$fieldValue) {
                 // si pas d'auteur interne saisit, renvoie le be_user cr�teur
                 $fieldValue = txRecupLib("be_users", "uid", "realName", $this->internal["currentRow"]["cruser_id"]);
             }
             return $fieldValue ? "Auteur : " . $fieldValue : "";
             break;
         case "email":
             $fieldValue = txRecupLib("fe_users", "uid", "email", $this->internal["currentRow"]["author"]);
             // si pas de mail et que l'auteur interne n'existe pas non plus, on renvoe le mail du be_user createur
             if (!$fieldValue && !txRecupLib("fe_users", "uid", "name", $this->internal["currentRow"]["author"])) {
                 $fieldValue = txRecupLib("be_users", "uid", "email", $this->internal["currentRow"]["cruser_id"]);
             }
             return $fieldValue ? $fieldValue : "";
             break;
         case "document":
             if ($fieldValue != "") {
                 $CfN = $this->upload_doc_folder . '/' . $fieldValue;
                 $fieldValue .= '<span class="actdoc">';
                 $fieldValue .= DFSIL($CfN);
                 $fieldValue .= '&nbsp;<a href="' . $CfN . '" target="_blank"><img src="' . $this->ChemImg . 'telecharger.gif" class="picto" title="' . $this->pi_getLL("download", "[download]") . '"></a></span>';
             }
             return $fieldValue;
             break;
         case "bimg_credit":
             if ($fieldValue != "") {
                 $fieldValue = $this->pi_getLL("CredPhot", "[(C) Photo]") . $fieldValue;
             }
             return $fieldValue;
             break;
         default:
             return $fieldValue;
             break;
     }
 }
 function RetEntete($title = "Document")
 {
     // SUR INTRANET ON PRENAIT LE NOM DU DOSSIER SYSTEME, Plus sur Internet
     $DStitle = txRecupLib("pages", "uid", "title", $this->conf['pidList']);
     $entete = '<H2 class="titreDossier"><img src="' . $this->conf["extCurDir"] . 'picto_documents.gif" class="picto">&nbsp;&nbsp;' . $title . '</H2>';
     return $entete;
 }
    /**
     * [Put your description here]
     */
    function pi_list_row($c)
    {
        $editPanel = $this->pi_getEditPanel();
        if ($editPanel) {
            $editPanel = "<TD>" . $editPanel . "</TD>";
        }
        /* ORGINAL: return '<tr'.($c%2 ? $this->pi_classParam("listrow-odd") : "").'>
        				<td><P>'.$this->getFieldContent("uid").'</P></td>
        				<td valign="top"><P>'.$this->getFieldContent("title").'</P></td>
        				<td valign="top"><P>'.$this->getFieldContent("k_value").'</P></td>
        				<td valign="top"><P>'.$this->getFieldContent("unity").'</P></td>
        				<td valign="top"><P>'.$this->getFieldContent("update_type").'</P></td>
        				<td valign="top"><P>'.$this->getFieldContent("update_period").'</P></td>
        				'.$editPanel.'
        			</tr>'; */
        $unity_uid = $this->getFieldContent("unity");
        $unity_icon = txRecupLib("tx_vm19keynumbers_unities", "uid", "icon", $unity_uid);
        if (file_exists($this->upload_doc_folder . '/' . $this->getFieldContent($fN))) {
            $valret = '<img src="' . $this->upload_doc_folder . '/' . $this->getFieldContent($fN) . '" align="left" border="0">';
        }
        if ($unity_icon != false && $unity_icon != "" && file_exists($this->upload_doc_folder . '/' . $unity_icon)) {
            $unity_icon = '<img src="' . $this->upload_doc_folder . '/' . $unity_icon . '">';
        } else {
            $unity_icon = "&nbsp;";
        }
        $u_code = txRecupLib("tx_vm19keynumbers_unities", "uid", "unity_code", $unity_uid);
        //debug($u_code);
        $k_value = $this->getFieldContent("k_value");
        /*
        Description du format
        unite|nb_dec|dec_sep|mil_sep
        */
        if (strstr($u_code, "|")) {
            // existe une séparation format#unité
            $f = explode("|", $u_code);
            $unite = $f[0];
            $nbdec = $f[1];
            $dec_sep = $f[2] != '' ? $f[2] : ',';
            $mil_sep = $f[3] != '' ? $f[3] : '¤';
        } else {
            $unite = $u_code;
            $nbdec = 1;
            $dec_sep = ",";
            $mil_sep = "¤";
        }
        $k_value = number_format($k_value, $nbdec, $dec_sep, $mil_sep) . "&nbsp;" . $unite;
        $k_value = str_replace("¤", "&nbsp;", $k_value);
        $line_comment = $this->getFieldContent("comment") != "" ? '<tr><td>&nbsp;</td><td colspan="2" class="comment">' . $this->getFieldContent("comment") . '</td></tr>' : "";
        return '<tr' . ($c % 2 ? $this->pi_classParam("listrow-odd") : "") . '>
			<td width="25">' . $unity_icon . '</td>
			<td colspan="2"><span class="k_value">' . $k_value . '
			<span class="title">' . $this->getFieldContent("title") . '</td>' . $line_comment . $editPanel . '
			</tr>';
    }