You are here

function message_subscribe_flag_get_flags in Message Subscribe 7

Get Message subscribe related flags.

Return Flags related to message subscribe using a name convention -- the flag name should start with "subscribe_".

Parameters

$content_type: Optional. The type of content for which to load the flags. Usually 'node'.

$content_subtype: Optional. The node type for which to load the flags.

$account: Optional. The user account to filter available flags. If not set, all flags for will this node will be returned.

$reset: Optional. Reset the internal query cache.

Return value

$flags An array of the structure [fid] = flag_object.

See also

flag_get_flags()

6 calls to message_subscribe_flag_get_flags()
message_subscribe_admin_settings in includes/message_subscribe.admin.inc
Menu callback; Admin settings form.
message_subscribe_message_subscribe_get_subscribers in ./message_subscribe.module
Implements hook_message_subscribe_get_subscribers().
message_subscribe_ui_menu in message_subscribe_ui/message_subscribe_ui.module
Implements hook_menu().
message_subscribe_ui_tab in message_subscribe_ui/message_subscribe_ui.module
Page callback; Call a view to show the user subscription in a flag.
message_subscribe_ui_tab_access in message_subscribe_ui/message_subscribe_ui.module
Access callback; Determine if user can access a tab.

... See full list

File

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

Code

function message_subscribe_flag_get_flags($content_type = NULL, $content_subtype = NULL, $account = NULL, $reset = FALSE) {
  $flags = flag_get_flags($content_type, $content_subtype, $account, $reset);
  $ms_flags = array();
  $prefix = variable_get('message_subscribe_flag_prefix', 'subscribe') . '_';
  foreach ($flags as $flag_name => $flag) {

    // Check that the flag is using name convention.
    if (strpos($flag_name, $prefix) === 0) {
      $ms_flags[$flag_name] = $flag;
    }
  }
  return $ms_flags;
}