summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--appinfo/routes.php8
-rw-r--r--controller/entityapiserializer.php6
-rw-r--r--controller/feedapicontroller.php1
-rw-r--r--controller/folderapicontroller.php1
-rw-r--r--controller/jsonhttperror.php4
-rw-r--r--http/downloadresponse.php40
-rw-r--r--http/textdownloadresponse.php2
-rw-r--r--js/app/services/businesslayer/feedbusinesslayer.coffee2
-rw-r--r--js/app/services/businesslayer/folderbusinesslayer.coffee2
-rw-r--r--templates/main.php12
-rw-r--r--tests/unit/http/DownloadResponseTest.php41
-rw-r--r--utility/methodannotationreader.php50
12 files changed, 13 insertions, 156 deletions
diff --git a/appinfo/routes.php b/appinfo/routes.php
index 4d91273b6..2d59e7ff7 100644
--- a/appinfo/routes.php
+++ b/appinfo/routes.php
@@ -60,10 +60,10 @@ $application->registerRoutes($this, array('routes' => array(
array('name' => 'export#articles', 'url' => '/export/articles', 'verb' => 'GET'),
// API
- array('name' => 'api#version', 'url' => '/api/v1-2/version', 'verb' => 'GET'),
- array('name' => 'api#before_update', 'url' => '/api/v1-2/cleanup/before-update', 'verb' => 'GET'),
- array('name' => 'api#after_update', 'url' => '/api/v1-2/cleanup/after-update', 'verb' => 'GET'),
- array('name' => 'api#preflighted_cors', 'url' => '/api/v1-2/{path}', 'verb' => 'OPTIONS', 'requirements' => array('path' => '.+')),
+ array('name' => 'utility_api#version', 'url' => '/api/v1-2/version', 'verb' => 'GET'),
+ array('name' => 'utility_api#before_update', 'url' => '/api/v1-2/cleanup/before-update', 'verb' => 'GET'),
+ array('name' => 'utility_api#after_update', 'url' => '/api/v1-2/cleanup/after-update', 'verb' => 'GET'),
+ array('name' => 'utility_api#preflighted_cors', 'url' => '/api/v1-2/{path}', 'verb' => 'OPTIONS', 'requirements' => array('path' => '.+')),
// folders
array('name' => 'folder_api#index', 'url' => '/api/v1-2/folders', 'verb' => 'GET'),
diff --git a/controller/entityapiserializer.php b/controller/entityapiserializer.php
index ef5e20fbe..6548fe6fd 100644
--- a/controller/entityapiserializer.php
+++ b/controller/entityapiserializer.php
@@ -5,16 +5,15 @@
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
- * @author Alessandro Cosentino <cosenal@gmail.com>
* @author Bernhard Posselt <dev@bernhard-posselt.com>
- * @copyright Alessandro Cosentino 2012
- * @copyright Bernhard Posselt 2012, 2014
+ * @copyright Bernhard Posselt 2014
*/
namespace OCA\News\Controller;
use \OCP\AppFramework\Http\IResponseSerializer;
+
class EntityApiSeralizer implements IResponseSerializer {
@@ -41,4 +40,5 @@ class EntityApiSeralizer implements IResponseSerializer {
}
}
+
} \ No newline at end of file
diff --git a/controller/feedapicontroller.php b/controller/feedapicontroller.php
index b326a1825..7d68e5f56 100644
--- a/controller/feedapicontroller.php
+++ b/controller/feedapicontroller.php
@@ -17,7 +17,6 @@ use \OCP\IRequest;
use \OCP\ILogger;
use \OCP\AppFramework\ApiController;
use \OCP\AppFramework\Http;
-use \OCP\AppFramework\Http\JSONResponse;
use \OCA\News\BusinessLayer\FeedBusinessLayer;
use \OCA\News\BusinessLayer\FolderBusinessLayer;
diff --git a/controller/folderapicontroller.php b/controller/folderapicontroller.php
index 4e9f3e00c..bf78bdf72 100644
--- a/controller/folderapicontroller.php
+++ b/controller/folderapicontroller.php
@@ -16,7 +16,6 @@ namespace OCA\News\Controller;
use \OCP\IRequest;
use \OCP\AppFramework\ApiController;
use \OCP\AppFramework\Http;
-use \OCP\AppFramework\Http\JSONResponse;
use \OCA\News\BusinessLayer\FolderBusinessLayer;
use \OCA\News\BusinessLayer\ItemBusinessLayer;
diff --git a/controller/jsonhttperror.php b/controller/jsonhttperror.php
index 5948a8a63..dca0cb2f3 100644
--- a/controller/jsonhttperror.php
+++ b/controller/jsonhttperror.php
@@ -5,10 +5,8 @@
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
- * @author Alessandro Cosentino <cosenal@gmail.com>
* @author Bernhard Posselt <dev@bernhard-posselt.com>
- * @copyright Alessandro Cosentino 2012
- * @copyright Bernhard Posselt 2012, 2014
+ * @copyright Bernhard Posselt 2014
*/
namespace OCA\News\Controller;
diff --git a/http/downloadresponse.php b/http/downloadresponse.php
deleted file mode 100644
index 15489529c..000000000
--- a/http/downloadresponse.php
+++ /dev/null
@@ -1,40 +0,0 @@
-<?php
-/**
- * ownCloud - News
- *
- * This file is licensed under the Affero General Public License version 3 or
- * later. See the COPYING file.
- *
- * @author Alessandro Cosentino <cosenal@gmail.com>
- * @author Bernhard Posselt <dev@bernhard-posselt.com>
- * @copyright Alessandro Cosentino 2012
- * @copyright Bernhard Posselt 2012, 2014
- */
-
-namespace OCA\News\Http;
-
-use \OCP\AppFramework\Http\Response;
-
-/**
- * Prompts the user to download the a file
- */
-class DownloadResponse extends Response {
-
- private $filename;
- private $contentType;
-
- /**
- * Creates a response that prompts the user to download the file
- * @param string $filename the name that the downloaded file should have
- * @param string $contentType the mimetype that the downloaded file should have
- */
- public function __construct($filename, $contentType) {
- $this->filename = $filename;
- $this->contentType = $contentType;
-
- $this->addHeader('Content-Disposition', 'attachment; filename="' . $filename . '"');
- $this->addHeader('Content-Type', $contentType);
- }
-
-
-}
diff --git a/http/textdownloadresponse.php b/http/textdownloadresponse.php
index a0821f43a..06b331d5d 100644
--- a/http/textdownloadresponse.php
+++ b/http/textdownloadresponse.php
@@ -13,6 +13,8 @@
namespace OCA\News\Http;
+use \OCP\AppFramework\Http\DownloadResponse;
+
/**
* Prompts the user to download the a textfile
diff --git a/js/app/services/businesslayer/feedbusinesslayer.coffee b/js/app/services/businesslayer/feedbusinesslayer.coffee
index 713ce2657..2700caeb5 100644
--- a/js/app/services/businesslayer/feedbusinesslayer.coffee
+++ b/js/app/services/businesslayer/feedbusinesslayer.coffee
@@ -172,7 +172,7 @@ FeedModel, NewLoading, _ExistsError, Utils, $rootScope, NewestItem)->
onSuccess(response)
failure = (response) ->
- feed.error = response.msg
+ feed.error = response.message
onFailure()
@_persistence.createFeed(url, parentId, success, failure)
diff --git a/js/app/services/businesslayer/folderbusinesslayer.coffee b/js/app/services/businesslayer/folderbusinesslayer.coffee
index ceb406b59..60bde1c4e 100644
--- a/js/app/services/businesslayer/folderbusinesslayer.coffee
+++ b/js/app/services/businesslayer/folderbusinesslayer.coffee
@@ -145,7 +145,7 @@ FeedModel, $rootScope) ->
onSuccess(response)
failure = (response) ->
- folder.error = response.msg
+ folder.error = response.message
onFailure()
@_persistence.createFolder folderName, 0, success, failure
diff --git a/templates/main.php b/templates/main.php
index 8ac778dea..03c5a7c03 100644
--- a/templates/main.php
+++ b/templates/main.php
@@ -13,17 +13,7 @@
\OCP\Util::addStyle('news', 'settings');
\OCP\Util::addStyle('news', 'showall');
\OCP\Util::addStyle('news', 'firstrun');
-
-
-// stylesheets for different OC versions
-$version = \OCP\Util::getVersion();
-
-// owncloud 6
-if($version[0] > 5 || ($version[0] >= 5 && $version[1] >= 80)) {
- \OCP\Util::addStyle('news', 'owncloud6');
-}
-
-
+\OCP\Util::addStyle('news', 'owncloud6');
?>
<div id="app" ng-app="News" ng-cloak ng-controller="AppController">
diff --git a/tests/unit/http/DownloadResponseTest.php b/tests/unit/http/DownloadResponseTest.php
deleted file mode 100644
index 82884ab85..000000000
--- a/tests/unit/http/DownloadResponseTest.php
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-/**
- * ownCloud - News
- *
- * This file is licensed under the Affero General Public License version 3 or
- * later. See the COPYING file.
- *
- * @author Alessandro Cosentino <cosenal@gmail.com>
- * @author Bernhard Posselt <dev@bernhard-posselt.com>
- * @copyright Alessandro Cosentino 2012
- * @copyright Bernhard Posselt 2012, 2014
- */
-
-
-namespace OCA\News\Http;
-
-
-require_once(__DIR__ . "/../../classloader.php");
-
-
-class ChildDownloadResponse extends DownloadResponse {};
-
-
-class DownloadResponseTest extends \PHPUnit_Framework_TestCase {
-
- protected $response;
-
- protected function setUp(){
- $this->response = new ChildDownloadResponse('file', 'content');
- }
-
-
- public function testHeaders() {
- $headers = $this->response->getHeaders();
-
- $this->assertContains('attachment; filename="file"', $headers['Content-Disposition']);
- $this->assertContains('content', $headers['Content-Type']);
- }
-
-
-} \ No newline at end of file
diff --git a/utility/methodannotationreader.php b/utility/methodannotationreader.php
deleted file mode 100644
index a3732ec21..000000000
--- a/utility/methodannotationreader.php
+++ /dev/null
@@ -1,50 +0,0 @@
-<?php
-/**
- * ownCloud - News
- *
- * This file is licensed under the Affero General Public License version 3 or
- * later. See the COPYING file.
- *
- * @author Alessandro Cosentino <cosenal@gmail.com>
- * @author Bernhard Posselt <dev@bernhard-posselt.com>
- * @copyright Alessandro Cosentino 2012
- * @copyright Bernhard Posselt 2012, 2014
- */
-
-namespace OCA\News\Utility;
-
-
-/**
- * Reads and parses annotations from doc comments
- */
-class MethodAnnotationReader {
-
- private $annotations;
-
- /**
- * @param object $object an object or classname
- * @param string $method the method which we want to inspect for annotations
- */
- public function __construct($object, $method){
- $this->annotations = array();
-
- $reflection = new \ReflectionMethod($object, $method);
- $docs = $reflection->getDocComment();
-
- // extract everythin prefixed by @ and first letter uppercase
- preg_match_all('/@([A-Z]\w+)/', $docs, $matches);
- $this->annotations = $matches[1];
- }
-
-
- /**
- * Check if a method contains an annotation
- * @param string $name the name of the annotation
- * @return bool true if the annotation is found
- */
- public function hasAnnotation($name){
- return in_array($name, $this->annotations);
- }
-
-
-} \ No newline at end of file