Overview

Namespaces

  • Cron
  • None

Classes

  • _HtmlGrid_TableOut
  • _TransactionModel_RawSaveOperation
  • AccessControlComponent
  • AccessControlHelper
  • ActionListHelper
  • ActiveDirectoryUtils
  • AddCurrentPidToSchedulingShellCallLogs
  • AnonymousFunctionOperation
  • ArrayUtil
  • AssociationIntegrityBehavior
  • AtomicOperation
  • AuthenticationComponent
  • AuthenticationController
  • AuthenticationUser
  • AutocompleteDatasourceComponent
  • BaseModelComponent
  • Basics
  • CakeLayersHelper
  • CheckAndRunShell
  • ClassSearcher
  • CommandLineUtil
  • CommonValidationBehavior
  • ConfigurableShellCallsSchedulingTask
  • ConfigurationKey
  • ConfigurationKeys
  • ConfigurationKeysController
  • Context
  • ContextComponent
  • ContextHelper
  • Contexts
  • ControllerInspector
  • ControllerMenuHelper
  • CreateJournalingTables
  • CreateTableConfigurationKeys
  • CreateTableSchedulingConfigurableShellCalls
  • CreateTableSchedulingShellCallLogs
  • CreateTableSettedConfigurationKeys
  • CreateTableUserResetPasswordRequests
  • CreateTableUsers
  • CronSchedulingInstaller
  • CronValidationBehavior
  • CssBox
  • CssController
  • CssProperties
  • CssShell
  • CsvUtil
  • CustomDataModel
  • DatasourceDumperManager
  • DateTimeInput
  • DependencyShell
  • DetailHelper
  • DumperShell
  • ExtendedFieldsAccessControl
  • ExtendedFieldSet
  • ExtendedFieldSetHelper
  • ExtendedFieldsParser
  • ExtendedFormHelper
  • ExtendedHasManyAppModel
  • ExtendedOperationsBehavior
  • FieldDefinition
  • FieldRowDefinition
  • FieldSetDefinition
  • FieldSetLayoutHelper
  • FileOperations
  • FileOperations_Rename
  • FileOperations_SymLink
  • FileOperations_Touch
  • FileOperations_Unlink
  • FileSystem
  • FixConfigurationKeysPrimaryKey
  • FixSettedConfigurationKeysPrimaryKey
  • HasManyUtilsBehavior
  • HtmlDocument
  • HtmlGrid
  • HtmlGrid_Cell
  • HttpClient
  • HttpResponse
  • ImapClient
  • ImapMailBox
  • ImapParserShell
  • IncludePath
  • InputMasked
  • InputSearchable
  • InputsOnSubmit
  • InstallShell
  • JenkinsBuildShell
  • Journal
  • JournalDetail
  • JournalizedBehavior
  • JsonResponseComponent
  • LayoutsHelper
  • Ldap
  • LdapUtils
  • ListFieldSet
  • ListFieldSetHelper
  • ListsHelper
  • MailParser
  • Make
  • MenuHelper
  • MigrationAllPluginsShell
  • ModelOperations
  • ModelOperations_Delete
  • ModelOperations_Save
  • ModelTraverser
  • MysqlDumper
  • OpenLdapUtils
  • PaginatorUtilComponent
  • PaginatorUtilComponentFilter
  • PaginatorUtilHelper
  • Plugin
  • PluginManager
  • Reflections
  • RenameEnabledToActiveFromUsersTable
  • RunShellCallShell
  • ScaffoldUtilComponent
  • ScaffoldUtilHelper
  • Scheduling
  • SchedulingConfigurableShellCall
  • SchedulingConfigurableShellCallsController
  • SchedulingShellCallLog
  • SchedulingShellCallLogsController
  • SettedConfigurationKey
  • StuffreposPluginsRename
  • TimeZoneBehavior
  • TransactionModel
  • TransactionOperation
  • Translator
  • TranslatorShell
  • User
  • UserAuthenticationComponent
  • UserChangePassword
  • UserResetPassword
  • UserResetPasswordRequest
  • UserResetPasswordRequestSubmission
  • UsersController
  • ViewUtilHelper

Interfaces

  • AccessControlFilter
  • CommitableOperation
  • DatasourceDumper
  • MakeListener
  • SchedulingInstaller
  • TasksObject
  • UndoableOperation

Exceptions

  • LdapObjectNotWritableException
  • ModelTraverserException
  • Overview
  • Namespace
  • Class
  • Tree
 1: <?php
 2: 
 3: /*
 4:  * Copyright 2010 Eduardo H. Bogoni <eduardobogoni@gmail.com>
 5:  *
 6:  * This file is part of CakePHP Bog Util.
 7:  *
 8:  * CakePHP Bog Util is free software: you can redistribute it and/or modify
 9:  * it under the terms of the GNU General Public License as published by the Free
10:  * Software Foundation, either version 3 of the License, or (at your option) any
11:  * later version.
12:  *
13:  * CakePHP Bog Util is distributed in the hope that it will be useful, but
14:  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15:  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
16:  * details.
17:  * 
18:  * You should have received a copy of the GNU General Public License along with
19:  * CakePHP Bog Util. If not, see http://www.gnu.org/licenses/.
20:  */
21: 
22: class PaginatorUtilHelper extends AppHelper {
23: 
24:     public $helpers = array('Html', 'Base.ExtendedForm');
25: 
26:     public function filterForm() {
27: 
28:         if (!empty($this->params['paginatorUtil']['filterFields'])) {
29:             $submitOptions = array('type' => 'get', 'url' => $this->_updateUrl());
30: 
31:             $buffer = "<div class='filterForm'>";
32:             $buffer .= $this->ExtendedForm->create(null, $submitOptions);
33:             $buffer .= "<fieldset><legend>Filter</legend>";
34:             foreach ($this->params['paginatorUtil']['filterFields'] as $key => $options) {
35:                 $buffer .= $this->ExtendedForm->input(Inflector::slug($key), array_merge(
36:                                         $options, array('label' => $key)
37:                                 ));
38:             }
39: 
40:             $buffer .= $this->ExtendedForm->submit(__d('base','Filter', true), array('name' => '_update'));
41:             $buffer .= $this->ExtendedForm->submit(__d('base','Show All', true), array('name' => '_clear'));
42:             $buffer .= "</fieldset>";
43:             $buffer .= $this->ExtendedForm->end();
44:             $buffer .= "</div>";
45: 
46:             return $buffer;
47:         } else {
48:             return '';
49:         }
50:     }
51:     
52:     private function _updateUrl() {
53:             $url = Router::parse($this->request->url); 
54:             $named = empty($url['named']) ? array() : $url['named'];
55:             $url += $named;
56:             unset($url['named']);            
57:             $url['page'] = 1;            
58:             return Router::url($url, true) . '?_update=true';
59:     }
60: 
61:     public function link($label, $parameters, $linkOptions = array()) {
62:         $linkParameters = array();
63:         foreach ($this->params['paginatorUtil']['filterFields'] as $key => $options) {
64:             $value = isset($parameters[$key]) ? $parameters[$key] : $options['value'];
65:             if ($value) {
66:                 $linkParameters[$key] = $value;
67:             }
68:         }
69: 
70:         $linkParameters['_update'] = 'true';
71:         $pairLinkParameters = array();
72: 
73:         foreach ($linkParameters as $key => $value) {
74:             $pairLinkParameters[] = "$key=$value";
75:         }
76: 
77:         return $this->Html->link($label, '?' . implode('&', $pairLinkParameters), $linkOptions);
78:     }
79: 
80: }
81: 
82: ?>
API documentation generated by ApiGen 2.8.0