1.20.x layout_relationship.inc LayoutRelationship::form(&$form, &$form_state)

Form.

File

modules/layout/plugins/relationships/layout_relationship.inc, line 85
Class that holds information relating to a layout's context relationships.

Class

LayoutRelationship
@file Class that holds information relating to a layout's context relationships.

Code

function form(&$form, &$form_state) {
  $contexts = $form_state['contexts'];

  $relationship_info = $this->getChild();

  $options = $this->getOptionLabels($contexts, $relationship_info);

  $form_state['relationship'] = $relationship_info;
  $form['context_parent'] = array(
    '#type' => 'select',
    '#default_value' => isset($this->settings['context_parent']) ? $this->settings['context_parent'] : '',
    '#options' => $options,
    '#title' => $relationship_info['context_label'],
  );
}