You are here

function rules_menu_add_element_title in Rules 7.2

Menu callback for getting the title for the add element page.

Uses a work-a-round for accessing the plugin name.

See also

RulesUIController::config_menu()

1 string reference to 'rules_menu_add_element_title'
RulesUIController::config_menu in ui/ui.controller.inc
Generates menu items to manipulate rules configurations.

File

./rules.module, line 1342
Rules engine module.

Code

function rules_menu_add_element_title($array) {
  $plugin_name = arg($array[0]);
  $cache = rules_get_cache();
  if (isset($cache['plugin_info'][$plugin_name]['class'])) {
    $info = $cache['plugin_info'][$plugin_name] + array(
      'label' => $plugin_name,
    );
    $label = drupal_strtolower(drupal_substr($info['label'], 0, 1)) . drupal_substr($info['label'], 1);
    return t('Add a new !plugin', array(
      '!plugin' => $label,
    ));
  }
}