X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=blobdiff_plain;f=Bjs.php;h=f2a4379e98b8ff99f9298c7754e7b590b31108b5;hp=1950d84777bb017ab5321d0151d5181ac3ddcf4a;hb=443623f47935eb52acd65a3ff0d84eab1fd5a98b;hpb=7c3da72f9a61f862857d2234e16b6e491193c318 diff --git a/Bjs.php b/Bjs.php index 1950d847..f2a4379e 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 2; + } $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); + } + } + } + } + }