index.php 4.6 KB

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