[TYPO3-project-formidable] Code simplification

François SCHOSSIG fs.nospam1 at a-e-r.org
Mon Oct 30 22:27:05 CET 2006


Here are some lines of XML code with two possible solutions...
This uses the possibility to recombine the way a renderlet is rendered.


You have this :
   <renderlet:TEXT name="fax">
     <recombine>
       <label>
         <userobj>
           <ts><![CDATA[
             10 = TEXT
             10.data = LLL:EXT:aer_feuser/pi1/ 
locallang.xml:accountEdit.fax.label
             10.wrap = |<span class="userRequis">&nbsp;*</span>
           ]]></ts>
         </userobj>
       </label>
     </recombine>
     <custom>class="userRepField"</custom>
     <validators>
       <validator:STANDARD>
         <required>
           <value>true</value>
           <message>LLL:EXT:aer_feuser/pi1/ 
locallang.xml:accountEdit.fax.error.required</message>
         </required>
       </validator:STANDARD>
     </validators>
   </renderlet:TEXT>

But, this is possible too :
   <renderlet:LISTBOX name="tx_aerfeuser_group_level2">
     <recombine>
       <userobj>
         <ts><![CDATA[
           10 = COA
           10 {
             10 = PHP_SCRIPT_EVAL
             10.value (
               $labelPath = "LLL:EXT:aer_feuser/pi1/ 
locallang.xml:accountEdit.tx_aerfeuser_group_level2.label.";
               $labelPath.= $GLOBALS['myThis']->oFormEdit- 
 >oDataHandler->_getThisFormData("tx_aerfeuser_group_type");
               echo $GLOBALS['myThis']->oFormEdit->_getLLLabel 
($labelPath);
             )
             10.wrap = <tr><td class="userLabel">|</td>

             20 = TEXT
             20.value < params.input
             20.wrap = <td class="userRep">|<span  
class="userRequis">&nbsp;*</span></td></tr>
           }
         ]]></ts>
       </userobj>
     </recombine>
     <custom>class="userRepList"</custom>
     <validators>
       <validator>
         <type>STANDARD</type>
           <required>
             <value>true</value>
             <message>
               <userobj>
                 <php><![CDATA[
                   return
                     $this->_getLLLabel(
                       "LLL:EXT:aer_feuser/pi1/ 
locallang.xml:accountEdit.tx_aerfeuser_group_level2.error.required."
                       .$this->oDataHandler->_getThisFormData 
("tx_aerfeuser_group_type")
                     );
                 ]]></php>
               </userobj>
             </message>
           </required>
       </validator>
     </validators>
     <process>
       <userobj>
         <php><![CDATA[
           $type = $this->oDataHandler->_getThisFormData 
("tx_aerfeuser_group_type");
           return ($type != "" && $type != "type-media" && $type !=  
"type-misc");
         ]]></php>
       </userobj>
     </process>
     <data>
       <userobj>
         <php><![CDATA[
           return $this->_oParent->oAERoutils->aer_populateGroupLevel2(
             $this->oDataHandler->_getThisFormData 
("tx_aerfeuser_group_level1"),
             1,
             array('fe_group')
           );
         ]]></php>
       </userobj>
     </data>
   </renderlet:LISTBOX>



--
F. SCHOSSIG, ICT Manager
Assemblée des Régions d'Europe
http://www.a-e-r.org


Le 13 oct. 06 à 12:44, François SCHOSSIG a écrit :

> Hello,
>
> If I remember well, it is possible to simplify this now with a new
> Typoscript wrap, but how ???
>
>    <label>
>      <userobj>
>        <php><![CDATA[
>          return '<tr><td class="userLabel">'.
>            $this->_getLLLabel(
>              "LLL:EXT:aer_feuser/pi1/
> locallang.xml:accountEdit.tx_aerfeuser_group_level1.label."
>              .$this->oDataHandler->_getThisFormData
> ("tx_aerfeuser_group_type")
>            );
>        ]]></php>
>      </userobj>
>    </label>
>    <wrap><![CDATA[</td><td class="userRep">|<span
> class="userRequis">&nbsp;*</span></td></tr>]]></wrap>
>
> Thanks.
> --
> F. SCHOSSIG, ICT Manager
> Assemblée des Régions d'Europe
> http://www.a-e-r.org
>
>
> _______________________________________________
> TYPO3-project-formidable mailing list
> TYPO3-project-formidable at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-project- 
> formidable




More information about the TYPO3-project-formidable mailing list