index.php 67 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725
  1. <?php
  2. // Include functions if not already included
  3. require_once('functions.php');
  4. // Upgrade environment
  5. upgradeCheck();
  6. // Lazyload settings
  7. $databaseConfig = configLazy('config/config.php');
  8. // Load Colours/Appearance
  9. foreach(loadAppearance() as $key => $value) {
  10. $$key = $value;
  11. }
  12. //Set some variables
  13. ini_set("display_errors", 1);
  14. ini_set("error_reporting", E_ALL | E_STRICT);
  15. $data = false;
  16. $databaseLocation = "databaseLocation.ini.php";
  17. $needSetup = "Yes";
  18. $tabSetup = "Yes";
  19. $hasOptions = "No";
  20. $settingsicon = "No";
  21. $settingsActive = "";
  22. $action = "";
  23. $loadingIcon = "images/organizr-load-w-thick.gif";
  24. $baseURL = "";
  25. // Get Action
  26. if(isset($_POST['action'])) {
  27. $action = $_POST['action'];
  28. unset($_POST['action']);
  29. }
  30. //Get Invite Code
  31. $inviteCode = isset($_GET['inviteCode']) ? $_GET['inviteCode'] : null;
  32. // Check for config file
  33. if(!file_exists('config/config.php')) {
  34. if($action == "createLocation") {
  35. if (isset($_POST['database_Location'])) {
  36. $_POST['database_Location'] = str_replace('//','/',$_POST['database_Location'].'/');
  37. if(substr($_POST['database_Location'], -1) != "/") : $_POST['database_Location'] = $_POST['database_Location'] . "/"; endif;
  38. $_POST['user_home'] = $_POST['database_Location'].'users/';
  39. }
  40. if (file_exists($_POST['database_Location'])) {
  41. updateConfig($_POST);
  42. } else {
  43. debug_out('Dir doesn\'t exist: '.$_POST['database_Location'],1); // Pretty Up
  44. }
  45. } else {
  46. $configReady = "No";
  47. $userpic = "";
  48. $showPic = "";
  49. }
  50. }
  51. if (file_exists('config/config.php')) {
  52. if (!DATABASE_LOCATION){
  53. die(header("Refresh:0"));
  54. }
  55. $configReady = "Yes";
  56. require_once("user.php");
  57. $USER = new User("registration_callback");
  58. $dbfile = DATABASE_LOCATION . constant('User::DATABASE_NAME') . ".db";
  59. $database = new PDO("sqlite:" . $dbfile);
  60. $query = "SELECT * FROM users";
  61. foreach($database->query($query) as $data) {
  62. $needSetup = "No";
  63. }
  64. $db = DATABASE_LOCATION . constant('User::DATABASE_NAME') . ".db";
  65. $file_db = new PDO("sqlite:" . $db);
  66. $file_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  67. $dbTab = $file_db->query('SELECT name FROM sqlite_master WHERE type="table" AND name="tabs"');
  68. $dbOptions = $file_db->query('SELECT name FROM sqlite_master WHERE type="table" AND name="options"');
  69. foreach($dbTab as $row) :
  70. if (in_array("tabs", $row)) :
  71. $tabSetup = "No";
  72. endif;
  73. endforeach;
  74. if($tabSetup == "Yes") :
  75. $settingsActive = "active";
  76. endif;
  77. foreach($dbOptions as $row) :
  78. if (in_array("options", $row)) :
  79. $hasOptions = "Yes";
  80. endif;
  81. endforeach;
  82. if($tabSetup == "No") :
  83. if($USER->authenticated && $USER->role == "admin") :
  84. $result = $file_db->query('SELECT * FROM tabs WHERE active = "true" ORDER BY `order` asc');
  85. $splash = $file_db->query('SELECT * FROM tabs WHERE active = "true" AND splash = "true" ORDER BY `order` asc');
  86. $getsettings = $file_db->query('SELECT * FROM tabs WHERE active = "true" ORDER BY `order` asc');
  87. foreach($getsettings as $row) :
  88. if(!empty($row['iconurl']) && $settingsicon == "No") :
  89. $settingsicon = "Yes";
  90. endif;
  91. endforeach;
  92. elseif($USER->authenticated && $USER->role == "user") :
  93. $result = $file_db->query('SELECT * FROM tabs WHERE active = "true" AND user = "true" ORDER BY `order` asc');
  94. $splash = $file_db->query('SELECT * FROM tabs WHERE active = "true" AND splash = "true" AND user = "true" ORDER BY `order` asc');
  95. else :
  96. $result = $file_db->query('SELECT * FROM tabs WHERE active = "true" AND guest = "true" ORDER BY `order` asc');
  97. $splash = $file_db->query('SELECT * FROM tabs WHERE active = "true" AND splash = "true" AND guest = "true" ORDER BY `order` asc');
  98. endif;
  99. endif;
  100. $userpic = md5( strtolower( trim( $USER->email ) ) );
  101. if(LOADINGICON !== "") : $loadingIcon = LOADINGICON; endif;
  102. if(SLIMBAR == "true") : $slimBar = "30"; $userSize = "25"; else : $slimBar = "56"; $userSize = "40"; endif;
  103. if($USER->authenticated) :
  104. if(GRAVATAR == "true") :
  105. $showPic = "<img src='https://www.gravatar.com/avatar/$userpic?s=$userSize' class='img-circle'>";
  106. else:
  107. $showPic = "<i class=\"mdi mdi-account-box-outline\"></i>";
  108. endif;
  109. else :
  110. $showPic = "<login class='login-btn text-uppercase'>" . $language->translate("LOGIN") . "</login>";
  111. endif;
  112. }
  113. if(!defined('SLIMBAR')) : define('SLIMBAR', 'true'); endif;
  114. if(!defined('AUTOHIDE')) : define('AUTOHIDE', 'false'); endif;
  115. if(!defined('ENABLEMAIL')) : define('ENABLEMAIL', 'false'); endif;
  116. if(!defined('CUSTOMCSS')) : define('CUSTOMCSS', 'false'); endif;
  117. if(!defined('LOADINGSCREEN')) : define('LOADINGSCREEN', 'true'); endif;
  118. if(!isset($notifyExplode)) :
  119. $notifyExplode = array("bar","slidetop");
  120. endif;
  121. if(SLIMBAR == "true") : $slimBar = "30"; $userSize = "25"; else : $slimBar = "56"; $userSize = "40"; endif;
  122. if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon = "settings2.png"; else: $iconRotate = "true"; $settingsIcon = "settings.png"; endif;
  123. ?>
  124. <!--
  125. ___ ___ ___ ___ ___ ___ ___ ___
  126. /\ \ /\ \ /\ \ /\ \ /\__\ /\ \ /\ \ /\ \
  127. /::\ \ /::\ \ /::\ \ /::\ \ /:| _|_ _\:\ \ _\:\ \ /::\ \
  128. /:/\:\__\ /::\:\__\ /:/\:\__\ /::\:\__\ /::|/\__\ /\/::\__\ /::::\__\ /::\:\__\
  129. \:\/:/ / \;:::/ / \:\:\/__/ \/\::/ / \/|::/ / \::/\/__/ \::;;/__/ \;:::/ /
  130. \::/ / |:\/__/ \::/ / /:/ / |:/ / \:\__\ \:\__\ |:\/__/
  131. \/__/ \|__| \/__/ \/__/ \/__/ \/__/ \/__/ \|__|
  132. [Organizr Version: <?php echo INSTALLEDVERSION; ?> - By: CauseFX]
  133. -->
  134. <!DOCTYPE html>
  135. <html lang="<?php echo $language->getLang(); ?>" class="no-js">
  136. <head>
  137. <meta charset="UTF-8">
  138. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
  139. <meta name="apple-mobile-web-app-capable" content="yes" />
  140. <meta name="mobile-web-app-capable" content="yes" /
  141. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  142. <meta name="msapplication-tap-highlight" content="no" />
  143. <title><?=$title;?><?php if($title !== "Organizr") : echo " - Organizr"; endif; ?></title>
  144. <link rel="stylesheet" href="<?=$baseURL;?>bower_components/bootstrap/dist/css/bootstrap.min.css?v=<?php echo INSTALLEDVERSION; ?>">
  145. <link rel="stylesheet" href="<?=$baseURL;?>bower_components/font-awesome/css/font-awesome.min.css?v=<?php echo INSTALLEDVERSION; ?>">
  146. <link rel="stylesheet" href="<?=$baseURL;?>bower_components/mdi/css/materialdesignicons.min.css?v=<?php echo INSTALLEDVERSION; ?>">
  147. <link rel="stylesheet" href="<?=$baseURL;?>bower_components/metisMenu/dist/metisMenu.min.css?v=<?php echo INSTALLEDVERSION; ?>">
  148. <link rel="stylesheet" href="<?=$baseURL;?>bower_components/Waves/dist/waves.min.css?v=<?php echo INSTALLEDVERSION; ?>">
  149. <link rel="stylesheet" href="<?=$baseURL;?>bower_components/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.css?v=<?php echo INSTALLEDVERSION; ?>">
  150. <link rel="stylesheet" href="<?=$baseURL;?>js/selects/cs-select.css?v=<?php echo INSTALLEDVERSION; ?>">
  151. <link rel="stylesheet" href="<?=$baseURL;?>js/selects/cs-skin-elastic.css?v=<?php echo INSTALLEDVERSION; ?>">
  152. <link rel="stylesheet" href="<?=$baseURL;?>bower_components/google-material-color/dist/palette.css?v=<?php echo INSTALLEDVERSION; ?>">
  153. <link rel="stylesheet" href="<?=$baseURL;?>bower_components/sweetalert/dist/sweetalert.css?v=<?php echo INSTALLEDVERSION; ?>">
  154. <link rel="stylesheet" href="<?=$baseURL;?>bower_components/smoke/dist/css/smoke.min.css?v=<?php echo INSTALLEDVERSION; ?>">
  155. <link rel="stylesheet" href="<?=$baseURL;?>js/notifications/ns-style-growl.css?v=<?php echo INSTALLEDVERSION; ?>">
  156. <link rel="stylesheet" href="<?=$baseURL;?>js/notifications/ns-style-other.css?v=<?php echo INSTALLEDVERSION; ?>">
  157. <script src="<?=$baseURL;?>js/menu/modernizr.custom.js?v=<?php echo INSTALLEDVERSION; ?>"></script>
  158. <script type="text/javascript" src="<?=$baseURL;?>js/sha1.js?v=<?php echo INSTALLEDVERSION; ?>"></script>
  159. <script type="text/javascript" src="<?=$baseURL;?>js/user.js?v=<?php echo INSTALLEDVERSION; ?>"></script>
  160. <link rel="stylesheet" href="<?=$baseURL;?>css/style.css?v=<?php echo INSTALLEDVERSION; ?>">
  161. <link rel="stylesheet" href="bower_components/animate.css/animate.min.css?v=<?php echo INSTALLEDVERSION; ?>">
  162. <link rel="icon" type="image/png" href="<?=$baseURL;?>images/favicon/android-chrome-192x192.png" sizes="192x192">
  163. <link rel="apple-touch-icon" sizes="180x180" href="<?=$baseURL;?>images/favicon/apple-touch-icon.png">
  164. <link rel="icon" type="image/png" href="<?=$baseURL;?>images/favicon/favicon-32x32.png" sizes="32x32">
  165. <link rel="icon" type="image/png" href="<?=$baseURL;?>images/favicon/favicon-16x16.png" sizes="16x16">
  166. <link rel="manifest" href="<?=$baseURL;?>images/favicon/manifest.json">
  167. <link rel="mask-icon" href="<?=$baseURL;?>images/favicon/safari-pinned-tab.svg" color="#2d89ef">
  168. <link rel="shortcut icon" href="<?=$baseURL;?>images/favicon/favicon.ico">
  169. <meta name="msapplication-config" content="<?=$baseURL;?>images/favicon/browserconfig.xml">
  170. <meta name="theme-color" content="#2d89ef">
  171. <link rel="stylesheet" type="text/css" href="css/addtohomescreen.css">
  172. <script src="js/addtohomescreen.js"></script>
  173. <script src="js/push.js"></script>
  174. <!--Other-->
  175. <script src="js/ajax.js?v=<?php echo INSTALLEDVERSION; ?>"></script>
  176. <!--[if lt IE 9]>
  177. <script src="bower_components/html5shiv/dist/html5shiv.min.js"></script>
  178. <script src="bower_components/respondJs/dest/respond.min.js"></script>
  179. <![endif]-->
  180. </head>
  181. <style>
  182. .loop-animation {
  183. animation-iteration-count: infinite;
  184. -webkit-animation-iteration-count: infinite;
  185. -moz-animation-iteration-count: infinite;
  186. -o-animation-iteration-count: infinite;
  187. }
  188. .loop-animation-timeout {
  189. animation-iteration-count: 5;
  190. -webkit-animation-iteration-count: 5;
  191. -moz-animation-iteration-count: 5;
  192. -o-animation-iteration-count: 5;
  193. }
  194. .ping-success {
  195. background: #46bc99 !important;
  196. box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
  197. }.ping-warning {
  198. background: #ff3333 !important;
  199. box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
  200. }
  201. .TabOpened {
  202. -webkit-filter: drop-shadow(0px 0px 5px <?=$topbartext;?>);
  203. filter: drop-shadow(0px 0px 5px <?=$topbartext;?>);
  204. }.bottom-bnts a {
  205. background: <?=$bottombar;?> !important;
  206. color: <?=$topbartext;?> !important;
  207. }.bottom-bnts {
  208. background: <?=$bottombar;?> !important;
  209. }.gn-menu-main {
  210. background: <?=$topbar;?>;
  211. }.gn-menu-main ul.gn-menu {
  212. background: <?=$sidebar;?>;
  213. }.gn-menu-wrapper {
  214. background: <?=$sidebar;?>;
  215. }.la-timer.la-dark {
  216. color: <?=$topbartext;?>
  217. }.refresh-preloader {
  218. background: <?=$loading;?>;
  219. }.la-timer {
  220. width: 75px;
  221. height: 75px;
  222. padding-top: 20px;
  223. border-radius: 100px;
  224. background: <?=$sidebar;?>;
  225. border: 2px solid <?=$topbar;?>;
  226. }@media screen and (min-width:737px){
  227. .tab-item:hover a {
  228. color: <?=$hovertext;?> !important;
  229. background: <?=$hoverbg;?>;
  230. border-radius: 100px 0 0 100px;
  231. }
  232. }.gn-menu li.active > a {
  233. color: <?=$activetabtext;?> !important;
  234. background: <?=$activetabBG;?>;
  235. border-radius: 100px 0 0 100px;
  236. }.gn-menu li.rightActive > a {
  237. background: <?=$hoverbg;?>;
  238. border-radius: 100px 0 0 100px;
  239. }.gn-menu li.active i.fa {
  240. color: <?=$activetabicon;?>;
  241. }.gn-menu li i.fa {
  242. color: <?=$inactiveicon;?>;
  243. }.gn-menu-main ul.gn-menu a {
  244. color: <?=$inactivetext;?>;
  245. }li.dropdown.some-btn .mdi {
  246. color: <?=$topbartext;?>;
  247. }li.dropdown.some-btn .mdi:hover {
  248. color: <?=$hoverbg;?>;
  249. }.nav>li>a:focus, .nav>li>a:hover {
  250. text-decoration: none;
  251. background-color: transparent;
  252. }div#preloader {
  253. background: <?=$loading;?>;
  254. }.iframe {
  255. -webkit-overflow-scrolling: touch;
  256. }.main-wrapper{
  257. position: absolute !important;
  258. }#menu-toggle span {
  259. background: <?=$topbartext;?>;
  260. }logo.logo {
  261. opacity: 0.5;
  262. filter: alpha(opacity=50);
  263. }.mini-nav .split {
  264. width: calc(50% - 25px);
  265. }.splitRight {
  266. width: 50%;
  267. margin-left: 50% !important;
  268. position: absolute !important;
  269. }.split {
  270. width: 50%;
  271. position: absolute !important;
  272. }.mini-nav .splitRight {
  273. margin-left: calc(50% + 25px) !important;
  274. width: calc(50% - 25px);
  275. }.form-control.material {
  276. background-image: -webkit-gradient(linear, left top, left bottom, from(<?=$topbartext;?>), to(<?=$topbartext;?>)), -webkit-gradient(linear, left top, left bottom, from(#d2d2d2), to(#d2d2d2));
  277. background-image: -webkit-linear-gradient(<?=$topbartext;?>, <?=$topbartext;?>), -webkit-linear-gradient(#d2d2d2, #d2d2d2);
  278. background-image: linear-gradient(<?=$topbartext;?>, <?=$topbartext;?>), linear-gradient(#d2d2d2, #d2d2d2);
  279. }img.titlelogoclass {
  280. max-width: 250px;
  281. max-height: <?=$slimBar;?>px;
  282. }@media only screen and (max-width: 450px) {
  283. img.titlelogoclass {
  284. max-width: 150px;
  285. }
  286. }.login-btn {
  287. -webkit-border-radius: 4;
  288. -moz-border-radius: 4;
  289. border-radius: 4px;
  290. -webkit-box-shadow: 0px 1px 3px #666666;
  291. -moz-box-shadow: 0px 1px 3px #666666;
  292. box-shadow: 0px 1px 3px #666666;
  293. font-family: Arial;
  294. color: <?=$topbar;?>;
  295. font-size: 10px;
  296. vertical-align: top;
  297. background: <?=$topbartext;?>;
  298. padding: 5px 10px 5px 10px;
  299. text-decoration: none;
  300. font-weight: 700;
  301. font-style: normal;
  302. }.login-btn:hover {
  303. background: <?=$hoverbg;?>;
  304. color: <?=$hovertext;?>;
  305. text-decoration: none;
  306. font-weight: 700;
  307. }
  308. <?php if(SLIMBAR == "true") : ?>
  309. /* Slim Styling */
  310. body{
  311. padding-top: 30px !important;
  312. }.gn-menu-main {
  313. height: 30px !important;
  314. }.gn-menu-wrapper {
  315. top: 30px !important;
  316. }.gn-menu-main .navbar-right {
  317. line-height: 30px !important;
  318. }img.img-circle {
  319. vertical-align: inherit;
  320. margin-top: 2px;
  321. }.menu-toggle .hamburger {
  322. top: 0px !important;
  323. }.top-clock {
  324. line-height: 30px !important;
  325. }img.titlelogoclass {
  326. vertical-align: inherit;
  327. }.members-sidebar {
  328. top: 30px !important;
  329. }.menu-toggle .cross span:nth-child(2) {
  330. left: -9px;
  331. top: 41px;
  332. }.menu-toggle.gn-selected .cross span:nth-child(2) {
  333. width: 53%;
  334. }.menu-toggle.gn-selected .cross span:nth-child(1) {
  335. height: 105% !important;
  336. }.menu-toggle .cross span:nth-child(1) {
  337. left: 6px !important;
  338. top: 26px !important;
  339. }.menu-toggle .hamburger span {
  340. margin: 5px 0;
  341. width: 25px;
  342. }.menu-toggle .hamburger {
  343. margin-left: -17px;
  344. }.ns-effect-slidetop {
  345. padding: 6px 22px;
  346. }.ns-effect-exploader {
  347. padding: 5px 22px;
  348. }
  349. <?php endif; ?>
  350. <?php customCSS(); ?>
  351. </style>
  352. <body style="overflow: hidden">
  353. <?php if (LOADINGSCREEN == "true") : ?>
  354. <!--Preloader-->
  355. <div id="preloader" class="preloader table-wrapper">
  356. <div class="table-row">
  357. <div class="table-cell">
  358. <div class="la-ball-scale-multiple la-3x" style="color: <?=$topbar;?>">
  359. <?php if (pathinfo($loadingIcon, PATHINFO_EXTENSION) !== "gif" ) :
  360. echo "<div></div><div></div><div></div>";
  361. endif; ?>
  362. <logo class="logo"><img height="192px" src="<?=$loadingIcon;?>"></logo>
  363. </div>
  364. </div>
  365. </div>
  366. </div>
  367. <?php endif; ?>
  368. <div id="main-wrapper" class="main-wrapper" tabindex="-1">
  369. <ul id="gn-menu" class="gn-menu-main">
  370. <li class="gn-trigger">
  371. <a id="menu-toggle" class="menu-toggle gn-icon gn-icon-menu">
  372. <div class="hamburger">
  373. <span></span>
  374. <span></span>
  375. <span></span>
  376. </div>
  377. <div class="cross">
  378. <span></span>
  379. <span></span>
  380. </div>
  381. </a>
  382. <nav class="gn-menu-wrapper">
  383. <div class="gn-scroller" id="gn-scroller">
  384. <ul id="tabList" class="gn-menu metismenu">
  385. <!--Start Tab List-->
  386. <?php if($tabSetup == "No") : $tabCount = 1; $allPings = array(); foreach($result as $row) :
  387. $name = str_replace(array(':', '\\', '/', '*'), 'x', $row['ping_url']);
  388. if($row['defaultz'] == "true") : $defaultz = "active"; else : $defaultz = ""; endif; ?>
  389. <li window="<?=$row['window'];?>" class="tab-item <?=$defaultz;?>" id="<?=$row['url'];?>x" data-title="<?=$row['name'];?>" name="<?php echo strtolower($row['name']);?>">
  390. <a class="tab-link">
  391. <?php if($row['iconurl']) : ?>
  392. <i style="font-size: 19px; padding: 0 10px; font-size: 19px;">
  393. <span id="<?=$row['url'];?>s" class="badge badge-success" style="position: absolute;z-index: 100;right: 0px;"></span>
  394. <img src="<?=$row['iconurl'];?>" style="height: 30px; width: 30px; margin-top: -2px;">
  395. <?php if($row['ping'] == "true" && $row['ping_url']){ $allPings["image".$name] = $row['ping_url']; ?>
  396. <ping id="ping-<?=$name;?>"></ping>
  397. <?php }?>
  398. </i>
  399. <?php else : ?>
  400. <i class="fa <?=$row['icon'];?> fa-lg">
  401. <span id="<?=$row['url'];?>s" class="badge badge-success" style="position: absolute;z-index: 100;right: 0px;"></span>
  402. <?php if($row['ping'] == "true" && $row['ping_url']){ $allPings["icon".$name] = $row['ping_url']; ?>
  403. <ping id="ping-<?=$name;?>"></ping>
  404. <?php }?>
  405. </i>
  406. <?php endif; ?>
  407. <?=$row['name'];?>
  408. </a>
  409. </li>
  410. <?php $tabCount++; endforeach; endif;?>
  411. <?php if($configReady == "Yes") : if($USER->authenticated && $USER->role == "admin") :?>
  412. <li class="tab-item <?=$settingsActive;?>" id="settings.phpx" data-title="Settings" name="settings">
  413. <a class="tab-link">
  414. <?php if($settingsicon == "Yes") :
  415. echo '<i style="font-size: 19px; padding: 0 10px; font-size: 19px;">
  416. <img id="settings-icon" src="images/' . $settingsIcon . '" style="height: 30px; margin-top: -2px;"></i>';
  417. else :
  418. echo '<i id="settings-icon" class="fa fa-cog"></i>';
  419. endif; ?>
  420. <?php echo $language->translate("SETTINGS");?>
  421. </a>
  422. </li>
  423. <li style="display: none;" class="tab-item" id="updatedb.phpx" data-title="Upgrade" name="upgrade">
  424. <a class="tab-link">
  425. <?php if($settingsicon == "Yes") :
  426. echo '<i style="font-size: 19px; padding: 0 10px; font-size: 19px;">
  427. <img id="upgrade-icon" src="images/upgrade.png" style="height: 30px; margin-top: -2px;"></i>';
  428. else :
  429. echo '<i id="upgrade-icon" class="fa fa-arrow-up"></i>';
  430. endif; ?>
  431. <?php echo $language->translate("UPGRADE");?>
  432. </a>
  433. </li>
  434. <?php endif; endif;?>
  435. <!--End Tab List-->
  436. </ul>
  437. </div>
  438. <!-- /gn-scroller -->
  439. <div class="bottom-bnts">
  440. <a class="fix-nav"><i class="mdi mdi-pin"></i></a>
  441. </div>
  442. </nav>
  443. </li>
  444. <li class="top-clock">
  445. <?php
  446. if($configReady == "Yes") :
  447. if(TITLELOGO == "") :
  448. echo "<span><span style=\"color: $topbartext\"><b>$title</b></span></span>";
  449. else :
  450. echo "<img class='titlelogoclass' src='" . TITLELOGO . "'>";
  451. endif;
  452. else :
  453. echo "<span><span style=\"color: $topbartext\"><b>$title</b></span></span>";
  454. endif;
  455. ?>
  456. </li>
  457. <li class="pull-right">
  458. <ul class="nav navbar-right right-menu">
  459. <li class="dropdown some-btn">
  460. <?php if($configReady == "Yes") : if(!$USER->authenticated) : ?>
  461. <a class="log-in">
  462. <?php endif; endif;?>
  463. <?php if($configReady == "Yes") : if($USER->authenticated) : ?>
  464. <a class="show-members">
  465. <?php endif; endif;?>
  466. <i class="userpic"><?=$showPic;?></i>
  467. </a>
  468. </li>
  469. <li class="dropdown some-btn">
  470. <a class="fullscreen">
  471. <i class="mdi mdi-fullscreen"></i>
  472. </a>
  473. </li>
  474. <li class="dropdown some-btn">
  475. <a id="reload" class="refresh">
  476. <i class="mdi mdi-refresh"></i>
  477. </a>
  478. </li>
  479. <li class="dropdown some-btn">
  480. <a id="popout" class="popout">
  481. <i class="mdi mdi-window-restore"></i>
  482. </a>
  483. </li>
  484. <li style="display: block" id="splitView" class="dropdown some-btn">
  485. <a class="spltView">
  486. <i class="mdi mdi-window-close"></i>
  487. </a>
  488. </li>
  489. </ul>
  490. </li>
  491. </ul>
  492. <!--Content-->
  493. <div id="content" class="content" style="">
  494. <script>addToHomescreen();</script>
  495. <!--Load Framed Content-->
  496. <?php if($needSetup == "Yes" && $configReady == "Yes") : ?>
  497. <div class="table-wrapper" style="background:<?=$sidebar;?>;">
  498. <div class="table-row">
  499. <div class="table-cell text-center">
  500. <div class="login i-block">
  501. <div class="content-box">
  502. <div class="biggest-box" style="background:<?=$topbar;?>;">
  503. <h1 class="zero-m text-uppercase" style="color:<?=$topbartext;?>;"><?php echo $language->translate("CREATE_ADMIN");?></h1>
  504. </div>
  505. <div class="big-box text-left registration-form">
  506. <h4 class="text-center"><?php echo $language->translate("CREATE_ACCOUNT");?></h4>
  507. <form class="controlbox" name="new user registration" id="registration" action="" method="POST" data-smk-icon="glyphicon-remove-sign">
  508. <input type="hidden" name="op" value="register"/>
  509. <input type="hidden" name="sha1" value=""/>
  510. <input type="hidden" name="settings" value="false"/>
  511. <div class="form-group">
  512. <input type="text" class="form-control material" name="username" autofocus placeholder="<?php echo $language->translate("USERNAME");?>" autocorrect="off" autocapitalize="off" minlength="3" maxlength="16" required>
  513. </div>
  514. <div class="form-group">
  515. <input type="email" class="form-control material" name="email" placeholder="<?php echo $language->translate("EMAIL");?>">
  516. </div>
  517. <div class="form-group">
  518. <input type="password" class="form-control material" name="password1" placeholder="<?php echo $language->translate("PASSWORD");?>" data-smk-strongPass="weak" required>
  519. </div>
  520. <div class="form-group">
  521. <input type="password" class="form-control material" name="password2" placeholder="<?php echo $language->translate("PASSWORD_AGAIN");?>">
  522. </div>
  523. <button id="registerSubmit" style="background:<?=$topbar;?>;" type="submit" class="btn btn-block text-uppercase waves waves-effect waves-float" value="Register"><text style="color:<?=$topbartext;?>;"><?php echo $language->translate("REGISTER");?></text></button>
  524. </form>
  525. </div>
  526. </div>
  527. </div>
  528. </div>
  529. </div>
  530. </div>
  531. <?php endif; ?>
  532. <?php if($needSetup == "Yes" && $configReady == "No") : ?>
  533. <div class="table-wrapper" style="background:<?=$sidebar;?>;">
  534. <div class="table-row">
  535. <div class="table-cell text-center">
  536. <div class="login i-block">
  537. <div class="content-box">
  538. <div class="biggest-box" style="background:<?=$topbar;?>;">
  539. <h1 class="zero-m text-uppercase" style="color:<?=$topbartext;?>;"><?php echo $language->translate("DATABASE_PATH");?></h1>
  540. </div>
  541. <div class="big-box text-left">
  542. <h3 class="text-center"><?php echo $language->translate("SPECIFY_LOCATION");?></h3>
  543. <h5 class="text-left"><strong><?php echo $language->translate("CURRENT_DIRECTORY");?>: <?php echo str_replace("\\","/",__DIR__); ?> <br><?php echo $language->translate("PARENT_DIRECTORY");?>: <?php echo str_replace("\\","/",dirname(__DIR__)); ?></strong></h5>
  544. <form class="controlbox" name="setupDatabase" id="setupDatabase" action="" method="POST" data-smk-icon="glyphicon-remove-sign">
  545. <input type="hidden" name="action" value="createLocation" />
  546. <div class="form-group">
  547. <input type="text" class="form-control material" name="database_Location" autofocus value="<?php echo str_replace("\\","/",dirname(__DIR__));?>" autocorrect="off" autocapitalize="off" required>
  548. <h5><?php echo $language->translate("SET_DATABASE_LOCATION");?></h5>
  549. <?php echo getTimezone();?>
  550. <h5><?php echo $language->translate("SET_TIMEZONE");?></h5>
  551. <?php
  552. if(file_exists(dirname(__DIR__) . '/users.db') || file_exists(__DIR__ . '/users.db') || file_exists(__DIR__ . '/config/users.db')) :
  553. echo '<h5 class="text-center red">';
  554. echo $language->translate("DONT_WORRY");
  555. echo '</h5>';
  556. endif;?>
  557. </div>
  558. <button style="background:<?=$topbar;?>;" id="databaseLocationSubmit" type="submit" class="btn btn-block btn-sm text-uppercase waves waves-effect waves-float" value="Save Location"><text style="color:<?=$topbartext;?>;"><?php echo $language->translate("SAVE_LOCATION");?></text></button>
  559. </form>
  560. </div>
  561. </div>
  562. </div>
  563. </div>
  564. </div>
  565. </div>
  566. <?php endif; ?>
  567. <?php if($configReady == "Yes") : if(!$USER->authenticated && $tabSetup == "Yes" && $needSetup == "No") :?>
  568. <div class="table-wrapper">
  569. <div class="table-row">
  570. <div class="table-cell text-center">
  571. <div class="login i-block">
  572. <div class="content-box">
  573. <div class="blue-bg biggest-box">
  574. <h1 class="zero-m text-uppercase"><?php echo $language->translate("AWESOME");?></h1>
  575. </div>
  576. <div class="big-box text-left">
  577. <h4 class="text-center"><?php echo $language->translate("TIME_TO_LOGIN");?></h4>
  578. <button type="submit" class="btn log-in btn-block btn-primary text-uppercase waves waves-effect waves-float"><?php echo $language->translate("LOGIN");?></button>
  579. </div>
  580. </div>
  581. </div>
  582. </div>
  583. </div>
  584. </div>
  585. <?php endif; endif; ?>
  586. <?php if($tabSetup == "No" && $needSetup == "No") :?>
  587. <div id="tabEmpty" class="table-wrapper" style="display: none; background:<?=$sidebar;?>;">
  588. <div class="table-row">
  589. <div class="table-cell text-center">
  590. <div class="login i-block">
  591. <div class="content-box">
  592. <div class="biggest-box" style="background:<?=$topbar;?>;">
  593. <h1 class="zero-m text-uppercase" style="color:<?=$topbartext;?>;"><?php echo $language->translate("HOLD_UP");?></h1>
  594. </div>
  595. <div class="big-box text-left">
  596. <center><img src="images/sowwy.png" style="height: 200px;"></center>
  597. <h2 class="text-center"><?php echo $language->translate("LOOKS_LIKE_YOU_DONT_HAVE_ACCESS");?></h2>
  598. <?php if(!$USER->authenticated) : ?>
  599. <button style="background:<?=$topbar;?>;" type="submit" class="btn log-in btn-block btn-primary text-uppercase waves waves-effect waves-float"><text style="color:<?=$topbartext;?>;"><?php echo $language->translate("LOGIN");?></text></button>
  600. <?php endif; ?>
  601. </div>
  602. </div>
  603. </div>
  604. </div>
  605. </div>
  606. </div>
  607. <?php endif;?>
  608. <!--End Load Framed Content-->
  609. </div>
  610. <div id="contentRight" class="content splitRight" style="">
  611. </div>
  612. <!--End Content-->
  613. <!--Welcome notification-->
  614. <div id="welcome"></div>
  615. <div id="members-sidebar" style="background: <?=$sidebar;?>;" class="members-sidebar fade in">
  616. <h4 class="pull-left zero-m"><?php echo $language->translate("OPTIONS");?></h4>
  617. <span class="close-members-sidebar"><i class="fa fa-remove fa-lg pull-right"></i></span>
  618. <div class="clearfix"><br/></div>
  619. <?php if($configReady == "Yes") : if($USER->authenticated) : ?>
  620. <br>
  621. <div class="content-box profile-sidebar box-shadow">
  622. <?php if(GRAVATAR == "true") : ?>
  623. <img src="https://www.gravatar.com/avatar/<?=$userpic;?>?s=100&d=mm" class="img-responsive img-circle center-block" alt="user">
  624. <?php endif; ?>
  625. <div class="profile-usertitle">
  626. <div class="profile-usertitle-name">
  627. <?php echo strtoupper($USER->username); ?>
  628. </div>
  629. <div class="profile-usertitle-job">
  630. <?php echo strtoupper($USER->role); ?>
  631. </div>
  632. </div>
  633. <div id="buttonsDiv" class="profile-userbuttons">
  634. <button id="editInfo" type="button" class="btn btn-primary text-uppercase waves waves-effect waves-float"><?php echo $language->translate("EDIT_INFO");?></button>
  635. <button type="button" class="logout btn btn-warning waves waves-effect waves-float"><?php echo $language->translate("LOGOUT");?></button>
  636. </div>
  637. <div id="editInfoDiv" style="display: none" class="profile-usertitle">
  638. <form class="content-form form-inline" name="update" id="update" action="" method="POST">
  639. <input type="hidden" name="op" value="update"/>
  640. <input type="hidden" name="sha1" value=""/>
  641. <input type="hidden" name="password" value="">
  642. <input type="hidden" name="username" value="<?php echo $USER->username; ?>"/>
  643. <input type="hidden" name="role" value="<?php echo $USER->role; ?>"/>
  644. <div class="form-group">
  645. <input autocomplete="off" type="text" value="<?php echo $USER->email; ?>" class="form-control" name="email" placeholder="<?php echo $language->translate("EMAIL_ADDRESS");?>">
  646. </div>
  647. <div class="form-group">
  648. <input autocomplete="off" type="password" class="form-control" name="password1" placeholder="<?php echo $language->translate("PASSWORD");?>">
  649. </div>
  650. <div class="form-group">
  651. <input autocomplete="off" type="password" class="form-control" name="password2" placeholder="<?php echo $language->translate("PASSWORD_AGAIN");?>">
  652. </div>
  653. <br>
  654. <div class="form-group">
  655. <input type="button" class="btn btn-success text-uppercase waves-effect waves-float" value="<?php echo $language->translate("UPDATE");?>" onclick="User.processUpdate()"/>
  656. <button id="goBackButtons" type="button" class="btn btn-primary text-uppercase waves waves-effect waves-float"><?php echo $language->translate("GO_BACK");?></button>
  657. </div>
  658. </form>
  659. </div>
  660. </div>
  661. <?php endif; endif;?>
  662. </div>
  663. </div>
  664. <?php if($configReady == "Yes") : if(!$USER->authenticated && $configReady == "Yes") : ?>
  665. <div id="loginModal" class="login-modal modal fade">
  666. <div style="background:<?=$sidebar;?>;" class="table-wrapper">
  667. <div class="table-row">
  668. <div class="table-cell text-center">
  669. <button style="color:<?=$topbartext;?>;" type="button" class="close" data-dismiss="modal" aria-label="Close">
  670. <span aria-hidden="true">&times;</span>
  671. </button>
  672. <div class="login i-block">
  673. <div class="content-box">
  674. <div style="background:<?=$topbar;?>;" class="biggest-box">
  675. <h1 style="color:<?=$topbartext;?>;" class="zero-m text-uppercase"><?php echo $language->translate("WELCOME");?></h1>
  676. </div>
  677. <div class="big-box text-left login-form">
  678. <?php if($USER->error!="") : ?>
  679. <p class="error">Error: <?php echo $USER->error; ?></p>
  680. <?php endif; ?>
  681. <form name="log in" id="login" action="" method="POST">
  682. <h4 class="text-center"><?php echo $language->translate("LOGIN");?></h4>
  683. <div class="form-group">
  684. <input type="hidden" name="op" value="login">
  685. <input type="hidden" name="sha1" value="">
  686. <input type="hidden" name="password" value="">
  687. <input type="hidden" name="rememberMe" value="false"/>
  688. <input type="text" class="form-control material" name="username" placeholder="<?php echo $language->translate("USERNAME");?>" autocomplete="off" autocorrect="off" autocapitalize="off" value="" autofocus required>
  689. </div>
  690. <div class="form-group">
  691. <input type="password" class="form-control material" name="password1" value="" autocomplete="off" placeholder="<?php echo $language->translate("PASSWORD");?>" required>
  692. </div>
  693. <div class="form-group">
  694. <div class="i-block"> <input id="rememberMe" name="rememberMe" class="switcher switcher-success switcher-medium pull-left" value="true" type="checkbox" checked="">
  695. <label for="rememberMe" class="pull-left"></label>
  696. <label class="pull-right"> &nbsp; <?php echo $language->translate("REMEMBER_ME");?></label>
  697. </div>
  698. </div>
  699. <button id="loginSubmit" style="background:<?=$topbar;?>;" type="submit" class="btn btn-block btn-info text-uppercase waves" value="log in" onclick="User.processLogin()"><text style="color:<?=$topbartext;?>;"><?php echo $language->translate("LOGIN");?></text></button>
  700. </form>
  701. <?php if (ENABLEMAIL == "true") : ?>
  702. <button id="switchForgot" style="background:<?=$topbartext;?>;" class="btn btn-block btn-info text-uppercase waves"><text style="color:<?=$topbar;?>;"><?php echo $language->translate("FORGOT_PASSWORD");?></text></button>
  703. <?php endif; ?>
  704. <?php if(REGISTERPASSWORD != "") : ?>
  705. <button id="switchCreateUser" style="background:<?=$hoverbg;?>;" class="btn btn-block btn-info text-uppercase waves"><text style="color:<?=$hovertext;?>;"><?php echo $language->translate("CREATE_USER");?></text></button>
  706. <?php endif; ?>
  707. <form style="display: none;" name="forgotPassword" id="forgotPassword" action="" method="POST" data-smk-icon="glyphicon-remove-sign">
  708. <h4 class="text-center"><?php echo $language->translate("FORGOT_PASSWORD");?></h4>
  709. <div class="form-group">
  710. <input type="hidden" name="op" value="reset">
  711. <input type="text" class="form-control material" name="email" placeholder="<?php echo $language->translate("EMAIL");?>" autocorrect="off" autocapitalize="off" value="" autofocus required>
  712. </div>
  713. <button style="background:<?=$topbar;?>;" type="submit" class="btn btn-block btn-info text-uppercase waves" value="reset password"><text style="color:<?=$topbartext;?>;"><?php echo $language->translate("RESET_PASSWORD");?></text></button>
  714. </form>
  715. <button id="welcomeGoBack" style="background:<?=$topbartext;?>; display: none" class="btn btn-block btn-info text-uppercase waves"><text style="color:<?=$topbar;?>;"><?php echo $language->translate("GO_BACK");?></text></button>
  716. <?php if(REGISTERPASSWORD != "") : ?>
  717. <div id="userPassForm" style="display: none;">
  718. <form id="userCreateForm" action="register.php" method="POST">
  719. <h4 class="text-center"><?php echo $language->translate("ENTER_PASSWORD_TO_REGISTER");?></h4>
  720. <center><h5 id="userCreateErrors" style="color: red"></h5></center>
  721. <div class="form-group">
  722. <input type="text" class="form-control material" name="registerPasswordValue" placeholder="<?php echo $language->translate("PASSWORD");?>" autocorrect="off" autocapitalize="off" value="" autofocus required>
  723. </div>
  724. <button style="background:<?=$topbar;?>;" type="submit" id="checkRegisterPass" class="btn btn-block btn-info text-uppercase waves" value="reset password"><text style="color:<?=$topbartext;?>;"><?php echo $language->translate("SUBMIT");?></text></button>
  725. </form>
  726. <button id="welcomeGoBack2" style="background:<?=$topbartext;?>; display: none" class="btn btn-block btn-info text-uppercase waves"><text style="color:<?=$topbar;?>;"><?php echo $language->translate("GO_BACK");?></text></button>
  727. </div>
  728. <form style="display: none;" name="createUser" id="registration" action="" method="POST" data-smk-icon="glyphicon-remove-sign">
  729. <h4 class="text-center"><?php echo $language->translate("CREATE_USER");?></h4>
  730. <input type="hidden" name="op" value="register"/>
  731. <input type="hidden" name="sha1" value=""/>
  732. <input type="hidden" name="settings" value="false"/>
  733. <div class="form-group">
  734. <input type="text" class="form-control material" name="username" autofocus placeholder="<?php echo $language->translate("USERNAME");?>" autocorrect="off" autocapitalize="off" minlength="3" maxlength="16" required>
  735. </div>
  736. <div class="form-group">
  737. <input type="email" class="form-control material" name="email" placeholder="<?php echo $language->translate("EMAIL");?>">
  738. </div>
  739. <div class="form-group">
  740. <input type="password" class="form-control material" name="password1" placeholder="<?php echo $language->translate("PASSWORD");?>" data-smk-strongPass="weak" required>
  741. </div>
  742. <div class="form-group">
  743. <input type="password" class="form-control material" name="password2" placeholder="<?php echo $language->translate("PASSWORD_AGAIN");?>">
  744. </div>
  745. <button id="registerSubmit" type="submit" class="btn green-bg btn-block btn-warning text-uppercase waves waves-effect waves-float" value="Register"><?php echo $language->translate("REGISTER");?></button>
  746. <button id="welcomeGoBack3" style="background:<?=$topbartext;?>; display: none" class="btn btn-block btn-info text-uppercase waves"><text style="color:<?=$topbar;?>;"><?php echo $language->translate("GO_BACK");?></text></button>
  747. </form>
  748. <?php endif; ?>
  749. </div>
  750. </div>
  751. </div>
  752. </div>
  753. </div>
  754. </div>
  755. </div>
  756. <?php endif; endif; ?>
  757. <?php if($configReady == "Yes") : if($USER->authenticated) : ?>
  758. <div style="background:<?=$topbar;?>;" class="logout-modal modal fade">
  759. <div class="table-wrapper" style="background: <?=$sidebar;?>">
  760. <div class="table-row">
  761. <div class="table-cell text-center">
  762. <div class="login i-block">
  763. <div class="content-box">
  764. <div style="background:<?=$topbar;?>;" class="biggest-box">
  765. <h1 style="color:<?=$topbartext;?>;" class="zero-m text-uppercase"><?php echo $language->translate("LOGOUT");?></h1>
  766. </div>
  767. <div class="big-box login-form">
  768. <form name="log out" id="logout" action="" method="POST">
  769. <input type="hidden" name="op" value="logout">
  770. <input type="hidden" name="username"value="<?php echo $_SESSION["username"]; ?>" >
  771. <center><img src="images/sowwy.png" style="height: 200px;"></center>
  772. <h3 style="color:<?=$topbar;?>;" class="zero-m text-uppercase"><?php echo $language->translate("DO_YOU_WANT_TO_LOGOUT");?></h3>
  773. <a style="color:<?=$topbar;?>;" id="logoutSubmit" class="i-block" data-dismiss="modal"><?php echo $language->translate("YES_WORD");?></a>
  774. <a style="color:<?=$topbar;?>;" class="i-block" data-dismiss="modal"><?php echo $language->translate("NO_WORD");?></a>
  775. </form>
  776. </div>
  777. </div>
  778. </div>
  779. </div>
  780. </div>
  781. </div>
  782. </div>
  783. <?php endif; endif;?>
  784. <?php if(isset($_GET['inviteCode'])){ ?>
  785. <div id="inviteSet" class="login-modal modal fade">
  786. <div style="background:<?=$sidebar;?>;" class="table-wrapper">
  787. <div class="table-row">
  788. <div class="table-cell text-center">
  789. <button style="color:<?=$topbartext;?>;" type="button" class="close" data-dismiss="modal" aria-label="Close">
  790. <span aria-hidden="true">&times;</span>
  791. </button>
  792. <div class="login i-block">
  793. <div class="content-box">
  794. <div style="background:<?=$topbar;?>;" class="biggest-box">
  795. <h1 style="color:<?=$topbartext;?>;" class="zero-m text-uppercase"><?php echo $language->translate("WELCOME");?></h1>
  796. </div>
  797. <div class="big-box text-left login-form">
  798. <?php if($USER->error!="") : ?>
  799. <p class="error">Error: <?php echo $USER->error; ?></p>
  800. <?php endif; ?>
  801. <form name="checkInviteForm" id="checkInviteForm" onsubmit="return false;" data-smk-icon="glyphicon-remove-sign">
  802. <h4 class="text-center"><?php echo $language->translate("CHECK_INVITE");?></h4>
  803. <div class="form-group">
  804. <input style="font-size: 400%; height: 100%" type="text" class="form-control yellow-bg text-center text-uppercase" name="inviteCode" placeholder="<?php echo $language->translate("CODE");?>" autocomplete="off" autocorrect="off" autocapitalize="off" value="<?=$inviteCode;?>" maxlength="6" spellcheck="false" autofocus required>
  805. </div>
  806. <button id="checkInviteForm_submit" style="background:<?=$topbar;?>;" type="submit" class="btn btn-block btn-info text-uppercase waves" value="checkInvite"><text style="color:<?=$topbartext;?>;"><?php echo $language->translate("SUBMIT_CODE");?></text></button>
  807. </form>
  808. <div style="display: none" id="chooseMethod">
  809. <h4 class="text-center"><?php echo $language->translate("HAVE_ACCOUNT");?></h4>
  810. <button id="yesPlexButton" style="background:<?=$topbartext;?>;" class="btn btn-block btn-info text-uppercase waves"><text style="color:<?=$topbar;?>;"><?php echo $language->translate("YES");?></text></button>
  811. <button id="noPlexButton" style="background:<?=$topbartext;?>;" class="btn btn-block btn-info text-uppercase waves"><text style="color:<?=$topbar;?>;"><?php echo $language->translate("NO");?></text></button>
  812. </div>
  813. <form style="display:none" name="useInviteForm" id="useInviteForm" onsubmit="return false;" data-smk-icon="glyphicon-remove-sign">
  814. <h4 class="text-center"><?php echo $language->translate("ENTER_PLEX_NAME");?></h4>
  815. <h4 id="accountMade" style="display: none" class="text-center">
  816. <span class="label label-primary"><?php echo $language->translate("ACCOUNT_MADE");?></span>
  817. </h4>
  818. <div id="accountSubmitted" style="display: none" class="panel panel-success">
  819. <div class="panel-heading">
  820. <h3 class="panel-title"><?php echo explosion($language->translate('ACCOUNT_SUBMITTED'), 0);?></h3>
  821. </div>
  822. <div class="panel-body">
  823. <?php echo explosion($language->translate('ACCOUNT_SUBMITTED'), 1);?><br/>
  824. <?php echo explosion($language->translate('ACCOUNT_SUBMITTED'), 2);?><br/>
  825. <?php echo explosion($language->translate('ACCOUNT_SUBMITTED'), 3);?>
  826. </div>
  827. </div>
  828. <div class="form-group">
  829. <input style="font-size: 400%; height: 100%" type="hidden" class="form-control yellow-bg text-center text-uppercase" name="inviteCode" placeholder="<?php echo $language->translate("CODE");?>" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" value="<?=$inviteCode;?>" maxlength="6" required>
  830. <input type="text" class="form-control material" name="inviteUser" placeholder="<?php echo $language->translate("USERNAME_EMAIL");?>" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" value="" autofocus required>
  831. </div>
  832. <button id="useInviteForm_submit" style="background:<?=$topbar;?>;" type="submit" class="btn btn-block btn-info text-uppercase waves" value="useInvite"><text style="color:<?=$topbartext;?>;"><?php echo $language->translate("JOIN");?></text></button>
  833. <button id="plexYesGoBack" style="background:<?=$topbartext;?>;" class="btn btn-block btn-info text-uppercase waves"><text style="color:<?=$topbar;?>;"><?php echo $language->translate("GO_BACK");?></text></button>
  834. </form>
  835. <form style="display:none" name="joinPlexForm" id="joinPlexForm" onsubmit="return false;" data-smk-icon="glyphicon-remove-sign">
  836. <h4 class="text-center"><?php echo $language->translate("CREATE_PLEX");?></h4>
  837. <div class="form-group">
  838. <input type="text" class="form-control material" name="joinUser" placeholder="<?php echo $language->translate("USERNAME");?>" autocomplete="new-password" autocorrect="off" autocapitalize="off" spellcheck="false" value="" autofocus required>
  839. <input type="text" class="form-control material" name="joinEmail" placeholder="<?php echo $language->translate("EMAIL");?>" autocomplete="new-password" autocorrect="off" autocapitalize="off" spellcheck="false" value="" required>
  840. <input type="password" class="form-control material" name="joinPassword" placeholder="<?php echo $language->translate("PASSWORD");?>" autocomplete="new-password" autocorrect="off" autocapitalize="off" spellcheck="false" value="" required>
  841. </div>
  842. <button id="joinPlexForm_submit" style="background:<?=$topbar;?>;" type="submit" class="btn btn-block btn-info text-uppercase waves" value="useInvite"><text style="color:<?=$topbartext;?>;"><?php echo $language->translate("SIGN_UP");?></text></button>
  843. <button id="plexNoGoBack" style="background:<?=$topbartext;?>;" class="btn btn-block btn-info text-uppercase waves"><text style="color:<?=$topbar;?>;"><?php echo $language->translate("GO_BACK");?></text></button>
  844. </form>
  845. </div>
  846. </div>
  847. </div>
  848. </div>
  849. </div>
  850. </div>
  851. </div>
  852. <?php } ?>
  853. <?php if (file_exists('config/config.php') && $configReady == "Yes" && $tabSetup == "No" && SPLASH == "true") {?>
  854. <div id="splashScreen" class="splash-modal modal fade">
  855. <div style="background:<?=$sidebar;?>;" class="table-wrapper big-box">
  856. <button style="color:<?=$topbartext;?>;" type="button" class="close" data-dismiss="modal" aria-label="Close">
  857. <span aria-hidden="true">&times;</span>
  858. </button>
  859. <br/><br/>
  860. <div class="row">
  861. <div class="col-lg-12">
  862. <div class="row">
  863. <?php if($tabSetup == "No") : $tabCount = 1; foreach($splash as $row) : ?>
  864. <div class="col-xs-6 col-sm-4 col-md-3 col-lg-2" id="splash-<?php echo strtolower($row['name']);?>">
  865. <li style="list-style-type: none; cursor: pointer;" window="<?=$row['window'];?>" class="splash-item content-box small-box ultra-widget gray-bg" name="<?php echo strtolower($row['name']);?>">
  866. <div class="w-content">
  867. <div class="w-icon">
  868. <center>
  869. <?php if($row['iconurl']) : ?>
  870. <i style="">
  871. <img src="<?=$row['iconurl'];?>" style="height: 100px; margin-top: -10px;" class="">
  872. </i>
  873. <?php else : ?>
  874. <i style="padding-bottom: 8px" class="fa <?=$row['icon'];?> fa-sm"></i>
  875. <?php endif; ?>
  876. </center>
  877. </div>
  878. <div class="text-center"><span class="text-uppercase w-name elip"><?=$row['name'];?></span></div>
  879. </div>
  880. </li>
  881. </div>
  882. <?php $tabCount++; endforeach; endif;?>
  883. </div>
  884. <?php if( $USER->authenticated && $USER->role == "admin" ){ ?>
  885. <div class="row">
  886. <div class="col-lg-12">
  887. <li style="list-style-type: none; cursor: pointer;" class="splash-item content-box small-box ultra-widget gray-bg" data-title="" name="settings">
  888. <div class="w-content">
  889. <div class="w-icon">
  890. <center>
  891. <i style="">
  892. <img src="images/settings.png" style="height: 100px; margin-top: -10px;" class="">
  893. </i>
  894. </center>
  895. </div>
  896. <div class="text-center"><span class="text-uppercase w-name elip">Settings</span></div>
  897. </div>
  898. </li>
  899. </div>
  900. </div>
  901. <?php } ?>
  902. </div>
  903. </div>
  904. </div>
  905. </div>
  906. <?php } ?>
  907. <!--Scripts-->
  908. <script src="<?=$baseURL;?>bower_components/jquery/dist/jquery.min.js"></script>
  909. <script src="<?=$baseURL;?>bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
  910. <script src="<?=$baseURL;?>bower_components/metisMenu/dist/metisMenu.min.js"></script>
  911. <script src="<?=$baseURL;?>bower_components/Waves/dist/waves.min.js"></script>
  912. <script src="<?=$baseURL;?>bower_components/moment/min/moment.min.js"></script>
  913. <script src="<?=$baseURL;?>bower_components/jquery.nicescroll/jquery.nicescroll.min.js"></script>
  914. <script src="<?=$baseURL;?>bower_components/slimScroll/jquery.slimscroll.min.js"></script>
  915. <script src="<?=$baseURL;?>bower_components/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.js"></script>
  916. <script src="<?=$baseURL;?>bower_components/cta/dist/cta.min.js"></script>
  917. <!--Menu-->
  918. <script src="<?=$baseURL;?>js/menu/classie.js"></script>
  919. <script src="<?=$baseURL;?>js/menu/gnmenu.js"></script>
  920. <!--Selects-->
  921. <script src="<?=$baseURL;?>js/selects/selectFx.js"></script>
  922. <script src="<?=$baseURL;?>bower_components/sweetalert/dist/sweetalert.min.js"></script>
  923. <script src="<?=$baseURL;?>bower_components/smoke/dist/js/smoke.min.js"></script>
  924. <!--Notification-->
  925. <script src="<?=$baseURL;?>js/notifications/notificationFx.js?v=<?php echo INSTALLEDVERSION; ?>"></script>
  926. <!--Custom Scripts-->
  927. <script src="<?=$baseURL;?>js/common.js?v=<?php echo INSTALLEDVERSION; ?>"></script>
  928. <script src="<?=$baseURL;?>js/mousetrap.min.js"></script>
  929. <script src="js/jquery.mousewheel.min.js" type="text/javascript"></script>
  930. <script>
  931. <?php if (file_exists('config/config.php') && $configReady == "Yes" && $tabSetup == "No" && SPLASH == "true") {?>
  932. $('.splash-modal').modal("show");
  933. <?php } ?>
  934. var fixed = document.getElementById('gn-scroller');
  935. fixed.addEventListener('touchmove', function(e) {
  936. e.preventDefault();
  937. }, false);
  938. function setHeight() {
  939. windowHeight = $(window).innerHeight();
  940. $("div").find(".iframe").css('height', windowHeight - <?=$slimBar;?> + "px");
  941. $('#content').css('height', windowHeight - <?=$slimBar;?> + "px");
  942. };
  943. function notify(notifyString, notifyIcon, notifyType, notifyLength, notifyLayout, notifyEffect) {
  944. var notifyString = notifyString;
  945. var notifyIcon = notifyIcon;
  946. var notifyType = notifyType;
  947. var notifyLength = notifyLength;
  948. var notifyLayout = notifyLayout;
  949. var notifyEffect = notifyEffect;
  950. if (notifyEffect === "slidetop"){
  951. var addMeesage = '<span class="fa fa-' + notifyIcon + ' fa-2x"></span>' + '<p>' + notifyString + '</p>';
  952. }else if (notifyEffect === "exploader"){
  953. var addMeesage = '<span class="fa fa-' + notifyIcon + ' fa-2x pull-left"></span>' + '<p>' + notifyString + '</p>';
  954. }else if (notifyEffect === "thumbslider"){
  955. var addMeesage = '<div class="ns-thumb"><img src="images/alert.png"/></div><div class="ns-content"><p>' + notifyString + '</p></div>';
  956. }else{
  957. var addMeesage = '<p>' + notifyString + '</p>';
  958. }
  959. setTimeout(function () {
  960. var notification = new NotificationFx({
  961. message: addMeesage,
  962. layout: notifyLayout,
  963. effect: notifyEffect,
  964. ttl: notifyLength,
  965. type: notifyType,
  966. onClose: function () {
  967. $(".ns-box").fadeOut(400);
  968. }
  969. });
  970. notification.show();
  971. }, 500);
  972. }
  973. $('#registerSubmit').click(function() {
  974. if ($('#registration').smkValidate()) {
  975. console.log("validated");
  976. }
  977. User.processRegistration();
  978. });
  979. $("#editInfo").click(function(){
  980. $( "div[id^='editInfoDiv']" ).toggle();
  981. $( "div[id^='buttonsDiv']" ).toggle();
  982. });
  983. $("#goBackButtons").click(function(){
  984. $( "div[id^='editInfoDiv']" ).toggle();
  985. $( "div[id^='buttonsDiv']" ).toggle();
  986. });
  987. $("#welcomeGoBack").click(function(){
  988. $( "form[id^='login']" ).toggle();
  989. $( "form[id^='forgotPassword']" ).toggle();
  990. $("#switchForgot").toggle();
  991. $("#switchCreateUser").toggle();
  992. $("#welcomeGoBack").toggle();
  993. });
  994. $("#plexNoGoBack").click(function(){
  995. $("#joinPlexForm").toggle();
  996. $("#chooseMethod").toggle();
  997. });
  998. $("#plexYesGoBack").click(function(){
  999. $("#useInviteForm").toggle();
  1000. $("#chooseMethod").toggle();
  1001. });
  1002. $("#welcomeGoBack2").click(function(){
  1003. $( "form[id^='login']" ).toggle();
  1004. $("#userPassForm").toggle();
  1005. $("#switchForgot").toggle();
  1006. $("#switchCreateUser").toggle();
  1007. $("#welcomeGoBack2").toggle();
  1008. });
  1009. $("#welcomeGoBack3").click(function(){
  1010. $("#registration").toggle();
  1011. $("#welcomeGoBack3").toggle();
  1012. $( "form[id^='login']" ).toggle();
  1013. $("#switchForgot").toggle();
  1014. $("#switchCreateUser").toggle();
  1015. });
  1016. $("#switchForgot").click(function(){
  1017. $( "form[id^='login']" ).toggle();
  1018. $( "form[id^='forgotPassword']" ).toggle();
  1019. $("#switchForgot").toggle();
  1020. $("#switchCreateUser").toggle();
  1021. $("#welcomeGoBack").toggle();
  1022. });
  1023. $("#switchCreateUser").click(function(){
  1024. $( "form[id^='login']" ).toggle();
  1025. $("#userPassForm").toggle();
  1026. $("#switchForgot").toggle();
  1027. $("#switchCreateUser").toggle();
  1028. $("#welcomeGoBack2").toggle();
  1029. });
  1030. //Sign in
  1031. $(".log-in").click(function(e){
  1032. var e1 = document.querySelector(".log-in"),
  1033. e2 = document.querySelector(".login-modal");
  1034. cta(e1, e2, {relativeToWindow: true}, function () {
  1035. $('.login-modal').modal("show");
  1036. });
  1037. e.preventDefault();
  1038. });
  1039. //InviteCode
  1040. <?php if(isset($_GET['inviteCode'])){ ?>
  1041. $('#inviteSet').modal("show");
  1042. <?php } ?>
  1043. //Logout
  1044. $(".logout").click(function(e){
  1045. var el1 = document.querySelector(".logout"),
  1046. el2 = document.querySelector(".logout-modal");
  1047. cta(el1, el2, {relativeToWindow: true}, function () {
  1048. $('.logout-modal').modal("show");
  1049. });
  1050. e.preventDefault();
  1051. });
  1052. //Members Sidebar
  1053. $(".show-members").click(function(e){
  1054. var e_s1 = document.querySelector(".show-members"),
  1055. e_s2 = document.querySelector("#members-sidebar");
  1056. cta(e_s1, e_s2, {relativeToWindow: true}, function () {
  1057. $ ('#members-sidebar').addClass('members-sidebar-open');
  1058. });
  1059. e.preventDefault();
  1060. });
  1061. $('.close-members-sidebar').click(function(){
  1062. $('#members-sidebar').removeClass('members-sidebar-open');
  1063. });
  1064. $(document).ready(function(){
  1065. <?php
  1066. if($configReady == "Yes"){
  1067. $pingCount = 1; if($USER->authenticated && $USER->role == "admin"){ $pingTimer = "60000"; }else{ $pingTimer = "600000"; }
  1068. foreach($allPings as $type => $ping){
  1069. $name = str_replace(array(':', '\\', '/', '*'), 'x', $ping);
  1070. if(strpos($type, 'image') !== false){ $style = "margin-top:28px"; }else{ $style = ""; }?>
  1071. var pingTab<?php echo $pingCount;?> = function() {
  1072. $("ping[id^='ping-<?php echo $name;?>']").load("ajax.php?a=get-ping&url=<?php echo $ping;?>&style=<?php echo $style;?>");
  1073. };
  1074. // Initial Loads
  1075. pingTab<?php echo $pingCount;?>();
  1076. // Interval Loads
  1077. setInterval(function() {
  1078. pingTab<?php echo $pingCount;?>();
  1079. console.log("ping check for tab[<?php echo $pingCount;?>] complete");
  1080. }, <?php echo $pingTimer; ?>);
  1081. <?php $pingCount++; }
  1082. }?>
  1083. //PLEX INVITE SHIT
  1084. $('#checkInviteForm').on('submit', function () {
  1085. ajax_request('POST', 'validate-invite', {
  1086. invitecode: $('#checkInviteForm [name=inviteCode]').val(),
  1087. }).done(function(data){
  1088. var result = JSON.stringify(data).includes("success");
  1089. if(result === true){
  1090. $('#checkInviteForm').hide();
  1091. $('#chooseMethod').show();
  1092. console.log(result);
  1093. }
  1094. });
  1095. });
  1096. $('#useInviteForm').on('submit', function () {
  1097. ajax_request('POST', 'use-invite', {
  1098. invitecode: $('#useInviteForm [name=inviteCode]').val(),
  1099. inviteuser: $('#useInviteForm [name=inviteUser]').val(),
  1100. }).done(function(data){
  1101. var result = JSON.stringify(data).includes("success");
  1102. console.log(result);
  1103. if(result === true){
  1104. //$('#checkInviteForm').hide();
  1105. //$('#chooseMethod').show();
  1106. $('#accountSubmitted').show();
  1107. console.log(result);
  1108. }
  1109. });
  1110. });
  1111. $('#joinPlexForm').on('submit', function () {
  1112. ajax_request('POST', 'join-plex', {
  1113. joinuser: $('#joinPlexForm [name=joinUser]').val(),
  1114. joinemail: $('#joinPlexForm [name=joinEmail]').val(),
  1115. joinpassword: $('#joinPlexForm [name=joinPassword]').val(),
  1116. }).done(function(data){
  1117. var result = JSON.stringify(data).includes("success");
  1118. if(result === true){
  1119. $('#joinPlexForm').hide();
  1120. $('#useInviteForm').show();
  1121. $('#accountMade').show();
  1122. $('input[name=inviteUser]').val($('input[name=joinUser]').val());
  1123. console.log(result);
  1124. }
  1125. });
  1126. });
  1127. $("#yesPlexButton").click(function(){
  1128. $('#chooseMethod').hide();
  1129. $('#useInviteForm').show();
  1130. });
  1131. $("#noPlexButton").click(function(){
  1132. $('#chooseMethod').hide();
  1133. $('#joinPlexForm').show();
  1134. });
  1135. $('#userCreateForm').submit(function(event) {
  1136. var formData = {
  1137. 'registerPasswordValue' : $('input[name=registerPasswordValue]').val()
  1138. };
  1139. $.ajax({
  1140. type : 'POST',
  1141. url : 'register.php',
  1142. data : formData,
  1143. dataType : 'json',
  1144. encode : true
  1145. })
  1146. .done(function(data) {
  1147. console.log(data);
  1148. if ( ! data.success) {
  1149. $('#userCreateErrors').html('Wrong Password!'); // add the actual error message under our input
  1150. } else {
  1151. $("#userPassForm").toggle();
  1152. $("#registration").toggle();
  1153. $("#welcomeGoBack3").toggle();
  1154. }
  1155. });
  1156. event.preventDefault();
  1157. });
  1158. defaultTab = $("li[class^='tab-item active']").attr("id");
  1159. $("li[class^='tab-item active']").first().find("img").addClass("TabOpened");
  1160. if (defaultTab){
  1161. defaultTab = defaultTab.substr(0, defaultTab.length-1);
  1162. console.log(defaultTab);
  1163. }else{
  1164. defaultTabNone = $("li[class^='tab-item']").attr("id");
  1165. if (defaultTabNone){
  1166. $("li[class^='tab-item']").first().attr("class", "tab-item active");
  1167. $("li[class^='tab-item']").first().find("img").addClass("TabOpened");
  1168. defaultTab = defaultTabNone.substr(0, defaultTabNone.length-1);
  1169. }
  1170. }
  1171. if (defaultTab){
  1172. defaultTabName = $("li[class^='tab-item active']").attr("name");
  1173. $("#content").html('<div class="iframe active" data-content-name="'+defaultTabName+'" data-content-url="'+defaultTab+'"><iframe id="frame-'+defaultTabName+'" scrolling="auto" sandbox="allow-presentation allow-forms allow-same-origin allow-pointer-lock allow-scripts allow-popups allow-modals allow-top-navigation" allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true" frameborder="0" style="width:100%; height:100%; position: absolute;" src="'+defaultTab+'"></iframe></div>');
  1174. document.getElementById('main-wrapper').focus();
  1175. }
  1176. if (defaultTab == null){
  1177. $("div[id^='tabEmpty']").show();
  1178. <?php
  1179. echo "console.log('Need Setup = $needSetup | Config Ready = $configReady');";
  1180. if($needSetup == "No" && $configReady == "Yes"){
  1181. if(!$USER->authenticated){
  1182. echo "$('#loginModal').modal('show');";
  1183. }
  1184. }
  1185. ?>
  1186. }
  1187. if ($(location).attr('hash')){
  1188. var getHash = $(location).attr('hash').substr(1).replace("%20", " ").replace("_", " ");
  1189. var gotHash = getHash.toLowerCase();
  1190. var getLiTab = $("li[name^='" + gotHash + "']");
  1191. if(gotHash === "upgrade"){ getLiTab.toggle(); console.log("got it"); }
  1192. getLiTab.trigger("click");
  1193. }
  1194. setHeight();
  1195. });
  1196. <?php if(!empty($USER->info_log)) : ?>
  1197. notify("<?php echo printArray($USER->info_log); ?>","info-circle","notice","5000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
  1198. <?php endif; ?>
  1199. <?php if(!empty($USER->error_log)) : ?>
  1200. notify("<?php echo printArray($USER->error_log); ?>","exclamation-circle ","error","5000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
  1201. <?php endif; ?>
  1202. $("li[class^='tab-item']").dblclick(function(){
  1203. var thisidfull = $(this).attr("id");
  1204. var thisid = thisidfull.substr(0, thisidfull.length-1);
  1205. var thisframe = $("#content div[data-content-url^='"+thisid+"']").children('iframe');
  1206. $(thisframe).attr('src', $(thisframe).attr('src'));
  1207. var refreshBox = $('#content').find('.active');
  1208. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(refreshBox).fadeIn(10);
  1209. setTimeout(function(){
  1210. var refreshPreloader = refreshBox.find('.refresh-preloader'),
  1211. deletedRefreshBox = refreshPreloader.fadeOut(300, function(){
  1212. refreshPreloader.remove();
  1213. $("i[class^='mdi mdi-refresh fa-spin']").attr("class", "mdi mdi-refresh");
  1214. });
  1215. },800);
  1216. });
  1217. $('#reload').on('click tap', function(){
  1218. $("i[class^='mdi mdi-refresh']").attr("class", "mdi mdi-refresh fa-spin");
  1219. var activeFrame = $('#content').find('.active').children('iframe');
  1220. activeFrame.attr('src', activeFrame.attr('src'));
  1221. var refreshBox = $('#content').find('.active');
  1222. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(refreshBox).fadeIn(10);
  1223. setTimeout(function(){
  1224. var refreshPreloader = refreshBox.find('.refresh-preloader'),
  1225. deletedRefreshBox = refreshPreloader.fadeOut(300, function(){
  1226. refreshPreloader.remove();
  1227. $("i[class^='mdi mdi-refresh fa-spin']").attr("class", "mdi mdi-refresh");
  1228. });
  1229. },500);
  1230. });
  1231. $('#popout').on('click tap', function(){
  1232. var activeFrame = $('#content').find('.active').children('iframe');
  1233. console.log(activeFrame.attr('src'));
  1234. window.open(activeFrame.attr('src'), '_blank');
  1235. });
  1236. $('#reload').on('contextmenu', function(e){
  1237. $("i[class^='mdi mdi-refresh']").attr("class", "mdi mdi-refresh fa-spin");
  1238. var activeFrame = $('#contentRight').find('.active').children('iframe');
  1239. activeFrame.attr('src', activeFrame.attr('src'));
  1240. var refreshBox = $('#contentRight').find('.active');
  1241. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(refreshBox).fadeIn(10);
  1242. setTimeout(function(){
  1243. var refreshPreloader = refreshBox.find('.refresh-preloader'),
  1244. deletedRefreshBox = refreshPreloader.fadeOut(300, function(){
  1245. refreshPreloader.remove();
  1246. $("i[class^='mdi mdi-refresh fa-spin']").attr("class", "mdi mdi-refresh");
  1247. });
  1248. },500);
  1249. return false;
  1250. });
  1251. $('#splitView').on('contextmenu', function(e){
  1252. e.stopPropagation();
  1253. //$('#splitView').hide();
  1254. $("#content").attr("class", "content");
  1255. $("li[class^='tab-item rightActive']").attr("class", "tab-item");
  1256. $("#contentRight").html('');
  1257. return false;
  1258. });
  1259. $('#splitView').on('click tap', function(){
  1260. var activeFrame = $('#content').find('.active');
  1261. var getCurrentTab = $("li[class^='tab-item active']");
  1262. getCurrentTab.removeClass('active');
  1263. getCurrentTab.find('img').removeClass('TabOpened');
  1264. $("img[class^='TabOpened']").parents("li").trigger("click");
  1265. activeFrame.remove();
  1266. });
  1267. <?php if($iconRotate == "true") : ?>
  1268. $("li[id^='settings.phpx']").on('click tap', function(){
  1269. $("img[id^='settings-icon']").addClass("fa-spin");
  1270. $("i[id^='settings-icon']").addClass("fa-spin");
  1271. setTimeout(function(){
  1272. $("img[id^='settings-icon']").removeClass("fa-spin");
  1273. $("i[id^='settings-icon']").removeClass("fa-spin");
  1274. },1000);
  1275. });
  1276. <?php endif; ?>
  1277. $('#logoutSubmit').on('click tap', function(){
  1278. $( "#logout" ).submit();
  1279. });
  1280. $(window).resize(function(){
  1281. setHeight();
  1282. });
  1283. $("li[class^='splash-item']").on('click vclick', function(){
  1284. var thisname = $(this).attr("name");
  1285. var splashTab = $("#tabList li[name^='" + thisname + "']");
  1286. splashTab.trigger("click");
  1287. $('.splash-modal').modal("hide");
  1288. });
  1289. $("li[class^='tab-item']").on('click vclick', function(){
  1290. var thisidfull = $(this).attr("id");
  1291. var thistitle = $(this).attr("data-title");
  1292. var thisname = $(this).attr("name");
  1293. var thisid = thisidfull.substr(0, thisidfull.length-1);
  1294. var currentframe = $("#content div[data-content-url^='"+thisid+"']");
  1295. if (currentframe.attr("class") == "iframe active") {
  1296. console.log(thisid + " is active already");
  1297. setHeight();
  1298. }else if (currentframe.attr("class") == "iframe hidden") {
  1299. console.log(thisid + " is active already but hidden");
  1300. $("#content div[class^='iframe active']").attr("class", "iframe hidden");
  1301. currentframe.attr("class", "iframe active");
  1302. document.title = thistitle;
  1303. //window.location.href = '#' + thisname;
  1304. setHeight();
  1305. $("li[class^='tab-item active']").attr("class", "tab-item");
  1306. $(this).attr("class", "tab-item active");
  1307. }else {
  1308. if ($(this).attr("window") == "true") {
  1309. window.open(thisid,'_blank');
  1310. }else {
  1311. console.log(thisid + " make new div");
  1312. $("#content div[class^='iframe active']").attr("class", "iframe hidden");
  1313. $( '<div class="iframe active" data-content-name="'+thisname+'" data-content-url="'+thisid+'"><iframe id="frame-'+thisname+'" scrolling="auto" sandbox="allow-presentation allow-forms allow-same-origin allow-pointer-lock allow-scripts allow-popups allow-modals allow-top-navigation" allowfullscreen="true" webkitallowfullscreen="true" frameborder="0" style="width:100%; height:100%; position: absolute;" src="'+thisid+'"></iframe></div>' ).appendTo( "#content" );
  1314. document.title = thistitle;
  1315. // window.location.href = '#' + thisname;
  1316. setHeight();
  1317. $("li[class^='tab-item active']").attr("class", "tab-item");
  1318. $(this).attr("class", "tab-item active");
  1319. jQuery(this).find("img").addClass("TabOpened");
  1320. }
  1321. }
  1322. });
  1323. $("li[class^='tab-item']").on('contextmenu', function(e){
  1324. e.stopPropagation();
  1325. $('#splitView').show();
  1326. $("#content").attr("class", "content split");
  1327. var thisidfull = $(this).attr("id");
  1328. var thistitle = $(this).attr("data-title");
  1329. var thisname = $(this).attr("name");
  1330. var thisid = thisidfull.substr(0, thisidfull.length-1);
  1331. var currentframe = $("#contentRight div[data-content-url^='"+thisid+"']");
  1332. if (currentframe.attr("class") == "iframe active") {
  1333. console.log(thisid + " is active already");
  1334. }else if (currentframe.attr("class") == "iframe hidden") {
  1335. console.log(thisid + " is active already but hidden");
  1336. $("#contentRight div[class^='iframe active']").attr("class", "iframe hidden");
  1337. currentframe.attr("class", "iframe active");
  1338. document.title = thistitle;
  1339. window.location.href = '#' + thisname;
  1340. setHeight();
  1341. $("li[class^='tab-item rightActive']").attr("class", "tab-item");
  1342. $(this).attr("class", "tab-item rightActive");
  1343. }else {
  1344. if ($(this).attr("window") == "true") {
  1345. window.open(thisid,'_blank');
  1346. }else {
  1347. console.log(thisid + " make new div");
  1348. $("#contentRight div[class^='iframe active']").attr("class", "iframe hidden");
  1349. $( '<div class="iframe active" data-content-name="'+thisname+'" data-content-url="'+thisid+'"><iframe id="frameRight-'+thisname+'" scrolling="auto" sandbox="allow-presentation allow-forms allow-same-origin allow-pointer-lock allow-scripts allow-popups allow-modals allow-top-navigation" allowfullscreen="true" webkitallowfullscreen="true" frameborder="0" style="width:100%; height:100%; position: absolute;" src="'+thisid+'"></iframe></div>' ).appendTo( "#contentRight" );
  1350. document.title = thistitle;
  1351. window.location.href = '#' + thisname;
  1352. setHeight();
  1353. $("li[class^='tab-item rightActive']").attr("class", "tab-item");
  1354. $(this).attr("class", "tab-item rightActive");
  1355. jQuery(this).find("img").addClass("TabOpened");
  1356. }
  1357. }
  1358. return false;
  1359. });
  1360. Mousetrap.bind('ctrl+shift+up', function(e) {
  1361. var getCurrentTab = $("li[class^='tab-item active']");
  1362. var previousTab = getCurrentTab.prev().attr( "class", "tab-item" );
  1363. previousTab.trigger("click");
  1364. return false;
  1365. });
  1366. Mousetrap.bind('ctrl+shift+down', function(e) {
  1367. var getCurrentTab = $("li[class^='tab-item active']");
  1368. var nextTab = getCurrentTab.next().attr( "class", "tab-item" );
  1369. nextTab.trigger("click");
  1370. return false;
  1371. });
  1372. Mousetrap.bind('s s', function() { $("li[id^='settings.phpx']").trigger("click"); });
  1373. Mousetrap.bind('p p', function() { $("a[class^='fix-nav']").trigger("click"); });
  1374. Mousetrap.bind('m m', function() { $("div[class^='hamburger']").trigger("click"); });
  1375. Mousetrap.bind('r r', function() { $("a[id^='reload']").trigger("click"); });
  1376. Mousetrap.bind('f f', function() { $("a[class^='fullscreen']").trigger("click"); });
  1377. <?php if($tabSetup == "No") : foreach(range(1,$tabCount) as $index) : if ($index == 10) : break; endif;?>
  1378. Mousetrap.bind('ctrl+shift+<?php echo $index; ?>', function() { $("ul[id^='tabList'] li:nth-child(<?php echo $index; ?>)").trigger("click"); });
  1379. <?php endforeach; endif; ?>
  1380. Mousetrap.bind('esc esc', function() {
  1381. $("#content").attr("class", "content");
  1382. $("li[class^='tab-item rightActive']").attr("class", "tab-item");
  1383. $("#contentRight").html('');
  1384. });
  1385. var ref = document.referrer;
  1386. if(ref.indexOf("updated")>=0){
  1387. notify("<?php echo $language->translate('UPDATE_COMPLETE');?>","exclamation-circle ","success","5000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
  1388. }
  1389. if(ref.indexOf("submit")>=0){
  1390. notify("<?php echo $language->translate('CUSTOM_COMPLETE');?>","exclamation-circle ","success","5000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
  1391. }
  1392. </script>
  1393. </body>
  1394. </html>