function context_condition_menu::condition_form

cis7 context_condition_menu.inc context_condition_menu::condition_form($context)
cle7 context_condition_menu.inc context_condition_menu::condition_form($context)
elmsmedia7 context_condition_menu.inc context_condition_menu::condition_form($context)
icor7 context_condition_menu.inc context_condition_menu::condition_form($context)
meedjum_blog7 context_condition_menu.inc context_condition_menu::condition_form($context)
mooc7 context_condition_menu.inc context_condition_menu::condition_form($context)

Override of condition_form(). Use multiselect widget.

Overrides context_condition::condition_form

File

sites/all/modules/ulmus/context/plugins/context_condition_menu.inc, line 42

Class

context_condition_menu
Expose menu items as a context condition.

Code

function condition_form($context) {
  $form = parent::condition_form($context);
  $menu_count = count($form['#options'], COUNT_RECURSIVE);
  $form['#type'] = 'select';
  $form['#multiple'] = TRUE;
  $form['#attributes'] = array('size' => $menu_count > 20 ? 20 : $menu_count);
  return $form;
}