[TYPO3] Extending SC_mod_user_setup_index

Tapio Markula tapio.markula at dnainternet.net
Thu Jul 6 10:20:13 CEST 2006


Hi

IMO it would be nice, if users themselves
could change such settings, which concerns them.

It is annoying, that administrator should setup layout-related issues.
I'm unsatisfied to my skin because I can't create for it necessary 
'Personally user setup' (User > Setup.

I didn't get help from 'dev', 'design' and 'hci' groups,
I try this - I know that this list has people, who knows
about plugin development.

I tried to follow the logic of kb_skinselect to extend
SC_mod_user_setup_index.


class ux_SC_mod_user_setup_index extends SC_mod_user_setup_index    {

     function main()    {
         global $LANG;
         parent::main();
         /* new fiel to store new data ? */
         $skinData = $this->getSkinData();
         $skinCode = 
$this->doc->section($LANG->sL('LLL:EXT:kb_skinselect/locallang.php:label_selectSkin').'Skininvaihto:', 
$skinData, 0, 1);
         $this->content = preg_replace('/<h3[^<>]*>Startup\:<\/h3>/', 
$skinCode.chr(10).'<h3 class="uppercase">Startup:</h3>', $this->content);
     }

/*
     function storeIncomingData()    {
         global $BE_USER;
         parent::storeIncomingData();

         $BE_USER->writeUC($BE_USER->uc);
     }
*/

     function getSkinData()    {
         global $LANG, $BE_USER;
         #print_r(t3lib_div::_POST('data'));
         #print_r($BE_USER->uc);
         print($BE_USER->uc['skin']);

         #print_r($BE_USER->userTS['mod.']);
         #print_r($BE_USER->userTS['mod.']);
         #print_r($BE_USER->userTS['mod.']['skin_grey_2.']);

         $options = array();
         $options[] = '<option value="default" 
'.$selected.'>'.$LANG->sL('LLL:EXT:kb_skinselect/locallang.php:label_noSkin').'defult</option>';
         $options[] = '<option value="test" 
'.$selected.'>'.$LANG->sL('LLL:EXT:kb_skinselect/locallang.php:label_noSkin').'test</option>';
         $options[] = '<option value="other" 
'.$selected.'>'.$LANG->sL('LLL:EXT:kb_skinselect/locallang.php:label_noSkin').'other</option>';

         return '<select name="data[skin]">'.implode(chr(10), 
$options).'</select>'.chr(10);
     }




}

the new fied because to BE but new data was not saved.

BTW. data[skin] was just for test purpose.
print($BE_USER->uc['skin']); - empty result.


?>



More information about the TYPO3-english mailing list