function olark_settings in Olark Chat 7
Same name and namespace in other branches
- 6 olark.module \olark_settings()
Settings form.
1 string reference to 'olark_settings'
- olark_menu in ./
olark.module - Implements hook_menu().
File
- ./
olark.module, line 171 - Integrates Olark Chat in a Drupal site.
Code
function olark_settings($form, &$form_state) {
$form = array();
$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>. Any customization code from <a href="https://www.olark.com/help/languages">here</a> is accepted.'),
'#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 platforms.'),
'#default_value' => variable_get('olark_ios', ''),
);
$form['olark_enable_admin'] = array(
'#type' => 'checkbox',
'#title' => t('Enable on admin pages.'),
'#description' => t('Embeds the olark code on admin pages.'),
'#default_value' => variable_get('olark_enable_admin', FALSE),
);
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/structure/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' => user_roles(),
);
return system_settings_form($form);
}