Add more files to have a basic and empty working app

master
Loic Blot 2015-07-08 21:40:17 +00:00
parent 0dd407abf1
commit c656d7eb50
6 changed files with 70 additions and 5 deletions

View File

@ -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/

View File

@ -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());
});
/**

View File

@ -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();

View File

@ -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');
}
};
?>

23
db/citymapper.php 100644
View File

@ -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');
}
};
?>

View File

@ -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();
});
};
}
]);