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
9b956ea6
Commit
9b956ea6
authored
Jul 27, 2012
by
dawehner
Committed by
tim.plunkett
Oct 21, 2012
Browse files
move some classes in seperated files
parent
d37ab861
Changes
3
Hide whitespace changes
Inline
Side-by-side
lib/Drupal/views/Plugins/views/field/FieldPluginBase.php
View file @
9b956ea6
...
...
@@ -1644,60 +1644,6 @@ function options_form(&$form, &$form_state) {
function
broken
()
{
return
TRUE
;
}
}
/**
* Render a numeric value as a size.
*
* @ingroup views_field_handlers
*/
class
views_handler_field_file_size
extends
FieldPluginBase
{
function
option_definition
()
{
$options
=
parent
::
option_definition
();
$options
[
'file_size_display'
]
=
array
(
'default'
=>
'formatted'
);
return
$options
;
}
function
options_form
(
&
$form
,
&
$form_state
)
{
parent
::
options_form
(
$form
,
$form_state
);
$form
[
'file_size_display'
]
=
array
(
'#title'
=>
t
(
'File size display'
),
'#type'
=>
'select'
,
'#options'
=>
array
(
'formatted'
=>
t
(
'Formatted (in KB or MB)'
),
'bytes'
=>
t
(
'Raw bytes'
),
),
);
}
function
render
(
$values
)
{
$value
=
$this
->
get_value
(
$values
);
if
(
$value
)
{
switch
(
$this
->
options
[
'file_size_display'
])
{
case
'bytes'
:
return
$value
;
case
'formatted'
:
default
:
return
format_size
(
$value
);
}
}
else
{
return
''
;
}
}
}
/**
* A handler to run a field through simple XSS filtering.
*
* @ingroup views_field_handlers
*/
class
views_handler_field_xss
extends
FieldPluginBase
{
function
render
(
$values
)
{
$value
=
$this
->
get_value
(
$values
);
return
$this
->
sanitize_value
(
$value
,
'xss'
);
}
}
/**
* @}
...
...
lib/Drupal/views/Plugins/views/field/FileSize.php
0 → 100644
View file @
9b956ea6
<?php
/**
* @file
* Definition of Drupal\views\Plugins\views\field\FileSize
*/
namespace
Drupal\views\Plugins\views\field
;
use
Drupal\views\Plugins\views\field\FieldPluginBase
;
/**
* Render a numeric value as a size.
*
* @ingroup views_field_handlers
*/
class
FileSize
extends
FieldPluginBase
{
function
option_definition
()
{
$options
=
parent
::
option_definition
();
$options
[
'file_size_display'
]
=
array
(
'default'
=>
'formatted'
);
return
$options
;
}
function
options_form
(
&
$form
,
&
$form_state
)
{
parent
::
options_form
(
$form
,
$form_state
);
$form
[
'file_size_display'
]
=
array
(
'#title'
=>
t
(
'File size display'
),
'#type'
=>
'select'
,
'#options'
=>
array
(
'formatted'
=>
t
(
'Formatted (in KB or MB)'
),
'bytes'
=>
t
(
'Raw bytes'
),
),
);
}
function
render
(
$values
)
{
$value
=
$this
->
get_value
(
$values
);
if
(
$value
)
{
switch
(
$this
->
options
[
'file_size_display'
])
{
case
'bytes'
:
return
$value
;
case
'formatted'
:
default
:
return
format_size
(
$value
);
}
}
else
{
return
''
;
}
}
}
lib/Drupal/views/Plugins/views/field/Xss.php
0 → 100644
View file @
9b956ea6
<?php
/**
* @file
* Definition of Drupal\views\Plugins\views\field\Xss
*/
namespace
Drupal\views\Plugins\views\field
;
use
Drupal\views\Plugins\views\field\FieldPluginBase
;
/**
* A handler to run a field through simple XSS filtering.
*
* @ingroup views_field_handlers
*/
class
Xss
extends
FieldPluginBase
{
function
render
(
$values
)
{
$value
=
$this
->
get_value
(
$values
);
return
$this
->
sanitize_value
(
$value
,
'xss'
);
}
}
Write
Preview
Supports
Markdown
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