Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
flag-3117936
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
flag-3117936
Commits
701faf84
Commit
701faf84
authored
16 years ago
by
Nate Lampton
Browse files
Options
Downloads
Patches
Plain Diff
#328383
. Provide hook_preprocess_link() to Drupal 5.
parent
9a09ac81
No related branches found
Branches containing commit
Tags
5.x-1.0-beta6
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
flag.module
+26
-2
26 additions, 2 deletions
flag.module
with
26 additions
and
2 deletions
flag.module
+
26
−
2
View file @
701faf84
...
...
@@ -810,7 +810,8 @@ function theme_flag($flag, $action, $content_id, $after_flagging = FALSE) {
'content_id'
=>
$content_id
,
'after_flagging'
=>
$after_flagging
,
);
template_preprocess_flag
(
$variables
);
flag_template_preprocess
(
'flag'
,
$variables
);
extract
(
$variables
);
ob_start
();
include
$template
;
...
...
@@ -887,7 +888,7 @@ function flag_phptemplate_adapter($flag, $action, $content_id, $after_flagging =
'content_id'
=>
$content_id
,
'after_flagging'
=>
$after_flagging
,
);
template_preprocess
_
flag
(
$variables
);
flag_
template_preprocess
(
'
flag
'
,
$variables
);
// Prepare an array of suggested templates to try.
$suggestions
=
array
();
...
...
@@ -904,6 +905,29 @@ function flag_phptemplate_adapter($flag, $action, $content_id, $after_flagging =
return
$output
;
}
/**
* Call module flag preprocess functions for Drupal 5.
*
* The preprocess functions for themes and phptemplate can be done in
* _phptemplate_variables(), but this adds preprocessing to modules that don't
* have this access in Drupal 5.
*
* @param $hook
* The name of the template file hook whose variables are being preprocessed.
* @param $variables
* The existing variables that will be passed to the template file.
*/
function
flag_template_preprocess
(
$hook
,
&
$variables
)
{
if
(
function_exists
(
'template_preprocess_'
.
$hook
))
{
$function
=
'template_preprocess_'
.
$hook
;
$function
(
$variables
);
}
foreach
(
module_implements
(
'preprocess_'
.
$hook
)
as
$module
)
{
$function
=
$module
.
'_preprocess_'
.
$hook
;
$function
(
$variables
);
}
}
/**
* Format a string containing a count of items.
*
...
...
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