Permalink
Browse files

Support nested Actions (Admin/Languages Application)

  • Loading branch information...
1 parent 20f6d39 commit de5a80c863d53e6090728e33f330fc372489f776 @haraldpdl haraldpdl committed with Jul 30, 2010
Showing with 383 additions and 206 deletions.
  1. +0 −22 osCommerce/OM/Core/Site/Admin/Application/Languages/Action/BatchDelete.php
  2. +38 −0 osCommerce/OM/Core/Site/Admin/Application/Languages/Action/BatchDelete/Process.php
  3. +0 −22 osCommerce/OM/Core/Site/Admin/Application/Languages/Action/BatchDeleteDefinitions.php
  4. +38 −0 osCommerce/OM/Core/Site/Admin/Application/Languages/Action/BatchDeleteDefinitions/Process.php
  5. +0 −13 osCommerce/OM/Core/Site/Admin/Application/Languages/Action/BatchSaveDefinitions.php
  6. +29 −0 osCommerce/OM/Core/Site/Admin/Application/Languages/Action/BatchSaveDefinitions/Process.php
  7. +0 −13 osCommerce/OM/Core/Site/Admin/Application/Languages/Action/Delete.php
  8. +29 −0 osCommerce/OM/Core/Site/Admin/Application/Languages/Action/Delete/Process.php
  9. +0 −13 osCommerce/OM/Core/Site/Admin/Application/Languages/Action/DeleteDefinition.php
  10. +29 −0 osCommerce/OM/Core/Site/Admin/Application/Languages/Action/DeleteDefinition/Process.php
  11. +0 −12 osCommerce/OM/Core/Site/Admin/Application/Languages/Action/DeleteGroup.php
  12. +29 −0 osCommerce/OM/Core/Site/Admin/Application/Languages/Action/DeleteGroup/Process.php
  13. +0 −13 osCommerce/OM/Core/Site/Admin/Application/Languages/Action/EditDefinition.php
  14. +29 −0 osCommerce/OM/Core/Site/Admin/Application/Languages/Action/EditDefinition/Process.php
  15. +0 −5 osCommerce/OM/Core/Site/Admin/Application/Languages/Action/Export.php
  16. +21 −0 osCommerce/OM/Core/Site/Admin/Application/Languages/Action/Export/Process.php
  17. +0 −13 osCommerce/OM/Core/Site/Admin/Application/Languages/Action/Import.php
  18. +29 −0 osCommerce/OM/Core/Site/Admin/Application/Languages/Action/Import/Process.php
  19. +0 −16 osCommerce/OM/Core/Site/Admin/Application/Languages/Action/InsertDefinition.php
  20. +32 −0 osCommerce/OM/Core/Site/Admin/Application/Languages/Action/InsertDefinition/Process.php
  21. +0 −27 osCommerce/OM/Core/Site/Admin/Application/Languages/Action/Save.php
  22. +43 −0 osCommerce/OM/Core/Site/Admin/Application/Languages/Action/Save/Process.php
  23. +4 −4 osCommerce/OM/Core/Site/Admin/Application/Languages/Languages.php
  24. +2 −2 osCommerce/OM/Core/Site/Admin/Application/Languages/pages/batch_delete.php
  25. +4 −4 osCommerce/OM/Core/Site/Admin/Application/Languages/pages/definitions.php
  26. +2 −2 osCommerce/OM/Core/Site/Admin/Application/Languages/pages/definitions_batch_delete.php
  27. +2 −2 osCommerce/OM/Core/Site/Admin/Application/Languages/pages/definitions_batch_edit.php
  28. +2 −2 osCommerce/OM/Core/Site/Admin/Application/Languages/pages/definitions_delete.php
  29. +2 −2 osCommerce/OM/Core/Site/Admin/Application/Languages/pages/definitions_edit.php
  30. +2 −2 osCommerce/OM/Core/Site/Admin/Application/Languages/pages/definitions_new.php
  31. +2 −2 osCommerce/OM/Core/Site/Admin/Application/Languages/pages/delete.php
  32. +2 −2 osCommerce/OM/Core/Site/Admin/Application/Languages/pages/edit.php
  33. +2 −2 osCommerce/OM/Core/Site/Admin/Application/Languages/pages/export.php
  34. +2 −2 osCommerce/OM/Core/Site/Admin/Application/Languages/pages/groups.php
  35. +2 −2 osCommerce/OM/Core/Site/Admin/Application/Languages/pages/groups_delete.php
  36. +2 −2 osCommerce/OM/Core/Site/Admin/Application/Languages/pages/import.php
  37. +5 −5 osCommerce/OM/Core/Site/Admin/Application/Languages/pages/main.php
@@ -11,33 +11,11 @@
namespace osCommerce\OM\Core\Site\Admin\Application\Languages\Action;
use osCommerce\OM\Core\ApplicationAbstract;
- use osCommerce\OM\Core\Site\Admin\Application\Languages\Languages;
- use osCommerce\OM\Core\Registry;
- use osCommerce\OM\Core\OSCOM;
class BatchDelete {
public static function execute(ApplicationAbstract $application) {
if ( isset($_POST['batch']) && is_array($_POST['batch']) && !empty($_POST['batch']) ) {
$application->setPageContent('batch_delete.php');
-
- if ( isset($_POST['subaction']) && ($_POST['subaction'] == 'confirm') ) {
- $error = false;
-
- foreach ( $_POST['batch'] as $id ) {
- if ( !Languages::delete($id) ) {
- $error = true;
- break;
- }
- }
-
- if ( $error === false ) {
- 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,38 @@
+<?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\Languages\Action\BatchDelete;
+
+ use osCommerce\OM\Core\ApplicationAbstract;
+ use osCommerce\OM\Core\Site\Admin\Application\Languages\Languages;
+ use osCommerce\OM\Core\Registry;
+ use osCommerce\OM\Core\OSCOM;
+
+ class Process {
+ public static function execute(ApplicationAbstract $application) {
+ $error = false;
+
+ foreach ( $_POST['batch'] as $id ) {
+ if ( !Languages::delete($id) ) {
+ $error = true;
+ break;
+ }
+ }
+
+ if ( $error === false ) {
+ 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());
+ }
+ }
+?>
@@ -11,33 +11,11 @@
namespace osCommerce\OM\Core\Site\Admin\Application\Languages\Action;
use osCommerce\OM\Core\ApplicationAbstract;
- use osCommerce\OM\Core\Site\Admin\Application\Languages\Languages;
- use osCommerce\OM\Core\Registry;
- use osCommerce\OM\Core\OSCOM;
class BatchDeleteDefinitions {
public static function execute(ApplicationAbstract $application) {
if ( isset($_POST['batch']) && is_array($_POST['batch']) && !empty($_POST['batch']) ) {
$application->setPageContent('definitions_batch_delete.php');
-
- if ( isset($_POST['subaction']) && ($_POST['subaction'] == 'confirm') ) {
- $error = false;
-
- foreach ( $_POST['batch'] as $id ) {
- if ( !Languages::deleteDefinitions($_GET['id'], $_GET['group'], $_POST['batch']) ) {
- $error = true;
- break;
- }
- }
-
- if ( $error === false ) {
- 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(null, null, 'id=' . $_GET['id'] . '&group=' . $_GET['group']));
- }
}
}
}
@@ -0,0 +1,38 @@
+<?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\Languages\Action\BatchDeleteDefinitions;
+
+ use osCommerce\OM\Core\ApplicationAbstract;
+ use osCommerce\OM\Core\Site\Admin\Application\Languages\Languages;
+ use osCommerce\OM\Core\Registry;
+ use osCommerce\OM\Core\OSCOM;
+
+ class Process {
+ public static function execute(ApplicationAbstract $application) {
+ $error = false;
+
+ foreach ( $_POST['batch'] as $id ) {
+ if ( !Languages::deleteDefinitions($_GET['id'], $_GET['group'], $_POST['batch']) ) {
+ $error = true;
+ break;
+ }
+ }
+
+ if ( $error === false ) {
+ 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(null, null, 'id=' . $_GET['id'] . '&group=' . $_GET['group']));
+ }
+ }
+?>
@@ -11,24 +11,11 @@
namespace osCommerce\OM\Core\Site\Admin\Application\Languages\Action;
use osCommerce\OM\Core\ApplicationAbstract;
- use osCommerce\OM\Core\Site\Admin\Application\Languages\Languages;
- use osCommerce\OM\Core\Registry;
- use osCommerce\OM\Core\OSCOM;
class BatchSaveDefinitions {
public static function execute(ApplicationAbstract $application) {
if ( isset($_POST['batch']) && is_array($_POST['batch']) && !empty($_POST['batch']) ) {
$application->setPageContent('definitions_batch_edit.php');
-
- if ( isset($_POST['subaction']) && ($_POST['subaction'] == 'confirm') ) {
- if ( Languages::updateDefinitions($_GET['id'], $_GET['group'], $_POST['def']) ) {
- 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(null, null, 'id=' . $_GET['id'] . '&group=' . $_GET['group']));
- }
}
}
}
@@ -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\Languages\Action\BatchSaveDefinitions;
+
+ use osCommerce\OM\Core\ApplicationAbstract;
+ use osCommerce\OM\Core\Site\Admin\Application\Languages\Languages;
+ use osCommerce\OM\Core\Registry;
+ use osCommerce\OM\Core\OSCOM;
+
+ class Process {
+ public static function execute(ApplicationAbstract $application) {
+ if ( Languages::updateDefinitions($_GET['id'], $_GET['group'], $_POST['def']) ) {
+ 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(null, null, 'id=' . $_GET['id'] . '&group=' . $_GET['group']));
+ }
+ }
+?>
@@ -11,23 +11,10 @@
namespace osCommerce\OM\Core\Site\Admin\Application\Languages\Action;
use osCommerce\OM\Core\ApplicationAbstract;
- use osCommerce\OM\Core\Site\Admin\Application\Languages\Languages;
- 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 ( Languages::delete($_GET['id']) ) {
- 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\Languages\Action\Delete;
+
+ use osCommerce\OM\Core\ApplicationAbstract;
+ use osCommerce\OM\Core\Site\Admin\Application\Languages\Languages;
+ use osCommerce\OM\Core\Registry;
+ use osCommerce\OM\Core\OSCOM;
+
+ class Process {
+ public static function execute(ApplicationAbstract $application) {
+ if ( Languages::delete($_GET['id']) ) {
+ 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());
+ }
+ }
+?>
@@ -11,23 +11,10 @@
namespace osCommerce\OM\Core\Site\Admin\Application\Languages\Action;
use osCommerce\OM\Core\ApplicationAbstract;
- use osCommerce\OM\Core\Site\Admin\Application\Languages\Languages;
- use osCommerce\OM\Core\Registry;
- use osCommerce\OM\Core\OSCOM;
class DeleteDefinition {
public static function execute(ApplicationAbstract $application) {
$application->setPageContent('definitions_delete.php');
-
- if ( isset($_POST['subaction']) && ($_POST['subaction'] == 'confirm') ) {
- if ( Languages::deleteDefinitions($_GET['id'], $_GET['group'], array($_GET['dID'])) ) {
- 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(null, null, 'id=' . $_GET['id'] . '&group=' . $_GET['group']));
- }
}
}
?>
@@ -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\Languages\Action\DeleteDefinition;
+
+ use osCommerce\OM\Core\ApplicationAbstract;
+ use osCommerce\OM\Core\Site\Admin\Application\Languages\Languages;
+ use osCommerce\OM\Core\Registry;
+ use osCommerce\OM\Core\OSCOM;
+
+ class Process {
+ public static function execute(ApplicationAbstract $application) {
+ if ( Languages::deleteDefinitions($_GET['id'], $_GET['group'], array($_GET['dID'])) ) {
+ 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(null, null, 'id=' . $_GET['id'] . '&group=' . $_GET['group']));
+ }
+ }
+?>
@@ -12,23 +12,11 @@
use osCommerce\OM\Core\ApplicationAbstract;
use osCommerce\OM\Core\Site\Admin\Application\Languages\Languages;
- use osCommerce\OM\Core\Registry;
- use osCommerce\OM\Core\OSCOM;
class DeleteGroup {
public static function execute(ApplicationAbstract $application) {
if ( Languages::isDefinitionGroup($_GET['id'], $_GET['group']) ) {
$application->setPageContent('groups_delete.php');
-
- if ( isset($_POST['subaction']) && ($_POST['subaction'] == 'confirm') ) {
- if ( Languages::deleteDefinitionGroup($_GET['group']) ) {
- 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(null, null, 'id=' . $_GET['id']));
- }
}
}
}
@@ -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\Languages\Action\DeleteGroup;
+
+ use osCommerce\OM\Core\ApplicationAbstract;
+ use osCommerce\OM\Core\Site\Admin\Application\Languages\Languages;
+ use osCommerce\OM\Core\Registry;
+ use osCommerce\OM\Core\OSCOM;
+
+ class Process {
+ public static function execute(ApplicationAbstract $application) {
+ if ( Languages::deleteDefinitionGroup($_GET['group']) ) {
+ 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(null, null, 'id=' . $_GET['id']));
+ }
+ }
+?>
@@ -11,23 +11,10 @@
namespace osCommerce\OM\Core\Site\Admin\Application\Languages\Action;
use osCommerce\OM\Core\ApplicationAbstract;
- use osCommerce\OM\Core\Site\Admin\Application\Languages\Languages;
- use osCommerce\OM\Core\Registry;
- use osCommerce\OM\Core\OSCOM;
class EditDefinition {
public static function execute(ApplicationAbstract $application) {
$application->setPageContent('definitions_edit.php');
-
- if ( isset($_POST['subaction']) && ($_POST['subaction'] == 'confirm') ) {
- if ( Languages::updateDefinitions($_GET['id'], $_GET['group'], $_POST['def']) ) {
- 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(null, null, 'id=' . $_GET['id'] . '&group=' . $_GET['group']));
- }
}
}
?>
Oops, something went wrong.

0 comments on commit de5a80c

Please sign in to comment.