| 1 |
<?php
|
| 2 |
// $Id: timeline.admin.inc,v 1.1.2.2 2009/07/25 01:36:49 xamanu Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* @file
|
| 6 |
* Admin settings for timeline module.
|
| 7 |
*/
|
| 8 |
|
| 9 |
|
| 10 |
/**
|
| 11 |
* Declares administrative settings for the module.
|
| 12 |
*/
|
| 13 |
function timeline_admin_settings() {
|
| 14 |
// Library
|
| 15 |
$form['library'] = array(
|
| 16 |
'#type' => 'fieldset',
|
| 17 |
'#title' => t('SIMILE Timeline Library'),
|
| 18 |
'#collapsible' => TRUE,
|
| 19 |
'#collapsed' => FALSE,
|
| 20 |
'#description' => t('You can select to get the timeline libraries from the SIMILE server or your can install it locally.')
|
| 21 |
);
|
| 22 |
|
| 23 |
$form['library']['timeline_library_source'] = array(
|
| 24 |
'#type' => 'select',
|
| 25 |
'#title' => t('Location of Simile Timeline libraries'),
|
| 26 |
'#default_value' => variable_get('timeline_library_source', 'Simile Server'),
|
| 27 |
'#options' => array('hosted' => t('Simile Server')),
|
| 28 |
'#description' => t('Only simile server available. The timeline library is not installed locally.'),
|
| 29 |
);
|
| 30 |
|
| 31 |
// Check correct inclusion of local timeline library
|
| 32 |
if ($timeline_library_status = timeline_validate_library()) {
|
| 33 |
if (is_string($timeline_library_status)) {
|
| 34 |
$form['library']['timeline_library_source']['#description'] = t('Information for local installation: ') . t($timeline_library_status);
|
| 35 |
}
|
| 36 |
elseif ($timeline_library_status == TRUE) {
|
| 37 |
$form['library']['timeline_library_source']['#options']['local'] = 'Local folder' ;
|
| 38 |
$form['library']['timeline_library_source']['#description'] = t('A local timeline library has been found at this location: !timeline_library_path', array('!timeline_library_path' => '<div class="status">' . libraries_get_path('simile_timeline') . '</div>'));
|
| 39 |
}
|
| 40 |
}
|
| 41 |
|
| 42 |
// Display settings
|
| 43 |
$form['display'] = array(
|
| 44 |
'#type' => 'fieldset',
|
| 45 |
'#title' => t('Default display settings'),
|
| 46 |
'#collapsible' => TRUE,
|
| 47 |
'#collapsed' => FALSE,
|
| 48 |
);
|
| 49 |
$form['display']['timeline_default_width'] = array(
|
| 50 |
'#type' => 'textfield',
|
| 51 |
'#title' => t('Default width'),
|
| 52 |
'#default_value' => variable_get('timeline_default_width', '100%'),
|
| 53 |
'#size' => 6,
|
| 54 |
'#maxlength' => 6,
|
| 55 |
'#description' => t('The default width of a timeline (in units of em, px or %), e.g. 600px or 90%.'),
|
| 56 |
);
|
| 57 |
$form['display']['timeline_default_height'] = array(
|
| 58 |
'#type' => 'textfield',
|
| 59 |
'#title' => t('Default height'),
|
| 60 |
'#default_value' => variable_get('timeline_default_height', '400px'),
|
| 61 |
'#size' => 6,
|
| 62 |
'#maxlength' => 6,
|
| 63 |
'#description' => t('The default height of a timeline (in units of em, px or %), e.g. 400px.'),
|
| 64 |
);
|
| 65 |
|
| 66 |
// Display settings
|
| 67 |
$form['advanced'] = array(
|
| 68 |
'#type' => 'fieldset',
|
| 69 |
'#title' => t('Advanced settings'),
|
| 70 |
'#collapsible' => TRUE,
|
| 71 |
'#collapsed' => FALSE,
|
| 72 |
);
|
| 73 |
$form['advanced']['timeline_debug'] = array(
|
| 74 |
'#type' => 'checkbox',
|
| 75 |
'#title' => t('Debug mode'),
|
| 76 |
'#default_value' => variable_get('timeline_debug', FALSE),
|
| 77 |
'#size' => 6,
|
| 78 |
'#maxlength' => 6,
|
| 79 |
'#description' => t('Never enable on a live site! The debug mode prints out an array of the data given to the timeline library when navigating to a views.'),
|
| 80 |
);
|
| 81 |
|
| 82 |
return system_settings_form($form);
|
| 83 |
}
|