Forums / Extensions / Module in class view

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

eZ debug

Timing: Jan 18 2025 00:08:59
Script start
Timing: Jan 18 2025 00:08:59
Module start 'content'
Timing: Jan 18 2025 00:09:00
Module end 'content'
Timing: Jan 18 2025 00:09:00
Script end

Main resources:

Total runtime0.8592 sec
Peak memory usage4,096.0000 KB
Database Queries200

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 592.4453180.8516
Module start 'content' 0.00530.7098 773.2969599.4922
Module end 'content' 0.71510.1440 1,372.7891337.6953
Script end 0.8591  1,710.4844 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.4787210.0002
Check MTime0.00170.1950210.0001
Mysql Total
Database connection0.00050.057710.0005
Mysqli_queries0.786391.51672000.0039
Looping result0.00200.22941980.0000
Template Total0.836797.420.4184
Template load0.00200.229820.0010
Template processing0.834797.154520.4174
Template load and register function0.00030.029810.0003
states
state_id_array0.00050.053410.0005
state_identifier_array0.00120.136620.0006
Override
Cache load0.00170.1981290.0001
Sytem overhead
Fetch class attribute can translate value0.00200.233340.0005
Fetch class attribute name0.00120.135660.0002
XML
Image XML parsing0.00160.187040.0004
class_abstraction
Instantiating content class attribute0.00000.001560.0000
General
dbfile0.00350.4053340.0001
String conversion0.00000.000530.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
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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 17
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs