You are here

function mobile_tools_context_is_mobile_ctools_access_settings in Mobile Tools 7.2

Settings form for the 'by perm' access plugin

@todo Need a way to provide a list of all available contexts to be used by the eval-ed PHP.

1 string reference to 'mobile_tools_context_is_mobile_ctools_access_settings'
is_mobile.inc in mobile_tools_context/plugins/access/is_mobile.inc
Plugin to provide access control based on evaluated PHP.

File

mobile_tools_context/plugins/access/is_mobile.inc, line 30
Plugin to provide access control based on evaluated PHP.

Code

function mobile_tools_context_is_mobile_ctools_access_settings($form, &$form_state, $conf) {
  $perms = array();
  $options = mobile_tools_device_groups();
  $options['mobile'] = 'Mobile device';
  $form['settings']['description'] = array(
    '#type' => 'textfield',
    '#title' => t('Administrative description'),
    '#default_value' => $conf['description'],
    '#description' => t('A description for this test for administrative purposes.'),
  );
  $form['settings']['mobile_any'] = array(
    '#type' => 'checkbox',
    '#title' => t('Mobile brower'),
    '#default_value' => $conf['mobile_any'],
    '#description' => t('Access will be granted if the client browser is any mobile.'),
  );
  $form['settings']['mobile_list'] = array(
    '#type' => 'select',
    '#title' => t('User Agent'),
    '#default_value' => $conf['mobile_list'],
    '#options' => $options,
    '#multiple' => TRUE,
    '#description' => t('Access will be granted if the client browser matches the specific groups.'),
  );
  return $form;
}