MCPcopy Index your code
hub / github.com/TruthHun/BookStack / getHeader

Function getHeader

utils/pager.go:254–272  ·  view source on GitHub ↗

** * 头部 */

(po *PageOptions, totalpages int)

Source from the content-addressed store, hash-verified

252 * 头部
253 */
254func getHeader(po *PageOptions, totalpages int) string {
255 var rs string = "<ul class=\"pagination\">"
256
257 if po.EnableFirstLastLink { //当首页,尾页都设定的时候,就显示
258 if po.CurrentPage == 1 {
259 rs += "<li" + judgeDisable(po, totalpages, 0) + " class=\"disabled\"><a href=\"###\">" + po.FirstPageText + "</a></li>"
260 } else {
261 rs += "<li" + judgeDisable(po, totalpages, 0) + " ><a href='" + po.Href + "&" + po.ParamName + "=" + con.Itoa(1) + "'>" + po.FirstPageText + "</a></li>"
262 }
263 }
264 if po.EnablePreNexLink { // disabled=\"disabled\"
265 var a int = po.CurrentPage - 1
266 if po.CurrentPage == 1 {
267 a = 1
268 }
269 rs += "<li" + judgeDisable(po, totalpages, 0) + " ><a href='" + po.Href + "&" + po.ParamName + "=" + con.Itoa(a) + "'>" + po.PrePageText + "</a></li>"
270 }
271 return rs
272}
273
274/**
275 * 尾部

Callers 4

fun4Function · 0.85
fun3Function · 0.85
fun2Function · 0.85
fun1Function · 0.85

Calls 1

judgeDisableFunction · 0.85

Tested by

no test coverage detected