array(
'id' => 'grauphel',
'order' => 2342,
- 'href' => OCP\Util::linkTo('grauphel', 'index.php'),
+ 'href' => \OCP\Util::linkToRoute('grauphel.gui.index'),
'icon' => OCP\Util::imagePath('grauphel', 'notes.png'),
'name' => 'Tomboy notes'
)
--- /dev/null
+<?php
+/**
+ * Part of grauphel
+ *
+ * PHP version 5
+ *
+ * @category Tools
+ * @package Grauphel
+ * @author Christian Weiske <cweiske@cweiske.de>
+ * @copyright 2014 Christian Weiske
+ * @license http://www.gnu.org/licenses/agpl.html GNU AGPL v3
+ * @link http://cweiske.de/grauphel.htm
+ */
+namespace OCA\Grauphel\Controller;
+
+use \OCP\AppFramework\Controller;
+use \OCP\AppFramework\Http\TemplateResponse;
+
+/**
+ * Owncloud frontend
+ *
+ * @category Tools
+ * @package Grauphel
+ * @author Christian Weiske <cweiske@cweiske.de>
+ * @copyright 2014 Christian Weiske
+ * @license http://www.gnu.org/licenses/agpl.html GNU AGPL v3
+ * @version Release: @package_version@
+ * @link http://cweiske.de/grauphel.htm
+ */
+class GuiController extends Controller
+{
+ /**
+ * constructor of the controller
+ *
+ * @param string $appName Name of the app
+ * @param IRequest $request Instance of the request
+ */
+ public function __construct($appName, \OCP\IRequest $request, $user, $urlGen)
+ {
+ parent::__construct($appName, $request);
+ $this->user = $user;
+ $this->urlGen = $urlGen;
+
+ //default http header: we assume something is broken
+ header('HTTP/1.0 500 Internal Server Error');
+ }
+
+ /**
+ * Main page /
+ *
+ * @NoAdminRequired
+ * @NoCSRFRequired
+ */
+ public function index()
+ {
+ $res = new TemplateResponse('grauphel', 'index');
+ $res->setParams(
+ array(
+ 'apiurl' => $this->urlGen->getAbsoluteURL(
+ $this->urlGen->linkToRoute(
+ 'grauphel.gui.index'
+ )
+ ),
+ )
+ );
+ return $res;
+
+ }
+}
+?>
+++ /dev/null
-<?php
-
-// Check if we are a user
-OCP\User::checkLoggedIn();
-
-$somesetting = OCP\Config::getSystemValue( "somesetting", '' );
-OCP\App::setActiveNavigationEntry( 'grauphel' );
-$tmpl = new OCP\Template( 'grauphel', 'main', 'user' );
-$tmpl->assign( 'somesetting', $somesetting );
-$tmpl->printPage();
--- /dev/null
+<div style="margin: 1em;">
+ <h1 style="font-size: 2em; font-weight: bold">Tomboy notes server</h1>
+ <p style="margin: 1em;">
+ To use the REST API, use the follwing server with tomboy:
+ </p>
+ <pre style="margin: 1em; background-color: #DDD; padding: 1ex; font-family: monospace"><?php p($_['apiurl']); ?></pre>
+</div>