You are here

function flag_user_operations in Flag 7.2

Same name and namespace in other branches
  1. 6.2 flag.module \flag_user_operations()
  2. 7.3 flag.module \flag_user_operations()

Implements hook_user_operations().

File

./flag.module, line 1339
The Flag module.

Code

function flag_user_operations() {
  global $user;
  $flags = flag_get_flags('user', NULL, $user);
  $operations = array();
  foreach ($flags as $flag) {
    $operations['flag_' . $flag->name] = array(
      'label' => $flag
        ->get_label('flag_short'),
      'callback' => 'flag_users',
      'callback arguments' => array(
        'flag',
        $flag->name,
      ),
    );
    $operations['unflag_' . $flag->name] = array(
      'label' => $flag
        ->get_label('unflag_short'),
      'callback' => 'flag_users',
      'callback arguments' => array(
        'unflag',
        $flag->name,
      ),
    );
  }
  return $operations;
}