Some Question

edited February 2011 in Modules
Hi,
I was doing some adv module development, these are my question

1. how to modify the admin menu order ?
currently the only way seem like edit /fuel/modules/config/fuel.php, is there anyway i can overwrite it so that the new module i created appear just after Dashboard ?

2. how to disable the markitup for textarea ?
currently i just disable the javascript to prevent this , any other way to do this ?

3. if I would like to extend the create user process by adding additional field etc , shall i just modify the /fuel/user controller ? or i should build my own controller to replace the create user processs ?


thanks in advance

Comments

  • edited 3:10AM
    1. You can overwrite the navigation order by creating your own $config['nav'] in MY_fuel.php in the order that you want.
    2. You can pass the class "no_editor" to your field like so:
    $fields['my_textarea'] = array('type' => 'textarea', 'class' => 'no_editor'....);
    3. You could modify the user controller, but I would recommend replacing it with your own module/module that extends it. The blog actually does something similar for authors in that they are fuel users with extended fields. The fuel_blog_users table extends the fields for fuel_users to add additional fields specific to the blog.
  • edited 3:10AM
    thanks for the first 2 info, for number 3 in that case i always need to create user first then create blogger ? or i should build a custom controller do insert data to both table at same time ?

    additional question - the save_related function seem like can't use it when you do adv module development, at least from what i see on the blog module , this has been done in other way, is this a bug or it build in that way for some reason?
  • edited 3:10AM
    For the blog users module, you are right in that a FUEL user needs to be created first. There is a dropdown to select which fuel user you want to associate the blog user profile with but that FUEL user needs to exist first. Depending on what you want to do it may be more user friendly to just insert into both tables (I'm assuming that these users you are creating are specific to the FUEL admin).

    The save_related() function should work with advanced modules (depending on the model relationships). The blog users model doesn't use that because save_related is meant to save information to a many to many table.
  • edited 3:10AM
    ah my fault, yup save_related is working, guess i put the wrong model name, thanks for the advice of the user module.

    back to $config['nav'] it seem like only working if you try to overwrite existing nav, example if i try to hide some module for site, but if you are try to add new module, it will be just show at the end of the navigation.
  • edited 3:10AM
    Right... you'll have to overwrite the navigation array completely to get the ordering the way you want. You can just replicate what is currently found in default fuel.php config file.
Sign In or Register to comment.