Extending the content module

Author Message

Bruce Morrison

Sunday 07 September 2003 10:27:22 pm

I'm in the process of adding a custom search to a site. I've written the search functionality as a new module but have realised that this is not what I want to do. I need to extend the existing "content" module so I can access and honour the permissions in place on the content.

Is it possible to do this using the extension system or will I have to modify the kernel/content/... directories?

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Jan Borsodi

Monday 08 September 2003 12:20:50 am

I don't know all the details of what you want to do but it sounds like you need to modify the kernel/content files.

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

Bruce Morrison

Monday 08 September 2003 12:33:49 am

Hi Jan

I want to be able to extend the system but for the content modules read permissions to be honoured. It struck me that because the permissions are module based I would have to extend the existing content module to use these permissions. I cannot just add a module extension as this would be a new module and have it's own set of permissions.

Is there any way to "import" the content modules limitation list into my new module. I really really really don't want to modify the core distributiuon if at all possible.

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Bruce Morrison

Monday 08 September 2003 9:48:37 pm

I ended up importing the policies for content, read with the following code (from index.php)

// Import the permissions for the content module as that these can be honoured
include_once( "kernel/classes/datatypes/ezuser/ezuser.php" );
$currentUser =& eZUser::currentUser();
$accessResult = $currentUser->hasAccessTo( 'content' , 'read' );
$params['Limitation'] =& $accessResult['policies'];
$GLOBALS['ezpolicylimitation_list'] =& $params['Limitation'];

$limitationList = array();
if ( isset( $GLOBALS['ezpolicylimitation_list'] ) )
{
$policyList =& $GLOBALS['ezpolicylimitation_list'];
$limitationList = array();
foreach( array_keys( $policyList ) as $key )
{
$policy =& $policyList[$key];
$limitationList[] =& $policy->attribute( 'limitations' );
}
}

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

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 21:12:47
Script start
Timing: Jan 18 2025 21:12:47
Module start 'layout'
Timing: Jan 18 2025 21:12:47
Module start 'content'
Timing: Jan 18 2025 21:12:49
Module end 'content'
Timing: Jan 18 2025 21:12:49
Script end

Main resources:

Total runtime1.5776 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 589.0313152.6250
Module start 'layout' 0.00600.0042 741.656339.4453
Module start 'content' 0.01021.5660 781.1016556.7500
Module end 'content' 1.57620.0014 1,337.851616.1641
Script end 1.5776  1,354.0156 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.2188160.0002
Check MTime0.00140.0877160.0001
Mysql Total
Database connection0.00100.065310.0010
Mysqli_queries1.519796.3263600.0253
Looping result0.00080.0497580.0000
Template Total1.523696.620.7618
Template load0.00290.181520.0014
Template processing1.520796.393020.7604
Template load and register function0.00010.007210.0001
states
state_id_array0.00230.148210.0023
state_identifier_array0.00210.130320.0010
Override
Cache load0.00230.1462390.0001
Sytem overhead
Fetch class attribute can translate value0.00050.034720.0003
Fetch class attribute name0.00150.095360.0003
XML
Image XML parsing0.00100.061720.0005
class_abstraction
Instantiating content class attribute0.00000.001080.0000
General
dbfile0.00100.0619230.0000
String conversion0.00000.000640.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/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 20
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs