Permalink
Browse files

Support nested Actions (Admin/ErrorLog Application)

  • Loading branch information...
1 parent 62b395d commit 482b1fb75022a472adac6ed6f3fc2a0671a55b60 @haraldpdl haraldpdl committed with Jul 30, 2010
@@ -11,23 +11,10 @@
namespace osCommerce\OM\Core\Site\Admin\Application\ErrorLog\Action;
use osCommerce\OM\Core\ApplicationAbstract;
- use osCommerce\OM\Core\Site\Admin\Application\ErrorLog\ErrorLog;
- use osCommerce\OM\Core\Registry;
- use osCommerce\OM\Core\OSCOM;
class Delete {
public static function execute(ApplicationAbstract $application) {
$application->setPageContent('delete.php');
-
- if ( isset($_POST['subaction']) && ($_POST['subaction'] == 'confirm') ) {
- if ( ErrorLog::delete() ) {
- Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_success_action_performed'), 'success');
- } else {
- Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_action_not_performed'), 'error');
- }
-
- osc_redirect_admin(OSCOM::getLink());
- }
}
}
?>
@@ -0,0 +1,29 @@
+<?php
+/*
+ osCommerce Online Merchant $osCommerce-SIG$
+ Copyright (c) 2010 osCommerce (http://www.oscommerce.com)
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License v2 (1991)
+ as published by the Free Software Foundation.
+*/
+
+ namespace osCommerce\OM\Core\Site\Admin\Application\ErrorLog\Action\Delete;
+
+ use osCommerce\OM\Core\ApplicationAbstract;
+ use osCommerce\OM\Core\Site\Admin\Application\ErrorLog\ErrorLog;
+ use osCommerce\OM\Core\Registry;
+ use osCommerce\OM\Core\OSCOM;
+
+ class Process {
+ public static function execute(ApplicationAbstract $application) {
+ if ( ErrorLog::delete() ) {
+ Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_success_action_performed'), 'success');
+ } else {
+ Registry::get('MessageStack')->add(null, OSCOM::getDef('ms_error_action_not_performed'), 'error');
+ }
+
+ osc_redirect_admin(OSCOM::getLink());
+ }
+ }
+?>
@@ -23,13 +23,13 @@
<div class="infoBox">
<h3><?php echo osc_icon('trash.png') . ' ' . OSCOM::getDef('title_delete_error_log'); ?></h3>
- <form name="elDelete" class="dataForm" action="<?php echo OSCOM::getLink(null, null, 'action=Delete'); ?>" method="post">
+ <form name="elDelete" class="dataForm" action="<?php echo OSCOM::getLink(null, null, 'Delete&Process'); ?>" method="post">
<p><?php echo OSCOM::getDef('introduction_delete_error_log'); ?></p>
<p><?php echo '<b>' . sprintf(OSCOM::getDef('number_of_error_log_file_entries'), number_format(ErrorHandler::getTotalEntries())) . '</b>'; ?></p>
- <p><?php echo osc_draw_hidden_field('subaction', 'confirm') . osc_draw_button(array('priority' => 'primary', 'icon' => 'trash', 'title' => OSCOM::getDef('button_delete'))) . ' ' . osc_draw_button(array('href' => OSCOM::getLink(), 'priority' => 'secondary', 'icon' => 'close', 'title' => OSCOM::getDef('button_cancel'))); ?></p>
+ <p><?php echo osc_draw_button(array('priority' => 'primary', 'icon' => 'trash', 'title' => OSCOM::getDef('button_delete'))) . ' ' . osc_draw_button(array('href' => OSCOM::getLink(), 'priority' => 'secondary', 'icon' => 'close', 'title' => OSCOM::getDef('button_cancel'))); ?></p>
</form>
</div>
@@ -22,7 +22,7 @@
<form id="liveSearchForm">
<input type="text" id="liveSearchField" name="search" class="searchField fieldTitleAsDefault" title="Search.." /><?php echo osc_draw_button(array('type' => 'button', 'params' => 'onclick="osC_DataTable.reset();"', 'title' => 'Reset')); ?>
- <span style="float: right;"><?php echo osc_draw_button(array('href' => OSCOM::getLink(null, null, 'action=Delete'), 'icon' => 'trash', 'title' => OSCOM::getDef('button_delete'))); ?></span>
+ <span style="float: right;"><?php echo osc_draw_button(array('href' => OSCOM::getLink(null, null, 'Delete'), 'icon' => 'trash', 'title' => OSCOM::getDef('button_delete'))); ?></span>
</form>
<div style="padding: 20px 5px 5px 5px; height: 16px;">

0 comments on commit 482b1fb

Please sign in to comment.