function _ds_styles in Display Suite 7
Utility function to return styles.
2 calls to _ds_styles()
- ds_extras_field_ui_alter in modules/
ds_extras/ ds_extras.admin.inc - Alter Manage display screen.
- _ds_field_ui_table_layouts in ./
ds.field_ui.inc - Add the layouts fieldset on the Field UI screen.
File
- ./
ds.field_ui.inc, line 1756 - Field UI functions for Display Suite.
Code
function _ds_styles($name = 'ds_styles_regions') {
static $styles = array();
if (!isset($styles[$name])) {
$styles[$name] = array();
$custom_styles = trim(variable_get($name, ''));
if (!empty($custom_styles)) {
$styles[$name][''] = t('None');
$custom_styles = explode("\n", $custom_styles);
foreach ($custom_styles as $key => $value) {
$classes = explode("|", $value);
$key = trim($classes[0]);
$friendly_name = isset($classes[1]) ? trim($classes[1]) : $key;
$styles[$name][check_plain($key)] = $friendly_name;
}
}
}
return $styles[$name];
}