Forums / General / Delete information collection

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/

eZ debug

Timing: Jan 30 2025 21:21:37
Script start
Timing: Jan 30 2025 21:21:37
Module start 'content'
Timing: Jan 30 2025 21:21:37
Module end 'content'
Timing: Jan 30 2025 21:21:37
Script end

Main resources:

Total runtime0.2032 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0093 587.9297370.3047
Module start 'content' 0.00930.0165 958.23441,001.6094
Module end 'content' 0.02590.1773 1,959.84383,889.9375
Script end 0.2032  5,849.7813 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00472.3108200.0002
Check MTime0.00130.6311200.0001
Mysql Total
Database connection0.00120.595910.0012
Mysqli_queries0.089544.02451410.0006
Looping result0.00140.66451390.0000
Template Total0.176987.110.1769
Template load0.00100.502410.0010
Template processing0.175986.549210.1759
Override
Cache load0.00060.314910.0006
Sytem overhead
Fetch class attribute can translate value0.00200.985210.0020
XML
Image XML parsing0.00050.260310.0005
General
dbfile0.01567.6541200.0008
String conversion0.00000.003430.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0002 secs