You are here

function mb_get_mappings in More Buttons 7

Get all More Buttons mappings.

Parameters

string $module: The name of the MB sub module. Values: mb_content, mb_comment, mb_user

Return value

array The array is keyed with the node types and contains the node type name and the MB mappings. Return is sanitized.

3 calls to mb_get_mappings()
mb_comment_admin in mb_comment/mb_comment.admin.inc
Provides the central MB Content settings form.
mb_content_admin in mb_content/mb_content.admin.inc
Provides the central MB Content settings form.
mb_user_admin in mb_user/mb_user.admin.inc
Provides the MB User settings form.

File

mb/mb.module, line 74
The More Buttons (MB) module allows to use additional buttons with Drupal.

Code

function mb_get_mappings($module) {
  $mappings = array();
  $types = array();
  switch ($module) {
    case 'mb':
    case 'mb_content':
      $types = node_type_get_types();
      foreach ($types as $type) {
        $mappings[check_plain($type->type)] = array(
          'name' => check_plain($type->name),
          'extends' => array(
            'cancel' => variable_get($module . '_cancel_' . $type->type, 0),
            'sac' => variable_get($module . 'sac_' . $type->type, 0),
            'tabcn' => variable_get($module . 'tabcn_' . $type->type, 0),
          ),
        );
      }
      break;
    case 'mb_comment':
      $types = node_type_get_types();
      foreach ($types as $type) {
        $mappings[check_plain($type->type)] = array(
          'name' => check_plain($type->name),
          'extends' => array(
            'cancel' => variable_get($module . '_cancel_' . $type->type, 0),
          ),
        );
      }
      break;
    case 'mb_user':
      $page_types = mb_user_type_get_types();
      foreach ($page_types as $type) {
        $mappings[$type['type']] = array(
          'name' => $type['name'],
          'extends' => array(
            'cancel' => variable_get($module . '_cancel_' . $type['name'], 0),
            'sac' => variable_get($module . 'sac_' . $type['name'], 0),
            'sacn' => variable_get($module . 'sacn_' . $type['name'], 0),
          ),
        );
      }
      break;
  }
  return $mappings;
}