hook_ec_widgets

Definition

hook_ec_widgets()
ecommerce-5--4/docs/developer/hooks/core.php, line 19

Description

This hook allows modules declare what widgets they make available. It can be charts, tables or whatever information to be added on store overview page. Widgets are also used for blocks and panels.

@todo get widgets working with panels 2.

Return value

Array, each widgets' attributes must include

  • title: the widget title
  • description: information about the widget
  • callback: function which returns the content
And optionally include:
  • weight: for default ordering
  • perm: access control string, (defaults to administer store)

Code

<?php
function hook_ec_widgets() {
  return array(
    'orders_basic' => array(
      'title'       => t('Orders'),
      'description' => t('Basic orders information.'),
      'callback'    => '_store_widget_orders',
      'weight'      => -10,
      'perm'        => 'administer store',
    ),
  );
}
?>