summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoao Ventura2010-07-20 00:31:59 (GMT)
committer Joao Ventura2010-07-20 00:31:59 (GMT)
commit3acee930e177db71c90a75e702d3c667dd231b18 (patch)
tree6bed91add0a531c14d71417100606d01b1c50d5d
parent844272173f59d94d9c47e953b38a3e34e17146a1 (diff)
Use type-default settings if a node is being created/updated leaving them unspecified
-rw-r--r--print.module6
-rw-r--r--print_mail/print_mail.module6
-rw-r--r--print_pdf/print_pdf.module6
3 files changed, 15 insertions, 3 deletions
diff --git a/print.module b/print.module
index 451d0db..c339ad2 100644
--- a/print.module
+++ b/print.module
@@ -351,7 +351,11 @@ function print_nodeapi(&$node, $op = 'view', $teaser, $page) {
case 'insert':
case 'update':
if (user_access('administer print') || user_access('node-specific print configuration')) {
- _print_node_conf_modify($node->nid, $node->print_display, $node->print_display_comment, $node->print_display_urllist);
+ if ($node->print_display === NULL) $node->print_display = variable_get('print_display_' . $node->type, PRINT_TYPE_SHOW_LINK_DEFAULT);
+ if ($node->print_display_comment === NULL) $node->print_display_comment = variable_get('print_display_comment_' . $node->type, PRINT_TYPE_COMMENT_LINK_DEFAULT);
+ if ($node->print_display_urllist === NULL) $node->print_display_urllist = variable_get('print_display_urllist_' . $node->type, PRINT_TYPE_URLLIST_DEFAULT);
+
+ _print_node_conf_modify($node->nid, $node->print_display, $node->print_display_comment, $node->print_display_urllist);
}
break;
case 'delete':
diff --git a/print_mail/print_mail.module b/print_mail/print_mail.module
index 6616ef1..af99a71 100644
--- a/print_mail/print_mail.module
+++ b/print_mail/print_mail.module
@@ -233,7 +233,11 @@ function print_mail_nodeapi(&$node, $op = 'view', $teaser, $page) {
case 'insert':
case 'update':
if (user_access('administer print') || user_access('node-specific print configuration')) {
- _print_mail_node_conf_modify($node->nid, $node->print_mail_display, $node->print_mail_display_comment, $node->print_mail_display_urllist);
+ if ($node->print_mail_display === NULL) $node->print_mail_display = variable_get('print_mail_display_' . $node->type, PRINT_TYPE_SHOW_LINK_DEFAULT);
+ if ($node->print_mail_display_comment === NULL) $node->print_mail_display_comment = variable_get('print_mail_display_comment_' . $node->type, PRINT_TYPE_COMMENT_LINK_DEFAULT);
+ if ($node->print_mail_display_urllist === NULL) $node->print_mail_display_urllist = variable_get('print_mail_display_urllist_' . $node->type, PRINT_TYPE_URLLIST_DEFAULT);
+
+ _print_mail_node_conf_modify($node->nid, $node->print_mail_display, $node->print_mail_display_comment, $node->print_mail_display_urllist);
}
break;
case 'delete':
diff --git a/print_pdf/print_pdf.module b/print_pdf/print_pdf.module
index 3a2e4bb..a64c894 100644
--- a/print_pdf/print_pdf.module
+++ b/print_pdf/print_pdf.module
@@ -245,7 +245,11 @@ function print_pdf_nodeapi(&$node, $op = 'view', $teaser, $page) {
case 'insert':
case 'update':
if (user_access('administer print') || user_access('node-specific print configuration')) {
- _print_pdf_node_conf_modify($node->nid, $node->print_pdf_display, $node->print_pdf_display_comment, $node->print_pdf_display_urllist);
+ if ($node->print_pdf_display === NULL) $node->print_pdf_display = variable_get('print_pdf_display_' . $node->type, PRINT_TYPE_SHOW_LINK_DEFAULT);
+ if ($node->print_pdf_display_comment === NULL) $node->print_pdf_display_comment = variable_get('print_pdf_display_comment_' . $node->type, PRINT_TYPE_COMMENT_LINK_DEFAULT);
+ if ($node->print_pdf_display_urllist === NULL) $node->print_pdf_display_urllist = variable_get('print_pdf_display_urllist_' . $node->type, PRINT_TYPE_URLLIST_DEFAULT);
+
+ _print_pdf_node_conf_modify($node->nid, $node->print_pdf_display, $node->print_pdf_display_comment, $node->print_pdf_display_urllist);
}
break;
case 'delete':