You are here

function message_subscribe_flag_default_flags in Message Subscribe 7

Implements hook_flag_default_flags().

File

./message_subscribe.module, line 517
Subscribe API for the Message and Message notify modules.

Code

function message_subscribe_flag_default_flags() {
  $flags = array();

  // Exported flag: "Content".
  $flags['subscribe_node'] = array(
    'entity_type' => 'node',
    'title' => 'Content',
    'global' => '0',
    'types' => array(),
    'flag_short' => 'Subscribe',
    'flag_long' => '',
    'flag_message' => 'You are now subscribed to this item.',
    'unflag_short' => 'Unsubscribe',
    'unflag_long' => '',
    'unflag_message' => 'You are no longer subscribed to this item.',
    'unflag_denied_text' => '',
    'link_type' => 'toggle',
    'import_roles' => array(
      'flag' => array(
        0 => '2',
      ),
      'unflag' => array(
        0 => '2',
      ),
    ),
    'weight' => 0,
    'show_on_form' => 0,
    'access_author' => '',
    'show_on_page' => 1,
    'show_on_teaser' => 1,
    'show_contextual_link' => 0,
    'i18n' => 0,
    'module' => 'message_subscribe',
    'locked' => array(
      0 => 'name',
    ),
    'api_version' => 3,
    'status' => FALSE,
  );

  // Exported flag: "Terms".
  $flags['subscribe_term'] = array(
    'entity_type' => 'taxonomy_term',
    'title' => 'Terms',
    'global' => '0',
    'types' => array(),
    'flag_short' => 'Subscribe',
    'flag_long' => '',
    'flag_message' => 'You are now subscribed to this item.',
    'unflag_short' => 'Unsubscribe',
    'unflag_long' => '',
    'unflag_message' => 'You are no longer subscribed to this item.',
    'unflag_denied_text' => '',
    'link_type' => 'toggle',
    'import_roles' => array(
      'flag' => array(
        0 => '2',
      ),
      'unflag' => array(
        0 => '2',
      ),
    ),
    'weight' => 0,
    'show_on_entity' => TRUE,
    'show_on_form' => 0,
    'access_author' => '',
    'module' => 'message_subscribe',
    'locked' => array(
      0 => 'name',
    ),
    'api_version' => 3,
    'status' => FALSE,
  );

  // Exported flag: "Users".
  $flags['subscribe_user'] = array(
    'entity_type' => 'user',
    'title' => 'Users',
    'global' => '0',
    'types' => array(),
    'flag_short' => 'Subscribe',
    'flag_long' => '',
    'flag_message' => 'You are now subscribed to this item.',
    'unflag_short' => 'Unsubscribe',
    'unflag_long' => '',
    'unflag_message' => 'You are no longer subscribed to this item.',
    'unflag_denied_text' => '',
    'link_type' => 'toggle',
    'import_roles' => array(
      'flag' => array(
        0 => '2',
      ),
      'unflag' => array(
        0 => '2',
      ),
    ),
    'weight' => 0,
    'show_on_form' => 0,
    'access_author' => '',
    'show_on_profile' => TRUE,
    'access_uid' => '',
    'module' => 'message_subscribe',
    'locked' => array(
      0 => 'name',
    ),
    'api_version' => 3,
    'status' => FALSE,
  );
  if (module_exists('og')) {

    // Exported flag: "Groups".
    $flags['subscribe_og'] = array(
      'entity_type' => 'node',
      'title' => 'Groups',
      'global' => '0',
      'types' => array(),
      'flag_short' => 'Subscribe',
      'flag_long' => '',
      'flag_message' => 'You are now subscribed to this item.',
      'unflag_short' => 'Unsubscribe',
      'unflag_long' => '',
      'unflag_message' => 'You are no longer subscribed to this item.',
      'unflag_denied_text' => '',
      'link_type' => 'toggle',
      'import_roles' => array(
        'flag' => array(
          0 => '2',
        ),
        'unflag' => array(
          0 => '2',
        ),
      ),
      'weight' => 0,
      'show_on_form' => 0,
      'access_author' => '',
      'show_on_page' => 1,
      'show_on_teaser' => 1,
      'show_contextual_link' => 0,
      'i18n' => 0,
      'module' => 'message_subscribe',
      'locked' => array(
        0 => 'name',
      ),
      'api_version' => 3,
      'status' => FALSE,
    );
  }
  if (FLAG_API_VERSION == 2) {
    $flags['subscribe_node']['api_version'] = $flags['subscribe_term']['api_version'] = $flags['subscribe_user']['api_version'] = 2;
    $flags['subscribe_node']['content_type'] = 'node';
    $flags['subscribe_term']['content_type'] = 'taxonomy_term';
    $flags['subscribe_user']['content_type'] = 'user';
    $flags['subscribe_node']['roles'] = $flags['subscribe_node']['import_roles'];
    $flags['subscribe_term']['roles'] = $flags['subscribe_term']['import_roles'];
    $flags['subscribe_user']['roles'] = $flags['subscribe_user']['import_roles'];
    unset($flags['subscribe_node']['import_roles'], $flags['subscribe_term']['import_roles'], $flags['subscribe_user']['import_roles']);
    unset($flags['subscribe_node']['entity_type'], $flags['subscribe_term']['entity_type'], $flags['subscribe_user']['entity_type']);
    if (module_exists('og')) {
      $flags['subscribe_og']['api_version'] = 2;
      $flags['subscribe_og']['content_type'] = 'node';
      $flags['subscribe_og']['roles'] = $flags['subscribe_og']['import_roles'];
      unset($flags['subscribe_og']['entity_type'], $flags['subscribe_og']['import_roles']);
    }
  }
  return $flags;
}