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: 
 5: class ExtendedFieldSetHelper extends AppHelper {
 6: 
 7:     public $helpers = array(
 8:         'Base.CakeLayers',
 9:         'ExtendedScaffold.FieldSetLayout',
10:         'ExtendedScaffold.ViewUtil',
11:     );
12: 
13:     public function fieldSet(\FieldSetDefinition $fieldSet, $scaffoldVars) {
14:         $b = '';
15:         if ($fieldSet->getLabel()) {
16:             $b .= "<h3>{$fieldSet->getLabel()}</h3>";
17:         }
18:         return $b . $this->FieldSetLayout->fieldSet($this->_lines($fieldSet, $scaffoldVars));
19:     }
20: 
21:     private function _lines(\FieldSetDefinition $fieldSet, $scaffoldVars) {
22:         $lines = array();
23:         foreach ($fieldSet->getLines() as $fieldsLine) {
24:             $fieldsLineResult = $this->_line($fieldsLine, $scaffoldVars);
25:             if (!empty($fieldsLineResult)) {
26:                 $lines[] = $fieldsLineResult;
27:             }
28:         }
29:         return $lines;
30:     }
31: 
32:     private function _line(\FieldRowDefinition $line, $scaffoldVars) {
33:         $ret = array();
34:         foreach ($line->getFields() as $field) {
35:             $ret[$this->_fieldLabel($field)] = $this->_fieldValue(
36:                     $field, $scaffoldVars);
37:         }
38:         return $ret;
39:     }
40: 
41:     private function _fieldLabel($field) {
42:         return __d('extended_scaffold', Inflector::humanize($field->getName()));
43:     }
44: 
45:     private function _fieldValue(\FieldDefinition $field, $scaffoldVars) {
46:         if ($field->getValueFunction()) {
47:             return call_user_func(
48:                     $field->getValueFunction()
49:                     , $this->CakeLayers->getCurrentView()
50:                     , $scaffoldVars['instance'][ClassRegistry::init($scaffoldVars['modelClass'])->alias]
51:                     , $field
52:             );
53:         }
54:         return $this->ViewUtil->autoFormat(
55:                         ModelTraverser::displayValue(
56:                                 $this->_model($scaffoldVars)
57:                                 , $scaffoldVars['instance']
58:                                 , $field->getName()
59:                         )
60:         );
61:     }
62: 
63:     private function _model($scaffoldVars) {
64:         if (empty($scaffoldVars['modelClass'])) {
65:             return $this->CakeLayers->getControllerDefaultModelClass();
66:         } else {
67:             return ClassRegistry::init($scaffoldVars['modelClass']);
68:         }
69:     }
70: 
71: }
72: 
API documentation generated by ApiGen 2.8.0