@@ -50,15 +50,6 @@ class PostTypesComponent extends Component
5050 ]
5151 ];
5252
53- /**
54- * Components
55- *
56- * @var array
57- */
58- public $ components = [
59- 'CakeAdmin.ModelManager '
60- ];
61-
6253 /**
6354 * Controller
6455 *
@@ -136,8 +127,8 @@ public function register($model, $options = [])
136127 'name ' => ucfirst (Inflector::slug (pluginSplit ($ model )[1 ])),
137128 'alias ' => ucfirst (Inflector::humanize (pluginSplit ($ model )[1 ])),
138129 'aliasLc ' => lcfirst (Inflector::humanize (pluginSplit ($ model )[1 ])),
139- 'singluarAlias ' => ucfirst (Inflector::singularize (Inflector::humanize (pluginSplit ($ model )[1 ]))),
140- 'singluarAliasLc ' => lcfirst (Inflector::singularize (Inflector::humanize (pluginSplit ($ model )[1 ]))),
130+ 'singluarAlias ' => ucfirst (Inflector::singularize (Inflector::humanize (pluginSplit ($ model )[1 ]))),
131+ 'singluarAliasLc ' => lcfirst (Inflector::singularize (Inflector::humanize (pluginSplit ($ model )[1 ]))),
141132 'description ' => null ,
142133 'actions ' => [
143134 'index ' => true ,
@@ -156,10 +147,10 @@ public function register($model, $options = [])
156147 ];
157148 $ options = array_merge ($ _defaults , $ options );
158149
159- if (!$ options ['tableColumns ' ]) {
150+ if (!$ options ['tableColumns ' ]) {
160151 $ options ['tableColumns ' ] = $ this ->_generateTableColumns ($ model );
161152 }
162- if (!$ options ['formFields ' ]) {
153+ if (!$ options ['formFields ' ]) {
163154 $ options ['formFields ' ] = $ this ->_generateFormFields ($ model );
164155 }
165156
@@ -184,18 +175,24 @@ public function register($model, $options = [])
184175 }
185176
186177 /**
187- * getOptions
178+ * getOption
188179 *
189- * Returns all options of a specific PostType.
180+ * Return single option, or all options per PostType.
190181 *
191182 * @param string $name Name of the PostType.
183+ * @param string $option String of the named option.
192184 * @return array|bool
193185 */
194- public function getOptions ($ name )
186+ public function getOption ($ name, $ option = null )
195187 {
196188 $ postTypes = Configure::read ('CA.PostTypes ' );
197189
198190 if (array_key_exists ($ name , $ postTypes )) {
191+ if ($ option ) {
192+ if (array_key_exists ($ option , $ postTypes [$ name ])) {
193+ return $ postTypes [$ name ][$ option ];
194+ }
195+ }
199196 return $ postTypes [$ name ];
200197 }
201198 return false ;
0 commit comments