]> jfr.im git - z_archive/KronOS.git/blobdiff - application/controllers/control.php
Starting work on app framework. Changes to config.php
[z_archive/KronOS.git] / application / controllers / control.php
diff --git a/application/controllers/control.php b/application/controllers/control.php
new file mode 100644 (file)
index 0000000..3ee3685
--- /dev/null
@@ -0,0 +1,35 @@
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+
+/* TODO: error handling */
+
+class Control extends CI_Controller {
+
+       public function __construct() {
+               parent::__construct();
+               $this->load->model('user');
+               $this->load->model('session');
+       }
+
+       public function index() {
+       }
+
+       public function open($aid) {
+               if ($this->user->is_logged_in()) {
+                       $instance = $this->session->openApp($aid);
+
+                       $repl = array('id' => $instance->iid(), 'name' => $instance->appName(), 'title' => $instance->windowTitle(), 'interior' => $instance->windowContents());
+                       $this->json->reply($this->user->is_logged_in());
+               } else {
+                       $this->json->error('Not logged in.');
+               }
+       }
+
+       public function act($iid, $action) {
+//             return $this->session->getAppInst($iid)->act($action);
+       }
+
+       public function close($iid) {
+               $this->session->closeApp($iid);
+       }
+}
+?>