function Pagination::getSettings in Pagination (Node) 6
Same name and namespace in other branches
- 7 includes/Pagination.inc \Pagination::getSettings()
@desc Private method to get pagination settings by content type
Parameters
string pagination setting: @param string node type @return array pagination settings @private
2 calls to Pagination::getSettings()
- Pagination::getStyle in ./
pagination.module - @desc Get pagination style
- Pagination::getValue in ./
pagination.module - @desc Get pagination value
File
- ./
pagination.module, line 692 - pagination.module @desc Allow for arbitrary nodes to be paginated. administrators can set which nodes they wish to paginate, and the length of content required to split a node into pages. Alternatively, content creators can set manual break points…
Class
- Pagination
- @desc Handles all the pagination logic
Code
function getSettings($setting, $type) {
static $pagination = [];
if (!isset($pagination[$type])) {
$query = "SELECT paginate, style FROM {pagination} WHERE type = '%s'";
$result = db_query($query, $type);
$get = db_fetch_object($result);
$pagination[$type] = array(
'style' => isset($get->style) ? $get->style : 0,
'value' => isset($get->paginate) ? $get->paginate : 0,
);
}
$result = isset($pagination[$type][$setting]) ? $pagination[$type][$setting] : 0;
return $result;
}