RefGraph.php 1.3 KB

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