$smarty->assign_by_ref('cant_pages', $cant_pages);
$smarty->assign('actual_page', 1 + $offset / $maxRecords);
if ($channels["cant"] > $offset + $maxRecords) {
    $smarty->assign('next_offset', $offset + $maxRecords);
} else {
    $smarty->assign('next_offset', -1);
}
// If offset is > 0 then prev_offset
if ($offset > 0) {
    $smarty->assign('prev_offset', $offset - $maxRecords);
} else {
    $smarty->assign('prev_offset', -1);
}
if ($prefs['poll_list_categories'] == 'y') {
    foreach ($channels['data'] as $key => $channel) {
        $channels['data'][$key]['categories'] = $polllib->get_poll_categories($channel['pollId']);
    }
}
if ($prefs['poll_list_objects'] == 'y') {
    foreach ($channels['data'] as $key => $channel) {
        $channels['data'][$key]['objects'] = $polllib->get_poll_objects($channel['pollId']);
    }
}
$smarty->assign_by_ref('channels', $channels["data"]);
$listPages = $tikilib->list_pageNames();
$smarty->assign_by_ref('listPages', $listPages['data']);
$cat_type = 'poll';
$cat_objid = $_REQUEST["pollId"];
include_once "categorize_list.php";
ask_ticket('admin-polls');
// disallow robots to index page: