function om_node_body_classes in OM Tools 8.2
Same name and namespace in other branches
- 6.2 tools/node/node.inc \om_node_body_classes()
- 7.2 tools/node/node.inc \om_node_body_classes()
Node Body Classes Form
1 call to om_node_body_classes()
- om_node_tools in tools/
node/ node.inc - Node Tools Form
File
- tools/
node/ node.inc, line 173 - Node Tools
Code
function om_node_body_classes($node_defaults = array()) {
// Node body classes
$out = array();
if (!isset($node_defaults['node_body_classes']) || $node_defaults['node_body_classes_reset'] == 1) {
$node_defaults['node_body_classes'] = 1;
$node_defaults['node_body_classes_prefix'] = 'content-type-';
$node_defaults['node_body_classes_reset'] = 0;
}
$out['node_body_classes_switch'] = array(
'#type' => 'checkbox',
'#title' => t('Apply node tools'),
'#default_value' => isset($node_defaults['node_body_classes_switch']) ? $node_defaults['node_body_classes_switch'] : 1,
);
$out['node_body_classes_settings'] = array(
'#type' => 'fieldset',
'#attributes' => array(
'id' => 'om-group-node-body-classes-settings',
),
'#title' => t('Node body classes settings'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
);
$out['node_body_classes_settings']['node_body_classes'] = array(
'#type' => 'checkbox',
'#title' => t('Add node body classes'),
'#default_value' => isset($node_defaults['node_body_classes']) ? $node_defaults['node_body_classes'] : 1,
);
$out['node_body_classes_settings']['node_body_classes_prefix'] = array(
'#type' => 'textfield',
'#title' => t('Node class prefix'),
'#default_value' => isset($node_defaults['node_body_classes_prefix']) ? $node_defaults['node_body_classes_prefix'] : '',
'#description' => t('content-type-page content-type-page-add | content-type-page-edit | content-type-page-view | content-type-page-delete section-node-add | section-node-edit | section-node-delete'),
);
$out['node_body_classes_reset'] = array(
'#type' => 'checkbox',
'#title' => t('Reset to default values.'),
'#default_value' => $node_defaults['node_body_classes_reset'],
);
return $out;
}