Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
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
229
Merge Requests
229
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
drupal
Commits
353315fc
Commit
353315fc
authored
Dec 07, 2013
by
webchick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2151355
by damiankloip: Enable reset button on admin/content exposed filters.
parent
f7e75db7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
462 additions
and
330 deletions
+462
-330
core/modules/node/config/views.view.content.yml
core/modules/node/config/views.view.content.yml
+1
-1
core/modules/node/config/views.view.content_recent.yml
core/modules/node/config/views.view.content_recent.yml
+461
-0
core/modules/node/lib/Drupal/node/Plugin/Block/RecentContentBlock.php
.../node/lib/Drupal/node/Plugin/Block/RecentContentBlock.php
+0
-79
core/modules/node/lib/Drupal/node/Tests/NodeBlockFunctionalTest.php
...es/node/lib/Drupal/node/Tests/NodeBlockFunctionalTest.php
+0
-153
core/modules/node/node.module
core/modules/node/node.module
+0
-97
No files found.
core/modules/node/config/views.view.content.yml
View file @
353315fc
...
...
@@ -18,7 +18,7 @@ display:
type
:
basic
options
:
submit_button
:
Filter
reset_button
:
fals
e
reset_button
:
tru
e
reset_button_label
:
Reset
exposed_sorts_label
:
'
Sort
by'
expose_sort_order
:
true
...
...
core/modules/node/config/views.view.content_recent.yml
0 → 100644
View file @
353315fc
base_field
:
nid
base_table
:
node
core
:
8.x
description
:
'
Recent
content.'
status
:
'
0'
display
:
block_1
:
display_plugin
:
block
id
:
block_1
display_title
:
Block
position
:
'
1'
block_category
:
'
Lists
(Views)'
display_options
:
link_url
:
admin/content
default
:
display_plugin
:
default
id
:
default
display_title
:
Master
position
:
'
1'
display_options
:
access
:
type
:
perm
options
:
perm
:
'
access
content'
cache
:
type
:
none
options
:
{
}
query
:
type
:
views_query
options
:
disable_sql_rewrite
:
'
0'
distinct
:
'
0'
slave
:
'
0'
query_comment
:
'
'
query_tags
:
{
}
exposed_form
:
type
:
basic
options
:
submit_button
:
Apply
reset_button
:
'
0'
reset_button_label
:
Reset
exposed_sorts_label
:
'
Sort
by'
expose_sort_order
:
'
1'
sort_asc_label
:
Asc
sort_desc_label
:
Desc
pager
:
type
:
some
options
:
items_per_page
:
'
10'
offset
:
'
0'
style
:
type
:
table
options
:
grouping
:
{
}
row_class
:
'
'
default_row_class
:
'
1'
row_class_special
:
'
1'
override
:
'
1'
sticky
:
'
0'
caption
:
'
'
summary
:
'
'
description
:
'
'
columns
:
title
:
title
timestamp
:
title
name
:
title
edit_node
:
edit_node
delete_node
:
delete_node
info
:
title
:
sortable
:
'
0'
default_sort_order
:
asc
align
:
'
'
separator
:
'
'
empty_column
:
'
0'
responsive
:
'
'
timestamp
:
sortable
:
'
0'
default_sort_order
:
asc
align
:
'
'
separator
:
'
'
empty_column
:
'
0'
responsive
:
'
'
name
:
sortable
:
'
0'
default_sort_order
:
asc
align
:
'
'
separator
:
'
'
empty_column
:
'
0'
responsive
:
'
'
edit_node
:
sortable
:
'
0'
default_sort_order
:
asc
align
:
'
'
separator
:
'
'
empty_column
:
'
1'
responsive
:
'
'
delete_node
:
sortable
:
'
0'
default_sort_order
:
asc
align
:
'
'
separator
:
'
'
empty_column
:
'
1'
responsive
:
'
'
default
:
'
-1'
empty_table
:
'
0'
row
:
type
:
fields
fields
:
title
:
id
:
title
table
:
node_field_data
field
:
title
relationship
:
none
group_type
:
group
admin_label
:
'
'
label
:
'
'
exclude
:
'
0'
alter
:
alter_text
:
'
0'
text
:
'
'
make_link
:
'
0'
path
:
'
'
absolute
:
'
0'
external
:
'
0'
replace_spaces
:
'
0'
path_case
:
none
trim_whitespace
:
'
0'
alt
:
'
'
rel
:
'
'
link_class
:
'
'
prefix
:
'
'
suffix
:
'
'
target
:
'
'
nl2br
:
'
0'
max_length
:
'
'
word_boundary
:
'
0'
ellipsis
:
'
0'
more_link
:
'
0'
more_link_text
:
'
'
more_link_path
:
'
'
strip_tags
:
'
0'
trim
:
'
0'
preserve_tags
:
'
'
html
:
'
0'
element_type
:
'
'
element_class
:
'
'
element_label_type
:
'
'
element_label_class
:
'
'
element_label_colon
:
'
0'
element_wrapper_type
:
'
'
element_wrapper_class
:
'
'
element_default_classes
:
'
1'
empty
:
'
'
hide_empty
:
'
0'
empty_zero
:
'
0'
hide_alter_empty
:
'
1'
link_to_node
:
'
1'
provider
:
node
timestamp
:
id
:
timestamp
table
:
history
field
:
timestamp
relationship
:
none
group_type
:
group
admin_label
:
'
'
label
:
'
'
exclude
:
'
0'
alter
:
alter_text
:
'
0'
text
:
'
'
make_link
:
'
0'
path
:
'
'
absolute
:
'
0'
external
:
'
0'
replace_spaces
:
'
0'
path_case
:
none
trim_whitespace
:
'
0'
alt
:
'
'
rel
:
'
'
link_class
:
'
'
prefix
:
'
'
suffix
:
'
'
target
:
'
'
nl2br
:
'
0'
max_length
:
'
'
word_boundary
:
'
1'
ellipsis
:
'
1'
more_link
:
'
0'
more_link_text
:
'
'
more_link_path
:
'
'
strip_tags
:
'
0'
trim
:
'
0'
preserve_tags
:
'
'
html
:
'
0'
element_type
:
'
'
element_class
:
'
'
element_label_type
:
'
'
element_label_class
:
'
'
element_label_colon
:
'
0'
element_wrapper_type
:
'
'
element_wrapper_class
:
'
'
element_default_classes
:
'
1'
empty
:
'
'
hide_empty
:
'
0'
empty_zero
:
'
0'
hide_alter_empty
:
'
1'
link_to_node
:
'
0'
comments
:
'
0'
plugin_id
:
history_user_timestamp
provider
:
history
name
:
id
:
name
table
:
users
field
:
name
relationship
:
uid
group_type
:
group
admin_label
:
'
'
label
:
'
'
exclude
:
'
0'
alter
:
alter_text
:
'
0'
text
:
'
'
make_link
:
'
0'
path
:
'
'
absolute
:
'
0'
external
:
'
0'
replace_spaces
:
'
0'
path_case
:
none
trim_whitespace
:
'
0'
alt
:
'
'
rel
:
'
'
link_class
:
'
'
prefix
:
'
'
suffix
:
'
'
target
:
'
'
nl2br
:
'
0'
max_length
:
'
'
word_boundary
:
'
1'
ellipsis
:
'
1'
more_link
:
'
0'
more_link_text
:
'
'
more_link_path
:
'
'
strip_tags
:
'
0'
trim
:
'
0'
preserve_tags
:
'
'
html
:
'
0'
element_type
:
div
element_class
:
'
'
element_label_type
:
'
'
element_label_class
:
'
'
element_label_colon
:
'
0'
element_wrapper_type
:
'
'
element_wrapper_class
:
'
'
element_default_classes
:
'
1'
empty
:
'
'
hide_empty
:
'
0'
empty_zero
:
'
0'
hide_alter_empty
:
'
1'
link_to_user
:
'
1'
overwrite_anonymous
:
'
0'
anonymous_text
:
'
'
format_username
:
'
1'
plugin_id
:
user_name
provider
:
user
edit_node
:
id
:
edit_node
table
:
node
field
:
edit_node
relationship
:
none
group_type
:
group
admin_label
:
'
'
label
:
'
'
exclude
:
'
0'
alter
:
alter_text
:
'
0'
text
:
'
'
make_link
:
'
0'
path
:
'
'
absolute
:
'
0'
external
:
'
0'
replace_spaces
:
'
0'
path_case
:
none
trim_whitespace
:
'
0'
alt
:
'
'
rel
:
'
'
link_class
:
'
'
prefix
:
'
'
suffix
:
'
'
target
:
'
'
nl2br
:
'
0'
max_length
:
'
'
word_boundary
:
'
1'
ellipsis
:
'
1'
more_link
:
'
0'
more_link_text
:
'
'
more_link_path
:
'
'
strip_tags
:
'
0'
trim
:
'
0'
preserve_tags
:
'
'
html
:
'
0'
element_type
:
'
'
element_class
:
'
'
element_label_type
:
'
'
element_label_class
:
'
'
element_label_colon
:
'
0'
element_wrapper_type
:
'
'
element_wrapper_class
:
'
'
element_default_classes
:
'
1'
empty
:
'
'
hide_empty
:
'
0'
empty_zero
:
'
0'
hide_alter_empty
:
'
1'
text
:
edit
plugin_id
:
node_link_edit
provider
:
node
delete_node
:
id
:
delete_node
table
:
node
field
:
delete_node
relationship
:
none
group_type
:
group
admin_label
:
'
'
label
:
'
'
exclude
:
'
0'
alter
:
alter_text
:
'
0'
text
:
'
'
make_link
:
'
0'
path
:
'
'
absolute
:
'
0'
external
:
'
0'
replace_spaces
:
'
0'
path_case
:
none
trim_whitespace
:
'
0'
alt
:
'
'
rel
:
'
'
link_class
:
'
'
prefix
:
'
'
suffix
:
'
'
target
:
'
'
nl2br
:
'
0'
max_length
:
'
'
word_boundary
:
'
1'
ellipsis
:
'
1'
more_link
:
'
0'
more_link_text
:
'
'
more_link_path
:
'
'
strip_tags
:
'
0'
trim
:
'
0'
preserve_tags
:
'
'
html
:
'
0'
element_type
:
'
'
element_class
:
'
'
element_label_type
:
'
'
element_label_class
:
'
'
element_label_colon
:
'
0'
element_wrapper_type
:
'
'
element_wrapper_class
:
'
'
element_default_classes
:
'
1'
empty
:
'
'
hide_empty
:
'
0'
empty_zero
:
'
0'
hide_alter_empty
:
'
1'
text
:
delete
plugin_id
:
node_link_delete
provider
:
node
filters
:
status_extra
:
id
:
status_extra
table
:
node_field_data
field
:
status_extra
relationship
:
none
group_type
:
group
admin_label
:
'
'
operator
:
'
='
value
:
'
'
group
:
'
1'
exposed
:
'
0'
expose
:
operator_id
:
'
0'
label
:
'
'
description
:
'
'
use_operator
:
'
0'
operator
:
'
'
identifier
:
'
'
required
:
'
0'
remember
:
'
0'
multiple
:
'
0'
remember_roles
:
authenticated
:
authenticated
is_grouped
:
'
0'
group_info
:
label
:
'
'
description
:
'
'
identifier
:
'
'
optional
:
'
1'
widget
:
select
multiple
:
'
0'
remember
:
'
0'
default_group
:
All
default_group_multiple
:
{
}
group_items
:
{
}
plugin_id
:
node_status
provider
:
node
sorts
:
changed
:
id
:
changed
table
:
node_field_data
field
:
changed
relationship
:
none
group_type
:
group
admin_label
:
'
'
order
:
DESC
exposed
:
'
0'
expose
:
label
:
'
'
granularity
:
second
plugin_id
:
date
provider
:
views
title
:
'
Recent
content'
header
:
{
}
footer
:
{
}
empty
:
area_text_custom
:
id
:
area_text_custom
table
:
views
field
:
area_text_custom
relationship
:
none
group_type
:
group
admin_label
:
'
'
empty
:
'
1'
tokenize
:
'
0'
content
:
'
No
content
available.'
plugin_id
:
text_custom
provider
:
views
relationships
:
uid
:
id
:
uid
table
:
node_field_data
field
:
uid
relationship
:
none
group_type
:
group
admin_label
:
author
required
:
'
1'
plugin_id
:
standard
provider
:
views
arguments
:
{
}
filter_groups
:
operator
:
AND
groups
:
{
}
use_more
:
'
1'
use_more_always
:
'
0'
use_more_text
:
More
link_display
:
custom_url
label
:
'
Recent
content'
module
:
views
id
:
content_recent
tag
:
default
uuid
:
22208367-bde8-4977-ae04-4f1a34383ae3
langcode
:
en
core/modules/node/lib/Drupal/node/Plugin/Block/RecentContentBlock.php
deleted
100644 → 0
View file @
f7e75db7
<?php
/**
* @file
* Contains \Drupal\node\Plugin\Block\RecentContentBlock.
*/
namespace
Drupal\node\Plugin\Block
;
use
Drupal\block\BlockBase
;
use
Drupal\block\Annotation\Block
;
use
Drupal\Core\Annotation\Translation
;
use
Drupal\Core\Session\AccountInterface
;
/**
* Provides a 'Recent content' block.
*
* @Block(
* id = "node_recent_block",
* admin_label = @Translation("Recent content"),
* category = @Translation("Lists (Views)")
* )
*/
class
RecentContentBlock
extends
BlockBase
{
/**
* {@inheritdoc}
*/
public
function
defaultConfiguration
()
{
return
array
(
'block_count'
=>
10
,
);
}
/**
* {@inheritdoc}
*/
public
function
access
(
AccountInterface
$account
)
{
return
$account
->
hasPermission
(
'access content'
);
}
/**
* Overrides \Drupal\block\BlockBase::blockForm().
*/
public
function
blockForm
(
$form
,
&
$form_state
)
{
$form
[
'block_count'
]
=
array
(
'#type'
=>
'select'
,
'#title'
=>
t
(
'Number of recent content items to display'
),
'#default_value'
=>
$this
->
configuration
[
'block_count'
],
'#options'
=>
drupal_map_assoc
(
array
(
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
,
18
,
19
,
20
,
25
,
30
)),
);
return
$form
;
}
/**
* Overrides \Drupal\block\BlockBase::blockSubmit().
*/
public
function
blockSubmit
(
$form
,
&
$form_state
)
{
$this
->
configuration
[
'block_count'
]
=
$form_state
[
'values'
][
'block_count'
];
}
/**
* {@inheritdoc}
*/
public
function
build
()
{
if
(
$nodes
=
node_get_recent
(
$this
->
configuration
[
'block_count'
]))
{
return
array
(
'#theme'
=>
'node_recent_block'
,
'#nodes'
=>
$nodes
,
);
}
else
{
return
array
(
'#children'
=>
t
(
'No content available.'
),
);
}
}
}
core/modules/node/lib/Drupal/node/Tests/NodeBlockFunctionalTest.php
deleted
100644 → 0
View file @
f7e75db7
<?php
/**
* @file
* Definition of Drupal\node\Tests\NodeBlockFunctionalTest.
*/
namespace
Drupal\node\Tests
;
/**
* Functional tests for the node module blocks.
*/
class
NodeBlockFunctionalTest
extends
NodeTestBase
{
/**
* An administrative user for testing.
*
* @var \Drupal\user\UserInterface
*/
protected
$adminUser
;
/**
* An unprivileged user for testing.
*
* @var \Drupal\user\UserInterface
*/
protected
$webUser
;
/**
* Modules to enable.
*
* @var array
*/
public
static
$modules
=
array
(
'block'
);
public
static
function
getInfo
()
{
return
array
(
'name'
=>
'Node blocks'
,
'description'
=>
'Test node block functionality.'
,
'group'
=>
'Node'
,
);
}
function
setUp
()
{
parent
::
setUp
();
// Create users and test node.
$this
->
adminUser
=
$this
->
drupalCreateUser
(
array
(
'administer content types'
,
'administer nodes'
,
'administer blocks'
));
$this
->
webUser
=
$this
->
drupalCreateUser
(
array
(
'access content'
,
'create article content'
));
}
/**
* Tests the recent comments block.
*/
public
function
testRecentNodeBlock
()
{
$this
->
drupalLogin
(
$this
->
adminUser
);
// Disallow anonymous users to view content.
user_role_change_permissions
(
DRUPAL_ANONYMOUS_RID
,
array
(
'access content'
=>
FALSE
,
));
// Enable the recent content block with two items.
$block
=
$this
->
drupalPlaceBlock
(
'node_recent_block'
,
array
(
'id'
=>
'test_block'
,
'block_count'
=>
2
));
// Test that block is not visible without nodes.
$this
->
drupalGet
(
''
);
$this
->
assertText
(
t
(
'No content available.'
),
'Block with "No content available." found.'
);
// Add some test nodes.
$default_settings
=
array
(
'uid'
=>
$this
->
webUser
->
id
(),
'type'
=>
'article'
);
$node1
=
$this
->
drupalCreateNode
(
$default_settings
);
$node2
=
$this
->
drupalCreateNode
(
$default_settings
);
<