forked from drupal/drupal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Drupal 8.1.3, SA-CORE-2016-002 by catch, dawehner, dsnopek, greggles,…
… Plazik, stefan.r, xjm, klausi, mlhess
- Loading branch information
Showing
7 changed files
with
83 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
core/modules/statistics/config/schema/statistics.views.schema.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Schema for the views plugins of the Statistics module. | ||
|
||
views.field.statistics_numeric: | ||
type: views.field.numeric | ||
label: 'Numeric values from the statistics module' | ||
|
||
views.field.node_counter_timestamp: | ||
type: views.field.date | ||
label: 'The most recent time the node has been viewed' |
24 changes: 24 additions & 0 deletions
24
core/modules/statistics/src/Plugin/views/field/NodeCounterTimestamp.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace Drupal\statistics\Plugin\views\field; | ||
|
||
use Drupal\views\Plugin\views\field\Date; | ||
use Drupal\Core\Session\AccountInterface; | ||
|
||
/** | ||
* Field handler to display the most recent time the node has been viewed. | ||
* | ||
* @ingroup views_field_handlers | ||
* | ||
* @ViewsField("node_counter_timestamp") | ||
*/ | ||
class NodeCounterTimestamp extends Date { | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function access(AccountInterface $account) { | ||
return $account->hasPermission('view post access counter'); | ||
} | ||
|
||
} |
24 changes: 24 additions & 0 deletions
24
core/modules/statistics/src/Plugin/views/field/StatisticsNumeric.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace Drupal\statistics\Plugin\views\field; | ||
|
||
use Drupal\views\Plugin\views\field\NumericField; | ||
use Drupal\Core\Session\AccountInterface; | ||
|
||
/** | ||
* Field handler to display numeric values from the statistics module. | ||
* | ||
* @ingroup views_field_handlers | ||
* | ||
* @ViewsField("statistics_numeric") | ||
*/ | ||
class StatisticsNumeric extends NumericField { | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function access(AccountInterface $account) { | ||
return $account->hasPermission('view post access counter'); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters