function setupPage($list, $action, $idfield, $valuefield) { global $token, $threadid, $TML; $pagination = setup_pagination($list); if (!empty($pagination)) { $page = array(); $page['pagination'] = $pagination['pagination']; $page['pagination_items'] = $pagination['pagination_items']; $page['params'] = array('thread' => $threadid, 'token' => $token); $TML->assign('pagination', generate_pagination($page['pagination'])); } $out = array(); if (!empty($page['pagination_items'])) { foreach ($page['pagination_items'] as $v) { $page['params']['nextoperatorid'] = $v[$idfield]; $params = array('servlet_root' => WEBIM_ROOT, 'servlet' => '/operator/redirect.php', 'path_vars' => $page['params']); $href = generate_get($params); $value = $v[$valuefield]; $out[] = '<li><a href="' . $href . '" title="' . $value . '">' . $value . '</a></li>'; } } return $out; }
function smarty_function_add_params($params, &$smarty) { return generate_get($params); }