Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
drupal.org
better_formats
Commits
6900896e
Commit
6900896e
authored
Dec 26, 2008
by
dragonwize
Browse files
Now deleting specific node type entires when a node type is deleted
parent
84f95b35
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
1 deletion
+16
-1
better_formats.module
better_formats.module
+16
-1
No files found.
better_formats.module
View file @
6900896e
...
...
@@ -235,7 +235,7 @@ function better_formats_new_role($form, &$form_state) {
// create stubs in per role table
$sql
=
"INSERT INTO
{
better_formats_defaults
}
VALUES (%d, '%s', %d, %d, %d)"
;
VALUES (%d, '%s', %d, %d, %d)"
;
db_query
(
$sql
,
$rid
,
'node'
,
0
,
1
,
25
);
db_query
(
$sql
,
$rid
,
'comment'
,
0
,
1
,
25
);
}
...
...
@@ -252,6 +252,21 @@ function better_formats_delete_role($form, &$form_state) {
db_query
(
$sql
,
$form
[
'rid'
][
'#value'
]);
}
/**
* Implementation of hook_node_type().
*/
function
better_formats_node_type
(
$op
,
$info
)
{
if
(
$op
===
'delete'
)
{
// delete per node type settings on node type delete
$sql
=
"DELETE FROM
{
better_formats_defaults
}
WHERE type IN ('node/%s', 'comment/%s')"
;
db_query
(
$sql
,
$info
->
type
,
$info
->
type
);
// delete node type variables
variable_del
(
'better_formats_allowed_'
.
$info
->
type
);
}
}
/**
* Implementation of hook_elements().
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment