Files
luos/gulliver/bin/tasks/templates/pluginDeleteExec.tpl

29 lines
890 B
Smarty
Raw Normal View History

<?php
try {
2010-12-02 23:34:41 +00:00
$form = $_POST['form'];
<!-- START BLOCK : keys -->
${phpName} = $form['{name}'];
<!-- END BLOCK : keys -->
2010-12-02 23:34:41 +00:00
<!-- START BLOCK : plugin -->
require_once (PATH_PLUGINS . '{pluginName}' . PATH_SEP . 'class.{pluginName}.php');
$pluginObj = new {pluginName}Class ();
2010-12-02 23:34:41 +00:00
<!-- END BLOCK : plugin -->
require_once ("classes/model/{className}.php");
2010-12-02 23:34:41 +00:00
//if exists the row in the database propel will update it, otherwise will insert.
$tr = {className}Peer::retrieveByPK({keylist});
if ((is_object($tr) && get_class($tr) == '{className}')) {
2010-12-02 23:34:41 +00:00
$tr->delete();
}
G::Header('location: {phpClassName}List');
2010-12-02 23:34:41 +00:00
}
catch (Exception $e) {
2010-12-02 23:34:41 +00:00
$G_PUBLISH = new Publisher;
$aMessage['MESSAGE'] = $e->getMessage();
$G_PUBLISH->AddContent('xmlform', 'xmlform', 'login/showMessage', '', $aMessage);
G::RenderPage('publish', 'blank');
}