[TYPO3-english] Plugin Development
    Kay Strobach 
    typo3 at kay-strobach.de
       
    Fri Sep  4 13:23:40 CEST 2009
    
    
  
Dmitry Dulepov schrieb:
> Move "$GLOBALS['BE_USER']->user['admin']=$userStatus;" above "$tce->start($recData,Array());".
> 
Hello Dimitry,
thanks a lot for the hint, but thats not the goal.
After quite a while of testing i found out the following:
[snip complete code in first post]
   $recData=array();
   $saveId =   $tplRow['_ORIG_uid']
             ? $tplRow['_ORIG_uid']
             : $tplRow['uid'];
   $recData["sys_template"][$saveId]["constants"] =
               implode($tmpl->raw,chr(10));
[snap]
The variable $saveId should point to the nearest template relative to 
pid. That's working as admin f.e. $saveId=71=uid of template, but not as 
normal user ($saveId is empty).
Thats why i set
$userstatus = $GLOBALS['BE_USER']->user['admin'];
$GLOBALS['BE_USER']->user['admin'] = 1;
at the very beginning of the function. And revert to the old state at 
the end. (I thougt this will effect the class t3lib_tsparser_ext as well.)
$GLOBALS['BE_USER']->user['admin'] = $userstatus;
Thanks a lot. (Especially for your book ;))
Best regards
Kay
    
    
More information about the TYPO3-english
mailing list