From: Ben Klang Date: Fri, 2 Apr 2010 21:08:25 +0000 (-0400) Subject: Shout: Convert adding extensions to AJAX X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=c87445e14b3687100ebe84b85448ad72832d014e;p=horde.git Shout: Convert adding extensions to AJAX --- 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 @@
-