You are here

public function FlexiformElementNodeStatus::form in Flexiform 7

Return the form element for this FlexiformElement.

Overrides FlexiformElement::form

File

includes/element/node_status.element.inc, line 15
Contains class for the Node status element.

Class

FlexiformElementNodeStatus
Class to add the node status field to a form.

Code

public function form($form, &$form_state, $entity, $language = LANGUAGE_NONE) {
  $parents = $form['#parents'];
  $parents[] = 'status';
  $form[$this->element_namespace] = array(
    '#type' => 'checkbox',
    '#parents' => $parents,
    '#title' => $this
      ->label(),
    '#default_value' => !empty($entity->status) ? $entity->status : FALSE,
  );
  $form = parent::form($form, $form_state, $entity);
  return $form;
}