]> jfr.im git - z_archive/KronOS.git/blobdiff - kosapps/common.php
Added ability for apps to define javascript -- static method scripts -- not core...
[z_archive/KronOS.git] / kosapps / common.php
index 1720098c4a2afdc6a23d291ef826e5cd58311ae8..e72d25ef8af258a012e4b1068e9fd1b125e86f13 100644 (file)
@@ -1,21 +1,22 @@
 <?php
 
 abstract class KOS_App {
-       function __construct($iid) {
+       function __construct($iid, $aid) {
                $this->iid = $iid;
+               $this->aid = $aid;
        }
-       public function iid() {
-               return $this->iid;
-       }
+       public function iid() { return $this->iid; }
+       public function aid() { return $this->aid; }
 
        abstract public function appName();
        abstract public function windowTitle();
        abstract public function windowContents();
 
-       public function opening() { return; }
-       public function closing() { return; }
+       public function opening() { return; } // default
+       public function closing() { return; } // default
 
-       abstract public function act($action);
+       public static function scripts($aid) { return 'wos.appscripts['.$aid.'] = {load: function(t){this.target = t}};'; } // default
+       public function act($action) { return $action; } // default, but will only work for static ("content") apps.
 }
 
 ?>