summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaren Stevenson2012-02-12 14:24:36 (GMT)
committer Karen Stevenson2012-02-12 14:24:36 (GMT)
commit9335829ebd4f9be89f13fa5c722b0ead47537f36 (patch)
tree0b1ef074a3868e6cca3477e49d2d41e5a2370de2
parent1bc60b33b78ab187c285dfd56266f36978028eb5 (diff)
Issue #1399964, Make sure calendar paths all take into account arguments ahead of the calendar arguments when creating links.
-rw-r--r--CHANGELOG.txt1
-rw-r--r--calendar.module17
2 files changed, 16 insertions, 2 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 2206b9e..5aff2bc 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -5,6 +5,7 @@ Calendar Module 7.x
Version 7.x-3.x-dev
===================
+- Issue #1399964, Make sure calendar paths all take into account arguments ahead of the calendar arguments when creating links.
- Issue #1253482, Get rid of attempt to keep track of current location when switching between calendar views, each one will go back to default.
- Issue #1415326 by bkline, Fix help link.
- Issue #1436020 by scrypt, Missing space in attributes at Month's day cell.
diff --git a/calendar.module b/calendar.module
index f807925..62f72c0 100644
--- a/calendar.module
+++ b/calendar.module
@@ -38,9 +38,10 @@ function calendar_preprocess_date_views_pager(&$vars) {
continue;
}
if ($display->display_options['style_plugin'] == 'calendar_style' && !empty($display->display_options['path'])) {
- $path = $display->display_options['path'];
+ //$path = $display->display_options['path'];
$title = $display->display_title;
$type = !empty($display->display_options['style_options']['calendar_type']) ? $display->display_options['style_options']['calendar_type'] : '';
+ $path = calendar_granularity_path($view, $type);
$calendar_links[$current_path]['tabs'][$type] = array('title' => $title, 'path' => $path);
$calendar_links[$current_path]['types'][] = $type;
}
@@ -384,7 +385,19 @@ function calendar_granularity_path(&$view, $granularity) {
if ($display->display_options['style_plugin'] == 'calendar_style' && !empty($display->display_options['path'])) {
$type = !empty($display->display_options['style_options']['calendar_type']) ? $display->display_options['style_options']['calendar_type'] : 'month';
if ($type == $granularity) {
- $paths[$view->name][$granularity] = $display->display_options['path'];
+ $part_path = $display->display_options['path'];
+ $parts = explode('/', $part_path);
+ if (in_array('%', $parts)) {
+ $current_path = parse_url($_GET['q']);
+ $current_parts = explode('/', $current_path['path']);
+ foreach ($parts as $key => $part) {
+ if ($part == '%') {
+ $parts[$key] = $current_parts[$key];
+ }
+ }
+ $part_path = implode('/', $parts);
+ }
+ $paths[$view->name][$granularity] = $part_path;
}
}
}