[TYPO3-project-formidable] hide/disable {link_delete} tag from tempelte doing runetime.

François SCHOSSIG fs.nospam1 at a-e-r.org
Tue May 22 09:15:31 CEST 2007


You can do (FORMidable 0.7)

-> template				
     <!-- ###LIGNE 1### begin -->
         <tr class = "ligne1">
             <td class="colCommunicationTitle">{communication_title}</ 
td>
             <td class="colCommunicationDate">{communication_date}</td>
             <td class="colIcons">{bouton_editLangDef}{i18n} 
{bouton_delete}</td>
         </tr>
     <!-- ###LIGNE 1### end -->

-> XML
     <renderlet:BUTTON name="bouton_delete" label="Delete"  
custom="class='bouton'">
         <onclick runat="server">
             <userobj>
                 <php><![CDATA[
		    // and you do here your delete action
                 ]]></php>
             </userobj>
         </onclick>
         <process>
             <userobj>
                 <php><![CDATA[
                     // return true or false depending on your rights
                     // this will make the button not on the page
                     // (not only hidden)
                 ]]></php>
             </userobj>
         </process>
     </renderlet:BUTTON>


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


Le 22 mai 07 à 01:03, Asbjørn Morell a écrit :

> I found a way of doing it.
>
> I modified  my template like this:
> <td><a href = "{link_delete}">delete</a></td>
> to
> <td>{link_delete}</td>
>
> I found another function in the TYPO3 api that generates a complete  
> linke:
>
>     function _populateArtLinkEdit($aParams, &$oForm)
>     {
>         if ($GLOBALS["TSFE"]->fe_user->user[uid] ==
> $aParams[row][cruser_id]) {
>             return ($this->pi_linkToPage("edit", $GLOBALS["TSFE"]->id,
>                     "",
>                     array("do" => artEdit,
>                         "uid" => $aParams['row']['uid']
>                         )
>                     )
>                 );
>         }
>     }
>
> Now I don't get delete and edit buttoms if my customtag function  
> don't find
> a match.
>
>
>
> Regards.
> Asbjørn Morell.
>
> "Asbjørn Morell" <atmorell at gmail.com> wrote in message
> news:mailman.1.1179773568.11409.typo3-project- 
> formidable at lists.netfielders.de...
>> Hello,
>>
>> I am trying to use the same listing form for normal view and  
>> auther mode.
>> This is a part of my template:
>>
>>  <!-- ###ROW1### begin-->
>>   <tr class="row1">
>>    <td>{title}</td>
>>    <td>{image}</td>
>>    <td><a href = "{link_delete}">delete</a></td>
>>   </tr>
>>  <!-- ###ROW1### end-->
>>
>> I need to hide/remove the {link_delete} if a fe_user does not own  
>> this
>> record. The link_delete is generated from a custom tag:
>>
>>  <customtags>
>>
>>    <tag_link_delete>
>>      <name>link_delete</name>
>>      <value>
>>        <userobj>
>>          <extension>this</extension>
>>          <method>_populateArtLinkDelete</method> //this function  
>> checks
>> permissions and returns an url if access is granted.
>>        </userobj>
>>      </value>
>>    </tag_link_delete>
>>
>>  </customtags>
>>
>>
>>
>> Best regards.
>> Asbjørn Morell.
>
> _______________________________________________
> 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