function om_node_terms_classes in OM Tools 8.2
Same name and namespace in other branches
- 6.2 tools/node/node.inc \om_node_terms_classes()
- 7.2 tools/node/node.inc \om_node_terms_classes()
Node Body Term Form
1 call to om_node_terms_classes()
- om_node_tools in tools/
node/ node.inc - Node Tools Form
File
- tools/
node/ node.inc, line 221 - Node Tools
Code
function om_node_terms_classes($node_defaults = array()) {
// Node body classes
$node_term_classes = array();
if (!isset($node_defaults['node_terms_classes']) || $node_defaults['node_terms_classes_reset'] == 1) {
$node_defaults['node_terms_classes'] = 1;
$node_defaults['node_terms_classes_prefix'] = 'content-term-';
$node_defaults['node_terms_classes_reset'] = 0;
}
$out['node_terms_classes_switch'] = array(
'#type' => 'checkbox',
'#title' => t('Apply node terms classes'),
'#default_value' => isset($node_defaults['node_terms_classes_switch']) ? $node_defaults['node_terms_classes_switch'] : '',
);
$out['node_terms_classes_settings'] = array(
'#type' => 'fieldset',
'#attributes' => array(
'id' => 'om-group-node-terms-classes-settings',
),
'#title' => t('Node terms classes settings'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$out['node_terms_classes_settings']['node_terms_classes'] = array(
'#type' => 'checkbox',
'#title' => t('Add node terms body classes'),
'#default_value' => isset($node_defaults['node_terms_classes']) ? $node_defaults['node_terms_classes'] : 1,
);
$out['node_terms_classes_settings']['node_terms_classes_prefix'] = array(
'#type' => 'textfield',
'#title' => t('Term class prefix'),
'#default_value' => isset($node_defaults['node_terms_classes_prefix']) ? $node_defaults['node_terms_classes_prefix'] : '',
'#description' => t('content-term-mobile content-term-technology content-term-educaton ...'),
);
$out['node_terms_classes_reset'] = array(
'#type' => 'checkbox',
'#title' => t('Reset to default values.'),
'#default_value' => $node_defaults['node_terms_classes_reset'],
);
return $out;
}