Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
V
views
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Drupal.org issue queue
Drupal.org issue queue
Security & Compliance
Security & Compliance
Dependency List
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
project
views
Commits
84b50489
Commit
84b50489
authored
May 05, 2007
by
merlinofchaos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#138481
: (fago) Allow 'delete' link to return to view like edit link does.
parent
ec71310d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletion
+18
-1
CHANGELOG.txt
CHANGELOG.txt
+1
-0
modules/views_node.inc
modules/views_node.inc
+17
-1
No files found.
CHANGELOG.txt
View file @
84b50489
...
...
@@ -10,6 +10,7 @@ Views 5.x-dev
o #117365: Comment: Last Changed Time wasn't ensuring node_comment_statistics is in the query.
o #136794: Sort by nid via click-sorting was also broken
o #141205: (by mfrederickson) Add an argument to views_get_filter_values() to let other code use it.
o #138481: (fago) Allow 'delete' link to return to view like edit link does.
Views 5.x-beta3
Bugs fixed:
...
...
modules/views_node.inc
View file @
84b50489
...
...
@@ -95,7 +95,10 @@ function node_views_tables() {
),
'delete'
=>
array
(
'name'
=>
t
(
'Node: Delete link'
),
'handler'
=>
'views_handler_node_delete'
,
'handler'
=>
array
(
'views_handler_node_delete_destination'
=>
t
(
'Return To View'
),
'views_handler_node_delete'
=>
t
(
'Return To The Frontpage'
),
),
'notafield'
=>
TRUE
,
'addlfields'
=>
array
(
'type'
,
'uid'
),
'option'
=>
'string'
,
...
...
@@ -887,6 +890,19 @@ function views_handler_node_delete($fieldinfo, $fielddata, $value, $data) {
}
}
/**
* display a link to delete a node with a destination return
*/
function
views_handler_node_delete_destination
(
$fieldinfo
,
$fielddata
,
$value
,
$data
)
{
// try to build a fake node object
$data
->
type
=
$data
->
node_type
;
$data
->
uid
=
$data
->
node_uid
;
if
(
node_access
(
'delete'
,
$data
))
{
$link_text
=
$fielddata
[
'options'
]
?
$fielddata
[
'options'
]
:
t
(
'Delete'
);
return
l
(
$link_text
,
"node/
$data->nid
/delete"
,
NULL
,
drupal_get_destination
());
}
}
/**
* Display a node's nid, which is a little bit special.
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment