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
5019a190
Commit
5019a190
authored
Jul 29, 2012
by
Daniel Wehner
Committed by
Tim Plunkett
Oct 21, 2012
Browse files
convert system stuff
parent
85f7dfc3
Changes
9
Hide whitespace changes
Inline
Side-by-side
lib/Views/
system
/Plugin/views/argument/
views_handler_argument_file_fid.inc
→
lib/Views/
file
/Plugin/views/argument/
Fid.php
View file @
5019a190
...
...
@@ -5,12 +5,23 @@
* Definition of views_handler_argument_file_fid.
*/
namespace
Views\file\Plugin\views\argument
;
use
Drupal\Core\Annotation\Plugin
;
use
Drupal\views\Plugin\views\argument\Numeric
;
/**
* Argument handler to accept multiple file ids.
*
* @ingroup views_argument_handlers
*/
class
views_handler_argument_file_fid
extends
views_handler_argument_numeric
{
/**
* @Plugin(
* plugin_id = "file_fid"
* )
*/
class
Fid
extends
Numeric
{
/**
* Override the behavior of title_query(). Get the filenames.
*/
...
...
lib/Views/
system
/Plugin/views/field/
views_handler_field_file_e
xtension.
inc
→
lib/Views/
file
/Plugin/views/field/
E
xtension.
php
View file @
5019a190
...
...
@@ -5,11 +5,23 @@
* Definition of views_handler_field_file_extension.
*/
namespace
Views\file\Plugin\views\field
;
use
Drupal\Core\Annotation\Plugin
;
use
Drupal\views\Plugin\views\field\FieldPluginBase
;
/**
* Returns a pure file extension of the file, for example 'module'.
*
* @ingroup views_field_handlers
*/
class
views_handler_field_file_extension
extends
views_handler_field
{
/**
* @Plugin(
* plugin_id = "file_extension"
* )
*/
class
Extension
extends
FieldPluginBase
{
function
render
(
$values
)
{
$value
=
$this
->
get_value
(
$values
);
if
(
preg_match
(
'/\.([^\.]+)$/'
,
$value
,
$match
))
{
...
...
lib/Views/
system
/Plugin/views/field/
views_handler_field_f
ile.
inc
→
lib/Views/
file
/Plugin/views/field/
F
ile.
php
View file @
5019a190
...
...
@@ -5,12 +5,24 @@
* Definition of views_handler_field_file.
*/
namespace
Views\file\Plugin\views\field
;
use
Drupal\Core\Annotation\Plugin
;
use
Drupal\views\Plugin\views\field\FieldPluginBase
;
/**
* Field handler to provide simple renderer that allows linking to a file.
*
* @ingroup views_field_handlers
*/
class
views_handler_field_file
extends
views_handler_field
{
/**
* @Plugin(
* plugin_id = "file"
* )
*/
class
File
extends
FieldPluginBase
{
/**
* Constructor to provide additional field to add.
*/
...
...
lib/Views/
system
/Plugin/views/field/
views_handler_field_file_filem
ime.
inc
→
lib/Views/
file
/Plugin/views/field/
FileM
ime.
php
View file @
5019a190
...
...
@@ -5,12 +5,22 @@
* Definition of views_handler_field_file_filemime.
*/
namespace
Views\file\Plugin\views\field
;
use
Drupal\Core\Annotation\Plugin
;
/**
* Field handler to add rendering MIME type images as an option on the filemime field.
*
* @ingroup views_field_handlers
*/
class
views_handler_field_file_filemime
extends
views_handler_field_file
{
/**
* @Plugin(
* plugin_id = "file_filemime"
* )
*/
class
FileMime
extends
File
{
function
option_definition
()
{
$options
=
parent
::
option_definition
();
$options
[
'filemime_image'
]
=
array
(
'default'
=>
FALSE
,
'bool'
=>
TRUE
);
...
...
lib/Views/
system
/Plugin/views/field/
views_handler_field_file_s
tatus.
inc
→
lib/Views/
file
/Plugin/views/field/
S
tatus.
php
View file @
5019a190
...
...
@@ -5,12 +5,23 @@
* Definition of views_handler_field_file_status.
*/
namespace
Views\file\Plugin\views\field
;
use
Drupal\Core\Annotation\Plugin
;
use
Drupal\views\Plugin\views\field\FieldPluginBase
;
/**
* Field handler to translate a node type into its readable form.
*
* @ingroup views_field_handlers
*/
class
views_handler_field_file_status
extends
views_handler_field
{
/**
* @Plugin(
* plugin_id = "file_status"
* )
*/
class
Status
extends
FieldPluginBase
{
function
render
(
$values
)
{
$value
=
$this
->
get_value
(
$values
);
return
_views_file_status
(
$value
);
...
...
lib/Views/
system
/Plugin/views/field/
views_handler_field_file_uri.inc
→
lib/Views/
file
/Plugin/views/field/
Uri.php
View file @
5019a190
...
...
@@ -5,10 +5,18 @@
* Definition of views_handler_field_file_uri.
*/
namespace
Views\file\Plugin\views\field
;
use
Drupal\Core\Annotation\Plugin
;
/**
* Field handler to add rendering file paths as file URLs instead of as internal file URIs.
*
* @Plugin(
* plugin_id = "file_uri"
* )
*/
class
views_handler_field_file_uri
extends
views_handler_field_f
ile
{
class
Uri
extends
F
ile
{
function
option_definition
()
{
$options
=
parent
::
option_definition
();
$options
[
'file_download_path'
]
=
array
(
'default'
=>
FALSE
,
'bool'
=>
TRUE
);
...
...
lib/Views/
system
/Plugin/views/filter/
views_handler_filter_file_s
tatus.
inc
→
lib/Views/
file
/Plugin/views/filter/
S
tatus.
php
View file @
5019a190
...
...
@@ -5,12 +5,23 @@
* Definition of views_handler_filter_file_status.
*/
namespace
Views\file\Plugin\views\filter
;
use
Drupal\Core\Annotation\Plugin
;
use
Drupal\views\Plugin\views\filter\InOperator
;
/**
* Filter by file status.
*
* @ingroup views_filter_handlers
*/
class
views_handler_filter_file_status
extends
views_handler_filter_in_operator
{
/**
* @Plugin(
* plugin_id = "file_status"
* )
*/
class
Status
extends
InOperator
{
function
get_value_options
()
{
if
(
!
isset
(
$this
->
value_options
))
{
$this
->
value_options
=
_views_file_status
();
...
...
lib/Views/system/Plugin/views/filter/
views_handler_filter_system_t
ype.
inc
→
lib/Views/system/Plugin/views/filter/
T
ype.
php
View file @
5019a190
...
...
@@ -5,10 +5,19 @@
* Definition of views_handler_filter_system_type.
*/
namespace
Views\system\Plugin\views\filter
;
use
Drupal\views\Plugin\views\filter\InOperator
;
use
Drupal\Core\Annotation\Plugin
;
/**
* Filter by system type.
*
* @Plugin(
* plugin_id = "system_type"
* )
*/
class
views_handler_filter_system_type
extends
views_handler_filter_in_o
perator
{
class
Type
extends
InO
perator
{
function
get_value_options
()
{
if
(
!
isset
(
$this
->
value_options
))
{
$this
->
value_title
=
t
(
'Type'
);
...
...
modules/system.views.inc
View file @
5019a190
...
...
@@ -35,11 +35,11 @@ function system_views_data() {
'title'
=>
t
(
'File ID'
),
'help'
=>
t
(
'The ID of the file.'
),
'field'
=>
array
(
'
handler'
=>
'views_handler_field_
file'
,
'
plugin_id'
=>
'
file'
,
'click sortable'
=>
TRUE
,
),
'argument'
=>
array
(
'
handler'
=>
'views_handler_argument_
file_fid'
,
'
plugin_id'
=>
'
file_fid'
,
'name field'
=>
'filename'
,
// the field to display in the summary.
'numeric'
=>
TRUE
,
),
...
...
@@ -56,7 +56,7 @@ function system_views_data() {
'title'
=>
t
(
'Name'
),
'help'
=>
t
(
'The name of the file.'
),
'field'
=>
array
(
'
handler'
=>
'views_handler_field_
file'
,
'
plugin_id'
=>
'
file'
,
'click sortable'
=>
TRUE
,
),
'sort'
=>
array
(
...
...
@@ -75,7 +75,7 @@ function system_views_data() {
'title'
=>
t
(
'Path'
),
'help'
=>
t
(
'The path of the file.'
),
'field'
=>
array
(
'
handler'
=>
'views_handler_field_
file_uri'
,
'
plugin_id'
=>
'
file_uri'
,
'click sortable'
=>
TRUE
,
),
'sort'
=>
array
(
...
...
@@ -94,7 +94,7 @@ function system_views_data() {
'title'
=>
t
(
'Mime type'
),
'help'
=>
t
(
'The mime type of the file.'
),
'field'
=>
array
(
'
handler'
=>
'views_handler_field_
file_filemime'
,
'
plugin_id'
=>
'
file_filemime'
,
'click sortable'
=>
TRUE
,
),
'sort'
=>
array
(
...
...
@@ -114,7 +114,7 @@ function system_views_data() {
'help'
=>
t
(
'The extension of the file.'
),
'real field'
=>
'filename'
,
'field'
=>
array
(
'
handler'
=>
'views_handler_
field_file_extension'
,
'
plugin_id'
=>
'
field_file_extension'
,
'click sortable'
=>
FALSE
,
),
);
...
...
@@ -124,7 +124,7 @@ function system_views_data() {
'title'
=>
t
(
'Size'
),
'help'
=>
t
(
'The size of the file.'
),
'field'
=>
array
(
'
handler'
=>
'views_handler_
field_file_size'
,
'
plugin_id'
=>
'
field_file_size'
,
'click sortable'
=>
TRUE
,
),
'sort'
=>
array
(
...
...
@@ -140,14 +140,14 @@ function system_views_data() {
'title'
=>
t
(
'Status'
),
'help'
=>
t
(
'The status of the file.'
),
'field'
=>
array
(
'
handler'
=>
'views_handler_
field_file_status'
,
'
plugin_id'
=>
'
field_file_status'
,
'click sortable'
=>
TRUE
,
),
'sort'
=>
array
(
'plugin_id'
=>
'standard'
,
),
'filter'
=>
array
(
'
handler'
=>
'views_handler_
filter_file_status'
,
'
plugin_id'
=>
'
filter_file_status'
,
),
);
...
...
@@ -516,7 +516,7 @@ function system_views_data() {
'name field'
=>
'type'
,
// the field to display in the summary.
),
'filter'
=>
array
(
'
handler'
=>
'views_handler_
filter_system_type'
,
'
plugin_id'
=>
'
filter_system_type'
,
),
'sort'
=>
array
(
'plugin_id'
=>
'standard'
,
...
...
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