$cats = array();
foreach($this->Operations as $op) {
- if (!isset($cats[$op->description->category])) {
+ if (!isset($op->description->category)) {
echo "missing Category for {$this->name}::{$op->name}\n";
} else {
$cats[$op->description->category] = isset($cats[$op->description->category]) ? $cats[$op->description->category] : array();
- $cats[$op->description->category][] = str_replace('_','-',sstrtolower($this->name)). '/'. $op->name;
+ $cats[$op->description->category][] = $op->name;
}
$ret[str_replace('_','-',strtolower($this->name)). '/'.$op->name] = $op->toJS();
}
foreach($this->Attributes as $op) {
// $ret[$this->name . '.'.$op->name] = $op->toJS();
}
+ $ret[ $this->name] = array();
+ foreach($cats as $k=>$v ) {
+ $ret[ $this->name][$k] = $this->catsToJs($v);
+ }
+
+
return $ret;
}
+ function catsToJs($ar)
+ {
+ sort($ar);
+ $ret = array(
+ 'xns' => 'Roo.bootstrap',
+ 'xtype' => 'NavGroup',
+ 'items' => array(
+
+ )
+ );
+ foreach($ar as $c) {
+ $ret['items'][] = array(
+ 'xns' => 'Roo.bootstrap',
+ 'xtype' => 'NavItem',
+ 'href' => '#' . str_replace('_','-',strtolower($this->name)). '/'.$c,
+ 'html' => $c
+ );
+ }
+
+
+
+ }
+
+
}
?>
\ No newline at end of file