X-Git-Url: http://git.roojs.org/?a=blobdiff_plain;f=Bjs.php;h=d936bcf9bbc031bca7028c563c15795c7d9d4015;hb=701b16754ea233993bdc7d65d5181696cc53cc9b;hp=1950d84777bb017ab5321d0151d5181ac3ddcf4a;hpb=7c3da72f9a61f862857d2234e16b6e491193c318;p=Pman.Core diff --git a/Bjs.php b/Bjs.php index 1950d847..d936bcf9 100644 --- a/Bjs.php +++ b/Bjs.php @@ -10,12 +10,13 @@ class Pman_Core_Bjs { var $json; var $fields = array(); - + var $cols = array(); function __construct($file) { $this->json = json_decode(file_get_contents($file)); $this->iterateFields($this->json->items); + $this->iterateColumns($this->json->items); } function iterateFields($ar) @@ -23,7 +24,10 @@ class Pman_Core_Bjs { foreach($ar as $o) { switch ($o->xtype) { - case "ComboBox": + case "ComboBox": + if (!isset($o->{'String hiddenName'})) { + continue; + } $this->fields[] = $o->{'String hiddenName'}; // fall throught.. $k = isset($o->{'String name'}) ? 'String name' : 'string name'; @@ -66,6 +70,20 @@ class Pman_Core_Bjs { } } - + function iterateColumns($ar) + { + foreach($ar as $o) { + switch ($o->xtype) { + case "ColumnModel": + $this->cols[] = $o; + break; + default: + if (isset($o->items)) { + $this->iterateColumns($o->items); + } + } + } + } + }