index.php 67 KB

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