Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
12b09da4
Commit
12b09da4
authored
Apr 05, 2013
by
alexpott
Browse files
Issue
#1895266
by damiankloip, dawehner: Convert views to use the ModuleHandler.
parent
8f3468aa
Changes
22
Hide whitespace changes
Inline
Side-by-side
core/modules/field/field.views.inc
View file @
12b09da4
...
...
@@ -28,7 +28,7 @@ function field_views_data() {
if
(
empty
(
$result
))
{
$result
=
field_views_field_default_views_data
(
$field
);
}
d
rupal
_
alter
(
'field_views_data'
,
$result
,
$field
,
$module
);
D
rupal
::
moduleHandler
()
->
alter
(
'field_views_data'
,
$result
,
$field
,
$module
);
if
(
is_array
(
$result
))
{
$data
=
NestedArray
::
mergeDeep
(
$result
,
$data
);
...
...
core/modules/views/lib/Drupal/views/Plugin/views/HandlerBase.php
View file @
12b09da4
...
...
@@ -295,7 +295,8 @@ public function buildOptionsForm(&$form, &$form_state) {
'#weight'
=>
150
,
);
// Allow to alter the default values brought into the form.
drupal_alter
(
'views_handler_options'
,
$this
->
options
,
$view
);
// @todo Do we really want to keep this hook.
\
Drupal
::
moduleHandler
()
->
alter
(
'views_handler_options'
,
$this
->
options
,
$this
->
view
);
}
/**
...
...
core/modules/views/lib/Drupal/views/Plugin/views/display/DisplayPluginBase.php
View file @
12b09da4
...
...
@@ -1202,7 +1202,7 @@ public function optionsSummary(&$categories, &$options) {
'***DEFAULT_LANGUAGE***'
=>
t
(
"Default site language"
),
LANGUAGE_NOT_SPECIFIED
=>
t
(
'Language neutral'
),
);
if
(
module_e
xists
(
'language'
))
{
if
(
\
Drupal
::
moduleHandler
()
->
moduleE
xists
(
'language'
))
{
$languages
=
array_merge
(
$languages
,
language_list
());
}
$options
[
'field_langcode'
]
=
array
(
...
...
core/modules/views/lib/Drupal/views/Plugin/views/display/Page.php
View file @
12b09da4
...
...
@@ -205,7 +205,7 @@ public function buildOptionsForm(&$form, &$form_state) {
);
// Only display the menu selector if menu module is enabled.
if
(
module_e
xists
(
'menu'
))
{
if
(
\
Drupal
::
moduleHandler
()
->
moduleE
xists
(
'menu'
))
{
$form
[
'menu'
][
'name'
]
=
array
(
'#title'
=>
t
(
'Menu'
),
'#type'
=>
'select'
,
...
...
@@ -322,7 +322,7 @@ public function buildOptionsForm(&$form, &$form_state) {
),
);
// Only display the menu selector if menu module is enabled.
if
(
module_e
xists
(
'menu'
))
{
if
(
\
Drupal
::
moduleHandler
()
->
moduleE
xists
(
'menu'
))
{
$form
[
'tab_options'
][
'name'
]
=
array
(
'#title'
=>
t
(
'Menu'
),
'#type'
=>
'select'
,
...
...
core/modules/views/lib/Drupal/views/Plugin/views/query/Sql.php
View file @
12b09da4
...
...
@@ -1379,7 +1379,7 @@ public function query($get_count = FALSE) {
}
// Add all query substitutions as metadata.
$query
->
addMetaData
(
'views_substitutions'
,
module_
invoke
_a
ll
(
'views_query_substitutions'
,
$this
));
$query
->
addMetaData
(
'views_substitutions'
,
\
Drupal
::
moduleHandler
()
->
invoke
A
ll
(
'views_query_substitutions'
,
array
(
$this
->
view
)
));
return
$query
;
}
...
...
@@ -1402,10 +1402,7 @@ function get_where_args() {
* Let modules modify the query just prior to finalizing it.
*/
function
alter
(
ViewExecutable
$view
)
{
foreach
(
module_implements
(
'views_query_alter'
)
as
$module
)
{
$function
=
$module
.
'_views_query_alter'
;
$function
(
$view
,
$this
);
}
\
Drupal
::
moduleHandler
()
->
invokeAll
(
'views_query_alter'
,
array
(
$view
,
$this
));
}
/**
...
...
@@ -1455,7 +1452,7 @@ function execute(ViewExecutable $view) {
$items
=
array
();
if
(
$query
)
{
$additional_arguments
=
module_
invoke
_a
ll
(
'views_query_substitutions'
,
$view
);
$additional_arguments
=
\
Drupal
::
moduleHandler
()
->
invoke
A
ll
(
'views_query_substitutions'
,
array
(
$view
)
)
;
// Count queries must be run through the preExecute() method.
// If not, then hook_query_node_access_alter() may munge the count by
...
...
core/modules/views/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php
View file @
12b09da4
...
...
@@ -290,7 +290,7 @@ function build_form(array $form, array &$form_state) {
'#prefix'
=>
'<div id="edit-page-link-properties-wrapper">'
,
'#suffix'
=>
'</div>'
,
);
if
(
module_e
xists
(
'menu'
))
{
if
(
\
Drupal
::
moduleHandler
()
->
moduleE
xists
(
'menu'
))
{
$menu_options
=
menu_get_menus
();
}
else
{
...
...
@@ -348,7 +348,7 @@ function build_form(array $form, array &$form_state) {
);
}
if
(
!
module_e
xists
(
'block'
))
{
if
(
!
\
Drupal
::
moduleHandler
()
->
moduleE
xists
(
'block'
))
{
return
$form
;
}
...
...
@@ -555,9 +555,7 @@ protected function row_style_options() {
* available).
*/
protected
function
build_filters
(
&
$form
,
&
$form_state
)
{
// Find all the fields we are allowed to filter by.
module_load_include
(
'inc'
,
'views_ui'
,
'admin'
);
$fields
=
views_fetch_fields
(
$this
->
base_table
,
'filter'
);
$bundles
=
entity_get_bundles
(
$this
->
entity_type
);
// If the current base table support bundles and has more than one (like user).
...
...
core/modules/views/lib/Drupal/views/Tests/UI/TagTest.php
View file @
12b09da4
...
...
@@ -34,7 +34,7 @@ public static function getInfo() {
* Tests the views_ui_autocomplete_tag function.
*/
public
function
testViewsUiAutocompleteTag
()
{
module_
load
_i
nclude
(
'inc'
,
'views_ui'
,
'admin'
);
\
Drupal
::
moduleHandler
()
->
load
I
nclude
(
'views_ui'
,
'inc'
,
'admin'
);
// Save 15 views with a tag.
$tags
=
array
();
...
...
core/modules/views/lib/Drupal/views/Tests/ViewTestData.php
View file @
12b09da4
...
...
@@ -45,9 +45,11 @@ public static function importTestViews($class, $modules = array()) {
'create'
=>
array
(),
'change'
=>
array
(),
);
$module_handler
=
\
Drupal
::
moduleHandler
();
foreach
(
$modules
as
$module
)
{
$config_dir
=
drupal_get_path
(
'module'
,
$module
)
.
'/test_views'
;
if
(
!
is_dir
(
$config_dir
)
||
!
module_
e
xists
(
$module
))
{
if
(
!
is_dir
(
$config_dir
)
||
!
$
module_
handler
->
moduleE
xists
(
$module
))
{
continue
;
}
...
...
core/modules/views/lib/Drupal/views/Tests/ViewsDataTest.php
View file @
12b09da4
...
...
@@ -170,7 +170,8 @@ protected function viewsData() {
* Tests the views_fetch_fields function().
*/
public
function
testViewsFetchFields
()
{
module_load_include
(
'inc'
,
'views_ui'
,
'admin'
);
$this
->
enableModules
(
array
(
'views_ui'
));
$this
->
container
->
get
(
'module_handler'
)
->
loadInclude
(
'views_ui'
,
'inc'
,
'admin'
);
$expected
=
array
(
'field'
=>
array
(
...
...
core/modules/views/lib/Drupal/views/Tests/Wizard/WizardPluginBaseUnitTest.php
View file @
12b09da4
...
...
@@ -46,6 +46,8 @@ protected function setUp() {
$this
->
installSchema
(
'language'
,
'language'
);
$this
->
installSchema
(
'system'
,
'variable'
);
$this
->
enableModules
(
array
(
'views_ui'
));
$this
->
wizard
=
$this
->
container
->
get
(
'plugin.manager.views.wizard'
)
->
createInstance
(
'standard:views_test_data'
,
array
());
}
...
...
core/modules/views/lib/Drupal/views/ViewExecutable.php
View file @
12b09da4
...
...
@@ -987,10 +987,8 @@ public function build($display_id = NULL) {
}
// Let modules modify the view just prior to building it.
foreach
(
module_implements
(
'views_pre_build'
)
as
$module
)
{
$function
=
$module
.
'_views_pre_build'
;
$function
(
$this
);
}
$module_handler
=
\
Drupal
::
moduleHandler
();
$module_handler
->
invokeAll
(
'views_pre_build'
,
array
(
$this
));
// Attempt to load from cache.
// @todo Load a build_info from cache.
...
...
@@ -1111,10 +1109,7 @@ public function build($display_id = NULL) {
$this
->
attachDisplays
();
// Let modules modify the view just after building it.
foreach
(
module_implements
(
'views_post_build'
)
as
$module
)
{
$function
=
$module
.
'_views_post_build'
;
$function
(
$this
);
}
$module_handler
->
invokeAll
(
'views_post_build'
,
array
(
$this
));
return
TRUE
;
}
...
...
@@ -1189,10 +1184,8 @@ public function execute($display_id = NULL) {
}
// Let modules modify the view just prior to executing it.
foreach
(
module_implements
(
'views_pre_execute'
)
as
$module
)
{
$function
=
$module
.
'_views_pre_execute'
;
$function
(
$this
);
}
$module_handler
=
\
Drupal
::
moduleHandler
();
$module_handler
->
invokeAll
(
'views_pre_execute'
,
array
(
$this
));
// Check for already-cached results.
if
(
!
empty
(
$this
->
live_preview
))
{
...
...
@@ -1217,10 +1210,7 @@ public function execute($display_id = NULL) {
}
// Let modules modify the view just after executing it.
foreach
(
module_implements
(
'views_post_execute'
)
as
$module
)
{
$function
=
$module
.
'_views_post_execute'
;
$function
(
$this
);
}
$module_handler
->
invokeAll
(
'views_post_execute'
,
array
(
$this
));
$this
->
executed
=
TRUE
;
}
...
...
@@ -1254,6 +1244,8 @@ public function render($display_id = NULL) {
$exposed_form
=
$this
->
display_handler
->
getPlugin
(
'exposed_form'
);
$exposed_form
->
pre_render
(
$this
->
result
);
$module_handler
=
\
Drupal
::
moduleHandler
();
// Check for already-cached output.
if
(
!
empty
(
$this
->
live_preview
))
{
$cache
=
FALSE
;
...
...
@@ -1261,6 +1253,7 @@ public function render($display_id = NULL) {
else
{
$cache
=
$this
->
display_handler
->
getPlugin
(
'cache'
);
}
if
(
$cache
&&
$cache
->
cache_get
(
'output'
))
{
}
else
{
...
...
@@ -1301,23 +1294,15 @@ public function render($display_id = NULL) {
}
// Let modules modify the view just prior to rendering it.
foreach
(
module_implements
(
'views_pre_render'
)
as
$module
)
{
$function
=
$module
.
'_views_pre_render'
;
$function
(
$this
);
}
$module_handler
->
invokeAll
(
'views_pre_render'
,
array
(
$this
));
// Let the themes play too, because pre render is a very themey thing.
foreach
(
$GLOBALS
[
'base_theme_info'
]
as
$base
)
{
$function
=
$base
->
name
.
'_views_pre_render'
;
if
(
function_exists
(
$function
))
{
$function
(
$this
);
}
}
$function
=
$GLOBALS
[
'theme'
]
.
'_views_pre_render'
;
if
(
function_exists
(
$function
))
{
$function
(
$this
);
$module_handler
->
invoke
(
$base
,
'views_pre_render'
,
array
(
$this
));
}
$module_handler
->
invoke
(
$GLOBALS
[
'theme'
],
'views_pre_render'
,
array
(
$this
));
$this
->
display_handler
->
output
=
$this
->
display_handler
->
render
();
if
(
$cache
)
{
$cache
->
cache_set
(
'output'
);
...
...
@@ -1331,23 +1316,15 @@ public function render($display_id = NULL) {
}
// Let modules modify the view output after it is rendered.
foreach
(
module_implements
(
'views_post_render'
)
as
$module
)
{
$function
=
$module
.
'_views_post_render'
;
$function
(
$this
,
$this
->
display_handler
->
output
,
$cache
);
}
$module_handler
->
invokeAll
(
'views_post_render'
,
array
(
$this
,
$this
->
display_handler
->
output
,
$cache
));
// Let the themes play too, because post render is a very themey thing.
foreach
(
$GLOBALS
[
'base_theme_info'
]
as
$base
)
{
$function
=
$base
->
name
.
'_views_post_render'
;
if
(
function_exists
(
$function
))
{
$function
(
$this
);
}
}
$function
=
$GLOBALS
[
'theme'
]
.
'_views_post_render'
;
if
(
function_exists
(
$function
))
{
$function
(
$this
,
$this
->
display_handler
->
output
,
$cache
);
$module_handler
->
invoke
(
$base
,
'views_post_render'
,
array
(
$this
));
}
$module_handler
->
invoke
(
$GLOBALS
[
'theme'
],
'views_post_render'
,
array
(
$this
));
return
$this
->
display_handler
->
output
;
}
...
...
@@ -1423,10 +1400,7 @@ public function preExecute($args = array()) {
}
// Let modules modify the view just prior to executing it.
foreach
(
module_implements
(
'views_pre_view'
)
as
$module
)
{
$function
=
$module
.
'_views_pre_view'
;
$function
(
$this
,
$display_id
,
$this
->
args
);
}
\
Drupal
::
moduleHandler
()
->
invokeAll
(
'views_pre_view'
,
array
(
$this
,
$display_id
,
$this
->
args
));
// Allow hook_views_pre_view() to set the dom_id, then ensure it is set.
$this
->
dom_id
=
!
empty
(
$this
->
dom_id
)
?
$this
->
dom_id
:
hash
(
'sha256'
,
$this
->
storage
->
id
()
.
REQUEST_TIME
.
mt_rand
());
...
...
core/modules/views/lib/Drupal/views/ViewStorageController.php
View file @
12b09da4
...
...
@@ -23,7 +23,7 @@ public function load(array $ids = NULL) {
// Only return views for enabled modules.
return
array_filter
(
$entities
,
function
(
$entity
)
{
if
(
module_e
xists
(
$entity
->
get
(
'module'
)))
{
if
(
\
Drupal
::
moduleHandler
()
->
moduleE
xists
(
$entity
->
get
(
'module'
)))
{
return
TRUE
;
}
return
FALSE
;
...
...
core/modules/views/lib/Drupal/views/ViewsBundle.php
View file @
12b09da4
...
...
@@ -31,6 +31,7 @@ public function build(ContainerBuilder $container) {
$container
->
register
(
'views.views_data'
,
'Drupal\views\ViewsDataCache'
)
->
addArgument
(
new
Reference
(
'cache.views_info'
))
->
addArgument
(
new
Reference
(
'config.factory'
))
->
addArgument
(
new
Reference
(
'module_handler'
))
->
addTag
(
'needs_destruction'
);
$container
->
register
(
'views.executable'
,
'Drupal\views\ViewExecutableFactory'
);
...
...
core/modules/views/lib/Drupal/views/ViewsDataCache.php
View file @
12b09da4
...
...
@@ -9,6 +9,7 @@
use
Drupal\Core\Cache\CacheBackendInterface
;
use
Drupal\Core\Config\ConfigFactory
;
use
Drupal\Core\Extension\ModuleHandlerInterface
;
use
Drupal\Core\DestructableInterface
;
/**
...
...
@@ -73,8 +74,26 @@ class ViewsDataCache implements DestructableInterface {
*/
protected
$langcode
;
public
function
__construct
(
CacheBackendInterface
$cache_backend
,
ConfigFactory
$config
)
{
/**
* Stores a module manager to invoke hooks.
*
* @var \Drupal\Core\Extension\ModuleHandlerInterface
*/
protected
$moduleHandler
;
/**
* Constructs this ViewsDataCache object.
*
* @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
* The cache backend to use.
* @param \Drupal\Core\Config\ConfigFactory $config
* The configuration factory object to use.
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The module handler class to use for invoking hooks.
*/
public
function
__construct
(
CacheBackendInterface
$cache_backend
,
ConfigFactory
$config
,
ModuleHandlerInterface
$module_handler
)
{
$this
->
cacheBackend
=
$cache_backend
;
$this
->
moduleHandler
=
$module_handler
;
$this
->
langcode
=
language
(
LANGUAGE_TYPE_INTERFACE
)
->
langcode
;
$this
->
skipCache
=
$config
->
get
(
'views.settings'
)
->
get
(
'skip_cache'
);
...
...
@@ -176,8 +195,8 @@ protected function getData() {
return
$data
->
data
;
}
else
{
$data
=
module_
invoke
_a
ll
(
'views_data'
);
drupal_
alter
(
'views_data'
,
$data
);
$data
=
$this
->
moduleHandler
->
invoke
A
ll
(
'views_data'
);
$this
->
moduleHandler
->
alter
(
'views_data'
,
$data
);
$this
->
processEntityTypes
(
$data
);
...
...
core/modules/views/views.module
View file @
12b09da4
...
...
@@ -79,7 +79,7 @@ function views_pre_render_view_element($element) {
* Implement hook_theme(). Register views theming functions.
*/
function
views_theme
(
$existing
,
$type
,
$theme
,
$path
)
{
module_
load
_i
nclude
(
'
inc'
,
'views
'
,
'views.theme'
);
Drupal
::
moduleHandler
()
->
load
I
nclude
(
'
views'
,
'inc
'
,
'views.theme'
);
// Some quasi clever array merging here.
$base
=
array
(
...
...
@@ -687,13 +687,15 @@ function views_invalidate_cache() {
// Set the menu as needed to be rebuilt.
state
()
->
set
(
'menu_rebuild_needed'
,
TRUE
);
$module_handler
=
Drupal
::
moduleHandler
();
// Invalidate the block cache to update views block derivatives.
if
(
module_
e
xists
(
'block'
))
{
d
rupal
_container
()
->
get
(
'plugin.manager.block'
)
->
clearCachedDefinitions
();
if
(
$
module_
handler
->
moduleE
xists
(
'block'
))
{
D
rupal
::
service
(
'plugin.manager.block'
)
->
clearCachedDefinitions
();
}
// Allow modules to respond to the Views cache being cleared.
module_invoke
_a
ll
(
'views_invalidate_cache'
);
$
module_
handler
->
invoke
A
ll
(
'views_invalidate_cache'
);
}
/**
...
...
@@ -955,7 +957,7 @@ function views_fetch_plugin_names($type, $key = NULL, $base = array()) {
}
// @todo While Views is providing on behalf of core modules, check to see
// if they are enabled or not.
if
(
isset
(
$plugin
[
'module'
])
&&
!
module_e
xists
(
$plugin
[
'module'
]))
{
if
(
isset
(
$plugin
[
'module'
])
&&
!
\
Drupal
::
moduleHandler
()
->
moduleE
xists
(
$plugin
[
'module'
]))
{
continue
;
}
...
...
@@ -980,10 +982,9 @@ function views_fetch_plugin_names($type, $key = NULL, $base = array()) {
* An array of plugin definitions for all types.
*/
function
views_get_plugin_definitions
()
{
$container
=
drupal_container
();
$plugins
=
array
();
foreach
(
ViewExecutable
::
getPluginTypes
()
as
$plugin_type
)
{
$plugins
[
$plugin_type
]
=
$container
->
get
(
"
plugin
.m
anager
.views.
$plugin_type
"
)
->
getDefinitions
();
$plugins
[
$plugin_type
]
=
Views
::
plugin
M
anager
(
$plugin_type
)
->
getDefinitions
();
}
return
$plugins
;
...
...
@@ -1015,10 +1016,8 @@ function views_get_enabled_display_extenders() {
* @endcode
*/
function
views_get_applicable_views
(
$type
)
{
$container
=
drupal_container
();
// Get all display plugins which provides the type.
$display_plugins
=
$container
->
get
(
'
plugin
.m
anager
.views.
display'
)
->
getDefinitions
();
$display_plugins
=
Views
::
plugin
M
anager
(
'
display'
)
->
getDefinitions
();
$ids
=
array
();
foreach
(
$display_plugins
as
$id
=>
$definition
)
{
if
(
!
empty
(
$definition
[
$type
]))
{
...
...
@@ -1026,13 +1025,13 @@ function views_get_applicable_views($type) {
}
}
$entity_ids
=
$container
->
get
(
'entity.query'
)
->
get
(
'view'
)
$entity_ids
=
Drupal
::
service
(
'entity.query'
)
->
get
(
'view'
)
->
condition
(
'status'
,
TRUE
)
->
condition
(
"display.*.display_plugin"
,
$ids
,
'IN'
)
->
execute
();
$result
=
array
();
foreach
(
$container
->
get
(
'plugin.manager.entity'
)
->
getStorageController
(
'view'
)
->
load
(
$entity_ids
)
as
$view
)
{
foreach
(
Drupal
::
service
(
'plugin.manager.entity'
)
->
getStorageController
(
'view'
)
->
load
(
$entity_ids
)
as
$view
)
{
// Check each display to see if it meets the criteria and is enabled.
$executable
=
$view
->
get
(
'executable'
);
$executable
->
initDisplay
();
...
...
@@ -1560,7 +1559,7 @@ function views_exposed_form_cache($views_name, $display_name, $form_output = NUL
* Build a list of theme function names for use most everywhere.
*/
function
views_theme_functions
(
$hook
,
ViewExecutable
$view
,
$display
=
NULL
)
{
module_
load
_i
nclude
(
'
inc'
,
'views
'
,
'views.theme'
);
Drupal
::
moduleHandler
()
->
load
I
nclude
(
'
views'
,
'inc
'
,
'views.theme'
);
return
_views_theme_functions
(
$hook
,
$view
,
$display
);
}
...
...
core/modules/views/views.theme.inc
View file @
12b09da4
...
...
@@ -1023,7 +1023,7 @@ function theme_views_form_views_form($variables) {
$replace
[]
=
isset
(
$form
[
$field_name
][
$row_id
])
?
drupal_render
(
$form
[
$field_name
][
$row_id
])
:
''
;
}
// Add in substitutions from hook_views_form_substitutions().
$substitutions
=
module_
invoke
_a
ll
(
'views_form_substitutions'
);
$substitutions
=
Drupal
::
moduleHandler
()
->
invoke
A
ll
(
'views_form_substitutions'
);
foreach
(
$substitutions
as
$placeholder
=>
$substitution
)
{
$search
[]
=
$placeholder
;
$replace
[]
=
$substitution
;
...
...
core/modules/views/views_ui/lib/Drupal/views_ui/Form/Ajax/ViewsFormBase.php
View file @
12b09da4
...
...
@@ -87,8 +87,8 @@ public function getForm(ViewStorageInterface $view, $display_id, $js) {
$key
=
$form_state
[
'form_key'
];
// @todo Remove the need for this.
module_
load
_i
nclude
(
'inc'
,
'views_ui'
,
'admin'
);
module_
load
_i
nclude
(
'
inc'
,
'views
'
,
'includes/ajax'
);
\
Drupal
::
moduleHandler
()
->
load
I
nclude
(
'views_ui'
,
'inc'
,
'admin'
);
\
Drupal
::
moduleHandler
()
->
load
I
nclude
(
'
views'
,
'inc
'
,
'includes/ajax'
);
// Reset the cache of IDs. Drupal rather aggressively prevents ID
// duplication but this causes it to remember IDs that are no longer even
...
...
core/modules/views/views_ui/lib/Drupal/views_ui/ViewAddFormController.php
View file @
12b09da4
...
...
@@ -100,7 +100,7 @@ public function form(array $form, array &$form_state, EntityInterface $view) {
'#options'
=>
$options
,
);
$show_form
=
&
$form
[
'displays'
][
'show'
];
$default_value
=
module_e
xists
(
'node'
)
?
'node'
:
'users'
;
$default_value
=
\
Drupal
::
moduleHandler
()
->
moduleE
xists
(
'node'
)
?
'node'
:
'users'
;
$show_form
[
'wizard_key'
][
'#default_value'
]
=
WizardPluginBase
::
getSelected
(
$form_state
,
array
(
'show'
,
'wizard_key'
),
$default_value
,
$show_form
[
'wizard_key'
]);
// Changing this dropdown updates the entire content of $form['displays'] via
// AJAX.
...
...
core/modules/views/views_ui/lib/Drupal/views_ui/ViewEditFormController.php
View file @
12b09da4
...
...
@@ -326,7 +326,7 @@ public function getDisplayTab($view) {
}
// In AJAX context, ViewUI::rebuildCurrentTab() returns this outside of form
// context, so hook_form_views_ui_edit_form_alter() is insufficient.
d
rupal
_
alter
(
'views_ui_display_tab'
,
$build
,
$view
,
$display_id
);
\
D
rupal
::
moduleHandler
()
->
alter
(
'views_ui_display_tab'
,
$build
,
$view
,
$display_id
);
return
$build
;
}
...
...
@@ -667,7 +667,7 @@ public function renderDisplayTop(ViewUI $view) {
);
// Let other modules add additional links here.
d
rupal
_
alter
(
'views_ui_display_top_links'
,
$element
[
'extra_actions'
][
'#links'
],
$view
,
$display_id
);
\
D
rupal
::
moduleHandler
()
->
alter
(
'views_ui_display_top_links'
,
$element
[
'extra_actions'
][
'#links'
],
$view
,
$display_id
);
if
(
isset
(
$view
->
type
)
&&
$view
->
type
!=
t
(
'Default'
))
{
if
(
$view
->
type
==
t
(
'Overridden'
))
{
...
...
@@ -724,7 +724,7 @@ public function renderDisplayTop(ViewUI $view) {
* should not yet redirect to the destination.
*/
public
function
submitDelayDestination
(
$form
,
&
$form_state
)
{
$query
=
d
rupal
_container
()
->
get
(
'request'
)
->
query
;
$query
=
\
D
rupal
::
service
(
'request'
)
->
query
;
// @todo: Revisit this when http://drupal.org/node/1668866 is in.
$destination
=
$query
->
get
(
'destination'
);
if
(
isset
(
$destination
)
&&
$form_state
[
'redirect'
]
!==
FALSE
)
{
...
...
core/modules/views/views_ui/lib/Drupal/views_ui/ViewFormControllerBase.php
View file @
12b09da4
...
...
@@ -82,7 +82,7 @@ public static function getAdminCSS() {
$list
[
$module_path
.
'/css/views-admin.css'
]
=
array
();
$list
[
$module_path
.
'/css/views-admin.theme.css'
]
=
array
();
if
(
module_e
xists
(
'contextual'
))
{
if
(
\
Drupal
::
moduleHandler
()
->
moduleE
xists
(
'contextual'
))
{
$list
[
$module_path
.
'/css/views-admin.contextual.css'
]
=
array
();
}
...
...
Prev
1
2
Next
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