Delete information collection

Author Message

Jens Kultima

Saturday 05 April 2008 3:46:53 am

Dear all,

<b>How do I, in a template, delete an information collection?</b>

I could use the Admin-interface, but I have created a custom view for my collected information. Now I would like a "delete this" button.

I don't understand how they have implemented the function in the admin-interface.

Could anyone help?

Thank you in advance!
Regards,
Jens

Xavier Gouley

Saturday 05 April 2008 10:58:40 am

Hi,

You have to follow this template, in the admin interface: design/admin/templates/infocollector/view.tpl

This one does what you want, in the admin interface :
see the form tag, and input tags :

<form name="objects" method="post" action={concat( '/infocollector/collectionlist/', $collection.contentobject_id )|ezurl}>
<input class="button" type="submit" name="RemoveCollectionsButton" value="{'Remove'|i18n( 'design/admin/infocollector/view' )}" title="{'Remove collection.'|i18n( 'design/admin/infocollector/view' )}" />
<input type="hidden" name="CollectionIDArray[]" value="{$collection.id}" />

You just have to paste them in your template, and I think, add in appropriate roles (for users that can remove info collection in the front office), the infocollector module.

When you click to this button, the next page that will be automatically loaded is the design/admin/templates/infocollector/confirmremoval.tpl : just look in this admin template, as for the first step, to retrieve form and input tags. This template shows a "confirm form". Copy this template in your front office design folder (to the same destination folder, and same name), and adapt it graphically (adapt HTML code, but not form and input tags).
When you confirm in this second page, the collection is removed, but you will be redirected to: design/admin/templates/infocollector/collectionlist/{$objectID} page automatically, which generally does not exist in a front office. This page use the infocollector/collectionlist.tpl, so you can copy it (like previously), and make a redirection in this page, where you want, for example.

I think this should work. If not, use the kernel/infocollector/collectionlist.php as a good model to make yourself a new module in an extension.

Gook luck !

Xavier Gouley
http://www.gxapplications.com/eng_blog/GX-Admin-s-Blog/

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

Main resources:

Total runtime0.6477 sec
Peak memory usage4,096.0000 KB
Database Queries54

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0057 587.9063152.6250
Module start 'layout' 0.00570.0031 740.531339.4453
Module start 'content' 0.00890.6375 779.9766529.5313
Module end 'content' 0.64630.0013 1,309.507812.1641
Script end 0.6476  1,321.6719 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.5172160.0002
Check MTime0.00130.2032160.0001
Mysql Total
Database connection0.00090.135410.0009
Mysqli_queries0.602593.0349540.0112
Looping result0.00040.0662520.0000
Template Total0.617495.320.3087
Template load0.00200.315320.0010
Template processing0.615395.006020.3077
Template load and register function0.00010.019310.0001
states
state_id_array0.00090.135610.0009
state_identifier_array0.00100.155020.0005
Override
Cache load0.00170.2564230.0001
Sytem overhead
Fetch class attribute can translate value0.00040.064720.0002
Fetch class attribute name0.00080.127230.0003
XML
Image XML parsing0.00270.409820.0013
class_abstraction
Instantiating content class attribute0.00000.001030.0000
General
dbfile0.00270.4135160.0002
String conversion0.00000.001240.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
2content/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
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 15
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs