function print_pdf_block in Printer, email and PDF versions 5.4
Same name and namespace in other branches
- 6 print_pdf/print_pdf.module \print_pdf_block()
- 5.x print_pdf/print_pdf.module \print_pdf_block()
Implementation of hook_block().
File
- print_pdf/
print_pdf.module, line 94
Code
function print_pdf_block($op = 'list', $delta = 0, $edit = array()) {
switch ($op) {
case 'list':
$block[0]['info'] = t('Most PDFd');
return $block;
break;
case 'configure':
return '';
case 'save':
return;
case 'view':
switch ($delta) {
case 0:
$block['subject'] = t('Most PDFd');
$result = db_query_range("SELECT path FROM {print_pdf_page_counter} ORDER BY totalcount DESC", 0, 3);
if (db_affected_rows()) {
$block['content'] = '<div class="item-list"><ul>';
while ($obj = db_fetch_object($result)) {
$block['content'] .= '<li>' . l(_print_get_title($obj->path), $obj->path) . '</li>';
}
$block['content'] .= '</ul></div>';
}
break;
}
return $block;
break;
}
}