prefs refactoring: partial implementation (wip)
[brisk.git] / web / Obj / dbase_base.phh
index 66c998f..d2cebbc 100644 (file)
@@ -98,6 +98,25 @@ class LoginDBItem {
     {
         return $this->supp_comp;
     }
+    function supp_comp_get_array()
+    {
+        $ret = array();
+        $group_id = array("fg", "bg");
+        $comp_id = array("r", "g", "b");
+        $ret_arr = array();
+        $supp_comp = $this->supp_comp;
+
+        for ($i = 0 ; $i < 2 ; $i++) {
+            $group_cur = $group_id[$i];
+            $ret_arr[$group_cur] = array();
+            for ($e = 0 ; $e < 3 ; $e++) {
+                $ret_arr[$group_cur][$comp_id[$e]] = base_convert(substr($supp_comp, $i*3 + $e, 2), 16, 10);
+            }
+        }
+
+        return ($ret_arr);
+    }
+
     function supp_comp_set($supp_comp)
     {
         $this->supp_comp = $supp_comp;