Recent Topics

1 Nov 18, 2009 19:43    

Version: 2.4.6

So I'm trying to add some fields to the Expert editing mode, the code for which is only going to happen when a new post is created. I get how to add the field; I know it needs to look something like this:

        function AdminDisplayItemFormFieldset( & $params )
        {
          $mynewfieldname = $this->get_class_id().'mynewfield';
          $params['Form']->begin_fieldset( 'Additional Posting Options' );
          $params['Form']->checkbox( $mynewfieldname,
                                     $mynewfieldvalue,
                                     T_('My New Field'), 
                                     T_('Check me.'));
          $params['Form']->end_fieldset( 'Additional Posting Options' );
        }

If I'm understanding the rest of the code and what I've read about the code correctly, I should be able to get the value of that check box after the form submits, in AdminBeforeItemEditCreate - only I cannot for the life of me figure out how.

Can anybody point me in the right direction, please?

2 Nov 18, 2009 19:49

$foo = param($this->get_class_id().'mynewfield', 'urmm... bugger ... can\'t remember which version boolean|checkbox works in... one of them');
echo ( $foo ? $foo : 'bar' );

ish

¥

3 Nov 18, 2009 20:32

Ah-ha. Thank you very much! I knew it had to be something relatively simple...


Form is loading...