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