index.php 4.4 KB

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