Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
V
views
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
3
Merge Requests
3
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
views
Commits
d7ac0942
Commit
d7ac0942
authored
Apr 22, 2008
by
merlinofchaos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make options on plugins more consistent with options() on handlers.
parent
2844f9b5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
52 deletions
+44
-52
includes/admin.inc
includes/admin.inc
+3
-1
includes/plugins.inc
includes/plugins.inc
+34
-38
modules/node.views.inc
modules/node.views.inc
+5
-9
modules/search.views.inc
modules/search.views.inc
+2
-4
No files found.
includes/admin.inc
View file @
d7ac0942
...
...
@@ -2468,7 +2468,9 @@ function views_ui_change_style_form_submit($form, &$form_state) {
if
(
empty
(
$item
[
'style_plugin'
])
||
$item
[
'style_plugin'
]
!=
$form_state
[
'values'
][
'style_plugin'
])
{
$plugin
=
views_get_plugin
(
'style'
,
$form_state
[
'values'
][
'style_plugin'
]);
$item
[
'style_options'
]
=
$plugin
->
options
(
$form_state
[
'view'
]
->
display
[
$form_state
[
'display_id'
]]);
$plugin
->
init
(
$form_state
[
'view'
],
$form_state
[
'view'
]
->
display
[
$form_state
[
'display_id'
]]);
$item
[
'style_options'
]
=
array
();
$plugin
->
options
(
$item
[
'style_options'
]);
}
// Store the data we're given.
...
...
includes/plugins.inc
View file @
d7ac0942
...
...
@@ -1237,8 +1237,13 @@ class views_plugin_display extends views_plugin {
if
(
$this
->
get_option
(
$section
)
!=
$form_state
[
'values'
][
$section
])
{
$this
->
set_option
(
$section
,
$form_state
[
'values'
][
$section
]);
$plugin
=
views_get_plugin
(
'row'
,
$form_state
[
'values'
][
$section
]);
// @todo -- change this
$this
->
set_option
(
'row_options'
,
$plugin
->
options
(
$this
->
display
));
if
(
$plugin
)
{
$row_options
=
array
();
$plugin
->
init
(
$this
->
view
,
$this
->
display
);
$plugin
->
options
(
$row_options
);
// @todo -- change this
$this
->
set_option
(
'row_options'
,
$row_options
);
}
}
break
;
case
'style_plugin'
:
...
...
@@ -1247,8 +1252,13 @@ class views_plugin_display extends views_plugin {
if
(
$this
->
get_option
(
$section
)
!=
$form_state
[
'values'
][
$section
])
{
$this
->
set_option
(
$section
,
$form_state
[
'values'
][
$section
]);
$plugin
=
views_get_plugin
(
'style'
,
$form_state
[
'values'
][
$section
]);
// @todo -- change this
$this
->
set_option
(
'style_options'
,
$plugin
->
options
(
$this
->
display
));
if
(
$plugin
)
{
$style_options
=
array
();
$plugin
->
init
(
$this
->
view
,
$this
->
display
);
$plugin
->
options
(
$style_options
);
// @todo -- change this
$this
->
set_option
(
'style_options'
,
$style_options
);
}
}
break
;
case
'style_options'
:
...
...
@@ -2375,9 +2385,7 @@ class views_plugin_style extends views_plugin {
* @todo the options on all plugins should be unified and made to match
* how handler options work.
*/
function
options
(
&
$display
)
{
return
array
();
}
function
options
(
&
$options
)
{
}
/**
* Provide a form for setting options.
...
...
@@ -2438,10 +2446,8 @@ class views_plugin_style_list extends views_plugin_style {
/**
* Set default options
*/
function
options
(
$display
)
{
return
array
(
'type'
=>
'ul'
,
);
function
options
(
&
$options
)
{
$options
[
'type'
]
=
'ul'
;
}
/**
...
...
@@ -2464,11 +2470,9 @@ class views_plugin_style_grid extends views_plugin_style {
/**
* Set default options
*/
function
options
(
$display
)
{
return
array
(
'columns'
=>
4
,
'alignment'
=>
'horizontal'
,
);
function
options
(
&
$options
)
{
$options
[
'columns'
]
=
4
;
$options
[
'alignment'
]
=
'horizontal'
;
}
/**
...
...
@@ -2497,14 +2501,12 @@ class views_plugin_style_table extends views_plugin_style {
/**
* Set default options
*/
function
options
(
$display
)
{
return
array
(
'columns'
=>
array
(),
'default'
=>
''
,
'info'
=>
array
(),
'override'
=>
TRUE
,
'order'
=>
'asc'
,
);
function
options
(
&
$options
)
{
$options
[
'columns'
]
=
array
();
$options
[
'default'
]
=
''
;
$options
[
'info'
]
=
array
();
$options
[
'override'
]
=
TRUE
;
$options
[
'order'
]
=
'asc'
;
}
/**
...
...
@@ -2778,12 +2780,10 @@ function theme_views_ui_style_plugin_table($form) {
* The default style plugin for summaries.
*/
class
views_plugin_style_summary
extends
views_plugin_style
{
function
options
(
$display
=
NULL
)
{
return
array
(
'count'
=>
TRUE
,
'override'
=>
FALSE
,
'items_per_page'
=>
25
,
);
function
options
(
&
$options
)
{
$options
[
'count'
]
=
TRUE
;
$options
[
'override'
]
=
FALSE
;
$options
[
'items_per_page'
]
=
25
;
}
function
query
()
{
...
...
@@ -2842,11 +2842,9 @@ class views_plugin_style_rss extends views_plugin_style {
}
}
function
options
(
$display
=
NULL
)
{
return
array
(
'description'
=>
''
,
'mission_description'
=>
FALSE
,
);
function
options
(
&
$options
)
{
$options
[
'description'
]
=
''
;
$options
[
'mission_description'
]
=
FALSE
;
}
function
options_form
(
&
$form
,
&
$form_state
)
{
...
...
@@ -2920,9 +2918,7 @@ class views_plugin_row extends views_plugin {
/**
* Static member function to set default options.
*/
function
options
(
&
$display
)
{
return
array
();
}
function
options
(
&
$options
)
{
}
/**
* Provide a form for setting options.
...
...
modules/node.views.inc
View file @
d7ac0942
...
...
@@ -1171,11 +1171,9 @@ function node_views_plugins() {
* @ingroup views_plugin_rows
*/
class
views_plugin_row_node_view
extends
views_plugin_row
{
function
options
(
$display
)
{
return
array
(
'teaser'
=>
TRUE
,
'links'
=>
TRUE
,
);
function
options
(
&
$options
)
{
$options
[
'teaser'
]
=
TRUE
;
$options
[
'links'
]
=
TRUE
;
}
function
options_form
(
&
$form
,
&
$form_state
)
{
...
...
@@ -1229,10 +1227,8 @@ function views_preprocess_node($vars) {
* @ingroup views_plugin_rows
*/
class
views_plugin_row_node_rss
extends
views_plugin_row
{
function
options
(
$display
)
{
return
array
(
'item_length'
=>
'default'
,
);
function
options
(
&
$options
)
{
$options
[
'item_length'
]
=
'default'
;
}
function
options_form
(
&
$form
,
&
$form_state
)
{
...
...
modules/search.views.inc
View file @
d7ac0942
...
...
@@ -252,10 +252,8 @@ function search_views_plugins() {
* @ingroup views_row_plugins
*/
class
views_plugin_row_search_view
extends
views_plugin_row
{
function
options
(
$display
)
{
return
array
(
'score'
=>
TRUE
,
);
function
options
(
&
$options
)
{
$options
[
'score'
]
=
TRUE
;
}
function
options_form
(
&
$form
,
&
$form_state
)
{
...
...
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