From fb33270d9e0978e6efbf62b9970b4c225e42b0c9 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Thu, 27 Jan 2011 12:23:37 -0500 Subject: [PATCH] Horde 4 style autoloading for kronolith's forms --- kronolith/calendars/create.php | 4 +--- kronolith/calendars/delete.php | 4 +--- kronolith/calendars/edit.php | 4 +--- kronolith/calendars/remote_edit.php | 5 +---- kronolith/calendars/remote_subscribe.php | 4 +--- kronolith/calendars/remote_unsubscribe.php | 4 +--- kronolith/lib/{Forms => Form}/CreateCalendar.php | 4 ++-- kronolith/lib/{Forms => Form}/CreateResource.php | 4 ++-- kronolith/lib/{Forms => Form}/CreateResourceGroup.php | 4 ++-- kronolith/lib/{Forms => Form}/DeleteCalendar.php | 4 ++-- kronolith/lib/{Forms => Form}/DeleteResource.php | 4 ++-- kronolith/lib/{Forms => Form}/DeleteResourceGroup.php | 9 +++++---- kronolith/lib/{Forms => Form}/EditCalendar.php | 4 ++-- kronolith/lib/{Forms => Form}/EditRemoteCalendar.php | 4 ++-- kronolith/lib/{Forms => Form}/EditResource.php | 4 ++-- kronolith/lib/{Forms => Form}/EditResourceGroup.php | 4 ++-- kronolith/lib/{Forms => Form}/SubscribeRemoteCalendar.php | 4 ++-- kronolith/lib/{Forms => Form}/UnsubscribeRemoteCalendar.php | 4 ++-- kronolith/resources/create.php | 4 +--- kronolith/resources/delete.php | 2 -- kronolith/resources/edit.php | 4 +--- kronolith/resources/groups/create.php | 4 +--- kronolith/resources/groups/delete.php | 4 +--- kronolith/resources/groups/edit.php | 4 +--- 24 files changed, 38 insertions(+), 62 deletions(-) rename kronolith/lib/{Forms => Form}/CreateCalendar.php (92%) rename kronolith/lib/{Forms => Form}/CreateResource.php (96%) rename kronolith/lib/{Forms => Form}/CreateResourceGroup.php (92%) rename kronolith/lib/{Forms => Form}/DeleteCalendar.php (89%) rename kronolith/lib/{Forms => Form}/DeleteResource.php (92%) rename kronolith/lib/{Forms => Form}/DeleteResourceGroup.php (79%) rename kronolith/lib/{Forms => Form}/EditCalendar.php (91%) rename kronolith/lib/{Forms => Form}/EditRemoteCalendar.php (90%) rename kronolith/lib/{Forms => Form}/EditResource.php (96%) rename kronolith/lib/{Forms => Form}/EditResourceGroup.php (93%) rename kronolith/lib/{Forms => Form}/SubscribeRemoteCalendar.php (90%) rename kronolith/lib/{Forms => Form}/UnsubscribeRemoteCalendar.php (87%) diff --git a/kronolith/calendars/create.php b/kronolith/calendars/create.php index 0d222f35f..8d88ccf59 100644 --- a/kronolith/calendars/create.php +++ b/kronolith/calendars/create.php @@ -15,8 +15,6 @@ if (Kronolith::showAjaxView()) { Horde::url('', true)->setAnchor('calendar:internal')->redirect(); } -require_once KRONOLITH_BASE . '/lib/Forms/CreateCalendar.php'; - // Exit if this isn't an authenticated user or if the user can't // create new calendars (default share is locked). if (!$GLOBALS['registry']->getAuth() || $prefs->isLocked('default_share')) { @@ -24,7 +22,7 @@ if (!$GLOBALS['registry']->getAuth() || $prefs->isLocked('default_share')) { } $vars = Horde_Variables::getDefaultVariables(); -$form = new Kronolith_CreateCalendarForm($vars); +$form = new Kronolith_Form_CreateCalendar($vars); // Execute if the form is valid. if ($form->validate($vars)) { diff --git a/kronolith/calendars/delete.php b/kronolith/calendars/delete.php index 48eca31fc..6f2c24ecb 100644 --- a/kronolith/calendars/delete.php +++ b/kronolith/calendars/delete.php @@ -11,8 +11,6 @@ require_once dirname(__FILE__) . '/../lib/Application.php'; Horde_Registry::appInit('kronolith'); -require_once KRONOLITH_BASE . '/lib/Forms/DeleteCalendar.php'; - // Exit if this isn't an authenticated user. if (!$GLOBALS['registry']->getAuth()) { Horde::url($prefs->getValue('defaultview') . '.php', true)->redirect(); @@ -36,7 +34,7 @@ if ($calendar->get('owner') != $GLOBALS['registry']->getAuth() && $notification->push(_("You are not allowed to delete this calendar."), 'horde.error'); Horde::url('calendars/', true)->redirect(); } -$form = new Kronolith_DeleteCalendarForm($vars, $calendar); +$form = new Kronolith_Form_DeleteCalendar($vars, $calendar); // Execute if the form is valid (must pass with POST variables only). if ($form->validate(new Horde_Variables($_POST))) { diff --git a/kronolith/calendars/edit.php b/kronolith/calendars/edit.php index c4c7ebf90..36a90399d 100644 --- a/kronolith/calendars/edit.php +++ b/kronolith/calendars/edit.php @@ -17,8 +17,6 @@ if (Kronolith::showAjaxView()) { Horde::url('', true)->setAnchor('calendar:internal|' . $vars->get('c'))->redirect(); } -require_once KRONOLITH_BASE . '/lib/Forms/EditCalendar.php'; - // Exit if this isn't an authenticated user. if (!$GLOBALS['registry']->getAuth()) { Horde::url($prefs->getValue('defaultview') . '.php', true)->redirect(); @@ -35,7 +33,7 @@ if ($calendar->get('owner') != $GLOBALS['registry']->getAuth() && $notification->push(_("You are not allowed to change this calendar."), 'horde.error'); Horde::url('calendars/', true)->redirect(); } -$form = new Kronolith_EditCalendarForm($vars, $calendar); +$form = new Kronolith_Form_EditCalendar($vars, $calendar); // Execute if the form is valid. if ($form->validate($vars)) { diff --git a/kronolith/calendars/remote_edit.php b/kronolith/calendars/remote_edit.php index ab6ffa870..96dba3497 100644 --- a/kronolith/calendars/remote_edit.php +++ b/kronolith/calendars/remote_edit.php @@ -18,8 +18,6 @@ if (Kronolith::showAjaxView()) { Horde::url('', true)->setAnchor('calendar:remote|' . rawurlencode($url))->redirect(); } -require_once KRONOLITH_BASE . '/lib/Forms/EditRemoteCalendar.php'; - // Exit if this isn't an authenticated user or if the user can't // subscribe to remote calendars (remote_cals is locked). if (!$GLOBALS['registry']->getAuth() || $prefs->isLocked('remote_cals')) { @@ -38,8 +36,7 @@ if (is_null($remote_calendar)) { $notification->push(_("The remote calendar was not found."), 'horde.error'); Horde::url('calendars/', true)->redirect(); } - -$form = new Kronolith_EditRemoteCalendarForm($vars, $remote_calendar); +$form = new Kronolith_Form_EditRemoteCalendar($vars, $remote_calendar); // Execute if the form is valid. if ($form->validate($vars)) { diff --git a/kronolith/calendars/remote_subscribe.php b/kronolith/calendars/remote_subscribe.php index fae59838d..c73265be6 100644 --- a/kronolith/calendars/remote_subscribe.php +++ b/kronolith/calendars/remote_subscribe.php @@ -18,15 +18,13 @@ if (Kronolith::showAjaxView()) { Horde::url('', true)->setAnchor('calendar:remote|' . rawurlencode($url))->redirect(); } -require_once KRONOLITH_BASE . '/lib/Forms/SubscribeRemoteCalendar.php'; - // Exit if this isn't an authenticated user or if the user can't // subscribe to remote calendars (remote_cals is locked). if (!$GLOBALS['registry']->getAuth() || $prefs->isLocked('remote_cals')) { Horde::url($prefs->getValue('defaultview') . '.php', true)->redirect(); } -$form = new Kronolith_SubscribeRemoteCalendarForm($vars); +$form = new Kronolith_Form_SubscribeRemoteCalendar($vars); // Execute if the form is valid. if ($form->validate($vars)) { diff --git a/kronolith/calendars/remote_unsubscribe.php b/kronolith/calendars/remote_unsubscribe.php index a7780f81f..7f0dfb7ac 100644 --- a/kronolith/calendars/remote_unsubscribe.php +++ b/kronolith/calendars/remote_unsubscribe.php @@ -18,8 +18,6 @@ if (Kronolith::showAjaxView()) { Horde::url('', true)->setAnchor('calendar:remote|' . rawurlencode($url))->redirect(); } -require_once KRONOLITH_BASE . '/lib/Forms/UnsubscribeRemoteCalendar.php'; - // Exit if this isn't an authenticated user or if the user can't // subscribe to remote calendars (remote_cals is locked). if (!$GLOBALS['registry']->getAuth() || $prefs->isLocked('remote_cals')) { @@ -39,7 +37,7 @@ if (is_null($remote_calendar)) { $notification->push(_("The remote calendar was not found."), 'horde.error'); Horde::url('calendars/', true)->redirect(); } -$form = new Kronolith_UnsubscribeRemoteCalendarForm($vars, $remote_calendar); +$form = new Kronolith_Form_UnsubscribeRemoteCalendar($vars, $remote_calendar); // Execute if the form is valid (must pass with POST variables only). if ($form->validate(new Horde_Variables($_POST))) { diff --git a/kronolith/lib/Forms/CreateCalendar.php b/kronolith/lib/Form/CreateCalendar.php similarity index 92% rename from kronolith/lib/Forms/CreateCalendar.php rename to kronolith/lib/Form/CreateCalendar.php index c9ae419b4..3f810bdde 100755 --- a/kronolith/lib/Forms/CreateCalendar.php +++ b/kronolith/lib/Form/CreateCalendar.php @@ -15,11 +15,11 @@ * @author Chuck Hagenbuch * @package Kronolith */ -class Kronolith_CreateCalendarForm extends Horde_Form +class Kronolith_Form_CreateCalendar extends Horde_Form { public function __construct($vars) { - parent::Horde_Form($vars, _("Create Calendar")); + parent::__construct($vars, _("Create Calendar")); $this->addVariable(_("Name"), 'name', 'text', true); $this->addVariable(_("Color"), 'color', 'colorpicker', false); diff --git a/kronolith/lib/Forms/CreateResource.php b/kronolith/lib/Form/CreateResource.php similarity index 96% rename from kronolith/lib/Forms/CreateResource.php rename to kronolith/lib/Form/CreateResource.php index a6cca6356..4a9d857a5 100644 --- a/kronolith/lib/Forms/CreateResource.php +++ b/kronolith/lib/Form/CreateResource.php @@ -16,14 +16,14 @@ * @author Michael J. Rubinsky * @package Kronolith */ -class Kronolith_CreateResourceForm extends Horde_Form +class Kronolith_Form_CreateResource extends Horde_Form { /** * @throws Kronolith_Exception */ public function __construct($vars) { - parent::Horde_Form($vars, _("Create Resource")); + parent::__construct($vars, _("Create Resource")); $responses = array(Kronolith_Resource::RESPONSETYPE_ALWAYS_ACCEPT => _("Always Accept"), Kronolith_Resource::RESPONSETYPE_ALWAYS_DECLINE => _("Always Decline"), diff --git a/kronolith/lib/Forms/CreateResourceGroup.php b/kronolith/lib/Form/CreateResourceGroup.php similarity index 92% rename from kronolith/lib/Forms/CreateResourceGroup.php rename to kronolith/lib/Form/CreateResourceGroup.php index 5ca78eb03..ff3ddb4f0 100644 --- a/kronolith/lib/Forms/CreateResourceGroup.php +++ b/kronolith/lib/Form/CreateResourceGroup.php @@ -16,14 +16,14 @@ * @author Michael J. Rubinsky * @package Kronolith */ -class Kronolith_CreateResourceGroupForm extends Horde_Form +class Kronolith_Form_CreateResourceGroup extends Horde_Form { /** * @throws Kronolith_Exception */ public function __construct($vars) { - parent::Horde_Form($vars, _("Create Resource")); + parent::__construct($vars, _("Create Resource")); $resources = Kronolith::getDriver('Resource')->listResources(Horde_Perms::READ, array('type' => Kronolith_Resource::TYPE_SINGLE)); $enum = array(); diff --git a/kronolith/lib/Forms/DeleteCalendar.php b/kronolith/lib/Form/DeleteCalendar.php similarity index 89% rename from kronolith/lib/Forms/DeleteCalendar.php rename to kronolith/lib/Form/DeleteCalendar.php index c8ffce14f..849595bb7 100644 --- a/kronolith/lib/Forms/DeleteCalendar.php +++ b/kronolith/lib/Form/DeleteCalendar.php @@ -15,7 +15,7 @@ * @author Chuck Hagenbuch * @package Kronolith */ -class Kronolith_DeleteCalendarForm extends Horde_Form +class Kronolith_Form_DeleteCalendar extends Horde_Form { /** * Calendar being deleted. @@ -25,7 +25,7 @@ class Kronolith_DeleteCalendarForm extends Horde_Form public function __construct($vars, $calendar) { $this->_calendar = $calendar; - parent::Horde_Form($vars, sprintf(_("Delete %s"), $calendar->get('name'))); + parent::__construct($vars, sprintf(_("Delete %s"), $calendar->get('name'))); $this->addHidden('', 'c', 'text', true); $this->addVariable(sprintf(_("Really delete the calendar \"%s\"? This cannot be undone and all data on this calendar will be permanently removed."), $this->_calendar->get('name')), 'desc', 'description', false); diff --git a/kronolith/lib/Forms/DeleteResource.php b/kronolith/lib/Form/DeleteResource.php similarity index 92% rename from kronolith/lib/Forms/DeleteResource.php rename to kronolith/lib/Form/DeleteResource.php index 1bbd5a9ba..f6ea739e2 100644 --- a/kronolith/lib/Forms/DeleteResource.php +++ b/kronolith/lib/Form/DeleteResource.php @@ -16,7 +16,7 @@ * @author Michael J. Rubinsky * @package Kronolith */ -class Kronolith_DeleteResourceForm extends Horde_Form +class Kronolith_Form_DeleteResource extends Horde_Form { /** * Resource being deleted. @@ -28,7 +28,7 @@ class Kronolith_DeleteResourceForm extends Horde_Form public function __construct($vars, $resource) { $this->_resource = $resource; - parent::Horde_Form($vars, sprintf(_("Delete %s"), $resource->get('name'))); + parent::__construct($vars, sprintf(_("Delete %s"), $resource->get('name'))); $this->addHidden('', 'c', 'text', true); $this->addVariable(sprintf(_("Really delete the resource \"%s\"? This cannot be undone and all data on this resource will be permanently removed."), $this->_resource->get('name')), 'desc', 'description', false); diff --git a/kronolith/lib/Forms/DeleteResourceGroup.php b/kronolith/lib/Form/DeleteResourceGroup.php similarity index 79% rename from kronolith/lib/Forms/DeleteResourceGroup.php rename to kronolith/lib/Form/DeleteResourceGroup.php index 9290c08e7..46fad26d4 100644 --- a/kronolith/lib/Forms/DeleteResourceGroup.php +++ b/kronolith/lib/Form/DeleteResourceGroup.php @@ -16,7 +16,7 @@ * @author Michael J. Rubinsky * @package Kronolith */ -class Kronolith_DeleteResourceGroupForm extends Horde_Form +class Kronolith_Form_DeleteResourceGroup extends Horde_Form { /** * Resource group being deleted. @@ -28,11 +28,12 @@ class Kronolith_DeleteResourceGroupForm extends Horde_Form public function __construct($vars, $resource) { $this->_resource = $resource; - parent::Horde_Form($vars, sprintf(_("Delete %s"), $resource->get('name'))); + parent::__construct($vars, sprintf(_("Delete %s"), $resource->get('name'))); $this->addHidden('', 'c', 'text', true); - $this->addVariable(sprintf(_("Really delete the resource \"%s\"? This cannot be undone and all data on this resource will be permanently removed."), $this->_resource->get('name')), 'desc', 'description', false); - + $this->addVariable( + sprintf(_("Really delete the resource \"%s\"? This cannot be undone and all data on this resource will be permanently removed."), $this->_resource->get('name')), + 'desc', 'description', false); $this->setButtons(array(_("Delete"), _("Cancel"))); } diff --git a/kronolith/lib/Forms/EditCalendar.php b/kronolith/lib/Form/EditCalendar.php similarity index 91% rename from kronolith/lib/Forms/EditCalendar.php rename to kronolith/lib/Form/EditCalendar.php index 5dff62dd1..e20b44d5f 100644 --- a/kronolith/lib/Forms/EditCalendar.php +++ b/kronolith/lib/Form/EditCalendar.php @@ -15,7 +15,7 @@ * @author Chuck Hagenbuch * @package Kronolith */ -class Kronolith_EditCalendarForm extends Horde_Form +class Kronolith_Form_EditCalendar extends Horde_Form { /** * Calendar being edited. @@ -25,7 +25,7 @@ class Kronolith_EditCalendarForm extends Horde_Form public function __construct($vars, $calendar) { $this->_calendar = $calendar; - parent::Horde_Form($vars, sprintf(_("Edit %s"), $calendar->get('name'))); + parent::__construct($vars, sprintf(_("Edit %s"), $calendar->get('name'))); $this->addHidden('', 'c', 'text', true); $this->addVariable(_("Name"), 'name', 'text', true); diff --git a/kronolith/lib/Forms/EditRemoteCalendar.php b/kronolith/lib/Form/EditRemoteCalendar.php similarity index 90% rename from kronolith/lib/Forms/EditRemoteCalendar.php rename to kronolith/lib/Form/EditRemoteCalendar.php index 3052957d2..f5b57d524 100644 --- a/kronolith/lib/Forms/EditRemoteCalendar.php +++ b/kronolith/lib/Form/EditRemoteCalendar.php @@ -15,11 +15,11 @@ * @author Chuck Hagenbuch * @package Kronolith */ -class Kronolith_EditRemoteCalendarForm extends Horde_Form +class Kronolith_Form_EditRemoteCalendar extends Horde_Form { public function __construct($vars, $remote_calendar) { - parent::Horde_Form($vars, sprintf(_("Edit %s"), $remote_calendar['name'])); + parent::__construct($vars, sprintf(_("Edit %s"), $remote_calendar['name'])); $this->addHidden('', 'url', 'text', true); $this->addVariable(_("Name"), 'name', 'text', true); diff --git a/kronolith/lib/Forms/EditResource.php b/kronolith/lib/Form/EditResource.php similarity index 96% rename from kronolith/lib/Forms/EditResource.php rename to kronolith/lib/Form/EditResource.php index 2885aaaf9..f72e4b00b 100644 --- a/kronolith/lib/Forms/EditResource.php +++ b/kronolith/lib/Form/EditResource.php @@ -16,7 +16,7 @@ * @author Michael J. Rubinsky * @package Kronolith */ -class Kronolith_EditResourceForm extends Horde_Form +class Kronolith_Form_EditResource extends Horde_Form { /** * Resource being edited. @@ -31,7 +31,7 @@ class Kronolith_EditResourceForm extends Horde_Form public function __construct($vars, $resource) { $this->_resource = $resource; - parent::Horde_Form($vars, sprintf(_("Edit %s"), $resource->get('name'))); + parent::__construct($vars, sprintf(_("Edit %s"), $resource->get('name'))); $responses = array(Kronolith_Resource::RESPONSETYPE_ALWAYS_ACCEPT => _("Always Accept"), Kronolith_Resource::RESPONSETYPE_ALWAYS_DECLINE => _("Always Decline"), diff --git a/kronolith/lib/Forms/EditResourceGroup.php b/kronolith/lib/Form/EditResourceGroup.php similarity index 93% rename from kronolith/lib/Forms/EditResourceGroup.php rename to kronolith/lib/Form/EditResourceGroup.php index 2feb6c083..d430c01ff 100644 --- a/kronolith/lib/Forms/EditResourceGroup.php +++ b/kronolith/lib/Form/EditResourceGroup.php @@ -16,7 +16,7 @@ * @author Michael J. Rubinsky * @package Kronolith */ -class Kronolith_EditResourceGroupForm extends Horde_Form +class Kronolith_Form_EditResourceGroup extends Horde_Form { /** * Resource group being edited. @@ -31,7 +31,7 @@ class Kronolith_EditResourceGroupForm extends Horde_Form public function __construct($vars, $resource) { $this->_resource = $resource; - parent::Horde_Form($vars, sprintf(_("Edit %s"), $resource->get('name'))); + parent::__construct($vars, sprintf(_("Edit %s"), $resource->get('name'))); $resources = Kronolith::getDriver('Resource')->listResources(Horde_Perms::READ, array('type' => Kronolith_Resource::TYPE_SINGLE)); $enum = array(); diff --git a/kronolith/lib/Forms/SubscribeRemoteCalendar.php b/kronolith/lib/Form/SubscribeRemoteCalendar.php similarity index 90% rename from kronolith/lib/Forms/SubscribeRemoteCalendar.php rename to kronolith/lib/Form/SubscribeRemoteCalendar.php index 386598404..028a06f1c 100644 --- a/kronolith/lib/Forms/SubscribeRemoteCalendar.php +++ b/kronolith/lib/Form/SubscribeRemoteCalendar.php @@ -15,11 +15,11 @@ * @author Chuck Hagenbuch * @package Kronolith */ -class Kronolith_SubscribeRemoteCalendarForm extends Horde_Form +class Kronolith_Form_SubscribeRemoteCalendar extends Horde_Form { public function __construct($vars) { - parent::Horde_Form($vars, _("Subscribe to a Remote Calendar")); + parent::__construct($vars, _("Subscribe to a Remote Calendar")); $this->addVariable(_("Name"), 'name', 'text', true); $this->addVariable(_("Color"), 'color', 'colorpicker', false); diff --git a/kronolith/lib/Forms/UnsubscribeRemoteCalendar.php b/kronolith/lib/Form/UnsubscribeRemoteCalendar.php similarity index 87% rename from kronolith/lib/Forms/UnsubscribeRemoteCalendar.php rename to kronolith/lib/Form/UnsubscribeRemoteCalendar.php index 773e115c8..ad2d9cee5 100644 --- a/kronolith/lib/Forms/UnsubscribeRemoteCalendar.php +++ b/kronolith/lib/Form/UnsubscribeRemoteCalendar.php @@ -15,11 +15,11 @@ * @author Chuck Hagenbuch * @package Kronolith */ -class Kronolith_UnsubscribeRemoteCalendarForm extends Horde_Form +class Kronolith_Form_UnsubscribeRemoteCalendar extends Horde_Form { public function __construct($vars, $calendar) { - parent::Horde_Form($vars, sprintf(_("Unsubscribe from %s"), $calendar['name'])); + parent::__construct($vars, sprintf(_("Unsubscribe from %s"), $calendar['name'])); $this->addHidden('', 'url', 'text', true); $this->addVariable(sprintf(_("Really unsubscribe from the calendar \"%s\" (%s)?"), $calendar['name'], $calendar['url']), 'desc', 'description', false); diff --git a/kronolith/resources/create.php b/kronolith/resources/create.php index 3a6ef7fcd..5280a2f44 100644 --- a/kronolith/resources/create.php +++ b/kronolith/resources/create.php @@ -20,10 +20,8 @@ if (!$registry->isAdmin()) { Horde::url($prefs->getValue('defaultview') . '.php', true)->redirect(); } -require_once KRONOLITH_BASE . '/lib/Forms/CreateResource.php'; - $vars = Horde_Variables::getDefaultVariables(); -$form = new Kronolith_CreateResourceForm($vars); +$form = new Kronolith_Form_CreateResource($vars); // Execute if the form is valid. if ($form->validate($vars)) { diff --git a/kronolith/resources/delete.php b/kronolith/resources/delete.php index 7894c6e11..2a1834125 100644 --- a/kronolith/resources/delete.php +++ b/kronolith/resources/delete.php @@ -15,8 +15,6 @@ if (Kronolith::showAjaxView()) { Horde::url('', true)->redirect(); } -require_once KRONOLITH_BASE . '/lib/Forms/DeleteResource.php'; - // Exit if this isn't an authenticated administrative user. if (!$registry->isAdmin()) { Horde::url($prefs->getValue('defaultview') . '.php', true)->redirect(); diff --git a/kronolith/resources/edit.php b/kronolith/resources/edit.php index 4518f20a6..ff450156c 100644 --- a/kronolith/resources/edit.php +++ b/kronolith/resources/edit.php @@ -15,8 +15,6 @@ if (Kronolith::showAjaxView()) { Horde::url('', true)->redirect(); } -require_once KRONOLITH_BASE . '/lib/Forms/EditResource.php'; - // Exit if this isn't an authenticated administrative user. if (!$registry->isAdmin()) { Horde::url($prefs->getValue('defaultview') . '.php', true)->redirect(); @@ -33,7 +31,7 @@ try { $notification->push($e, 'horde.error'); Horde::url('resources/', true)->redirect(); } -$form = new Kronolith_EditResourceForm($vars, $resource); +$form = new Kronolith_Form_EditResource($vars, $resource); // Execute if the form is valid. if ($form->validate($vars)) { diff --git a/kronolith/resources/groups/create.php b/kronolith/resources/groups/create.php index 4ce77a368..d63ecb08e 100644 --- a/kronolith/resources/groups/create.php +++ b/kronolith/resources/groups/create.php @@ -11,15 +11,13 @@ require_once dirname(__FILE__) . '/../../lib/Application.php'; Horde_Registry::appInit('kronolith'); -require_once KRONOLITH_BASE . '/lib/Forms/CreateResourceGroup.php'; - // Exit if this isn't an authenticated, administrative user if (!$registry->isAdmin()) { Horde::url($prefs->getValue('defaultview') . '.php', true)->redirect(); } $vars = Horde_Variables::getDefaultVariables(); -$form = new Kronolith_CreateResourceGroupForm($vars); +$form = new Kronolith_Form_CreateResourceGroup($vars); // Execute if the form is valid. if ($form->validate($vars)) { diff --git a/kronolith/resources/groups/delete.php b/kronolith/resources/groups/delete.php index 53af12a7e..097574ca3 100644 --- a/kronolith/resources/groups/delete.php +++ b/kronolith/resources/groups/delete.php @@ -11,8 +11,6 @@ require_once dirname(__FILE__) . '/../../lib/Application.php'; Horde_Registry::appInit('kronolith'); -require_once KRONOLITH_BASE . '/lib/Forms/DeleteResourceGroup.php'; - // Exit if this isn't an authenticated administrative user. if (!$registry->isAdmin()) { Horde::url($prefs->getValue('defaultview') . '.php', true)->redirect(); @@ -30,7 +28,7 @@ try { Horde::url('resources/groups/', true)->redirect(); } -$form = new Kronolith_DeleteResourceGroupForm($vars, $resource); +$form = new Kronolith_Form_DeleteResourceGroup($vars, $resource); // Execute if the form is valid (must pass with POST variables only). if ($form->validate(new Horde_Variables($_POST))) { diff --git a/kronolith/resources/groups/edit.php b/kronolith/resources/groups/edit.php index 033635fb4..0827cb162 100644 --- a/kronolith/resources/groups/edit.php +++ b/kronolith/resources/groups/edit.php @@ -11,8 +11,6 @@ require_once dirname(__FILE__) . '/../../lib/Application.php'; Horde_Registry::appInit('kronolith'); -require_once KRONOLITH_BASE . '/lib/Forms/EditResourceGroup.php'; - // Exit if this isn't an authenticated administrative user. if (!$registry->isAdmin()) { Horde::url($prefs->getValue('defaultview') . '.php', true)->redirect(); @@ -29,7 +27,7 @@ try { $notification->push($e, 'horde.error'); Horde::url('resources/groups/', true)->redirect(); } -$form = new Kronolith_EditResourceGroupForm($vars, $group); +$form = new Kronolith_Form_EditResourceGroup($vars, $group); // Execute if the form is valid. if ($form->validate($vars)) { -- 2.11.0