Needed feature for ISPConfig 2.X

Discussion in 'Developers' Forum' started by danf.1979, Feb 7, 2007.

  1. danf.1979

    danf.1979 ISPConfig Developer ISPConfig Developer

    When adding a new element in the form designer, there should be a way to specify permissions rules (Permitted for Reseller? Permitted for client?)
    For example, you may want to have exclusive features for the administrator only in the website hosting plans or website adding form (Text input fields or checkboxes, etc) . Right now adding a new element in the website adding form includes also the reseller by default, which might no be what one have in mind... Or I have missed something? :)
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    You can change the visibility of form elemnts in the code of the onshow event of the form action file.
     
  3. danf.1979

    danf.1979 ISPConfig Developer ISPConfig Developer

    I did a fast view and saw a lot of references like this
    Code:
    if (something)
    
      $doc->deck[0]->elements[17]->visible = 0;
    
    
    I thought using numeric indices would make very hard to "move" a new element ip in a given form? Things could break...
    In other codes I see this, which seems to be better
    Code:
    getElementByName(name)
    
    I did move my element up, so I guess the element index changes all indices by 1, down the form :(
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    There is already a getElementByName function implemented:

    $doc->deck[0]->getElementByName('web_mailquota')->visible = 0;

    But the older code addresses the fields by ID. If you moved your field up, you will either have to change the ID's for all elements that where now on another position or replace the IS's by the getElementByName syntax which will help us in future.
     
  5. danf.1979

    danf.1979 ISPConfig Developer ISPConfig Developer

    Ok no problem, I'll update the code then for that form. Thanks for the help...
     

Share This Page