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: App::uses('ViewUtilHelper', 'ExtendedScaffold.View/Helper');
 4: App::uses('ExtendedField', 'ExtendedScaffold.Lib');
 5: 
 6: class ListFieldSetHelper extends AppHelper {
 7: 
 8:     public $helpers = array(
 9:         'ExtendedScaffold.Lists',
10:         'Base.CakeLayers',
11:     );
12: 
13:     public function fieldSet(\FieldSetDefinition $fieldSet, $scaffoldVars, $options) {
14:         if (!$fieldSet->getListAssociation()) {
15:             throw new Exception('$fieldSet->getListAssociation() is empty: '.print_r($fieldSet->getOptions(), true));
16:         }
17:         $b = '';
18:         if ($fieldSet->getLabel()) {
19:             $b .= "<h3>{$fieldSet->getLabel()}</h3>";
20:         }
21:         $b .= $this->Lists->rowsTable(
22:                 $this->_fields($fieldSet)
23:                 , $this->_rows($scaffoldVars, $fieldSet->getListAssociation())
24:                 , Hash::merge($this->settings, array(
25:                     'model' => $this->_model($scaffoldVars, $fieldSet->getListAssociation())
26:                     , 'showActions' => false
27:                     , 'controller' => $this->_controller($scaffoldVars, $fieldSet->getListAssociation())
28:                 ))
29:         );
30: 
31:         return $b;
32:     }
33: 
34:     private function _fields(\FieldSetDefinition $fieldSet) {
35:         $ret = array();
36:         foreach ($fieldSet->getLines() as $line) {
37:             foreach($line->getFields() as $field) {
38:                 $ret[$field->getName()] = $field->getOptions();
39:             }
40:         }
41:         return $ret;
42:     }
43: 
44:     private function _rows($scaffoldVars, $listAssociation) {
45:         return ModelTraverser::value(
46:                         $this->CakeLayers->getModel($scaffoldVars['modelClass'])
47:                         , $scaffoldVars['instance']
48:                         , $listAssociation
49:         );
50:     }
51: 
52:     private function _model($scaffoldVars, $listAssociation) {
53:         return $this->CakeLayers->modelAssociationModel(
54:                         $scaffoldVars['modelClass']
55:                         , $listAssociation
56:                         , true
57:         );
58:     }
59: 
60:     private function _controller($scaffoldVars, $listAssociation) {
61:         $controller = $this->CakeLayers->getController(
62:                 Inflector::pluralize($this->_model($scaffoldVars, $listAssociation)->name), false
63:         );
64:         if ($controller) {
65:             return $controller->name;
66:         } else {
67:             return null;
68:         }
69:     }
70: 
71: }
72: 
API documentation generated by ApiGen 2.8.0