Active
Project:
Ubercart Discount Coupons
Version:
7.x-2.1-alpha7
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
4 Apr 2013 at 13:47 UTC
Updated:
27 Sep 2013 at 21:16 UTC
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
Comment #1
deja711 commentedWe 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?
Comment #2
djg_tram commented[Oops. Changed typo in title.]
Comment #3
milovan commented+1 for this! Exactly how it should be IMO. Please, accept it!