index.php 79 KB

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