Currently RulesUIController is shipped with the rules_admin module, but then contribs cannot re-use the UI as described in #904978: Preserve breadcrumbs on edit pages for Rules without the rules_admin module being enabled.

Comments

fago’s picture

Component: User Interface » User interface

I've just commited a fixed for that:

 #1015872 a bunch of rules UI improvements that fix re-using of the UI without the rules admin module and make re-using the UI easier:
   * Changed the UI controller to be not based upon the entity API UI controller, as it is too different.
   * moved the rules UI controller to the rules module and fixed the admin module to make use of it.
   * improved overviewTable() and moved it to the UI controller.
   * added the function rules_ui() for easy access to the controller.
   * added an export page

Thus the rules UI can be re-used like that now:

Menu item definition:

  // Add the menu items for the various Rules forms.
  $items += rules_ui()->config_menu('admin/commerce/config/payment');

Page callback:

/**
* Example page callback
*/
function commerce_payment_ui_admin_page() {
  $conditions = array('event' => 'commerce_payment_methods', 'plugin' => 'reaction rule', 'active' => TRUE);
  $content['rules'] = rules_ui()->overviewTable($conditions, array('base path' => admin/commerce/config/payment');
  return $content;
}

Please report if you have any troubles or suggestions for re-using the UI.

fago’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.