settings.php 150 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240
  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 USER
  9. require_once("user.php");
  10. $USER = new User("registration_callback");
  11. $data = false;
  12. ini_set("display_errors", 1);
  13. ini_set("error_reporting", E_ALL | E_STRICT);
  14. if(!$USER->authenticated) :
  15. header( 'Location: error.php?error=999' );
  16. elseif($USER->authenticated && $USER->role !== "admin") :
  17. header( 'Location: error.php?error=401' );
  18. endif;
  19. $dbfile = DATABASE_LOCATION.'users.db';
  20. $databaseLocation = "databaseLocation.ini.php";
  21. $homepageSettings = "homepageSettings.ini.php";
  22. $userdirpath = USER_HOME;
  23. $userdirpath = substr_replace($userdirpath, "", -1);
  24. $file_db = new PDO("sqlite:" . $dbfile);
  25. $file_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  26. $getUsers = $file_db->query('SELECT * FROM users');
  27. $gotUsers = $file_db->query('SELECT * FROM users');
  28. $dbTab = $file_db->query('SELECT name FROM sqlite_master WHERE type="table" AND name="tabs"');
  29. $dbOptions = $file_db->query('SELECT name FROM sqlite_master WHERE type="table" AND name="options"');
  30. $tabSetup = "Yes";
  31. $hasOptions = "No";
  32. foreach($dbTab as $row) :
  33. if (in_array("tabs", $row)) :
  34. $tabSetup = "No";
  35. endif;
  36. endforeach;
  37. foreach($dbOptions as $row) :
  38. if (in_array("options", $row)) :
  39. $hasOptions = "Yes";
  40. endif;
  41. endforeach;
  42. if($hasOptions == "No") :
  43. $title = "Organizr";
  44. $topbar = "#333333";
  45. $topbartext = "#66D9EF";
  46. $bottombar = "#333333";
  47. $sidebar = "#393939";
  48. $hoverbg = "#AD80FD";
  49. $activetabBG = "#F92671";
  50. $activetabicon = "#FFFFFF";
  51. $activetabtext = "#FFFFFF";
  52. $inactiveicon = "#66D9EF";
  53. $inactivetext = "#66D9EF";
  54. $loading = "#66D9EF";
  55. $hovertext = "#000000";
  56. endif;
  57. if($tabSetup == "No") :
  58. $result = $file_db->query('SELECT * FROM tabs');
  59. endif;
  60. if($hasOptions == "Yes") :
  61. $resulto = $file_db->query('SELECT * FROM options');
  62. endif;
  63. if($hasOptions == "Yes") :
  64. foreach($resulto as $row) :
  65. $title = isset($row['title']) ? $row['title'] : "Organizr";
  66. $topbartext = isset($row['topbartext']) ? $row['topbartext'] : "#66D9EF";
  67. $topbar = isset($row['topbar']) ? $row['topbar'] : "#333333";
  68. $bottombar = isset($row['bottombar']) ? $row['bottombar'] : "#333333";
  69. $sidebar = isset($row['sidebar']) ? $row['sidebar'] : "#393939";
  70. $hoverbg = isset($row['hoverbg']) ? $row['hoverbg'] : "#AD80FD";
  71. $activetabBG = isset($row['activetabBG']) ? $row['activetabBG'] : "#F92671";
  72. $activetabicon = isset($row['activetabicon']) ? $row['activetabicon'] : "#FFFFFF";
  73. $activetabtext = isset($row['activetabtext']) ? $row['activetabtext'] : "#FFFFFF";
  74. $inactiveicon = isset($row['inactiveicon']) ? $row['inactiveicon'] : "#66D9EF";
  75. $inactivetext = isset($row['inactivetext']) ? $row['inactivetext'] : "#66D9EF";
  76. $loading = isset($row['loading']) ? $row['loading'] : "#66D9EF";
  77. $hovertext = isset($row['hovertext']) ? $row['hovertext'] : "#000000";
  78. endforeach;
  79. endif;
  80. $action = "";
  81. if(isset($_POST['action'])) :
  82. $action = $_POST['action'];
  83. endif;
  84. if($action == "deleteDB") :
  85. unset($_COOKIE['Organizr']);
  86. setcookie('Organizr', '', time() - 3600, '/');
  87. unset($_COOKIE['OrganizrU']);
  88. setcookie('OrganizrU', '', time() - 3600, '/');
  89. $file_db = null;
  90. unlink($dbfile);
  91. foreach(glob($userdirpath . '/*') as $file) :
  92. if(is_dir($file)) :
  93. rmdir($file);
  94. elseif(!is_dir($file)) :
  95. unlink($file);
  96. endif;
  97. endforeach;
  98. rmdir($userdirpath);
  99. echo "<script>window.parent.location.reload();</script>";
  100. endif;
  101. if($action == "deleteLog") :
  102. unlink(FAIL_LOG);
  103. echo "<script type='text/javascript'>window.location.replace('settings.php');</script>";
  104. endif;
  105. if($action == "upgrade") :
  106. function downloadFile($url, $path){
  107. $folderPath = "upgrade/";
  108. if(!mkdir($folderPath)) : echo "can't make dir"; endif;
  109. $newfname = $folderPath . $path;
  110. $file = fopen ($url, 'rb');
  111. if ($file) {
  112. $newf = fopen ($newfname, 'wb');
  113. if ($newf) {
  114. while(!feof($file)) {
  115. fwrite($newf, fread($file, 1024 * 8), 1024 * 8);
  116. }
  117. }
  118. }
  119. if ($file) {
  120. fclose($file);
  121. }
  122. if ($newf) {
  123. fclose($newf);
  124. }
  125. }
  126. function unzipFile($zipFile){
  127. $zip = new ZipArchive;
  128. $extractPath = "upgrade/";
  129. if($zip->open($extractPath . $zipFile) != "true"){
  130. echo "Error :- Unable to open the Zip File";
  131. }
  132. /* Extract Zip File */
  133. $zip->extractTo($extractPath);
  134. $zip->close();
  135. }
  136. // Function to remove folders and files
  137. function rrmdir($dir) {
  138. if (is_dir($dir)) {
  139. $files = scandir($dir);
  140. foreach ($files as $file)
  141. if ($file != "." && $file != "..") rrmdir("$dir/$file");
  142. rmdir($dir);
  143. }
  144. else if (file_exists($dir)) unlink($dir);
  145. }
  146. // Function to Copy folders and files
  147. function rcopy($src, $dst) {
  148. if (is_dir ( $src )) {
  149. if (!file_exists($dst)) : mkdir ( $dst ); endif;
  150. $files = scandir ( $src );
  151. foreach ( $files as $file )
  152. if ($file != "." && $file != "..")
  153. rcopy ( "$src/$file", "$dst/$file" );
  154. } else if (file_exists ( $src ))
  155. copy ( $src, $dst );
  156. }
  157. $url = "https://github.com/causefx/Organizr/archive/master.zip";
  158. $file = "upgrade.zip";
  159. $source = __DIR__ . "/upgrade/Organizr-master/";
  160. $cleanup = __DIR__ . "/upgrade/";
  161. $destination = __DIR__ . "/";
  162. downloadFile($url, $file);
  163. unzipFile($file);
  164. rcopy($source, $destination);
  165. rrmdir($cleanup);
  166. echo "<script>top.location.href = 'index.php#upgrade';</script>";
  167. endif;
  168. if(!isset($_POST['op'])) :
  169. $_POST['op'] = "";
  170. endif;
  171. if($action == "addTabz") :
  172. if($tabSetup == "No") :
  173. $file_db->exec("DELETE FROM tabs");
  174. endif;
  175. if($tabSetup == "Yes") :
  176. $file_db->exec("CREATE TABLE tabs (name TEXT UNIQUE, url TEXT, defaultz TEXT, active TEXT, user TEXT, guest TEXT, icon TEXT, iconurl TEXT, window TEXT)");
  177. endif;
  178. $addTabName = array();
  179. $addTabUrl = array();
  180. $addTabIcon = array();
  181. $addTabIconUrl = array();
  182. $addTabDefault = array();
  183. $addTabActive = array();
  184. $addTabUser = array();
  185. $addTabGuest = array();
  186. $addTabWindow = array();
  187. $buildArray = array();
  188. foreach ($_POST as $key => $value) :
  189. $trueKey = explode('-', $key);
  190. if ($value == "on") :
  191. $value = "true";
  192. endif;
  193. if($trueKey[0] == "name"):
  194. array_push($addTabName, $value);
  195. endif;
  196. if($trueKey[0] == "url"):
  197. array_push($addTabUrl, $value);
  198. endif;
  199. if($trueKey[0] == "icon"):
  200. array_push($addTabIcon, $value);
  201. endif;
  202. if($trueKey[0] == "iconurl"):
  203. array_push($addTabIconUrl, $value);
  204. endif;
  205. if($trueKey[0] == "default"):
  206. array_push($addTabDefault, $value);
  207. endif;
  208. if($trueKey[0] == "active"):
  209. array_push($addTabActive, $value);
  210. endif;
  211. if($trueKey[0] == "user"):
  212. array_push($addTabUser, $value);
  213. endif;
  214. if($trueKey[0] == "guest"):
  215. array_push($addTabGuest, $value);
  216. endif;
  217. if($trueKey[0] == "window"):
  218. array_push($addTabWindow, $value);
  219. endif;
  220. endforeach;
  221. $tabArray = 0;
  222. if(count($addTabName) > 0) :
  223. foreach(range(1,count($addTabName)) as $index) :
  224. if(!isset($addTabDefault[$tabArray])) :
  225. $tabDefault = "false";
  226. else :
  227. $tabDefault = $addTabDefault[$tabArray];
  228. endif;
  229. $buildArray[] = array('name' => $addTabName[$tabArray],
  230. 'url' => $addTabUrl[$tabArray],
  231. 'defaultz' => $tabDefault,
  232. 'active' => $addTabActive[$tabArray],
  233. 'user' => $addTabUser[$tabArray],
  234. 'guest' => $addTabGuest[$tabArray],
  235. 'icon' => $addTabIcon[$tabArray],
  236. 'window' => $addTabWindow[$tabArray],
  237. 'iconurl' => $addTabIconUrl[$tabArray]);
  238. $tabArray++;
  239. endforeach;
  240. endif;
  241. $insert = "INSERT INTO tabs (name, url, defaultz, active, user, guest, icon, iconurl, window)
  242. VALUES (:name, :url, :defaultz, :active, :user, :guest, :icon, :iconurl, :window)";
  243. $stmt = $file_db->prepare($insert);
  244. $stmt->bindParam(':name', $name);
  245. $stmt->bindParam(':url', $url);
  246. $stmt->bindParam(':defaultz', $defaultz);
  247. $stmt->bindParam(':active', $active);
  248. $stmt->bindParam(':user', $user);
  249. $stmt->bindParam(':guest', $guest);
  250. $stmt->bindParam(':icon', $icon);
  251. $stmt->bindParam(':iconurl', $iconurl);
  252. $stmt->bindParam(':window', $window);
  253. foreach ($buildArray as $t) :
  254. $name = $t['name'];
  255. $url = $t['url'];
  256. $defaultz = $t['defaultz'];
  257. $active = $t['active'];
  258. $user = $t['user'];
  259. $guest = $t['guest'];
  260. $icon = $t['icon'];
  261. $iconurl = $t['iconurl'];
  262. $window = $t['window'];
  263. $stmt->execute();
  264. endforeach;
  265. endif;
  266. if($action == "addOptionz") :
  267. if($hasOptions == "Yes") :
  268. $file_db->exec("DELETE FROM options");
  269. endif;
  270. if($hasOptions == "No") :
  271. $file_db->exec("CREATE TABLE options (title TEXT UNIQUE, topbar TEXT, bottombar TEXT, sidebar TEXT, hoverbg TEXT, topbartext TEXT, activetabBG TEXT, activetabicon TEXT, activetabtext TEXT, inactiveicon TEXT, inactivetext TEXT, loading TEXT, hovertext TEXT)");
  272. endif;
  273. $title = $_POST['title'];
  274. $topbartext = $_POST['topbartext'];
  275. $topbar = $_POST['topbar'];
  276. $bottombar = $_POST['bottombar'];
  277. $sidebar = $_POST['sidebar'];
  278. $hoverbg = $_POST['hoverbg'];
  279. $hovertext = $_POST['hovertext'];
  280. $activetabBG = $_POST['activetabBG'];
  281. $activetabicon = $_POST['activetabicon'];
  282. $activetabtext = $_POST['activetabtext'];
  283. $inactiveicon = $_POST['inactiveicon'];
  284. $inactivetext = $_POST['inactivetext'];
  285. $loading = $_POST['loading'];
  286. $insert = "INSERT INTO options (title, topbartext, topbar, bottombar, sidebar, hoverbg, activetabBG, activetabicon, activetabtext, inactiveicon, inactivetext, loading, hovertext)
  287. VALUES (:title, :topbartext, :topbar, :bottombar, :sidebar, :hoverbg, :activetabBG, :activetabicon , :activetabtext , :inactiveicon, :inactivetext, :loading, :hovertext)";
  288. $stmt = $file_db->prepare($insert);
  289. $stmt->bindParam(':title', $title);
  290. $stmt->bindParam(':topbartext', $topbartext);
  291. $stmt->bindParam(':topbar', $topbar);
  292. $stmt->bindParam(':bottombar', $bottombar);
  293. $stmt->bindParam(':sidebar', $sidebar);
  294. $stmt->bindParam(':hoverbg', $hoverbg);
  295. $stmt->bindParam(':activetabBG', $activetabBG);
  296. $stmt->bindParam(':activetabicon', $activetabicon);
  297. $stmt->bindParam(':activetabtext', $activetabtext);
  298. $stmt->bindParam(':inactiveicon', $inactiveicon);
  299. $stmt->bindParam(':inactivetext', $inactivetext);
  300. $stmt->bindParam(':loading', $loading);
  301. $stmt->bindParam(':hovertext', $hovertext);
  302. $stmt->execute();
  303. endif;
  304. if(SLIMBAR == "true") : $slimBar = "30"; $userSize = "25"; else : $slimBar = "56"; $userSize = "40"; endif;
  305. ?>
  306. <!DOCTYPE html>
  307. <html lang="en" class="no-js">
  308. <head>
  309. <meta charset="UTF-8">
  310. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  311. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  312. <meta name="msapplication-tap-highlight" content="no" />
  313. <title>Settings</title>
  314. <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
  315. <link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.min.css">
  316. <link rel="stylesheet" href="bower_components/mdi/css/materialdesignicons.min.css">
  317. <link rel="stylesheet" href="bower_components/metisMenu/dist/metisMenu.min.css">
  318. <link rel="stylesheet" href="bower_components/Waves/dist/waves.min.css">
  319. <link rel="stylesheet" href="bower_components/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.css">
  320. <link rel="stylesheet" href="js/selects/cs-select.css">
  321. <link rel="stylesheet" href="js/selects/cs-skin-elastic.css">
  322. <link href="bower_components/iconpick/dist/css/fontawesome-iconpicker.min.css" rel="stylesheet">
  323. <link rel="stylesheet" href="bower_components/google-material-color/dist/palette.css">
  324. <link rel="stylesheet" href="bower_components/sweetalert/dist/sweetalert.css">
  325. <link rel="stylesheet" href="bower_components/smoke/dist/css/smoke.min.css">
  326. <script src="js/menu/modernizr.custom.js"></script>
  327. <script type="text/javascript" src="js/sha1.js"></script>
  328. <script type="text/javascript" src="js/user.js"></script>
  329. <link rel="stylesheet" href="bower_components/animate.css/animate.min.css">
  330. <link rel="stylesheet" href="bower_components/DataTables/media/css/jquery.dataTables.css">
  331. <link rel="stylesheet" href="bower_components/datatables-tabletools/css/dataTables.tableTools.css">
  332. <link rel="stylesheet" href="bower_components/numbered/jquery.numberedtextarea.css">
  333. <link rel="stylesheet" href="css/style.css?v=<?php echo INSTALLEDVERSION; ?>">
  334. <link href="css/jquery.filer.css" rel="stylesheet">
  335. <link href="css/jquery.filer-dragdropbox-theme.css" rel="stylesheet">
  336. <!--[if lt IE 9]>
  337. <script src="bower_components/html5shiv/dist/html5shiv.min.js"></script>
  338. <script src="bower_components/respondJs/dest/respond.min.js"></script>
  339. <![endif]-->
  340. <!--Scripts-->
  341. <script src="bower_components/jquery/dist/jquery.min.js"></script>
  342. <script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
  343. <script src="bower_components/metisMenu/dist/metisMenu.min.js"></script>
  344. <script src="bower_components/Waves/dist/waves.min.js"></script>
  345. <script src="bower_components/moment/min/moment.min.js"></script>
  346. <script src="bower_components/jquery.nicescroll/jquery.nicescroll.min.js"></script>
  347. <script src="bower_components/slimScroll/jquery.slimscroll.min.js"></script>
  348. <script src="bower_components/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.js"></script>
  349. <script src="bower_components/cta/dist/cta.min.js"></script>
  350. <!--Menu-->
  351. <script src="js/menu/classie.js"></script>
  352. <script src="bower_components/iconpick/dist/js/fontawesome-iconpicker.js"></script>
  353. <!--Selects-->
  354. <script src="js/selects/selectFx.js"></script>
  355. <script src="js/jscolor.js"></script>
  356. <script src="bower_components/sweetalert/dist/sweetalert.min.js"></script>
  357. <script src="bower_components/smoke/dist/js/smoke.min.js"></script>
  358. <script src="bower_components/numbered/jquery.numberedtextarea.js"></script>
  359. <!--Notification-->
  360. <script src="js/notifications/notificationFx.js"></script>
  361. <script src="js/jqueri_ui_custom/jquery-ui.min.js"></script>
  362. <script src="js/jquery.filer.min.js" type="text/javascript"></script>
  363. <script src="js/custom.js?v=<?php echo INSTALLEDVERSION; ?>" type="text/javascript"></script>
  364. <script src="js/jquery.mousewheel.min.js" type="text/javascript"></script>
  365. <!--Data Tables-->
  366. <script src="bower_components/DataTables/media/js/jquery.dataTables.js"></script>
  367. <script src="bower_components/datatables.net-responsive/js/dataTables.responsive.js"></script>
  368. <script src="bower_components/datatables-tabletools/js/dataTables.tableTools.js"></script>
  369. </head>
  370. <body class="scroller-body" style="padding: 0; background: #273238; overflow: hidden">
  371. <style>
  372. @media screen and (max-width:737px){
  373. .email-body{width: 100%; overflow: auto;}
  374. .email-content, .email-new {
  375. -webkit-overflow-scrolling: touch;
  376. -webkit-transform: translateZ(0);
  377. overflow: scroll;
  378. position: fixed;
  379. height:100% !important;
  380. margin-top:0;
  381. }.email-content .email-header, .email-new .email-header{
  382. padding: 10px 30px;
  383. z-index: 1000;
  384. }
  385. }@media screen and (min-width:737px){
  386. .email-body{width: 100%}
  387. .email-content .close-button, .email-content .email-actions, .email-new .close-button, .email-new .email-actions {
  388. position: relative;
  389. top: 15px;
  390. right: 0px;
  391. float: right;
  392. }.email-inner-section {
  393. margin-top: 50px;
  394. }.email-content, .email-new {
  395. overflow: auto;
  396. margin-top: 0;
  397. height: 100%;
  398. position: fixed;
  399. max-width: 100%;
  400. width: 84%;
  401. right: -84%;
  402. }.email-content .email-header, .email-new .email-header{
  403. position: fixed;
  404. padding: 10px 30px;
  405. width: 84%;
  406. z-index: 1000;
  407. }
  408. }ul.inbox-nav.nav {
  409. background: white;
  410. padding: 5px;
  411. border-radius: 5px;
  412. }.profile-usermenu ul li.active a {
  413. border-left: 3px solid <?=$activetabBG;?> !important;
  414. padding-left: 12px;
  415. }.profile-usermenu ul li a:hover {
  416. background: <?=$hoverbg;?> !important;
  417. color: <?=$hovertext;?> !important;
  418. cursor: pointer;
  419. }input.form-control.material.icp-auto.iconpicker-element.iconpicker-input {
  420. display: none;
  421. }input.form-control.iconpicker-search {
  422. color: black;
  423. }.key {
  424. font-family:Tahoma, sans-serif;
  425. border-style:solid;
  426. border-color:#D5D6AD #C1C1A8 #CDCBA5 #E7E5C5;
  427. border-width:2px 3px 8px 3px;
  428. background:#D6D4B4;
  429. display:inline-block;
  430. border-radius:5px;
  431. margin:3px;
  432. text-align:center;
  433. }.form-control.material {
  434. background-image: -webkit-gradient(linear, left top, left bottom, from(<?=$topbartext;?>), to(<?=$topbartext;?>)), -webkit-gradient(linear, left top, left bottom, from(#d2d2d2), to(#d2d2d2));
  435. background-image: -webkit-linear-gradient(<?=$topbartext;?>, <?=$topbartext;?>), -webkit-linear-gradient(#d2d2d2, #d2d2d2);
  436. background-image: linear-gradient(<?=$topbartext;?>, <?=$topbartext;?>), linear-gradient(#d2d2d2, #d2d2d2);
  437. }.key span {
  438. background:#ECEECA;
  439. color:#5D5E4F;
  440. display:block;
  441. font-size:12px;
  442. padding:0 2px;
  443. border-radius:3px;
  444. width:14px;
  445. height:18px;
  446. line-height:18px;
  447. text-align:center;
  448. font-weight:bold;
  449. letter-spacing:1px;
  450. text-transform:uppercase;
  451. }.key.wide span {
  452. width:auto;
  453. padding:0 12px;
  454. }.dragging{
  455. border: 2px solid;
  456. }.todo .action-btns a span {
  457. color: #76828e !important;
  458. }.todo li:nth-child(even) {
  459. background: #FFFFFF !important;
  460. }.themeImage {
  461. position: fixed;
  462. left: 160px;
  463. top: 0px;
  464. height: 400px;
  465. }.chooseTheme a span {
  466. position:absolute; display:none; z-index:99;
  467. }.chooseTheme a:hover span {
  468. display:block;
  469. }ul.nav.nav-tabs.apps {
  470. border: solid;
  471. border-top: 0;
  472. border-left: 0;
  473. border-right: 0;
  474. border-radius: 0;
  475. }li.apps.active {
  476. border: solid;
  477. border-bottom: 0;
  478. border-radius: 5px;
  479. top: 3px;
  480. }<?php if(CUSTOMCSS == "true") :
  481. $template_file = "custom.css";
  482. $file_handle = fopen($template_file, "rb");
  483. echo fread($file_handle, filesize($template_file));
  484. fclose($file_handle);
  485. echo "\n";
  486. endif; ?>
  487. </style>
  488. <div id="main-wrapper" class="main-wrapper">
  489. <!--Content-->
  490. <div id="content" style="margin:0 10px; overflow:hidden">
  491. <br/>
  492. <div id="versionCheck"></div>
  493. <div class="row">
  494. <div class="col-lg-2">
  495. <?php if($action) : ?>
  496. <button id="apply" style="width: 100%" class="btn waves btn-success btn-sm text-uppercase waves-effect waves-float animated tada" type="submit">
  497. <?php echo $language->translate("APPLY_CHANGES");?>
  498. </button>
  499. <?php endif; ?>
  500. <div class="content-box profile-sidebar box-shadow">
  501. <img src="images/organizr-logo-h-d.png" width="100%" style="margin-top: -10px;">
  502. <div class="profile-usermenu">
  503. <ul class="nav" id="settings-list">
  504. <li class=""><a id="open-tabs"><i class="fa fa-list red-orange"></i>Edit Tabs</a></li>
  505. <li class=""><a id="open-colors"><i class="fa fa-paint-brush green"></i>Edit Colors</a></li>
  506. <li><a id="open-users"><i class="fa fa-user red"></i>Manage Users</a></li>
  507. <li><a id="open-logs"><i class="fa fa-file-text-o blue"></i>View Logs</a></li>
  508. <li><a id="open-homepage"><i class=" fa fa-home yellow"></i>Edit Homepage</a></li>
  509. <li><a id="open-advanced"><i class=" fa fa-cog light-blue"></i>Advanced</a></li>
  510. <li><a id="open-info"><i class=" fa fa-info orange"></i>&nbsp; About</a></li>
  511. </ul>
  512. </div>
  513. </div>
  514. </div>
  515. <div class="col-lg-10">
  516. </div>
  517. </div>
  518. <div class="email-content tab-box white-bg">
  519. <div class="email-body">
  520. <div class="email-header gray-bg">
  521. <button type="button" class="btn btn-danger btn-sm waves close-button"><i class="fa fa-close"></i></button>
  522. <h1>Edit Tabs</h1>
  523. </div>
  524. <div class="email-inner small-box">
  525. <div class="email-inner-section">
  526. <div class="small-box todo-list fade in" id="tab-tabs">
  527. <div class="sort-todo">
  528. <a class="total-tabs"><?php echo $language->translate("TABS");?> <span class="badge gray-bg"></span></a>
  529. <button id="iconHide" type="button" class="btn waves btn-labeled btn-success btn-sm text-uppercase waves-effect waves-float">
  530. <span class="btn-label"><i class="fa fa-upload"></i></span><?php echo $language->translate("UPLOAD_ICONS");?>
  531. </button>
  532. <button id="iconAll" type="button" class="btn waves btn-labeled btn-success btn-sm text-uppercase waves-effect waves-float">
  533. <span class="btn-label"><i class="fa fa-picture-o"></i></span><?php echo $language->translate("VIEW_ICONS");?>
  534. </button>
  535. </div>
  536. <input type="file" name="files[]" id="uploadIcons" multiple="multiple">
  537. <div id="viewAllIcons" style="display: none;">
  538. <h4><strong><?php echo $language->translate("ALL_ICONS");?></strong> [<?php echo $language->translate("CLICK_ICON");?>]</h4>
  539. <div class="row">
  540. <textarea id="copyTarget" class="hideCopy" style="left: -9999px; top: 0; position: absolute;"></textarea>
  541. <?php
  542. $dirname = "images/";
  543. $images = scandir($dirname);
  544. $ignore = Array(".", "..", "favicon/", "favicon", "._.DS_Store", ".DS_Store", "confused.png", "sowwy.png", "sort-btns", "loading.png", "titlelogo.png", "default.svg", "login.png", "themes", "nadaplaying.jpg", "organizr-logo-h-d.png", "organizr-logo-h.png");
  545. foreach($images as $curimg){
  546. if(!in_array($curimg, $ignore)) { ?>
  547. <div class="col-xs-2" style="width: 75px; height: 75px; padding-right: 0px;">
  548. <a data-toggle="tooltip" data-placement="bottom" title="<?=$dirname.$curimg;?>" class="thumbnail" style="box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);">
  549. <img style="width: 50px; height: 50px;" src="<?=$dirname.$curimg;?>" alt="thumbnail" class="allIcons">
  550. </a>
  551. </div>
  552. <?php } } ?>
  553. </div>
  554. </div>
  555. <form id="add_tab" method="post">
  556. <div class="form-group add-tab">
  557. <div class="input-group">
  558. <div class="input-group-addon">
  559. <i class="fa fa-pencil gray"></i>
  560. </div>
  561. <input type="text" class="form-control name-of-todo" placeholder="<?php echo $language->translate("TYPE_HIT_ENTER");?>" style="border-top-left-radius: 0;
  562. border-bottom-left-radius: 0;">
  563. </div>
  564. </div>
  565. </form>
  566. <div class="panel">
  567. <form id="submitTabs" method="post">
  568. <div class="panel-body todo">
  569. <input type="hidden" name="action" value="addTabz" />
  570. <ul class="list-group ui-sortable">
  571. <?php if($tabSetup == "No") : $tabNum = 1;
  572. foreach($result as $row) :
  573. if($row['defaultz'] == "true") : $default = "checked"; else : $default = ""; endif;
  574. if($row['active'] == "true") : $activez = "checked"; else : $activez = ""; endif;
  575. if($row['guest'] == "true") : $guestz = "checked"; else : $guestz = ""; endif;
  576. if($row['user'] == "true") : $userz = "checked"; else : $userz = ""; endif;
  577. if($row['window'] == "true") : $windowz = "checked"; else : $windowz = ""; endif;
  578. if($row['iconurl'] != "") : $backgroundListImage = "background-image: url('". $row['iconurl'] . "') !important; background-repeat: no-repeat !important; background-position: left !important; background-blend-mode: difference !important; background-size: 50px 50px !important"; else : $backgroundListImage = ""; endif;
  579. ?>
  580. <li id="item-<?=$tabNum;?>" class="list-group-item" style="position: relative; left: 0px; top: 0px;">
  581. <tab class="content-form form-inline">
  582. <div class="form-group">
  583. <div class="action-btns tabIconView" style="width:calc(100%)">
  584. <?php if($backgroundListImage == "") : ?>
  585. <a class="" style="margin-left: 0px"><span style="font: normal normal normal 30px/1 FontAwesome;" class="fa fa-hand-paper-o"></span></a>
  586. <?php endif; ?>
  587. <?php if($backgroundListImage != "") : ?>
  588. <a class="" style="margin-left: 0px"><span style="display: none; font: normal normal normal 30px/1 FontAwesome;" class="fa fa-hand-paper-o"></span></a>
  589. <a class="" style="margin-left: 0px"><span style=""><img style="height: 30px; width: 30px" src="<?=$row['iconurl']?>"></span></a>
  590. <?php endif; ?>
  591. </div>
  592. </div>
  593. <div class="form-group">
  594. <input style="width: 100%;" type="text" class="form-control material input-sm" id="name-<?=$tabNum;?>" name="name-<?=$tabNum;?>" placeholder="<?php echo $language->translate("NEW_TAB_NAME");?>" value="<?=$row['name'];?>">
  595. </div>
  596. <div class="form-group">
  597. <input style="width: 100%;" type="text" class="form-control material input-sm" id="url-<?=$tabNum;?>" name="url-<?=$tabNum;?>" placeholder="<?php echo $language->translate("TAB_URL");?>" value="<?=$row['url']?>">
  598. </div>
  599. <div style="margin-right: 5px;" class="form-group">
  600. <div class="input-group">
  601. <input data-placement="bottomRight" class="form-control material icp-auto" name="icon-<?=$tabNum;?>" value="<?=$row['icon'];?>" type="text" />
  602. <span class="input-group-addon"></span>
  603. </div>
  604. - <?php echo $language->translate("OR");?> -
  605. </div>
  606. <div class="form-group">
  607. <input style="width: 100%;" type="text" class="form-control material input-sm" id="iconurl-<?=$tabNum;?>" name="iconurl-<?=$tabNum;?>" placeholder="<?php echo $language->translate("ICON_URL");?>" value="<?=$row['iconurl']?>">
  608. </div>
  609. <div class="form-group">
  610. <div class="radio radio-danger">
  611. <input type="radio" id="default[<?=$tabNum;?>]" value="true" name="default" <?=$default;?>>
  612. <label for="default[<?=$tabNum;?>]"><?php echo $language->translate("DEFAULT");?></label>
  613. </div>
  614. </div>
  615. <div class="form-group">
  616. <div class="">
  617. <input id="" class="switcher switcher-success" value="false" name="active-<?=$tabNum;?>" type="hidden">
  618. <input id="active[<?=$tabNum;?>]" class="switcher switcher-success" name="active-<?=$tabNum;?>" type="checkbox" <?=$activez;?>>
  619. <label for="active[<?=$tabNum;?>]"></label>
  620. </div>
  621. <?php echo $language->translate("ACTIVE");?>
  622. </div>
  623. <div class="form-group">
  624. <div class="">
  625. <input id="" class="switcher switcher-primary" value="false" name="user-<?=$tabNum;?>" type="hidden">
  626. <input id="user[<?=$tabNum;?>]" class="switcher switcher-primary" name="user-<?=$tabNum;?>" type="checkbox" <?=$userz;?>>
  627. <label for="user[<?=$tabNum;?>]"></label>
  628. </div>
  629. <?php echo $language->translate("USER");?>
  630. </div>
  631. <div class="form-group">
  632. <div class="">
  633. <input id="" class="switcher switcher-primary" value="false" name="guest-<?=$tabNum;?>" type="hidden">
  634. <input id="guest[<?=$tabNum;?>]" class="switcher switcher-warning" name="guest-<?=$tabNum;?>" type="checkbox" <?=$guestz;?>>
  635. <label for="guest[<?=$tabNum;?>]"></label>
  636. </div>
  637. <?php echo $language->translate("GUEST");?>
  638. </div>
  639. <div class="form-group">
  640. <div class="">
  641. <input id="" class="switcher switcher-primary" value="false" name="window-<?=$tabNum;?>" type="hidden">
  642. <input id="window[<?=$tabNum;?>]" class="switcher switcher-danger" name="window-<?=$tabNum;?>" type="checkbox" <?=$windowz;?>>
  643. <label for="window[<?=$tabNum;?>]"></label>
  644. </div>
  645. <?php echo $language->translate("NO_IFRAME");?>
  646. </div>
  647. <div class="pull-right action-btns" style="padding-top: 8px;">
  648. <a class="trash"><span class="fa fa-trash"></span></a>
  649. </div>
  650. </tab>
  651. </li>
  652. <?php $tabNum ++; endforeach; endif;?>
  653. </ul>
  654. </div>
  655. <div class="checkbox clear-todo pull-left"></div>
  656. <button style="margin-top: 5px;" class="btn waves btn-labeled btn-success btn-sm pull-right text-uppercase waves-effect waves-float" type="submit">
  657. <span class="btn-label"><i class="fa fa-floppy-o"></i></span><?php echo $language->translate("SAVE_TABS");?>
  658. </button>
  659. </form>
  660. </div>
  661. </div>
  662. </div>
  663. </div>
  664. </div>
  665. </div>
  666. <div class="email-content color-box white-bg">
  667. <div class="email-body">
  668. <div class="email-header gray-bg">
  669. <button type="button" class="btn btn-danger btn-sm waves close-button"><i class="fa fa-close"></i></button>
  670. <h1>Color Settings</h1>
  671. </div>
  672. <div class="email-inner small-box">
  673. <div class="email-inner-section">
  674. <div class="small-box fade in" id="customedit">
  675. <form id="add_optionz" method="post">
  676. <input type="hidden" name="action" value="addOptionz" />
  677. <div class="btn-group">
  678. <button type="button" class="btn btn-dark dropdown-toggle btn-sm" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  679. <?php echo $language->translate("CHOOSE_THEME");?> <span class="caret"></span>
  680. </button>
  681. <ul class="dropdown-menu gray-bg">
  682. <li class="chooseTheme" id="plexTheme" style="border: 1px #FFFFFF; border-style: groove; background: #000000; border-radius: 5px; margin: 5px;"><a style="color: #E49F0C !important;" href="#">Plex<span><img class="themeImage" src="images/themes/plex.png"></span></a></li>
  683. <li class="chooseTheme" id="newPlexTheme" style="border: 1px #E5A00D; border-style: groove; background: #282A2D; border-radius: 5px; margin: 5px;"><a style="color: #E5A00D !important;" href="#">New Plex<span><img class="themeImage" src="images/themes/newplex.png"></span></a></li>
  684. <li class="chooseTheme" id="embyTheme" style="border: 1px #FFFFFF; border-style: groove; background: #212121; border-radius: 5px; margin: 5px;"><a style="color: #52B54B !important;" href="#">Emby<span><img class="themeImage" src="images/themes/emby.png"></span></a></li>
  685. <li class="chooseTheme" id="bookTheme" style="border: 1px #FFFFFF; border-style: groove; background: #3B5998; border-radius: 5px; margin: 5px;"><a style="color: #FFFFFF !important;" href="#">Facebook<span><img class="themeImage" src="images/themes/facebook.png"></span></a></li>
  686. <li class="chooseTheme" id="spaTheme" style="border: 1px #66BBAE; border-style: groove; background: #66BBAE; border-radius: 5px; margin: 5px;"><a style="color: #5B391E !important;" href="#">Spa<span><img class="themeImage" src="images/themes/spa.png"></span></a></li>
  687. <li class="chooseTheme" id="darklyTheme" style="border: 1px #464545; border-style: groove; background: #375A7F; border-radius: 5px; margin: 5px;"><a style="color: #FFFFFF !important;" href="#">Darkly<span><img class="themeImage" src="images/themes/darkly.png"></span></a></li>
  688. <li class="chooseTheme" id="slateTheme" style="border: 1px #58C0DE; border-style: groove; background: #272B30; border-radius: 5px; margin: 5px;"><a style="color: #C8C8C8 !important;" href="#">Slate<span><img class="themeImage" src="images/themes/slate.png"></span></a></li>
  689. <li class="chooseTheme" id="monokaiTheme" style="border: 1px #AD80FD; border-style: groove; background: #333333; border-radius: 5px; margin: 5px;"><a style="color: #66D9EF !important;" href="#">Monokai<span><img class="themeImage" src="images/themes/monokai.png"></span></a></li>
  690. <li class="chooseTheme" id="thejokerTheme" style="border: 1px #CCC6CC; border-style: groove; background: #000000; border-radius: 5px; margin: 5px;"><a style="color: #CCCCCC !important;" href="#">The Joker<span><img class="themeImage" src="images/themes/joker.png"></span></a></li>
  691. <li class="chooseTheme" id="redTheme" style="border: 1px #eb6363; border-style: groove; background: #eb6363; border-radius: 5px; margin: 5px;"><a style="color: #FFFFFF !important;" href="#">Original Red<span><img class="themeImage" src="images/themes/original.png"></span></a></li>
  692. </ul>
  693. </div>
  694. <button id="editCssButton" class="btn waves btn-labeled btn-primary btn-sm text-uppercase waves-effect waves-float" type="button">
  695. <span class="btn-label"><i class="fa fa-css3"></i></span><?php echo $language->translate("EDIT_CUSTOM_CSS");?>
  696. </button>
  697. <button class="btn waves btn-labeled btn-success btn-sm pull-right text-uppercase waves-effect waves-float" type="submit">
  698. <span class="btn-label"><i class="fa fa-floppy-o"></i></span><?php echo $language->translate("SAVE_OPTIONS");?>
  699. </button>
  700. <div class="big-box grids">
  701. <div class="row show-grids col-lg-12">
  702. <h4><strong><?php echo $language->translate("TITLE");?></strong></h4>
  703. <div class="col-md-4 gray-bg">
  704. <center><?php echo $language->translate("TITLE");?></center>
  705. <input name="title" class="form-control gray" value="<?=$title;?>" placeholder="Organizr">
  706. </div>
  707. <div class="col-md-4 gray-bg">
  708. <center><?php echo $language->translate("TITLE_TEXT");?></center>
  709. <input name="topbartext" id="topbartext" class="form-control jscolor {hash:true}" value="<?=$topbartext;?>">
  710. </div>
  711. <div class="col-md-4 gray-bg">
  712. <center><?php echo $language->translate("LOADING_COLOR");?></center>
  713. <input name="loading" id="loading" class="form-control jscolor {hash:true}" value="<?=$loading;?>">
  714. </div>
  715. </div>
  716. <div class="row show-grids col-lg-12">
  717. <h4><strong><?php echo $language->translate("NAVIGATION_BARS");?></strong></h4>
  718. <div class="col-md-4 gray-bg">
  719. <center><?php echo $language->translate("TOP_BAR");?></center>
  720. <input name="topbar" id="topbar" class="form-control jscolor {hash:true}" value="<?=$topbar;?>">
  721. </div>
  722. <div class="col-md-4 gray-bg">
  723. <center><?php echo $language->translate("BOTTOM_BAR");?></center>
  724. <input name="bottombar" id="bottombar" class="form-control jscolor {hash:true}" value="<?=$bottombar;?>">
  725. </div>
  726. <div class="clearfix visible-xs-block"></div>
  727. <div class="col-md-4 gray-bg">
  728. <center><?php echo $language->translate("SIDE_BAR");?></center>
  729. <input name="sidebar" id="sidebar" class="form-control jscolor {hash:true}" value="<?=$sidebar;?>">
  730. </div>
  731. </div>
  732. <div class="row show-grids col-lg-12">
  733. <div class="col-md-6 gray-bg">
  734. <center><?php echo $language->translate("HOVER_BG");?></center>
  735. <input name="hoverbg" id="hoverbg" class="form-control jscolor {hash:true}" value="<?=$hoverbg;?>">
  736. </div>
  737. <div class="col-md-6 gray-bg">
  738. <center><?php echo $language->translate("HOVER_TEXT");?></center>
  739. <input name="hovertext" id="hovertext" class="form-control jscolor {hash:true}" value="<?=$hovertext;?>">
  740. </div>
  741. </div>
  742. <div class="row show-grids col-lg-12">
  743. <h4><strong><?php echo $language->translate("ACTIVE_TAB");?></strong></h4>
  744. <div class="col-md-4 gray-bg">
  745. <center><?php echo $language->translate("ACTIVE_TAB_BG");?></center>
  746. <input name="activetabBG" id="activetabBG" class="form-control jscolor {hash:true}" value=<?=$activetabBG;?>"">
  747. </div>
  748. <div class="col-md-4 gray-bg">
  749. <center><?php echo $language->translate("ACTIVE_TAB_ICON");?></center>
  750. <input name="activetabicon" id="activetabicon" class="form-control jscolor {hash:true}" value="<?=$activetabicon;?>">
  751. </div>
  752. <div class="col-md-4 gray-bg">
  753. <center><?php echo $language->translate("ACTIVE_TAB_TEXT");?></center>
  754. <input name="activetabtext" id="activetabtext" class="form-control jscolor {hash:true}" value="<?=$activetabtext;?>">
  755. </div>
  756. </div>
  757. <div class="row show-grids col-lg-12">
  758. <h4><strong><?php echo $language->translate("INACTIVE_TAB");?></strong></h4>
  759. <div class="col-md-6 gray-bg">
  760. <center><?php echo $language->translate("INACTIVE_ICON");?></center>
  761. <input name="inactiveicon" id="inactiveicon" class="form-control jscolor {hash:true}" value="<?=$inactiveicon;?>">
  762. </div>
  763. <div class="col-md-6 gray-bg">
  764. <center><?php echo $language->translate("INACTIVE_TEXT");?></center>
  765. <input name="inactivetext" id="inactivetext" class="form-control jscolor {hash:true}" value="<?=$inactivetext;?>">
  766. </div>
  767. </div>
  768. </div>
  769. </form>
  770. <form style="display: none" id="editCssForm" method="POST" action="ajax.php">
  771. <button class="btn waves btn-labeled btn-warning btn-sm pull-left text-uppercase waves-effect waves-float" type="button" id="backToThemeButton">
  772. <span class="btn-label"><i class="fa fa-arrow-left"></i></span><?php echo $language->translate("GO_BACK");?>
  773. </button>
  774. <button class="btn waves btn-labeled btn-success btn-sm pull-right text-uppercase waves-effect waves-float" type="submit">
  775. <span class="btn-label"><i class="fa fa-floppy-o"></i></span><?php echo $language->translate("SAVE_CSS");?>
  776. </button>
  777. <br><br>
  778. <input type="hidden" name="submit" value="editCSS" />
  779. <h1><?php echo $language->translate("EDIT_CUSTOM_CSS");?></h1>
  780. <!--<p>Variables Available<code>$topbar - $topbartext - $bottombar - $sidebar - $hoverbg - $activetabBG - $activetabicon - $activetabtext - $inactiveicon - $inactivetext - $loading - $hovertext</code></p>-->
  781. <textarea class="form-control" id="css-show" name="css-show" rows="25" style="background: #000; color: #FFF;">
  782. <?php if(CUSTOMCSS == "true") :
  783. $template_file = "custom.css";
  784. $file_handle = fopen($template_file, "rb");
  785. echo fread($file_handle, filesize($template_file));
  786. fclose($file_handle);
  787. endif;?></textarea>
  788. </form>
  789. </div>
  790. </div>
  791. </div>
  792. </div>
  793. </div>
  794. <div class="email-content homepage-box white-bg">
  795. <?php
  796. // Qualify most typical hostnames prior to form submission
  797. $urlPattern = '([hH][tT][tT][pP][sS]?):\/\/([\w\.]{1,250})(?::(\d{1,5}))?((?:\/[^?.\s]+))?';
  798. // Once configurable user groups is added change to select-multi to allow specific group selection
  799. $userSelectType = 'select';
  800. $userTypes = array(
  801. 'None' => 'false',
  802. 'User' => 'user|admin',
  803. 'Admin' => 'admin',
  804. );
  805. // Build Advanced Settings
  806. echo buildSettings(
  807. array(
  808. 'title' => 'Homepage Settings',
  809. 'id' => 'homepage_settings',
  810. 'fields' => array(
  811. array(
  812. 'type' => 'header',
  813. 'value' => 'General',
  814. ),
  815. array(
  816. 'type' => $userSelectType,
  817. 'labelTranslate' => 'SHOW_HOMEPAGE',
  818. 'name' => 'homePageAuthNeeded',
  819. 'value' => HOMEPAGEAUTHNEEDED,
  820. 'options' => $userTypes,
  821. ),
  822. array(
  823. 'type' => 'header',
  824. 'value' => 'Services',
  825. ),
  826. ),
  827. 'tabs' => array(
  828. array(
  829. 'title' => 'Plex',
  830. 'id' => 'plex',
  831. 'image' => 'images/plex.png',
  832. 'fields' => array(
  833. array(
  834. 'type' => 'text',
  835. 'placeholder' => 'http://hostname:32400',
  836. 'labelTranslate' => 'PLEX_URL',
  837. 'assist' => 'http://hostname:32400',
  838. 'name' => 'plexURL',
  839. 'pattern' => $urlPattern,
  840. 'value' => PLEXURL,
  841. ),
  842. array(
  843. 'type' => 'text',
  844. 'placeholder' => randString(20),
  845. 'labelTranslate' => 'PLEX_TOKEN',
  846. 'name' => 'plexToken',
  847. 'pattern' => '[a-zA-Z0-9]{20}',
  848. 'value' => PLEXTOKEN,
  849. ),
  850. array(
  851. array(
  852. 'type' => 'checkbox',
  853. 'labelTranslate' => 'RECENT_MOVIES',
  854. 'name' => 'plexRecentMovie',
  855. 'value' => PLEXRECENTMOVIE,
  856. ),
  857. array(
  858. 'type' => 'checkbox',
  859. 'labelTranslate' => 'RECENT_TV',
  860. 'name' => 'plexRecentTV',
  861. 'value' => PLEXRECENTTV,
  862. ),
  863. array(
  864. 'type' => 'checkbox',
  865. 'labelTranslate' => 'RECENT_MUSIC',
  866. 'name' => 'plexRecentMusic',
  867. 'value' => PLEXRECENTMUSIC,
  868. ),
  869. array(
  870. 'type' => 'checkbox',
  871. 'labelTranslate' => 'PLAYING_NOW',
  872. 'name' => 'plexPlayingNow',
  873. 'value' => PLEXPLAYINGNOW,
  874. ),
  875. ),
  876. array(
  877. 'type' => $userSelectType,
  878. 'labelTranslate' => 'SHOW_ON_HOMEPAGE',
  879. 'name' => 'plexHomeAuth',
  880. 'value' => PLEXHOMEAUTH,
  881. 'options' => $userTypes,
  882. ),
  883. ),
  884. ),
  885. array(
  886. 'title' => 'Emby',
  887. 'id' => 'emby',
  888. 'image' => 'images/emby.png',
  889. 'fields' => array(
  890. array(
  891. 'type' => 'text',
  892. 'placeholder' => 'http://hostname:8096/emby',
  893. 'labelTranslate' => 'EMBY_URL',
  894. 'assist' => 'http://hostname:8096 | https://hostname/emby | http://hostname:8096/emby',
  895. 'name' => 'embyURL',
  896. 'pattern' => $urlPattern,
  897. 'value' => EMBYURL,
  898. ),
  899. array(
  900. 'type' => 'text',
  901. 'placeholder' => randString(32),
  902. 'labelTranslate' => 'EMBY_TOKEN',
  903. 'name' => 'plexToken',
  904. 'pattern' => '[a-zA-Z0-9]{32}',
  905. 'value' => EMBYTOKEN,
  906. ),
  907. array(
  908. array(
  909. 'type' => 'checkbox',
  910. 'labelTranslate' => 'RECENT_MOVIES',
  911. 'name' => 'embyRecentMovie',
  912. 'value' => EMBYRECENTMOVIE,
  913. ),
  914. array(
  915. 'type' => 'checkbox',
  916. 'labelTranslate' => 'RECENT_TV',
  917. 'name' => 'embyRecentTV',
  918. 'value' => EMBYRECENTTV,
  919. ),
  920. array(
  921. 'type' => 'checkbox',
  922. 'labelTranslate' => 'RECENT_MUSIC',
  923. 'name' => 'embyRecentMusic',
  924. 'value' => EMBYRECENTMUSIC,
  925. ),
  926. array(
  927. 'type' => 'checkbox',
  928. 'labelTranslate' => 'PLAYING_NOW',
  929. 'name' => 'embyPlayingNow',
  930. 'value' => EMBYPLAYINGNOW,
  931. ),
  932. ),
  933. array(
  934. 'type' => $userSelectType,
  935. 'labelTranslate' => 'SHOW_ON_HOMEPAGE',
  936. 'name' => 'embyHomeAuth',
  937. 'value' => EMBYHOMEAUTH,
  938. 'options' => $userTypes,
  939. ),
  940. ),
  941. ),
  942. array(
  943. 'title' => 'Sonarr',
  944. 'id' => 'sonarr',
  945. 'image' => 'images/sonarr.png',
  946. 'fields' => array(
  947. array(
  948. 'type' => 'text',
  949. 'placeholder' => 'http://hostname:8989',
  950. 'labelTranslate' => 'SONARR_URL',
  951. 'assist' => 'http://hostname:8989 | hostname/sonarr | http://hostname:8989/sonarr',
  952. 'name' => 'sonarrURL',
  953. 'pattern' => $urlPattern,
  954. 'value' => SONARRURL,
  955. ),
  956. array(
  957. 'type' => 'text',
  958. 'placeholder' => randString(32),
  959. 'labelTranslate' => 'SONARR_KEY',
  960. 'name' => 'sonarrKey',
  961. 'pattern' => '[a-zA-Z0-9]{32}',
  962. 'value' => SONARRKEY,
  963. ),
  964. array(
  965. 'type' => $userSelectType,
  966. 'labelTranslate' => 'SHOW_ON_HOMEPAGE',
  967. 'name' => 'sonarrHomeAuth',
  968. 'value' => SONARRHOMEAUTH,
  969. 'options' => $userTypes,
  970. ),
  971. ),
  972. ),
  973. array(
  974. 'title' => 'Radarr',
  975. 'id' => 'radarr',
  976. 'image' => 'images/radarr.png',
  977. 'fields' => array(
  978. array(
  979. 'type' => 'text',
  980. 'placeholder' => 'http://hostname:8989',
  981. 'labelTranslate' => 'RADARR_URL',
  982. 'assist' => 'http://hostname:8989 | hostname/radarr | http://hostname:8989/radarr',
  983. 'name' => 'radarrURL',
  984. 'pattern' => $urlPattern,
  985. 'value' => RADARRURL,
  986. ),
  987. array(
  988. 'type' => 'text',
  989. 'placeholder' => randString(32),
  990. 'labelTranslate' => 'RADARR_KEY',
  991. 'name' => 'radarrKey',
  992. 'pattern' => '[a-zA-Z0-9]{32}',
  993. 'value' => RADARRKEY,
  994. ),
  995. array(
  996. 'type' => $userSelectType,
  997. 'labelTranslate' => 'SHOW_ON_HOMEPAGE',
  998. 'name' => 'radarrHomeAuth',
  999. 'value' => RADARRHOMEAUTH,
  1000. 'options' => $userTypes,
  1001. ),
  1002. ),
  1003. ),
  1004. array(
  1005. 'title' => 'Sickbeard/Sickrage',
  1006. 'id' => 'sick',
  1007. 'image' => 'images/sickrage.png',
  1008. 'fields' => array(
  1009. array(
  1010. 'type' => 'text',
  1011. 'placeholder' => 'http://hostname:8081/sick',
  1012. 'labelTranslate' => 'SICK_URL',
  1013. 'assist' => 'http://hostname:8081 | hostname/sick | http://hostname:8081/sick',
  1014. 'name' => 'sickrageURL',
  1015. 'pattern' => $urlPattern,
  1016. 'value' => SICKRAGEURL,
  1017. ),
  1018. array(
  1019. 'type' => 'text',
  1020. 'placeholder' => randString(32),
  1021. 'labelTranslate' => 'SICK_KEY',
  1022. 'name' => 'sickrageKey',
  1023. 'value' => SICKRAGEKEY,
  1024. ),
  1025. array(
  1026. 'type' => $userSelectType,
  1027. 'labelTranslate' => 'SHOW_ON_HOMEPAGE',
  1028. 'name' => 'sickrageHomeAuth',
  1029. 'value' => SICKRAGEHOMEAUTH,
  1030. 'options' => $userTypes,
  1031. ),
  1032. ),
  1033. ),
  1034. array(
  1035. 'title' => 'Headphones',
  1036. 'id' => 'headphones',
  1037. 'image' => 'images/headphones.png',
  1038. 'fields' => array(
  1039. array(
  1040. 'type' => 'text',
  1041. 'placeholder' => 'http://hostname:8181',
  1042. 'labelTranslate' => 'HEADPHONES_URL',
  1043. 'assist' => 'http://hostname:8181',
  1044. 'name' => 'headphonesURL',
  1045. 'pattern' => $urlPattern,
  1046. 'value' => HEADPHONESURL,
  1047. ),
  1048. array(
  1049. 'type' => 'text',
  1050. 'placeholder' => randString(32),
  1051. 'labelTranslate' => 'HEADPHONES_KEY',
  1052. 'name' => 'headphonesKey',
  1053. 'value' => HEADPHONESKEY,
  1054. ),
  1055. array(
  1056. 'type' => $userSelectType,
  1057. 'labelTranslate' => 'SHOW_ON_HOMEPAGE',
  1058. 'name' => 'headphonesHomeAuth',
  1059. 'value' => HEADPHONESHOMEAUTH,
  1060. 'options' => $userTypes,
  1061. ),
  1062. ),
  1063. ),
  1064. array(
  1065. 'title' => 'Sabnzbd',
  1066. 'id' => 'sabnzbd',
  1067. 'image' => 'images/sabnzbd.png',
  1068. 'fields' => array(
  1069. array(
  1070. 'type' => 'text',
  1071. 'placeholder' => 'http://hostname:8080/sabnzbd',
  1072. 'labelTranslate' => 'SABNZBD_URL',
  1073. 'assist' => 'http://hostname:8080 | http://hostname/sabnzbd | http://hostname:8080/sabnzbd',
  1074. 'name' => 'sabnzbdURL',
  1075. 'pattern' => $urlPattern,
  1076. 'value' => SABNZBDURL,
  1077. ),
  1078. array(
  1079. 'type' => 'text',
  1080. 'placeholder' => randString(32),
  1081. 'labelTranslate' => 'SABNZBD_KEY',
  1082. 'name' => 'sabnzbdKey',
  1083. 'value' => SABNZBDKEY,
  1084. ),
  1085. array(
  1086. 'type' => $userSelectType,
  1087. 'labelTranslate' => 'SHOW_ON_HOMEPAGE',
  1088. 'name' => 'sabnzbdHomeAuth',
  1089. 'value' => SABNZBDHOMEAUTH,
  1090. 'options' => $userTypes,
  1091. ),
  1092. ),
  1093. ),
  1094. array(
  1095. 'title' => 'nzbGET',
  1096. 'id' => 'nzbget',
  1097. 'image' => 'images/nzbget.png',
  1098. 'fields' => array(
  1099. array(
  1100. 'type' => 'text',
  1101. 'placeholder' => 'http://hostname:6789',
  1102. 'labelTranslate' => 'NZBGET_URL',
  1103. 'assist' => 'http://hostname:6789',
  1104. 'name' => 'nzbgetURL',
  1105. 'pattern' => $urlPattern,
  1106. 'value' => NZBGETURL,
  1107. ),
  1108. array(
  1109. 'type' => 'text',
  1110. 'labelTranslate' => 'USERNAME',
  1111. 'name' => 'nzbgetUsername',
  1112. 'value' => NZBGETUSERNAME,
  1113. ),
  1114. array(
  1115. 'type' => 'password',
  1116. 'labelTranslate' => 'PASSWORD',
  1117. 'name' => 'nzbgetPassword',
  1118. 'value' => (empty(NZBGETPASSWORD)?'':randString(20)),
  1119. ),
  1120. array(
  1121. 'type' => $userSelectType,
  1122. 'labelTranslate' => 'SHOW_ON_HOMEPAGE',
  1123. 'name' => 'nzbgetHomeAuth',
  1124. 'value' => NZBGETHOMEAUTH,
  1125. 'options' => $userTypes,
  1126. ),
  1127. ),
  1128. ),
  1129. array(
  1130. 'title' => 'Calendar',
  1131. 'id' => 'calendar',
  1132. 'image' => 'images/calendar.png',
  1133. 'fields' => array(
  1134. array(
  1135. 'type' => 'select',
  1136. 'labelTranslate' => 'CALENDAR_START_DAY',
  1137. 'name' => 'calendarStart',
  1138. 'value' => CALENDARSTART,
  1139. 'options' => array(
  1140. explode('|', translate('DAYS'))[0] => '0',
  1141. explode('|', translate('DAYS'))[1] => '1',
  1142. explode('|', translate('DAYS'))[2] => '2',
  1143. explode('|', translate('DAYS'))[3] => '3',
  1144. explode('|', translate('DAYS'))[4] => '4',
  1145. explode('|', translate('DAYS'))[5] => '5',
  1146. explode('|', translate('DAYS'))[6] => '6',
  1147. ),
  1148. ),
  1149. array(
  1150. 'type' => 'select',
  1151. 'labelTranslate' => 'DEFAULT',
  1152. 'name' => 'calendarView',
  1153. 'value' => CALENDARVIEW,
  1154. 'options' => array(
  1155. translate('MONTH') => 'month',
  1156. translate('DAY') => 'basicDay',
  1157. translate('WEEK') => 'basicWeek',
  1158. ),
  1159. ),
  1160. array(
  1161. 'type' => 'select',
  1162. 'labelTranslate' => 'CALTIMEFORMAT',
  1163. 'name' => 'calTimeFormat',
  1164. 'value' => CALTIMEFORMAT,
  1165. 'options' => array(
  1166. '6p' => 'h(:mm)t',
  1167. '6:00p' => 'h:mmt',
  1168. '6:00' => 'h:mm',
  1169. '18' => 'H(:mm)',
  1170. '18:00' => 'H:mm',
  1171. ),
  1172. ),
  1173. array(
  1174. 'type' => 'number',
  1175. 'placeholder' => '10',
  1176. 'labelTranslate' => 'CALENDAR_START_DATE',
  1177. 'name' => 'calendarStartDay',
  1178. 'pattern' => '[1-9][0-9]+',
  1179. 'value' => CALENDARSTARTDAY,
  1180. ),
  1181. array(
  1182. 'type' => 'number',
  1183. 'placeholder' => '10',
  1184. 'labelTranslate' => 'CALENDAR_END_DATE',
  1185. 'name' => 'calendarEndDay',
  1186. 'pattern' => '[1-9][0-9]+',
  1187. 'value' => CALENDARENDDAY,
  1188. ),
  1189. ),
  1190. ),
  1191. ),
  1192. )
  1193. );
  1194. ?>
  1195. </div>
  1196. <div class="email-content advanced-box white-bg">
  1197. <?php
  1198. $backendOptions = array();
  1199. foreach (array_filter(get_defined_functions()['user'],function($v) { return strpos($v, 'plugin_auth_') === 0; }) as $value) {
  1200. $name = str_replace('plugin_auth_','',$value);
  1201. if (strpos($name, 'disabled') === false) {
  1202. $backendOptions[ucwords(str_replace('_',' ',$name))] = $name;
  1203. } else {
  1204. $backendOptions[$value()] = array(
  1205. 'value' => randString(),
  1206. 'disabled' => true,
  1207. );
  1208. }
  1209. }
  1210. ksort($backendOptions);
  1211. echo buildSettings(
  1212. array(
  1213. 'title' => 'Advanced Settings',
  1214. 'id' => 'advanced_settings',
  1215. 'onready' => '$(\'.be-auth\').each(function() { $(this).parent().hide(); }); $(\'.be-auth-\'+$(\'#authBackend_id\').val()).each(function() { $(this).parent().show(); });',
  1216. 'tabs' => array(
  1217. array(
  1218. 'title' => 'Backend Authentication',
  1219. 'id' => 'be_auth',
  1220. 'image' => 'images/security.png',
  1221. 'fields' => array(
  1222. array(
  1223. 'type' => 'select',
  1224. 'labelTranslate' => 'AUTHTYPE',
  1225. 'name' => 'authType',
  1226. 'value' => AUTHTYPE,
  1227. 'options' => array(
  1228. 'Organizr' => 'internal',
  1229. 'Organizr & Backend' => 'both',
  1230. // 'Backend' => 'external',
  1231. ),
  1232. ),
  1233. array(
  1234. 'type' => 'select',
  1235. 'labelTranslate' => 'AUTHBACKEND',
  1236. 'name' => 'authBackend',
  1237. 'onchange' => '$(\'.be-auth\').each(function() { $(this).parent().hide(); }); $(\'.be-auth-\'+this.value).each(function() { $(this).parent().show(); });',
  1238. 'value' => AUTHBACKEND,
  1239. 'options' => $backendOptions,
  1240. ),
  1241. array(
  1242. 'type' => 'select',
  1243. 'labelTranslate' => 'AUTHBACKENDCREATE',
  1244. 'name' => 'authBackendCreate',
  1245. 'value' => AUTHBACKENDCREATE,
  1246. 'options' => array(
  1247. translate('YES_CREATE') => 'true',
  1248. translate('NO_CREATE') => 'false',
  1249. ),
  1250. ),
  1251. array(
  1252. 'type' => 'text',
  1253. 'placeholder' => 'http://hostname:8181',
  1254. 'labelTranslate' => 'AUTHBACKENDHOST',
  1255. 'assist' => 'http(s)://hostname:8181 | Ldap(s)://localhost:389 | ftp(s)://localhost:21',
  1256. 'name' => 'authBackendHost',
  1257. 'class' => 'be-auth be-auth-ftp be-auth-ldap',
  1258. 'pattern' => '((?:[hH][tT][tT][pP]|[lL][dD][aA][pP]|[fF][tT][pP])[sS]?):\/\/([\w\.]{1,250})(?::(\d{1,5}))?((?:\/[^?.\s]+))?',
  1259. 'value' => AUTHBACKENDHOST,
  1260. ),
  1261. array(
  1262. 'type' => 'text',
  1263. 'placeholder' => 'domain',
  1264. 'labelTranslate' => 'AUTHBACKENDDOMAIN',
  1265. 'name' => 'authBackendDomain',
  1266. 'class' => 'be-auth be-auth-ldap',
  1267. 'value' => AUTHBACKENDDOMAIN,
  1268. ),
  1269. array(
  1270. 'type' => 'text',
  1271. 'placeholder' => 'http://hostname:8096/emby',
  1272. 'labelTranslate' => 'EMBY_URL',
  1273. 'assist' => 'http://hostname:8096 | https://hostname/emby | http://hostname:8096/emby',
  1274. 'class' => 'be-auth be-auth-emby_local be-auth-emby_all be-auth-emby_connect',
  1275. 'name' => 'embyURL',
  1276. 'pattern' => $urlPattern,
  1277. 'value' => EMBYURL,
  1278. ),
  1279. array(
  1280. 'type' => 'text',
  1281. 'placeholder' => randString(32),
  1282. 'labelTranslate' => 'EMBY_TOKEN',
  1283. 'name' => 'plexToken',
  1284. 'class' => 'be-auth be-auth-emby_all be-auth-emby_connect',
  1285. 'pattern' => '[a-zA-Z0-9]{32}',
  1286. 'value' => EMBYTOKEN,
  1287. ),
  1288. array(
  1289. 'type' => 'text',
  1290. 'labelTranslate' => 'PLEX_USERNAME',
  1291. 'name' => 'plexUsername',
  1292. 'class' => 'be-auth be-auth-plex',
  1293. 'value' => PLEXUSERNAME,
  1294. ),
  1295. array(
  1296. 'type' => 'password',
  1297. 'labelTranslate' => 'PLEX_PASSWORD',
  1298. 'name' => 'plexPassword',
  1299. 'class' => 'be-auth be-auth-plex',
  1300. 'value' => (empty(PLEXPASSWORD)?'':randString(20)),
  1301. ),
  1302. ),
  1303. ),
  1304. array(
  1305. 'title' => 'Super Advanced',
  1306. 'id' => 'super_advanced',
  1307. 'image' => 'images/gear.png',
  1308. 'fields' => array(
  1309. array(
  1310. 'type' => 'text',
  1311. 'placeholder' => '/home/www-data/',
  1312. 'labelTranslate' => 'DATABASE_PATH',
  1313. 'name' => 'database_Location',
  1314. 'value' => DATABASE_LOCATION,
  1315. ),
  1316. array(
  1317. 'type' => 'select',
  1318. 'labelTranslate' => 'SET_TIMEZONE',
  1319. 'name' => 'timezone',
  1320. 'value' => TIMEZONE,
  1321. 'options' => timezoneOptions(),
  1322. ),
  1323. array(
  1324. 'type' => 'text',
  1325. 'labelTranslate' => 'REGISTER_PASSWORD',
  1326. 'name' => 'registerPassword',
  1327. 'value' => REGISTERPASSWORD,
  1328. ),
  1329. array(
  1330. 'type' => 'text',
  1331. 'labelTranslate' => 'COOKIE_DOMAIN',
  1332. 'name' => 'domain',
  1333. 'value' => DOMAIN,
  1334. ),
  1335. array(
  1336. 'type' => 'password',
  1337. 'labelTranslate' => 'COOKIE_PASSWORD',
  1338. 'name' => 'cookiePassword',
  1339. 'value' => (empty(COOKIEPASSWORD)?'':randString(20)),
  1340. ),
  1341. array(
  1342. 'type' => 'checkbox',
  1343. 'labelTranslate' => 'MULTIPLE_LOGINS',
  1344. 'name' => 'multipleLogin',
  1345. 'value' => MULTIPLELOGIN,
  1346. ),
  1347. ),
  1348. ),
  1349. array(
  1350. 'title' => 'Mail Settings',
  1351. 'id' => 'mail_settings',
  1352. 'image' => 'images/mail.png',
  1353. 'fields' => array(
  1354. array(
  1355. 'type' => 'text',
  1356. 'placeholder' => 'mail.provider.com',
  1357. 'labelTranslate' => 'SMTP_HOST',
  1358. 'name' => 'smtpHost',
  1359. 'pattern' => $urlPattern,
  1360. 'value' => SMTPHOST,
  1361. ),
  1362. array(
  1363. 'type' => 'number',
  1364. 'placeholder' => '465',
  1365. 'labelTranslate' => 'SMTP_HOST_PORT',
  1366. 'name' => 'smtpHostPort',
  1367. 'value' => SMTPHOSTPORT,
  1368. ),
  1369. array(
  1370. 'type' => 'text',
  1371. 'labelTranslate' => 'SMTP_HOST_USERNAME',
  1372. 'name' => 'smtpHostUsername',
  1373. 'value' => SMTPHOSTUSERNAME,
  1374. ),
  1375. array(
  1376. 'type' => 'password',
  1377. 'labelTranslate' => 'SMTP_HOST_PASSWORD',
  1378. 'name' => 'smtpHostPassword',
  1379. 'value' => (empty(SMTPHOSTPASSWORD)?'':randString(20)),
  1380. ),
  1381. array(
  1382. 'type' => 'text',
  1383. 'labelTranslate' => 'SMTP_HOST_SENDER_NAME',
  1384. 'name' => 'smtpHostSenderName',
  1385. 'value' => SMTPHOSTSENDERNAME,
  1386. ),
  1387. array(
  1388. 'type' => 'text',
  1389. 'labelTranslate' => 'SMTP_HOST_SENDER_EMAIL',
  1390. 'name' => 'smtpHostSenderEmail',
  1391. 'value' => SMTPHOSTSENDEREMAIL,
  1392. ),
  1393. array(
  1394. array(
  1395. 'type' => 'checkbox',
  1396. 'labelTranslate' => 'SMTP_HOST_AUTH',
  1397. 'name' => 'smtpHostAuth',
  1398. 'value' => SMTPHOSTAUTH,
  1399. ),
  1400. array(
  1401. 'type' => 'checkbox',
  1402. 'labelTranslate' => 'ENABLE_MAIL',
  1403. 'name' => 'enableMail',
  1404. 'value' => ENABLEMAIL,
  1405. ),
  1406. ),
  1407. ),
  1408. ),
  1409. array(
  1410. 'title' => 'Advanced Visual',
  1411. 'id' => 'advanced_visual',
  1412. 'image' => 'images/paint.png',
  1413. 'fields' => array(
  1414. array(
  1415. 'type' => 'text',
  1416. 'placeholder' => 'images/organizr.png',
  1417. 'labelTranslate' => 'LOADING_ICON_URL',
  1418. 'name' => 'loadingIcon',
  1419. 'value' => LOADINGICON,
  1420. ),
  1421. array(
  1422. 'type' => 'text',
  1423. 'placeholder' => 'images/organizr.png',
  1424. 'labelTranslate' => 'LOGO_URL_TITLE',
  1425. 'name' => 'titleLogo',
  1426. 'value' => TITLELOGO,
  1427. ),
  1428. array(
  1429. 'type' => 'select',
  1430. 'labelTranslate' => 'NOTIFICATION_TYPE',
  1431. 'name' => 'notifyEffect',
  1432. 'onchange' => 'parent.notify(\'This is an example popup!\', \'bullhorn\', \'success\', 4000, this.value.split(\'-\')[0], this.value.split(\'-\')[1]);',
  1433. 'value' => explode("-", NOTIFYEFFECT)[1],
  1434. 'options' => array(
  1435. 'Slide From Top' => 'bar-slidetop',
  1436. 'Exploader From Top' => 'bar-exploader',
  1437. 'Flip' => 'attached-flip',
  1438. 'Bouncy Flip' => 'attached-bouncyflip',
  1439. 'Growl Scale' => 'growl-scale',
  1440. 'Growl Genie' => 'growl-genie',
  1441. 'Growl Jelly' => 'growl-jelly',
  1442. 'Growl Slide' => 'growl-slide',
  1443. 'Spinning Box' => 'other-boxspinner',
  1444. 'Sliding' => 'other-thumbslider',
  1445. ),
  1446. ),
  1447. array(
  1448. array(
  1449. 'type' => 'checkbox',
  1450. 'labelTranslate' => 'ENABLE_LOADING_SCREEN',
  1451. 'name' => 'loadingScreen',
  1452. 'value' => LOADINGSCREEN,
  1453. ),
  1454. array(
  1455. 'type' => 'checkbox',
  1456. 'labelTranslate' => 'ENABLE_SLIMBAR',
  1457. 'name' => 'slimBar',
  1458. 'value' => SLIMBAR,
  1459. ),
  1460. array(
  1461. 'type' => 'checkbox',
  1462. 'labelTranslate' => 'GRAVATAR',
  1463. 'name' => 'gravatar',
  1464. 'value' => GRAVATAR,
  1465. ),
  1466. ),
  1467. ),
  1468. ),
  1469. ),
  1470. )
  1471. );
  1472. ?>
  1473. </div>
  1474. <div class="email-content info-box white-bg">
  1475. <div class="email-body">
  1476. <div class="email-header gray-bg">
  1477. <button type="button" class="btn btn-danger btn-sm waves close-button"><i class="fa fa-close"></i></button>
  1478. <h1>About Organizr</h1>
  1479. </div>
  1480. <div class="email-inner small-box">
  1481. <div class="email-inner-section">
  1482. <div class="small-box fade in" id="about">
  1483. <h4><img src="images/organizr-logo-h-d.png" height="50px"></h4>
  1484. <p id="version"></p>
  1485. <p id="submitFeedback">
  1486. <a href='https://reddit.com/r/organizr' target='_blank' type='button' style="background: #AD80FD" class='btn waves btn-labeled btn-success btn text-uppercase waves-effect waves-float'><span class='btn-label'><i class='fa fa-reddit'></i></span>SUBREDDIT</a>
  1487. <a href='https://github.com/causefx/Organizr/issues/new' target='_blank' type='button' class='btn waves btn-labeled btn-success btn text-uppercase waves-effect waves-float'><span class='btn-label'><i class='fa fa-github-alt'></i></span><?php echo $language->translate("SUBMIT_ISSUE");?></a>
  1488. <a href='https://github.com/causefx/Organizr' target='_blank' type='button' class='btn waves btn-labeled btn-primary btn text-uppercase waves-effect waves-float'><span class='btn-label'><i class='fa fa-github'></i></span><?php echo $language->translate("VIEW_ON_GITHUB");?></a>
  1489. <a href='https://gitter.im/Organizrr/Lobby' target='_blank' type='button' class='btn waves btn-labeled btn-dark btn text-uppercase waves-effect waves-float'><span class='btn-label'><i class='fa fa-comments-o'></i></span><?php echo $language->translate("CHAT_WITH_US");?></a>
  1490. <button type="button" class="class='btn waves btn-labeled btn-warning btn text-uppercase waves-effect waves-float" data-toggle="modal" data-target=".Help-Me-modal-lg"><span class='btn-label'><i class='fa fa-life-ring'></i></span><?php echo $language->translate("HELP");?></button>
  1491. <button id="deleteToggle" type="button" class="class='btn waves btn-labeled btn-danger btn text-uppercase waves-effect waves-float" ><span class='btn-label'><i class='fa fa-trash'></i></span><?php echo $language->translate("DELETE_DATABASE");?></button>
  1492. </p>
  1493. <div class="modal fade Help-Me-modal-lg" tabindex="-1" role="dialog">
  1494. <div class="modal-dialog modal-lg" role="document">
  1495. <div class="modal-content" style="color: <?php echo $topbartext;?> !important; background: <?php echo $topbar;?> !important;">
  1496. <div class="modal-header">
  1497. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  1498. <h4 class="modal-title"><?php echo $language->translate("HELP");?>!</h4>
  1499. </div>
  1500. <div class="modal-body" style="background: <?php echo $sidebar;?> !important;">
  1501. <div style="margin-bottom: 0px;" class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
  1502. <div style="color: <?php echo $topbartext;?> !important; background: <?php echo $topbar;?> !important;" class="panel panel-default">
  1503. <div class="panel-heading" role="tab" id="headingOne">
  1504. <h4 class="panel-title" style="text-decoration: none;" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
  1505. <?php echo $language->translate("ADDING_TABS");?>
  1506. </h4>
  1507. </div>
  1508. <div id="collapseOne" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne" aria-expanded="true">
  1509. <div class="panel-body">
  1510. <p><?php echo $language->translate("START_ADDING_TABS");?></p>
  1511. <ul>
  1512. <li><strong><?php echo $language->translate("TAB_URL");?></strong> <?php echo $language->translate("TAB_URL_ABOUT");?></li>
  1513. <li><strong><?php echo $language->translate("ICON_URL");?></strong> <?php echo $language->translate("ICON_URL_ABOUT");?></li>
  1514. <li><strong><?php echo $language->translate("DEFAULT");?></strong> <?php echo $language->translate("DEFAULT_ABOUT");?></li>
  1515. <li><strong><?php echo $language->translate("ACTIVE");?></strong> <?php echo $language->translate("ACTIVE_ABOUT");?></li>
  1516. <li><strong><?php echo $language->translate("USER");?></strong> <?php echo $language->translate("USER_ABOUT");?></li>
  1517. <li><strong><?php echo $language->translate("GUEST");?></strong> <?php echo $language->translate("GUEST_ABOUT");?></li>
  1518. <li><strong><?php echo $language->translate("NO_IFRAME");?></strong> <?php echo $language->translate("NO_IFRAME_ABOUT");?></li>
  1519. </ul>
  1520. </div>
  1521. </div>
  1522. </div>
  1523. <div style="color: <?php echo $topbartext;?> !important; background: <?php echo $topbar;?> !important;" class="panel panel-default">
  1524. <div class="panel-heading" role="tab" id="headingTwo">
  1525. <h4 class="panel-title" style="text-decoration: none;" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="true" aria-controls="collapseTwo">
  1526. <?php echo $language->translate("QUICK_ACCESS");?>
  1527. </h4>
  1528. </div>
  1529. <div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo" aria-expanded="true">
  1530. <div class="panel-body">
  1531. <p><?php echo $language->translate("QUICK_ACCESS_ABOUT");?> <mark><?php echo getServerPath(); ?>#Sonarr</mark></p>
  1532. </div>
  1533. </div>
  1534. </div>
  1535. <div style="color: <?php echo $topbartext;?> !important; background: <?php echo $topbar;?> !important;" class="panel panel-default">
  1536. <div class="panel-heading" role="tab" id="headingThree">
  1537. <h4 class="panel-title" style="text-decoration: none;" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseThree" aria-expanded="true" aria-controls="collapseThree">
  1538. <?php echo $language->translate("SIDE_BY_SIDE");?>
  1539. </h4>
  1540. </div>
  1541. <div id="collapseThree" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingThree" aria-expanded="true">
  1542. <div class="panel-body">
  1543. <p><?php echo $language->translate("SIDE_BY_SIDE_ABOUT");?></p>
  1544. <ul>
  1545. <li><?php echo $language->translate("SIDE_BY_SIDE_INSTRUCTIONS1");?></li>
  1546. <li><?php echo $language->translate("SIDE_BY_SIDE_INSTRUCTIONS2");?> [<i class='mdi mdi-refresh'></i>]</li>
  1547. <li><?php echo $language->translate("SIDE_BY_SIDE_INSTRUCTIONS3");?></li>
  1548. </ul>
  1549. </div>
  1550. </div>
  1551. </div>
  1552. <div style="color: <?php echo $topbartext;?> !important; background: <?php echo $topbar;?> !important;" class="panel panel-default">
  1553. <div class="panel-heading" role="tab" id="headingFour">
  1554. <h4 class="panel-title" style="text-decoration: none;" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseFour" aria-expanded="true" aria-controls="collapseFour">
  1555. <?php echo $language->translate("KEYBOARD_SHORTCUTS");?>
  1556. </h4>
  1557. </div>
  1558. <div id="collapseFour" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingFour" aria-expanded="true">
  1559. <div class="panel-body">
  1560. <p><?php echo $language->translate("KEYBOARD_SHORTCUTS_ABOUT");?></p>
  1561. <ul>
  1562. <li><keyboard class="key"><span>S</span></keyboard> + <keyboard class="key"><span>S</span></keyboard> <?php echo $language->translate("KEYBOARD_INSTRUCTIONS1");?></li>
  1563. <li><keyboard class="key"><span>F</span></keyboard> + <keyboard class="key"><span>F</span></keyboard> <?php echo $language->translate("KEYBOARD_INSTRUCTIONS6");?></li>
  1564. <li><keyboard class="key"><span>P</span></keyboard> + <keyboard class="key"><span>P</span></keyboard> <?php echo $language->translate("KEYBOARD_INSTRUCTIONS7");?></li>
  1565. <li><keyboard class="key"><span>M</span></keyboard> + <keyboard class="key"><span>M</span></keyboard> <?php echo $language->translate("KEYBOARD_INSTRUCTIONS8");?></li>
  1566. <li><keyboard class="key wide"><span>Ctrl</span></keyboard> + <keyboard class="key wide"><span>Shift</span></keyboard> + <keyboard class="key"><span>&darr;</span></keyboard> <?php echo $language->translate("KEYBOARD_INSTRUCTIONS2");?></li>
  1567. <li><keyboard class="key wide"><span>Ctrl</span></keyboard> + <keyboard class="key wide"><span>Shift</span></keyboard> + <keyboard class="key"><span>&uarr;</span></keyboard> <?php echo $language->translate("KEYBOARD_INSTRUCTIONS3");?></li>
  1568. <li><keyboard class="key wide"><span>Ctrl</span></keyboard> + <keyboard class="key wide"><span>Shift</span></keyboard> + <keyboard class="key"><span>1</span></keyboard> - <keyboard class="key"><span>9</span></keyboard> <?php echo $language->translate("KEYBOARD_INSTRUCTIONS5");?></li>
  1569. <li><keyboard class="key wide"><span>Esc</span></keyboard> + <keyboard class="key wide"><span>Esc</span></keyboard> <?php echo $language->translate("KEYBOARD_INSTRUCTIONS4");?></li>
  1570. </ul>
  1571. </div>
  1572. </div>
  1573. </div>
  1574. <div style="color: <?php echo $topbartext;?> !important; background: <?php echo $topbar;?> !important;" class="panel panel-default">
  1575. <div class="panel-heading" role="tab" id="headingFive">
  1576. <h4 class="panel-title" style="text-decoration: none;" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseFive" aria-expanded="true" aria-controls="collapseFive">
  1577. <?php echo $language->translate("TAB_NOT_LOADING");?>
  1578. </h4>
  1579. </div>
  1580. <div id="collapseFive" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingFive" aria-expanded="true">
  1581. <div class="panel-body">
  1582. <p><?php echo $language->translate("TAB_NOT_LOADING_ABOUT");?></p>
  1583. <?php
  1584. if(get_browser_name() == "Chrome") : echo get_browser_name() . ": <a href='https://chrome.google.com/webstore/detail/ignore-x-frame-headers/gleekbfjekiniecknbkamfmkohkpodhe' target='_blank'><strong>Ignore X-Frame headers</strong> by Guillaume Ryder</a>";
  1585. elseif(get_browser_name() == "Firefox") : echo get_browser_name() . ": <a href='https://addons.mozilla.org/en-us/firefox/addon/ignore-x-frame-options/' target='_blank'><strong>Ignore X-Frame headers</strong> by rjhoukema</a>";
  1586. else : echo "Sorry, currently there is no other alternative for " . get_browser_name(); endif;
  1587. ?>
  1588. </div>
  1589. </div>
  1590. </div>
  1591. <div style="color: <?php echo $topbartext;?> !important; background: <?php echo $topbar;?> !important;" class="panel panel-default">
  1592. <div class="panel-heading" role="tab" id="headingSix">
  1593. <h4 class="panel-title" style="text-decoration: none;" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseSix" aria-expanded="true" aria-controls="collapseSix">
  1594. <?php echo $language->translate("USER_ICONS");?>
  1595. </h4>
  1596. </div>
  1597. <div id="collapseSix" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingSix" aria-expanded="true">
  1598. <div class="panel-body">
  1599. <p><?php echo $language->translate("USER_ICONS_ABOUT");?> <a href="http://gravatar.com" target="_blank">gravatar.com</a></p>
  1600. </div>
  1601. </div>
  1602. </div>
  1603. <div style="color: <?php echo $topbartext;?> !important; background: <?php echo $topbar;?> !important;" class="panel panel-default">
  1604. <div class="panel-heading" role="tab" id="headingSeven">
  1605. <h4 class="panel-title" style="text-decoration: none;" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseSeven" aria-expanded="true" aria-controls="collapseSeven">
  1606. <?php echo $language->translate("TRANSLATIONS");?>
  1607. </h4>
  1608. </div>
  1609. <div id="collapseSeven" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingSeven" aria-expanded="true">
  1610. <div class="panel-body">
  1611. <p><?php echo $language->translate("TRANSLATIONS_ABOUT");?> <a href="https://github.com/causefx/Organizr/tree/develop/lang" target="_blank">Github Develop Branch</a></p>
  1612. </div>
  1613. </div>
  1614. </div>
  1615. </div>
  1616. </div>
  1617. <div class="modal-footer">
  1618. <button type="button" class="btn btn-default waves" data-dismiss="modal"><?php echo $language->translate("CLOSE");?></button>
  1619. </div>
  1620. </div>
  1621. </div>
  1622. </div>
  1623. <p id="whatsnew"></p>
  1624. <p id="downloadnow"></p>
  1625. <div id="deleteDiv" style="display: none;" class="panel panel-danger">
  1626. <div class="panel-heading">
  1627. <h3 class="panel-title"><?php echo $language->translate("DELETE_DATABASE");?></h3>
  1628. </div>
  1629. <div class="panel-body">
  1630. <div class="">
  1631. <p><?php echo $language->translate("DELETE_WARNING");?></p>
  1632. <form id="deletedb" method="post">
  1633. <input type="hidden" name="action" value="deleteDB" />
  1634. <button class="btn waves btn-labeled btn-danger pull-right text-uppercase waves-effect waves-float" type="submit">
  1635. <span class="btn-label"><i class="fa fa-trash"></i></span><?php echo $language->translate("DELETE_DATABASE");?>
  1636. </button>
  1637. </form>
  1638. </div>
  1639. </div>
  1640. </div>
  1641. <div class="timeline-container">
  1642. <div class="row">
  1643. <div class="col-lg-12">
  1644. <ul class="cbp_tmtimeline" id="versionHistory">
  1645. </ul>
  1646. <div class="btn-group-sm btn-group btn-group-justified">
  1647. <div id="loadMore" class="btn-group" role="group">
  1648. <button type="button" class="btn waves btn-primary waves-effect waves-float text-uppercase"><?php echo $language->translate("SHOW_MORE");?></button>
  1649. </div>
  1650. <div id="showLess" class="btn-group" role="group">
  1651. <button type="button" class="btn waves btn-warning waves-effect waves-float text-uppercase"><?php echo $language->translate("SHOW_LESS");?></button>
  1652. </div>
  1653. </div>
  1654. </div>
  1655. </div>
  1656. </div>
  1657. </div>
  1658. </div>
  1659. </div>
  1660. </div>
  1661. </div>
  1662. <div class="email-content users-box white-bg">
  1663. <div class="email-body">
  1664. <div class="email-header gray-bg">
  1665. <button type="button" class="btn btn-danger btn-sm waves close-button"><i class="fa fa-close"></i></button>
  1666. <h1>Users Management</h1>
  1667. </div>
  1668. <div class="email-inner small-box">
  1669. <div class="email-inner-section">
  1670. <div class="small-box fade in" id="useredit">
  1671. <div class="row">
  1672. <div class="col-lg-12">
  1673. <div class="small-box">
  1674. <form class="content-form form-inline" name="new user registration" id="registration" action="" method="POST">
  1675. <input type="hidden" name="op" value="register"/>
  1676. <input type="hidden" name="sha1" value=""/>
  1677. <input type="hidden" name="settings" value="true"/>
  1678. <div class="form-group">
  1679. <input type="text" class="form-control material" name="username" placeholder="<?php echo $language->translate("USERNAME");?>" autocorrect="off" autocapitalize="off" value="">
  1680. </div>
  1681. <div class="form-group">
  1682. <input type="email" class="form-control material" name="email" placeholder="<?php echo $language->translate("EMAIL");?>">
  1683. </div>
  1684. <div class="form-group">
  1685. <input type="password" class="form-control material" name="password1" placeholder="<?php echo $language->translate("PASSWORD");?>">
  1686. </div>
  1687. <div class="form-group">
  1688. <input type="password" class="form-control material" name="password2" placeholder="<?php echo $language->translate("PASSWORD_AGAIN");?>">
  1689. </div>
  1690. <button type="submit" onclick="User.processRegistration()" class="btn waves btn-labeled btn-primary btn btn-sm text-uppercase waves-effect waves-float promoteUser">
  1691. <span class="btn-label"><i class="fa fa-user-plus"></i></span><?php echo $language->translate("CREATE_USER");?>
  1692. </button>
  1693. </form>
  1694. </div>
  1695. </div>
  1696. </div>
  1697. <div class="small-box">
  1698. <form class="content-form form-inline" name="unregister" id="unregister" action="" method="POST">
  1699. <p id="inputUsername"></p>
  1700. <div class="table-responsive">
  1701. <table class="table table-striped">
  1702. <thead>
  1703. <tr>
  1704. <th>#</th>
  1705. <th><?php echo $language->translate("USERNAME");?></th>
  1706. <th><?php echo $language->translate("EMAIL");?></th>
  1707. <th><?php echo $language->translate("LOGIN_STATUS");?></th>
  1708. <th><?php echo $language->translate("LAST_SEEN");?></th>
  1709. <th><?php echo $language->translate("USER_GROUP");?></th>
  1710. <th><?php echo $language->translate("USER_ACTIONS");?></th>
  1711. </tr>
  1712. </thead>
  1713. <tbody>
  1714. <?php $countUsers = 1;
  1715. foreach($gotUsers as $row) :
  1716. if($row['role'] == "admin" && $countUsers == 1) :
  1717. $userColor = "red";
  1718. $disableAction = "disabled=\"disabled\"";
  1719. else :
  1720. $userColor = "blue";
  1721. $disableAction = "";
  1722. endif;
  1723. if($row['active'] == "true") :
  1724. $userActive = $language->translate("LOGGED_IN");
  1725. $userActiveColor = "primary";
  1726. else :
  1727. $userActive = $language->translate("LOGGED_OUT");
  1728. $userActiveColor = "danger";
  1729. endif;
  1730. $userpic = md5( strtolower( trim( $row['email'] ) ) );
  1731. if(!empty($row["last"])) :
  1732. $lastActive = date("Y-m-d H:i", intval($row["last"]));
  1733. else :
  1734. $lastActive = "";
  1735. endif;
  1736. ?>
  1737. <tr id="<?=$row['username'];?>">
  1738. <th scope="row"><?=$countUsers;?></th>
  1739. <td><?php if(GRAVATAR == "true") : ?><i class="userpic"><img src="https://www.gravatar.com/avatar/<?=$userpic;?>?s=25&d=mm" class="img-circle"></i> &nbsp; <?php endif; ?><?=$row['username'];?></td>
  1740. <td><?=$row['email'];?></td>
  1741. <td><span class="label label-<?=$userActiveColor;?>"><?=$userActive;?></span></td>
  1742. <td><?=$lastActive;?></td>
  1743. <td><span class="text-uppercase <?=$userColor;?>"><?=$row['role'];?></span></td>
  1744. <td id="<?=$row['username'];?>">
  1745. <button <?=$disableAction;?> class="btn waves btn-labeled btn-danger btn btn-sm text-uppercase waves-effect waves-float deleteUser">
  1746. <span class="btn-label"><i class="fa fa-user-times"></i></span><?php echo $language->translate("DELETE");?>
  1747. </button>
  1748. <?php if ($row['role'] == "user") : ?>
  1749. <button class="btn waves btn-labeled btn-success btn btn-sm text-uppercase waves-effect waves-float promoteUser">
  1750. <span class="btn-label"><i class="fa fa-arrow-up"></i></span><?php echo $language->translate("PROMOTE");?>
  1751. </button>
  1752. <?php endif; ?>
  1753. <?php if ($row['role'] == "admin") : ?>
  1754. <button <?=$disableAction;?> class="btn waves btn-labeled btn-warning btn btn-sm text-uppercase waves-effect waves-float demoteUser">
  1755. <span class="btn-label"><i class="fa fa-arrow-down"></i></span><?php echo $language->translate("DEMOTE");?>
  1756. </button>
  1757. <?php endif; ?>
  1758. </td>
  1759. </tr>
  1760. <?php $countUsers++; endforeach; ?>
  1761. </tbody>
  1762. </table>
  1763. </div>
  1764. </form>
  1765. </div>
  1766. </div>
  1767. </div>
  1768. </div>
  1769. </div>
  1770. </div>
  1771. <div class="email-content logs-box white-bg">
  1772. <div class="email-body">
  1773. <div class="email-header gray-bg">
  1774. <button type="button" class="btn btn-danger btn-sm waves close-button"><i class="fa fa-close"></i></button>
  1775. <h1>Logs</h1>
  1776. </div>
  1777. <div class="email-inner small-box">
  1778. <div class="email-inner-section">
  1779. <div class="small-box" id="loginlog">
  1780. <div class="table-responsive">
  1781. <?php if(file_exists(FAIL_LOG)) : ?>
  1782. <div id="loginStats">
  1783. <div class="content-box ultra-widget">
  1784. <div class="w-progress">
  1785. <span id="goodCount" class="w-amount green"></span>
  1786. <span id="badCount" class="w-amount red pull-right">3</span>
  1787. <br>
  1788. <span class="text-uppercase w-name"><?php echo $language->translate("GOOD_LOGINS");?></span>
  1789. <span class="text-uppercase w-name pull-right"><?php echo $language->translate("BAD_LOGINS");?></span>
  1790. </div>
  1791. <div class="progress progress-bar-sm zero-m">
  1792. <div id="goodPercent" class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: 20%"></div>
  1793. <div id="badPercent" class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%"></div>
  1794. </div>
  1795. <div class="w-status clearfix">
  1796. <div id="goodTitle" class="w-status-title pull-left text-uppercase">20%</div>
  1797. <div id="badTitle" class="w-status-number pull-right text-uppercase">80%</div>
  1798. </div>
  1799. </div>
  1800. </div>
  1801. <table id="datatable" class="display">
  1802. <thead>
  1803. <tr>
  1804. <th><?php echo $language->translate("DATE");?></th>
  1805. <th><?php echo $language->translate("USERNAME");?></th>
  1806. <th><?php echo $language->translate("IP_ADDRESS");?></th>
  1807. <th><?php echo $language->translate("TYPE");?></th>
  1808. </tr>
  1809. </thead>
  1810. <tbody>
  1811. <?php
  1812. $getFailLog = str_replace("\r\ndate", "date", file_get_contents(FAIL_LOG));
  1813. $gotFailLog = json_decode($getFailLog, true);
  1814. $goodLogin = 0;
  1815. $badLogin = 0;
  1816. function getColor($colorTest){
  1817. if($colorTest == "bad_auth") :
  1818. $gotColorTest = "danger";
  1819. elseif($colorTest == "good_auth") :
  1820. $gotColorTest = "primary";
  1821. endif;
  1822. echo $gotColorTest;
  1823. }
  1824. foreach (array_reverse($gotFailLog["auth"]) as $key => $val) :
  1825. if($val["auth_type"] == "bad_auth") : $badLogin++; elseif($val["auth_type"] == "good_auth") : $goodLogin++; endif;
  1826. ?>
  1827. <tr>
  1828. <td><?=$val["date"];?></td>
  1829. <td><?=$val["username"];?></td>
  1830. <td><?=$val["ip"];?></td>
  1831. <td><span class="label label-<?php getColor($val["auth_type"]);?>"><?=$val["auth_type"];?></span></td>
  1832. </tr>
  1833. <?php endforeach; ?>
  1834. </tbody>
  1835. </table>
  1836. <?php
  1837. $totalLogin = $goodLogin + $badLogin;
  1838. $goodPercent = round(($goodLogin / $totalLogin) * 100);
  1839. $badPercent = round(($badLogin / $totalLogin) * 100);
  1840. endif;
  1841. if(!file_exists(FAIL_LOG)) :
  1842. echo $language->translate("NOTHING_LOG");
  1843. endif;
  1844. ?>
  1845. </div>
  1846. </div>
  1847. </div>
  1848. </div>
  1849. </div>
  1850. </div>
  1851. </div>
  1852. <!--End Content-->
  1853. </div>
  1854. <script>
  1855. $(function () {
  1856. //Data Tables
  1857. $('#datatable').DataTable({
  1858. displayLength: 10,
  1859. dom: 'T<"clear">lfrtip',
  1860. responsive: true,
  1861. "order": [[ 0, 'desc' ]],
  1862. "language": {
  1863. "info": "<?php echo explosion($language->translate('SHOW_ENTRY_CURRENT'), 0);?> _START_ <?php echo explosion($language->translate('SHOW_ENTRY_CURRENT'), 1);?> _END_ <?php echo explosion($language->translate('SHOW_ENTRY_CURRENT'), 2);?> _TOTAL_ <?php echo explosion($language->translate('SHOW_ENTRY_CURRENT'), 3);?>",
  1864. "infoEmpty": "<?php echo $language->translate('NO_ENTRIES');?>",
  1865. "infoFiltered": "<?php echo explosion($language->translate('FILTERED'), 0);?> _MAX_ <?php echo explosion($language->translate('FILTERED'), 1);?>",
  1866. "lengthMenu": "<?php echo $language->translate('SHOW');?> _MENU_ <?php echo $language->translate('ENTRIES');?>",
  1867. "search": "",
  1868. "searchPlaceholder": "<?php echo $language->translate('SEARCH');?>",
  1869. "searchClass": "<?php echo $language->translate('SEARCH');?>",
  1870. "zeroRecords": "<?php echo $language->translate('NO_MATCHING');?>",
  1871. "paginate": {
  1872. "next": "<?php echo $language->translate('NEXT');?>",
  1873. "previous": "<?php echo $language->translate('PREVIOUS');?>",
  1874. }
  1875. }
  1876. });
  1877. });
  1878. </script>
  1879. <?php if($_POST['op']) : ?>
  1880. <script>
  1881. parent.notify("<?php echo printArray($USER->info_log); ?>","info-circle","notice","5000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
  1882. <?php if(!empty($USER->error_log)) : ?>
  1883. parent.notify("<?php echo printArray($USER->error_log); ?>","exclamation-circle ","error","5000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
  1884. <?php endif; ?>
  1885. </script>
  1886. <?php endif; ?>
  1887. <?php if($action == "addTabz") : ?>
  1888. <script>
  1889. if(!window.location.hash) {
  1890. window.location = window.location + '#loaded';
  1891. window.location.reload();
  1892. }else{
  1893. parent.notify("<strong><?php echo $language->translate('TABS_SAVED');?></strong> <?php echo $language->translate('APPLY_RELOAD');?>","floppy-o","success","5000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
  1894. }
  1895. </script>
  1896. <?php endif; ?>
  1897. <?php if($action == "addOptionz") : ?>
  1898. <script>
  1899. parent.notify("<strong><?php echo $language->translate('COLORS_SAVED');?></strong> <?php echo $language->translate('APPLY_RELOAD');?>","floppy-o","success","5000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
  1900. </script>
  1901. <?php endif; ?>
  1902. <script>
  1903. (function($) {
  1904. function startTrigger(e,data) {
  1905. var $elem = $(this);
  1906. $elem.data('mouseheld_timeout', setTimeout(function() {
  1907. $elem.trigger('mouseheld');
  1908. }, e.data));
  1909. }
  1910. function stopTrigger() {
  1911. var $elem = $(this);
  1912. clearTimeout($elem.data('mouseheld_timeout'));
  1913. }
  1914. var mouseheld = $.event.special.mouseheld = {
  1915. setup: function(data) {
  1916. var $this = $(this);
  1917. $this.bind('mousedown', +data || mouseheld.time, startTrigger);
  1918. $this.bind('mouseleave mouseup', stopTrigger);
  1919. },
  1920. teardown: function() {
  1921. var $this = $(this);
  1922. $this.unbind('mousedown', startTrigger);
  1923. $this.unbind('mouseleave mouseup', stopTrigger);
  1924. },
  1925. time: 200 // default to 750ms
  1926. };
  1927. })(jQuery);
  1928. $(function () {
  1929. //$(".todo ul").sortable();
  1930. $(".todo ul").sortable({
  1931. 'opacity': 0.9,
  1932. });
  1933. $("#add_tab").on('submit', function (e) {
  1934. e.preventDefault();
  1935. var $toDo = $(this).find('.name-of-todo');
  1936. toDo_name = $toDo.val();
  1937. if (toDo_name.length >= 3) {
  1938. var newid = $('.list-group-item').length + 1;
  1939. $(".todo ul").append(
  1940. '<li id="item-' + newid + '" class="list-group-item animated zoomInDown" style="position: relative; left: 0px; top: 0px;"><tab class="content-form form-inline"> <div class="form-group"><div class="action-btns" style="width:calc(100%)"><a class="" style="margin-left: 0px"><span style="font: normal normal normal 30px/1 FontAwesome;" class="fa fa-hand-paper-o"></span></a></div></div> <div class="form-group"><input style="width: 100%;" type="text" class="form-control material input-sm" name="name-' + newid + '" id="name[' + newid + ']" placeholder="<?php echo $language->translate("NEW_TAB_NAME");?>" value="' + toDo_name + '"></div> <div class="form-group"><input style="width: 100%;" type="text" class="form-control material input-sm" name="url-' + newid + '" id="url[' + newid + ']" placeholder="<?php echo $language->translate("TAB_URL");?>"></div> <div style="margin-right: 5px;" class="form-group"><div class="input-group"><input style="width: 100%;" name="icon-' + newid + '" data-placement="bottomRight" class="form-control material icp-auto" value="fa-diamond" type="text" /><span class="input-group-addon"></span></div> - <?php echo $language->translate("OR");?> -</div> <div class="form-group"><input style="width: 100%;" type="text" class="form-control material input-sm" id="iconurl-' + newid + '" name="iconurl-' + newid + '" placeholder="<?php echo $language->translate("ICON_URL");?>" value=""></div> <div class="form-group"> <div class="radio radio-danger"> <input type="radio" name="default" id="default[' + newid + ']" name="default"> <label for="default[' + newid + ']"><?php echo $language->translate("DEFAULT");?></label></div></div> <div class="form-group"><div class=""><input id="" class="switcher switcher-success" value="false" name="active-' + newid + '" type="hidden"><input name="active-' + newid + '" id="active[' + newid + ']" class="switcher switcher-success" type="checkbox" checked=""><label for="active[' + newid + ']"></label></div> <?php echo $language->translate("ACTIVE");?></div> <div class="form-group"><div class=""><input id="" class="switcher switcher-primary" value="false" name="user-' + newid + '" type="hidden"><input id="user[' + newid + ']" name="user-' + newid + '" class="switcher switcher-primary" type="checkbox" checked=""><label for="user[' + newid + ']"></label></div> <?php echo $language->translate("USER");?></div> <div class="form-group"><div class=""><input id="" class="switcher switcher-primary" value="false" name="guest-' + newid + '" type="hidden"><input name="guest-' + newid + '" id="guest[' + newid + ']" class="switcher switcher-warning" type="checkbox" checked=""><label for="guest[' + newid + ']"></label></div> <?php echo $language->translate("GUEST");?></div> <div class="form-group"><div class=""><input id="" class="switcher switcher-primary" value="false" name="window-' + newid + '" type="hidden"><input name="window-' + newid + '" id="window[' + newid + ']" class="switcher switcher-danger" type="checkbox"><label for="window[' + newid + ']"></label></div> <?php echo $language->translate("NO_IFRAME");?></div><div class="pull-right action-btns" style="padding-top: 8px;"><a class="trash"><span class="fa fa-trash"></span></a></div></tab></li>'
  1941. );
  1942. $('.icp-auto').iconpicker({placement: 'left', hideOnSelect: false, collision: true});
  1943. var eventObject = {
  1944. title: $.trim($("#" + newid).text()),
  1945. className: $("#" + newid).attr("data-bg"),
  1946. stick: true
  1947. };
  1948. $("#" + newid).data('eventObject', eventObject);
  1949. $toDo.val('').focus();
  1950. } else {
  1951. $toDo.focus();
  1952. }
  1953. });
  1954. count();
  1955. $(".list-group-item").addClass("list-item");
  1956. //Remove one completed item
  1957. $(document).on('click', '.trash', function (e) {
  1958. var listItemRemove = $(this).closest(".list-group-item");
  1959. var animation = "zoomOutRight";
  1960. var container = $(this).closest(".list-group-item");
  1961. //container.attr('class', 'list-group-item gray-bg animation-container');
  1962. container.addClass('animated ' + animation);
  1963. setTimeout(function() {
  1964. var clearedCompItem = listItemRemove.remove();
  1965. console.log("removed");
  1966. e.preventDefault();
  1967. count();
  1968. }, 800);
  1969. });
  1970. //Count items
  1971. function count() {
  1972. var active = $('.list-group-item').length;
  1973. $('.total-tabs span').text(active);
  1974. };
  1975. $("#submitTabs").on('submit', function (e) {
  1976. console.log("submitted");
  1977. $("div.radio").each(function(i) {
  1978. $(this).find('input').attr('name', 'default-' + i);
  1979. console.log(i);
  1980. });
  1981. $('form input[type="radio"]').not(':checked').each(function() {
  1982. $(this).prop('checked', true);
  1983. $(this).prop('value', "false");
  1984. console.log("found unchecked");
  1985. });
  1986. });
  1987. $('#apply').on('click touchstart', function(){
  1988. window.parent.location.reload();
  1989. });
  1990. });
  1991. </script>
  1992. <script>
  1993. function rememberTabSelection(tabPaneSelector, useHash) {
  1994. var key = 'selectedTabFor' + tabPaneSelector;
  1995. if(get(key))
  1996. $(tabPaneSelector).find('a[href=' + get(key) + ']').tab('show');
  1997. $(tabPaneSelector).on("click", 'a[data-toggle]', function(event) {
  1998. set(key, this.getAttribute('href'));
  1999. });
  2000. function get(key) {
  2001. return useHash ? location.hash: localStorage.getItem(key);
  2002. }
  2003. function set(key, value){
  2004. if(useHash)
  2005. location.hash = value;
  2006. else
  2007. localStorage.setItem(key, value);
  2008. }
  2009. }
  2010. $("#notifyTest").click(function(){
  2011. var notifySplit = $("#notifyValue").val().split("-");
  2012. console.log(notifySplit[0]);
  2013. parent.notify("<?php echo $language->translate('TEST_MESSAGE');?>","flask","notice","5000", notifySplit[0], notifySplit[1]);
  2014. });
  2015. $("#iconHide").click(function(){
  2016. $( "div[class^='jFiler jFiler-theme-dragdropbox']" ).toggle();
  2017. });
  2018. $("#iconAll").click(function(){
  2019. $( "div[id^='viewAllIcons']" ).toggle();
  2020. });
  2021. $("#deleteToggle").click(function(){
  2022. $( "#deleteDiv" ).toggle();
  2023. });
  2024. $("#editCssButton").click(function(){
  2025. $( "#add_optionz" ).toggle();
  2026. $( "#editCssForm" ).toggle();
  2027. });
  2028. $("#backToThemeButton").click(function(){
  2029. $( "#add_optionz" ).toggle();
  2030. $( "#editCssForm" ).toggle();
  2031. });
  2032. $(".deleteUser").click(function(){
  2033. var parent_id = $(this).parent().attr('id');
  2034. editUsername = $('#unregister').find('#inputUsername');
  2035. $(editUsername).html('<input type="hidden" name="op" value="unregister"/><input type="hidden" name="username"value="' + parent_id + '" />');
  2036. });
  2037. $(".promoteUser").click(function(){
  2038. var parent_ids = $(this).parent().attr('id');
  2039. editUsername = $('#unregister').find('#inputUsername');
  2040. $(editUsername).html('<input type="hidden" name="op" value="update"/><input type="hidden" name="role" value="admin"/><input type="hidden" name="username"value="' + parent_ids + '" />');
  2041. });
  2042. $(".demoteUser").click(function(){
  2043. var parent_idz = $(this).parent().attr('id');
  2044. editUsername = $('#unregister').find('#inputUsername');
  2045. $(editUsername).html('<input type="hidden" name="op" value="update"/><input type="hidden" name="role" value="user"/><input type="hidden" name="username"value="' + parent_idz + '" />');
  2046. });
  2047. $('#showLess').hide();
  2048. $('#loadMore').click(function () {
  2049. x= (x+5 <= size_li) ? x+5 : size_li;
  2050. $('#versionHistory li:lt('+x+')').show();
  2051. $('#showLess').show();
  2052. if(x == size_li){
  2053. $('#loadMore').hide();
  2054. }
  2055. });
  2056. $('#showLess').click(function () {
  2057. $('#versionHistory li').not(':lt(2)').hide();
  2058. $('#loadMore').show();
  2059. $('#showLess').hide();
  2060. });
  2061. $('.icp-auto').iconpicker({placement: 'left', hideOnSelect: false, collision: true});
  2062. $("li[class^='list-group-item']").bind('mouseheld', function(e) {
  2063. $(this).find("span[class^='fa fa-hand-paper-o']").attr("class", "fa fa-hand-grab-o");
  2064. $(this).addClass("dragging");
  2065. $(this).find("div[class^='action-btns tabIconView']").addClass("animated swing");
  2066. $(this).mouseup(function() {
  2067. $(this).find("span[class^='fa fa-hand-grab-o']").attr("class", "fa fa-hand-paper-o");
  2068. $(this).removeClass("dragging");
  2069. $(this).find("div[class^='action-btns tabIconView']").removeClass("animated swing");
  2070. });
  2071. });
  2072. function copyToClipboard(elem) {
  2073. // create hidden text element, if it doesn't already exist
  2074. var targetId = "_hiddenCopyText_";
  2075. var isInput = elem.tagName === "INPUT" || elem.tagName === "TEXTAREA";
  2076. var origSelectionStart, origSelectionEnd;
  2077. if (isInput) {
  2078. // can just use the original source element for the selection and copy
  2079. target = elem;
  2080. origSelectionStart = elem.selectionStart;
  2081. origSelectionEnd = elem.selectionEnd;
  2082. } else {
  2083. // must use a temporary form element for the selection and copy
  2084. target = document.getElementById(targetId);
  2085. if (!target) {
  2086. var target = document.createElement("textarea");
  2087. target.style.position = "absolute";
  2088. target.style.left = "-9999px";
  2089. target.style.top = "0";
  2090. target.id = targetId;
  2091. document.body.appendChild(target);
  2092. }
  2093. target.textContent = elem.textContent;
  2094. }
  2095. // select the content
  2096. var currentFocus = document.activeElement;
  2097. target.focus();
  2098. target.setSelectionRange(0, target.value.length);
  2099. // copy the selection
  2100. var succeed;
  2101. try {
  2102. succeed = document.execCommand("copy");
  2103. } catch(e) {
  2104. succeed = false;
  2105. }
  2106. // restore original focus
  2107. if (currentFocus && typeof currentFocus.focus === "function") {
  2108. //currentFocus.focus();
  2109. }
  2110. if (isInput) {
  2111. // restore prior selection
  2112. elem.setSelectionRange(origSelectionStart, origSelectionEnd);
  2113. } else {
  2114. // clear temporary content
  2115. target.textContent = "";
  2116. }
  2117. return succeed;
  2118. }
  2119. $("img[class^='allIcons']").click(function(){
  2120. $("textarea[id^='copyTarget']").val($(this).attr("src"));
  2121. copyToClipboard(document.getElementById("copyTarget"));
  2122. parent.notify("<?php echo $language->translate('ICON_COPY');?>","clipboard","success","5000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
  2123. $( "div[id^='viewAllIcons']" ).toggle();
  2124. });
  2125. $('body').on('click', 'b.allIcons', function() {
  2126. $("textarea[id^='copyTarget2']").val($(this).attr("title"));
  2127. copyToClipboard(document.getElementById("copyTarget2"));
  2128. parent.notify("<?php echo $language->translate('ICON_COPY');?>","clipboard","success","5000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
  2129. $( "div[class^='jFiler jFiler-theme-dragdropbox']" ).hide();
  2130. });
  2131. </script>
  2132. <script>
  2133. //Custom Themes
  2134. function changeColor(elementName, elementColor) {
  2135. var definedElement = document.getElementById(elementName);
  2136. definedElement.focus();
  2137. definedElement.value = elementColor;
  2138. definedElement.style.backgroundColor = elementColor;
  2139. }
  2140. $('#plexTheme').on('click touchstart', function(){
  2141. changeColor("topbartext", "#E49F0C");
  2142. changeColor("topbar", "#000000");
  2143. changeColor("bottombar", "#000000");
  2144. changeColor("sidebar", "#121212");
  2145. changeColor("hoverbg", "#FFFFFF");
  2146. changeColor("activetabBG", "#E49F0C");
  2147. changeColor("activetabicon", "#FFFFFF");
  2148. changeColor("activetabtext", "#FFFFFF");
  2149. changeColor("inactiveicon", "#949494");
  2150. changeColor("inactivetext", "#B8B8B8");
  2151. changeColor("loading", "#E49F0C");
  2152. changeColor("hovertext", "#000000");
  2153. });
  2154. $('#embyTheme').on('click touchstart', function(){
  2155. changeColor("topbartext", "#52B54B");
  2156. changeColor("topbar", "#212121");
  2157. changeColor("bottombar", "#212121");
  2158. changeColor("sidebar", "#121212");
  2159. changeColor("hoverbg", "#FFFFFF");
  2160. changeColor("activetabBG", "#52B54B");
  2161. changeColor("activetabicon", "#FFFFFF");
  2162. changeColor("activetabtext", "#FFFFFF");
  2163. changeColor("inactiveicon", "#949494");
  2164. changeColor("inactivetext", "#B8B8B8");
  2165. changeColor("loading", "#52B54B");
  2166. changeColor("hovertext", "#000000");
  2167. });
  2168. $('#bookTheme').on('click touchstart', function(){
  2169. changeColor("topbartext", "#FFFFFF");
  2170. changeColor("topbar", "#3B5998");
  2171. changeColor("bottombar", "#3B5998");
  2172. changeColor("sidebar", "#8B9DC3");
  2173. changeColor("hoverbg", "#FFFFFF");
  2174. changeColor("activetabBG", "#3B5998");
  2175. changeColor("activetabicon", "#FFFFFF");
  2176. changeColor("activetabtext", "#FFFFFF");
  2177. changeColor("inactiveicon", "#DFE3EE");
  2178. changeColor("inactivetext", "#DFE3EE");
  2179. changeColor("loading", "#FFFFFF");
  2180. changeColor("hovertext", "#000000");
  2181. });
  2182. $('#spaTheme').on('click touchstart', function(){
  2183. changeColor("topbartext", "#5B391E");
  2184. changeColor("topbar", "#66BBAE");
  2185. changeColor("bottombar", "#66BBAE");
  2186. changeColor("sidebar", "#C3EEE7");
  2187. changeColor("hoverbg", "#66BBAE");
  2188. changeColor("activetabBG", "#C6C386");
  2189. changeColor("activetabicon", "#FFFFFF");
  2190. changeColor("activetabtext", "#FFFFFF");
  2191. changeColor("inactiveicon", "#5B391E");
  2192. changeColor("inactivetext", "#5B391E");
  2193. changeColor("loading", "#5B391E");
  2194. changeColor("hovertext", "#000000");
  2195. });
  2196. $('#darklyTheme').on('click touchstart', function(){
  2197. changeColor("topbartext", "#FFFFFF");
  2198. changeColor("topbar", "#375A7F");
  2199. changeColor("bottombar", "#375A7F");
  2200. changeColor("sidebar", "#222222");
  2201. changeColor("hoverbg", "#464545");
  2202. changeColor("activetabBG", "#FFFFFF");
  2203. changeColor("activetabicon", "#464545");
  2204. changeColor("activetabtext", "#464545");
  2205. changeColor("inactiveicon", "#0CE3AC");
  2206. changeColor("inactivetext", "#0CE3AC");
  2207. changeColor("loading", "#FFFFFF");
  2208. changeColor("hovertext", "#000000");
  2209. });
  2210. $('#slateTheme').on('click touchstart', function(){
  2211. changeColor("topbartext", "#C8C8C8");
  2212. changeColor("topbar", "#272B30");
  2213. changeColor("bottombar", "#272B30");
  2214. changeColor("sidebar", "#32383E");
  2215. changeColor("hoverbg", "#58C0DE");
  2216. changeColor("activetabBG", "#3E444C");
  2217. changeColor("activetabicon", "#C8C8C8");
  2218. changeColor("activetabtext", "#FFFFFF");
  2219. changeColor("inactiveicon", "#C8C8C8");
  2220. changeColor("inactivetext", "#C8C8C8");
  2221. changeColor("loading", "#C8C8C8");
  2222. changeColor("hovertext", "#000000");
  2223. });
  2224. $('#defaultTheme').on('click touchstart', function(){
  2225. changeColor("topbartext", "#FFFFFF");
  2226. changeColor("topbar", "#eb6363");
  2227. changeColor("bottombar", "#eb6363");
  2228. changeColor("sidebar", "#000000");
  2229. changeColor("hoverbg", "#eb6363");
  2230. changeColor("activetabBG", "#eb6363");
  2231. changeColor("activetabicon", "#FFFFFF");
  2232. changeColor("activetabtext", "#FFFFFF");
  2233. changeColor("inactiveicon", "#FFFFFF");
  2234. changeColor("inactivetext", "#FFFFFF");
  2235. changeColor("loading", "#FFFFFF");
  2236. changeColor("hovertext", "#000000");
  2237. });
  2238. $('#redTheme').on('click touchstart', function(){
  2239. changeColor("topbartext", "#FFFFFF");
  2240. changeColor("topbar", "#eb6363");
  2241. changeColor("bottombar", "#eb6363");
  2242. changeColor("sidebar", "#000000");
  2243. changeColor("hoverbg", "#eb6363");
  2244. changeColor("activetabBG", "#eb6363");
  2245. changeColor("activetabicon", "#FFFFFF");
  2246. changeColor("activetabtext", "#FFFFFF");
  2247. changeColor("inactiveicon", "#FFFFFF");
  2248. changeColor("inactivetext", "#FFFFFF");
  2249. changeColor("loading", "#FFFFFF");
  2250. changeColor("hovertext", "#000000");
  2251. });
  2252. $('#monokaiTheme').on('click touchstart', function(){
  2253. changeColor("topbartext", "#66D9EF");
  2254. changeColor("topbar", "#333333");
  2255. changeColor("bottombar", "#333333");
  2256. changeColor("sidebar", "#393939");
  2257. changeColor("hoverbg", "#AD80FD");
  2258. changeColor("activetabBG", "#F92671");
  2259. changeColor("activetabicon", "#FFFFFF");
  2260. changeColor("activetabtext", "#FFFFFF");
  2261. changeColor("inactiveicon", "#66D9EF");
  2262. changeColor("inactivetext", "#66D9EF");
  2263. changeColor("loading", "#66D9EF");
  2264. changeColor("hovertext", "#000000");
  2265. });
  2266. $('#thejokerTheme').on('click touchstart', function(){
  2267. changeColor("topbartext", "#CCCCCC");
  2268. changeColor("topbar", "#000000");
  2269. changeColor("bottombar", "#000000");
  2270. changeColor("sidebar", "#121212");
  2271. changeColor("hoverbg", "#CCC6CC");
  2272. changeColor("activetabBG", "#A50CB0");
  2273. changeColor("activetabicon", "#FFFFFF");
  2274. changeColor("activetabtext", "#FFFFFF");
  2275. changeColor("inactiveicon", "#949494");
  2276. changeColor("inactivetext", "#B8B8B8");
  2277. changeColor("loading", "#CCCCCC");
  2278. changeColor("hovertext", "#000000");
  2279. });
  2280. $('#newPlexTheme').on('click touchstart', function(){
  2281. changeColor("topbartext", "#E5A00D");
  2282. changeColor("topbar", "#282A2D");
  2283. changeColor("bottombar", "#282A2D");
  2284. changeColor("sidebar", "#3F4245");
  2285. changeColor("hoverbg", "#E5A00D");
  2286. changeColor("activetabBG", "#282A2D");
  2287. changeColor("activetabicon", "#E5A00D");
  2288. changeColor("activetabtext", "#E5A00D");
  2289. changeColor("inactiveicon", "#F9F9F9");
  2290. changeColor("inactivetext", "#F9F9F9");
  2291. changeColor("loading", "#E5A00D");
  2292. changeColor("hovertext", "#E0E3E6");
  2293. });
  2294. $('textarea').numberedtextarea({
  2295. // font color for line numbers
  2296. color: null,
  2297. // border color
  2298. borderColor: 'null',
  2299. // CSS class to be added to the line numbers
  2300. class: null,
  2301. // if true Tab key creates indentation
  2302. allowTabChar: true,
  2303. });
  2304. $(".email-header .close-button").click(function () {
  2305. $(".email-content").removeClass("email-active");
  2306. $('html').removeClass("overhid");
  2307. $("#settings-list").find("li").removeClass("active");
  2308. });
  2309. $(document).mouseup(function (e)
  2310. {
  2311. var container = $(".email-content");
  2312. if (!container.is(e.target) && container.has(e.target).length === 0) {
  2313. $(".email-content").removeClass("email-active");
  2314. $('html').removeClass("overhid");
  2315. $("#settings-list").find("li").removeClass("active");
  2316. }
  2317. });
  2318. $( document ).on( 'keydown', function ( e ) {
  2319. if ( e.keyCode === 27 ) { // ESC
  2320. var container = $(".email-content");
  2321. if (!container.is(e.target) && container.has(e.target).length === 0) {
  2322. $(".email-content").removeClass("email-active");
  2323. $('html').removeClass("overhid");
  2324. $("#settings-list").find("li").removeClass("active");
  2325. }
  2326. }
  2327. });
  2328. $("#open-tabs").on("click",function (e) {
  2329. $(".email-content").removeClass("email-active");
  2330. $('html').removeClass("overhid");
  2331. if($(window).width() < 768){
  2332. $('html').addClass("overhid");
  2333. }
  2334. var settingsBox = $('.tab-box');
  2335. settingsBox.addClass("email-active");
  2336. $(this).parent().addClass("active");
  2337. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(settingsBox).show();
  2338. setTimeout(function(){
  2339. var refreshMailPreloader = settingsBox.find('.refresh-preloader'),
  2340. deletedMailBox = refreshMailPreloader.fadeOut(300, function(){
  2341. refreshMailPreloader.remove();
  2342. });
  2343. },600);
  2344. e.preventDefault();
  2345. });
  2346. $("#open-colors").on("click",function (e) {
  2347. $(".email-content").removeClass("email-active");
  2348. $('html').removeClass("overhid");
  2349. if($(window).width() < 768){
  2350. $('html').addClass("overhid");
  2351. }
  2352. var settingsBox = $('.color-box');
  2353. settingsBox.addClass("email-active");
  2354. $(this).parent().addClass("active");
  2355. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(settingsBox).show();
  2356. setTimeout(function(){
  2357. var refreshMailPreloader = settingsBox.find('.refresh-preloader'),
  2358. deletedMailBox = refreshMailPreloader.fadeOut(300, function(){
  2359. refreshMailPreloader.remove();
  2360. });
  2361. },600);
  2362. e.preventDefault();
  2363. });
  2364. $("#open-homepage").on("click",function (e) {
  2365. $(".email-content").removeClass("email-active");
  2366. $('html').removeClass("overhid");
  2367. if($(window).width() < 768){
  2368. $('html').addClass("overhid");
  2369. }
  2370. var settingsBox = $('.homepage-box');
  2371. settingsBox.addClass("email-active");
  2372. $(this).parent().addClass("active");
  2373. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(settingsBox).show();
  2374. setTimeout(function(){
  2375. var refreshMailPreloader = settingsBox.find('.refresh-preloader'),
  2376. deletedMailBox = refreshMailPreloader.fadeOut(300, function(){
  2377. refreshMailPreloader.remove();
  2378. });
  2379. },600);
  2380. e.preventDefault();
  2381. });
  2382. $("#open-advanced").on("click",function (e) {
  2383. $(".email-content").removeClass("email-active");
  2384. $('html').removeClass("overhid");
  2385. if($(window).width() < 768){
  2386. $('html').addClass("overhid");
  2387. }
  2388. var settingsBox = $('.advanced-box');
  2389. settingsBox.addClass("email-active");
  2390. $(this).parent().addClass("active");
  2391. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(settingsBox).show();
  2392. setTimeout(function(){
  2393. var refreshMailPreloader = settingsBox.find('.refresh-preloader'),
  2394. deletedMailBox = refreshMailPreloader.fadeOut(300, function(){
  2395. refreshMailPreloader.remove();
  2396. });
  2397. },600);
  2398. e.preventDefault();
  2399. });
  2400. $("#open-info").on("click",function (e) {
  2401. $(".email-content").removeClass("email-active");
  2402. $('html').removeClass("overhid");
  2403. if($(window).width() < 768){
  2404. $('html').addClass("overhid");
  2405. }
  2406. var settingsBox = $('.info-box');
  2407. settingsBox.addClass("email-active");
  2408. $(this).parent().addClass("active");
  2409. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(settingsBox).show();
  2410. setTimeout(function(){
  2411. var refreshMailPreloader = settingsBox.find('.refresh-preloader'),
  2412. deletedMailBox = refreshMailPreloader.fadeOut(300, function(){
  2413. refreshMailPreloader.remove();
  2414. });
  2415. },600);
  2416. e.preventDefault();
  2417. });
  2418. $("#open-users").on("click",function (e) {
  2419. $(".email-content").removeClass("email-active");
  2420. $('html').removeClass("overhid");
  2421. if($(window).width() < 768){
  2422. $('html').addClass("overhid");
  2423. }
  2424. var settingsBox = $('.users-box');
  2425. settingsBox.addClass("email-active");
  2426. $(this).parent().addClass("active");
  2427. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(settingsBox).show();
  2428. setTimeout(function(){
  2429. var refreshMailPreloader = settingsBox.find('.refresh-preloader'),
  2430. deletedMailBox = refreshMailPreloader.fadeOut(300, function(){
  2431. refreshMailPreloader.remove();
  2432. });
  2433. },600);
  2434. e.preventDefault();
  2435. });
  2436. $("#open-logs").on("click",function (e) {
  2437. $(".email-content").removeClass("email-active");
  2438. $('html').removeClass("overhid");
  2439. if($(window).width() < 768){
  2440. $('html').addClass("overhid");
  2441. }
  2442. var settingsBox = $('.logs-box');
  2443. settingsBox.addClass("email-active");
  2444. $(this).parent().addClass("active");
  2445. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(settingsBox).show();
  2446. setTimeout(function(){
  2447. var refreshMailPreloader = settingsBox.find('.refresh-preloader'),
  2448. deletedMailBox = refreshMailPreloader.fadeOut(300, function(){
  2449. refreshMailPreloader.remove();
  2450. });
  2451. },600);
  2452. e.preventDefault();
  2453. });
  2454. </script>
  2455. <script>
  2456. $( document ).ready(function() {
  2457. //Hide Icon box on load
  2458. $( "div[class^='jFiler jFiler-theme-dragdropbox']" ).hide();
  2459. //Set Some Scrollbars
  2460. $(".scroller-body").niceScroll({
  2461. railpadding: {top:0,right:0,left:0,bottom:0}
  2462. });
  2463. $(".email-content").niceScroll({
  2464. railpadding: {top:0,right:0,left:0,bottom:0}
  2465. });
  2466. //Stop Div behind From Scrolling
  2467. $( '.email-content' ).on( 'mousewheel', function ( e ) {
  2468. e.preventDefault();
  2469. }, false);
  2470. //Set Hide Function
  2471. if (0) {
  2472. var authTypeFunc = function() {
  2473. // Hide Everything
  2474. $('#host-selected, #host-other, #host-plex, #host-emby, #host-ldap').hide();
  2475. // Qualify Auth Type
  2476. if($('#authType').val() !== "internal"){
  2477. $( '#host-selected' ).show();
  2478. // Qualify aithBackend
  2479. if($('#authBackend').val() === "plex"){
  2480. $('#host-selected, #host-plex').show();
  2481. }else if($('#authBackend').val().indexOf("emby")>=0){
  2482. $('#host-selected, #host-other, #host-emby').show();
  2483. }else if($('#authBackend').val() === "ldap"){
  2484. $('#host-selected, #host-other, #host-ldap').show();
  2485. }else {
  2486. $('#host-selected, #host-other').show();
  2487. }
  2488. }
  2489. }
  2490. //Hide Settings on selection
  2491. $('#authType, #authBackend').on('change', authTypeFunc);
  2492. //Hide Settings on Load
  2493. authTypeFunc();
  2494. } else { console.log() }
  2495. //Simulate Edit Tabs Click
  2496. $("#open-tabs").trigger("click");
  2497. //Append Delete log to User Logs
  2498. $("div[class^='DTTT_container']").append('<form style="display: inline; margin-left: 3px;" id="deletelog" method="post"><input type="hidden" name="action" value="deleteLog" /><button class="btn waves btn-labeled btn-danger text-uppercase waves-effect waves-float" type="submit"><span class="btn-label"><i class="fa fa-trash"></i></span><?php echo $language->translate("PURGE_LOG");?> </button></form>')
  2499. $("a[id^='ToolTables_datatable_0'] span").html('<?php echo $language->translate("PRINT");?>')
  2500. //Enable Tooltips
  2501. $('[data-toggle="tooltip"]').tooltip();
  2502. //Tab save on reload - might need to delete as we changed tab layout
  2503. //rememberTabSelection('#settingsTabs', !localStorage);
  2504. //AJAX call to github to get version info
  2505. $.ajax({
  2506. type: "GET",
  2507. url: "https://api.github.com/repos/causefx/Organizr/releases",
  2508. dataType: "json",
  2509. success: function(github) {
  2510. var currentVersion = "<?php echo INSTALLEDVERSION;?>";
  2511. infoTabVersion = $('#about').find('#version');
  2512. infoTabVersionHistory = $('#about').find('#versionHistory');
  2513. infoTabNew = $('#about').find('#whatsnew');
  2514. infoTabDownload = $('#about').find('#downloadnow');
  2515. $.each(github, function(i,v) {
  2516. if(i === 0){
  2517. console.log(v.tag_name);
  2518. githubVersion = v.tag_name;
  2519. githubDescription = v.body;
  2520. githubName = v.name;
  2521. }
  2522. $(infoTabVersionHistory).append('<li style="display: none"><time class="cbp_tmtime" datetime="' + v.published_at + '"><span>' + v.published_at.substring(0,10) + '</span> <span>' + v.tag_name + '</span></time><div class="cbp_tmicon animated jello"><i class="fa fa-github-alt"></i></div><div class="cbp_tmlabel"><h2 class="text-uppercase">' + v.name + '</h2><p>' + v.body + '</p></div></li>');
  2523. size_li = $("#versionHistory li").size();
  2524. x=2;
  2525. $('#versionHistory li:lt('+x+')').show();
  2526. });
  2527. if(currentVersion < githubVersion){
  2528. console.log("You Need To Upgrade");
  2529. parent.notify("<strong><?php echo $language->translate("NEW_VERSION");?></strong> <?php echo $language->translate("CLICK_INFO");?>","arrow-circle-o-down","warning","50000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
  2530. $(infoTabNew).html("<br/><h4><strong><?php echo $language->translate("WHATS_NEW");?> " + githubVersion + "</strong></h4><strong><?php echo $language->translate("TITLE");?>: </strong>" + githubName + " <br/><strong><?php echo $language->translate("CHANGES");?>: </strong>" + githubDescription);
  2531. $(infoTabDownload).html("<br/><form style=\"display:initial;\" id=\"deletedb\" method=\"post\"><input type=\"hidden\" name=\"action\" value=\"upgrade\" /><button class=\"btn waves btn-labeled btn-success text-uppercase waves-effect waves-float\" type=\"submit\"><span class=\"btn-label\"><i class=\"fa fa-refresh\"></i></span><?php echo $language->translate("AUTO_UPGRADE");?></button></form> <a href='https://github.com/causefx/Organizr/archive/master.zip' target='_blank' type='button' class='btn waves btn-labeled btn-success text-uppercase waves-effect waves-float'><span class='btn-label'><i class='fa fa-download'></i></span>Organizr v." + githubVersion + "</a>");
  2532. $( "p[id^='upgrade']" ).toggle();
  2533. }else if(currentVersion === githubVersion){
  2534. console.log("You Are on Current Version");
  2535. }else{
  2536. console.log("something went wrong");
  2537. }
  2538. $(infoTabVersion).html("<strong><?php echo $language->translate("INSTALLED_VERSION");?>: </strong>" + currentVersion + " <strong><?php echo $language->translate("CURRENT_VERSION");?>: </strong>" + githubVersion + " <strong><?php echo $language->translate("DATABASE_PATH");?>: </strong> <?php echo htmlentities(DATABASE_LOCATION);?>");
  2539. }
  2540. });
  2541. //Edit Info tab with Github info
  2542. <?php if(file_exists(FAIL_LOG)) : ?>
  2543. goodCount = $('#loginStats').find('#goodCount');
  2544. goodPercent = $('#loginStats').find('#goodPercent');
  2545. goodTitle = $('#loginStats').find('#goodTitle');
  2546. badCount = $('#loginStats').find('#badCount');
  2547. badPercent = $('#loginStats').find('#badPercent');
  2548. badTitle = $('#loginStats').find('#badTitle');
  2549. $(goodCount).html("<?php echo $goodLogin;?>");
  2550. $(goodTitle).html("<?php echo $goodPercent;?>%");
  2551. $(goodPercent).attr('aria-valuenow', "<?php echo $goodPercent;?>");
  2552. $(goodPercent).attr('style', "width: <?php echo $goodPercent;?>%");
  2553. $(badCount).html("<?php echo $badLogin;?>");
  2554. $(badTitle).html("<?php echo $badPercent;?>%");
  2555. $(badPercent).attr('aria-valuenow', "<?php echo $badPercent;?>");
  2556. $(badPercent).attr('style', "width: <?php echo $badPercent;?>%");
  2557. <?php endif; ?>
  2558. });
  2559. </script>
  2560. </body>
  2561. </html>