Forum Replies Created

Viewing 1 replies (of 1 total)
  • Thread Starter jonmase

    (@jonmase)

    It would be even better to use the code snippet below, so that if the Members plugin is installed and the user has the ‘form_manager_main’ capability so can see the list of forms, but can’t actually do anything to those forms (i.e. doesn’t have either ‘form_manager_forms’ or ‘form_manager_data’), then the form name isn’t made into a link. I’m not sure why a user would have that combination of capabilities, as there’s no point giving them ‘form_manager_main’ if they can’t do anything with the forms, but it makes it a bit more robust.

    <strong>
       <?php if(!$fm_MEMBERS_EXISTS || current_user_can('form_manager_forms') || current_user_can('form_manager_data')) { ?>
          <a class="row-title" href="<?php
          if(!$fm_MEMBERS_EXISTS || current_user_can('form_manager_forms')) {
             echo get_admin_url(null, 'admin.php')."?page=fm-edit-form&sec=design&id=".$form['ID'];
          }
          else if(current_user_can('form_manager_data')) {
             echo get_admin_url(null, 'admin.php')."?page=fm-edit-form&sec=data&id=".$form['ID'];
          }
       ?>">
       <?php echo $form['title'];?></a>
       <?php } else { echo $form['title']; } //If user has no form permissions, do not create a link ?>
    </strong>
Viewing 1 replies (of 1 total)