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.

eZ debug

Timing: Jan 30 2025 00:52:40
Script start
Timing: Jan 30 2025 00:52:40
Module start 'layout'
Timing: Jan 30 2025 00:52:40
Module start 'content'
Timing: Jan 30 2025 00:52:40
Module end 'content'
Timing: Jan 30 2025 00:52:40
Script end

Main resources:

Total runtime0.0110 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0042 588.2656151.2266
Module start 'layout' 0.00420.0020 739.492236.6797
Module start 'content' 0.00620.0037 776.171994.2188
Module end 'content' 0.00990.0011 870.390637.9922
Script end 0.0110  908.3828 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.001917.4083140.0001
Check MTime0.00098.5048140.0001
Mysql Total
Database connection0.00076.652710.0007
Mysqli_queries0.002220.105330.0007
Looping result0.00000.073710.0000
Template Total0.00097.810.0009
Template load0.00076.394910.0007
Template processing0.00021.382110.0002
Override
Cache load0.00054.789710.0005
General
dbfile0.00021.945380.0000
String conversion0.00000.045540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_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