Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
33 lines (28 sloc) 965 Bytes
<?php
$app->get("/librarians", function() use($app){
return $app->render("librarians", array(
"librarians" => $app->get_users_by_group("librarian")
, "developers" => $app->get_users_by_group("admin")
));
});
$app->get("/librarians/issues", function() use($app){
$app->redirect("/librarians/issues/0");
});
$app->get("/librarians/issues/:page", function($page) use($app){
if( !$app->is("librarian") && !$app->is("admin") )
return $app->notFound();
$results_per_page = 24;
$total = $app->num_reported_clipart();
$start = $page * $results_per_page;
$cliparts = $app->get_reported_clipart($page, $results_per_page);
if(sizeof($cliparts) === 0) return $app->notFound();
return $app->render("clipart/list", array(
"cliparts" => $cliparts
, "title" => "Clipart with issues"
, 'pagination' => array(
'pages' => round( $total / $results_per_page, 0, PHP_ROUND_HALF_UP) - 1
, 'current' => $page
)
));
});
?>