You are here

function ContextConditionBreakpoint::condition_form in Context Breakpoint 7

Condition form.

Overrides context_condition::condition_form

File

plugins/context_condition_breakpoint.inc, line 233
context_condition_resolution.inc Provides the context CTools plugin base class.

Class

ContextConditionBreakpoint
@file context_condition_resolution.inc Provides the context CTools plugin base class.

Code

function condition_form($context) {
  $supported = implode(', ', array(
    '(min/max-)width',
    '(min/max-)height',
    '(min/max-)device-width',
    '(min/max-)device-height',
    '(min/max-)aspect-ratio',
    '(min/max-)device-aspect-ratio',
  ));
  $values = $this
    ->fetch_from_context($context, 'values');
  $bp = $values && count($values) ? $values[0] : '';
  return array(
    '#title' => $this->title,
    '#description' => t('Choose the breakpoint or breakpoint group you want to react to. Only compatible breakpoints are displayed (all breakpoints in a group need to be compatible). <br />Supported: ' . $supported . '. "and" queries are supported. <br />' . l('Configure breakpoints', 'admin/config/media/breakpoints')),
    '#options' => $this
      ->condition_values(),
    '#type' => 'select',
    '#default_value' => $bp,
  );
}