index.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. if(!file_exists('config.json')){
  3. header('Location: install');
  4. die();
  5. }elseif(file_exists('install')){
  6. $files = scandir('install');
  7. if(empty($files)){
  8. @rmdir('install');
  9. }
  10. }
  11. session_start();
  12. require_once('php/include.php');
  13. if(isset($_GET['get'])){
  14. $get = $_GET['get'];
  15. unset($_GET['get']);
  16. if(!isset($_GET['type']) || !isset($_GET['id'])){
  17. $type = 'template';
  18. $id = 'index';
  19. }else{
  20. $type = $_GET['type'];
  21. $id = $_GET['id'];
  22. }
  23. if($get == 'state'){
  24. $json = Array();
  25. $json['state'] = Array();
  26. $json['state']['data'] = $_GET;
  27. switch($type){
  28. case 'user':$url='~'.$id;break;
  29. case 'group':$url='+'.$id;break;
  30. case 'issue':$url='!'.$id;break;
  31. case 'template':$url='page-'.$id;break;
  32. default:$url=$type.'-'.$id;
  33. }
  34. $json['state']['url'] = $url;
  35. die(json_encode($json));
  36. }elseif($get == 'api'){
  37. require_once('api.php');
  38. }
  39. }
  40. ?>
  41. <!doctype html>
  42. <html>
  43. <head>
  44. <meta charset=utf-8>
  45. <title>Bugs</title>
  46. <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
  47. <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.min.js"></script>
  48. <script src="js/handlebars.js"></script>
  49. <script src="js/jquery.mCustomScrollbar.concat.min.js"></script>
  50. <script src="js/jquery.history.js"></script>
  51. <script src="js/jquery.cookie.js"></script>
  52. <script src="js/index.js"></script>
  53. <link href="http://code.jquery.com/ui/1.10.3/themes/black-tie/jquery-ui.css" rel="stylesheet" type="text/css"/>
  54. <link href="css/jquery.mCustomScrollbar.css" rel="stylesheet" type="text/css"/>
  55. <link href="css/style.css" rel="stylesheet" type="text/css"/>
  56. </head>
  57. <body>
  58. <div id="topbar"></div>
  59. <div id="content"></div>
  60. </body>
  61. </html>