You are here

function om_node_body_classes in OM Tools 6.2

Same name and namespace in other branches
  1. 8.2 tools/node/node.inc \om_node_body_classes()
  2. 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 150
Node Tools

Code

function om_node_body_classes($node_defaults = array()) {

  // Node Body Classes
  $out = array();
  if ($node_defaults['node_body_classes_reset'] == 1 || !isset($node_defaults['node_body_classes'])) {
    $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 body classes'),
    '#default_value' => $node_defaults['node_body_classes_switch'],
  );
  $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' => $node_defaults['node_body_classes'],
  );
  $out['node_body_classes_settings']['node_body_classes_prefix'] = array(
    '#type' => 'textfield',
    '#title' => t('Node body class prefix'),
    '#default_value' => $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;
}