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
bdd5fa18
Commit
bdd5fa18
authored
16 years ago
by
Angie Byron
Browse files
Options
Downloads
Patches
Plain Diff
#369653
by rszrama: Add 'No categories' message to Contact module when no categories exist.
parent
f3ed3283
No related branches found
No related tags found
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
modules/contact/contact.admin.inc
+19
-3
19 additions, 3 deletions
modules/contact/contact.admin.inc
with
19 additions
and
3 deletions
modules/contact/contact.admin.inc
+
19
−
3
View file @
bdd5fa18
...
@@ -10,12 +10,28 @@
...
@@ -10,12 +10,28 @@
* Categories/list tab.
* Categories/list tab.
*/
*/
function
contact_admin_categories
()
{
function
contact_admin_categories
()
{
$result
=
db_query
(
'SELECT cid, category, recipients, selected FROM {contact} ORDER BY weight, category'
);
$rows
=
array
();
$rows
=
array
();
$header
=
array
(
t
(
'Category'
),
t
(
'Recipients'
),
t
(
'Selected'
),
array
(
'data'
=>
t
(
'Operations'
),
'colspan'
=>
2
));
// Get all the contact categories from the database.
$result
=
db_query
(
'SELECT cid, category, recipients, selected FROM {contact} ORDER BY weight, category'
);
// Loop through the categories and add them to the table.
while
(
$category
=
db_fetch_object
(
$result
))
{
while
(
$category
=
db_fetch_object
(
$result
))
{
$rows
[]
=
array
(
$category
->
category
,
$category
->
recipients
,
(
$category
->
selected
?
t
(
'Yes'
)
:
t
(
'No'
)),
l
(
t
(
'edit'
),
'admin/build/contact/edit/'
.
$category
->
cid
),
l
(
t
(
'delete'
),
'admin/build/contact/delete/'
.
$category
->
cid
));
$rows
[]
=
array
(
$category
->
category
,
$category
->
recipients
,
(
$category
->
selected
?
t
(
'Yes'
)
:
t
(
'No'
)),
l
(
t
(
'edit'
),
'admin/build/contact/edit/'
.
$category
->
cid
),
l
(
t
(
'delete'
),
'admin/build/contact/delete/'
.
$category
->
cid
),
);
}
// If no categories were found, let the user know.
if
(
empty
(
$rows
))
{
$rows
[]
=
array
(
array
(
'data'
=>
t
(
'No categories available.'
),
'colspan'
=>
5
));
}
}
$header
=
array
(
t
(
'Category'
),
t
(
'Recipients'
),
t
(
'Selected'
),
array
(
'data'
=>
t
(
'Operations'
),
'colspan'
=>
2
));
return
theme
(
'table'
,
$header
,
$rows
);
return
theme
(
'table'
,
$header
,
$rows
);
}
}
...
...
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