class views_pdf_handler_page_break in Views PDF 6
Same name and namespace in other branches
- 7.3 field_plugins/views_pdf_handler_page_break.inc \views_pdf_handler_page_break
- 7 field_plugins/views_pdf_handler_page_break.inc \views_pdf_handler_page_break
- 7.2 handlers/views_pdf_handler_page_break.inc \views_pdf_handler_page_break
Plugin class that holds the functionality for the page break in a PDF display.
Hierarchy
- class \views_pdf_handler_page_break extends \views_handler_field
Expanded class hierarchy of views_pdf_handler_page_break
1 string reference to 'views_pdf_handler_page_break'
- views_pdf_views_data in ./
views_pdf.views.inc - Implementation of hook_views_data()
File
- field_plugins/
views_pdf_handler_page_break.inc, line 16 - The page break plugin for PDF page display.
View source
class views_pdf_handler_page_break extends views_handler_field {
/**
* This method is used to query data. In our case
* we want that no data is queried.
*
*/
function query() {
// Override parent::query() and don't alter query.
$this->field_alias = 'pdf_page_break_' . $this->position;
}
/**
* This method contains the defintion of the options for the page
* break.
*
*/
function option_definition() {
$options = parent::option_definition();
$options['last_row'] = array(
'default' => FALSE,
);
return $options;
}
/**
* Option form
*/
function options_form(&$form, &$form_state) {
parent::options_form($form, $form_state);
$form['last_row'] = array(
'#type' => 'checkbox',
'#title' => t('Exclude from last row'),
'#default_value' => $this->options['last_row'],
'#description' => t('Check this box to not add new page on last row.'),
);
}
/**
* This method renders the page break. It uses the PDF class to
* add a page break.
*/
function render($values) {
if (isset($this->view->pdf) && is_object($this->view->pdf)) {
if ($this->options['last_row'] == TRUE && $this->countRecords + 1 >= $this->view->numberOfRecords) {
return '';
}
$this->countRecords++;
$this->view->pdf
->addPage();
return '';
}
}
/**
* We dont want to use advanced rendering.
*/
function allow_advanced_render() {
return FALSE;
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
views_pdf_handler_page_break:: |
function | We dont want to use advanced rendering. | ||
views_pdf_handler_page_break:: |
function | Option form | ||
views_pdf_handler_page_break:: |
function | This method contains the defintion of the options for the page break. | ||
views_pdf_handler_page_break:: |
function | This method is used to query data. In our case we want that no data is queried. | ||
views_pdf_handler_page_break:: |
function | This method renders the page break. It uses the PDF class to add a page break. |