-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Benn Oshrin
committed
Jun 23, 2019
1 parent
10c593c
commit 77eebad
Showing
11 changed files
with
294 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,109 @@ | ||
| <?php | ||
| /** | ||
| * COmanage Common Pagination Element | ||
| * | ||
| * Portions licensed to the University Corporation for Advanced Internet | ||
| * Development, Inc. ("UCAID") under one or more contributor license agreements. | ||
| * See the NOTICE file distributed with this work for additional information | ||
| * regarding copyright ownership. | ||
| * | ||
| * UCAID licenses this file to you under the Apache License, Version 2.0 | ||
| * (the "License"); you may not use this file except in compliance with the | ||
| * License. You may obtain a copy of the License at: | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| * | ||
| * @link http://www.internet2.edu/comanage COmanage Project | ||
| * @package common | ||
| * @since COmanage Common v1.0.0 | ||
| * @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) | ||
| */ | ||
|
|
||
| /** | ||
| * THIS FILE IS MASTERED IN THE COMMON REPOSITORY. | ||
| */ | ||
|
|
||
| // Which product are we? | ||
| $product = __('product.code'); | ||
| ?> | ||
|
|
||
| <div id="pagination"> | ||
| <span class="paginationCounter"> | ||
| <?= $this->Paginator->counter(['format' => __($product.'.in.pagination.format')]); ?> | ||
| </span> | ||
| <?php if($this->paginator->hasPage(2)): ?> | ||
| <span class="paginationFirst"> | ||
| <?= $this->Paginator->first(__($product.'.op.first')); ?> | ||
| </span> | ||
| <span class="paginationPrev"> | ||
| <?= $this->Paginator->prev(__($product.'.op.previous'), ['class' => 'disabled']); ?> | ||
| </span> | ||
| <span class="paginationNumbers"> | ||
| <?= $this->Paginator->numbers(); ?> | ||
| </span> | ||
| <span class="paginationNext"> | ||
| <?= $this->Paginator->next(__($product.'.op.next'), ['class' => 'disabled']); ?> | ||
| </span> | ||
| <span class="paginationLast"> | ||
| <?= $this->Paginator->last(__($product.'.op.last')); ?> | ||
| </span> | ||
| <?php endif; ?> | ||
|
|
||
| <?php if($this->paginator->hasPage(2)): ?> | ||
| <!-- show the Goto page form if there is more than 1 page --> | ||
| <form id="goto-page" | ||
| class="pagination-form" | ||
| method="get" | ||
| onsubmit="gotoPage(this.pageNum.value, | ||
| <?= $this->Paginator->counter('{{pages}}');?>, | ||
| '<?= __($product.'.er.pagenum.nan');?>', | ||
| '<?= __($product.'.er.pagenum.exceeded', [$this->Paginator->counter('{{pages}}')]);?>'); | ||
| return false;"> | ||
| <label for="pageNum"><?= __($product.'.op.page.goto'); ?></label> | ||
| <input type="text" size="3" name="pageNum" id="pageNum"/> | ||
| <input type="submit" value="<?= __($product.'.op.go'); ?>"/> | ||
| </form> | ||
| <?php endif; ?> | ||
|
|
||
| <?php | ||
| if($this->Paginator->counter('{{pages}}') > 25) { | ||
| // Provide a form for setting the page limit. | ||
| // Default is 25 records, current maximum is 100. | ||
| // For now we will simply hard-code the options from 25 - 100. | ||
|
|
||
| print $this->Form->create(null, [ 'type' => 'get' ]); | ||
|
|
||
| // This is similar to Paginator->limitControl, but we have to manually | ||
| // re-insert query params that we want to maintain through the limit adjustment | ||
|
|
||
| $queryParams = ['page', 'sort', 'direct']; | ||
|
|
||
| if(!empty($vv_primary_link)) { | ||
| $queryParams[] = $vv_primary_link; | ||
| } | ||
|
|
||
| foreach($queryParams as $p) { | ||
| if(!empty($this->request->getQuery($p))) { | ||
| print $this->Form->hidden($p, ['default' => $this->request->getQuery($p)]); | ||
| } | ||
| } | ||
|
|
||
| print $this->Form->control('limit', [ | ||
| 'type' => 'select', | ||
| 'label' => __($product.'.op.page.display'), | ||
| 'value' => $this->request->getQuery('limit'), | ||
| 'options' => [25 => 25, 50 => 50, 100 => 100], | ||
| 'onChange' => 'this.form.submit()' | ||
| ]); | ||
|
|
||
| print $this->Form->end(); | ||
| } | ||
| ?> | ||
| </div> | ||
|
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.