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