1 |
85ad3d82
|
Assos Assos
|
<?php
|
2 |
|
|
|
3 |
|
|
/**
|
4 |
|
|
* @file
|
5 |
|
|
* Contains the fixed argument default plugin.
|
6 |
|
|
*/
|
7 |
|
|
|
8 |
|
|
/**
|
9 |
|
|
* The fixed argument default handler.
|
10 |
|
|
*
|
11 |
|
|
* @ingroup views_argument_default_plugins
|
12 |
|
|
*/
|
13 |
|
|
class views_plugin_argument_default_fixed extends views_plugin_argument_default {
|
14 |
|
|
function option_definition() {
|
15 |
|
|
$options = parent::option_definition();
|
16 |
|
|
$options['argument'] = array('default' => '');
|
17 |
|
|
|
18 |
|
|
return $options;
|
19 |
|
|
}
|
20 |
|
|
|
21 |
|
|
function options_form(&$form, &$form_state) {
|
22 |
|
|
parent::options_form($form, $form_state);
|
23 |
|
|
$form['argument'] = array(
|
24 |
|
|
'#type' => 'textfield',
|
25 |
|
|
'#title' => t('Fixed value'),
|
26 |
|
|
'#default_value' => $this->options['argument'],
|
27 |
|
|
);
|
28 |
|
|
}
|
29 |
|
|
|
30 |
|
|
/**
|
31 |
|
|
* Return the default argument.
|
32 |
|
|
*/
|
33 |
|
|
function get_argument() {
|
34 |
|
|
return $this->options['argument'];
|
35 |
|
|
}
|
36 |
|
|
|
37 |
|
|
function convert_options(&$options) {
|
38 |
|
|
if (!isset($options['argument']) && isset($this->argument->options['default_argument_fixed'])) {
|
39 |
|
|
$options['argument'] = $this->argument->options['default_argument_fixed'];
|
40 |
|
|
}
|
41 |
|
|
}
|
42 |
|
|
}
|
43 |
|
|
|
44 |
|
|
/**
|
45 |
|
|
* @}
|
46 |
|
|
*/ |