index.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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><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><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. </head>
  56. <body style="position: fixed; top: 0; right: 0; bottom: 0; left: 0;background: url(img/bg.jpg) no-repeat center center fixed;
  57. -webkit-background-size: cover;
  58. -moz-background-size: cover;
  59. -o-background-size: cover;
  60. background-size: cover;">
  61. <span>&nbsp;</span>
  62. <div id="page">
  63. <!--Tabs Start-->
  64. <div id="tabbed-nav">
  65. <ul>
  66. <?=$loadedlist;?>
  67. <?=$lasttablist;?>
  68. </ul>
  69. <!-- Content container -->
  70. <style> .z-container { position: fixed; top: 50px; right: 0px; bottom: 0px; left: 0px; margin: 10px; } </style>
  71. <div style="top: <?=$px;?>">
  72. <?=$loadedurls;?>
  73. <?=$lasttaburl;?>
  74. </div>
  75. </div>
  76. <!--Tabs End-->
  77. </div>
  78. <script>
  79. jQuery(document).ready(function ($) {
  80. /* jQuery activation and setting options for the tabs*/
  81. $("#tabbed-nav").zozoTabs({
  82. defaultTab: "tab1",
  83. multiline: true,
  84. theme: "white",
  85. position: "top-compact",
  86. size: "medium",
  87. animation: {
  88. easing: "easeInOutExpo",
  89. duration: 450,
  90. effects: "fade"
  91. }
  92. });
  93. });
  94. </script>
  95. <script>
  96. jQuery('iframe','#container').attr('src',url);
  97. </script>
  98. </body>
  99. </html>