Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
81f57691
Commit
81f57691
authored
Jul 29, 2012
by
Tim Plunkett
Browse files
Remove hook_views_plugins().
parent
119083b1
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/node.views.inc
View file @
81f57691
...
...
@@ -624,50 +624,6 @@ function node_views_data() {
return
$data
;
}
/**
* Implements hook_views_plugins().
*/
function
node_views_plugins
()
{
return
array
(
'module'
=>
'views'
,
// This just tells our themes are elsewhere.
'row'
=>
array
(
'node'
=>
array
(
'title'
=>
t
(
'Content'
),
'help'
=>
t
(
'Display the content with standard node view.'
),
'class'
=>
'views_plugin_row_node_view'
,
'path'
=>
drupal_get_path
(
'module'
,
'views'
)
.
'/modules/node'
,
// not necessary for most modules
'base'
=>
array
(
'node'
),
// only works with 'node' as base.
'uses options'
=>
TRUE
,
'type'
=>
'normal'
,
'help topic'
=>
'style-node'
,
),
'node_rss'
=>
array
(
'title'
=>
t
(
'Content'
),
'help'
=>
t
(
'Display the content with standard node view.'
),
'class'
=>
'views_plugin_row_node_rss'
,
'path'
=>
drupal_get_path
(
'module'
,
'views'
)
.
'/modules/node'
,
// not necessary for most modules
'theme'
=>
'views_view_row_rss'
,
'base'
=>
array
(
'node'
),
// only works with 'node' as base.
'uses options'
=>
TRUE
,
'type'
=>
'feed'
,
'help topic'
=>
'style-node-rss'
,
),
),
'argument validator'
=>
array
(
'node'
=>
array
(
'title'
=>
t
(
'Content'
),
'handler'
=>
'views_plugin_argument_validate_node'
,
),
),
'argument default'
=>
array
(
'node'
=>
array
(
'title'
=>
t
(
'Content ID from URL'
),
'handler'
=>
'views_plugin_argument_default_node'
),
),
);
}
/**
* Implements hook_preprocess_node().
*/
...
...
modules/search.views.inc
View file @
81f57691
...
...
@@ -128,72 +128,3 @@ function search_views_data() {
return
$data
;
}
/**
* Implements hook_views_plugins().
*/
function
search_views_plugins
()
{
return
;
// @todo: DISABLED. This currently doesn't work.
return
array
(
'module'
=>
'views'
,
// This just tells our themes are elsewhere.
'row'
=>
array
(
'search'
=>
array
(
'title'
=>
t
(
'Search'
),
'help'
=>
t
(
'Display the results with standard search view.'
),
'handler'
=>
'views_plugin_row_search_view'
,
'theme'
=>
'views_view_row_search'
,
'path'
=>
drupal_get_path
(
'module'
,
'views'
)
.
'/modules/search'
,
// not necessary for most modules
'base'
=>
array
(
'node'
),
// only works with 'node' as base.
'type'
=>
'normal'
,
),
),
);
}
/**
* Template helper for theme_views_view_row_search
*/
function
template_preprocess_views_view_row_search
(
&
$vars
)
{
$vars
[
'node'
]
=
''
;
// make sure var is defined.
$nid
=
$vars
[
'row'
]
->
nid
;
if
(
!
is_numeric
(
$nid
))
{
return
;
}
// @todo: Once the search row is fixed this node_load should be replace by a node_load_multiple
$node
=
node_load
(
$nid
);
if
(
empty
(
$node
))
{
return
;
}
// Build the node body.
$node
=
node_build_content
(
$node
,
FALSE
,
FALSE
);
$node
->
body
=
drupal_render
(
$node
->
content
);
// Fetch comments for snippet
$node
->
body
.
=
module_invoke
(
'comment'
,
'nodeapi'
,
$node
,
'update index'
);
// Fetch terms for snippet
$node
->
body
.
=
module_invoke
(
'taxonomy'
,
'nodeapi'
,
$node
,
'update index'
);
$vars
[
'url'
]
=
url
(
'node/'
.
$nid
);
$vars
[
'title'
]
=
check_plain
(
$node
->
label
());
$info
=
array
();
$info
[
'type'
]
=
node_type_get_name
(
$node
);
$info
[
'user'
]
=
theme
(
'username'
,
array
(
'acccount'
=>
$node
));
$info
[
'date'
]
=
format_date
(
$node
->
changed
,
'small'
);
$extra
=
module_invoke_all
(
'node_search_result'
,
$node
);
if
(
isset
(
$extra
)
&&
is_array
(
$extra
))
{
$info
=
array_merge
(
$info
,
$extra
);
}
$vars
[
'info_split'
]
=
$info
;
$vars
[
'info'
]
=
implode
(
' - '
,
$info
);
$vars
[
'node'
]
=
$node
;
// @todo: get score from ???
//$vars['score'] = $item->score;
$vars
[
'snippet'
]
=
search_excerpt
(
$vars
[
'view'
]
->
value
,
$node
->
body
);
}
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment