X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=blobdiff_plain;f=Bjs.php;fp=Bjs.php;h=d936bcf9bbc031bca7028c563c15795c7d9d4015;hp=1950d84777bb017ab5321d0151d5181ac3ddcf4a;hb=1a0a4a8e210ae6708cb6caed163d24970fabd4c9;hpb=c623872838420a0cfb76596d7b09a694a1ee5f26 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); + } + } + } + } + }