[TYPO3] how to modify the content of a dropdown menu in the backend comming from my custom table

krassimir berov k_berov at yahoo.com
Tue Apr 4 16:09:28 CEST 2006


Hi everyone, This is my first question as I remember.
 Does any one can help me with the following issue.
 
 I am preparing a custom backend module which modifyes a custom table.
 I have some backend users which are not allowed to set some values in a field of my table. 
 However another backend group has the right to set this value. After that a user from the first group can edit this field and he sees the value and he can leave it like this althought he is not allowed to set this value.
 the result is that my acces rights design is ruined.
 I found that I can preprocess the fields by using a reference to a method in a defined custom class, but it doesnot seems to work.
 
 Example:
 
 $TCA["tx_seekb_articles"] = Array (
 ......
 ....
 #description of field in question
 
 "article_state" => Array (        
             "exclude" => 1,        
             "label" => "LLL:EXT:seekb/locallang_db.php:tx_seekb_articles.article_state",        
             "config" => Array (
                 "type" => "select",
                 "items" => Array (
 #Items are for example 1,2,3
 Array("LLL:EXT:seekb/locallang_db.php:tx_seekb_articles.article_state.I.0", "1", t3lib_extMgm::extRelPath("seekb")."ico_state_0.gif"),
                     
                     Array("LLL:EXT:seekb/locallang_db.php:tx_seekb_articles.article_state.I.3", "3", t3lib_extMgm::extRelPath("seekb")."ico_state_3.gif"),
 Array("LLL:EXT:seekb/locallang_db.php:tx_seekb_articles.article_state.I.4", "4", t3lib_extMgm::extRelPath("seekb")."ico_state_4.gif"),
                 ),
 "itemsProcFunc" => "tx_seekb_articles_article_state->main",    
                 "size" => 1,    
                 "maxitems" => 1,
                 "default" => 3,
             )
         ),
 
 
 ##ETC.
 
 Now if I have in my table a value with state 1 it is displayed like:
 INVALID VALUE (1)
 
 I tryed to preprocess this
 using tx_seekb_articles_article_state->main()
 but I can only add Items to the list. I am not able to change the value.
 
 My problem code in main():
 if($params['row']['article_state']==1){
 #Can't change item value
 $params["items"][1][1]=2; // does not work
 }
 
 Any help will be highly appreciated!!! Thanks in advance.
 

Ps:In CaseYou can not Read my Messages,
they are usualy sent in
Encodings such as
Cyrillic (Windows) or UTF-8
-----K.Berov
		
---------------------------------
New Yahoo! Messenger with Voice. Call regular phones from your PC and save big.


More information about the TYPO3-english mailing list