Module in class view

Author Message

Ivan Švogor

Monday 04 October 2010 11:21:13 am

Hello!

I created a new extension for ez publish, how can I show it in the drop down list in class view? - the same way the users add new Article, i need my module. Can anyone help me with this?

Ivo Lukac

Tuesday 05 October 2010 1:12:37 am

In module.php of your extension module you need to specify a function list. e.g.:

$FunctionList['some_function'] = array( );   //FUNCTION WITHOUT LIMITATION

Then in the same file for module view specify that function:

$ViewList['some_view'] = array( 
 'script' => 'some_view.php',
 'functions' => array( 'some_function' ),
 'params' => array( )
);

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

Ivan Švogor

Tuesday 05 October 2010 5:11:17 am

Hello Ivo, thank you for replying.

I have this code in my module.php. But when I log in, and toolbar shows up, I can only access default classes (Article, Blog, Blog post, Comment,...), and also classes I created via Administrator panel (Setup -> Classes -> New Class...)

Currently if I want to access my module I have to do it via URL e.g.: http://localhost:8085/newez/index.php/ezuser/modul/list/

I need some way to have this inside the dropdown in toolbar so editors can also add this to some site. Currently this module returns only a plain site, I want to display it inside a folder or article as an object. I need some more elegant way to use it rather than just URL. So I would be able to create new instance...

Gaetano Giunta

Tuesday 05 October 2010 12:22:08 pm

@Ivan: you seem to be confused. Either that, or I am.

When you create a new module and some views inside it, it is your job to create where appropriate in templates the links/forms that will send the user to your new module/view url

The classes listed in the 'create here' dropdown are the content classes that are

1. defined in the system (in administration|classes) panel

2. available to the current user within the roles & policies section - ie. the user has permission on content/create for those classes within the current node

I have a hard time understanding what you mean by having users being able to get redirected to your module when they select to create a new "class XXX" object.

Anyway, it could be done by:

. finding out the template used to fill that dropdown, and overriding it

. adding to the list yor custom 'fake' line

. adding some js magick that intercepts the 'onclick' event of the 'create here' button and, if your fake class is selected, send user to your module instead of sending him to content/action

Principal Consultant International Business
Member of the Community Project Board

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 18 2025 02:06:48
Script start
Timing: Jan 18 2025 02:06:48
Module start 'layout'
Timing: Jan 18 2025 02:06:48
Module start 'content'
Timing: Jan 18 2025 02:06:49
Module end 'content'
Timing: Jan 18 2025 02:06:49
Script end

Main resources:

Total runtime0.5938 sec
Peak memory usage4,096.0000 KB
Database Queries63

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 587.8906152.6094
Module start 'layout' 0.00530.0029 740.500039.4219
Module start 'content' 0.00810.5845 779.9219594.4297
Module end 'content' 0.59260.0011 1,374.351612.5000
Script end 0.5937  1,386.8516 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.5307160.0002
Check MTime0.00130.2234160.0001
Mysql Total
Database connection0.00100.160810.0010
Mysqli_queries0.543491.5225630.0086
Looping result0.00060.1093610.0000
Template Total0.566495.420.2832
Template load0.00200.337620.0010
Template processing0.564495.046120.2822
Template load and register function0.00020.025410.0002
states
state_id_array0.00070.124310.0007
state_identifier_array0.00070.113520.0003
Override
Cache load0.00170.2895290.0001
Sytem overhead
Fetch class attribute can translate value0.00050.083030.0002
Fetch class attribute name0.00110.190260.0002
XML
Image XML parsing0.00110.192930.0004
class_abstraction
Instantiating content class attribute0.00000.001860.0000
General
dbfile0.00080.1320230.0000
String conversion0.00000.001540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 17
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs