You are here

function olark_settings in Olark Chat 6

Same name and namespace in other branches
  1. 7 olark.module \olark_settings()

Settings form.

1 string reference to 'olark_settings'
olark_menu in ./olark.module
Implements hook_menu().

File

./olark.module, line 150
Integrates Olark Chat in a Drupal site.

Code

function olark_settings() {
  $form = array();
  $olark_roles_options = user_roles();
  $form['olark_code'] = array(
    '#type' => 'textarea',
    '#title' => t('Olark code'),
    '#description' => t('Paste the Javascript code block from <a href="http://olark.com/install">Olark.com</a>'),
    '#default_value' => variable_get('olark_code', ''),
  );
  $form['olark_ios'] = array(
    '#type' => 'checkbox',
    '#title' => t('Disable in iOS devices'),
    '#description' => t('Hides it on iPhone, iPad and iPod since it has issues in this plataforms.'),
    '#default_value' => variable_get('olark_ios', ''),
  );
  if (module_exists('context')) {
    $form['olark_context'] = array(
      '#type' => 'checkbox',
      '#title' => t('Use Context to choose when Olark is added to the page.'),
      '#description' => t('The Olark code will be included on all pages of your site by default. You can use <a href="!context_url">Context module</a> to fine tune when and where it will be displayed.', array(
        '!context_url' => url('admin/build/context'),
      )),
      '#default_value' => variable_get('olark_context', 0),
    );
  }
  $form['olark_ignore_user_roles'] = array(
    '#type' => 'checkboxes',
    '#title' => t('User roles that will not display Olark Chat'),
    '#description' => t('Certain roles may exist, such as the administrator role, that you do not wish Olark Chat to display. Use these checkboxes to select possible roles that will prevent Olark Chat from loading'),
    '#default_value' => variable_get('olark_ignore_user_roles', array()),
    '#options' => $olark_roles_options,
  );
  return system_settings_form($form);
}