You are here

function commerce_product_pricing_ui_sell_price_rules in Commerce Core 7

Builds the product sell price calculation Rules Overview page.

1 string reference to 'commerce_product_pricing_ui_sell_price_rules'
commerce_product_pricing_ui_menu in modules/product_pricing/commerce_product_pricing_ui.module
Implements hook_menu().

File

modules/product_pricing/includes/commerce_product_pricing_ui.admin.inc, line 12
Administrative page callbacks for the Product Pricing UI module.

Code

function commerce_product_pricing_ui_sell_price_rules() {
  RulesPluginUI::$basePath = 'admin/commerce/config/product-pricing/rules';
  $options = array(
    'show plugin' => FALSE,
  );
  $content['enabled']['title']['#markup'] = '<h3>' . t('Enabled sell price calculation rules') . '</h3>';
  $conditions = array(
    'event' => 'commerce_product_calculate_sell_price',
    'plugin' => 'reaction rule',
    'active' => TRUE,
  );
  $content['enabled']['rules'] = RulesPluginUI::overviewTable($conditions, $options);
  $content['enabled']['rules']['#empty'] = t('There are no active sell price calculation rules.');
  $content['disabled']['title']['#markup'] = '<h3>' . t('Disabled sell price calculation rules') . '</h3>';
  $conditions['active'] = FALSE;
  $content['disabled']['rules'] = RulesPluginUI::overviewTable($conditions, $options);
  $content['disabled']['rules']['#empty'] = t('There are no disabled sell price calculation rules.');

  // Store the function name in the content array to make it easy to alter the
  // contents of this page.
  $content['#page_callback'] = 'commerce_product_pricing_ui_sell_price_rules';
  return $content;
}