4
0

settings.php 196 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418
  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. $group = $USER->role;
  12. // Create Database Connection
  13. $file_db = new PDO('sqlite:'.DATABASE_LOCATION.'users.db');
  14. $file_db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
  15. // Some PHP config stuff
  16. ini_set("display_errors", 1);
  17. ini_set("error_reporting", E_ALL | E_STRICT);
  18. // Confirm Access
  19. qualifyUser('admin', true);
  20. // Load User List
  21. $gotUsers = $file_db->query('SELECT * FROM users');
  22. // Load Invite List
  23. $gotInvites = $file_db->query('SELECT * FROM invites');
  24. // Load Colours/Appearance
  25. foreach(loadAppearance() as $key => $value) {
  26. $$key = $value;
  27. }
  28. // Slimbar
  29. if(SLIMBAR == "true") {
  30. $slimBar = "30";
  31. $userSize = "25";
  32. } else {
  33. $slimBar = "56";
  34. $userSize = "40";
  35. }
  36. //Theme Info
  37. $themeName = (!empty(INSTALLEDTHEME) ? explode("-", INSTALLEDTHEME)[0] : null);
  38. $themeVersion = (!empty(INSTALLEDTHEME) ? explode("-", INSTALLEDTHEME)[1] : null);
  39. ?>
  40. <!DOCTYPE html>
  41. <html lang="en" class="no-js">
  42. <head>
  43. <meta charset="UTF-8">
  44. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  45. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  46. <meta name="msapplication-tap-highlight" content="no" />
  47. <title>Settings</title>
  48. <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css?v=<?php echo INSTALLEDVERSION; ?>">
  49. <link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.min.css">
  50. <link rel="stylesheet" href="bower_components/mdi/css/materialdesignicons.min.css">
  51. <link rel="stylesheet" href="bower_components/metisMenu/dist/metisMenu.min.css">
  52. <link rel="stylesheet" href="bower_components/Waves/dist/waves.min.css">
  53. <link rel="stylesheet" href="bower_components/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.css">
  54. <link rel="stylesheet" href="js/selects/cs-select.css">
  55. <link rel="stylesheet" href="js/selects/cs-skin-elastic.css">
  56. <link rel="stylesheet" href="bower_components/iconpick/dist/css/fontawesome-iconpicker.min.css">
  57. <link rel="stylesheet" href="bower_components/google-material-color/dist/palette.css">
  58. <link rel="stylesheet" href="bower_components/sweetalert/dist/sweetalert.css">
  59. <link rel="stylesheet" href="bower_components/smoke/dist/css/smoke.min.css">
  60. <link rel="stylesheet" href="bower_components/animate.css/animate.min.css">
  61. <link rel="stylesheet" href="bower_components/DataTables/media/css/jquery.dataTables.css">
  62. <link rel="stylesheet" href="bower_components/datatables-tabletools/css/dataTables.tableTools.css">
  63. <link rel="stylesheet" href="bower_components/numbered/jquery.numberedtextarea.css">
  64. <link rel="stylesheet" href="css/style.css?v=<?php echo INSTALLEDVERSION; ?>">
  65. <link rel="stylesheet" href="bower_components/summernote/dist/summernote.css">
  66. <link rel="stylesheet" href="css/jquery.filer.css">
  67. <link rel="stylesheet" href="css/jquery.filer-dragdropbox-theme.css">
  68. <link rel="stylesheet" href="bower_components/morris.js/morris.css">
  69. <link rel="stylesheet" href="css/settings.css?v=<?php echo INSTALLEDVERSION; ?>">
  70. <!--[if lt IE 9]>
  71. <script src="bower_components/html5shiv/dist/html5shiv.min.js"></script>
  72. <script src="bower_components/respondJs/dest/respond.min.js"></script>
  73. <![endif]-->
  74. <!--Scripts-->
  75. <script src="js/menu/modernizr.custom.js"></script>
  76. <script src="js/sha1.js"></script>
  77. <script src="js/user.js"></script>
  78. <script src="bower_components/jquery/dist/jquery.min.js"></script>
  79. <script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
  80. <script src="bower_components/metisMenu/dist/metisMenu.min.js"></script>
  81. <script src="bower_components/Waves/dist/waves.min.js"></script>
  82. <script src="bower_components/moment/min/moment.min.js"></script>
  83. <script src="bower_components/jquery.nicescroll/jquery.nicescroll.min.js?v=<?php echo INSTALLEDVERSION; ?>"></script>
  84. <script src="bower_components/slimScroll/jquery.slimscroll.min.js"></script>
  85. <script src="bower_components/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.js"></script>
  86. <script src="bower_components/cta/dist/cta.min.js"></script>
  87. <!--Menu-->
  88. <script src="js/menu/classie.js"></script>
  89. <script src="bower_components/iconpick/dist/js/fontawesome-iconpicker.js"></script>
  90. <!--Selects-->
  91. <script src="js/selects/selectFx.js"></script>
  92. <script src="js/jscolor.js"></script>
  93. <script src="bower_components/sweetalert/dist/sweetalert.min.js"></script>
  94. <script src="bower_components/smoke/dist/js/smoke.min.js"></script>
  95. <script src="bower_components/numbered/jquery.numberedtextarea.js"></script>
  96. <!--Other-->
  97. <script src="js/ajax.js?v=<?php echo INSTALLEDVERSION; ?>"></script>
  98. <script src="bower_components/raphael/raphael-min.js"></script>
  99. <script src="bower_components/morris.js/morris.min.js"></script>
  100. <!--Notification-->
  101. <script src="js/notifications/notificationFx.js"></script>
  102. <script src="js/jqueri_ui_custom/jquery-ui.min.js"></script>
  103. <script src="js/jquery.filer.min.js" type="text/javascript"></script>
  104. <script src="js/custom.js?v=<?php echo INSTALLEDVERSION; ?>" type="text/javascript"></script>
  105. <script src="js/jquery.mousewheel.min.js" type="text/javascript"></script>
  106. <!--Data Tables-->
  107. <script src="bower_components/DataTables/media/js/jquery.dataTables.js"></script>
  108. <script src="bower_components/datatables.net-responsive/js/dataTables.responsive.js"></script>
  109. <script src="bower_components/datatables-tabletools/js/dataTables.tableTools.js"></script>
  110. <!--Summernote-->
  111. <script src="bower_components/summernote/dist/summernote.min.js"></script>
  112. <!--Other-->
  113. <script src="js/lazyload.min.js"></script>
  114. <script>
  115. function addTab() {
  116. var idNumber = Math.round(Math.random() * 999999999) + 1000000000;
  117. var $element = $('#tab-new').clone();
  118. $element.css('display','block');
  119. $element.attr('id', $element.attr('id').replace('new',idNumber));
  120. $element.find('[value=new]').attr('value', idNumber).val(idNumber);
  121. $element.find('[id][name]').each(function () {
  122. this.id = this.id.replace('new',idNumber);
  123. this.name = this.name.replace('new',idNumber);
  124. });
  125. $element.find('[for]').each(function () {
  126. $(this).attr('for',$(this).attr('for').replace('new',idNumber));
  127. });
  128. $element.appendTo('#submitTabs ul');
  129. $element.find('.iconpickeradd').iconpicker({placement: 'right', hideOnSelect: false, collision: true});
  130. $(".iconpicker-items").niceScroll({
  131. railpadding: {top:0,right:0,left:0,bottom:0},
  132. scrollspeed: 30,
  133. mousescrollstep: 60,
  134. grabcursorenabled: false
  135. });
  136. $('.tab-box').scrollTop($('.tab-box')[0].scrollHeight);
  137. }
  138. function submitTabs(form) {
  139. var formData = {};
  140. var ids = [];
  141. $.each($(form).serializeArray(), function(i,v) {
  142. var regmatch = /(\w+)\[((?:new-)?\d+)\]/i.exec(v.name);
  143. if (regmatch) {
  144. if (ids.indexOf(regmatch[2]) == -1) {
  145. ids.push(regmatch[2]);
  146. if (typeof formData['order'] !== 'object') { formData['order'] = {}; }
  147. formData['order'][regmatch[2]] = ids.length;
  148. }
  149. if (typeof formData[regmatch[1]] !== 'object') { formData[regmatch[1]] = {}; }
  150. formData[regmatch[1]][regmatch[2]] = v.value;
  151. } else {
  152. console.log(regmatch);
  153. }
  154. });
  155. console.log(formData);
  156. ajax_request('POST', 'submit-tabs', formData);
  157. return false;
  158. }
  159. </script>
  160. <style>
  161. body{
  162. background: #273238;
  163. }
  164. .tabs-with-bg .dropdown-menu a:hover {
  165. color: black !important;
  166. }
  167. .shadow {
  168. -webkit-filter: drop-shadow(0px 0px 0px black);
  169. filter: drop-shadow(0px 0px 0px black);
  170. }
  171. .faded {
  172. opacity: .5;
  173. }
  174. .save-btn-form {
  175. position: absolute;
  176. top: 15px;
  177. right: 60px;
  178. }
  179. @media screen and (min-width: 737px){
  180. .save-btn-form {
  181. position: relative;
  182. top: 15px;
  183. right: 10px;
  184. float: right;
  185. }
  186. }
  187. .darkBold {
  188. color: black;
  189. font-weight: 500;
  190. }
  191. @-webkit-keyframes fadeIn {
  192. from { opacity: 0; }
  193. to { opacity: 1; }
  194. }
  195. @keyframes fadeIn {
  196. from { opacity: 0; }
  197. to { opacity: 1; }
  198. }
  199. button.settingsMenu:hover {
  200. width: 250px !important;
  201. z-index: 10000;
  202. opacity: 1 !important;
  203. }
  204. button.settingsMenu:hover p{
  205. display: block !important;
  206. -webkit-animation: fadeIn 1s;
  207. animation: fadeIn 1s;
  208. opacity: 1 !important;
  209. }
  210. button.settingsMenuActive {
  211. margin-left: 0px !important;
  212. opacity: 1 !important;
  213. }
  214. button.settingsMenuInactive {
  215. opacity: .5;
  216. }
  217. .loop-animation {
  218. animation-iteration-count: infinite;
  219. -webkit-animation-iteration-count: infinite;
  220. -moz-animation-iteration-count: infinite;
  221. -o-animation-iteration-count: infinite;
  222. }
  223. @media screen and (max-width:737px){
  224. .email-body{width: 100%; overflow: auto;}
  225. .email-content, .email-new {
  226. -webkit-overflow-scrolling: touch;
  227. -webkit-transform: translateZ(0);
  228. overflow: scroll;
  229. position: fixed;
  230. height:100% !important;
  231. margin-top:0;
  232. }.email-content .email-header, .email-new .email-header{
  233. padding: 10px 30px;
  234. z-index: 1000;
  235. }
  236. }@media screen and (min-width:737px){
  237. .email-body{width: 100%}
  238. .email-content .close-button, .email-content .email-actions, .email-new .close-button, .email-new .email-actions {
  239. position: relative;
  240. top: 15px;
  241. right: 0px;
  242. float: right;
  243. }.email-inner-section {
  244. margin-top: 50px;
  245. }.email-content, .email-new {
  246. overflow: auto;
  247. margin-top: 0;
  248. height: 100%;
  249. position: fixed;
  250. max-width: 100%;
  251. width: calc(100% - 50px) !important;
  252. right: calc(-100% - 50px);
  253. }.email-content .email-header, .email-new .email-header{
  254. position: fixed;
  255. padding: 10px 30px;
  256. width: calc(100% - 50px) !important;
  257. z-index: 1000;
  258. }
  259. }ul.inbox-nav.nav {
  260. background: white;
  261. padding: 5px;
  262. border-radius: 5px;
  263. }.profile-usermenu ul li.active a {
  264. border-left: 3px solid <?=$activetabBG;?> !important;
  265. padding-left: 12px;
  266. }.profile-usermenu ul li a:hover {
  267. background: <?=$hoverbg;?> !important;
  268. color: <?=$hovertext;?> !important;
  269. cursor: pointer;
  270. }input.form-control.material.icp-auto.iconpicker-element.iconpicker-input {
  271. display: none;
  272. }input.form-control.iconpicker-search {
  273. color: black;
  274. }.key {
  275. font-family:Tahoma, sans-serif;
  276. border-style:solid;
  277. border-color:#D5D6AD #C1C1A8 #CDCBA5 #E7E5C5;
  278. border-width:2px 3px 8px 3px;
  279. background:#D6D4B4;
  280. display:inline-block;
  281. border-radius:5px;
  282. margin:3px;
  283. text-align:center;
  284. }.form-control.material {
  285. background-image: -webkit-gradient(linear, left top, left bottom, from(<?=$topbartext;?>), to(<?=$topbartext;?>)), -webkit-gradient(linear, left top, left bottom, from(#d2d2d2), to(#d2d2d2));
  286. background-image: -webkit-linear-gradient(<?=$topbartext;?>, <?=$topbartext;?>), -webkit-linear-gradient(#d2d2d2, #d2d2d2);
  287. background-image: linear-gradient(<?=$topbartext;?>, <?=$topbartext;?>), linear-gradient(#d2d2d2, #d2d2d2);
  288. }.key span {
  289. background:#ECEECA;
  290. color:#5D5E4F;
  291. display:block;
  292. font-size:12px;
  293. padding:0 2px;
  294. border-radius:3px;
  295. width:14px;
  296. height:18px;
  297. line-height:18px;
  298. text-align:center;
  299. font-weight:bold;
  300. letter-spacing:1px;
  301. text-transform:uppercase;
  302. }.key.wide span {
  303. width:auto;
  304. padding:0 12px;
  305. }.dragging{
  306. border: 2px solid;
  307. }.todo .action-btns a span {
  308. color: #76828e !important;
  309. }.todo li:nth-child(even) {
  310. background: #FFFFFF !important;
  311. }.themeImage {
  312. position: fixed;
  313. left: 160px;
  314. top: 0px;
  315. height: 400px;
  316. }.chooseTheme a span {
  317. position:absolute; display:none; z-index:99;
  318. }.chooseTheme a:hover span {
  319. display:block;
  320. }ul.nav.nav-tabs.apps {
  321. border: solid;
  322. border-top: 0;
  323. border-left: 0;
  324. border-right: 0;
  325. border-radius: 0;
  326. }li.apps.active {
  327. border: solid;
  328. border-bottom: 0;
  329. border-radius: 5px;
  330. top: 3px;
  331. }<?php customCSS(); ?>
  332. </style>
  333. </head>
  334. <body id="body-settings" class="scroller-body group-<?php echo $group;?>" style="padding: 0; overflow: hidden">
  335. <div id="main-wrapper" class="main-wrapper">
  336. <!--Content-->
  337. <div id="content" style="margin:0 10px; overflow:hidden">
  338. <!-- Update -->
  339. <div id="updateStatus" class="row" style="display: none;z-index: 10000;position: relative;">
  340. <div class="col-lg-2">
  341. <div class="content-box box-shadow animated rubberBand">
  342. <div class="table-responsive">
  343. <table class="table table-striped progress-widget zero-m">
  344. <thead class="yellow-bg"><tr><th>Updating</th></tr></thead>
  345. <tbody >
  346. <tr>
  347. <td>
  348. <div class="progress">
  349. <div id="updateStatusBar" class="progress-bar progress-bar-success progress-bar-striped active" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
  350. </div>
  351. </div>
  352. </td>
  353. </tr>
  354. </tbody>
  355. </table>
  356. </div>
  357. </div>
  358. </div>
  359. </div>
  360. <!-- Check Frame Modal -->
  361. <div class="modal fade checkFrame" tabindex="-1" role="dialog">
  362. <div class="modal-dialog modal-lg" role="document">
  363. <div class="modal-content">
  364. <div class="modal-header">
  365. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  366. <h4 class="modal-title">Check iFrame Compatability</h4>
  367. </div>
  368. <form id="urlTestForm" onsubmit="return false;">
  369. <div class="modal-body">
  370. <?php echo translate("TEST_URL"); ?>
  371. <input type="text" class="form-control material" name="url-test" placeholder="<?php echo translate("URL"); ?>" autocorrect="off" autocapitalize="off" value="">
  372. </div>
  373. <div class="modal-footer">
  374. <button type="button" class="btn btn-default waves" data-dismiss="modal">Close</button>
  375. <button id="urlTestForm_submit" class="btn btn-primary waves" data-dismiss="modal">Check Frame URL</button>
  376. </div>
  377. </form>
  378. </div>
  379. </div>
  380. </div>
  381. <br/>
  382. <div id="versionCheck"></div>
  383. <div class="row">
  384. <?php
  385. if($userDevice !== "phone"){
  386. echo '<div class="col-xs-1" style="width: 60px">';
  387. echo '
  388. <button id="apply" type="submit" style="display:none;border-radius: 0px !important; -webkit-border-radius: 20px !important;margin-bottom: -20px;margin-left: 5px;z-index:10000;" class="btn btn-success btn-icon waves waves-circle waves-effect waves-float settingsMenu animated tada">
  389. <i class="fa fa-retweet fa-fw pull-left" style="padding-left: 12px;"></i>
  390. <p class="" style="text-align: center;direction: rtl;display:none;"><strong>'.$language->translate("APPLY_CHANGES").'</strong></p>
  391. </button>
  392. ';
  393. }else{
  394. echo '<div class="col-sm-2">';
  395. echo '<button id="apply" style="width: 100%; display: none;" class="btn waves btn-success btn-sm text-uppercase waves-effect waves-float animated tada" type="submit">'.$language->translate("APPLY_CHANGES").'</button>';
  396. }
  397. $buildMenu = array(
  398. array(
  399. 'id' => 'open-tabs',
  400. 'box' => 'tab-box',
  401. 'name' => 'Edit Tabs',
  402. 'icon_1' => 'view-list',
  403. 'icon_2' => 'th-list',
  404. 'color' => 'red-orange',
  405. 'color2' => 'palette-Red-A700 bg',
  406. 'padding' => '2',
  407. ),
  408. array(
  409. 'id' => 'open-colors',
  410. 'box' => 'color-box',
  411. 'name' => 'Edit Colors',
  412. 'icon_1' => 'format-paint',
  413. 'icon_2' => 'paint-brush',
  414. 'color' => 'red',
  415. 'color2' => 'palette-Indigo-A700 bg',
  416. 'padding' => '2',
  417. ),
  418. array(
  419. 'id' => 'open-users',
  420. 'box' => 'users-box',
  421. 'name' => 'Manage Users',
  422. 'icon_1' => 'account-multiple',
  423. 'icon_2' => 'user',
  424. 'color' => 'green',
  425. 'color2' => 'palette-Blue-Grey-700 bg',
  426. 'padding' => '2',
  427. ),
  428. array(
  429. 'id' => 'open-email',
  430. 'box' => 'email-box',
  431. 'name' => 'Email Users',
  432. 'icon_1' => 'email',
  433. 'icon_2' => 'envelope',
  434. 'color' => 'yellow',
  435. 'color2' => 'palette-Pink-A700 bg',
  436. 'padding' => '2',
  437. ),
  438. array(
  439. 'id' => 'open-logs',
  440. 'box' => 'logs-box',
  441. 'name' => 'View Logs',
  442. 'icon_1' => 'file-document-box',
  443. 'icon_2' => 'list-alt',
  444. 'color' => 'blue',
  445. 'color2' => 'palette-Teal-A700 bg',
  446. 'padding' => '2',
  447. ),
  448. array(
  449. 'id' => 'open-homepage',
  450. 'box' => 'homepage-box',
  451. 'name' => 'Edit Homepage',
  452. 'icon_1' => 'television-guide',
  453. 'icon_2' => 'home',
  454. 'color' => 'yellow',
  455. 'color2' => 'palette-Deep-Orange-A400 bg',
  456. 'padding' => '2',
  457. ),
  458. array(
  459. 'id' => 'open-invites',
  460. 'box' => 'invites-box',
  461. 'name' => 'Plex Invites',
  462. 'icon_1' => 'account-multiple-plus',
  463. 'icon_2' => 'user-plus',
  464. 'color' => 'light-blue',
  465. 'color2' => 'palette-Amber-A700 bg',
  466. 'padding' => '2',
  467. ),
  468. array(
  469. 'id' => 'open-advanced',
  470. 'box' => 'advanced-box',
  471. 'name' => 'Advanced',
  472. 'icon_1' => 'settings',
  473. 'icon_2' => 'cog',
  474. 'color' => 'gray',
  475. 'color2' => 'palette-Grey-600 bg',
  476. 'padding' => '2',
  477. ),array(
  478. 'id' => 'open-info',
  479. 'box' => 'info-box',
  480. 'name' => 'About',
  481. 'icon_1' => 'information',
  482. 'icon_2' => 'info-circle',
  483. 'color' => 'orange',
  484. 'color2' => 'palette-Light-Blue-A700 bg',
  485. 'padding' => '2',
  486. ),array(
  487. 'id' => 'open-help',
  488. 'box' => 'help-box',
  489. 'name' => 'Help & Chat',
  490. 'icon_1' => 'help-circle',
  491. 'icon_2' => 'question-circle',
  492. 'color' => 'orange',
  493. 'color2' => 'palette-Light-Blue-900 bg',
  494. 'padding' => '2',
  495. ),array(
  496. 'id' => 'open-donate',
  497. 'box' => 'donate-box',
  498. 'name' => 'Donate',
  499. 'icon_1' => 'cash-usd',
  500. 'icon_2' => 'money',
  501. 'color' => 'red',
  502. 'color2' => 'palette-Green-A700 bg',
  503. 'padding' => '2',
  504. ),
  505. );
  506. if($userDevice !== "phone"){ echo "<br><br><br>".buildMenu($buildMenu); }else{ echo buildMenuPhone($buildMenu); }?>
  507. </div>
  508. <?php if($userDevice !== "phone"){?>
  509. <div class="col-lg-10" style="position: absolute;top: 50%;left: 10%;width: 80%;">
  510. <h1 style="font-size: 50px" class="text-center">ORGANIZR <i class="fa fa-heart fa-1x red loop-animation animated pulse" aria-hidden="true"></i> YOU</h1>
  511. </div>
  512. <?php } ?>
  513. </div>
  514. <div class="email-content tab-box white-bg">
  515. <div class="email-body">
  516. <div class="email-header gray-bg">
  517. <button type="button" class="btn btn-danger btn-sm waves close-button"><i class="fa fa-close"></i></button>
  518. <button type="button" class="btn waves btn-labeled btn-success btn btn-sm text-uppercase waves-effect waves-float save-btn-form submitTabBtn">
  519. <span class="btn-label"><i class="fa fa-floppy-o"></i></span><?php echo translate('SAVE_TABS'); ?>
  520. </button>
  521. <h1>Edit Tabs</h1>
  522. </div>
  523. <div class="email-inner small-box">
  524. <div class="email-inner-section">
  525. <div class="small-box todo-list fade in" id="tab-tabs">
  526. <form id="submitTabs" onsubmit="submitTabs(this); return false;">
  527. <div class="sort-todo">
  528. <button id="newtab" type="button" class="btn waves btn-labeled btn-success btn-sm text-uppercase waves-effect waves-float" onclick="addTab()">
  529. <span class="btn-label"><i class="fa fa-plus"></i></span><?php echo translate("NEW_TAB");?>
  530. </button>
  531. <button id="iconHide" type="button" class="btn waves btn-labeled btn-warning btn-sm text-uppercase waves-effect waves-float">
  532. <span class="btn-label"><i class="fa fa-upload"></i></span><?php echo $language->translate("UPLOAD_ICONS");?>
  533. </button>
  534. <button id="iconAll" type="button" class="btn waves btn-labeled btn-info btn-sm text-uppercase waves-effect waves-float">
  535. <span class="btn-label"><i class="fa fa-picture-o"></i></span><?php echo $language->translate("VIEW_ICONS");?>
  536. </button>
  537. <button id="checkFrame" data-toggle="modal" data-target=".checkFrame" type="button" class="btn waves btn-labeled btn-gray btn-sm text-uppercase waves-effect waves-float">
  538. <span class="btn-label"><i class="fa fa-check"></i></span><?php echo $language->translate("CHECK_FRAME");?>
  539. </button>
  540. <button id="toggleAllExtra" type="button" class="btn waves btn-labeled btn-info btn-sm text-uppercase waves-effect waves-float indigo-bg">
  541. <span class="btn-label"><i class="fa fa-toggle-off"></i></span><span class="btn-text"><?php echo $language->translate("TOGGLE_ALL");?></span>
  542. </button>
  543. </div>
  544. <input type="file" name="files[]" id="uploadIcons" multiple="multiple">
  545. <div id="viewAllIcons" style="display: none;">
  546. <h4><strong><?php echo $language->translate("ALL_ICONS");?></strong> [<?php echo $language->translate("CLICK_ICON");?>]</h4>
  547. <div class="row">
  548. <textarea id="copyTarget" class="hideCopy" style="left: -9999px; top: 0; position: absolute;"></textarea>
  549. <?php echo loadIcons();?>
  550. </div>
  551. </div>
  552. <div class="panel">
  553. <div class="panel-body todo">
  554. <ul class="list-group ui-sortable">
  555. <?php
  556. foreach($file_db->query('SELECT * FROM tabs ORDER BY `order` asc') as $key => $row) {
  557. if (!isset($row['id'])) { $row['id'] = $key + 1; }
  558. echo printTabRow($row);
  559. }
  560. ?>
  561. </ul>
  562. </div>
  563. </div>
  564. </form>
  565. <?php echo printTabRow(false); ?>
  566. </div>
  567. </div>
  568. </div>
  569. </div>
  570. </div>
  571. <div class="email-content color-box white-bg">
  572. <?php
  573. // Build Colour Settings
  574. echo buildSettings(
  575. array(
  576. 'title' => 'Appearance Settings',
  577. 'id' => 'appearance_settings',
  578. 'submitAction' => 'update-appearance',
  579. 'tabs' => array(
  580. array(
  581. 'title' => 'Colours',
  582. 'id' => 'theme_colours',
  583. 'image' => 'images/paint.png',
  584. 'fields' => array(
  585. array(
  586. array(
  587. 'type' => 'button',
  588. 'labelTranslate' => 'COLOR_TEMPLATE',
  589. 'icon' => 'css3',
  590. 'id' => 'themeSelector',
  591. 'buttonType' => 'dark',
  592. 'buttonDrop' => '
  593. <ul class="dropdown-menu gray-bg">
  594. <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>
  595. <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>
  596. <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>
  597. <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>
  598. <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>
  599. <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>
  600. <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>
  601. <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>
  602. <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>
  603. <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>
  604. </ul>
  605. ',
  606. ),
  607. array(
  608. 'type' => 'button',
  609. 'labelTranslate' => 'CHOOSE_THEME',
  610. 'icon' => 'birthday-cake',
  611. 'id' => 'layerCake',
  612. 'buttonType' => 'dark',
  613. 'buttonDrop' => '
  614. <ul class="dropdown-menu">
  615. <li class="dropdown-header">Choose a Theme Below</li>
  616. <li id="open-themes" box="themes-box" onclick"" data-toggle="tooltip" data-placement="top" title="" data-original-title="Custom Themes Created by The Community"><a onclick="" href="#">Themes</a></li>
  617. <li id="layerCakeDefault" data-toggle="tooltip" data-placement="top" title="" data-original-title="A 7 color theme based on Organizr"><a onclick="layerCake(\'Basic\',\'layerCake\');$(\'#customCSS_id\').attr(\'data-changed\', \'true\');" href="#">LAYER#CAKE Basic</a></li>
  618. <li id="layerCakeCustom" data-toggle="tooltip" data-placement="top" title="" data-original-title="A 32 color theme based on Organizr"><a onclick="layerCake(\'Advanced\',\'layerCake\');$(\'#customCSS_id\').attr(\'data-changed\', \'true\');" href="#">LAYER#CAKE Advanced</a></li>
  619. </ul>
  620. ',
  621. ),
  622. ),
  623. array(
  624. 'type' => 'header',
  625. 'labelTranslate' => 'TITLE',
  626. ),
  627. array(
  628. array(
  629. 'type' => 'text',
  630. 'format' => 'colour',
  631. 'labelTranslate' => 'TITLE',
  632. 'name' => 'title',
  633. 'id' => 'title',
  634. 'value' => $title,
  635. ),
  636. array(
  637. 'type' => 'text',
  638. 'format' => 'colour',
  639. 'class' => 'jscolor {hash:true}',
  640. 'labelTranslate' => 'TITLE_TEXT',
  641. 'name' => 'topbartext',
  642. 'id' => 'topbartext',
  643. 'value' => $topbartext,
  644. ),
  645. array(
  646. 'type' => 'text',
  647. 'format' => 'colour',
  648. 'class' => 'jscolor {hash:true}',
  649. 'labelTranslate' => 'LOADING_COLOR',
  650. 'name' => 'loading',
  651. 'id' => 'loading',
  652. 'value' => $loading,
  653. ),
  654. ),
  655. array(
  656. 'type' => 'header',
  657. 'labelTranslate' => 'NAVIGATION_BARS',
  658. ),
  659. array(
  660. array(
  661. 'type' => 'text',
  662. 'format' => 'colour',
  663. 'class' => 'jscolor {hash:true}',
  664. 'labelTranslate' => 'TOP_BAR',
  665. 'name' => 'topbar',
  666. 'id' => 'topbar',
  667. 'value' => $topbar,
  668. ),
  669. array(
  670. 'type' => 'text',
  671. 'format' => 'colour',
  672. 'class' => 'jscolor {hash:true}',
  673. 'labelTranslate' => 'BOTTOM_BAR',
  674. 'name' => 'bottombar',
  675. 'id' => 'bottombar',
  676. 'value' => $bottombar,
  677. ),
  678. array(
  679. 'type' => 'text',
  680. 'format' => 'colour',
  681. 'class' => 'jscolor {hash:true}',
  682. 'labelTranslate' => 'SIDE_BAR',
  683. 'name' => 'sidebar',
  684. 'id' => 'sidebar',
  685. 'value' => $sidebar,
  686. ),
  687. ),
  688. array(
  689. array(
  690. 'type' => 'text',
  691. 'format' => 'colour',
  692. 'class' => 'jscolor {hash:true}',
  693. 'labelTranslate' => 'HOVER_BG',
  694. 'name' => 'hoverbg',
  695. 'id' => 'hoverbg',
  696. 'value' => $hoverbg,
  697. ),
  698. array(
  699. 'type' => 'text',
  700. 'format' => 'colour',
  701. 'class' => 'jscolor {hash:true}',
  702. 'labelTranslate' => 'HOVER_TEXT',
  703. 'name' => 'hovertext',
  704. 'id' => 'hovertext',
  705. 'value' => $hovertext,
  706. ),
  707. ),
  708. array(
  709. 'type' => 'header',
  710. 'labelTranslate' => 'ACTIVE_TAB',
  711. ),
  712. array(
  713. array(
  714. 'type' => 'text',
  715. 'format' => 'colour',
  716. 'class' => 'jscolor {hash:true}',
  717. 'labelTranslate' => 'ACTIVE_TAB_BG',
  718. 'name' => 'activetabBG',
  719. 'id' => 'activetabBG',
  720. 'value' => $activetabBG,
  721. ),
  722. array(
  723. 'type' => 'text',
  724. 'format' => 'colour',
  725. 'class' => 'jscolor {hash:true}',
  726. 'labelTranslate' => 'ACTIVE_TAB_ICON',
  727. 'name' => 'activetabicon',
  728. 'id' => 'activetabicon',
  729. 'value' => $activetabicon,
  730. ),
  731. array(
  732. 'type' => 'text',
  733. 'format' => 'colour',
  734. 'class' => 'jscolor {hash:true}',
  735. 'labelTranslate' => 'ACTIVE_TAB_TEXT',
  736. 'name' => 'activetabtext',
  737. 'id' => 'activetabtext',
  738. 'value' => $activetabtext,
  739. ),
  740. ),
  741. array(
  742. 'type' => 'header',
  743. 'labelTranslate' => 'INACTIVE_TAB',
  744. ),
  745. array(
  746. array(
  747. 'type' => 'text',
  748. 'format' => 'colour',
  749. 'class' => 'jscolor {hash:true}',
  750. 'labelTranslate' => 'INACTIVE_ICON',
  751. 'name' => 'inactiveicon',
  752. 'id' => 'inactiveicon',
  753. 'value' => $inactiveicon,
  754. ),
  755. array(
  756. 'type' => 'text',
  757. 'format' => 'colour',
  758. 'class' => 'jscolor {hash:true}',
  759. 'labelTranslate' => 'INACTIVE_TEXT',
  760. 'name' => 'inactivetext',
  761. 'id' => 'inactivetext',
  762. 'value' => $inactivetext,
  763. ),
  764. ),
  765. ),
  766. ),
  767. array(
  768. 'title' => 'Custom CSS',
  769. 'id' => 'theme_css',
  770. 'image' => 'images/css.png',
  771. 'fields' => array(
  772. array(
  773. 'type' => 'header',
  774. 'label' => 'Custom CSS',
  775. ),
  776. array(
  777. 'type' => 'header',
  778. 'class' => '',
  779. 'label' => (empty(INSTALLEDTHEME)?'<span class="themeHeader">Installed Theme: No Theme Installed</span>':'<span class="themeHeader">Installed Theme: '.INSTALLEDTHEME.'</span><button id="clearTheme" type="button" class="btn waves pull-right btn-labeled btn-sm btn-danger text-uppercase waves-effect waves-float"><span class="btn-label"><i class="fa fa-trash"></i></span> Clear Theme</button>'),
  780. ),
  781. array(
  782. 'type' => 'textarea',
  783. 'name' => 'customCSS',
  784. 'value' => (file_exists('./custom.css')?file_get_contents('./custom.css'):''),
  785. 'rows' => 25,
  786. 'style' => 'background: #000; color: #FFF;',
  787. ),
  788. ),
  789. ),
  790. ),
  791. )
  792. );
  793. ?>
  794. </div>
  795. <div class="email-content homepage-box white-bg">
  796. <?php
  797. // Qualify most typical hostnames prior to form submission
  798. $urlPattern = '([hH][tT][tT][pP][sS]?):\/\/([\w\.\-]{1,250})(?::(\d{1,5}))?((?:\/[^?.\s]+))?';
  799. // Once configurable user groups is added change to select-multi to allow specific group selection
  800. $userSelectType = 'select';
  801. $userTypes = array(
  802. 'None' => 'false',
  803. 'User' => 'user|admin',
  804. 'Admin' => 'admin',
  805. );
  806. $branchTypes = array(
  807. 'Master' => 'v1-master',
  808. 'Develop' => 'v1-develop',
  809. 'Pre-Develop' => 'v1-develop',
  810. );
  811. $refreshSeconds = array(
  812. '1 sec' => '1000',
  813. '5 secs' => '5000',
  814. '10 secs' => '10000',
  815. '15 secs' => '15000',
  816. '30 secs' => '30000',
  817. '1 min' => '60000',
  818. '1.5 mins' => '90000',
  819. '2 mins' => '120000',
  820. '5 mins' => '300000',
  821. '10 mins' => '600000',
  822. '15 mins' => '900000',
  823. '30 mins' => '1800000',
  824. '45 mins' => '2700000',
  825. '1 hour' => '3600000',
  826. );
  827. // Build Homepage Settings
  828. echo buildSettings(
  829. array(
  830. 'title' => 'Homepage Settings',
  831. 'id' => 'homepage_settings',
  832. 'onready' => '',
  833. 'tabs' => array(
  834. array(
  835. 'title' => 'General',
  836. 'id' => 'home_general',
  837. 'image' => 'images/gear.png',
  838. 'fields' => array(
  839. array(
  840. 'type' => 'custom',
  841. 'html' => '<h2>To Enable, please add new tab with url of homepage.php</h2>',
  842. ),
  843. array(
  844. 'type' => $userSelectType,
  845. 'labelTranslate' => 'SHOW_HOMEPAGE',
  846. 'name' => 'homePageAuthNeeded',
  847. 'value' => HOMEPAGEAUTHNEEDED,
  848. 'options' => $userTypes,
  849. ),
  850. /*
  851. array(
  852. 'type' => 'custom',
  853. 'labelTranslate' => 'SHOW_HOMEPAGE',
  854. 'html' => 'homePageAuthNeeded',
  855. 'name' => 'homePagelayout',
  856. 'value' => '',
  857. ),
  858. */
  859. ),
  860. ),
  861. array(
  862. 'title' => 'Plex',
  863. 'id' => 'plex',
  864. 'image' => 'images/plex.png',
  865. 'fields' => array(
  866. array(
  867. 'type' => $userSelectType,
  868. 'labelTranslate' => 'SHOW_ON_HOMEPAGE',
  869. 'name' => 'plexHomeAuth',
  870. 'value' => PLEXHOMEAUTH,
  871. 'options' => $userTypes,
  872. ),
  873. array(
  874. 'type' => 'text',
  875. 'placeholder' => 'http://hostname:32400',
  876. 'labelTranslate' => 'PLEX_URL',
  877. 'assist' => 'http://hostname:32400',
  878. 'name' => 'plexURL',
  879. 'pattern' => $urlPattern,
  880. 'value' => PLEXURL,
  881. ),
  882. array(
  883. array(
  884. 'type' => 'text',
  885. 'placeholder' => randString(20),
  886. 'labelTranslate' => 'PLEX_TOKEN',
  887. 'name' => 'plexToken',
  888. 'pattern' => '[a-zA-Z0-9]{20}',
  889. 'value' => PLEXTOKEN,
  890. ),
  891. array(
  892. 'type' => 'custom',
  893. 'html' => '<button id="openPlexModal" type="button" class="btn waves btn-labeled btn-success btn-sm text-uppercase waves-effect waves-float"> <span class="btn-label"><i class="fa fa-ticket"></i></span>'.translate("GET_PLEX_TOKEN").'</button>',
  894. ),
  895. ),
  896. array(
  897. array(
  898. 'type' => 'text',
  899. 'placeholder' => "",
  900. 'labelTranslate' => 'RECENT_ITEMS_LIMIT',
  901. 'name' => 'plexRecentItems',
  902. 'pattern' => '[0-9]+',
  903. 'value' => PLEXRECENTITEMS,
  904. ),
  905. array(
  906. 'type' => $userSelectType,
  907. 'labelTranslate' => 'RECENT_REFRESH',
  908. 'name' => 'recentRefresh',
  909. 'value' => RECENTREFRESH,
  910. 'options' => $refreshSeconds,
  911. ),
  912. ),
  913. array(
  914. 'type' => 'text',
  915. 'placeholder' => "Name of Plex Tab i.e. Plex",
  916. 'labelTranslate' => 'PLEX_TAB_NAME',
  917. 'name' => 'plexTabName',
  918. 'value' => PLEXTABNAME,
  919. ),
  920. array(
  921. 'type' => 'text',
  922. 'placeholder' => "URL For Plex Links",
  923. 'labelTranslate' => 'PLEX_TAB_URL',
  924. 'name' => 'plexTabURL',
  925. 'value' => PLEXTABURL,
  926. ),
  927. array(
  928. array(
  929. 'type' => 'checkbox',
  930. 'labelTranslate' => 'ALLOW_SEARCH',
  931. 'name' => 'plexSearch',
  932. 'value' => PLEXSEARCH,
  933. ),
  934. array(
  935. 'type' => $userSelectType,
  936. 'labelTranslate' => 'SHOW_ON_HOMEPAGE',
  937. 'name' => 'plexHomeAuth',
  938. 'value' => PLEXSEARCHAUTH,
  939. 'options' => $userTypes,
  940. ),
  941. ),
  942. array(
  943. array(
  944. 'type' => 'checkbox',
  945. 'labelTranslate' => 'RECENT_MOVIES',
  946. 'name' => 'plexRecentMovie',
  947. 'value' => PLEXRECENTMOVIE,
  948. ),
  949. array(
  950. 'type' => $userSelectType,
  951. 'labelTranslate' => 'SHOW_ON_HOMEPAGE',
  952. 'name' => 'plexRecentMovieAuth',
  953. 'value' => PLEXRECENTMOVIEAUTH,
  954. 'options' => $userTypes,
  955. ),
  956. ),
  957. array(
  958. array(
  959. 'type' => 'checkbox',
  960. 'labelTranslate' => 'RECENT_TV',
  961. 'name' => 'plexRecentTV',
  962. 'value' => PLEXRECENTTV,
  963. ),
  964. array(
  965. 'type' => $userSelectType,
  966. 'labelTranslate' => 'SHOW_ON_HOMEPAGE',
  967. 'name' => 'plexRecentTVAuth',
  968. 'value' => PLEXRECENTTVAUTH,
  969. 'options' => $userTypes,
  970. ),
  971. ),
  972. array(
  973. array(
  974. 'type' => 'checkbox',
  975. 'labelTranslate' => 'RECENT_MUSIC',
  976. 'name' => 'plexRecentMusic',
  977. 'value' => PLEXRECENTMUSIC,
  978. ),
  979. array(
  980. 'type' => $userSelectType,
  981. 'labelTranslate' => 'SHOW_ON_HOMEPAGE',
  982. 'name' => 'plexRecentMusicAuth',
  983. 'value' => PLEXRECENTMUSICAUTH,
  984. 'options' => $userTypes,
  985. ),
  986. ),
  987. array(
  988. array(
  989. 'type' => 'checkbox',
  990. 'labelTranslate' => 'PLAYLISTS',
  991. 'name' => 'plexPlaylists',
  992. 'value' => PLEXPLAYLISTS,
  993. ),
  994. array(
  995. 'type' => $userSelectType,
  996. 'labelTranslate' => 'SHOW_ON_HOMEPAGE',
  997. 'name' => 'plexPlaylistsAuth',
  998. 'value' => PLEXPLAYLISTSAUTH,
  999. 'options' => $userTypes,
  1000. ),
  1001. ),
  1002. array(
  1003. array(
  1004. 'type' => 'checkbox',
  1005. 'labelTranslate' => 'PLAYING_NOW',
  1006. 'name' => 'plexPlayingNow',
  1007. 'value' => PLEXPLAYINGNOW,
  1008. ),
  1009. array(
  1010. 'type' => $userSelectType,
  1011. 'labelTranslate' => 'SHOW_ON_HOMEPAGE',
  1012. 'name' => 'plexPlayingNowAuth',
  1013. 'value' => PLEXPLAYINGNOWAUTH,
  1014. 'options' => $userTypes,
  1015. ),
  1016. ),
  1017. array(
  1018. array(
  1019. 'type' => 'checkbox',
  1020. 'labelTranslate' => 'SHOW_NAMES',
  1021. 'name' => 'plexShowNames',
  1022. 'value' => PLEXSHOWNAMES,
  1023. ),
  1024. ),
  1025. ),
  1026. ),
  1027. array(
  1028. 'title' => 'Emby',
  1029. 'id' => 'emby',
  1030. 'image' => 'images/emby.png',
  1031. 'fields' => array(
  1032. array(
  1033. 'type' => $userSelectType,
  1034. 'labelTranslate' => 'SHOW_ON_HOMEPAGE',
  1035. 'name' => 'embyHomeAuth',
  1036. 'value' => EMBYHOMEAUTH,
  1037. 'options' => $userTypes,
  1038. ),
  1039. array(
  1040. 'type' => 'text',
  1041. 'placeholder' => 'http://hostname:8096/emby',
  1042. 'labelTranslate' => 'EMBY_URL',
  1043. 'assist' => 'http://hostname:8096 | https://hostname/emby | http://hostname:8096/emby',
  1044. 'name' => 'embyURL',
  1045. 'pattern' => $urlPattern,
  1046. 'value' => EMBYURL,
  1047. ),
  1048. array(
  1049. 'type' => 'text',
  1050. 'placeholder' => randString(32),
  1051. 'labelTranslate' => 'EMBY_TOKEN',
  1052. 'name' => 'embyToken',
  1053. 'pattern' => '[a-zA-Z0-9]{32}',
  1054. 'value' => EMBYTOKEN,
  1055. ),
  1056. array(
  1057. array(
  1058. 'type' => 'text',
  1059. 'placeholder' => "",
  1060. 'labelTranslate' => 'RECENT_ITEMS_LIMIT',
  1061. 'name' => 'embyRecentItems',
  1062. 'pattern' => '[0-9]+',
  1063. 'value' => EMBYRECENTITEMS,
  1064. ),
  1065. array(
  1066. 'type' => $userSelectType,
  1067. 'labelTranslate' => 'RECENT_REFRESH',
  1068. 'name' => 'recentRefresh',
  1069. 'value' => RECENTREFRESH,
  1070. 'options' => $refreshSeconds,
  1071. ),
  1072. ),
  1073. array(
  1074. array(
  1075. 'type' => 'checkbox',
  1076. 'labelTranslate' => 'RECENT_MOVIES',
  1077. 'name' => 'embyRecentMovie',
  1078. 'value' => EMBYRECENTMOVIE,
  1079. ),
  1080. array(
  1081. 'type' => $userSelectType,
  1082. 'labelTranslate' => 'SHOW_ON_HOMEPAGE',
  1083. 'name' => 'embyRecentMovieAuth',
  1084. 'value' => EMBYRECENTMOVIEAUTH,
  1085. 'options' => $userTypes,
  1086. ),
  1087. ),
  1088. array(
  1089. array(
  1090. 'type' => 'checkbox',
  1091. 'labelTranslate' => 'RECENT_TV',
  1092. 'name' => 'embyRecentTV',
  1093. 'value' => EMBYRECENTTV,
  1094. ),
  1095. array(
  1096. 'type' => $userSelectType,
  1097. 'labelTranslate' => 'SHOW_ON_HOMEPAGE',
  1098. 'name' => 'embyRecentTVAuth',
  1099. 'value' => EMBYRECENTTVAUTH,
  1100. 'options' => $userTypes,
  1101. ),
  1102. ),
  1103. array(
  1104. array(
  1105. 'type' => 'checkbox',
  1106. 'labelTranslate' => 'RECENT_MUSIC',
  1107. 'name' => 'embyRecentMusic',
  1108. 'value' => EMBYRECENTMUSIC,
  1109. ),
  1110. array(
  1111. 'type' => $userSelectType,
  1112. 'labelTranslate' => 'SHOW_ON_HOMEPAGE',
  1113. 'name' => 'embyRecentMusicAuth',
  1114. 'value' => EMBYRECENTMUSICAUTH,
  1115. 'options' => $userTypes,
  1116. ),
  1117. ),
  1118. array(
  1119. array(
  1120. 'type' => 'checkbox',
  1121. 'labelTranslate' => 'PLAYING_NOW',
  1122. 'name' => 'embyPlayingNow',
  1123. 'value' => EMBYPLAYINGNOW,
  1124. ),
  1125. array(
  1126. 'type' => $userSelectType,
  1127. 'labelTranslate' => 'SHOW_ON_HOMEPAGE',
  1128. 'name' => 'embyPlayingNowAuth',
  1129. 'value' => EMBYPLAYINGNOWAUTH,
  1130. 'options' => $userTypes,
  1131. ),
  1132. ),
  1133. array(
  1134. array(
  1135. 'type' => 'checkbox',
  1136. 'labelTranslate' => 'SHOW_NAMES',
  1137. 'name' => 'embyShowNames',
  1138. 'value' => EMBYSHOWNAMES,
  1139. ),
  1140. ),
  1141. ),
  1142. ),
  1143. array(
  1144. 'title' => 'Sonarr',
  1145. 'id' => 'sonarr',
  1146. 'image' => 'images/sonarr.png',
  1147. 'fields' => array(
  1148. array(
  1149. 'type' => $userSelectType,
  1150. 'labelTranslate' => 'SHOW_ON_HOMEPAGE',
  1151. 'name' => 'sonarrHomeAuth',
  1152. 'value' => SONARRHOMEAUTH,
  1153. 'options' => $userTypes,
  1154. ),
  1155. array(
  1156. 'type' => 'text',
  1157. 'placeholder' => 'http://hostname:8989',
  1158. 'labelTranslate' => 'SONARR_URL',
  1159. 'assist' => 'http://hostname:8989 | hostname/sonarr | http://hostname:8989/sonarr',
  1160. 'name' => 'sonarrURL',
  1161. 'pattern' => $urlPattern,
  1162. 'value' => SONARRURL,
  1163. ),
  1164. array(
  1165. 'type' => 'text',
  1166. 'placeholder' => randString(32),
  1167. 'labelTranslate' => 'SONARR_KEY',
  1168. 'name' => 'sonarrKey',
  1169. 'pattern' => '[a-zA-Z0-9]{32}',
  1170. 'value' => SONARRKEY,
  1171. ),
  1172. array(
  1173. 'type' => 'checkbox',
  1174. 'labelTranslate' => 'SONARR_UNMONITORED',
  1175. 'name' => 'sonarrUnmonitored',
  1176. 'value' => SONARRUNMONITORED,
  1177. ),
  1178. ),
  1179. ),
  1180. array(
  1181. 'title' => 'Radarr',
  1182. 'id' => 'radarr',
  1183. 'image' => 'images/radarr.png',
  1184. 'fields' => array(
  1185. array(
  1186. 'type' => $userSelectType,
  1187. 'labelTranslate' => 'SHOW_ON_HOMEPAGE',
  1188. 'name' => 'radarrHomeAuth',
  1189. 'value' => RADARRHOMEAUTH,
  1190. 'options' => $userTypes,
  1191. ),
  1192. array(
  1193. 'type' => 'text',
  1194. 'placeholder' => 'http://hostname:7878',
  1195. 'labelTranslate' => 'RADARR_URL',
  1196. 'assist' => 'http://hostname:7878 | hostname/radarr | http://hostname:7878/radarr',
  1197. 'name' => 'radarrURL',
  1198. 'pattern' => $urlPattern,
  1199. 'value' => RADARRURL,
  1200. ),
  1201. array(
  1202. 'type' => 'text',
  1203. 'placeholder' => randString(32),
  1204. 'labelTranslate' => 'RADARR_KEY',
  1205. 'name' => 'radarrKey',
  1206. 'pattern' => '[a-zA-Z0-9]{32}',
  1207. 'value' => RADARRKEY,
  1208. ),
  1209. ),
  1210. ),
  1211. array(
  1212. 'title' => 'CouchPotato',
  1213. 'id' => 'couchpotato',
  1214. 'image' => 'images/couchpotato.png',
  1215. 'fields' => array(
  1216. array(
  1217. 'type' => $userSelectType,
  1218. 'labelTranslate' => 'SHOW_ON_HOMEPAGE',
  1219. 'name' => 'couchHomeAuth',
  1220. 'value' => COUCHHOMEAUTH,
  1221. 'options' => $userTypes,
  1222. ),
  1223. array(
  1224. 'type' => 'text',
  1225. 'placeholder' => 'http://hostname:8181',
  1226. 'labelTranslate' => 'COUCH_URL',
  1227. 'assist' => 'http://hostname:8181',
  1228. 'name' => 'couchURL',
  1229. 'pattern' => $urlPattern,
  1230. 'value' => COUCHURL,
  1231. ),
  1232. array(
  1233. 'type' => 'text',
  1234. 'placeholder' => randString(32),
  1235. 'labelTranslate' => 'COUCH_KEY',
  1236. 'name' => 'couchAPI',
  1237. 'value' => COUCHAPI,
  1238. ),
  1239. ),
  1240. ),
  1241. array(
  1242. 'title' => 'Sickbeard/Sickrage',
  1243. 'id' => 'sick',
  1244. 'image' => 'images/sickrage.png',
  1245. 'fields' => array(
  1246. array(
  1247. 'type' => $userSelectType,
  1248. 'labelTranslate' => 'SHOW_ON_HOMEPAGE',
  1249. 'name' => 'sickrageHomeAuth',
  1250. 'value' => SICKRAGEHOMEAUTH,
  1251. 'options' => $userTypes,
  1252. ),
  1253. array(
  1254. 'type' => 'text',
  1255. 'placeholder' => 'http://hostname:8081/sick',
  1256. 'labelTranslate' => 'SICK_URL',
  1257. 'assist' => 'http://hostname:8081 | hostname/sick | http://hostname:8081/sick',
  1258. 'name' => 'sickrageURL',
  1259. 'pattern' => $urlPattern,
  1260. 'value' => SICKRAGEURL,
  1261. ),
  1262. array(
  1263. 'type' => 'text',
  1264. 'placeholder' => randString(32),
  1265. 'labelTranslate' => 'SICK_KEY',
  1266. 'name' => 'sickrageKey',
  1267. 'value' => SICKRAGEKEY,
  1268. ),
  1269. ),
  1270. ),
  1271. array(
  1272. 'title' => 'Headphones',
  1273. 'id' => 'headphones',
  1274. 'image' => 'images/headphones.png',
  1275. 'fields' => array(
  1276. array(
  1277. 'type' => $userSelectType,
  1278. 'labelTranslate' => 'SHOW_ON_HOMEPAGE',
  1279. 'name' => 'headphonesHomeAuth',
  1280. 'value' => HEADPHONESHOMEAUTH,
  1281. 'options' => $userTypes,
  1282. ),
  1283. array(
  1284. 'type' => 'text',
  1285. 'placeholder' => 'http://hostname:8181',
  1286. 'labelTranslate' => 'HEADPHONES_URL',
  1287. 'assist' => 'http://hostname:8181',
  1288. 'name' => 'headphonesURL',
  1289. 'pattern' => $urlPattern,
  1290. 'value' => HEADPHONESURL,
  1291. ),
  1292. array(
  1293. 'type' => 'text',
  1294. 'placeholder' => randString(32),
  1295. 'labelTranslate' => 'HEADPHONES_KEY',
  1296. 'name' => 'headphonesKey',
  1297. 'value' => HEADPHONESKEY,
  1298. ),
  1299. ),
  1300. ),
  1301. array(
  1302. 'title' => 'Sabnzbd',
  1303. 'id' => 'sabnzbd',
  1304. 'image' => 'images/sabnzbd.png',
  1305. 'fields' => array(
  1306. array(
  1307. 'type' => $userSelectType,
  1308. 'labelTranslate' => 'SHOW_ON_HOMEPAGE',
  1309. 'name' => 'sabnzbdHomeAuth',
  1310. 'value' => SABNZBDHOMEAUTH,
  1311. 'options' => $userTypes,
  1312. ),
  1313. array(
  1314. 'type' => 'text',
  1315. 'placeholder' => 'http://hostname:8080/sabnzbd',
  1316. 'labelTranslate' => 'SABNZBD_URL',
  1317. 'assist' => 'http://hostname:8080 | http://hostname/sabnzbd | http://hostname:8080/sabnzbd',
  1318. 'name' => 'sabnzbdURL',
  1319. 'pattern' => $urlPattern,
  1320. 'value' => SABNZBDURL,
  1321. ),
  1322. array(
  1323. 'type' => 'text',
  1324. 'placeholder' => randString(32),
  1325. 'labelTranslate' => 'SABNZBD_KEY',
  1326. 'name' => 'sabnzbdKey',
  1327. 'value' => SABNZBDKEY,
  1328. ),
  1329. array(
  1330. 'type' => $userSelectType,
  1331. 'labelTranslate' => 'DOWNLOAD_REFRESH',
  1332. 'name' => 'downloadRefresh',
  1333. 'value' => DOWNLOADREFRESH,
  1334. 'options' => $refreshSeconds,
  1335. ),
  1336. array(
  1337. 'type' => $userSelectType,
  1338. 'labelTranslate' => 'HISTORY_REFRESH',
  1339. 'name' => 'historyRefresh',
  1340. 'value' => HISTORYREFRESH,
  1341. 'options' => $refreshSeconds,
  1342. ),
  1343. ),
  1344. ),
  1345. array(
  1346. 'title' => 'nzbGET',
  1347. 'id' => 'nzbget',
  1348. 'image' => 'images/nzbget.png',
  1349. 'fields' => array(
  1350. array(
  1351. 'type' => $userSelectType,
  1352. 'labelTranslate' => 'SHOW_ON_HOMEPAGE',
  1353. 'name' => 'nzbgetHomeAuth',
  1354. 'value' => NZBGETHOMEAUTH,
  1355. 'options' => $userTypes,
  1356. ),
  1357. array(
  1358. 'type' => 'text',
  1359. 'placeholder' => 'http://hostname:6789',
  1360. 'labelTranslate' => 'NZBGET_URL',
  1361. 'assist' => 'http://hostname:6789',
  1362. 'name' => 'nzbgetURL',
  1363. 'pattern' => $urlPattern,
  1364. 'value' => NZBGETURL,
  1365. ),
  1366. array(
  1367. 'type' => 'text',
  1368. 'labelTranslate' => 'USERNAME',
  1369. 'name' => 'nzbgetUsername',
  1370. 'value' => NZBGETUSERNAME,
  1371. ),
  1372. array(
  1373. 'type' => 'password',
  1374. 'labelTranslate' => 'PASSWORD',
  1375. 'name' => 'nzbgetPassword',
  1376. 'value' => (empty(NZBGETPASSWORD)?'':randString(20)),
  1377. 'autocomplete' => 'new-password',
  1378. ),
  1379. array(
  1380. 'type' => $userSelectType,
  1381. 'labelTranslate' => 'DOWNLOAD_REFRESH',
  1382. 'name' => 'downloadRefresh',
  1383. 'value' => DOWNLOADREFRESH,
  1384. 'options' => $refreshSeconds,
  1385. ),
  1386. array(
  1387. 'type' => $userSelectType,
  1388. 'labelTranslate' => 'HISTORY_REFRESH',
  1389. 'name' => 'historyRefresh',
  1390. 'value' => HISTORYREFRESH,
  1391. 'options' => $refreshSeconds,
  1392. ),
  1393. ),
  1394. ),
  1395. array(
  1396. 'title' => 'Transmission',
  1397. 'id' => 'transmission',
  1398. 'image' => 'images/transmission.png',
  1399. 'fields' => array(
  1400. array(
  1401. 'type' => $userSelectType,
  1402. 'labelTranslate' => 'SHOW_ON_HOMEPAGE',
  1403. 'name' => 'transmissionHomeAuth',
  1404. 'value' => TRANSMISSIONHOMEAUTH,
  1405. 'options' => $userTypes,
  1406. ),
  1407. array(
  1408. 'type' => 'text',
  1409. 'placeholder' => 'http://hostname:6789',
  1410. 'labelTranslate' => 'TRANSMISSION_URL',
  1411. 'assist' => 'http://hostname:6789',
  1412. 'name' => 'transmissionURL',
  1413. 'pattern' => $urlPattern,
  1414. 'value' => TRANSMISSIONURL,
  1415. ),
  1416. array(
  1417. 'type' => 'text',
  1418. 'labelTranslate' => 'USERNAME',
  1419. 'name' => 'transmissionUsername',
  1420. 'value' => TRANSMISSIONUSERNAME,
  1421. ),
  1422. array(
  1423. 'type' => 'password',
  1424. 'labelTranslate' => 'PASSWORD',
  1425. 'name' => 'transmissionPassword',
  1426. 'value' => (empty(TRANSMISSIONPASSWORD)?'':randString(20)),
  1427. 'autocomplete' => 'new-password',
  1428. ),
  1429. array(
  1430. 'type' => $userSelectType,
  1431. 'labelTranslate' => 'DOWNLOAD_REFRESH',
  1432. 'name' => 'downloadRefresh',
  1433. 'value' => DOWNLOADREFRESH,
  1434. 'options' => $refreshSeconds,
  1435. ),
  1436. ),
  1437. ),
  1438. array(
  1439. 'title' => 'Calendar',
  1440. 'id' => 'calendar',
  1441. 'image' => 'images/calendar.png',
  1442. 'fields' => array(
  1443. array(
  1444. 'type' => 'select',
  1445. 'labelTranslate' => 'CALENDAR_START_DAY',
  1446. 'name' => 'calendarStart',
  1447. 'value' => CALENDARSTART,
  1448. 'options' => array(
  1449. explode('|', translate('DAYS'))[0] => '0',
  1450. explode('|', translate('DAYS'))[1] => '1',
  1451. explode('|', translate('DAYS'))[2] => '2',
  1452. explode('|', translate('DAYS'))[3] => '3',
  1453. explode('|', translate('DAYS'))[4] => '4',
  1454. explode('|', translate('DAYS'))[5] => '5',
  1455. explode('|', translate('DAYS'))[6] => '6',
  1456. ),
  1457. ),
  1458. array(
  1459. 'type' => 'select',
  1460. 'labelTranslate' => 'DEFAULT',
  1461. 'name' => 'calendarView',
  1462. 'value' => CALENDARVIEW,
  1463. 'options' => array(
  1464. translate('MONTH') => 'month',
  1465. translate('DAY') => 'basicDay',
  1466. translate('WEEK') => 'basicWeek',
  1467. ),
  1468. ),
  1469. array(
  1470. 'type' => 'select',
  1471. 'labelTranslate' => 'CALTIMEFORMAT',
  1472. 'name' => 'calTimeFormat',
  1473. 'value' => CALTIMEFORMAT,
  1474. 'options' => array(
  1475. '6p' => 'h(:mm)t',
  1476. '6:00p' => 'h:mmt',
  1477. '6:00' => 'h:mm',
  1478. '18' => 'H(:mm)',
  1479. '18:00' => 'H:mm',
  1480. ),
  1481. ),
  1482. array(
  1483. 'type' => 'number',
  1484. 'placeholder' => '10',
  1485. 'labelTranslate' => 'CALENDAR_START_DATE',
  1486. 'name' => 'calendarStartDay',
  1487. 'pattern' => '[1-9][0-9]+',
  1488. 'value' => CALENDARSTARTDAY,
  1489. ),
  1490. array(
  1491. 'type' => 'number',
  1492. 'placeholder' => '10',
  1493. 'labelTranslate' => 'CALENDAR_END_DATE',
  1494. 'name' => 'calendarEndDay',
  1495. 'pattern' => '[1-9][0-9]+',
  1496. 'value' => CALENDARENDDAY,
  1497. ),
  1498. array(
  1499. 'type' => $userSelectType,
  1500. 'labelTranslate' => 'CALENDAR_REFRESH',
  1501. 'name' => 'calendarRefresh',
  1502. 'value' => CALENDARREFRESH,
  1503. 'options' => $refreshSeconds,
  1504. ),
  1505. ),
  1506. ),
  1507. array(
  1508. 'title' => 'Notice',
  1509. 'id' => 'notice',
  1510. 'image' => 'images/pin.png',
  1511. 'fields' => array(
  1512. array(
  1513. 'type' => $userSelectType,
  1514. 'labelTranslate' => 'SHOW_ON_HOMEPAGE',
  1515. 'name' => 'homepageNoticeAuth',
  1516. 'value' => HOMEPAGENOTICEAUTH,
  1517. 'options' => $userTypes,
  1518. ),
  1519. array(
  1520. 'type' => $userSelectType,
  1521. 'labelTranslate' => 'NOTICE_LAYOUT',
  1522. 'name' => 'homepageNoticeLayout',
  1523. 'value' => HOMEPAGENOTICELAYOUT,
  1524. 'options' => array(
  1525. 'Elegant' => 'elegant',
  1526. 'Basic' => 'basic',
  1527. 'Jumbotron' => 'jumbotron',
  1528. ),
  1529. ),
  1530. array(
  1531. 'type' => $userSelectType,
  1532. 'labelTranslate' => 'NOTICE_COLOR',
  1533. 'name' => 'homepageNoticeType',
  1534. 'value' => HOMEPAGENOTICETYPE,
  1535. 'options' => array(
  1536. 'Green' => 'success',
  1537. 'Blue' => 'primary',
  1538. 'Gray' => 'gray',
  1539. 'Red' => 'danger',
  1540. 'Yellow' => 'warning',
  1541. 'Light Blue' => 'info',
  1542. ),
  1543. ),
  1544. array(
  1545. 'type' => 'text',
  1546. 'labelTranslate' => 'NOTICE_TITLE',
  1547. 'name' => 'homepageNoticeTitle',
  1548. 'value' => HOMEPAGENOTICETITLE,
  1549. ),
  1550. /*array(
  1551. 'type' => 'textarea',
  1552. 'labelTranslate' => 'NOTICE_MESSAGE',
  1553. 'name' => 'homepageNoticeMessage',
  1554. 'value' => HOMEPAGENOTICEMESSAGE,
  1555. 'rows' => 5,
  1556. 'class' => 'material no-code',
  1557. ),*/
  1558. array(
  1559. 'type' => 'custom',
  1560. 'labelTranslate' => 'NOTICE_MESSAGE',
  1561. 'html' => '<div class="summernote" name="homepageNoticeMessage">'.HOMEPAGENOTICEMESSAGE.'</div>',
  1562. ),
  1563. array(
  1564. 'type' => 'custom',
  1565. 'html' => '<h2>Not Logged In/Guest Notice</h2>',
  1566. ),
  1567. array(
  1568. 'type' => $userSelectType,
  1569. 'labelTranslate' => 'NOTICE_LAYOUT',
  1570. 'name' => 'homepageNoticeLayoutGuest',
  1571. 'value' => HOMEPAGENOTICELAYOUTGUEST,
  1572. 'options' => array(
  1573. 'Elegant' => 'elegant',
  1574. 'Basic' => 'basic',
  1575. 'Jumbotron' => 'jumbotron',
  1576. ),
  1577. ),
  1578. array(
  1579. 'type' => $userSelectType,
  1580. 'labelTranslate' => 'NOTICE_COLOR',
  1581. 'name' => 'homepageNoticeTypeGuest',
  1582. 'value' => HOMEPAGENOTICETYPEGUEST,
  1583. 'options' => array(
  1584. 'Green' => 'success',
  1585. 'Blue' => 'primary',
  1586. 'Gray' => 'gray',
  1587. 'Red' => 'danger',
  1588. 'Yellow' => 'warning',
  1589. 'Light Blue' => 'info',
  1590. ),
  1591. ),
  1592. array(
  1593. 'type' => 'text',
  1594. 'labelTranslate' => 'NOTICE_TITLE',
  1595. 'name' => 'homepageNoticeTitleGuest',
  1596. 'value' => HOMEPAGENOTICETITLEGUEST,
  1597. ),
  1598. array(
  1599. 'type' => 'custom',
  1600. 'labelTranslate' => 'NOTICE_MESSAGE',
  1601. 'html' => '<div class="summernote" name="homepageNoticeMessageGuest">'.HOMEPAGENOTICEMESSAGEGUEST.'</div>',
  1602. ),
  1603. ),
  1604. ),
  1605. array(
  1606. 'title' => 'Ombi',
  1607. 'id' => 'ombiSettings',
  1608. 'image' => 'images/ombi.png',
  1609. 'fields' => array(
  1610. array(
  1611. 'type' => $userSelectType,
  1612. 'labelTranslate' => 'SHOW_ON_HOMEPAGE',
  1613. 'name' => 'ombiAuth',
  1614. 'value' => OMBIAUTH,
  1615. 'options' => $userTypes,
  1616. ),
  1617. array(
  1618. 'type' => 'text',
  1619. 'placeholder' => 'http://hostname:5000',
  1620. 'labelTranslate' => 'OMBI_URL',
  1621. 'assist' => 'http://hostname:5000 | http://hostname/ombi | http://hostname:5000/ombi',
  1622. 'name' => 'ombiURL',
  1623. 'pattern' => $urlPattern,
  1624. 'value' => OMBIURL,
  1625. ),
  1626. array(
  1627. 'type' => 'text',
  1628. 'placeholder' => randString(32),
  1629. 'labelTranslate' => 'OMBI_KEY',
  1630. 'name' => 'ombiKey',
  1631. 'value' => OMBIKEY,
  1632. ),
  1633. array(
  1634. 'type' => $userSelectType,
  1635. 'labelTranslate' => 'REQUEST_REFRESH',
  1636. 'name' => 'requestRefresh',
  1637. 'value' => REQUESTREFRESH,
  1638. 'options' => $refreshSeconds,
  1639. ),
  1640. array(
  1641. 'type' => 'checkbox',
  1642. 'labelTranslate' => 'REQUESTED_ONLY',
  1643. 'name' => 'requestedUserOnly',
  1644. 'value' => REQUESTEDUSERONLY,
  1645. ),
  1646. array(
  1647. 'type' => 'custom',
  1648. 'html' => '<h2>Requires Ombi V3.0.2165 & Above</h2>',
  1649. ),
  1650. ),
  1651. ),
  1652. array(
  1653. 'title' => 'Speed Test',
  1654. 'id' => 'speedTestSettings',
  1655. 'image' => 'images/settings/full-color/png/64px/speedometer.png',
  1656. 'fields' => array(
  1657. array(
  1658. 'type' => $userSelectType,
  1659. 'labelTranslate' => 'SHOW_ON_HOMEPAGE',
  1660. 'name' => 'speedtestAuth',
  1661. 'value' => SPEEDTESTAUTH,
  1662. 'options' => $userTypes,
  1663. ),
  1664. array(
  1665. 'type' => 'checkbox',
  1666. 'labelTranslate' => 'SPEED_TEST',
  1667. 'name' => 'speedTest',
  1668. 'value' => SPEEDTEST,
  1669. ),
  1670. array(
  1671. 'type' => 'custom',
  1672. 'html' => '<button id="open-speedtest" box="speed-box" type="button" class="btn waves btn-labeled btn-success btn-sm text-uppercase waves-effect waves-float"><span class="btn-label"><i class="fa fa-star"></i></span> History</button>',
  1673. 'name' => 'speed_test_history',
  1674. 'value' => '',
  1675. ),
  1676. ),
  1677. ),
  1678. array(
  1679. 'title' => 'Custom HTML 1',
  1680. 'id' => 'customhtml1',
  1681. 'image' => 'images/html.png',
  1682. 'fields' => array(
  1683. array(
  1684. 'type' => $userSelectType,
  1685. 'labelTranslate' => 'SHOW_ON_HOMEPAGE',
  1686. 'name' => 'homepageCustomHTML1Auth',
  1687. 'value' => HOMEPAGECUSTOMHTML1AUTH,
  1688. 'options' => $userTypes,
  1689. ),
  1690. array(
  1691. 'type' => 'textarea',
  1692. 'labelTranslate' => 'CUSTOMHTML',
  1693. 'name' => 'homepageCustomHTML1',
  1694. 'value' => HOMEPAGECUSTOMHTML1,
  1695. 'rows' => 15,
  1696. 'style' => 'background: #000; color: #FFF;',
  1697. ),
  1698. ),
  1699. ),
  1700. array(
  1701. 'title' => 'Homepage Arrangement',
  1702. 'id' => 'homepageArrangement',
  1703. 'image' => 'images/settings/full-color/png/64px/news.png',
  1704. 'fields' => array(
  1705. array(
  1706. 'type' => 'custom',
  1707. 'html' => buildHomepageSettings(),
  1708. ),
  1709. ),
  1710. ),
  1711. ),
  1712. )
  1713. );
  1714. ?>
  1715. </div>
  1716. <div class="email-content advanced-box white-bg">
  1717. <?php
  1718. $backendOptions = array();
  1719. foreach (array_filter(get_defined_functions()['user'],function($v) { return strpos($v, 'plugin_auth_') === 0; }) as $value) {
  1720. $name = str_replace('plugin_auth_','',$value);
  1721. if (strpos($name, 'disabled') === false) {
  1722. $backendOptions[ucwords(str_replace('_',' ',$name))] = $name;
  1723. } else {
  1724. $backendOptions[$value()] = array(
  1725. 'value' => randString(),
  1726. 'disabled' => true,
  1727. );
  1728. }
  1729. }
  1730. ksort($backendOptions);
  1731. $emailTemplates = array(
  1732. array(
  1733. 'type' => 'inputbox',
  1734. 'name' => 'emailTempateLogo',
  1735. 'value' => emailTempateLogo,
  1736. ),
  1737. array(
  1738. 'type' => 'template',
  1739. 'title' => 'Password Reset',
  1740. 'variables' => array('{user}','{domain}','{fullDomain}','{password}'),
  1741. 'subject' => emailTemplateResetPasswordSubject,
  1742. 'body' => emailTemplateResetPassword,
  1743. 'template' => 'emailTemplateResetPassword',
  1744. ),
  1745. array(
  1746. 'type' => 'template',
  1747. 'title' => 'New Registration',
  1748. 'variables' => array('{user}','{domain}','{fullDomain}'),
  1749. 'subject' => emailTemplateRegisterUserSubject,
  1750. 'body' => emailTemplateRegisterUser,
  1751. 'template' => 'emailTemplateRegisterUser',
  1752. ),
  1753. array(
  1754. 'type' => 'template',
  1755. 'title' => 'Invite User',
  1756. 'variables' => array('{user}','{domain}','{fullDomain}','{inviteCode}'),
  1757. 'subject' => emailTemplateInviteUserSubject,
  1758. 'body' => emailTemplateInviteUser,
  1759. 'template' => 'emailTemplateInviteUser',
  1760. ),
  1761. array(
  1762. 'type' => 'templateCustom',
  1763. 'title' => emailTemplateCustomOneName,
  1764. 'variables' => array('{domain}','{fullDomain}'),
  1765. 'subject' => emailTemplateCustomOneSubject,
  1766. 'body' => emailTemplateCustomOne,
  1767. 'template' => 'emailTemplateCustomOne',
  1768. ),
  1769. array(
  1770. 'type' => 'templateCustom',
  1771. 'title' => emailTemplateCustomTwoName,
  1772. 'variables' => array('{domain}','{fullDomain}'),
  1773. 'subject' => emailTemplateCustomTwoSubject,
  1774. 'body' => emailTemplateCustomTwo,
  1775. 'template' => 'emailTemplateCustomTwo',
  1776. ),
  1777. array(
  1778. 'type' => 'templateCustom',
  1779. 'title' => emailTemplateCustomThreeName,
  1780. 'variables' => array('{domain}','{fullDomain}'),
  1781. 'subject' => emailTemplateCustomThreeSubject,
  1782. 'body' => emailTemplateCustomThree,
  1783. 'template' => 'emailTemplateCustomThree',
  1784. ),
  1785. array(
  1786. 'type' => 'templateCustom',
  1787. 'title' => emailTemplateCustomFourName,
  1788. 'variables' => array('{domain}','{fullDomain}'),
  1789. 'subject' => emailTemplateCustomFourSubject,
  1790. 'body' => emailTemplateCustomFour,
  1791. 'template' => 'emailTemplateCustomFour',
  1792. ),
  1793. );
  1794. echo buildSettings(
  1795. array(
  1796. 'title' => 'Advanced Settings',
  1797. 'id' => 'advanced_settings',
  1798. 'onready' => '$(\'#authType_id\').trigger(\'change\')',
  1799. 'tabs' => array(
  1800. array(
  1801. 'title' => 'Backend Authentication',
  1802. 'id' => 'be_auth',
  1803. 'image' => 'images/security.png',
  1804. 'fields' => array(
  1805. array(
  1806. 'type' => 'select',
  1807. 'labelTranslate' => 'AUTHTYPE',
  1808. 'name' => 'authType',
  1809. 'value' => AUTHTYPE,
  1810. 'onchange' => 'if (this.value == \'internal\') { $(\'.be-auth, #authBackend_id, #authBackendCreate_id\').parent().hide(); } else { $(\'#authBackend_id, #authBackendCreate_id\').trigger(\'change\').parent().show(); }if (this.value == \'external\') { alert(\'ATTENTION! Before using this option, Make sure that the ADMIN account that you setup matches at least one username on your external backend. Otherwide you will lose Admin functionality. If something messes up, edit config/config.php and change authType to either internal or both.\') } ',
  1811. 'options' => array(
  1812. 'Organizr' => 'internal',
  1813. (AUTHBACKEND) ? 'Organizr & '.ucwords(AUTHBACKEND) : 'Organizr & Backend' => 'both',
  1814. (AUTHBACKEND) ? ucwords(AUTHBACKEND)." Only" : "Backend Only" => 'external',
  1815. ),
  1816. ),
  1817. array(
  1818. 'type' => 'select',
  1819. 'labelTranslate' => 'AUTHBACKEND',
  1820. 'name' => 'authBackend',
  1821. 'onchange' => '$(\'.be-auth\').each(function() { $(this).parent().hide(); }); $(\'.be-auth-\'+this.value).each(function() { $(this).parent().show(); });',
  1822. 'value' => AUTHBACKEND,
  1823. 'options' => $backendOptions,
  1824. ),
  1825. array(
  1826. 'type' => 'select',
  1827. 'labelTranslate' => 'AUTHBACKENDCREATE',
  1828. 'name' => 'authBackendCreate',
  1829. 'value' => AUTHBACKENDCREATE,
  1830. 'options' => array(
  1831. translate('YES_CREATE') => 'true',
  1832. translate('NO_CREATE') => 'false',
  1833. ),
  1834. ),
  1835. array(
  1836. 'type' => 'text',
  1837. 'placeholder' => 'http://hostname:8181',
  1838. 'labelTranslate' => 'AUTHBACKENDHOST',
  1839. 'assist' => 'http(s)://hostname:8181 | Ldap(s)://localhost:389 | ftp(s)://localhost:21',
  1840. 'name' => 'authBackendHost',
  1841. 'class' => 'be-auth be-auth-ftp be-auth-ldap',
  1842. 'pattern' => '((?:[hH][tT][tT][pP]|[lL][dD][aA][pP]|[fF][tT][pP])[sS]?):\/\/([\w\.]{1,250})(?::(\d{1,5}))?((?:\/[^?.\s]+))?',
  1843. 'value' => AUTHBACKENDHOST,
  1844. ),
  1845. array(
  1846. 'type' => 'text',
  1847. 'placeholder' => 'domain',
  1848. 'labelTranslate' => 'AUTHBACKENDDOMAIN',
  1849. 'name' => 'authBackendDomain',
  1850. 'class' => 'be-auth be-auth-ldap',
  1851. 'value' => AUTHBACKENDDOMAIN,
  1852. ),
  1853. array(
  1854. 'type' => 'text',
  1855. 'placeholder' => 'domain & format',
  1856. 'labelTranslate' => 'AUTHBACKENDDOMAINFORMAT',
  1857. 'name' => 'authBackendDomainFormat',
  1858. 'class' => 'be-auth be-auth-ldap',
  1859. 'value' => AUTHBACKENDDOMAINFORMAT,
  1860. ),
  1861. array(
  1862. 'type' => 'text',
  1863. 'placeholder' => 'http://hostname:8096/emby',
  1864. 'labelTranslate' => 'EMBY_URL',
  1865. 'assist' => 'http://hostname:8096 | https://hostname/emby | http://hostname:8096/emby',
  1866. 'class' => 'be-auth be-auth-emby_local be-auth-emby_all be-auth-emby_connect',
  1867. 'name' => 'embyURL',
  1868. 'pattern' => $urlPattern,
  1869. 'value' => EMBYURL,
  1870. ),
  1871. array(
  1872. 'type' => 'text',
  1873. 'placeholder' => randString(32),
  1874. 'labelTranslate' => 'EMBY_TOKEN',
  1875. 'name' => 'embyToken',
  1876. 'class' => 'be-auth be-auth-emby_all be-auth-emby_connect',
  1877. 'pattern' => '[a-zA-Z0-9]{32}',
  1878. 'value' => EMBYTOKEN,
  1879. ),
  1880. array(
  1881. 'type' => 'text',
  1882. 'labelTranslate' => 'PLEX_USERNAME',
  1883. 'name' => 'plexUsername',
  1884. 'class' => 'be-auth be-auth-plex',
  1885. 'value' => PLEXUSERNAME,
  1886. ),
  1887. array(
  1888. 'type' => 'password',
  1889. 'labelTranslate' => 'PLEX_PASSWORD',
  1890. 'name' => 'plexPassword',
  1891. 'class' => 'be-auth be-auth-plex',
  1892. 'value' => (empty(PLEXPASSWORD)?'':randString(20)),
  1893. 'autocomplete' => 'new-password',
  1894. ),
  1895. array(
  1896. 'type' => 'text',
  1897. 'labelTranslate' => 'ORGANIZR_API_KEY',
  1898. 'name' => 'organizrAPI',
  1899. 'value' => ORGANIZRAPI,
  1900. ),
  1901. array(
  1902. 'type' => 'button',
  1903. 'id' => 'generateAPI',
  1904. 'labelTranslate' => 'GENERATE_API_KEY',
  1905. 'icon' => 'key',
  1906. 'onclick' => 'var code = generateCode(); $(\'#organizrAPI_id\').val(code); $(\'#organizrAPI_id\').attr(\'data-changed\', \'true\');',
  1907. ),
  1908. ),
  1909. ),
  1910. array(
  1911. 'title' => 'Super Advanced',
  1912. 'id' => 'super_advanced',
  1913. 'image' => 'images/gear.png',
  1914. 'fields' => array(
  1915. array(
  1916. 'type' => 'text',
  1917. 'placeholder' => '/home/www-data/',
  1918. 'labelTranslate' => 'DATABASE_PATH',
  1919. 'name' => 'database_Location',
  1920. 'value' => DATABASE_LOCATION,
  1921. ),
  1922. array(
  1923. 'type' => 'select',
  1924. 'labelTranslate' => 'SET_TIMEZONE',
  1925. 'name' => 'timezone',
  1926. 'value' => TIMEZONE,
  1927. 'options' => timezoneOptions(),
  1928. ),
  1929. array(
  1930. 'type' => 'text',
  1931. 'labelTranslate' => 'REGISTER_PASSWORD',
  1932. 'name' => 'registerPassword',
  1933. 'value' => REGISTERPASSWORD,
  1934. ),
  1935. array(
  1936. 'type' => 'text',
  1937. 'labelTranslate' => 'COOKIE_DOMAIN',
  1938. 'name' => 'domain',
  1939. 'value' => DOMAIN,
  1940. ),
  1941. array(
  1942. 'type' => 'password',
  1943. 'labelTranslate' => 'COOKIE_PASSWORD',
  1944. 'name' => 'cookiePassword',
  1945. 'value' => (empty(COOKIEPASSWORD)?'':randString(20)),
  1946. 'autocomplete' => 'new-password',
  1947. ),
  1948. array(
  1949. 'type' => 'text',
  1950. 'labelTranslate' => 'IPINFO_TOKEN',
  1951. 'name' => 'ipInfoToken',
  1952. 'value' => IPINFOTOKEN,
  1953. ),
  1954. array(
  1955. 'type' => 'select',
  1956. 'labelTranslate' => 'GIT_BRANCH',
  1957. 'placeholder' => 'Default: \'master\' - Development: \'develop\' OR \'cero-dev\'',
  1958. 'id' => 'git_branch_id',
  1959. 'name' => 'git_branch',
  1960. 'value' => GIT_BRANCH,
  1961. 'options' => $branchTypes,
  1962. ),
  1963. array(
  1964. array(
  1965. 'type' => 'checkbox',
  1966. 'labelTranslate' => 'GIT_CHECK',
  1967. 'name' => 'git_check',
  1968. 'value' => GIT_CHECK,
  1969. ),
  1970. array(
  1971. 'type' => 'button',
  1972. 'id' => 'gitForceInstall',
  1973. 'style' => (extension_loaded("ZIP")) ? "" : "display : none",
  1974. 'labelTranslate' => 'GIT_FORCE',
  1975. 'icon' => 'gear',
  1976. 'onclick' => 'if ($(\'#git_branch_id[data-changed]\').length) { alert(\'Branch was altered, save settings first!\') } else { if (confirm(\''.translate('GIT_FORCE_CONFIRM').'\')) { performUpdate(); ajax_request(\'POST\', \'forceBranchInstall\'); } }',
  1977. ),
  1978. ),
  1979. ),
  1980. ),
  1981. array(
  1982. 'title' => 'Mail Settings',
  1983. 'id' => 'mail_settings',
  1984. 'image' => 'images/mail.png',
  1985. 'fields' => array(
  1986. array(
  1987. 'type' => 'text',
  1988. 'placeholder' => 'mail.provider.com',
  1989. 'labelTranslate' => 'SMTP_HOST',
  1990. 'name' => 'smtpHost',
  1991. 'pattern' => '([\w\.\-]{1,250})',
  1992. 'value' => SMTPHOST,
  1993. ),
  1994. array(
  1995. 'type' => 'number',
  1996. 'placeholder' => 'port # i.e. 465',
  1997. 'labelTranslate' => 'SMTP_HOST_PORT',
  1998. 'name' => 'smtpHostPort',
  1999. 'value' => SMTPHOSTPORT,
  2000. ),
  2001. array(
  2002. 'type' => 'text',
  2003. 'labelTranslate' => 'SMTP_HOST_USERNAME',
  2004. 'name' => 'smtpHostUsername',
  2005. 'value' => SMTPHOSTUSERNAME,
  2006. ),
  2007. array(
  2008. 'type' => 'password',
  2009. 'labelTranslate' => 'SMTP_HOST_PASSWORD',
  2010. 'name' => 'smtpHostPassword',
  2011. 'value' => (empty(SMTPHOSTPASSWORD)?'':randString(20)),
  2012. 'autocomplete' => 'new-password',
  2013. ),
  2014. array(
  2015. 'type' => 'text',
  2016. 'labelTranslate' => 'SMTP_HOST_SENDER_NAME',
  2017. 'name' => 'smtpHostSenderName',
  2018. 'value' => SMTPHOSTSENDERNAME,
  2019. ),
  2020. array(
  2021. 'type' => 'text',
  2022. 'labelTranslate' => 'SMTP_HOST_SENDER_EMAIL',
  2023. 'name' => 'smtpHostSenderEmail',
  2024. 'value' => SMTPHOSTSENDEREMAIL,
  2025. ),
  2026. array(
  2027. 'type' => 'select',
  2028. 'labelTranslate' => 'SMTP_HOST_AUTH',
  2029. 'name' => 'smtpHostType',
  2030. 'value' => SMTPHOSTTYPE,
  2031. 'options' => array(
  2032. 'ssl' => 'ssl',
  2033. 'tls' => 'tls',
  2034. 'off' => 'false',
  2035. ),
  2036. ),
  2037. array(
  2038. array(
  2039. 'type' => 'button',
  2040. 'labelTranslate' => 'TEST_EMAIL',
  2041. 'id' => 'testEmail',
  2042. 'icon' => 'flask',
  2043. ),
  2044. array(
  2045. 'type' => 'checkbox',
  2046. 'labelTranslate' => 'SMTP_HOST_AUTH',
  2047. 'name' => 'smtpHostAuth',
  2048. 'value' => SMTPHOSTAUTH,
  2049. ),
  2050. array(
  2051. 'type' => 'checkbox',
  2052. 'labelTranslate' => 'ENABLE_MAIL',
  2053. 'name' => 'enableMail',
  2054. 'value' => ENABLEMAIL,
  2055. ),
  2056. ),
  2057. array(
  2058. 'type' => 'custom',
  2059. 'html' => '<h2>Custom Mail Options</h2>',
  2060. ),
  2061. array(
  2062. array(
  2063. 'type' => 'custom',
  2064. 'html' => buildAccordion($emailTemplates),
  2065. ),
  2066. array(
  2067. 'type' => 'textarea',
  2068. 'name' => 'emailTemplateCSS',
  2069. 'value' => emailTemplateCSS,
  2070. 'labelTranslate' => 'EDIT_CUSTOM_CSS',
  2071. 'placeholder' => 'Please Include <style></style> tags',
  2072. 'rows' => 25,
  2073. 'style' => 'background: #000; color: #FFF;',
  2074. ),
  2075. ),
  2076. ),
  2077. ),
  2078. array(
  2079. 'title' => 'Advanced Visual',
  2080. 'id' => 'advanced_visual',
  2081. 'image' => 'images/paint.png',
  2082. 'fields' => array(
  2083. array(
  2084. 'type' => 'text',
  2085. 'format' => 'text',
  2086. 'labelTranslate' => 'INSTALLED_THEME',
  2087. 'name' => 'installedTheme',
  2088. 'id' => 'installedTheme',
  2089. 'class' => 'text-center',
  2090. 'placeholder' => (empty(INSTALLEDTHEME)?'No Theme Installed':INSTALLEDTHEME),
  2091. 'value' => INSTALLEDTHEME,
  2092. 'disabled' => true,
  2093. ),
  2094. array(
  2095. 'type' => 'text',
  2096. 'placeholder' => 'images/organizr.png',
  2097. 'labelTranslate' => 'LOADING_ICON_URL',
  2098. 'name' => 'loadingIcon',
  2099. 'value' => LOADINGICON,
  2100. ),
  2101. array(
  2102. 'type' => 'text',
  2103. 'placeholder' => 'images/organizr.png',
  2104. 'labelTranslate' => 'LOGO_URL_TITLE',
  2105. 'name' => 'titleLogo',
  2106. 'value' => TITLELOGO,
  2107. ),
  2108. array(
  2109. 'type' => 'select',
  2110. 'labelTranslate' => 'NOTIFICATION_TYPE',
  2111. 'name' => 'notifyEffect',
  2112. 'onchange' => 'parent.notify(\'This is an example popup!\', \'bullhorn\', \'success\', 4000, this.value.split(\'-\')[0], this.value.split(\'-\')[1]);',
  2113. 'value' => NOTIFYEFFECT,
  2114. 'options' => array(
  2115. 'Slide From Top' => 'bar-slidetop',
  2116. 'Exploader From Top' => 'bar-exploader',
  2117. 'Flip' => 'attached-flip',
  2118. 'Bouncy Flip' => 'attached-bouncyflip',
  2119. 'Growl Scale' => 'growl-scale',
  2120. 'Growl Genie' => 'growl-genie',
  2121. 'Growl Jelly' => 'growl-jelly',
  2122. 'Growl Slide' => 'growl-slide',
  2123. 'Spinning Box' => 'other-boxspinner',
  2124. 'Sliding' => 'other-thumbslider',
  2125. ),
  2126. ),
  2127. array(
  2128. array(
  2129. 'type' => 'checkbox',
  2130. 'labelTranslate' => 'ENABLE_SPLASH_SCREEN',
  2131. 'name' => 'splash',
  2132. 'value' => SPLASH,
  2133. ),
  2134. array(
  2135. 'type' => $userSelectType,
  2136. 'labelTranslate' => 'MINIMUM_SPLASH_ACCESS',
  2137. 'name' => 'splashAuth',
  2138. 'value' => SPLASHAUTH,
  2139. 'options' => $userTypes,
  2140. ),
  2141. ),
  2142. array(
  2143. array(
  2144. 'type' => 'checkbox',
  2145. 'labelTranslate' => 'ENABLE_LOADING_SCREEN',
  2146. 'name' => 'loadingScreen',
  2147. 'value' => LOADINGSCREEN,
  2148. ),
  2149. array(
  2150. 'type' => 'checkbox',
  2151. 'labelTranslate' => 'ENABLE_SLIMBAR',
  2152. 'name' => 'slimBar',
  2153. 'value' => SLIMBAR,
  2154. ),
  2155. array(
  2156. 'type' => 'checkbox',
  2157. 'labelTranslate' => 'GRAVATAR',
  2158. 'name' => 'gravatar',
  2159. 'value' => GRAVATAR,
  2160. ),
  2161. ),
  2162. ),
  2163. ),
  2164. array(
  2165. 'title' => 'Chat Settings',
  2166. 'id' => 'chat_settings',
  2167. 'image' => 'images/settings/full-color/png/64px/chat.png',
  2168. 'fields' => array(
  2169. array(
  2170. 'type' => $userSelectType,
  2171. 'labelTranslate' => 'CHAT_AUTH',
  2172. 'name' => 'chatAuth',
  2173. 'value' => CHATAUTH,
  2174. 'options' => $userTypes,
  2175. 'disabled' => (!extension_loaded('sqlite3')) ? true : false,
  2176. ),
  2177. array(
  2178. 'type' => 'checkbox',
  2179. 'labelTranslate' => (!extension_loaded('sqlite3')) ? 'SQLITE_NOT_INSTALLED' : 'ENABLE_CHAT',
  2180. 'name' => 'chat',
  2181. 'value' => CHAT,
  2182. 'disabled' => (!extension_loaded('sqlite3')) ? true : false,
  2183. ),
  2184. array(
  2185. 'type' => 'button',
  2186. 'id' => 'deleteChat',
  2187. 'labelTranslate' => 'DELETE_CHAT_DATABASE',
  2188. 'icon' => 'trash',
  2189. 'onclick' => 'ajax_request(\'POST\', \'deleteChat\');',
  2190. 'class' => 'btn-warning',
  2191. 'disabled' => (!extension_loaded('sqlite3')) ? true : false,
  2192. ),
  2193. ),
  2194. ),
  2195. array(
  2196. 'title' => 'Weather Settings',
  2197. 'id' => 'weather_settings',
  2198. 'image' => 'images/settings/full-color/png/64px/weather.png',
  2199. 'fields' => array(
  2200. array(
  2201. 'type' => $userSelectType,
  2202. 'labelTranslate' => 'WEATHER_AUTH',
  2203. 'name' => 'weatherAuth',
  2204. 'value' => WEATHERAUTH,
  2205. 'options' => $userTypes,
  2206. ),
  2207. array(
  2208. 'type' => 'checkbox',
  2209. 'labelTranslate' => 'ENABLE_WEATHER',
  2210. 'name' => 'weather',
  2211. 'value' => WEATHER,
  2212. ),
  2213. ),
  2214. ),
  2215. array(
  2216. 'title' => 'Backup Settings',
  2217. 'id' => 'backup_settings',
  2218. 'image' => 'images/backup.png',
  2219. 'fields' => array(
  2220. array(
  2221. array(
  2222. 'type' => 'button',
  2223. 'labelTranslate' => 'BACKUP_NOW',
  2224. 'id' => 'backupNow',
  2225. 'icon' => 'database',
  2226. 'style' => (extension_loaded("ZIP")) ? "margin-bottom: 5px;" : "display : none",
  2227. ),
  2228. ),
  2229. array(
  2230. 'type' => 'textarea',
  2231. 'labelTranslate' => 'BACKUP_LIST',
  2232. 'name' => 'backupList',
  2233. 'value' => (extension_loaded("ZIP")) ? implode("\n",getBackups()) : "PLEASE ENABLE PHP ZIP",
  2234. 'rows' => 15,
  2235. 'style' => 'background: #000; color: #FFF;pointer-events: none',
  2236. ),
  2237. ),
  2238. ),
  2239. ),
  2240. )
  2241. );
  2242. ?>
  2243. </div>
  2244. <div class="email-content donate-box white-bg">
  2245. <div class="email-body">
  2246. <div class="email-header gray-bg">
  2247. <button type="button" class="btn btn-danger btn-sm waves close-button"><i class="fa fa-close"></i></button>
  2248. <h1>Donate To Organizr</h1>
  2249. </div>
  2250. <div class="email-inner small-box">
  2251. <div class="email-inner-section">
  2252. <div class="small-box fade in" id="donate-org">
  2253. <div class="row">
  2254. <div class="col-lg-12">
  2255. <div class="jumbotron">
  2256. <div class="container">
  2257. <h2><strong>Hey There <em class="gray"><?php echo ucwords($USER->username);?></em>,</strong></h2>
  2258. <br/>
  2259. <small>I had always said that I wouldn't take any donations for my work but some situations have changed in my life. By no means does anyone need to donate but if you choose to help out and show appreciation I would surely appreciate that very much. I do all of this for everyone and because I'm happy when i do it :)</small>
  2260. <br/><br/>
  2261. <small>I just want to take this time to thank you for even visiting this section of Organizr. Just by you clicking into this area makes me happy. Even the fact that you are still reading this makes me happy. I bet now you are wondering, why am I even still reading this... LOL, don't worry, I'm kinda laughing as I am typing this. Anywho, thank you for reading along and I hope you enjoy the rest of your day.</small>
  2262. <br/><br/>
  2263. <p class="pull-right"><i class="fa fa-heart fa-1x red loop-animation animated pulse" aria-hidden="true"></i> CauseFX</p>
  2264. </div>
  2265. </div>
  2266. </div>
  2267. </div>
  2268. <div class="row">
  2269. <div class="col-sm-6 col-lg-6">
  2270. <div class="content-box ultra-widget blue-bg" style="cursor: pointer;" onclick="window.open('https://paypal.me/causefx', '_blank')">
  2271. <div class="w-content big-box">
  2272. <div class="w-progress">
  2273. <span class="w-amount">PayPal</span>
  2274. <br>
  2275. <span class="text-uppercase w-name">Donate with PayPal</span>
  2276. </div>
  2277. <span class="w-refresh w-p-icon">
  2278. <span class="fa-stack fa-lg">
  2279. <i class="fa fa-square fa-stack-2x"></i>
  2280. <i class="fa fa-paypal blue fa-stack-1x fa-inverse"></i>
  2281. </span>
  2282. </span>
  2283. </div>
  2284. </div>
  2285. <div class="content-box ultra-widget green-bg" style="cursor: pointer;" onclick="window.open('https://cash.me/$causefx', '_blank')">
  2286. <div class="w-content big-box">
  2287. <div class="w-progress">
  2288. <span class="w-amount">Square</span>
  2289. <br>
  2290. <span class="text-uppercase w-name">Donate with Square Cash</span>
  2291. </div>
  2292. <span class="w-refresh w-p-icon">
  2293. <span class="fa-stack fa-lg">
  2294. <i class="fa fa-square fa-stack-2x"></i>
  2295. <i class="fa fa-dollar green fa-stack-1x fa-inverse"></i>
  2296. </span>
  2297. </span>
  2298. </div>
  2299. </div>
  2300. <div class="content-box ultra-widget red-bg">
  2301. <div class="w-content big-box">
  2302. <div class="w-progress">
  2303. <span class="w-amount">BitCoin</span>
  2304. <br>
  2305. <small class="text-uppercase">1JLWKsSgDDKdnLjPWbnxfQmCxi8uUohzVv</small>
  2306. </div>
  2307. <span class="w-refresh w-p-icon">
  2308. <span class="fa-stack fa-lg">
  2309. <i class="fa fa-square fa-stack-2x"></i>
  2310. <i class="fa fa-btc red fa-stack-1x fa-inverse"></i>
  2311. </span>
  2312. </span>
  2313. </div>
  2314. </div>
  2315. </div>
  2316. <div class="col-sm-6 col-lg-6">
  2317. <div class="jumbotron">
  2318. <div class="container">
  2319. <h2><strong>Want to become an <em class="gray">ORGANIZR</em> Patreon?</strong></h2>
  2320. <small>By becoming a Patreon, you will get some perks on Discord as well as other things...</small>
  2321. <br/><br/>
  2322. <small>Some of the perks are:</small>
  2323. <br/><br/>
  2324. <ul>
  2325. <li>One on One RDP Sessions</li>
  2326. <li>Help with Custom CSS</li>
  2327. <li>Feature Request Priority</li>
  2328. <li>And more..</li>
  2329. </ul>
  2330. <p class="pull-right"><a class="btn btn-default" target='_blank' href="https://www.patreon.com/organizr"><i class="fa fa-hand-o-right fa-1x red loop-animation animated pulse" aria-hidden="true"></i> Become Patreon</a></p>
  2331. </div>
  2332. </div>
  2333. </div>
  2334. </div>
  2335. </div>
  2336. </div>
  2337. </div>
  2338. </div>
  2339. </div>
  2340. <div class="email-content themes-box white-bg">
  2341. <div class="email-body">
  2342. <div class="email-header gray-bg">
  2343. <button type="button" class="btn btn-danger btn-sm waves close-button"><i class="fa fa-close"></i></button>
  2344. <h1>Themes</h1>
  2345. </div>
  2346. <div class="email-inner small-box">
  2347. <div class="email-inner-section">
  2348. <div class="small-box fade in" id="layerCakeOrg">
  2349. <div class="row">
  2350. <div class="col-lg-2">
  2351. <div class="content-box profile-sidebar box-shadow">
  2352. <img src="images/layercake.png" width="50%" style="margin-top: -10px; margin-bottom: 10px;">
  2353. <div class="profile-usermenu">
  2354. <ul class="nav" id="theme-list"></ul>
  2355. </div>
  2356. </div>
  2357. </div>
  2358. <div class="col-lg-10">
  2359. <h1 id="chooseLayer">Choose A Theme To Preview</h1>
  2360. <div class="row">
  2361. <div id="layerCakePreview" class="col-lg-10"></div>
  2362. <div id="layerCakeInfo" class="col-lg-2"></div>
  2363. </div>
  2364. </div>
  2365. </div>
  2366. </div>
  2367. </div>
  2368. </div>
  2369. </div>
  2370. </div>
  2371. <div class="email-content email-box white-bg"><!-- $('.email-box').find('.panel-body').html(); -->
  2372. <div class="email-body">
  2373. <div class="email-header gray-bg">
  2374. <button type="button" class="btn btn-danger btn-sm waves close-button"><i class="fa fa-close"></i></button>
  2375. <h1>E-Mail Users</h1>
  2376. </div>
  2377. <div class="email-inner small-box">
  2378. <div class="email-inner-section">
  2379. <div class="small-box fade in">
  2380. <div class="mail-header">
  2381. <div class="sort-todo">
  2382. <button class="btn btn-success btn-labeled waves btn-sm text-uppercase waves-effect waves-float generateEmails">
  2383. <span class="btn-label"><i class="fa fa-users"></i></span><span class="btn-text">Choose Users</span>
  2384. </button>
  2385. <button id="selectAllEmail" style="display: none;" class="btn btn-success btn-labeled waves btn-sm text-uppercase waves-effect waves-float">
  2386. <span class="btn-label"><i class="fa fa-users"></i></span><span class="btn-text">Select All</span>
  2387. </button>
  2388. <button id="sendEmail" class="btn btn-success btn-labeled waves btn-sm text-uppercase waves-effect waves-float pull-right">
  2389. <span class="btn-label"><i class="fa fa-paper-plane"></i></span><span class="btn-text">Send</span>
  2390. </button>
  2391. <div class="btn-group">
  2392. <button id="emailCustom" type="button" class="btn waves btn-labeled btn-dark btn-sm text-uppercase waves-effect waves-float dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span class="btn-label"><i class="fa fa-envelope"></i></span><span class="btn-text">Custom Email Templates</span></button>
  2393. <ul class="dropdown-menu">
  2394. <li class="dropdown-header">Choose a Template Below</li>
  2395. <li><a onclick="customEmail('one');" href="#"><?php echo emailTemplateCustomOneName; ?></a></li>
  2396. <li><a onclick="customEmail('two');" href="#"><?php echo emailTemplateCustomTwoName; ?></a></li>
  2397. <li><a onclick="customEmail('three');" href="#"><?php echo emailTemplateCustomThreeName; ?></a></li>
  2398. <li><a onclick="customEmail('four');" href="#"><?php echo emailTemplateCustomFourName; ?></a></li>
  2399. </ul>
  2400. </div>
  2401. </div>
  2402. <div style="display: none;"class="form-group" id="emailSelect">
  2403. <select multiple="true" size="10" id="email-users" class="form-control"></select>
  2404. </div>
  2405. <div class="form-group">
  2406. <input type="text" class="form-control material" id="mailTo" placeholder="To">
  2407. </div>
  2408. <div class="form-group">
  2409. <input type="text" class="form-control material" id="subject" placeholder="Subject">
  2410. </div>
  2411. </div>
  2412. <div class="summernote"></div>
  2413. </div>
  2414. </div>
  2415. </div>
  2416. </div>
  2417. </div>
  2418. <div class="email-content speed-box white-bg">
  2419. <div class="email-body">
  2420. <div class="email-header gray-bg">
  2421. <button type="button" class="btn btn-danger btn-sm waves close-button"><i class="fa fa-close"></i></button>
  2422. <h1>SpeedTest History</h1>
  2423. </div>
  2424. <div class="email-inner small-box">
  2425. <div class="email-inner-section">
  2426. <div class="small-box fade in" id="speedOrg">
  2427. <div class="row">
  2428. <div class="col-lg-12">
  2429. <div class="content-box">
  2430. <div class="content-title big-box i-block"></div>
  2431. <div class="clearfix"></div>
  2432. <div class="big-box">
  2433. <div id="morris-line" class="morris-container"></div>
  2434. </div>
  2435. </div>
  2436. </div>
  2437. </div>
  2438. <?php if(file_exists(DATABASE_LOCATION."speedtest.db")){ ?>
  2439. <div id="speedTestTable" class="table-responsive">
  2440. <table id="speedLogs" class="datatable display">
  2441. <thead>
  2442. <tr>
  2443. <th><?php echo $language->translate("DATE");?></th>
  2444. <th><?php echo $language->translate("IP");?></th>
  2445. <th><?php echo $language->translate("DOWNLOAD");?></th>
  2446. <th><?php echo $language->translate("UPLOAD");?></th>
  2447. <th><?php echo $language->translate("PING");?></th>
  2448. <th><?php echo $language->translate("JITTER");?></th>
  2449. </tr>
  2450. </thead>
  2451. <tbody><?php echo speedTestDisplay(speedTestData(),"table");?></tbody>
  2452. </table>
  2453. </div>
  2454. <?php } ?>
  2455. </div>
  2456. </div>
  2457. </div>
  2458. </div>
  2459. </div>
  2460. <div class="email-content help-box white-bg">
  2461. <div class="email-body">
  2462. <div class="email-header gray-bg">
  2463. <button type="button" class="btn btn-danger btn-sm waves close-button"><i class="fa fa-close"></i></button>
  2464. <h1>Help & Chat</h1>
  2465. </div>
  2466. <div class="email-inner small-box">
  2467. <div class="email-inner-section">
  2468. <div class="small-box fade in">
  2469. <embed style="height:calc(100vh - 100px);width:calc(100%)" src='https://titanembeds.com/embed/374648602632388610' />
  2470. </div>
  2471. </div>
  2472. </div>
  2473. </div>
  2474. </div>
  2475. <div class="email-content info-box white-bg">
  2476. <div class="email-body">
  2477. <div class="email-header gray-bg">
  2478. <button type="button" class="btn btn-danger btn-sm waves close-button"><i class="fa fa-close"></i></button>
  2479. <h1>About Organizr</h1>
  2480. </div>
  2481. <div class="email-inner small-box">
  2482. <div class="email-inner-section">
  2483. <div class="small-box fade in" id="about">
  2484. <h4><img src="images/organizr-logo-h-d.png" height="50px"></h4>
  2485. <p id="version"></p>
  2486. <p id="submitFeedback">
  2487. <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>
  2488. <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>
  2489. <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>
  2490. <a href='https://discord.gg/XvbT6nz' 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>
  2491. <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>
  2492. <!--<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>-->
  2493. </p>
  2494. <div class="modal fade Help-Me-modal-lg" tabindex="-1" role="dialog">
  2495. <div class="modal-dialog modal-lg" role="document">
  2496. <div class="modal-content" style="color: <?php echo $topbartext;?> !important; background: <?php echo $topbar;?> !important;">
  2497. <div class="modal-header">
  2498. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  2499. <h4 class="modal-title"><?php echo $language->translate("HELP");?>!</h4>
  2500. </div>
  2501. <div class="modal-body" style="background: <?php echo $sidebar;?> !important;">
  2502. <div style="margin-bottom: 0px;" class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
  2503. <div style="color: <?php echo $topbartext;?> !important; background: <?php echo $topbar;?> !important;" class="panel panel-default">
  2504. <div class="panel-heading" role="tab" id="headingOne">
  2505. <h4 class="panel-title" style="text-decoration: none;" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
  2506. <?php echo $language->translate("ADDING_TABS");?>
  2507. </h4>
  2508. </div>
  2509. <div id="collapseOne" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne" aria-expanded="true">
  2510. <div class="panel-body">
  2511. <p><?php echo $language->translate("START_ADDING_TABS");?></p>
  2512. <ul>
  2513. <li><strong><?php echo $language->translate("TAB_URL");?></strong> <?php echo $language->translate("TAB_URL_ABOUT");?></li>
  2514. <li><strong><?php echo $language->translate("ICON_URL");?></strong> <?php echo $language->translate("ICON_URL_ABOUT");?></li>
  2515. <li><strong><?php echo $language->translate("DEFAULT");?></strong> <?php echo $language->translate("DEFAULT_ABOUT");?></li>
  2516. <li><strong><?php echo $language->translate("ACTIVE");?></strong> <?php echo $language->translate("ACTIVE_ABOUT");?></li>
  2517. <li><strong><?php echo $language->translate("USER");?></strong> <?php echo $language->translate("USER_ABOUT");?></li>
  2518. <li><strong><?php echo $language->translate("GUEST");?></strong> <?php echo $language->translate("GUEST_ABOUT");?></li>
  2519. <li><strong><?php echo $language->translate("NO_IFRAME");?></strong> <?php echo $language->translate("NO_IFRAME_ABOUT");?></li>
  2520. </ul>
  2521. </div>
  2522. </div>
  2523. </div>
  2524. <div style="color: <?php echo $topbartext;?> !important; background: <?php echo $topbar;?> !important;" class="panel panel-default">
  2525. <div class="panel-heading" role="tab" id="headingTwo">
  2526. <h4 class="panel-title" style="text-decoration: none;" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="true" aria-controls="collapseTwo">
  2527. <?php echo $language->translate("QUICK_ACCESS");?>
  2528. </h4>
  2529. </div>
  2530. <div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo" aria-expanded="true">
  2531. <div class="panel-body">
  2532. <p><?php echo $language->translate("QUICK_ACCESS_ABOUT");?> <mark><?php echo getServerPath(); ?>#Sonarr</mark></p>
  2533. </div>
  2534. </div>
  2535. </div>
  2536. <div style="color: <?php echo $topbartext;?> !important; background: <?php echo $topbar;?> !important;" class="panel panel-default">
  2537. <div class="panel-heading" role="tab" id="headingThree">
  2538. <h4 class="panel-title" style="text-decoration: none;" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseThree" aria-expanded="true" aria-controls="collapseThree">
  2539. <?php echo $language->translate("SIDE_BY_SIDE");?>
  2540. </h4>
  2541. </div>
  2542. <div id="collapseThree" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingThree" aria-expanded="true">
  2543. <div class="panel-body">
  2544. <p><?php echo $language->translate("SIDE_BY_SIDE_ABOUT");?></p>
  2545. <ul>
  2546. <li><?php echo $language->translate("SIDE_BY_SIDE_INSTRUCTIONS1");?></li>
  2547. <li><?php echo $language->translate("SIDE_BY_SIDE_INSTRUCTIONS2");?> [<i class='mdi mdi-refresh'></i>]</li>
  2548. <li><?php echo $language->translate("SIDE_BY_SIDE_INSTRUCTIONS3");?></li>
  2549. </ul>
  2550. </div>
  2551. </div>
  2552. </div>
  2553. <div style="color: <?php echo $topbartext;?> !important; background: <?php echo $topbar;?> !important;" class="panel panel-default">
  2554. <div class="panel-heading" role="tab" id="headingFour">
  2555. <h4 class="panel-title" style="text-decoration: none;" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseFour" aria-expanded="true" aria-controls="collapseFour">
  2556. <?php echo $language->translate("KEYBOARD_SHORTCUTS");?>
  2557. </h4>
  2558. </div>
  2559. <div id="collapseFour" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingFour" aria-expanded="true">
  2560. <div class="panel-body">
  2561. <p><?php echo $language->translate("KEYBOARD_SHORTCUTS_ABOUT");?></p>
  2562. <ul>
  2563. <li><keyboard class="key"><span>S</span></keyboard> + <keyboard class="key"><span>S</span></keyboard> <?php echo $language->translate("KEYBOARD_INSTRUCTIONS1");?></li>
  2564. <li><keyboard class="key"><span>F</span></keyboard> + <keyboard class="key"><span>F</span></keyboard> <?php echo $language->translate("KEYBOARD_INSTRUCTIONS6");?></li>
  2565. <li><keyboard class="key"><span>P</span></keyboard> + <keyboard class="key"><span>P</span></keyboard> <?php echo $language->translate("KEYBOARD_INSTRUCTIONS7");?></li>
  2566. <li><keyboard class="key"><span>M</span></keyboard> + <keyboard class="key"><span>M</span></keyboard> <?php echo $language->translate("KEYBOARD_INSTRUCTIONS8");?></li>
  2567. <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>
  2568. <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>
  2569. <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>
  2570. <li><keyboard class="key wide"><span>Esc</span></keyboard> + <keyboard class="key wide"><span>Esc</span></keyboard> <?php echo $language->translate("KEYBOARD_INSTRUCTIONS4");?></li>
  2571. </ul>
  2572. </div>
  2573. </div>
  2574. </div>
  2575. <div style="color: <?php echo $topbartext;?> !important; background: <?php echo $topbar;?> !important;" class="panel panel-default">
  2576. <div class="panel-heading" role="tab" id="headingFive">
  2577. <h4 class="panel-title" style="text-decoration: none;" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseFive" aria-expanded="true" aria-controls="collapseFive">
  2578. <?php echo $language->translate("TAB_NOT_LOADING");?>
  2579. </h4>
  2580. </div>
  2581. <div id="collapseFive" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingFive" aria-expanded="true">
  2582. <div class="panel-body">
  2583. <p><?php echo $language->translate("TAB_NOT_LOADING_ABOUT");?></p>
  2584. <?php
  2585. 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>";
  2586. 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>";
  2587. else : echo "Sorry, currently there is no other alternative for " . get_browser_name(); endif;
  2588. ?>
  2589. </div>
  2590. </div>
  2591. </div>
  2592. <div style="color: <?php echo $topbartext;?> !important; background: <?php echo $topbar;?> !important;" class="panel panel-default">
  2593. <div class="panel-heading" role="tab" id="headingSix">
  2594. <h4 class="panel-title" style="text-decoration: none;" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseSix" aria-expanded="true" aria-controls="collapseSix">
  2595. <?php echo $language->translate("USER_ICONS");?>
  2596. </h4>
  2597. </div>
  2598. <div id="collapseSix" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingSix" aria-expanded="true">
  2599. <div class="panel-body">
  2600. <p><?php echo $language->translate("USER_ICONS_ABOUT");?> <a href="http://gravatar.com" target="_blank">gravatar.com</a></p>
  2601. </div>
  2602. </div>
  2603. </div>
  2604. <div style="color: <?php echo $topbartext;?> !important; background: <?php echo $topbar;?> !important;" class="panel panel-default">
  2605. <div class="panel-heading" role="tab" id="headingSeven">
  2606. <h4 class="panel-title" style="text-decoration: none;" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseSeven" aria-expanded="true" aria-controls="collapseSeven">
  2607. <?php echo $language->translate("TRANSLATIONS");?>
  2608. </h4>
  2609. </div>
  2610. <div id="collapseSeven" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingSeven" aria-expanded="true">
  2611. <div class="panel-body">
  2612. <p><?php echo $language->translate("TRANSLATIONS_ABOUT");?> <a href="https://github.com/causefx/Organizr/tree/v1-develop/lang" target="_blank">Github Develop Branch</a></p>
  2613. </div>
  2614. </div>
  2615. </div>
  2616. </div>
  2617. </div>
  2618. <div class="modal-footer">
  2619. <button type="button" class="btn special" style="background: transparent !important;color: transparent !important;">Special</button>
  2620. <button type="button" class="btn btn-default waves" data-dismiss="modal"><?php echo $language->translate("CLOSE");?></button>
  2621. </div>
  2622. </div>
  2623. </div>
  2624. </div>
  2625. <p id="whatsnew"></p>
  2626. <p id="downloadnow"></p>
  2627. <div id="deleteDiv" style="display: none;" class="panel panel-danger">
  2628. <div class="panel-heading">
  2629. <h3 class="panel-title"><?php echo $language->translate("DELETE_DATABASE");?></h3>
  2630. </div>
  2631. <div class="panel-body">
  2632. <div class="">
  2633. <p><?php echo $language->translate("DELETE_WARNING");?></p>
  2634. <form id="deletedb" method="post" onsubmit="ajax_request('POST', 'deleteDB'); return false;">
  2635. <button class="btn waves btn-labeled btn-danger pull-right text-uppercase waves-effect waves-float" type="submit">
  2636. <span class="btn-label"><i class="fa fa-trash"></i></span><?php echo $language->translate("DELETE_DATABASE");?>
  2637. </button>
  2638. </form>
  2639. </div>
  2640. </div>
  2641. </div>
  2642. <div class="timeline-container">
  2643. <div class="row">
  2644. <div class="col-lg-12">
  2645. <ul class="cbp_tmtimeline" id="versionHistory">
  2646. </ul>
  2647. <div class="btn-group-sm btn-group btn-group-justified">
  2648. <div id="loadMore" class="btn-group" role="group">
  2649. <button type="button" class="btn waves btn-primary waves-effect waves-float text-uppercase"><?php echo $language->translate("SHOW_MORE");?></button>
  2650. </div>
  2651. <div id="showLess" class="btn-group" role="group">
  2652. <button type="button" class="btn waves btn-warning waves-effect waves-float text-uppercase"><?php echo $language->translate("SHOW_LESS");?></button>
  2653. </div>
  2654. </div>
  2655. </div>
  2656. </div>
  2657. </div>
  2658. </div>
  2659. </div>
  2660. </div>
  2661. </div>
  2662. </div>
  2663. <div class="email-content users-box white-bg">
  2664. <div class="email-body">
  2665. <div class="email-header gray-bg">
  2666. <button type="button" class="btn btn-danger btn-sm waves close-button"><i class="fa fa-close"></i></button>
  2667. <h1>Users Management</h1>
  2668. </div>
  2669. <div class="email-inner small-box">
  2670. <div class="email-inner-section">
  2671. <div class="small-box fade in" id="useredit">
  2672. <div class="row">
  2673. <div class="col-lg-12">
  2674. <div class="small-box">
  2675. <form class="content-form form-inline" name="new user registration" id="registration" action="" method="POST">
  2676. <input type="hidden" name="op" value="register"/>
  2677. <input type="hidden" name="sha1" value=""/>
  2678. <input type="hidden" name="settings" value="true"/>
  2679. <div class="form-group">
  2680. <input type="text" class="form-control material" name="username" placeholder="<?php echo $language->translate("USERNAME");?>" autocorrect="off" autocapitalize="off" value="">
  2681. </div>
  2682. <div class="form-group">
  2683. <input type="email" class="form-control material" name="email" placeholder="<?php echo $language->translate("EMAIL");?>">
  2684. </div>
  2685. <div class="form-group">
  2686. <input type="password" class="form-control material" name="password1" placeholder="<?php echo $language->translate("PASSWORD");?>">
  2687. </div>
  2688. <div class="form-group">
  2689. <input type="password" class="form-control material" name="password2" placeholder="<?php echo $language->translate("PASSWORD_AGAIN");?>">
  2690. </div>
  2691. <button type="submit" onclick="User.processRegistration()" class="btn waves btn-labeled btn-primary btn btn-sm text-uppercase waves-effect waves-float promoteUser">
  2692. <span class="btn-label"><i class="fa fa-user-plus"></i></span><?php echo $language->translate("CREATE_USER");?>
  2693. </button>
  2694. </form>
  2695. </div>
  2696. </div>
  2697. </div>
  2698. <div class="small-box">
  2699. <form class="content-form form-inline" name="unregister" id="unregister" action="" method="POST">
  2700. <p id="inputUsername"></p>
  2701. <div class="table-responsive">
  2702. <table class="table table-striped">
  2703. <thead>
  2704. <tr>
  2705. <th>#</th>
  2706. <th><?php echo $language->translate("USERNAME");?></th>
  2707. <th><?php echo $language->translate("EMAIL");?></th>
  2708. <th><?php echo $language->translate("LOGIN_STATUS");?></th>
  2709. <th><?php echo $language->translate("LAST_SEEN");?></th>
  2710. <th><?php echo $language->translate("USER_GROUP");?></th>
  2711. <th><?php echo $language->translate("USER_ACTIONS");?></th>
  2712. </tr>
  2713. </thead>
  2714. <tbody>
  2715. <?php $countUsers = 1;
  2716. foreach($gotUsers as $row) :
  2717. if($row['role'] == "admin" && $countUsers == 1) :
  2718. $userColor = "red";
  2719. $disableAction = "disabled=\"disabled\"";
  2720. else :
  2721. $userColor = "blue";
  2722. $disableAction = "";
  2723. endif;
  2724. if($row['active'] == "true") :
  2725. $userActive = $language->translate("LOGGED_IN");
  2726. $userActiveColor = "primary";
  2727. else :
  2728. $userActive = $language->translate("LOGGED_OUT");
  2729. $userActiveColor = "danger";
  2730. endif;
  2731. $userpic = md5( strtolower( trim( $row['email'] ) ) );
  2732. if(!empty($row["last"])) :
  2733. $lastActive = date("Y-m-d H:i", intval($row["last"]));
  2734. else :
  2735. $lastActive = "";
  2736. endif;
  2737. ?>
  2738. <tr id="<?=$row['username'];?>">
  2739. <th scope="row"><?=$countUsers;?></th>
  2740. <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>
  2741. <td><input type="text" class="form-control material newemail" name="newemail" value="<?=$row['email'];?>">
  2742. <button style="display: none" class="btn btn-success btn-sm waves editUserEmail"><i class="fa fa-check"></i></button>
  2743. <button style="display: none" type="button" class="btn btn-danger btn-sm waves closeEditUserEmail"><i class="fa fa-close"></i></button>
  2744. </td>
  2745. <td><span class="label label-<?=$userActiveColor;?>"><?=$userActive;?></span></td>
  2746. <td><?=$lastActive;?></td>
  2747. <td><span class="userRole text-uppercase <?=$userColor;?>"><?=$row['role'];?></span></td>
  2748. <td id="<?=$row['username'];?>">
  2749. <button <?=$disableAction;?> class="btn waves btn-labeled btn-danger btn btn-sm text-uppercase waves-effect waves-float deleteUser">
  2750. <span class="btn-label"><i class="fa fa-user-times"></i></span><?php echo $language->translate("DELETE");?>
  2751. </button>
  2752. <?php if ($row['role'] == "user") : ?>
  2753. <button class="btn waves btn-labeled btn-success btn btn-sm text-uppercase waves-effect waves-float promoteUser">
  2754. <span class="btn-label"><i class="fa fa-arrow-up"></i></span><?php echo $language->translate("PROMOTE");?>
  2755. </button>
  2756. <?php endif; ?>
  2757. <?php if ($row['role'] == "admin") : ?>
  2758. <button <?=$disableAction;?> class="btn waves btn-labeled btn-warning btn btn-sm text-uppercase waves-effect waves-float demoteUser">
  2759. <span class="btn-label"><i class="fa fa-arrow-down"></i></span><?php echo $language->translate("DEMOTE");?>
  2760. </button>
  2761. <?php endif; ?>
  2762. </td>
  2763. </tr>
  2764. <?php $countUsers++; endforeach; ?>
  2765. </tbody>
  2766. </table>
  2767. </div>
  2768. </form>
  2769. </div>
  2770. </div>
  2771. </div>
  2772. </div>
  2773. </div>
  2774. </div>
  2775. <div class="email-content invites-box white-bg">
  2776. <div class="email-body">
  2777. <div class="email-header gray-bg">
  2778. <button type="button" class="btn btn-danger btn-sm waves close-button"><i class="fa fa-close"></i></button>
  2779. <h1>Invite Management</h1>
  2780. </div>
  2781. <div class="email-inner small-box">
  2782. <div class="email-inner-section">
  2783. <div class="small-box fade in" id="useredit">
  2784. <div class="row">
  2785. <div class="col-lg-12">
  2786. <div class="small-box">
  2787. <form class="content-form form-inline" name="inviteNewUser" id="inviteNewUser" action="" method="POST">
  2788. <input type="hidden" name="op" value="invite"/>
  2789. <input type="hidden" name="server" value="plex"/>
  2790. <div class="form-group">
  2791. <input type="text" class="form-control material" name="username" placeholder="<?php echo $language->translate("USERNAME_NAME");?>" autocorrect="off" autocapitalize="off" value="">
  2792. </div>
  2793. <div class="form-group">
  2794. <input type="email" class="form-control material" name="email" placeholder="<?php echo $language->translate("EMAIL");?>" required>
  2795. </div>
  2796. <button type="submit" class="btn waves btn-labeled btn-primary btn btn-sm text-uppercase waves-effect waves-float">
  2797. <span class="btn-label"><i class="fa fa-user-plus"></i></span><?php echo $language->translate("SEND_INVITE");?>
  2798. </button>
  2799. </form>
  2800. </div>
  2801. </div>
  2802. </div>
  2803. <div class="small-box">
  2804. <form class="content-form form-inline" name="deleteInviteForm" id="deleteInviteForm" action="" method="POST">
  2805. <p id="inputInvite"></p>
  2806. <div class="table-responsive">
  2807. <table class="table table-striped">
  2808. <thead>
  2809. <tr>
  2810. <th>#</th>
  2811. <th><?php echo $language->translate("USERNAME");?></th>
  2812. <th><?php echo $language->translate("EMAIL");?></th>
  2813. <th><?php echo $language->translate("INVITE_CODE");?></th>
  2814. <th><?php echo $language->translate("DATE_SENT");?></th>
  2815. <th><?php echo $language->translate("DATE_USED");?></th>
  2816. <th><?php echo $language->translate("USED_BY");?></th>
  2817. <th><?php echo $language->translate("IP_ADDRESS");?></th>
  2818. <th><?php echo $language->translate("VALID");?></th>
  2819. <th><?php echo $language->translate("DELETE");?></th>
  2820. </tr>
  2821. </thead>
  2822. <tbody><!-- onsubmit="return false;" -->
  2823. <?php
  2824. foreach($gotInvites as $row) :
  2825. $validColor = ($row['valid'] == "Yes" ? "primary" : "danger");
  2826. $inviteUser = ($row['username'] != "" ? $row['username'] : "N/A");
  2827. $dateInviteUsed = ($row['dateused'] != "" ? $row['dateused'] : "Not Used");
  2828. $ipUsed = ($row['ip'] != "" ? $row['ip'] : "Not Used");
  2829. $usedBy = ($row['usedby'] != "" ? $row['usedby'] : "Not Used");
  2830. ?>
  2831. <tr id="<?=$row['id'];?>">
  2832. <th scope="row"><?=$row['id'];?></th>
  2833. <td><?=$inviteUser;?></td>
  2834. <td><?=$row['email'];?></td>
  2835. <td><span style="font-size: 100%;" class="label label-<?=$validColor;?>"><?=$row['code'];?></span></td>
  2836. <td><?=$row['date'];?></td>
  2837. <td><?=$dateInviteUsed;?></td>
  2838. <td><?=$usedBy;?></td>
  2839. <td style="cursor: pointer" class="ipInfo"><?=$ipUsed;?></td>
  2840. <td><span style="font-size: 100%;" class="label label-<?=$validColor;?>"><?=$row['valid'];?></span></td>
  2841. <td id="<?=$row['id'];?>">
  2842. <button class="btn waves btn-labeled btn-danger btn btn-sm text-uppercase waves-effect waves-float deleteInvite">
  2843. <span class="btn-label"><i class="fa fa-trash"></i></span><?php echo $language->translate("DELETE");?>
  2844. </button>
  2845. </td>
  2846. </tr>
  2847. <?php endforeach; ?>
  2848. </tbody>
  2849. </table>
  2850. </div>
  2851. </form>
  2852. </div>
  2853. </div>
  2854. </div>
  2855. </div>
  2856. </div>
  2857. </div>
  2858. <div class="email-content logs-box white-bg">
  2859. <div class="email-body">
  2860. <div class="email-header gray-bg">
  2861. <button type="button" class="btn btn-danger btn-sm waves close-button"><i class="fa fa-close"></i></button>
  2862. <h1>Logs</h1>
  2863. </div>
  2864. <div class="email-inner small-box">
  2865. <div class="email-inner-section">
  2866. <div class="small-box" id="loginlog">
  2867. <div>
  2868. <?php if(file_exists(DATABASE_LOCATION."org.log")){ ?>
  2869. <button id="viewOrgLogs" class="btn waves btn-labeled gray-bg text-uppercase waves-effect waves-float" type="button"><span class="btn-label"><i class="fa fa-terminal"></i></span>Organizr Log </button>
  2870. <?php } if(file_exists(FAIL_LOG)){ ?>
  2871. <button id="viewLoginLogs" class="btn waves btn-labeled grayish-blue-bg text-uppercase waves-effect waves-float" type="button" style="display: none"><span class="btn-label"><i class="fa fa-user"></i></span>Login Log </button>
  2872. <?php } ?>
  2873. </div>
  2874. <?php if(file_exists(DATABASE_LOCATION."org.log")){ ?>
  2875. <div id="orgLogTable" class="table-responsive" style="display: none">
  2876. <table id="orgLogs" class="datatable display">
  2877. <thead>
  2878. <tr>
  2879. <th><?php echo $language->translate("DATE");?></th>
  2880. <th><?php echo $language->translate("STATUS");?></th>
  2881. <th><?php echo $language->translate("TYPE");?></th>
  2882. </tr>
  2883. </thead>
  2884. <tbody>
  2885. <?php readLog(); ?>
  2886. </tbody>
  2887. </table>
  2888. </div>
  2889. <?php } ?>
  2890. <div id="loginTable" class="table-responsive">
  2891. <?php if(file_exists(FAIL_LOG)){ ?>
  2892. <div id="loginStats">
  2893. <div class="ultra-widget">
  2894. <div class="w-progress">
  2895. <span id="goodCount" class="w-amount green"></span>
  2896. <span id="badCount" class="w-amount red pull-right">3</span>
  2897. <br>
  2898. <span class="text-uppercase w-name"><?php echo $language->translate("GOOD_LOGINS");?></span>
  2899. <span class="text-uppercase w-name pull-right"><?php echo $language->translate("BAD_LOGINS");?></span>
  2900. </div>
  2901. <div class="progress progress-bar-sm zero-m">
  2902. <div id="goodPercent" class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100" style="width: 20%"></div>
  2903. <div id="badPercent" class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="80" aria-valuemin="0" aria-valuemax="100" style="width: 80%"></div>
  2904. </div>
  2905. <div class="w-status clearfix">
  2906. <div id="goodTitle" class="w-status-title pull-left text-uppercase">20%</div>
  2907. <div id="badTitle" class="w-status-number pull-right text-uppercase">80%</div>
  2908. </div>
  2909. </div>
  2910. </div>
  2911. <table id="datatable" class="datatable display">
  2912. <thead>
  2913. <tr>
  2914. <th><?php echo $language->translate("DATE");?></th>
  2915. <th><?php echo $language->translate("USERNAME");?></th>
  2916. <th><?php echo $language->translate("IP_ADDRESS");?></th>
  2917. <th><?php echo $language->translate("TYPE");?></th>
  2918. </tr>
  2919. </thead>
  2920. <tbody>
  2921. <?php
  2922. $getFailLog = str_replace("\r\ndate", "date", file_get_contents(FAIL_LOG));
  2923. $gotFailLog = json_decode($getFailLog, true);
  2924. $goodLogin = 0;
  2925. $badLogin = 0;
  2926. function getColor($colorTest){
  2927. if($colorTest == "bad_auth") :
  2928. $gotColorTest = "danger";
  2929. elseif($colorTest == "good_auth") :
  2930. $gotColorTest = "primary";
  2931. endif;
  2932. echo $gotColorTest;
  2933. }
  2934. foreach (array_reverse($gotFailLog["auth"]) as $key => $val) :
  2935. if($val["auth_type"] == "bad_auth") : $badLogin++; elseif($val["auth_type"] == "good_auth") : $goodLogin++; endif;
  2936. ?>
  2937. <tr>
  2938. <td><?=$val["date"];?></td>
  2939. <td><?=$val["username"];?></td>
  2940. <td style="cursor: pointer" class="ipInfo"><?=$val["ip"];?></td>
  2941. <td><span class="label label-<?php getColor($val["auth_type"]);?>"><?=$val["auth_type"];?></span></td>
  2942. </tr>
  2943. <?php endforeach; ?>
  2944. </tbody>
  2945. </table>
  2946. <?php
  2947. $totalLogin = $goodLogin + $badLogin;
  2948. $goodPercent = round(($goodLogin / $totalLogin) * 100);
  2949. $badPercent = round(($badLogin / $totalLogin) * 100);
  2950. };
  2951. if(!file_exists(FAIL_LOG)){
  2952. echo $language->translate("NOTHING_LOG");
  2953. }
  2954. ?>
  2955. </div>
  2956. </div>
  2957. </div>
  2958. </div>
  2959. </div>
  2960. </div>
  2961. </div>
  2962. <!--End Content-->
  2963. <!-- Modal for IP -->
  2964. <div id="ipModal" class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog">
  2965. <div class="modal-dialog modal-lg" role="document">
  2966. <div class="modal-content">
  2967. <div class="modal-header">
  2968. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  2969. <h4 class="modal-title" id="ipIp">Modal title</h4>
  2970. </div>
  2971. <div class="modal-body">
  2972. <h3>Hostname: <small id="ipHostname"></small></h3>
  2973. <h3>Location: <small id="ipLocation"></small></h3>
  2974. <h3>Org: <small id="ipOrg"></small></h3>
  2975. <h3>City: <small id="ipCity"></small></h3>
  2976. <h3>Region: <small id="ipRegion"></small></h3>
  2977. <h3>Country: <small id="ipCountry"></small></h3>
  2978. <h3>Phone: <small id="ipPhone"></small></h3>
  2979. </div>
  2980. <div class="modal-footer">
  2981. <button type="button" class="btn btn-default waves" data-dismiss="modal">Close</button>
  2982. </div>
  2983. </div>
  2984. </div>
  2985. </div>
  2986. <!-- END IP Modal -->
  2987. <!-- Modal for Plex Token -->
  2988. <div id="plexModal" class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog">
  2989. <div class="modal-dialog modal-lg" role="document">
  2990. <div class="modal-content">
  2991. <div class="modal-header">
  2992. <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
  2993. <h4 class="modal-title"><?php echo translate("GET_PLEX_TOKEN"); ?></h4>
  2994. </div>
  2995. <div class="modal-body">
  2996. <div style="display:none" id="plexError" class=""></div>
  2997. <input class="form-control material" placeholder="<?php echo translate("USERNAME"); ?>" type="text" name="plex_username" id="plex_username" value="<?php echo PLEXUSERNAME;?>">
  2998. <input class="form-control material" placeholder="<?php echo translate("PASSWORD"); ?>" type="password" name="plex_password" id="plex_password" value="<?php echo PLEXPASSWORD;?>">
  2999. </div>
  3000. <div class="modal-footer">
  3001. <button type="button" class="btn btn-default waves" data-dismiss="modal"><?php echo translate("CLOSE"); ?></button>
  3002. <button id="getPlexToken" type="button" class="btn btn-success waves waves-effect waves-float"><?php echo translate("GET_PLEX_TOKEN"); ?></button>
  3003. </div>
  3004. </div>
  3005. </div>
  3006. </div>
  3007. <!-- END IP Modal -->
  3008. </div>
  3009. <?php if(isset($_POST['op'])) : ?>
  3010. <script>
  3011. parent.notify("<?php echo printArray($USER->info_log); ?>","info-circle","notice","5000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
  3012. <?php if(!empty($USER->error_log)) : ?>
  3013. parent.notify("<?php echo printArray($USER->error_log); ?>","exclamation-circle ","error","5000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
  3014. <?php endif; ?>
  3015. </script>
  3016. <?php endif; ?>
  3017. <script>
  3018. lazyload();
  3019. <?php echo speedTestDisplay(speedTestData(),"graph");?>
  3020. $(".settingsMenu").click(function() {
  3021. $(".settingsMenu").removeClass("settingsMenuActive");
  3022. $(this).addClass("settingsMenuActive");
  3023. $(".settingsMenu").addClass("settingsMenuInactive");
  3024. $(this).removeClass("settingsMenuInactive");
  3025. })
  3026. $(".special").click(function() {
  3027. swal({
  3028. title: "Hmmm What is This?",
  3029. text: '<p><img src="images/settings/not-so-hidden.gif"></p>',
  3030. html: true,
  3031. confirmButtonColor: "#63A8EB"
  3032. });
  3033. console.log('hmmmmm, what the hell is this section?');
  3034. })
  3035. $(".generateEmails").click(function() {
  3036. <?php if(PLEXURL != ''){
  3037. echo 'var backend = "plex";';
  3038. }elseif(EMBYURL != ''){
  3039. echo 'var backend = "emby";';
  3040. }else{
  3041. echo 'var backend = "org";';
  3042. } ?>
  3043. $('.generateEmails').text("Loading...");
  3044. ajax_request('POST', 'get-emails', {type : backend}).done(function(data){
  3045. console.log('start');
  3046. $('#email-users').html(data);
  3047. $('#emailSelect').show();
  3048. $('.generateEmails').hide();
  3049. $('#selectAllEmail').show();
  3050. });
  3051. });
  3052. $(".submitTabBtn").click(function() {
  3053. $("#submitTabs").submit();
  3054. });
  3055. $(function() {
  3056. /*$("#email-users").niceScroll({
  3057. cursorwidth: "12px",
  3058. railpadding: {top:0,right:0,left:0,bottom:0},
  3059. scrollspeed: 30,
  3060. mousescrollstep: 60,
  3061. grabcursorenabled: false,
  3062. autohidemode: false
  3063. });*/
  3064. $('#email-users').slimScroll({
  3065. width: '100%',
  3066. railVisible: true,
  3067. alwaysVisible: true,
  3068. allowPageScroll: true
  3069. });
  3070. });
  3071. $("#email-users").on('change click', function (e) {
  3072. var selected = $("#email-users").val();
  3073. $('#mailTo').val(selected);
  3074. console.log(selected);
  3075. });
  3076. $("#sendEmail").click(function() {
  3077. var to = $('#mailTo').val();
  3078. var subject = $('#subject').val();
  3079. var message = $('.email-box').find('.panel-body').html();
  3080. console.log(to);
  3081. console.log(subject);
  3082. console.log(message);
  3083. ajax_request('POST', 'mass-email', {
  3084. emailto: to,
  3085. emailsubject: subject,
  3086. emailmessage: message
  3087. });
  3088. })
  3089. $('#selectAllEmail').click(function() {
  3090. $('#email-users option').prop('selected', true);
  3091. var selected = $("#email-users").val();
  3092. $('#mailTo').val(selected);
  3093. console.log(selected);
  3094. });
  3095. //IP INFO
  3096. $(".ipInfo").click(function(){
  3097. $.getJSON("https://ipinfo.io/"+$(this).text()+"/?token=<?php echo IPINFOTOKEN;?>", function (response) {
  3098. $('#ipModal').modal('show');
  3099. $('#ipIp').text("IP Info for: "+response.ip);
  3100. $('#ipHostname').text(response.hostname);
  3101. $('#ipLocation').text(response.loc);
  3102. $('#ipOrg').text(response.org);
  3103. $('#ipCity').text(response.city);
  3104. $('#ipRegion').text(response.region);
  3105. $('#ipCountry').text(response.country);
  3106. $('#ipPhone').text(response.phone);
  3107. console.log(response);
  3108. });
  3109. });
  3110. // Plex.tv auth token fetch
  3111. $("#openPlexModal").click(function() {
  3112. $('#plexModal').modal('show');
  3113. });
  3114. $("#getPlexToken").click(function() {
  3115. $('#plexError').show();
  3116. $('#plexError').addClass("well well-sm yellow-bg");
  3117. $('#plexError').text("Grabbing Token");
  3118. var plex_username = $("#plex_username").val().trim();
  3119. var plex_password = $("#plex_password").val().trim();
  3120. if ((plex_password !== '') && (plex_password !== '')) {
  3121. $.ajax({
  3122. type: 'POST',
  3123. headers: {
  3124. 'X-Plex-Product':'Organizr',
  3125. 'X-Plex-Version':'1.0',
  3126. 'X-Plex-Client-Identifier':'01010101-10101010'
  3127. },
  3128. url: 'https://plex.tv/users/sign_in.json',
  3129. data: {
  3130. 'user[login]': plex_username,
  3131. 'user[password]': plex_password,
  3132. force: true
  3133. },
  3134. cache: false,
  3135. async: true,
  3136. complete: function(xhr, status) {
  3137. var result = $.parseJSON(xhr.responseText);
  3138. if (xhr.status === 201) {
  3139. $('#plexError').removeClass();
  3140. $('#plexError').addClass("well well-sm green-bg");
  3141. $('#plexError').show();
  3142. $('#plexError').text(xhr.statusText);
  3143. $("#plexToken_id").val(result.user.authToken);
  3144. $("#plexToken_id").attr('data-changed', 'true');
  3145. $('#plexModal').modal('hide');
  3146. } else {
  3147. $('#plexError').removeClass();
  3148. $('#plexError').addClass("well well-sm red-bg");
  3149. $('#plexError').show();
  3150. $('#plexError').text(xhr.statusText);
  3151. }
  3152. }
  3153. });
  3154. } else {
  3155. $('#plexError').text("Enter Username and Password");
  3156. }
  3157. });
  3158. //Generate API
  3159. function generateCode() {
  3160. var code = "";
  3161. var possible = "abcdefghijklmnopqrstuvwxyz0123456789";
  3162. for (var i = 0; i < 20; i++)
  3163. code += possible.charAt(Math.floor(Math.random() * possible.length));
  3164. return code;
  3165. }
  3166. function performUpdate(){
  3167. $('#updateStatus').show();
  3168. setTimeout(function(){
  3169. $('#updateStatusBar').attr("style", "width: 1%");
  3170. setTimeout(function(){
  3171. $('#updateStatusBar').attr("style", "width: 20%");
  3172. setTimeout(function(){
  3173. $('#updateStatusBar').attr("style", "width: 35%");
  3174. setTimeout(function(){
  3175. $('#updateStatusBar').attr("style", "width: 50%");
  3176. setTimeout(function(){
  3177. $('#updateStatusBar').attr("style", "width: 65%");
  3178. setTimeout(function(){
  3179. $('#updateStatusBar').attr("style", "width: 80%");
  3180. setTimeout(function(){
  3181. $('#updateStatusBar').attr("style", "width: 95%");
  3182. setTimeout(function(){
  3183. $('#updateStatusBar').attr("style", "width: 100%");
  3184. }, 4000);
  3185. }, 3500);
  3186. }, 3000);
  3187. }, 2500);
  3188. }, 2000);
  3189. }, 1500);
  3190. }, 1000);
  3191. }, 100);
  3192. }
  3193. $(function () {
  3194. //Data Tables
  3195. $('.datatable').DataTable({
  3196. displayLength: 10,
  3197. dom: 'T<"clear">lfrtip',
  3198. responsive: true,
  3199. "order": [[ 0, 'desc' ]],
  3200. "language": {
  3201. "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);?>",
  3202. "infoEmpty": "<?php echo $language->translate('NO_ENTRIES');?>",
  3203. "infoFiltered": "<?php echo explosion($language->translate('FILTERED'), 0);?> _MAX_ <?php echo explosion($language->translate('FILTERED'), 1);?>",
  3204. "lengthMenu": "<?php echo $language->translate('SHOW');?> _MENU_ <?php echo $language->translate('ENTRIES');?>",
  3205. "search": "",
  3206. "searchPlaceholder": "<?php echo $language->translate('SEARCH');?>",
  3207. "searchClass": "<?php echo $language->translate('SEARCH');?>",
  3208. "zeroRecords": "<?php echo $language->translate('NO_MATCHING');?>",
  3209. "paginate": {
  3210. "next": "<?php echo $language->translate('NEXT');?>",
  3211. "previous": "<?php echo $language->translate('PREVIOUS');?>",
  3212. }
  3213. }
  3214. });
  3215. });
  3216. </script>
  3217. <script>
  3218. (function($) {
  3219. function startTrigger(e,data) {
  3220. var $elem = $(this);
  3221. $elem.data('mouseheld_timeout', setTimeout(function() {
  3222. $elem.trigger('mouseheld');
  3223. }, e.data));
  3224. }
  3225. function stopTrigger() {
  3226. var $elem = $(this);
  3227. clearTimeout($elem.data('mouseheld_timeout'));
  3228. }
  3229. var mouseheld = $.event.special.mouseheld = {
  3230. setup: function(data) {
  3231. var $this = $(this);
  3232. $this.bind('mousedown', +data || mouseheld.time, startTrigger);
  3233. $this.bind('mouseleave mouseup', stopTrigger);
  3234. },
  3235. teardown: function() {
  3236. var $this = $(this);
  3237. $this.unbind('mousedown', startTrigger);
  3238. $this.unbind('mouseleave mouseup', stopTrigger);
  3239. },
  3240. time: 200 // default to 750ms
  3241. };
  3242. })(jQuery);
  3243. $(function () {
  3244. $('.summernote').summernote({
  3245. height: 120,
  3246. codemirror: { // codemirror options
  3247. mode: 'text/html',
  3248. htmlMode: true,
  3249. lineNumbers: true,
  3250. theme: 'monokai'
  3251. }
  3252. });
  3253. // summernote.change
  3254. $('.summernote').on('summernote.change', function(we, contents, $editable) {
  3255. $(this).attr('data-changed', 'true');
  3256. });
  3257. //$(".todo ul").sortable();
  3258. $(".todo ul").sortable({
  3259. 'opacity': 0.9,
  3260. //'placeholder': "sort-placeholder",
  3261. //'forcePlaceholderSize': true,
  3262. });
  3263. $("#submitTabs").on('submit', function (e) {
  3264. console.log('disabled this func')
  3265. return false;
  3266. });
  3267. $('#apply').on('click touchstart', function(){
  3268. window.parent.location.reload();
  3269. });
  3270. });
  3271. </script>
  3272. <script>
  3273. $("#iconHide").click(function(){
  3274. $( "div[class^='jFiler jFiler-theme-dragdropbox']" ).toggle();
  3275. });
  3276. $("#iconAll").click(function(){
  3277. $( "div[id^='viewAllIcons']" ).toggle();
  3278. });
  3279. $("#deleteToggle").click(function(){
  3280. $( "#deleteDiv" ).toggle();
  3281. });
  3282. $(".deleteInvite").click(function(){
  3283. var parent_id = $(this).parent().attr('id');
  3284. editUsername = $('#deleteInviteForm').find('#inputInvite');
  3285. $(editUsername).html('<input type="hidden" name="op" value="deleteinvite"/><input type="hidden" name="id"value="' + parent_id + '" />');
  3286. });
  3287. $(".deleteUser").click(function(){
  3288. var parent_id = $(this).parent().attr('id');
  3289. editUsername = $('#unregister').find('#inputUsername');
  3290. $(editUsername).html('<input type="hidden" name="op" value="unregister"/><input type="hidden" name="username"value="' + parent_id + '" />');
  3291. });
  3292. $(".newemail").click(function(){
  3293. $(".editUserEmail").hide();
  3294. $(".closeEditUserEmail").hide();
  3295. $(this).parent().find('.editUserEmail').show();
  3296. $(this).parent().find('.closeEditUserEmail').show();
  3297. });
  3298. $(".closeEditUserEmail").click(function(){
  3299. $(".editUserEmail").hide();
  3300. $(".closeEditUserEmail").hide();
  3301. });
  3302. $(".editUserEmail").click(function(){
  3303. var parent_ids = $(this).parent().parent().attr('id');
  3304. newemail = $(this).parent().parent().find('input[name=newemail]').val();
  3305. role = $(this).parent().parent().find('.userRole').text();
  3306. editUsername = $('#unregister').find('#inputUsername');
  3307. console.log('user: '+parent_ids+' email: '+newemail+' role: '+role);
  3308. $(editUsername).html('<input type="hidden" name="op" value="update"/><input type="hidden" name="email" value="'+newemail+'"/><input type="hidden" name="role" value="'+role+'"/><input type="hidden" name="username"value="' + parent_ids + '" />');
  3309. });
  3310. $(".promoteUser").click(function(){
  3311. var parent_ids = $(this).parent().attr('id');
  3312. editUsername = $('#unregister').find('#inputUsername');
  3313. $(editUsername).html('<input type="hidden" name="op" value="update"/><input type="hidden" name="role" value="admin"/><input type="hidden" name="username"value="' + parent_ids + '" />');
  3314. });
  3315. $(".demoteUser").click(function(){
  3316. var parent_idz = $(this).parent().attr('id');
  3317. editUsername = $('#unregister').find('#inputUsername');
  3318. $(editUsername).html('<input type="hidden" name="op" value="update"/><input type="hidden" name="role" value="user"/><input type="hidden" name="username"value="' + parent_idz + '" />');
  3319. });
  3320. $("#viewOrgLogs, #viewLoginLogs").click(function(){
  3321. $('#orgLogTable').toggle();
  3322. $('#loginTable').toggle();
  3323. $('#viewOrgLogs').toggle();
  3324. $('#viewLoginLogs').toggle();
  3325. });
  3326. $('#showLess').hide();
  3327. $('#loadMore').click(function () {
  3328. x= (x+5 <= size_li) ? x+5 : size_li;
  3329. $('#versionHistory li:lt('+x+')').show();
  3330. $('#showLess').show();
  3331. if(x == size_li){
  3332. $('#loadMore').hide();
  3333. }
  3334. });
  3335. $('#showLess').click(function () {
  3336. $('#versionHistory li').not(':lt(2)').hide();
  3337. $('#loadMore').show();
  3338. $('#showLess').hide();
  3339. });
  3340. $("li[class^='list-group-item']").bind('mouseheld', function(e) {
  3341. $(this).find("span[class^='fa fa-hand-paper-o']").attr("class", "fa fa-hand-grab-o");
  3342. $(this).addClass("dragging");
  3343. $(this).find("div[class^='action-btns tabIconView']").addClass("animated swing");
  3344. $(this).mouseup(function() {
  3345. $(this).find("span[class^='fa fa-hand-grab-o']").attr("class", "fa fa-hand-paper-o");
  3346. $(this).removeClass("dragging");
  3347. $(this).find("div[class^='action-btns tabIconView']").removeClass("animated swing");
  3348. });
  3349. });
  3350. function copyToClipboard(elem) {
  3351. // create hidden text element, if it doesn't already exist
  3352. var targetId = "_hiddenCopyText_";
  3353. var isInput = elem.tagName === "INPUT" || elem.tagName === "TEXTAREA";
  3354. var origSelectionStart, origSelectionEnd;
  3355. if (isInput) {
  3356. // can just use the original source element for the selection and copy
  3357. target = elem;
  3358. origSelectionStart = elem.selectionStart;
  3359. origSelectionEnd = elem.selectionEnd;
  3360. } else {
  3361. // must use a temporary form element for the selection and copy
  3362. target = document.getElementById(targetId);
  3363. if (!target) {
  3364. var target = document.createElement("textarea");
  3365. target.style.position = "absolute";
  3366. target.style.left = "-9999px";
  3367. target.style.top = "0";
  3368. target.id = targetId;
  3369. document.body.appendChild(target);
  3370. }
  3371. target.textContent = elem.textContent;
  3372. }
  3373. // select the content
  3374. var currentFocus = document.activeElement;
  3375. target.focus();
  3376. target.setSelectionRange(0, target.value.length);
  3377. // copy the selection
  3378. var succeed;
  3379. try {
  3380. succeed = document.execCommand("copy");
  3381. } catch(e) {
  3382. succeed = false;
  3383. }
  3384. // restore original focus
  3385. if (currentFocus && typeof currentFocus.focus === "function") {
  3386. //currentFocus.focus();
  3387. }
  3388. if (isInput) {
  3389. // restore prior selection
  3390. elem.setSelectionRange(origSelectionStart, origSelectionEnd);
  3391. } else {
  3392. // clear temporary content
  3393. target.textContent = "";
  3394. }
  3395. return succeed;
  3396. }
  3397. $("img[class^='allIcons']").click(function(){
  3398. $("textarea[id^='copyTarget']").val($(this).attr("src"));
  3399. copyToClipboard(document.getElementById("copyTarget"));
  3400. parent.notify("<?php echo $language->translate('ICON_COPY');?>","clipboard","success","5000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
  3401. $( "div[id^='viewAllIcons']" ).toggle();
  3402. });
  3403. $('body').on('click', 'b.allIcons', function() {
  3404. $("textarea[id^='copyTarget2']").val($(this).attr("title"));
  3405. copyToClipboard(document.getElementById("copyTarget2"));
  3406. parent.notify("<?php echo $language->translate('ICON_COPY');?>","clipboard","success","5000", "<?=$notifyExplode[0];?>", "<?=$notifyExplode[1];?>");
  3407. $( "div[class^='jFiler jFiler-theme-dragdropbox']" ).hide();
  3408. });
  3409. </script>
  3410. <script>
  3411. //Backup
  3412. $('#backupNow').on('click', function () {
  3413. console.log("starting backup now");
  3414. ajax_request('POST', 'backup-now');
  3415. setTimeout(function(){
  3416. ajax_request('GET', 'get-backups').done(function(data){
  3417. $('#backupList_id').html(data);
  3418. $('#backupList_id').addClass('animated pulse');
  3419. });
  3420. console.log("ajax backup done")
  3421. }, 500);
  3422. ;
  3423. });
  3424. //TestEmail
  3425. function isUpperCase(str) {
  3426. return str === str.toUpperCase();
  3427. }
  3428. $('#smtpHostAuth_id').change(function() {
  3429. if($('#smtpHostAuth_id').attr("data-value") == "true"){
  3430. $('#smtpHostAuth_id').attr("data-value", "false");
  3431. }else{
  3432. $('#smtpHostAuth_id').attr("data-value", "true");
  3433. }
  3434. });
  3435. $('#testEmail').on('click', function () {
  3436. var password = '';
  3437. if(isUpperCase($('#smtpHostPassword_id').val())){
  3438. password = '<?php echo SMTPHOSTPASSWORD; ?>';
  3439. }else{
  3440. password = $('#smtpHostPassword_id').val();
  3441. }
  3442. console.log("starting");
  3443. ajax_request('POST', 'test-email', {
  3444. emailto: '<?php echo $USER->email;?>',
  3445. emailhost: $('#smtpHost_id').val(),
  3446. emailport: $('#smtpHostPort_id').val(),
  3447. emailusername: $('#smtpHostUsername_id').val(),
  3448. emailpassword: password,
  3449. emailsendername: $('#smtpHostSenderName_id').val(),
  3450. emailsenderemail: $('#smtpHostSenderEmail_id').val(),
  3451. emailtype: $('#smtpHostType_id').val(),
  3452. emailauth: $('#smtpHostAuth_id').attr("data-value"),
  3453. });
  3454. console.log(
  3455. 'TO: <?php echo $USER->email;?>\n'+
  3456. 'HOST: '+$('#smtpHost_id').val()+'\n'+
  3457. 'PORT: '+$('#smtpHostPort_id').val()+'\n'+
  3458. 'USERNAME: '+$('#smtpHostUsername_id').val()+'\n'+
  3459. 'SENDER NAME: '+$('#smtpHostSenderName_id').val()+'\n'+
  3460. 'SENDER EMAIL: '+$('#smtpHostSenderEmail_id').val()+'\n'+
  3461. 'TYPE: '+$('#smtpHostType_id').val()+'\n'+
  3462. 'AUTH: '+$('#smtpHostAuth_id').attr("data-value")+'\n'
  3463. );
  3464. console.log("ajax done");
  3465. });
  3466. //Custom Themes
  3467. function changeColor(elementName, elementColor) {
  3468. var definedElement = document.getElementById(elementName);
  3469. definedElement.focus();
  3470. definedElement.value = elementColor;
  3471. definedElement.style.backgroundColor = elementColor;
  3472. $(definedElement).trigger('change');
  3473. }
  3474. $('#plexTheme').on('click touchstart', function(){
  3475. changeColor("topbartext", "#E49F0C");
  3476. changeColor("topbar", "#000000");
  3477. changeColor("bottombar", "#000000");
  3478. changeColor("sidebar", "#121212");
  3479. changeColor("hoverbg", "#FFFFFF");
  3480. changeColor("activetabBG", "#E49F0C");
  3481. changeColor("activetabicon", "#FFFFFF");
  3482. changeColor("activetabtext", "#FFFFFF");
  3483. changeColor("inactiveicon", "#949494");
  3484. changeColor("inactivetext", "#B8B8B8");
  3485. changeColor("loading", "#E49F0C");
  3486. changeColor("hovertext", "#000000");
  3487. });
  3488. $('#embyTheme').on('click touchstart', function(){
  3489. changeColor("topbartext", "#52B54B");
  3490. changeColor("topbar", "#212121");
  3491. changeColor("bottombar", "#212121");
  3492. changeColor("sidebar", "#121212");
  3493. changeColor("hoverbg", "#FFFFFF");
  3494. changeColor("activetabBG", "#52B54B");
  3495. changeColor("activetabicon", "#FFFFFF");
  3496. changeColor("activetabtext", "#FFFFFF");
  3497. changeColor("inactiveicon", "#949494");
  3498. changeColor("inactivetext", "#B8B8B8");
  3499. changeColor("loading", "#52B54B");
  3500. changeColor("hovertext", "#000000");
  3501. });
  3502. $('#bookTheme').on('click touchstart', function(){
  3503. changeColor("topbartext", "#FFFFFF");
  3504. changeColor("topbar", "#3B5998");
  3505. changeColor("bottombar", "#3B5998");
  3506. changeColor("sidebar", "#8B9DC3");
  3507. changeColor("hoverbg", "#FFFFFF");
  3508. changeColor("activetabBG", "#3B5998");
  3509. changeColor("activetabicon", "#FFFFFF");
  3510. changeColor("activetabtext", "#FFFFFF");
  3511. changeColor("inactiveicon", "#DFE3EE");
  3512. changeColor("inactivetext", "#DFE3EE");
  3513. changeColor("loading", "#FFFFFF");
  3514. changeColor("hovertext", "#000000");
  3515. });
  3516. $('#spaTheme').on('click touchstart', function(){
  3517. changeColor("topbartext", "#5B391E");
  3518. changeColor("topbar", "#66BBAE");
  3519. changeColor("bottombar", "#66BBAE");
  3520. changeColor("sidebar", "#C3EEE7");
  3521. changeColor("hoverbg", "#66BBAE");
  3522. changeColor("activetabBG", "#C6C386");
  3523. changeColor("activetabicon", "#FFFFFF");
  3524. changeColor("activetabtext", "#FFFFFF");
  3525. changeColor("inactiveicon", "#5B391E");
  3526. changeColor("inactivetext", "#5B391E");
  3527. changeColor("loading", "#5B391E");
  3528. changeColor("hovertext", "#000000");
  3529. });
  3530. $('#darklyTheme').on('click touchstart', function(){
  3531. changeColor("topbartext", "#FFFFFF");
  3532. changeColor("topbar", "#375A7F");
  3533. changeColor("bottombar", "#375A7F");
  3534. changeColor("sidebar", "#222222");
  3535. changeColor("hoverbg", "#464545");
  3536. changeColor("activetabBG", "#FFFFFF");
  3537. changeColor("activetabicon", "#464545");
  3538. changeColor("activetabtext", "#464545");
  3539. changeColor("inactiveicon", "#0CE3AC");
  3540. changeColor("inactivetext", "#0CE3AC");
  3541. changeColor("loading", "#FFFFFF");
  3542. changeColor("hovertext", "#000000");
  3543. });
  3544. $('#slateTheme').on('click touchstart', function(){
  3545. changeColor("topbartext", "#C8C8C8");
  3546. changeColor("topbar", "#272B30");
  3547. changeColor("bottombar", "#272B30");
  3548. changeColor("sidebar", "#32383E");
  3549. changeColor("hoverbg", "#58C0DE");
  3550. changeColor("activetabBG", "#3E444C");
  3551. changeColor("activetabicon", "#C8C8C8");
  3552. changeColor("activetabtext", "#FFFFFF");
  3553. changeColor("inactiveicon", "#C8C8C8");
  3554. changeColor("inactivetext", "#C8C8C8");
  3555. changeColor("loading", "#C8C8C8");
  3556. changeColor("hovertext", "#000000");
  3557. });
  3558. $('#defaultTheme').on('click touchstart', function(){
  3559. changeColor("topbartext", "#FFFFFF");
  3560. changeColor("topbar", "#eb6363");
  3561. changeColor("bottombar", "#eb6363");
  3562. changeColor("sidebar", "#000000");
  3563. changeColor("hoverbg", "#eb6363");
  3564. changeColor("activetabBG", "#eb6363");
  3565. changeColor("activetabicon", "#FFFFFF");
  3566. changeColor("activetabtext", "#FFFFFF");
  3567. changeColor("inactiveicon", "#FFFFFF");
  3568. changeColor("inactivetext", "#FFFFFF");
  3569. changeColor("loading", "#FFFFFF");
  3570. changeColor("hovertext", "#000000");
  3571. });
  3572. $('#redTheme').on('click touchstart', function(){
  3573. changeColor("topbartext", "#FFFFFF");
  3574. changeColor("topbar", "#eb6363");
  3575. changeColor("bottombar", "#eb6363");
  3576. changeColor("sidebar", "#000000");
  3577. changeColor("hoverbg", "#eb6363");
  3578. changeColor("activetabBG", "#eb6363");
  3579. changeColor("activetabicon", "#FFFFFF");
  3580. changeColor("activetabtext", "#FFFFFF");
  3581. changeColor("inactiveicon", "#FFFFFF");
  3582. changeColor("inactivetext", "#FFFFFF");
  3583. changeColor("loading", "#FFFFFF");
  3584. changeColor("hovertext", "#000000");
  3585. });
  3586. $('#monokaiTheme').on('click touchstart', function(){
  3587. changeColor("topbartext", "#66D9EF");
  3588. changeColor("topbar", "#333333");
  3589. changeColor("bottombar", "#333333");
  3590. changeColor("sidebar", "#393939");
  3591. changeColor("hoverbg", "#AD80FD");
  3592. changeColor("activetabBG", "#F92671");
  3593. changeColor("activetabicon", "#FFFFFF");
  3594. changeColor("activetabtext", "#FFFFFF");
  3595. changeColor("inactiveicon", "#66D9EF");
  3596. changeColor("inactivetext", "#66D9EF");
  3597. changeColor("loading", "#66D9EF");
  3598. changeColor("hovertext", "#000000");
  3599. });
  3600. $('#thejokerTheme').on('click touchstart', function(){
  3601. changeColor("topbartext", "#CCCCCC");
  3602. changeColor("topbar", "#000000");
  3603. changeColor("bottombar", "#000000");
  3604. changeColor("sidebar", "#121212");
  3605. changeColor("hoverbg", "#CCC6CC");
  3606. changeColor("activetabBG", "#A50CB0");
  3607. changeColor("activetabicon", "#FFFFFF");
  3608. changeColor("activetabtext", "#FFFFFF");
  3609. changeColor("inactiveicon", "#949494");
  3610. changeColor("inactivetext", "#B8B8B8");
  3611. changeColor("loading", "#CCCCCC");
  3612. changeColor("hovertext", "#000000");
  3613. });
  3614. $('#newPlexTheme').on('click touchstart', function(){
  3615. changeColor("topbartext", "#E5A00D");
  3616. changeColor("topbar", "#282A2D");
  3617. changeColor("bottombar", "#282A2D");
  3618. changeColor("sidebar", "#3F4245");
  3619. changeColor("hoverbg", "#E5A00D");
  3620. changeColor("activetabBG", "#282A2D");
  3621. changeColor("activetabicon", "#E5A00D");
  3622. changeColor("activetabtext", "#E5A00D");
  3623. changeColor("inactiveicon", "#F9F9F9");
  3624. changeColor("inactivetext", "#F9F9F9");
  3625. changeColor("loading", "#E5A00D");
  3626. changeColor("hovertext", "#E0E3E6");
  3627. });//$( "div" ).not( ".green, #blueone" )
  3628. $('textarea').not( ".no-code" ).numberedtextarea({
  3629. // font color for line numbers
  3630. color: null,
  3631. // border color
  3632. borderColor: 'null',
  3633. // CSS class to be added to the line numbers
  3634. class: null,
  3635. // if true Tab key creates indentation
  3636. allowTabChar: true,
  3637. });
  3638. //more/less
  3639. $(".toggleTabExtra").click(function () {
  3640. $(this).find('.btn-text').text(function(i, text){
  3641. return text === "More" ? "Less" : "More";
  3642. })
  3643. $(this).find('i').toggleClass('fa-chevron-down fa-chevron-up');
  3644. });
  3645. $("#toggleAllExtra").click(function () {
  3646. $( ".toggleTabExtra" ).each(function() {
  3647. $(this).click();
  3648. });
  3649. $(this).find('i').toggleClass('fa-toggle-off fa-toggle-on');
  3650. });
  3651. $(".email-header .close-button").click(function () {
  3652. $(".email-content").removeClass("email-active");
  3653. $(".settingsMenu").removeClass("settingsMenuActive");
  3654. $(".settingsMenu").removeClass("settingsMenuInactive");
  3655. $('html').removeClass("overhid");
  3656. $("#settings-list").find("li").removeClass("active");
  3657. });
  3658. $(document).mouseup(function (e)
  3659. {
  3660. var container = $(".email-content, .checkFrame, .scroller-body");
  3661. if (!container.is(e.target) && container.has(e.target).length === 0) {
  3662. $(".email-content").removeClass("email-active");
  3663. $('html').removeClass("overhid");
  3664. $("#settings-list").find("li").removeClass("active");
  3665. }
  3666. });
  3667. $( document ).on( 'keydown', function ( e ) {
  3668. if ( e.keyCode === 27 ) { // ESC
  3669. var container = $(".email-content");
  3670. if (!container.is(e.target) && container.has(e.target).length === 0) {
  3671. $(".email-content").removeClass("email-active");
  3672. $(".settingsMenu").removeClass("settingsMenuActive");
  3673. $(".settingsMenu").removeClass("settingsMenuInactive");
  3674. $('html').removeClass("overhid");
  3675. $("#settings-list").find("li").removeClass("active");
  3676. }
  3677. }
  3678. });
  3679. $("#open-info, #open-users, #open-logs, #open-advanced, #open-homepage, #open-colors, #open-tabs, #open-donate, #open-invites , #open-themes, #open-speedtest, #open-email, #open-help").on("click",function (e) {
  3680. $(".email-content").removeClass("email-active");
  3681. $('html').removeClass("overhid");
  3682. if($(window).width() < 768){
  3683. $('html').addClass("overhid");
  3684. }
  3685. //Theme box
  3686. if($(this).attr("box") == "themes-box"){
  3687. getLayerCakeThemes();
  3688. }
  3689. if (typeof $(this).attr("box") !== 'undefined') {
  3690. var settingsBox = $('.'+$(this).attr("box"));
  3691. }else{
  3692. var settingsBox = $('.themes-box');
  3693. }
  3694. //console.log(settingsBox);
  3695. settingsBox.addClass("email-active");
  3696. $("#settings-list").find("li").removeClass("active");
  3697. $(this).parent().addClass("active");
  3698. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(settingsBox).show();
  3699. setTimeout(function(){
  3700. var refreshMailPreloader = settingsBox.find('.refresh-preloader'),
  3701. deletedMailBox = refreshMailPreloader.fadeOut(300, function(){
  3702. refreshMailPreloader.remove();
  3703. });
  3704. },600);
  3705. e.preventDefault();
  3706. });
  3707. function customEmail(id){
  3708. if(id == 'one'){
  3709. var Body = <?php echo json_encode(emailTemplateCustomOne); ?>;
  3710. var Subject = <?php echo json_encode(emailTemplateCustomOneSubject); ?>;
  3711. }else if(id == 'two'){
  3712. var Body = <?php echo json_encode(emailTemplateCustomTwo); ?>;
  3713. var Subject = <?php echo json_encode(emailTemplateCustomTwoSubject); ?>;
  3714. }else if(id == 'three'){
  3715. var Body = <?php echo json_encode(emailTemplateCustomThree); ?>;
  3716. var Subject = <?php echo json_encode(emailTemplateCustomThreeSubject); ?>;
  3717. }else if(id == 'four'){
  3718. var Body = <?php echo json_encode(emailTemplateCustomFour); ?>;
  3719. var Subject = <?php echo json_encode(emailTemplateCustomFourSubject); ?>;
  3720. }
  3721. console.log(Body);
  3722. console.log(Subject);
  3723. $('#subject').val(Subject);
  3724. $('.email-box .note-editable.panel-body').html(Body);
  3725. }
  3726. function checkGithub() {
  3727. $.ajax({
  3728. type: "GET",
  3729. url: "https://api.github.com/repos/causefx/Organizr/releases",
  3730. dataType: "json",
  3731. success: function(github) {
  3732. var currentVersion = "<?php echo INSTALLEDVERSION;?>";
  3733. infoTabVersion = $('#about').find('#version');
  3734. infoTabVersionHistory = $('#about').find('#versionHistory');
  3735. infoTabNew = $('#about').find('#whatsnew');
  3736. infoTabDownload = $('#about').find('#downloadnow');
  3737. $.each(github, function(i,v) {
  3738. if(i === 0){
  3739. console.log(v.tag_name);
  3740. githubVersion = v.tag_name;
  3741. githubDescription = v.body;
  3742. githubName = v.name;
  3743. }
  3744. $(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>');
  3745. size_li = $("#versionHistory li").size();
  3746. x=2;
  3747. $('#versionHistory li:lt('+x+')').show();
  3748. });
  3749. if(currentVersion < githubVersion){
  3750. console.log("You Need To Upgrade");
  3751. 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];?>");
  3752. $(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);
  3753. <?php if (extension_loaded("ZIP")){?>
  3754. $(infoTabDownload).html("<br/><form style=\"display:initial;\" id=\"upgradeOrg\" method=\"post\" onsubmit=\"performUpdate(); ajax_request(\'POST\', \'upgradeInstall\'); return false;\"><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/v1-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>");
  3755. $( "p[id^='upgrade']" ).toggle();
  3756. <?php }else{ ?>
  3757. $(infoTabDownload).html("<br/><a href='https://github.com/causefx/Organizr/archive/v1-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>");
  3758. $( "p[id^='upgrade']" ).toggle();
  3759. <?php } ?>
  3760. }else if(currentVersion === githubVersion){
  3761. console.log("You Are on Current Version");
  3762. }else{
  3763. console.log("something went wrong");
  3764. }
  3765. $(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);?> <strong><?php echo $language->translate("DOMAIN");?>: </strong> <?php echo substr(getServerPath(), 0, -1);?>");
  3766. }
  3767. });
  3768. }
  3769. function layerCake(type, path) {
  3770. $.ajax({
  3771. type: "GET",
  3772. url: "ajax.php?a=show-file&file=https://raw.githubusercontent.com/leram84/layer.Cake/master/"+path+"/"+type+".css",
  3773. dataType: "text",
  3774. success: function(github) {
  3775. cssTab = $("a[href^='#tab-theme_css']");
  3776. cssTab.trigger("click");
  3777. $('#customCSS_id').text(github);
  3778. $('#installedTheme').val('');
  3779. $("#installedTheme").attr('data-changed', 'true');
  3780. swal({
  3781. title: "Loaded Layer#Cake "+type,
  3782. text: '<h2>Awesome Sauce!</h2><p>Now that you have enabled Layer#Cake, edit the colors here and then hit Save at the top right.<blockquote class="blockquote-reverse"><p>Layer#Cake is powered and brought to you by:</p><footer>Hackerman - <cite title="Source Title">Leram</cite></footer></blockquote>',
  3783. html: true,
  3784. confirmButtonColor: "#63A8EB"
  3785. });
  3786. }
  3787. });
  3788. }
  3789. function getLayerCakeThemes() {
  3790. $.ajax({
  3791. type: "GET",
  3792. url: "https://api.github.com/repos/leram84/layer.Cake/contents/Themes",
  3793. dataType: "json",
  3794. success: function(github) {
  3795. themeList = $('#theme-list');
  3796. themeList.html("");
  3797. var countThemes = 0;
  3798. $.each(github, function(i,v) {
  3799. if(v.type === "file"){
  3800. i++;
  3801. countThemes = i;
  3802. file = v.name.split("-");
  3803. preview = v.name.split(".");
  3804. preview = preview[0].substring(4, preview[0].length -2).split("-");
  3805. version = file[3].split(".");
  3806. version = version[0]+'.'+version[1];
  3807. fileName = file[1];
  3808. fileOrder = file[0];
  3809. fileAuthor = file[2];
  3810. if(fileName == '<?php echo $themeName; ?>'){
  3811. if(version !== '<?php echo $themeVersion; ?>'){
  3812. //update available
  3813. info = '<p class="pull-right"><span class="label label-primary">Update Available</span></p>';
  3814. }else{
  3815. //no update available
  3816. info = '<p class="pull-right"><span class="label label-success">Installed</span></p>';
  3817. }
  3818. }else{
  3819. info = '';
  3820. }
  3821. $(themeList).append('<li><a preview="'+preview[0]+'.png" name="'+fileName+'" check="'+fileName+'-'+version+'" version="'+version+'" file="'+v.name+'" path="'+v.path+'" order="'+fileOrder+'" author="'+fileAuthor+'" id="LC-'+fileName+'">'+fileName+' v'+version+' '+info+'</a></li>');
  3822. }
  3823. });
  3824. console.log(countThemes);
  3825. }
  3826. });
  3827. }
  3828. function layerCakeTheme(path, name, author, theme) {
  3829. var settingsBox = $('.themes-box');
  3830. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(settingsBox).show();
  3831. $.ajax({
  3832. type: "GET",
  3833. url: "ajax.php?a=show-file&file=https://raw.githubusercontent.com/leram84/layer.Cake/master/Themes/"+path,
  3834. dataType: "text",
  3835. success: function(github) {
  3836. $("#open-colors").trigger("click");
  3837. $("a[href^='#tab-theme_css']").trigger("click");
  3838. $('#customCSS_id').text(github);
  3839. $("#customCSS_id").attr('data-changed', 'true');
  3840. $('#installedTheme').val(theme);
  3841. $('.themeHeader').text('Installed Theme: '+theme);
  3842. $("#installedTheme").attr('data-changed', 'true');
  3843. swal({
  3844. title: "Loaded Theme: "+name,
  3845. text: '<h2>Awesome Sauce!</h2><p>Theme has been imported. <p><strong style="color: red;">Please click Save at the top right.</strong></p><blockquote class="blockquote-reverse"><p>Layer#Cake Theme by:</p><footer><cite title="Source Title">'+author+'</cite></footer></blockquote>',
  3846. html: true,
  3847. confirmButtonColor: "#63A8EB"
  3848. });
  3849. }
  3850. });
  3851. }
  3852. //layerCake Themes
  3853. $(document).on('click', "a[id*=LC-]", function(){
  3854. file = $(this).attr("file");
  3855. name = $(this).attr("name");
  3856. author = $(this).attr("author");
  3857. theme = $(this).attr("name")+'-'+$(this).attr("version");
  3858. $.ajax({
  3859. type: 'GET',
  3860. url: 'https://raw.githubusercontent.com/leram84/layer.Cake/master/Themes/Information/'+name+'.txt',
  3861. dataType: "html",
  3862. async: false,
  3863. success: function(msg){
  3864. gotinformation = msg.replace(/\r\n|\r|\n/g,"<br/>");
  3865. },
  3866. error: function(msg){
  3867. gotinformation = "There is no information for theme "+name;
  3868. }
  3869. });
  3870. information = '<div class="caption gray-bg"><h3>Theme Information</h3><p>'+gotinformation+'</p></div>';
  3871. button = '<div class="thumbnail gray-bg"><div class="caption gray-bg"><p class="pull-left">'+name+' by: '+author+'</p><p class="pull-right"><button type="button" onclick="layerCakeTheme(\''+file+'\',\''+name+'\',\''+author+'\',\''+theme+'\')" class="btn btn-success waves waves-effect waves-float">Install</button></p></div><img src="https://raw.githubusercontent.com/leram84/layer.Cake/master/Themes/Preview/'+$(this).attr("preview")+'" alt="thumbnail">'+information+'</div>';
  3872. $('#chooseLayer').hide();
  3873. themeInfo = $('#layerCakeInfo');
  3874. $('#layerCakePreview').html( ''+button+'' );
  3875. });
  3876. $("#clearTheme").click(function () {
  3877. swal({
  3878. title: "Please Choose",
  3879. text: "You can clear just the theme name saved or clear theme name and CSS",
  3880. type: "warning",
  3881. showCancelButton: true,
  3882. confirmButtonColor: "#DD6B55",
  3883. confirmButtonText: "Clear Everything!",
  3884. cancelButtonText: "Clear Name Only!",
  3885. closeOnConfirm: false,
  3886. closeOnCancel: false,
  3887. confirmButtonColor: "#63A8EB"
  3888. },
  3889. function (isConfirm) {
  3890. if (isConfirm) {
  3891. swal("Cleared!", "All Theme settings have been cleared", "success");
  3892. $('#customCSS_id').text("");
  3893. $("#customCSS_id").attr('data-changed', 'true');
  3894. $('#installedTheme').val("");
  3895. $('.themeHeader').text('Installed Theme: No Theme Installed!');
  3896. $("#installedTheme").attr('data-changed', 'true');
  3897. $('#appearance_settings_form_submit').addClass("animated tada");
  3898. } else {
  3899. swal("Cleared", "Cleared the Theme name saved, CSS still remains", "success");
  3900. $('#installedTheme').val("");
  3901. $('.themeHeader').text('Installed Theme: No Theme Installed!');
  3902. $("#installedTheme").attr('data-changed', 'true');
  3903. $('#appearance_settings_form_submit').addClass("animated tada");
  3904. }
  3905. });
  3906. });
  3907. </script>
  3908. <script>
  3909. $( document ).ready(function() {
  3910. $("#homepage-items").sortable({
  3911. placeholder: "sort-placeholder col-md-3",
  3912. forcePlaceholderSize: true,
  3913. start: function( e, ui ){
  3914. ui.item.data( "start-pos", ui.item.index()+1 );
  3915. },
  3916. change: function( e, ui ){
  3917. var seq,
  3918. startPos = ui.item.data( "start-pos" ),
  3919. $index,
  3920. correction;
  3921. correction = startPos <= ui.placeholder.index() ? 0 : 1;
  3922. ui.item.parent().find( "div.sort-homepage").each( function( idx, el ){
  3923. var $this = $( el ),
  3924. $index = $this.index();
  3925. if ( ( $index+1 >= startPos && correction === 0) || ($index+1 <= startPos && correction === 1 ) ){
  3926. $index = $index + correction;
  3927. $this.find( ".ordinal-position").text( $index);
  3928. link = $this.find( ".ordinal-position" ).attr('data-link');
  3929. $('#homepage-values [name='+link+']').val($index);
  3930. $('#homepage-values [name='+link+']').attr('data-changed', 'true');
  3931. console.log(link+' - '+$index);
  3932. }
  3933. });
  3934. seq = ui.item.parent().find( "div.sort-placeholder.col-md-3").index() + correction;
  3935. ui.item.find( ".ordinal-position" ).text( seq );
  3936. newlink = ui.item.find( ".ordinal-position" ).attr('data-link');
  3937. $('#homepage-values [name='+newlink+']').val(seq);
  3938. $('#homepage-values [name='+newlink+']').attr('data-changed', 'true');
  3939. console.log(newlink+' - '+seq);
  3940. }
  3941. });
  3942. $(".iconpickeradd").on("click", function() {
  3943. console.log('icon picker start add');
  3944. $(this).iconpicker({placement: 'right', hideOnSelect: false, collision: true});
  3945. $(".iconpicker-items").niceScroll({
  3946. railpadding: {top:0,right:0,left:0,bottom:0},
  3947. scrollspeed: 30,
  3948. mousescrollstep: 60,
  3949. grabcursorenabled: false
  3950. });
  3951. $(this).focus();
  3952. });
  3953. //AJAX Submit for URL Check
  3954. $('#urlTestForm_submit').on('click', function () {
  3955. ajax_request('POST', 'check-url', {
  3956. checkurl: $('#urlTestForm [name=url-test]').val(),
  3957. });
  3958. });
  3959. //Hide Icon box on load
  3960. $( "div[class^='jFiler jFiler-theme-dragdropbox']" ).hide();
  3961. //Set Some Scrollbars
  3962. $(".note-editable panel-body").niceScroll({
  3963. railpadding: {top:0,right:0,left:0,bottom:0},
  3964. grabcursorenabled: false
  3965. });
  3966. $(".scroller-body").niceScroll({
  3967. railpadding: {top:0,right:0,left:0,bottom:0},
  3968. grabcursorenabled: false
  3969. });
  3970. $(".email-content").niceScroll({
  3971. railpadding: {top:0,right:0,left:0,bottom:0},
  3972. railoffset: {top:75,right:0,left:0,bottom:75},
  3973. grabcursorenabled: false,
  3974. zindex: 1101
  3975. });
  3976. $("textarea").niceScroll({
  3977. railpadding: {top:0,right:0,left:0,bottom:0},
  3978. grabcursorenabled: false
  3979. });
  3980. //Stop Div behind From Scrolling
  3981. $( '.email-content' ).on( 'mousewheel', function ( e ) {
  3982. e.preventDefault();
  3983. }, false);
  3984. //Set Hide Function
  3985. if (0) {
  3986. var authTypeFunc = function() {
  3987. // Hide Everything
  3988. $('#host-selected, #host-other, #host-plex, #host-emby, #host-ldap').hide();
  3989. // Qualify Auth Type
  3990. if($('#authType').val() !== "internal"){
  3991. $( '#host-selected' ).show();
  3992. // Qualify aithBackend
  3993. if($('#authBackend').val() === "plex"){
  3994. $('#host-selected, #host-plex').show();
  3995. }else if($('#authBackend').val().indexOf("emby")>=0){
  3996. $('#host-selected, #host-other, #host-emby').show();
  3997. }else if($('#authBackend').val() === "ldap"){
  3998. $('#host-selected, #host-other, #host-ldap').show();
  3999. }else {
  4000. $('#host-selected, #host-other').show();
  4001. }
  4002. }
  4003. }
  4004. //Hide Settings on selection
  4005. $('#authType, #authBackend').on('change', authTypeFunc);
  4006. //Hide Settings on Load
  4007. authTypeFunc();
  4008. } else { console.log() }
  4009. //Simulate Edit Tabs Click
  4010. //$("#open-tabs").trigger("click");
  4011. //Append Delete log to User Logs and Org Logs
  4012. $("#datatable_wrapper > div[class^='DTTT_container']").append('<form style="display: inline; margin-left: 3px;" id="deletelog" method="post" onsubmit="ajax_request(\'POST\', \'deleteLog\'); return false;"><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>');
  4013. $("#orgLogs_wrapper > div[class^='DTTT_container']").append('<form style="display: inline; margin-left: 3px;" id="deleteOrglog" method="post" onsubmit="ajax_request(\'POST\', \'deleteOrgLog\'); return false;"><input type="hidden" name="action" value="deleteOrgLog" /><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>')
  4014. $("a[id^='ToolTables_datatable_0'] span").html('<?php echo $language->translate("PRINT");?>')
  4015. //Enable Tooltips
  4016. $('[data-toggle="tooltip"]').tooltip();
  4017. //AJAX call to github to get version info
  4018. <?php if (GIT_CHECK == "true") { echo 'checkGithub()'; } ?>
  4019. //Edit Info tab with Github info
  4020. <?php if(file_exists(FAIL_LOG)) : ?>
  4021. goodCount = $('#loginStats').find('#goodCount');
  4022. goodPercent = $('#loginStats').find('#goodPercent');
  4023. goodTitle = $('#loginStats').find('#goodTitle');
  4024. badCount = $('#loginStats').find('#badCount');
  4025. badPercent = $('#loginStats').find('#badPercent');
  4026. badTitle = $('#loginStats').find('#badTitle');
  4027. $(goodCount).html("<?php echo $goodLogin;?>");
  4028. $(goodTitle).html("<?php echo $goodPercent;?>%");
  4029. $(goodPercent).attr('aria-valuenow', "<?php echo $goodPercent;?>");
  4030. $(goodPercent).attr('style', "width: <?php echo $goodPercent;?>%");
  4031. $(badCount).html("<?php echo $badLogin;?>");
  4032. $(badTitle).html("<?php echo $badPercent;?>%");
  4033. $(badPercent).attr('aria-valuenow', "<?php echo $badPercent;?>");
  4034. $(badPercent).attr('style', "width: <?php echo $badPercent;?>%");
  4035. <?php endif; ?>
  4036. });
  4037. </script>
  4038. </body>
  4039. </html>