You are here

function _custom_pagers_visibility in Custom Pagers 5

Same name and namespace in other branches
  1. 6 custom_pagers.module \_custom_pagers_visibility()
  2. 7 custom_pagers.module \_custom_pagers_visibility()
2 calls to _custom_pagers_visibility()
custom_pagers_block in ./custom_pagers.module
Implementation of hook_block().
custom_pagers_nodeapi in ./custom_pagers.module

File

./custom_pagers.module, line 391

Code

function _custom_pagers_visibility($pager, $node) {
  $visible = FALSE;
  if (!empty($pager->visibility_php)) {

    // Use PHP code to generate the list.
    ob_start();
    $result = eval(trim($pager->visibility_php));
    $visible = $result == TRUE;
    ob_end_clean();
  }
  elseif (!empty($pager->node_type)) {
    $visible = strpos($pager->node_type, $node->type) !== FALSE;
  }
  return $visible;
}