summaryrefslogtreecommitdiff
path: root/kolab.org/www/drupal-7.15/sites/all/modules/views/plugins/views_plugin_argument_default_raw.inc
diff options
context:
space:
mode:
Diffstat (limited to 'kolab.org/www/drupal-7.15/sites/all/modules/views/plugins/views_plugin_argument_default_raw.inc')
-rw-r--r--kolab.org/www/drupal-7.15/sites/all/modules/views/plugins/views_plugin_argument_default_raw.inc16
1 files changed, 15 insertions, 1 deletions
diff --git a/kolab.org/www/drupal-7.15/sites/all/modules/views/plugins/views_plugin_argument_default_raw.inc b/kolab.org/www/drupal-7.15/sites/all/modules/views/plugins/views_plugin_argument_default_raw.inc
index dcaf22f..385ca91 100644
--- a/kolab.org/www/drupal-7.15/sites/all/modules/views/plugins/views_plugin_argument_default_raw.inc
+++ b/kolab.org/www/drupal-7.15/sites/all/modules/views/plugins/views_plugin_argument_default_raw.inc
@@ -1,4 +1,5 @@
<?php
+
/**
* @file
* Contains the raw value argument default plugin.
@@ -6,11 +7,14 @@
/**
* Default argument plugin to use the raw value from the URL.
+ *
+ * @ingroup views_argument_default_plugins
*/
class views_plugin_argument_default_raw extends views_plugin_argument_default {
function option_definition() {
$options = parent::option_definition();
$options['index'] = array('default' => '');
+ $options['use_alias'] = array('default' => FALSE, 'bool' => TRUE);
return $options;
}
@@ -26,10 +30,20 @@ class views_plugin_argument_default_raw extends views_plugin_argument_default {
'#options' => range(1, 10),
'#description' => t('The numbering starts from 1, e.g. on the page admin/structure/types, the 3rd path component is "types".'),
);
+ $form['use_alias'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Use path alias'),
+ '#default_value' => $this->options['use_alias'],
+ '#description' => t('Use path alias instead of internal path.'),
+ );
}
function get_argument() {
- if ($arg = arg($this->options['index'])) {
+ $path = NULL;
+ if ($this->options['use_alias']) {
+ $path = drupal_get_path_alias();
+ }
+ if ($arg = arg($this->options['index'], $path)) {
return $arg;
}
}