function flag_flag::options in Flag 7.3
Same name and namespace in other branches
- 6.2 flag.inc \flag_flag::options()
- 7.2 flag.inc \flag_flag::options()
Declares the options this flag supports, and their default values.
Derived classes should want to override this.
3 calls to flag_flag::options()
- flag_entity::options in includes/
flag/ flag_entity.inc - Adds additional options that are common for all entity types.
- flag_flag::construct in includes/
flag/ flag_flag.inc - Default constructor. Loads the default options.
- flag_flag::get_serialized_options in includes/
flag/ flag_flag.inc - Options are stored serialized in the database.
1 method overrides flag_flag::options()
- flag_entity::options in includes/
flag/ flag_entity.inc - Adds additional options that are common for all entity types.
File
- includes/
flag/ flag_flag.inc, line 182 - Contains the flag_flag class. Flag type classes use an object oriented style inspired by that of Views 2.
Class
- flag_flag
- This abstract class represents a flag, or, in Views 2 terminology, "a handler".
Code
function options() {
$options = array(
// The text for the "flag this" link for this flag.
'flag_short' => '',
// The description of the "flag this" link.
'flag_long' => '',
// Message displayed after flagging an entity.
'flag_message' => '',
// Likewise but for unflagged.
'unflag_short' => '',
'unflag_long' => '',
'unflag_message' => '',
'unflag_denied_text' => '',
// The link type used by the flag, as defined in
// hook_flag_link_type_info().
'link_type' => 'toggle',
'weight' => 0,
);
// Merge in options from the current link type.
$link_type = $this
->get_link_type();
$options = array_merge($options, $link_type['options']);
// Allow other modules to change the flag options.
drupal_alter('flag_options', $options, $this);
return $options;
}