function views_custom_cache_plugin_cache::options_form in Views custom cache 7
Implements views_plugin#options_form().
Overrides views_plugin::options_form
File
- views/
views_custom_cache_plugin_cache.inc, line 60 - Views custom cache first argument plugin.
Class
- views_custom_cache_plugin_cache
- Views caching given view's first argument.
Code
function options_form(&$form, &$form_state) {
parent::options_form($form, $form_state);
$options = array(
60,
300,
1800,
3600,
21600,
86400,
518400,
);
$options = drupal_map_assoc($options, 'format_interval');
$options = array(
-1 => t('Never cache'),
) + array(
0 => t('Permanent cache'),
) + $options + array(
'custom' => t('Custom'),
);
$options_per_user = array(
1 => t('Yes'),
0 => t('No'),
);
$options_entities = array(
'none' => t('Unaware'),
'node' => t('Node aware'),
);
$options_bundles = $this
->get_node_bundles();
$form['cache_time'] = array(
'#type' => 'select',
'#title' => t('Cache duration time.'),
'#options' => $options,
'#default_value' => $this->options['cache_time'],
);
$form['cache_time_custom'] = array(
'#type' => 'textfield',
'#title' => t('Custom time.'),
'#size' => '25',
'#maxlength' => '30',
'#description' => t('Cache duration time in seconds.'),
'#default_value' => $this->options['cache_time_custom'],
'#process' => array(
'ctools_dependent_process',
),
'#dependency' => array(
'edit-cache-options-cache-time' => array(
'custom',
),
),
);
$form['per_role'] = array(
'#type' => 'select',
'#title' => t('Cache per role?'),
'#options' => $options_per_user,
'#default_value' => $this->options['per_role'],
);
$form['entities'] = array(
'#type' => 'select',
'#title' => t('Updates awareness'),
'#options' => $options_entities,
'#default_value' => $this->options['entities'],
);
$form['bundles'] = array(
'#type' => 'select',
'#multiple' => TRUE,
'#title' => t('Be aware of following bundles'),
'#options' => $options_bundles,
'#description' => t('Empty selection means to be aware of all bundles.'),
'#default_value' => $this->options['bundles'],
'#dependency' => array(
'edit-cache-options-entities' => array(
'node',
),
),
);
}