bocian.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <?php
  2. // TODO: file and class name must have the same name as project
  3. class Theme_bocian extends ThemeDefault {
  4. function head() {
  5. // echo ''; // TODO: dodać bootsrap-theme-bocian
  6. echo '<meta name="robots" content="noindex, nofollow">';
  7. UI::inlineCSS(dirname(__FILE__) . '/assets/css/styles.css');
  8. // main color: #d7142d - red
  9. echo UI::h('style', [ 'type' => "text/css" ], "
  10. .AjaxTable { font-size:14px }
  11. .AjaxTable .tblAjax__head__filter .stickyCol1 button { padding:1px 3px }
  12. .AjaxTable tbody .stickyCol1 { font-size:12px }
  13. .popover-content li { text-align:left; font-size:14px }
  14. .bi-btn-primary { padding:6px 12px; font-size:14px; background-color:#fff; color:#d7142d; border-color:#d7142d; }
  15. .bi-btn-primary:hover { background-color:#d7142d; color:#fff; border-color:#d7142d; }
  16. .bi-btn-primary .badge { background-color:#d7142d; color:#fff; border-color:#d7142d; }
  17. .bi-btn-primary:hover .badge { background-color:#fff; color:#d7142d; border-color:#d7142d; }
  18. .bi-btn-disabled-group-label { cursor: default; padding:6px 12px; font-size:14px; background-color:#fff; color:#d7142d; border-color:#d7142d; }
  19. .btn-primary .badge { background-color:#d7142d; color:#fff; }
  20. .btn-primary:hover .badge { background-color:#fff; color:#d7142d; }
  21. .btn-xs { padding:6px 12px; }
  22. .btn-xs .badge { padding:2px 5px; }
  23. ");
  24. UI::inlineRawJS(dirname(__FILE__) . '/assets/js/graph/d3.v3.min.js');
  25. UI::inlineRawJS(dirname(__FILE__) . '/assets/js/graph/csaladenes/sankey/sankey.js');
  26. // UI::inlineRawJS(dirname(__FILE__) . '/assets/js/graph/csaladenes/sankey/sankey-init.js');
  27. UI::inlineRawJS(dirname(__FILE__) . '/assets/js/graph/sankey-init-widget.js');
  28. }
  29. function top() {
  30. include dirname(__FILE__) . '/view/top.php';
  31. //todo: demo load data for graph :DELETE line if tested
  32. // UI::inlineRawJS(dirname(__FILE__) . '/demoGraph/sampleData/sampleData.js');
  33. // UI::inlineRawJS(dirname(__FILE__) . '/assets/js/graph/GetFeature.js');
  34. // UI::inlineRawJS(dirname(__FILE__) . '/assets/js/graph/parser.js');
  35. }
  36. function footer() {
  37. include dirname(__FILE__) . '/view/footer.php';
  38. //todo: ujednolicic wczytanie themy widoków i css w jednym katalogu(obecnie css w katalogu static a widoki w katalogu tmp )
  39. UI::inlineRawJS(dirname(__FILE__) . '/assets/js/scripts.js');
  40. if ('ViewTableAjax' === V::get('_route', '', $_GET)
  41. && 'default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA' === V::get('namespace', '', $_GET)
  42. ) {
  43. UI::inlineJS(dirname(__FILE__) . '/assets/js/updateRaportProgress.js', [
  44. 'DBG' => (V::get('DBG', '', $_GET)),
  45. 'DBG_FAKE_ANIM' => (V::get('DBG_FAKE_ANIM', '', $_GET)),
  46. 'URL_FETCH_BI_AUDIT_PROGRESS' => Router::getRoute('UrlAction_Bocian')->getLink('fetchProgressAjax', [ 'SKIP_TIMER' => "1" ])
  47. ]);
  48. }
  49. UI::inlineJS(dirname(__FILE__) . '/assets/js/updateLastRaportProgress.js', [
  50. 'DBG' => (V::get('DBG', '', $_GET)),
  51. 'DBG_FAKE_ANIM' => (V::get('DBG_FAKE_ANIM', '', $_GET)),
  52. 'URL_FETCH_BI_AUDIT_PROGRESS' => Router::getRoute('UrlAction_Bocian')->getLink('fetchProgressAjax', [ 'SKIP_TIMER' => "1" ]),
  53. 'URL_BI_AUDIT_RESULT' => Router::getRoute('UrlAction_BiAuditGenerate')->getLink(''),
  54. 'ID_ARG_BI_AUDIT_RESULT' => 'ID_BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA'
  55. ]);
  56. // override checkbox selecting for live select to localStorage - PROBLEM: how to choose OD/DO?
  57. if ('ViewTableAjax' === V::get('_route', '', $_GET)
  58. // TODO: what tables? maybe GET arg?
  59. // && 'default_db/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA/BI_audit_ENERGA_RUM_KONTRAHENCI_POWIAZANIA' === V::get('namespace', '', $_GET)
  60. ) {
  61. $keyPrefix = $this->_getKeyPrefixFromNamespace(V::get('namespace', '', $_GET));
  62. if ($keyPrefix) {
  63. UI::inlineJS(dirname(__FILE__) . '/assets/js/createTableSelectedStateObject.js', [
  64. // 'URI_WPS' => Request::getPathUri() . 'wps.php',
  65. 'KEY_PREFIX' => $keyPrefix,
  66. 'BAZA_OD_DO' => V::get('BAZA_OD_DO', '', $_GET), // OD | DO | ''
  67. 'URL_BAZA_OD' => 'index.php?' . http_build_query(array_merge($_GET, [ 'BAZA_OD_DO' => 'OD' ])),
  68. 'URL_BAZA_DO' => 'index.php?' . http_build_query(array_merge($_GET, [ 'BAZA_OD_DO' => 'DO' ])),
  69. 'URL_BAZA_NONE' => 'index.php?' . http_build_query(array_merge($_GET, [ 'BAZA_OD_DO' => '' ])),
  70. 'DBG' => ('1' === V::get('DBG_JS', '', $_GET)),
  71. ]);
  72. }
  73. }
  74. }
  75. function _getKeyPrefixFromNamespace($ns) {
  76. switch ($ns) {
  77. case 'default_db/BI_audit_KRS/BI_audit_KRS': return 'KRS';
  78. case 'default_db/BI_audit_KRS_person/BI_audit_KRS_person': return 'KRS/p';
  79. case 'default_db/BI_audit_MSIG/BI_audit_MSIG': return 'MSIG';
  80. case 'default_db/BI_audit_MSIG_person/BI_audit_MSIG_person': return 'MSIG/p';
  81. case 'default_db/BI_audit_CEIDG/BI_audit_CEIDG': return 'CEIDG';
  82. default: return '';
  83. }
  84. }
  85. function login($data) {
  86. if (is_array($data) && !empty($data)) {
  87. extract($data);
  88. }
  89. include dirname(__FILE__) . '/view/login.php';
  90. }
  91. function logout($data) {
  92. if (is_array($data) && !empty($data)) {
  93. extract($data);
  94. }
  95. include dirname(__FILE__) . '/view/logout.php';
  96. }
  97. function home($data) {
  98. if (is_array($data) && !empty($data)) {
  99. extract($data);
  100. }
  101. include dirname(__FILE__) . '/view/home.php';
  102. }
  103. }