The module should have proper D7 menu structure with (default) local tasks, local actions and similar, like:

  $items['admin/store/coupons'] = array(
    'title' => 'Coupons',
    'description' => 'Manage store discount coupons.',
    'page callback' => 'drupal_goto',
    'page arguments' => array('admin/store/coupons/list'),
    'access arguments' => array('view store coupons'),
    'file' => 'uc_coupon.admin.inc',
    'position' => 'left',
    'weight' => 10,
  );
  $items['admin/store/coupons/list'] = array(
    'title' => 'Coupons',
    'description' => 'View all coupons.',
    'page callback' => 'uc_coupon_display',
    'page arguments' => array('active'),
    'access arguments' => array('view store coupons'),
    'type' => MENU_NORMAL_ITEM,
    'file' => 'uc_coupon.admin.inc',
    'weight' => 2,
  );
  $items['admin/store/coupons/list/add'] = array(
    'title' => 'Add new coupon',
    'description' => 'Add a new coupon.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('uc_coupon_add_form'),
    'access arguments' => array('manage store coupons'),
    'type' => MENU_LOCAL_ACTION,
    'file' => 'uc_coupon.admin.inc',
    'weight' => 0,
  );
  $items['admin/store/coupons/list/active'] = array(
    'title' => 'Active coupons',
    'description' => 'View active coupons.',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -10,
  );
  $items['admin/store/coupons/list/inactive'] = array(
    'title' => 'Inactive coupons',
    'description' => 'View inactive coupons.',
    'page callback' => 'uc_coupon_display',
    'page arguments' => array('inactive'),
    'access arguments' => array('view store coupons'),
    'type' => MENU_LOCAL_TASK,
    'file' => 'uc_coupon.admin.inc',
    'weight' => 2,
  );

Also, in admin.inc:

  $form['actions'] = array('#type' => 'actions');
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save coupon'),
    '#weight' => 10,
  );

Comments

deja711’s picture

We also noticed this issue. At some point in the past, the 3 tabs functionality was lost (Active Coupons, View Inactive Coupons, Add New Coupon). Lot of store managers loved this and found it very intuitive.
I am not sure if there is a reason for current change. But we needed to make similar change as what you suggested above.

Can this get accepted?

djg_tram’s picture

Title: D7 menu entries and loval tasks » D7 menu entries and local tasks

[Oops. Changed typo in title.]

milovan’s picture

+1 for this! Exactly how it should be IMO. Please, accept it!