Code Duplication    Length = 11-11 lines in 2 locations

framework/Web/UI/WebControls/TDataGrid.php 1 location

@@ 1290-1300 (lines=11) @@
1287
		$buttonCount = $maxButtonCount > $pageCount ? $pageCount : $maxButtonCount;
1288
		$startPageIndex = 1;
1289
		$endPageIndex = $buttonCount;
1290
		if ($pageIndex > $endPageIndex) {
1291
			$startPageIndex = ((int) (($pageIndex - 1) / $maxButtonCount)) * $maxButtonCount + 1;
1292
			if (($endPageIndex = $startPageIndex + $maxButtonCount - 1) > $pageCount) {
1293
				$endPageIndex = $pageCount;
1294
			}
1295
			if ($endPageIndex - $startPageIndex + 1 < $maxButtonCount) {
1296
				if (($startPageIndex = $endPageIndex - $maxButtonCount + 1) < 1) {
1297
					$startPageIndex = 1;
1298
				}
1299
			}
1300
		}
1301
1302
		if ($startPageIndex > 1) {
1303
			if (($text = $style->getFirstPageText()) !== '') {

framework/Web/UI/WebControls/TPager.php 1 location

@@ 570-580 (lines=11) @@
567
		$buttonCount = $maxButtonCount > $pageCount ? $pageCount : $maxButtonCount;
568
		$startPageIndex = 1;
569
		$endPageIndex = $buttonCount;
570
		if ($pageIndex > $endPageIndex) {
571
			$startPageIndex = ((int) (($pageIndex - 1) / $maxButtonCount)) * $maxButtonCount + 1;
572
			if (($endPageIndex = $startPageIndex + $maxButtonCount - 1) > $pageCount) {
573
				$endPageIndex = $pageCount;
574
			}
575
			if ($endPageIndex - $startPageIndex + 1 < $maxButtonCount) {
576
				if (($startPageIndex = $endPageIndex - $maxButtonCount + 1) < 1) {
577
					$startPageIndex = 1;
578
				}
579
			}
580
		}
581
582
		if ($startPageIndex > 1) {
583
			if (($text = $this->getFirstPageText()) !== '') {