1
0

Extend the admin scheduler controller from the admin maintenance controller to pick up the existing maintenance controller functionality. Add a config/routes.php which routes all admin/maintenance requests to the admin/schedule controller.

This commit is contained in:
Tim Almdal 2010-05-31 09:42:39 -07:00
parent 0b6b5bc72b
commit 680643c4f9
2 changed files with 25 additions and 3 deletions

View File

@ -0,0 +1,22 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
* Copyright (C) 2000-2010 Bharat Mediratta
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
// Redirect /admin/maintenance to the admin/scheduler
$config["^admin/maintenance(.*)$"] = "admin/schedule$1";

View File

@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
class Admin_Schedule_Controller extends Admin_Controller {
class Admin_Schedule_Controller extends Admin_Maintenance_Controller {
/**
* Show a list of all available, running and finished tasks.
*/
@ -80,14 +80,14 @@ class Admin_Schedule_Controller extends Admin_Controller {
$v = new View("admin_schedule_confirm.html");
$v->name = $schedule->name;
$v->form = new Forge("admin/schedule/remove/{$id}", "", "post",
$v->form = new Forge("admin/schedule/remove_event/{$id}", "", "post",
array("id" => "g-remove-schedule"));
$group = $v->form->group("remove");
$group->submit("")->value(t("Continue"));
print $v;
}
public function remove($id) {
public function remove_event($id) {
access::verify_csrf();
$schedule = ORM::factory("schedule", $id);
$schedule->delete();