Class group visibility

Author Message

paul bolger

Sunday 10 May 2009 1:30:05 am

What controls which class groups are visible in the 'create here' menu in the admin interface? classes in 'users' don't seem to show, but if I make a new group (to put unused classes into so they don't confuse the users) it does.

Paul Bolger

Łukasz Serwatka

Sunday 10 May 2009 2:11:00 am

Hi Paul,

http://ez.no/doc/ez_publish/technical_manual/4_0/reference/modules/content/fetch_functions/can_instantiate_class_list

See content.ini.[ClassGroupIDs].Users and content.ini.[ClassGroupIDs].Setup

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

paul bolger

Sunday 10 May 2009 5:19:00 am

Hi Łukasz

I'm afraid I don't get it: Logged in as admin I can 'create here' in Content and Media, but not Setup and Users.

And the content.ini file:

[ClassGroupIDs]
Content=1
Users=2
Media=3
Setup=4

Do you just give ClassGroups an arbitary id in the content.ini file?

Would it be simpler just to put unused classes into the 'users' class group and not worry about the inherent messiness of putting completely unrelated objects together?

Paul B

Paul Bolger

André R.

Sunday 10 May 2009 5:57:50 am

The reason is in the template code (children.tpl):

   {if $node.path_array|contains( ezini( 'NodeSettings', 'UserRootNode', 'content.ini' ) )}
       {def $can_create_classes = fetch( 'content', 'can_instantiate_class_list', hash( 'group_id', ezini( 'ClassGroupIDs', 'Users', 'content.ini' ), 'parent_node', $node ) )}
   {else}
       {def $can_create_classes = fetch( 'content', 'can_instantiate_class_list', hash( 'group_id', array( ezini( 'ClassGroupIDs', 'Users', 'content.ini' ), ezini( 'ClassGroupIDs', 'Setup', 'content.ini' ) ), 'parent_node', $node, 'filter_type', 'exclude' ) )}
   {/if}

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

paul bolger

Sunday 10 May 2009 7:37:35 pm

Sorry about this.
I'm logged in as an admin user and can create anything. Why does the 'create here' list only show objects from the the 'content' and 'media' groups?
If I take a content class like 'forum reply' and stick it in the 'setup' group it no longer shows (which is what I want, but I'd like to do it a less messy way).

Paul Bolger

André R.

Sunday 10 May 2009 11:50:58 pm

It's in the code above.

IF NOT in USER section, then show all classes that is NOT (see 'exclude' parameter) in the USER and SETUP group. There should definitely be setting to control this..

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

paul bolger

Monday 11 May 2009 4:58:45 am

Thanks André

I get it now, although still not sure what the ClassGroupIDs in the content.ini file are doing.

I'm thinking that it'd be simpler just to use the 'setup' group as a dumping area for unused classes.

I must admit that I can't see what other use the 'setup' group is - I do all configuration by modifying the setup folder.

Paul Bolger

André R.

Monday 11 May 2009 1:16:29 pm

> I get it now, although still not sure what the ClassGroupIDs in the content.ini file are doing.

It's used for things like this, getting the id of a specific class group to exclude or include classes in those groups. Searching in eZ Publish revealed that it is currently used 5 places in templates (admin) and 8 places in kernel ( eZContentObjectTreeNode::availableClassListJsArray() and eZUser::fetchUserGroupClassNames() ) files. All places uses either Users or Setup, so the other ones doesn't seem to be used.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.