Forums / Developer / Class group visibility

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

eZ debug

Timing: Jan 31 2025 00:38:34
Script start
Timing: Jan 31 2025 00:38:34
Module start 'content'
Timing: Jan 31 2025 00:38:34
Module end 'content'
Timing: Jan 31 2025 00:38:34
Script end

Main resources:

Total runtime0.1862 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0102 589.0391370.3047
Module start 'content' 0.01030.0116 959.34381,013.6094
Module end 'content' 0.02180.1643 1,972.95313,901.5391
Script end 0.1861  5,874.4922 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00452.4281200.0002
Check MTime0.00140.7408200.0001
Mysql Total
Database connection0.00140.730910.0014
Mysqli_queries0.096451.78331410.0007
Looping result0.00130.69641390.0000
Template Total0.163988.010.1639
Template load0.00070.361510.0007
Template processing0.163287.651510.1632
Override
Cache load0.00040.241110.0004
Sytem overhead
Fetch class attribute can translate value0.00191.022710.0019
XML
Image XML parsing0.00020.118110.0002
General
dbfile0.00693.6868200.0003
String conversion0.00000.005330.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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