index.php 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <?php
  2. try {
  3. $config = parse_ini_file('settings.ini.php', true);
  4. } catch(Exception $e) {
  5. die('<b>Unable to read config.ini.php. Did you rename it from config.ini.php-example?</b><br><br>Error message: ' .$e->getMessage());
  6. }
  7. foreach ($config as $keyname => $section) {
  8. if(!empty($section["useicons"]) && ($section["useicons"]=="true")){
  9. $icons = "active";
  10. if($icons == "active"){ $px = "80px"; }else{ $px = "50px";}
  11. $guesticons = "<span><i class=\"fa fa-toggle-on\"></i></span>";
  12. $adminicons = "<span><i class=\"fa fa-toggle-on\"></i></span>";
  13. $refreshicons = "<span><i class=\"fa fa-refresh\"></i></span>";
  14. }
  15. //Guest
  16. if(!isset($_COOKIE["logged"]) && !empty($section["enabled"]) && ($section["enabled"]=="true") && !empty($section["guest"]) && ($section["guest"]=="true") ) {
  17. if($icons == "active"){ $listicons = "<span><i class=\"fa ". $section["icon"] ."\"></i></span>"; }
  18. $loadedlist .= "<li id=\"". $section["url"] ."x\"><a>" . $keyname . " " . $listicons ."</a></li>\n";
  19. $loadedurls .= "<div class=\"z-nopadding\" data-content-url=\"". $section["url"] ."\" data-content-type=\"iframe\"></div>\n";
  20. }
  21. //Full Access
  22. if(isset($_COOKIE["logged"]) && !empty($section["enabled"]) && ($section["enabled"]=="true")) {
  23. if($icons == "active"){ $listicons = "<span><i class=\"fa ". $section["icon"] ."\"></i></span>"; }
  24. $loadedlist .= "<li id=\"". $section["url"] ."x\"><a>" . $keyname . " " . $listicons ."</a></li>\n";
  25. $loadedurls .= "<div class=\"z-nopadding\" data-content-url=\"". $section["url"] ."\" data-content-type=\"iframe\"></div>\n";
  26. }
  27. //General
  28. if (empty($title)) $title = 'Manage My HTPC';
  29. if(($keyname == "general")) { $title = $section["title"]; }
  30. }
  31. if(!isset($_COOKIE["logged"])){
  32. $lasttablist .= "<li><a>Login" . $guesticons . "</a></li>\n";
  33. $lasttaburl .= "<div class=\"z-nopadding\" data-content-url=\"setup.php\" data-content-type=\"iframe\"></div>\n";
  34. }
  35. if(isset($_COOKIE["logged"])){
  36. $lasttablist .= "<li><a>Settings" . $adminicons . "</a></li>\n";
  37. $lasttaburl .= "<div class=\"z-nopadding\" data-content-url=\"setup.php\" data-content-type=\"iframe\"></div>\n";
  38. }
  39. if(!file_exists('settings.ini.php')){
  40. $lasttablist = "<li><a>Setup<span><i class=\"fa fa-spinner\"></i></span></a></li>\n";
  41. $lasttaburl = "<div class=\"z-nopadding\" data-content-url=\"setup.php\" data-content-type=\"iframe\"></div>\n";
  42. }
  43. ?>
  44. <!doctype html>
  45. <html class="z-white z-width1200">
  46. <head>
  47. <title><?=$title;?></title>
  48. <meta charset="utf-8">
  49. <meta name="viewport" content="width = device-width, initial-scale = 1.0" />
  50. <link href="css/min.css" rel="stylesheet" />
  51. <link href="css/tabs.min.css" rel="stylesheet" />
  52. <script src="js/jquery.min.js"></script>
  53. <script src="js/tabs.min.js"></script>
  54. <link rel='stylesheet prefetch' href='https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css'>
  55. <script>
  56. $(document).ready(function(){
  57. $("li").dblclick(function(){
  58. var frame = this.id.slice(0, -1);
  59. var f = document.getElementById(frame);
  60. f.src = f.src;
  61. });
  62. });
  63. </script>
  64. </head>
  65. <body style="position: fixed; top: 0; right: 0; bottom: 0; left: 0;background: url(img/bg.jpg) no-repeat center center fixed;
  66. -webkit-background-size: cover;
  67. -moz-background-size: cover;
  68. -o-background-size: cover;
  69. background-size: cover;">
  70. <span>&nbsp;</span>
  71. <div id="page">
  72. <!--Tabs Start-->
  73. <div id="tabbed-nav">
  74. <ul>
  75. <?=$loadedlist;?>
  76. <?=$lasttablist;?>
  77. </ul>
  78. <!-- Content container -->
  79. <style> .z-container { position: fixed; top: 50px; right: 0px; bottom: 0px; left: 0px; margin: 10px; } </style>
  80. <div style="top: <?=$px;?>">
  81. <?=$loadedurls;?>
  82. <?=$lasttaburl;?>
  83. </div>
  84. </div>
  85. <!--Tabs End-->
  86. </div>
  87. <script>
  88. jQuery(document).ready(function ($) {
  89. /* jQuery activation and setting options for the tabs*/
  90. $("#tabbed-nav").zozoTabs({
  91. defaultTab: "tab1",
  92. multiline: true,
  93. theme: "white",
  94. position: "top-compact",
  95. size: "medium",
  96. animation: {
  97. easing: "easeInOutExpo",
  98. duration: 450,
  99. effects: "fade"
  100. }
  101. });
  102. });
  103. </script>
  104. <script>
  105. jQuery('iframe','#container').attr('src',url);
  106. </script>
  107. </body>
  108. </html>