Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal-3443915
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
drupal-3443915
Commits
f7fa9970
Commit
f7fa9970
authored
12 years ago
by
Tim Plunkett
Browse files
Options
Downloads
Patches
Plain Diff
Restore the missing custom text area plugin.
parent
d9c68d48
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/Drupal/views/Plugin/views/area/TextCustom.php
+64
-0
64 additions, 0 deletions
lib/Drupal/views/Plugin/views/area/TextCustom.php
modules/views.views.inc
+7
-8
7 additions, 8 deletions
modules/views.views.inc
with
71 additions
and
8 deletions
lib/Drupal/views/Plugin/views/area/TextCustom.php
0 → 100644
+
64
−
0
View file @
f7fa9970
<?php
/**
* @file
* Definition of Drupal\views\Plugin\views\area\TextCustom.
*/
namespace
Drupal\views\Plugin\views\area
;
use
Drupal\Core\Annotation\Plugin
;
/**
* Views area text handler.
*
* @ingroup views_area_handlers
*/
/**
* @Plugin(
* plugin_id = "text_custom"
* )
*/
class
TextCustom
extends
AreaPluginBase
{
function
option_definition
()
{
$options
=
parent
::
option_definition
();
unset
(
$options
[
'format'
]);
return
$options
;
}
function
options_form
(
&
$form
,
&
$form_state
)
{
parent
::
options_form
(
$form
,
$form_state
);
// Alter the form element, to be a regular text area.
$form
[
'content'
][
'#type'
]
=
'textarea'
;
unset
(
$form
[
'content'
][
'#format'
]);
unset
(
$form
[
'content'
][
'#wysiwyg'
]);
}
// Empty, so we don't inherit options_submit from the parent.
function
options_submit
(
&
$form
,
&
$form_state
)
{
}
function
render
(
$empty
=
FALSE
)
{
if
(
!
$empty
||
!
empty
(
$this
->
options
[
'empty'
]))
{
return
$this
->
render_textarea_custom
(
$this
->
options
[
'content'
]);
}
return
''
;
}
/**
* Render a text area with filter_xss_admin.
*/
function
render_textarea_custom
(
$value
)
{
if
(
$value
)
{
if
(
$this
->
options
[
'tokenize'
])
{
$value
=
$this
->
view
->
style_plugin
->
tokenize_value
(
$value
,
0
);
}
return
$this
->
sanitize_value
(
$value
,
'xss_admin'
);
}
}
}
This diff is collapsed.
Click to expand it.
modules/views.views.inc
+
7
−
8
View file @
f7fa9970
...
...
@@ -57,14 +57,13 @@ function views_views_data() {
),
);
// @todo: this class seems to be missing.
// $data['views']['area_text_custom'] = array(
// 'title' => t('Unfiltered text'),
// 'help' => t('Add unrestricted, custom text or markup. This is similar to the custom text field.'),
// 'area' => array(
// 'handler' => 'views_handler_area_text_custom',
// ),
// );
$data
[
'views'
][
'area_text_custom'
]
=
array
(
'title'
=>
t
(
'Unfiltered text'
),
'help'
=>
t
(
'Add unrestricted, custom text or markup. This is similar to the custom text field.'
),
'area'
=>
array
(
'plugin_id'
=>
'text_custom'
,
),
);
$data
[
'views'
][
'view'
]
=
array
(
'title'
=>
t
(
'View area'
),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment