BiAuditGraph.php 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. Lib::loadClass('Api_WfsNs');
  3. class Route_UrlAction_BiAuditGraph extends RouteBase {
  4. function defaultAction() {
  5. UI::layout([$this, 'defaultView']);
  6. }
  7. function defaultView() {
  8. // typeName = "default_db__x3A__BI_audit_KRS_person:BI_audit_KRS_person"
  9. $namespace = 'default_db/BI_audit_KRS_person/BI_audit_KRS_person'; // V::get('namespace', '', $_GET);
  10. if (!$namespace) throw new Exception("Missing namespace");
  11. $primaryKey = V::get('primaryKey', '', $_GET);
  12. if (!$primaryKey) throw new Exception("Missing primaryKey");
  13. echo UI::h('div', [ 'id' => "ref_graph_node", 'style' => "width:98%; height:500px; border:1px solid silver; margin:8px auto; padding:0" ], [
  14. "Pobieranie danych..."
  15. ]);
  16. echo UI::h('script', [ 'src' => "static/visjs/vis.min.js" ]);
  17. echo UI::h('style', [ 'type' => "text/css", 'src' => "static/visjs/vis.min.css" ]);
  18. UI::inlineJS(__FILE__ . '.view.js', [
  19. 'HTML_ID_REF_GRAPH' => 'ref_graph_node',
  20. 'TYPENAME' => Api_WfsNs::typeName($namespace),
  21. 'PRIMARY_KEY' => $primaryKey,
  22. 'WFS_URL' => Router::getRoute('WfsBiAudit')->getLink(),
  23. 'DBG' => (V::get('DBG', 0, $_GET, 'int') > 0),
  24. ]);
  25. }
  26. }