From c87445e14b3687100ebe84b85448ad72832d014e Mon Sep 17 00:00:00 2001 From: Ben Klang Date: Fri, 2 Apr 2010 17:08:25 -0400 Subject: [PATCH] Shout: Convert adding extensions to AJAX --- shout/lib/Ajax/Application.php | 20 ++++++++++++ shout/templates/extensions.inc.php | 62 +++++++++++++++++++++++++++++++++----- shout/themes/screen.css | 24 +++++++++++---- 3 files changed, 93 insertions(+), 13 deletions(-) diff --git a/shout/lib/Ajax/Application.php b/shout/lib/Ajax/Application.php index 9fcf545fd..5cecd5f2a 100644 --- a/shout/lib/Ajax/Application.php +++ b/shout/lib/Ajax/Application.php @@ -27,6 +27,26 @@ class Shout_Ajax_Application extends Horde_Ajax_Application_Base return null; } + public function saveExtension() + { + try { + $shout = $GLOBALS['registry']->getApiInstance('shout', 'application'); + $curaccount = $_SESSION['shout']['curaccount']; + require_once SHOUT_BASE . '/lib/Forms/ExtensionForm.php'; + $this->_vars->set('account', $curaccount['code']); + $Form = new ExtensionDetailsForm($this->_vars); + $Form->setSubmitted(); + if ($Form->isValid()) { + $Form->execute(); + return true; + } + } catch (Exception $e) { + //FIXME: Create a way to notify the user of the failure. + Horde::logMessage($e, 'ERR'); + return false; + } + } + /** * TODO */ diff --git a/shout/templates/extensions.inc.php b/shout/templates/extensions.inc.php index 955827112..d8ff56476 100644 --- a/shout/templates/extensions.inc.php +++ b/shout/templates/extensions.inc.php @@ -42,7 +42,7 @@
-