Commit 1d15b615 authored by jcnventura's avatar jcnventura

Use textual block deltas

parent befeb815
......@@ -161,8 +161,8 @@ function print_schema() {
function print_update_7000(&$sandbox) {
$renamed_deltas = array(
'print' => array(
'0' => 'print links',
'1' => 'print top',
'0' => 'print-links',
'1' => 'print-top',
),
);
......
......@@ -228,10 +228,10 @@ function print_menu() {
* Implements hook_block_info().
*/
function print_block_info() {
$block[0]['info'] = t('Printer, e-mail and PDF versions');
$block[0]['cache'] = DRUPAL_CACHE_PER_PAGE;
$block[1]['info'] = t('Most printed');
$block[1]['cache'] = DRUPAL_CACHE_GLOBAL;
$block['print-links']['info'] = t('Printer, e-mail and PDF versions');
$block['print-links']['cache'] = DRUPAL_CACHE_PER_PAGE;
$block['print-top']['info'] = t('Most printed');
$block['print-top']['cache'] = DRUPAL_CACHE_GLOBAL;
return $block;
}
......@@ -240,7 +240,7 @@ function print_block_info() {
*/
function print_block_view($delta = '') {
switch ($delta) {
case 0:
case 'print-links':
$nid = preg_replace('!^node/!', '', $_GET['q']);
if (is_numeric($nid)) {
$node = node_load($nid);
......@@ -259,7 +259,7 @@ function print_block_view($delta = '') {
}
}
break;
case 1:
case 'print-top':
$block['subject'] = t('Most printed');
$result = db_query_range("SELECT path FROM {print_page_counter} ORDER BY totalcount DESC", 0, 3)
->fetchAll();
......@@ -639,10 +639,10 @@ function _print_format_link_aux($type = 0, $text = '', $img = '') {
$html = TRUE;
switch ($type) {
case 2:
$text = theme('image', $img, $text, $text, array('class' => 'print-icon'));
$text = theme('image', array('path' => $img, 'alt' => $text, 'title' => $text, 'attributes' => array('class' => 'print-icon')));
break;
case 3:
$text = theme('image', $img, $text, $text, array('class' => 'print-icon print-icon-margin')) . $text;
$text = theme('image', array('path' => $img, 'alt' => $text, 'title' => $text, 'attributes' => array('class' => 'print-icon print-icon-margin'))) . $text;
break;
}
}
......
......@@ -147,7 +147,7 @@ function print_mail_schema() {
function print_mail_update_7000(&$sandbox) {
$renamed_deltas = array(
'print_mail' => array(
'0' => 'print_mail top',
'0' => 'print_mail-top',
),
);
......
......@@ -103,8 +103,8 @@ function print_mail_menu() {
* Implements hook_block_info().
*/
function print_mail_block_info() {
$block[0]['info'] = t('Most emailed');
$block[0]['cache'] = DRUPAL_CACHE_GLOBAL;
$block['print_mail-top']['info'] = t('Most emailed');
$block['print_mail-top']['cache'] = DRUPAL_CACHE_GLOBAL;
return $block;
}
......@@ -113,7 +113,7 @@ function print_mail_block_info() {
*/
function print_mail_block_view($delta = 0) {
switch ($delta) {
case 0:
case 'print_mail-top':
$block['subject'] = t('Most emailed');
$result = db_query_range("SELECT path FROM {print_mail_page_counter} ORDER BY sentcount DESC", 0, 3)
->fetchAll();
......
......@@ -134,7 +134,7 @@ function print_pdf_schema() {
function print_pdf_update_7000(&$sandbox) {
$renamed_deltas = array(
'print_pdf' => array(
'0' => 'print_pdf top',
'0' => 'print_pdf-top',
),
);
......
......@@ -31,7 +31,7 @@ define('PRINT_PDF_PAGE_ORIENTATION_DEFAULT', 'portrait');
define('PRINT_PDF_AUTOCONFIG_DEFAULT', 1);
define('PRINT_PDF_FONT_FAMILY_DEFAULT', 'dejavusans');
define('PRINT_PDF_FONT_SIZE_DEFAULT', 10);
define('PRINT_PDF_FILENAME_DEFAULT', '[site:name] - [node:title] - [date:custom:Y-m-d]');
define('PRINT_PDF_FILENAME_DEFAULT', '[site:name] - [node:title] - [node:changed]');
define('PRINT_PDF_DOMPDF_UNICODE_DEFAULT', 0);
define('PRINT_PDF_WKHTMLTOPDF_OPTIONS', "--footer-font-size 7 --footer-right '[page]'");
......@@ -129,8 +129,8 @@ function print_pdf_menu() {
* Implements hook_block_info().
*/
function print_pdf_block_info() {
$block[0]['info'] = t('Most PDFd');
$block[0]['cache'] = DRUPAL_CACHE_GLOBAL;
$block['print_pdf-top']['info'] = t('Most PDFd');
$block['print_pdf-top']['cache'] = DRUPAL_CACHE_GLOBAL;
return $block;
}
......@@ -139,7 +139,7 @@ function print_pdf_block_info() {
*/
function print_pdf_block_view($delta = 0) {
switch ($delta) {
case 0:
case 'print_pdf-top':
$block['subject'] = t('Most PDFd');
$result = db_query_range("SELECT path FROM {print_pdf_page_counter} ORDER BY totalcount DESC", 0, 3)
->fetchAll();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment