Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
webform_rules
Manage
Activity
Members
Labels
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
drupal.org
webform_rules
Commits
151f7c24
Commit
151f7c24
authored
12 years ago
by
Stefan Borchert
Browse files
Options
Downloads
Patches
Plain Diff
Issue #1408286 by mike64: use all webform-enabled types for webform selection in rules condition.
parent
5c2a478d
Branches
master
No related tags found
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
webform_rules.rules.inc
+12
-4
12 additions, 4 deletions
webform_rules.rules.inc
with
12 additions
and
4 deletions
webform_rules.rules.inc
+
12
−
4
View file @
151f7c24
...
...
@@ -103,11 +103,19 @@ function webform_rules_condition_webform_has_id($form_id, $selected_webform) {
* Get an option list of all webforms.
*/
function
webform_rules_get_webforms
()
{
$result
=
db_query
(
"SELECT nid, title FROM
{
node
}
WHERE type = :type"
,
array
(
':type'
=>
'webform'
,
));
// Get a list of all webform-enabled content types.
$webform_types
=
webform_variable_get
(
'webform_node_types'
);
// Get a list of all nodes that are configured to use a webform.
$query
=
db_select
(
'node'
,
'n'
)
->
fields
(
'n'
,
array
(
'nid'
,
'title'
))
->
condition
(
'n.type'
,
$webform_types
,
'IN'
);
// Join to limi result list to node that really have a webform.
$query
->
join
(
'webform'
,
'w'
,
'n.nid = w.nid'
);
// Get the result list.
$results
=
$query
->
execute
();
$options
=
array
();
foreach
(
$result
as
$record
)
{
foreach
(
$result
s
as
$record
)
{
$options
[
"webform-client-form-
{
$record
->
nid
}
"
]
=
$record
->
title
;
}
return
$options
;
...
...
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