modules/mongodb_watchdog/src/Controller/RequestController.php 1 location
|
@@ 219-236 (lines=18) @@
|
| 216 |
|
* @return int |
| 217 |
|
* The number of the page to display, starting at 0. |
| 218 |
|
*/ |
| 219 |
|
public function setupPager(Request $request, $uniqueId) { |
| 220 |
|
$count = $this->watchdog->requestEventsCount($uniqueId); |
| 221 |
|
$height = $this->itemsPerPage; |
| 222 |
|
pager_default_initialize($count, $height); |
| 223 |
|
|
| 224 |
|
$page = intval($request->query->get('page')); |
| 225 |
|
if ($page < 0) { |
| 226 |
|
$page = 0; |
| 227 |
|
} |
| 228 |
|
else { |
| 229 |
|
$page_max = intval(min(ceil($count / $height), PHP_INT_MAX) - 1); |
| 230 |
|
if ($page > $page_max) { |
| 231 |
|
$page = $page_max; |
| 232 |
|
} |
| 233 |
|
} |
| 234 |
|
|
| 235 |
|
return $page; |
| 236 |
|
} |
| 237 |
|
|
| 238 |
|
/** |
| 239 |
|
* Convert an absolute path to a relative one if below the site root. |
modules/mongodb_watchdog/src/Controller/DetailController.php 1 location
|
@@ 191-208 (lines=18) @@
|
| 188 |
|
* @return int |
| 189 |
|
* The number of the page to display, starting at 0. |
| 190 |
|
*/ |
| 191 |
|
public function setupPager(Request $request, EventTemplate $template) { |
| 192 |
|
$count = $this->watchdog->eventCount($template); |
| 193 |
|
$height = $this->itemsPerPage; |
| 194 |
|
pager_default_initialize($count, $height); |
| 195 |
|
|
| 196 |
|
$page = intval($request->query->get('page')); |
| 197 |
|
if ($page < 0) { |
| 198 |
|
$page = 0; |
| 199 |
|
} |
| 200 |
|
else { |
| 201 |
|
$page_max = intval(min(ceil($count / $height), PHP_INT_MAX) - 1); |
| 202 |
|
if ($page > $page_max) { |
| 203 |
|
$page = $page_max; |
| 204 |
|
} |
| 205 |
|
} |
| 206 |
|
|
| 207 |
|
return $page; |
| 208 |
|
} |
| 209 |
|
|
| 210 |
|
} |
| 211 |
|
|
modules/mongodb_watchdog/src/Controller/OverviewController.php 1 location
|
@@ 295-312 (lines=18) @@
|
| 292 |
|
* @return int |
| 293 |
|
* The number of the page to display, starting at 0. |
| 294 |
|
*/ |
| 295 |
|
public function setupPager(Request $request) { |
| 296 |
|
$count = $this->watchdog->templatesCount(); |
| 297 |
|
$height = $this->itemsPerPage; |
| 298 |
|
pager_default_initialize($count, $height); |
| 299 |
|
|
| 300 |
|
$page = intval($request->query->get('page')); |
| 301 |
|
if ($page < 0) { |
| 302 |
|
$page = 0; |
| 303 |
|
} |
| 304 |
|
else { |
| 305 |
|
$page_max = intval(min(ceil($count / $height), PHP_INT_MAX) - 1); |
| 306 |
|
if ($page > $page_max) { |
| 307 |
|
$page = $page_max; |
| 308 |
|
} |
| 309 |
|
} |
| 310 |
|
|
| 311 |
|
return $page; |
| 312 |
|
} |
| 313 |
|
|
| 314 |
|
} |
| 315 |
|
|