Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
project
drupal
Commits
b416a377
Commit
b416a377
authored
11 years ago
by
Dries Buytaert
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#1941286
by scor, Eric_A: Remove the process layer (rdf module).
parent
8d206bf5
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/modules/rdf/rdf.module
+23
-3
23 additions, 3 deletions
core/modules/rdf/rdf.module
with
23 additions
and
3 deletions
core/modules/rdf/rdf.module
+
23
−
3
View file @
b416a377
...
...
@@ -283,7 +283,11 @@ function rdf_preprocess_node(&$variables) {
$created_mapping
=
$mapping
->
getPreparedFieldMapping
(
'created'
);
if
(
!
empty
(
$created_mapping
)
&&
$variables
[
'submitted'
])
{
$date_attributes
=
rdf_rdfa_attributes
(
$created_mapping
,
$variables
[
'node'
]
->
created
);
$variables
[
'submitted'
]
.
=
theme
(
'rdf_metadata'
,
array
(
'metadata'
=>
array
(
$date_attributes
)));
$rdf_metadata
=
array
(
'#theme'
=>
'rdf_metadata'
,
'#metadata'
=>
array
(
$date_attributes
),
);
$variables
[
'submitted'
]
.
=
drupal_render
(
$rdf_metadata
);
}
// Adds RDFa markup annotating the number of comments a node has.
...
...
@@ -479,6 +483,9 @@ function rdf_preprocess_comment(&$variables) {
$author_mapping
=
$mapping
->
getPreparedFieldMapping
(
'uid'
);
if
(
!
empty
(
$author_mapping
))
{
$author_attributes
=
array
(
'rel'
=>
$author_mapping
[
'properties'
]);
// Wraps the author variable and the submitted variable which are both
// available in comment.html.twig.
$variables
[
'author'
]
=
'<span '
.
new
Attribute
(
$author_attributes
)
.
'>'
.
$variables
[
'author'
]
.
'</span>'
;
$variables
[
'submitted'
]
=
'<span '
.
new
Attribute
(
$author_attributes
)
.
'>'
.
$variables
[
'submitted'
]
.
'</span>'
;
}
// Adds RDFa markup for the date of the comment.
...
...
@@ -487,7 +494,16 @@ function rdf_preprocess_comment(&$variables) {
// The comment date is precomputed as part of the rdf_data so that it can be
// cached as part of the entity.
$date_attributes
=
$comment
->
rdf_data
[
'date'
];
$variables
[
'submitted'
]
.
=
theme
(
'rdf_metadata'
,
array
(
'metadata'
=>
array
(
$date_attributes
)));
$rdf_metadata
=
array
(
'#theme'
=>
'rdf_metadata'
,
'#metadata'
=>
array
(
$date_attributes
),
);
$created_metadata_markup
=
drupal_render
(
$rdf_metadata
);
// Appends the markup to the created variable and the submitted variable
// which are both available in comment.html.twig.
$variables
[
'created'
]
.
=
$created_metadata_markup
;
$variables
[
'submitted'
]
.
=
$created_metadata_markup
;
}
$title_mapping
=
$mapping
->
getPreparedFieldMapping
(
'title'
);
if
(
!
empty
(
$title_mapping
))
{
...
...
@@ -524,7 +540,11 @@ function rdf_preprocess_comment(&$variables) {
if
(
!
isset
(
$variables
[
'content'
][
'comment_body'
][
'#prefix'
]))
{
$variables
[
'content'
][
'comment_body'
][
'#prefix'
]
=
''
;
}
$variables
[
'content'
][
'comment_body'
][
'#prefix'
]
=
theme
(
'rdf_metadata'
,
array
(
'metadata'
=>
$variables
[
'rdf_metadata_attributes'
]))
.
$variables
[
'content'
][
'comment_body'
][
'#prefix'
];
$rdf_metadata
=
array
(
'#theme'
=>
'rdf_metadata'
,
'#metadata'
=>
$variables
[
'rdf_metadata_attributes'
],
);
$variables
[
'content'
][
'comment_body'
][
'#prefix'
]
=
drupal_render
(
$rdf_metadata
)
.
$variables
[
'content'
][
'comment_body'
][
'#prefix'
];
}
}
...
...
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