]> jfr.im git - z_archive/KronOS.git/blob - application/controllers/control.php
Starting work on app framework. Changes to config.php
[z_archive/KronOS.git] / application / controllers / control.php
1 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
2
3 /* TODO: error handling */
4
5 class Control extends CI_Controller {
6
7 public function __construct() {
8 parent::__construct();
9 $this->load->model('user');
10 $this->load->model('session');
11 }
12
13 public function index() {
14 }
15
16 public function open($aid) {
17 if ($this->user->is_logged_in()) {
18 $instance = $this->session->openApp($aid);
19
20 $repl = array('id' => $instance->iid(), 'name' => $instance->appName(), 'title' => $instance->windowTitle(), 'interior' => $instance->windowContents());
21 $this->json->reply($this->user->is_logged_in());
22 } else {
23 $this->json->error('Not logged in.');
24 }
25 }
26
27 public function act($iid, $action) {
28 // return $this->session->getAppInst($iid)->act($action);
29 }
30
31 public function close($iid) {
32 $this->session->closeApp($iid);
33 }
34 }
35 ?>