HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


standard AED module class....

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#91366 (In Topic #18384)
Avatar

Community saint

How to phrase this….

I have figured out what 'ad' and 'ed' do, or go to (I think).. but what about 'ac' and 'ec'?   

I am editing a table, but one of the fields in that table is the id number in a different table, so I'm trying to set up to edit that second table…    I based all this on looking into the code and seeing that similar things that have 'category' editors do this as well…

Perhaps I need to go through the aed class a bit more..


Code (php)

        function misc()
        {
                require_code('templates_donext');
                require_lang('ocrewards');

                return do_next_manager(get_screen_title('OCREWARDS_TITLE'),comcode_lang_string('DOC_OCREWARDS'),
                                        array(
                                                /*       type                                                     page   params                                                                                                  zone*/
                                                array('add_one_category',array('_SELF',array('type'=>'ac'),'_SELF'),do_lang('ADD_REWARD_TYPE')),
                                                array('edit_one_category',array('_SELF',array('type'=>'ec'),'_SELF'),do_lang('EDIT_REWARD_TYPE')),
         
                                                array('add_one',array('_SELF',array('type'=>'ad'),'_SELF'),do_lang('ADD_REWARD')),
                                                array('edit_one',array('_SELF',array('type'=>'ed'),'_SELF'),do_lang('EDIT_REWARD')),
                                                // how do I add add/edit options for rtypes?
                                        ),
                                        do_lang('OCREWARDS_TITLE')
                );
        }
 

Paul
Back to the top
 
Posted
Rating:
#91367
Avatar

ad=add form
_ad=save the add
ed=choose what to edit
_ed=edit form
__ed=save the edit
ac=add form (category)
_ac=save the add (category)
ec=choose what to edit (category)
_ec=edit form (category)
__ec=save the edit (category)

The category ones are called via chaining aed_module classes together. The main aed_module class contains a reference to the class for managing categories, in $cat_aed_module


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#91368
Avatar

Community saint

Ok.   For the rewards addon I am working on, I use ad, ed for the main table.

There is another table ('types') that keeps the type of rewards… the main table uses this one.

Should I be using ac and ec?   

My main module is "class Module_admin_ocrewards extends standard_aed_module"   then after the code to handle the main database (and all this works), I have :

"class Module_admin_ocrewards_cat extends standard_aed_module" …

Is that the correct methodology for the 'ac' and ec' to get to the right place?    

And do I just generate the forms in the _cat class  like I did for the main database?   

Paul
Back to the top
 
Posted
Rating:
#91371
Avatar

Community saint

The answer to my question above is "Yes".


Paul
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: