Extending existing modules with new views

Author Message

Alex Kozeka

Sunday 14 February 2010 7:10:58 am

Hi all!

Is it possible and how to extend existing module with new view?

For example, I need to substitute user/register view, with user/register2 view.

What *.ini files should be changed to do that?

PS: It is simple to create new module/view in extension, but I want to extend existing module.

Thanks.

--
Argentea S.p.A., http://www.argentea.it/

Gaetano Giunta

Sunday 14 February 2010 7:27:28 am

Not really.

but you can use the url translating mechanism to work around this:

- create user2/login view, with no access control

- inside the login.php file, check by hand if the user has access perms on user/login

- set up an url redirection from user/login to user2/login (no http redirect but internal one)

Principal Consultant International Business
Member of the Community Project Board

Alex Kozeka

Sunday 14 February 2010 8:05:44 am

Thanks! That's the idea.

Could you also meanwhile clarify, why if I add new module 'user2' with 'register' view I also need to add new policy record for Anonymous to allow access user2/register, while I have no any such record for kernel's user/register?

--
Argentea S.p.A., http://www.argentea.it/

Peter Keung

Sunday 14 February 2010 1:47:42 pm

If you look in the default site.ini, you'll see that user/register is on this list:

[RoleSettings]
# [...]
# A list of modules to omit policy checking on,
# You should add 'role' to the list if you loose
# access to the role module
# You can also specify views by adding a / and the viewname
PolicyOmitList[]
PolicyOmitList[]=user/login
PolicyOmitList[]=user/logout
PolicyOmitList[]=user/register
PolicyOmitList[]=user/activate
PolicyOmitList[]=user/success
PolicyOmitList[]=user/forgotpassword
PolicyOmitList[]=layout
PolicyOmitList[]=manual
PolicyOmitList[]=ezinfo
PolicyOmitList[]=paypal/notify_url
PolicyOmitList[]=switchlanguage

http://www.mugo.ca
Mugo Web, eZ Partner in Vancouver, Canada

Alex Kozeka

Sunday 14 February 2010 11:40:10 pm

Wow! Thanks a lot! :)

--
Argentea S.p.A., http://www.argentea.it/

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.