You are here

function picture_select_breakpoint_group_form in Picture 7.2

Select breakpoint group form.

1 string reference to 'picture_select_breakpoint_group_form'
picture_picture_mapping_ctools_export_ui in ctools/plugins/export_ui/picture_mapping.inc
Implements HOOK_PLUGIN_ctools_export_ui().

File

./picture.admin.inc, line 10
Picture - map breakpoints and image styles.

Code

function picture_select_breakpoint_group_form($form, &$form_state) {
  $groups = breakpoints_breakpoint_group_load_all();
  $options = array();
  foreach ($groups as $group) {
    $options[$group->machine_name] = $group->name;
  }
  if ($options) {
    $form['breakpoint_group'] = array(
      '#title' => t('Breakpoint group'),
      '#type' => 'select',
      '#required' => TRUE,
      '#description' => t('Select a breakpoint group.'),
      '#options' => $options,
      '#default_value' => $form_state['item']
        ->getBreakpointGroup() ? $form_state['item']
        ->getBreakpointGroup()->machine_name : NULL,
    );
  }
  else {
    $form['breakpoint_group'] = array(
      '#title' => t('Breakpoint group'),
      '#type' => 'item',
      '#markup' => t('There are no breakpoint groups. !create_link.', array(
        '!create_link' => l(t('Create a breakpoint group'), 'admin/config/media/breakpoints/groups/add'),
      )),
    );
  }
  return $form;
}