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.

eZ debug

Timing: Jan 31 2025 00:20:29
Script start
Timing: Jan 31 2025 00:20:29
Module start 'layout'
Timing: Jan 31 2025 00:20:29
Module start 'content'
Timing: Jan 31 2025 00:20:29
Module end 'content'
Timing: Jan 31 2025 00:20:29
Script end

Main resources:

Total runtime0.0259 sec
Peak memory usage6,144.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0040 588.1250151.2109
Module start 'layout' 0.00400.0037 739.3359220.6719
Module start 'content' 0.00770.0164 960.00781,009.8828
Module end 'content' 0.02410.0018 1,969.890641.9922
Script end 0.0259  2,011.8828 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002610.1431140.0002
Check MTime0.00114.0673140.0001
Mysql Total
Database connection0.00041.484910.0004
Mysqli_queries0.00218.108030.0007
Looping result0.00000.035010.0000
Template Total0.00134.910.0013
Template load0.00103.685510.0010
Template processing0.00031.219010.0003
Override
Cache load0.00072.593510.0007
General
dbfile0.002610.176280.0003
String conversion0.00000.023940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs