function _filter_get_formats in Features 6
Retrieve all input formats with their respective filters loaded.
4 calls to _filter_get_formats()
- FeaturesUserTestCase::_test_filter in tests/
features.test - filter_features_export in includes/
features.filter.inc - Implementation of hook_features_export().
- filter_features_export_options in includes/
features.filter.inc - Implementation of hook_features_export_options().
- filter_features_export_render in includes/
features.filter.inc - Implementation of hook_features_export_render().
File
- includes/
features.filter.inc, line 98
Code
function _filter_get_formats() {
$formats = array();
// We cannot use user_roles() here because it has the names translated.
$roles = _features_get_roles();
$result = db_query("SELECT * FROM {filter_formats}");
while ($row = db_fetch_object($result)) {
$format_roles = array();
// Prepare a roles array with roles that may access the filter.
foreach ($roles as $name => $role) {
if (strstr($row->roles, ',' . $role['rid'] . ',')) {
$format_roles[$name] = $name;
}
}
$formats[$row->format] = array(
'name' => $row->name,
'roles' => $format_roles,
'filters' => array(),
);
foreach (_filter_list_format($row->format, TRUE) as $filter) {
$formats[$row->format]['filters'][] = array(
'module' => $filter->module,
'delta' => $filter->delta,
'weight' => $filter->weight,
);
}
}
return $formats;
}