From 53ed056acb5bf13efba14173c0502f381c62856f Mon Sep 17 00:00:00 2001 From: Benoit Tremblay Date: Thu, 05 Nov 2009 16:36:52 +0000 Subject: remove some duplication in views --- diff --git a/site/app/controllers/tutorius_api_controller.php b/site/app/controllers/tutorius_api_controller.php index 40acccb..05755cc 100644 --- a/site/app/controllers/tutorius_api_controller.php +++ b/site/app/controllers/tutorius_api_controller.php @@ -36,7 +36,6 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -//require_once('Archive/Zip.php'); vendor('sphinx/addonsSearch'); uses('sanitize'); @@ -66,22 +65,11 @@ class TutoriusApiController extends AppController 'Html', 'Link', 'Time', 'Localization' ); - var $securityLevel = 'low'; - const STATUS_OK = '200 OK'; const STATUS_CREATED = '201 Created'; - const STATUS_ACCEPTED = '202 Accepted'; - const STATUS_FOUND = '302 Found'; - const STATUS_SEE_OTHER = '303 See Other'; const STATUS_NOT_MODIFIED = '304 Not Modified'; - const STATUS_BAD_REQUEST = '400 Bad Request'; const STATUS_UNAUTHORIZED = '401 Unauthorized'; - const STATUS_FORBIDDEN = '403 Forbidden'; - const STATUS_NOT_FOUND = '404 Not Found'; const STATUS_METHOD_NOT_ALLOWED = '405 Method Not Allowed'; - const STATUS_CONFLICT = '409 Conflict'; - const STATUS_GONE = '410 Gone'; - const STATUS_UNSUPPORTED_MEDIA = '415 Unsupported Media Type'; const STATUS_ERROR = '500 Internal Server Error'; var $cache_lifetime = 0; // 0 seconds @@ -250,8 +238,6 @@ class TutoriusApiController extends AppController function tutorials_GET($context, $category='all', $page=1, $limit=10, $sort_by='') { extract($context); - - $this->forceShadowDb(); $addontype = ADDON_TUTORIUS; @@ -902,6 +888,7 @@ class TutoriusApiController extends AppController } $addon_id = $data['Addon']['id']; + // now get the newly created tutorial, associate it with // categories and return it $this->_getTutorials(array($addon_id)); diff --git a/site/app/views/tutorius_api/publish.thtml b/site/app/views/tutorius_api/publish.thtml index e7d3f0d..6eb1e28 100644 --- a/site/app/views/tutorius_api/publish.thtml +++ b/site/app/views/tutorius_api/publish.thtml @@ -37,87 +37,7 @@ if (isset($error)) { ?> - - - - '> - - - '> - - - - - - - urlImage(DEFAULT_THEME_ICON) : $html->urlImage(DEFAULT_ADDON_ICON)); - echo $amo.$tutorialIconPath; - } ?> - - - - - - - - 1) { ?> - - - - - - - - ?src=api - - '> - - - - - - \ No newline at end of file +} else { + $addon = $tutorial; + include 'tutorial_display.thtml'; +} ?> \ No newline at end of file diff --git a/site/app/views/tutorius_api/tutorial_display.thtml b/site/app/views/tutorius_api/tutorial_display.thtml index 433b342..eeaf69a 100644 --- a/site/app/views/tutorius_api/tutorial_display.thtml +++ b/site/app/views/tutorius_api/tutorial_display.thtml @@ -48,7 +48,8 @@ if (isset($addon_pre)) echo $addon_pre; ?> - '> + + '> '>