index.html 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. {include file="public/header" /}
  2. {include file="public/topnav" /}
  3. <div class="admincp-container">
  4. <div class="admincp-container-left">
  5. {include file="public/left" /}
  6. </div>
  7. <div class="admincp-container-right">
  8. <div class="top-border"></div>
  9. <iframe src="{:url('Dashboard/index')}" id="main-frame" name="main-frame" style="overflow: visible;" frameborder="0" width="100%" height="94%" scrolling="yes" onload="window.parent"></iframe>
  10. </div>
  11. </div>
  12. <script>
  13. $(function() {
  14. $('#welcome,dashboard,dashboard').addClass('active');
  15. if ($.cookie('now_location_controller') != null) {
  16. openItem($.cookie('now_location_action') + ',' + $.cookie('now_location_controller') + ',' + $.cookie('now_location_module'));
  17. } else {
  18. $('#mainMenu>ul').first().css('display', 'block');
  19. //第一次进入后台时,默认定到欢迎界面
  20. $('#item_welcome').addClass('selected');
  21. $('#workspace').attr('src', ADMINSITEURL+'/Dashboard/welcome.html');
  22. }
  23. $('#iframe_refresh').click(function() {
  24. var fr = document.frames ? document.frames("workspace") : document.getElementById("workspace").contentWindow;
  25. fr.location.reload();
  26. });
  27. });
  28. function openItem(args) {
  29. spl = args.split(',');
  30. action = spl[0];
  31. try {
  32. controller = spl[1];
  33. module = spl[2];
  34. }
  35. catch (ex) {
  36. }
  37. if (typeof(controller) == 'undefined') {
  38. var module = args;
  39. }
  40. //顶部导航样式处理
  41. $('.actived').removeClass('actived');
  42. $('#nav_' + module).addClass('actived');
  43. //清除左侧样式
  44. $('.selected').removeClass('selected');
  45. //show
  46. $('#mainMenu ul').css('display', 'none');
  47. $('#sort_' + module).css('display', 'block');
  48. if (typeof(controller) == 'undefined') {
  49. //顶部菜单事件
  50. html = $('#sort_' + module + '>li').first().html();
  51. str = html.match(/openItem\('(.*)'\)/ig);
  52. arg = str[0].split("'");
  53. spl = arg[1].split(',');
  54. action = spl[0];
  55. controller = spl[1];
  56. module = spl[2];
  57. first_obj = $('#sort_' + module + '>li').first();
  58. $(first_obj).addClass('selected');
  59. } else {
  60. //左侧菜单事件
  61. //location
  62. $.cookie('now_location_module', module);
  63. $.cookie('now_location_controller', controller);
  64. $.cookie('now_location_action', action);
  65. $("#left_"+ module + controller + action).addClass('selected');
  66. }
  67. src = ADMINSITEURL + '/' + controller + '/' + action + '/';
  68. $('#main-frame').attr('src', src);
  69. }
  70. </script>
  71. {include file="public/footer" /}