footer.html.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. </div><?php /* end '.outer' in 'header.html.php'. */ ?>
  2. <script>
  3. $.initSidebar();
  4. </script>
  5. <?php if($extView = $this->getExtViewFile(__FILE__)){include $extView; return helper::cd();}?>
  6. <iframe frameborder='0' name='hiddenwin' id='hiddenwin' scrolling='no' class='debugwin hidden'></iframe>
  7. <?php if($onlybody != 'yes' and $app->viewType != 'xhtml'):?>
  8. </main><?php /* end '#wrap' in 'header.html.php'. */ ?>
  9. <div id="noticeBox"><?php if($config->vision != 'lite') echo $this->loadModel('score')->getNotice(); ?></div>
  10. <script>
  11. <?php $this->app->loadConfig('message');?>
  12. <?php if($config->message->browser->turnon):?>
  13. /* Alert got messages. */
  14. needPing = false;
  15. $(function()
  16. {
  17. if(window.parent && window.parent.zin) return;
  18. var windowBlur = false;
  19. if(window.Notification && Notification.permission == 'granted')
  20. {
  21. window.onblur = function(){windowBlur = true;}
  22. window.onfocus = function(){windowBlur = false;}
  23. }
  24. setInterval(function()
  25. {
  26. $.get(createLink('message', 'ajaxGetMessage', "windowBlur=" + (windowBlur ? '1' : '0')), function(data)
  27. {
  28. if(!windowBlur)
  29. {
  30. $('#noticeBox').append(data);
  31. adjustNoticePosition();
  32. }
  33. else
  34. {
  35. if(data)
  36. {
  37. if(typeof data == 'string') data = $.parseJSON(data);
  38. if(typeof data.message == 'string') notifyMessage(data);
  39. }
  40. }
  41. });
  42. }, <?php echo $config->message->browser->pollTime * 1000;?>);
  43. })
  44. <?php endif;?>
  45. <?php if(!empty($config->sso->redirect)):?>
  46. <?php
  47. $ranzhiAddr = $config->sso->addr;
  48. $ranzhiURL = substr($ranzhiAddr, 0, strrpos($ranzhiAddr, '/sys/'));
  49. ?>
  50. <?php if(!empty($ranzhiURL)):?>
  51. $(function(){ redirect('<?php echo $ranzhiURL?>', '<?php echo $config->sso->code?>'); });
  52. <?php endif;?>
  53. <?php endif;?>
  54. </script>
  55. <?php endif;?>
  56. <?php
  57. if($this->loadModel('cron')->runnable()) js::execute('startCron()');
  58. if(isset($pageJS)) js::execute($pageJS); // load the js for current page.
  59. /* Load hook files for current page. */
  60. $extensionRoot = $this->app->getExtensionRoot();
  61. if($this->config->vision != 'open')
  62. {
  63. $extHookRule = $extensionRoot . $this->config->edition . '/common/ext/view/footer.*.hook.php';
  64. $extHookFiles = glob($extHookRule);
  65. if($extHookFiles) foreach($extHookFiles as $extHookFile) include $extHookFile;
  66. }
  67. if($this->config->vision == 'lite')
  68. {
  69. $extHookRule = $extensionRoot . $this->config->vision . '/common/ext/view/footer.*.hook.php';
  70. $extHookFiles = glob($extHookRule);
  71. if($extHookFiles) foreach($extHookFiles as $extHookFile) include $extHookFile;
  72. }
  73. $extHookRule = $extensionRoot . 'custom/common/ext/view/footer.*.hook.php';
  74. $extHookFiles = glob($extHookRule);
  75. if($extHookFiles) foreach($extHookFiles as $extHookFile) include $extHookFile;
  76. ?>
  77. <?php if($config->debug > 2 and $config->tabSession): ?>
  78. <div id="tid" style="position:fixed;right:0;bottom:0;z-index:10000">
  79. <code class="bg-red">tsid=<?php if(empty($_GET['tid'])) echo session_id(); else echo md5(session_id() . $_GET['tid']);?></code>
  80. <?php if(!empty($_GET['tid'])): ?>
  81. <code class="bg-yellow">servertid=<?php echo $_GET['tid'];?></code>
  82. <?php endif; ?>
  83. <code class="bg-green">sid=<?php echo session_id();?></code>
  84. </div>
  85. <?php endif; ?>
  86. <?php
  87. /* Export page vars for zin tool */
  88. if(isset($config->zinTool))
  89. {
  90. $pageVars = get_defined_vars();
  91. $exportVars = array('lang' => $lang);
  92. foreach($pageVars as $varName => $varValue)
  93. {
  94. if(is_string($varValue) || is_bool($varValue) || is_numeric($varValue)) $exportVars[$varName] = $varValue;
  95. }
  96. js::set('pageVars', $exportVars);
  97. }
  98. ?>
  99. </body>
  100. </html>