You are here

function flag_lists_get_templates in Flag Lists 7

Same name and namespace in other branches
  1. 6 flag_lists.module \flag_lists_get_templates()
  2. 7.3 flag_lists.module \flag_lists_get_templates()

Get a list of template flag names.

2 calls to flag_lists_get_templates()
flag_lists_generate_lists_form in ./flag_lists.admin.inc
flag_lists_handler_filter_template::get_value_options in includes/flag_lists_handler_filter_template.inc
Child classes should be used to override this function and set the 'value options', unless 'options callback' is defined as a valid function or static public method to generate these values.

File

./flag_lists.module, line 1610
The Flag Lists module.

Code

function flag_lists_get_templates() {
  $templates = array();
  $result = db_select('flag_lists_types', 'f')
    ->fields('f', array(
    'name',
  ))
    ->distinct()
    ->execute();
  foreach ($result as $obj) {
    $templates[] = flag_get_flag($obj->name);
  }
  return $templates;
}