Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
calendar-3296709
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
calendar-3296709
Commits
ea02abcd
Commit
ea02abcd
authored
16 years ago
by
Karen Stevenson
Browse files
Options
Downloads
Patches
Plain Diff
#239594
Make sure ical links with other arguments work correctly.
parent
90e15dfe
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CHANGELOG.txt
+1
-0
1 addition, 0 deletions
CHANGELOG.txt
calendar.inc
+2
-29
2 additions, 29 deletions
calendar.inc
calendar.module
+65
-0
65 additions, 0 deletions
calendar.module
calendar_ical.module
+6
-5
6 additions, 5 deletions
calendar_ical.module
with
74 additions
and
34 deletions
CHANGELOG.txt
+
1
−
0
View file @
ea02abcd
...
...
@@ -4,6 +4,7 @@ Views Calendar 5.x
Version 2.0 dev
===============
- #239594 Make sure ical links with other arguments work correctly.
- #238287 Make sure calendars with other args (like OG) display default view.
- #269920 Fix breadcrumb on year view.
- #238369 Clean up breadcrumb when using calendar with other arguments.
...
...
This diff is collapsed.
Click to expand it.
calendar.inc
+
2
−
29
View file @
ea02abcd
...
...
@@ -662,36 +662,9 @@ function calendar_get_paths($view) {
date_modify
(
$prev_date
,
'-1 '
.
$view
->
calendar_type
);
$next_date
=
drupal_clone
(
$view
->
min_date
);
date_modify
(
$next_date
,
'+1 '
.
$view
->
calendar_type
);
$path
=
calendar_get_url
(
$view
,
$view
->
args
,
TRUE
);
// build an array of the current path and its parts
$real_url
=
calendar_real_url
(
$view
,
$view
->
real_args
);
$buried_args
=
calendar_args_in_url
(
$view
);
$i
=
0
;
$path
[
0
]
=
array
(
'path'
=>
$real_url
,
'type'
=>
'url'
,
);
$start_calendar
=
FALSE
;
foreach
(
$view
->
argument
as
$delta
=>
$arg
)
{
if
(
$delta
<
$buried_args
)
{
continue
;
}
if
(
substr
(
$arg
[
'type'
],
0
,
8
)
==
'calendar'
)
{
$start_calendar
=
TRUE
;
$pathtype
=
str_replace
(
'calendar_'
,
''
,
$arg
[
'type'
]);
$path
[
$delta
+
1
]
=
array
(
'path'
=>
$view
->
args
[
$delta
]
!=
CALENDAR_EMPTY_ARG
?
$view
->
args
[
$delta
]
:
CALENDAR_EMPTY_ARG
,
'type'
=>
$pathtype
,
);
}
// Args prior to the calendar arg are already reflected in the $real_url.
elseif
(
$start_calendar
)
{
$path
[
$delta
+
1
]
=
array
(
'path'
=>
$view
->
args
[
$delta
],
'type'
=>
''
,
);
}
}
// reverse through the path, creating a $nextpath and $prevpath arrays
$formats
=
array
(
'day'
=>
'j'
,
'month'
=>
'm'
,
'year'
=>
'Y'
,
'week'
=>
'W'
);
for
(
$x
=
$delta
+
1
;
$x
>=
0
;
$x
--
)
{
...
...
This diff is collapsed.
Click to expand it.
calendar.module
+
65
−
0
View file @
ea02abcd
...
...
@@ -496,6 +496,71 @@ function calendar_url_append($view) {
return
$url
;
}
/**
* An alternative to views_get_url()
* that will correctly substitute replacement
* values like $group or $node.
*/
function
calendar_get_url
(
$view
,
$args
,
$as_array
=
FALSE
)
{
// build an array of the current path and its parts
$real_url
=
calendar_real_url
(
$view
,
$view
->
real_args
);
$buried_args
=
calendar_args_in_url
(
$view
);
$i
=
0
;
$path
[
0
]
=
array
(
'path'
=>
$real_url
,
'type'
=>
'url'
,
);
$start_calendar
=
FALSE
;
foreach
(
$view
->
argument
as
$delta
=>
$arg
)
{
if
(
$delta
<
$buried_args
)
{
continue
;
}
if
(
in_array
(
$arg
[
'type'
],
calendar_args
()))
{
$start_calendar
=
TRUE
;
$pathtype
=
str_replace
(
'calendar_'
,
''
,
$arg
[
'type'
]);
$path
[
$delta
+
1
]
=
array
(
'path'
=>
$args
[
$delta
]
!=
CALENDAR_EMPTY_ARG
?
$args
[
$delta
]
:
CALENDAR_EMPTY_ARG
,
'type'
=>
$pathtype
,
);
}
// Args prior to the calendar arg are already reflected in the $real_url.
elseif
(
$start_calendar
)
{
$path
[
$delta
+
1
]
=
array
(
'path'
=>
$args
[
$delta
],
'type'
=>
''
,
);
}
}
if
(
$as_array
)
{
return
$path
;
}
else
{
$string
=
''
;
$first
=
TRUE
;
foreach
(
$path
as
$part
)
{
if
(
!
$first
)
{
$string
.
=
'/'
;
}
$string
.
=
$part
[
'path'
];
$first
=
FALSE
;
}
return
$string
;
}
}
/**
* Substitute a calendar argument with a wildcard.
*/
function
calendar_wildcard
(
$arg
,
$value
)
{
if
(
empty
(
$value
)
&&
substr
(
$arg
[
'type'
],
0
,
8
)
==
'calendar'
)
{
$value
=
CALENDAR_EMPTY_ARG
;
}
elseif
(
!
empty
(
$arg
[
'wildcard_substitution'
])
&&
!
empty
(
$arg
[
'wildcard'
])
&&
!
empty
(
$value
)
&&
$value
==
$arg
[
'wildcard'
])
{
$value
=
$arg
[
'wildcard_substitution'
];
}
return
$value
;
}
/**
* Function to test whether this is a view that uses the calendar plugin theme.
*/
...
...
This diff is collapsed.
Click to expand it.
calendar_ical.module
+
6
−
5
View file @
ea02abcd
...
...
@@ -188,7 +188,7 @@ function calendar_ical_views_arguments() {
* handler for our own ical argument; mimics the feed selector
*/
function
views_handler_arg_ical
(
$op
,
&
$query
,
$argtype
,
$arg
=
''
)
{
switch
(
$op
)
{
switch
(
$op
)
{
case
'summary'
:
case
'sort'
:
case
'link'
:
...
...
@@ -223,9 +223,9 @@ function calendar_ical_views_post_view($view, $items, $output) {
* when called as a hook or when called manually from calendar_ical_views_post_view
*/
function
calendar_ical_views_feed_argument
(
$op
,
&
$view
,
$arg
,
$argtype
=
NULL
)
{
if
(
$op
==
'argument'
&&
$arg
==
'ical'
)
{
if
(
$op
==
'argument'
&&
$arg
==
'ical'
)
{
// Keep devel module from appending queries to ical export.
$GLOBALS
[
'devel_shutdown'
]
=
FALSE
;
$GLOBALS
[
'devel_shutdown'
]
=
FALSE
;
$view
->
page_type
=
'calendar_ical'
;
// reset the 'real url' to the URL without the feed argument.
$view_args
=
array
();
...
...
@@ -241,11 +241,12 @@ function calendar_ical_views_feed_argument($op, &$view, $arg, $argtype = NULL) {
$view_args
[]
=
$view_arg
;
}
}
$view
->
feed_url
=
views_get_url
(
$view
,
$view_args
);
$url
=
calendar_get_url
(
$view
,
$args
,
FALSE
);
$view
->
feed_url
=
$url
;
}
else
if
(
$op
==
'post_view'
)
{
$args
=
calendar_ical_post_view_make_args
(
$view
,
$arg
,
'ical'
);
$url
=
views
_get_url
(
$view
,
$args
);
$url
=
calendar
_get_url
(
$view
,
$args
,
FALSE
);
$title
=
views_get_title
(
$view
,
'page'
,
$args
);
if
(
$view
->
used_filters
)
{
$filters
=
drupal_query_string_encode
(
$view
->
used_filters
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment