Fix #726146 by marrch_caat: node-specific settings ain't saved on node creation
[project/print.git] / print.install
CommitLineData
b09f08f7
JV
1<?php
2// $Id$
3
4/**
3483245d
JV
5 * @file
6 * Install file of the print module
d08475b8
JV
7 *
8 * @ingroup print
3483245d
JV
9 */
10
11/**
937c5ab6 12 * Implements hook_install().
1e156b5a
JV
13 */
14function print_install() {
855b243a
JV
15 drupal_install_schema('print');
16
7d62e7c4
JV
17 $t = get_t();
18 drupal_set_message($t('Printer-friendly Page settings are available under !link',
99e463d7 19 array( '!link' => l($t('Administer > Site configuration > Printer-friendly Pages'), 'admin/settings/print' ) )
1e156b5a
JV
20 ));
21}
22
23/**
937c5ab6 24 * Implements hook_uninstall().
b09f08f7
JV
25 */
26function print_uninstall() {
855b243a
JV
27 drupal_uninstall_schema('print');
28
b09f08f7 29 variable_del('print_settings');
b09f08f7
JV
30 variable_del('print_sourceurl_settings');
31 variable_del('print_html_settings');
32 variable_del('print_robot_settings');
7d62e7c4 33 variable_del('print_logo_url');
6df28242 34 variable_del('print_logo_options');
7d62e7c4
JV
35 variable_del('print_css');
36 variable_del('print_urls');
5e9a8d09 37 variable_del('print_urls_anchors');
7d62e7c4
JV
38 variable_del('print_comments');
39 variable_del('print_newwindow');
40 variable_del('print_sourceurl_enabled');
41 variable_del('print_sourceurl_date');
42 variable_del('print_sourceurl_forcenode');
43 variable_del('print_html_show_link');
6df28242 44 variable_del('print_html_link_pos');
7d62e7c4
JV
45 variable_del('print_html_node_link_visibility');
46 variable_del('print_html_node_link_pages');
47 variable_del('print_html_link_class');
48 variable_del('print_html_sys_link_visibility');
49 variable_del('print_html_sys_link_pages');
50 variable_del('print_html_book_link');
51 variable_del('print_html_new_window');
52 variable_del('print_html_sendtoprinter');
b42d3086 53 variable_del('print_html_windowclose');
7d62e7c4
JV
54 variable_del('print_robots_noindex');
55 variable_del('print_robots_nofollow');
56 variable_del('print_robots_noarchive');
855b243a
JV
57 variable_del('print_footer_options');
58 variable_del('print_footer_user');
59 variable_del('print_html_link_text');
60 variable_del('print_html_link_use_alias');
61 variable_del('print_text_by');
62 variable_del('print_text_created');
63 variable_del('print_text_links');
64 variable_del('print_text_published');
65 variable_del('print_text_retrieved');
66 variable_del('print_text_source_url');
b09f08f7 67 $settings = db_query("SELECT name FROM {variable} WHERE name LIKE 'print\_display\_%'");
855b243a 68 foreach ($settings as $variable) {
b09f08f7
JV
69 variable_del($variable->name);
70 }
71}
7d62e7c4
JV
72
73/**
937c5ab6 74 * Implements hook_schema().
7d62e7c4 75 */
855b243a
JV
76function print_schema() {
77 $schema['print_node_conf'] = array(
78 'fields' => array(
79 'nid' => array(
80 'type' => 'int',
81 'unsigned' => TRUE,
82 'not null' => TRUE,
83 ),
84 'link' => array(
85 'type' => 'int',
86 'unsigned' => TRUE,
87 'not null' => TRUE,
a43c9735 88 'default' => 1,
855b243a
JV
89 'size' => 'tiny',
90 ),
91 'comments' => array(
92 'type' => 'int',
93 'unsigned' => TRUE,
94 'not null' => TRUE,
a43c9735 95 'default' => 1,
855b243a
JV
96 'size' => 'tiny',
97 ),
98 'url_list' => array(
99 'type' => 'int',
100 'unsigned' => TRUE,
101 'not null' => TRUE,
a43c9735 102 'default' => 1,
855b243a
JV
103 'size' => 'tiny',
104 ),
105 ),
106 'primary key' => array('nid'),
107 );
7d62e7c4 108
855b243a
JV
109 $schema['print_page_counter'] = array(
110 'fields' => array(
111 'path' => array(
112 'type' => 'varchar',
113 'length' => 128,
114 'not null' => TRUE,
115 ),
116 'totalcount' => array(
117 'type' => 'int',
118 'unsigned' => TRUE,
119 'not null' => TRUE,
120 'default' => 0,
121 'size' => 'big',
122 ),
123 'timestamp' => array(
124 'type' => 'int',
125 'unsigned' => TRUE,
126 'not null' => TRUE,
127 'default' => 0,
128 ),
129 ),
130 'primary key' => array('path'),
131 );
fabf1a53 132
855b243a 133 return $schema;
fabf1a53 134}