<?php
-// $Id$
/**
* @file
- * Install file of the print module
+ * Install, update and uninstall functions for the print module.
+ *
+ * @ingroup print
*/
/**
- * Implementation of hook_install().
+ * Implements hook_install().
*/
function print_install() {
- drupal_install_schema('print');
-
$t = get_t();
drupal_set_message($t('Printer-friendly Page settings are available under !link',
- array( '!link' => l('Administer > Site configuration > Printer-friendly Pages ', 'admin/settings/print' ) )
+ array( '!link' => l($t('Administer > Configuration > Printer, e-mail and PDF versions'), 'admin/config/user-interface/print' ) )
));
}
/**
- * Implementation of hook_uninstall().
+ * Implements hook_enable().
*/
-function print_uninstall() {
- drupal_uninstall_schema('print');
+function print_enable() {
+ $t = get_t();
+
+ // Module weight
+ db_update('system')
+ ->fields(array(
+ 'weight' => 0,
+ ))
+ ->condition('type', 'module')
+ ->condition('name', 'print')
+ ->execute();
+}
+/**
+ * Implements hook_uninstall().
+ */
+function print_uninstall() {
variable_del('print_settings');
variable_del('print_sourceurl_settings');
variable_del('print_html_settings');
variable_del('print_logo_options');
variable_del('print_css');
variable_del('print_urls');
+ variable_del('print_urls_anchors');
variable_del('print_comments');
variable_del('print_newwindow');
variable_del('print_sourceurl_enabled');
variable_del('print_sourceurl_forcenode');
variable_del('print_html_show_link');
variable_del('print_html_link_pos');
+ variable_del('print_html_link_teaser');
variable_del('print_html_node_link_visibility');
variable_del('print_html_node_link_pages');
variable_del('print_html_link_class');
variable_del('print_html_book_link');
variable_del('print_html_new_window');
variable_del('print_html_sendtoprinter');
+ variable_del('print_html_windowclose');
variable_del('print_robots_noindex');
variable_del('print_robots_nofollow');
variable_del('print_robots_noarchive');
variable_del('print_footer_user');
variable_del('print_html_link_text');
variable_del('print_html_link_use_alias');
- variable_del('print_text_by');
- variable_del('print_text_created');
variable_del('print_text_links');
variable_del('print_text_published');
variable_del('print_text_retrieved');
}
/**
- * Implementation of hook_schema().
+ * Implements hook_schema().
*/
function print_schema() {
$schema['print_node_conf'] = array(
+ 'description' => 'Printer-friendly version node-specific configuration settings',
'fields' => array(
'nid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
+ 'description' => 'The {node}.nid of the node.',
),
'link' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
- 'default' => '1',
+ 'default' => 1,
'size' => 'tiny',
+ 'description' => 'Show link',
),
'comments' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
- 'default' => '1',
+ 'default' => 1,
'size' => 'tiny',
+ 'description' => 'Show link in individual comments',
),
'url_list' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
- 'default' => '1',
+ 'default' => 1,
'size' => 'tiny',
+ 'description' => 'Show Printer-friendly URLs list',
),
),
'primary key' => array('nid'),
);
$schema['print_page_counter'] = array(
+ 'description' => 'Printer-friendly version access counter',
'fields' => array(
'path' => array(
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
+ 'description' => 'Page path',
),
'totalcount' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'size' => 'big',
+ 'description' => 'Number of page accesses',
),
'timestamp' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
+ 'description' => 'Last access',
),
),
'primary key' => array('path'),
return $schema;
}
+
+/**
+ * Remove hardcoded numeric deltas from all blocks
+ */
+function print_update_7000(&$sandbox) {
+ $renamed_deltas = array(
+ 'print' => array(
+ '0' => 'print-links',
+ '1' => 'print-top',
+ ),
+ );
+
+ update_fix_d7_block_deltas($sandbox, $renamed_deltas, array());
+}