From 80ca5d9bd3570c24a9a433b53bd7c04f7e5c29ba Mon Sep 17 00:00:00 2001 From: Arlen Johnson Date: Wed, 11 Feb 2026 13:19:36 -0500 Subject: [PATCH] Simplify $subnav declaration (CFM-291) --- .../templates/ApiSourceEndpoints/fields.inc | 3 +- .../templates/ApiSources/fields.inc | 3 +- .../templates/FileProvisioners/fields.inc | 3 +- .../templates/FileSources/fields.inc | 3 +- .../templates/KerberosServers/fields.inc | 3 +- .../PasswordAuthenticators/fields.inc | 3 +- .../templates/SqlProvisioners/fields.inc | 3 +- .../templates/SqlSources/fields.inc | 3 +- .../templates/MatchCallbacks/fields.inc | 3 +- .../templates/FormatAssigners/fields.inc | 3 +- .../templates/SqlAssigners/fields.inc | 3 +- .../templates/ApprovalCollectors/fields.inc | 3 +- .../templates/AttributeCollectors/fields.inc | 3 +- .../BasicAttributeCollectors/fields.inc | 3 +- .../templates/EmailVerifiers/fields.inc | 3 +- .../EnrollmentAttributes/columns.inc | 3 +- .../templates/EnrollmentAttributes/fields.inc | 3 +- .../templates/IdentifierCollectors/fields.inc | 3 +- .../templates/InvitationAccepters/fields.inc | 3 +- .../templates/HttpServers/fields.inc | 3 +- .../MatchServerAttributes/columns.inc | 3 +- .../MatchServerAttributes/fields.inc | 3 +- .../templates/MatchServers/fields.inc | 3 +- .../templates/Oauth2Servers/fields.inc | 3 +- .../templates/SmtpServers/fields.inc | 3 +- .../templates/SqlServers/fields.inc | 3 +- .../templates/EnvSourceCollectors/fields.inc | 3 +- .../EnvSource/templates/EnvSources/fields.inc | 3 +- .../OrcidSourceCollectors/fields.inc | 3 +- .../templates/OrcidSources/fields.inc | 3 +- .../templates/SshKeyAuthenticators/fields.inc | 3 +- .../templates/AgreementCollectors/fields.inc | 3 +- app/templates/Servers/fields.inc | 3 +- app/templates/Standard/subnavigation.inc | 29 ++++++++++--------- 34 files changed, 48 insertions(+), 80 deletions(-) diff --git a/app/availableplugins/ApiConnector/templates/ApiSourceEndpoints/fields.inc b/app/availableplugins/ApiConnector/templates/ApiSourceEndpoints/fields.inc index 64fd79507..e3b79cfa3 100644 --- a/app/availableplugins/ApiConnector/templates/ApiSourceEndpoints/fields.inc +++ b/app/availableplugins/ApiConnector/templates/ApiSourceEndpoints/fields.inc @@ -39,8 +39,7 @@ $fields = [ 'external_identity_source_id' ]; -$subnav = 'local'; -$subnavLocal = [ +$subnav = [ 'tabs' => ['Apis', 'ApiConnector.ApiSourceEndpoints'], 'action' => [ 'Apis' => ['edit'], diff --git a/app/availableplugins/ApiConnector/templates/ApiSources/fields.inc b/app/availableplugins/ApiConnector/templates/ApiSources/fields.inc index 34c21dd7e..e3178098d 100644 --- a/app/availableplugins/ApiConnector/templates/ApiSources/fields.inc +++ b/app/availableplugins/ApiConnector/templates/ApiSources/fields.inc @@ -39,8 +39,7 @@ $fields = [ ] ]; -$subnav = 'local'; -$subnavLocal = [ +$subnav = [ 'tabs' => ['ExternalIdentitySources', 'ApiConnector.ApiSources', 'ExternalIdentitySources@action.search'], 'action' => [ 'ExternalIdentitySources' => ['edit', 'view', 'search'], diff --git a/app/availableplugins/FileConnector/templates/FileProvisioners/fields.inc b/app/availableplugins/FileConnector/templates/FileProvisioners/fields.inc index 0eb4a67e2..c5eb0f373 100644 --- a/app/availableplugins/FileConnector/templates/FileProvisioners/fields.inc +++ b/app/availableplugins/FileConnector/templates/FileProvisioners/fields.inc @@ -29,8 +29,7 @@ $fields = [ 'filename' ]; -$subnav = 'local'; -$subnavLocal = [ +$subnav = [ 'tabs' => ['ProvisioningTargets', 'FileConnector.FileProvisioners'], 'action' => [ 'ProvisioningTargets' => ['edit'], diff --git a/app/availableplugins/FileConnector/templates/FileSources/fields.inc b/app/availableplugins/FileConnector/templates/FileSources/fields.inc index ce401091b..a9f4af3de 100644 --- a/app/availableplugins/FileConnector/templates/FileSources/fields.inc +++ b/app/availableplugins/FileConnector/templates/FileSources/fields.inc @@ -33,8 +33,7 @@ $fields = [ 'threshold_override', ]; -$subnav = 'local'; -$subnavLocal = [ +$subnav = [ 'tabs' => ['ExternalIdentitySources', 'FileConnector.FileSources', 'ExternalIdentitySources@action.search'], 'action' => [ 'ExternalIdentitySources' => ['edit', 'view', 'search'], diff --git a/app/availableplugins/KerberosConnector/templates/KerberosServers/fields.inc b/app/availableplugins/KerberosConnector/templates/KerberosServers/fields.inc index 7f0c72f5d..8b9f5afbc 100644 --- a/app/availableplugins/KerberosConnector/templates/KerberosServers/fields.inc +++ b/app/availableplugins/KerberosConnector/templates/KerberosServers/fields.inc @@ -33,8 +33,7 @@ $fields = [ 'keytab_path' ]; -$subnav = 'local'; -$subnavLocal = [ +$subnav = [ 'tabs' => ['Servers', 'KerberosConnector.KerberosServers'], 'action' => [ 'Servers' => ['edit'], diff --git a/app/availableplugins/PasswordAuthenticator/templates/PasswordAuthenticators/fields.inc b/app/availableplugins/PasswordAuthenticator/templates/PasswordAuthenticators/fields.inc index a85f03dc0..59452354b 100644 --- a/app/availableplugins/PasswordAuthenticator/templates/PasswordAuthenticators/fields.inc +++ b/app/availableplugins/PasswordAuthenticator/templates/PasswordAuthenticators/fields.inc @@ -34,8 +34,7 @@ $fields = [ 'format_plaintext' ]; -$subnav = 'local'; -$subnavLocal = [ +$subnav = [ 'tabs' => ['Authenticators', 'PasswordAuthenticator.PasswordAuthenticators'], 'action' => [ 'Authenticators' => ['edit'], diff --git a/app/availableplugins/SqlConnector/templates/SqlProvisioners/fields.inc b/app/availableplugins/SqlConnector/templates/SqlProvisioners/fields.inc index bee4c5fdf..f82265102 100644 --- a/app/availableplugins/SqlConnector/templates/SqlProvisioners/fields.inc +++ b/app/availableplugins/SqlConnector/templates/SqlProvisioners/fields.inc @@ -32,8 +32,7 @@ $fields = [ ] ]; -$subnav = 'local'; -$subnavLocal = [ +$subnav = [ 'tabs' => ['ProvisioningTargets', 'SqlConnector.SqlProvisioners'], 'action' => [ 'ProvisioningTargets' => ['edit'], diff --git a/app/availableplugins/SqlConnector/templates/SqlSources/fields.inc b/app/availableplugins/SqlConnector/templates/SqlSources/fields.inc index 391958532..2081bf11b 100644 --- a/app/availableplugins/SqlConnector/templates/SqlSources/fields.inc +++ b/app/availableplugins/SqlConnector/templates/SqlSources/fields.inc @@ -52,8 +52,7 @@ $fields = array_merge($fields, [ 'threshold_override' ]); -$subnav = 'local'; -$subnavLocal = [ +$subnav = [ 'tabs' => ['ExternalIdentitySources', 'SqlConnector.SqlSources', 'ExternalIdentitySources@action.search'], 'action' => [ 'ExternalIdentitySources' => ['edit', 'view', 'search'], diff --git a/app/plugins/CoreApi/templates/MatchCallbacks/fields.inc b/app/plugins/CoreApi/templates/MatchCallbacks/fields.inc index fd37d1d2c..4f17564f4 100644 --- a/app/plugins/CoreApi/templates/MatchCallbacks/fields.inc +++ b/app/plugins/CoreApi/templates/MatchCallbacks/fields.inc @@ -38,8 +38,7 @@ $fields = [ 'server_id' ]; -$subnav = 'local'; -$subnavLocal = [ +$subnav = [ 'tabs' => ['Apis', 'CoreApi.MatchCallbacks'], 'action' => [ 'Apis' => ['edit'], diff --git a/app/plugins/CoreAssigner/templates/FormatAssigners/fields.inc b/app/plugins/CoreAssigner/templates/FormatAssigners/fields.inc index 31423f2ef..a4d041694 100644 --- a/app/plugins/CoreAssigner/templates/FormatAssigners/fields.inc +++ b/app/plugins/CoreAssigner/templates/FormatAssigners/fields.inc @@ -35,8 +35,7 @@ $fields = [ 'enable_transliteration' ]; -$subnav = 'local'; -$subnavLocal = [ +$subnav = [ 'tabs' => ['IdentifierAssignments', 'CoreAssigner.FormatAssigners'], 'action' => [ 'IdentifierAssignments' => ['edit'], diff --git a/app/plugins/CoreAssigner/templates/SqlAssigners/fields.inc b/app/plugins/CoreAssigner/templates/SqlAssigners/fields.inc index f86403983..3aec604fa 100644 --- a/app/plugins/CoreAssigner/templates/SqlAssigners/fields.inc +++ b/app/plugins/CoreAssigner/templates/SqlAssigners/fields.inc @@ -31,8 +31,7 @@ $fields = [ 'type_id' ]; -$subnav = 'local'; -$subnavLocal = [ +$subnav = [ 'tabs' => ['IdentifierAssignments', 'CoreAssigner.SqlAssigners'], 'action' => [ 'IdentifierAssignments' => ['edit'], diff --git a/app/plugins/CoreEnroller/templates/ApprovalCollectors/fields.inc b/app/plugins/CoreEnroller/templates/ApprovalCollectors/fields.inc index 31195a24d..c99e19cd8 100644 --- a/app/plugins/CoreEnroller/templates/ApprovalCollectors/fields.inc +++ b/app/plugins/CoreEnroller/templates/ApprovalCollectors/fields.inc @@ -31,8 +31,7 @@ $fields = [ 'redirect_on_denial' ]; -$subnav = 'local'; -$subnavLocal = [ +$subnav = [ 'tabs' => ['EnrollmentFlowSteps', 'CoreEnroller.ApprovalCollectors'], 'action' => [ 'EnrollmentFlowSteps' => ['edit', 'view'], diff --git a/app/plugins/CoreEnroller/templates/AttributeCollectors/fields.inc b/app/plugins/CoreEnroller/templates/AttributeCollectors/fields.inc index cf2ed57ac..4ec246ca0 100644 --- a/app/plugins/CoreEnroller/templates/AttributeCollectors/fields.inc +++ b/app/plugins/CoreEnroller/templates/AttributeCollectors/fields.inc @@ -45,8 +45,7 @@ $topLinks[] = [ 'class' => '' ]; -$subnav = 'local'; -$subnavLocal = [ +$subnav = [ 'tabs' => ['EnrollmentFlowSteps', 'CoreEnroller.AttributeCollectors', 'EnrollmentFlowSteps.Hierarchy'], 'action' => [ 'EnrollmentFlowSteps' => ['edit', 'view'], diff --git a/app/plugins/CoreEnroller/templates/BasicAttributeCollectors/fields.inc b/app/plugins/CoreEnroller/templates/BasicAttributeCollectors/fields.inc index a8578ff7e..3a05d030e 100644 --- a/app/plugins/CoreEnroller/templates/BasicAttributeCollectors/fields.inc +++ b/app/plugins/CoreEnroller/templates/BasicAttributeCollectors/fields.inc @@ -32,8 +32,7 @@ $fields = [ 'cou_id' ]; -$subnav = 'local'; -$subnavLocal = [ +$subnav = [ 'tabs' => ['EnrollmentFlowSteps', 'CoreEnroller.BasicAttributeCollectors'], 'action' => [ 'EnrollmentFlowSteps' => ['edit', 'view'], diff --git a/app/plugins/CoreEnroller/templates/EmailVerifiers/fields.inc b/app/plugins/CoreEnroller/templates/EmailVerifiers/fields.inc index e559e71d2..f28464a8a 100644 --- a/app/plugins/CoreEnroller/templates/EmailVerifiers/fields.inc +++ b/app/plugins/CoreEnroller/templates/EmailVerifiers/fields.inc @@ -118,8 +118,7 @@ $fields = [ ] ]; -$subnav = 'local'; -$subnavLocal = [ +$subnav = [ 'tabs' => ['EnrollmentFlowSteps', 'CoreEnroller.EmailVerifiers'], 'action' => [ 'EnrollmentFlowSteps' => ['edit', 'view'], diff --git a/app/plugins/CoreEnroller/templates/EnrollmentAttributes/columns.inc b/app/plugins/CoreEnroller/templates/EnrollmentAttributes/columns.inc index 9fa1950ca..df2fe70a3 100644 --- a/app/plugins/CoreEnroller/templates/EnrollmentAttributes/columns.inc +++ b/app/plugins/CoreEnroller/templates/EnrollmentAttributes/columns.inc @@ -56,8 +56,7 @@ $indexColumns = [ ] ]; -$subnav = 'local'; -$subnavLocal = [ +$subnav = [ 'tabs' => ['EnrollmentFlowSteps', 'CoreEnroller.AttributeCollectors', 'EnrollmentFlowSteps.Hierarchy'], 'action' => [ 'EnrollmentFlowSteps' => ['edit', 'view'], diff --git a/app/plugins/CoreEnroller/templates/EnrollmentAttributes/fields.inc b/app/plugins/CoreEnroller/templates/EnrollmentAttributes/fields.inc index 46e5810ca..db39b8702 100644 --- a/app/plugins/CoreEnroller/templates/EnrollmentAttributes/fields.inc +++ b/app/plugins/CoreEnroller/templates/EnrollmentAttributes/fields.inc @@ -203,8 +203,7 @@ if ( $fields[] = 'hidden'; } -$subnav = 'local'; -$subnavLocal = [ +$subnav = [ 'tabs' => ['EnrollmentFlowSteps', 'CoreEnroller.AttributeCollectors', 'EnrollmentFlowSteps.Hierarchy'], 'action' => [ 'EnrollmentFlowSteps' => ['edit', 'view'], diff --git a/app/plugins/CoreEnroller/templates/IdentifierCollectors/fields.inc b/app/plugins/CoreEnroller/templates/IdentifierCollectors/fields.inc index 7a03f7120..183a8a858 100644 --- a/app/plugins/CoreEnroller/templates/IdentifierCollectors/fields.inc +++ b/app/plugins/CoreEnroller/templates/IdentifierCollectors/fields.inc @@ -29,8 +29,7 @@ $fields = [ 'type_id' ]; -$subnav = 'local'; -$subnavLocal = [ +$subnav = [ 'tabs' => ['EnrollmentFlowSteps', 'CoreEnroller.IdentifierCollectors'], 'action' => [ 'EnrollmentFlowSteps' => ['edit', 'view'], diff --git a/app/plugins/CoreEnroller/templates/InvitationAccepters/fields.inc b/app/plugins/CoreEnroller/templates/InvitationAccepters/fields.inc index ac8f4f74e..8a317ee61 100644 --- a/app/plugins/CoreEnroller/templates/InvitationAccepters/fields.inc +++ b/app/plugins/CoreEnroller/templates/InvitationAccepters/fields.inc @@ -32,8 +32,7 @@ $fields = [ 'welcome_message' ]; -$subnav = 'local'; -$subnavLocal = [ +$subnav = [ 'tabs' => ['EnrollmentFlowSteps', 'CoreEnroller.InvitationAccepters'], 'action' => [ 'EnrollmentFlowSteps' => ['edit', 'view'], diff --git a/app/plugins/CoreServer/templates/HttpServers/fields.inc b/app/plugins/CoreServer/templates/HttpServers/fields.inc index 456972fff..6926478fc 100644 --- a/app/plugins/CoreServer/templates/HttpServers/fields.inc +++ b/app/plugins/CoreServer/templates/HttpServers/fields.inc @@ -33,8 +33,7 @@ $fields = [ 'skip_ssl_verification' ]; -$subnav = 'local'; -$subnavLocal = [ +$subnav = [ 'tabs' => ['Servers', 'CoreServer.HttpServers'], 'action' => [ 'Servers' => ['edit'], diff --git a/app/plugins/CoreServer/templates/MatchServerAttributes/columns.inc b/app/plugins/CoreServer/templates/MatchServerAttributes/columns.inc index ffb48a78f..2e2d71ad4 100644 --- a/app/plugins/CoreServer/templates/MatchServerAttributes/columns.inc +++ b/app/plugins/CoreServer/templates/MatchServerAttributes/columns.inc @@ -42,8 +42,7 @@ $indexColumns = [ ] ]; -$subnav = 'local'; -$subnavLocal = [ +$subnav = [ 'tabs' => ['Servers', 'CoreServer.MatchServers', 'CoreServer.MatchServerAttributes'], 'action' => [ 'Servers' => ['edit'], diff --git a/app/plugins/CoreServer/templates/MatchServerAttributes/fields.inc b/app/plugins/CoreServer/templates/MatchServerAttributes/fields.inc index 9d48c3dd5..d674bc5e8 100644 --- a/app/plugins/CoreServer/templates/MatchServerAttributes/fields.inc +++ b/app/plugins/CoreServer/templates/MatchServerAttributes/fields.inc @@ -47,8 +47,7 @@ foreach ([ $fields[] = 'required'; -$subnav = 'local'; -$subnavLocal = [ +$subnav = [ 'tabs' => ['Servers', 'CoreServer.MatchServers', 'CoreServer.MatchServerAttributes'], 'action' => [ 'Servers' => ['edit'], diff --git a/app/plugins/CoreServer/templates/MatchServers/fields.inc b/app/plugins/CoreServer/templates/MatchServers/fields.inc index ea4afb9fe..8fb6ac14c 100644 --- a/app/plugins/CoreServer/templates/MatchServers/fields.inc +++ b/app/plugins/CoreServer/templates/MatchServers/fields.inc @@ -46,8 +46,7 @@ if(!empty($vv_obj->url)) { ]; } -$subnav = 'local'; -$subnavLocal = [ +$subnav = [ 'tabs' => ['Servers', 'CoreServer.MatchServers', 'CoreServer.MatchServerAttributes'], 'action' => [ 'Servers' => ['edit'], diff --git a/app/plugins/CoreServer/templates/Oauth2Servers/fields.inc b/app/plugins/CoreServer/templates/Oauth2Servers/fields.inc index 5610455c2..aa342d45b 100644 --- a/app/plugins/CoreServer/templates/Oauth2Servers/fields.inc +++ b/app/plugins/CoreServer/templates/Oauth2Servers/fields.inc @@ -64,8 +64,7 @@ $fields['access_token'] = [ 'labelIsTextOnly' => true ]; -$subnav = 'local'; -$subnavLocal = [ +$subnav = [ 'tabs' => ['Servers', 'CoreServer.Oauth2Servers'], 'action' => [ 'Servers' => ['edit'], diff --git a/app/plugins/CoreServer/templates/SmtpServers/fields.inc b/app/plugins/CoreServer/templates/SmtpServers/fields.inc index 09a3f43e2..882000297 100644 --- a/app/plugins/CoreServer/templates/SmtpServers/fields.inc +++ b/app/plugins/CoreServer/templates/SmtpServers/fields.inc @@ -40,8 +40,7 @@ $fields = [ 'override_to' ]; -$subnav = 'local'; -$subnavLocal = [ +$subnav = [ 'tabs' => ['Servers', 'CoreServer.SmtpServers'], 'action' => [ 'Servers' => ['edit'], diff --git a/app/plugins/CoreServer/templates/SqlServers/fields.inc b/app/plugins/CoreServer/templates/SqlServers/fields.inc index ef882e486..7b9482170 100644 --- a/app/plugins/CoreServer/templates/SqlServers/fields.inc +++ b/app/plugins/CoreServer/templates/SqlServers/fields.inc @@ -34,8 +34,7 @@ $fields = [ 'password' ]; -$subnav = 'local'; -$subnavLocal = [ +$subnav = [ 'tabs' => ['Servers', 'CoreServer.SqlServers'], 'action' => [ 'Servers' => ['edit'], diff --git a/app/plugins/EnvSource/templates/EnvSourceCollectors/fields.inc b/app/plugins/EnvSource/templates/EnvSourceCollectors/fields.inc index ae1c20c42..de96bfcb2 100644 --- a/app/plugins/EnvSource/templates/EnvSourceCollectors/fields.inc +++ b/app/plugins/EnvSource/templates/EnvSourceCollectors/fields.inc @@ -31,8 +31,7 @@ $fields = [ ] ]; -$subnav = 'local'; -$subnavLocal = [ +$subnav = [ 'tabs' => ['EnrollmentFlowSteps', 'EnvSource.EnvSourceCollectors'], 'action' => [ 'EnrollmentFlowSteps' => ['edit', 'view'], diff --git a/app/plugins/EnvSource/templates/EnvSources/fields.inc b/app/plugins/EnvSource/templates/EnvSources/fields.inc index 3b14dc405..4d6d9479e 100644 --- a/app/plugins/EnvSource/templates/EnvSources/fields.inc +++ b/app/plugins/EnvSource/templates/EnvSources/fields.inc @@ -74,8 +74,7 @@ foreach($defaultNames as $field => $envName) { ]; } -$subnav = 'local'; -$subnavLocal = [ +$subnav = [ 'tabs' => ['ExternalIdentitySources', 'EnvSource.EnvSources', 'ExternalIdentitySources@action.search'], 'action' => [ 'ExternalIdentitySources' => ['edit', 'view', 'search'], diff --git a/app/plugins/OrcidSource/templates/OrcidSourceCollectors/fields.inc b/app/plugins/OrcidSource/templates/OrcidSourceCollectors/fields.inc index bdd7f3bd3..b7f871854 100644 --- a/app/plugins/OrcidSource/templates/OrcidSourceCollectors/fields.inc +++ b/app/plugins/OrcidSource/templates/OrcidSourceCollectors/fields.inc @@ -31,8 +31,7 @@ $fields = [ ] ]; -$subnav = 'local'; -$subnavLocal = [ +$subnav = [ 'tabs' => ['EnrollmentFlowSteps', 'OrcidSource.OrcidSourceCollectors'], 'action' => [ 'EnrollmentFlowSteps' => ['edit', 'view'], diff --git a/app/plugins/OrcidSource/templates/OrcidSources/fields.inc b/app/plugins/OrcidSource/templates/OrcidSources/fields.inc index cde63d977..f1ff2572e 100644 --- a/app/plugins/OrcidSource/templates/OrcidSources/fields.inc +++ b/app/plugins/OrcidSource/templates/OrcidSources/fields.inc @@ -68,8 +68,7 @@ $fields = [ 'name_type_id' ]; -$subnav = 'local'; -$subnavLocal = [ +$subnav = [ 'tabs' => ['ExternalIdentitySources', 'OrcidSource.OrcidSources', 'ExternalIdentitySources@action.search'], 'action' => [ 'ExternalIdentitySources' => ['edit', 'view', 'search'], diff --git a/app/plugins/SshKeyAuthenticator/templates/SshKeyAuthenticators/fields.inc b/app/plugins/SshKeyAuthenticator/templates/SshKeyAuthenticators/fields.inc index 099efcbda..e22c09e37 100644 --- a/app/plugins/SshKeyAuthenticator/templates/SshKeyAuthenticators/fields.inc +++ b/app/plugins/SshKeyAuthenticator/templates/SshKeyAuthenticators/fields.inc @@ -29,8 +29,7 @@ declare(strict_types = 1); $this->Field->disableFormEditMode(); -$subnav = 'local'; -$subnavLocal = [ +$subnav = [ 'tabs' => ['Authenticators', 'SshKeyAuthenticator.SshKeyAuthenticators'], 'action' => [ 'Authenticators' => ['edit'], diff --git a/app/plugins/TermsAgreer/templates/AgreementCollectors/fields.inc b/app/plugins/TermsAgreer/templates/AgreementCollectors/fields.inc index f5f6d9e1b..ae160b7cb 100644 --- a/app/plugins/TermsAgreer/templates/AgreementCollectors/fields.inc +++ b/app/plugins/TermsAgreer/templates/AgreementCollectors/fields.inc @@ -29,8 +29,7 @@ $fields = [ 't_and_c_mode' ]; -$subnav = 'local'; -$subnavLocal = [ +$subnav = [ 'tabs' => ['EnrollmentFlowSteps', 'TermsAgreer.AgreementCollectors'], 'action' => [ 'EnrollmentFlowSteps' => ['edit', 'view'], diff --git a/app/templates/Servers/fields.inc b/app/templates/Servers/fields.inc index 679e8c65e..f75fd850f 100644 --- a/app/templates/Servers/fields.inc +++ b/app/templates/Servers/fields.inc @@ -37,8 +37,7 @@ $fields = array_merge($fields, include(ROOT . DS . 'templates' . DS . 'Standard/ // Match Servers have special subnavigation treatment (they have an extra tab for Match Server Attributes). if($vv_obj['plugin'] == 'CoreServer.MatchServers') { - $subnav = 'local'; - $subnavLocal = [ + $subnav = [ 'tabs' => ['Servers', 'Servers.Plugin', 'CoreServer.MatchServerAttributes'], 'action' => [ 'Servers' => ['edit'], diff --git a/app/templates/Standard/subnavigation.inc b/app/templates/Standard/subnavigation.inc index 145d3965a..29f4810ed 100644 --- a/app/templates/Standard/subnavigation.inc +++ b/app/templates/Standard/subnavigation.inc @@ -33,14 +33,16 @@ $modelsName = $this->getName(); $tabsConfiguration = []; /** - * Subnavigation is established by setting the $subnav array in fields.inc/columns.inc to a string that either - * matches a named set from the $subnavConfig[] array below (e.g. $subnav = 'people') - * or by setting $subnav = 'local' and then defining $subnavLocal = [the tab definition array]. - * For plugins, the tab definition will always be local in the plugin fields.inc config. - * + * Subnavigation is established by setting a variable called $subnav in fields.inc/columns.inc + * either to a string that matches a named set from the $subnavConfig[] array below + * or by setting $subnav = [a local tab definition array]. + * + * For core views, the tab definition will typically reference a named set below, + * e.g. $subnav = 'people', or $subnav = 'standard'. + * + * For plugins, the tab definition will typically be local in the plugin fields.inc config. * For example (in app/availableplugins/PasswordAuthenticator/templates/PasswordAuthenticators/fields.inc): - * $subnav = 'local'; - * $subnavLocal = [ + * $subnav = [ * 'tabs' => ['Authenticators', 'PasswordAuthenticator.PasswordAuthenticators'], * 'action' => [ * 'Authenticators' => ['edit'], @@ -53,11 +55,11 @@ $tabsConfiguration = []; */ // Subnavigation configuration definitions for common subnavigation sets. -// These are here to avoid duplicate configuration. +// These are here to avoid duplicate configurations when handling core views. $subnavConfig = [ // STANDARD: for any object that has a simple two-tab set of "PROPERTIES" and "PLUGIN CONFIGURATION". // Use $subnav = 'standard' for the properties tab; each plugin tab definition will live in the - // plugin fields.inc config as $subnav = 'local' and $subnavLocal = [the tab definition array] + // plugin fields.inc config as $subnav = [the tab definition array] // as described above. 'standard' => [ 'tabs' => [$modelsName, $modelsName . '.Plugin'], @@ -153,11 +155,10 @@ $subnavConfig = [ ]; // Do not render subnavigation if $subnav is empty or if we have no configuration array. -if(!empty($subnav) && (!empty($subnavConfig[$subnav]) || !empty($subnavLocal))) { - if(!empty($subnavLocal)) { - // We are rendering tabs for a plugin configuration view. - // The tabs configuraton is defined as $subnavLocal in the plugin's fields.inc file. - $tabsConfiguration = $subnavLocal; +if(!empty($subnav) && (is_array($subnav) || (is_string($subnav) && !empty($subnavConfig[$subnav])))) { + if(is_array($subnav)) { + // We are rendering a locally configured tabs configuration set in fields.inc or columns.inc. + $tabsConfiguration = $subnav; } else { // We are rendering a standard set of tabs as defined in $subnavConfig above. $tabsConfiguration = $subnavConfig[$subnav];