Add more files to have a basic and empty working app
parent
0dd407abf1
commit
c656d7eb50
|
@ -21,7 +21,7 @@ if (class_exists('\OCP\AppFramework\App')) {
|
|||
'order' => 10,
|
||||
|
||||
// the route that will be shown on startup
|
||||
'href' => \OCP\Util::linkToRoute('weather.board.index'),
|
||||
'href' => \OCP\Util::linkToRoute('weather.city.index'),
|
||||
|
||||
// the icon that will be shown in the navigation
|
||||
// this file needs to exist in img/
|
||||
|
|
|
@ -37,7 +37,7 @@ class Application extends App {
|
|||
* Database Layer
|
||||
*/
|
||||
$container->registerService('CityMapper', function(IContainer $c) {
|
||||
return new BoardMapper($c->query('ServerContainer')->getDb());
|
||||
return new CityMapper($c->query('ServerContainer')->getDb());
|
||||
});
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* ownCloud - owncity
|
||||
* ownCloud - Weather
|
||||
*
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later. See the COPYING file.
|
||||
|
@ -9,7 +9,7 @@
|
|||
* @copyright Loic Blot 2015
|
||||
*/
|
||||
|
||||
namespace OCA\OwnBoard\AppInfo;
|
||||
namespace OCA\Weather\AppInfo;
|
||||
|
||||
$application = new Application();
|
||||
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
/**
|
||||
* ownCloud - Weather
|
||||
*
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later. See the COPYING file.
|
||||
*
|
||||
* @author Loic Blot <loic.blot@unix-experience.fr>
|
||||
* @copyright Loic Blot 2015
|
||||
*/
|
||||
|
||||
namespace OCA\Weather\Controller;
|
||||
|
||||
use \OCP\IRequest;
|
||||
use \OCP\AppFramework\Http\TemplateResponse;
|
||||
use \OCP\AppFramework\Controller;
|
||||
use \OCP\AppFramework\Http\JSONResponse;
|
||||
use \OCP\AppFramework\Http;
|
||||
|
||||
use \OCA\Weather\Db\CityMapper;
|
||||
|
||||
class CityController extends Controller {
|
||||
|
||||
private $userId;
|
||||
private $mapper;
|
||||
|
||||
public function __construct ($appName, IRequest $request, $userId, CityMapper $mapper) {
|
||||
parent::__construct($appName, $request);
|
||||
$this->userId = $userId;
|
||||
$this->mapper = $mapper;
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
*/
|
||||
public function index () {
|
||||
return new TemplateResponse($this->appName, 'main');
|
||||
}
|
||||
};
|
||||
?>
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
/**
|
||||
* ownCloud - weather
|
||||
*
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later. See the COPYING file.
|
||||
*
|
||||
* @author Loic Blot <loic.blot@unix-experience.fr>
|
||||
* @copyright Loic Blot 2015
|
||||
*/
|
||||
|
||||
namespace OCA\Weather\Db;
|
||||
|
||||
use \OCP\IDb;
|
||||
|
||||
use \OCP\AppFramework\Db\Mapper;
|
||||
|
||||
class CityMapper extends Mapper {
|
||||
public function __construct (IDb $db) {
|
||||
parent::__construct($db, 'weather_city');
|
||||
}
|
||||
};
|
||||
?>
|
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* ownCloud - ownBoard
|
||||
* ownCloud - Weather
|
||||
*
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later. See the COPYING file.
|
||||
|
@ -47,4 +47,5 @@ app.controller('WeatherController', ['$scope', '$interval', '$timeout', '$compil
|
|||
$scope.fatalError();
|
||||
});
|
||||
};
|
||||
}
|
||||
]);
|
||||
|
|
Loading…
Reference in New Issue