homepage-functions.php 96 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398
  1. <?php
  2. //homepage order
  3. function homepageOrder()
  4. {
  5. /*$homepageOrder = array(
  6. "homepageOrdercustomhtml" => $GLOBALS['homepageOrdercustomhtml'],
  7. "homepageOrdercustomhtmlTwo" => $GLOBALS['homepageOrdercustomhtmlTwo'],
  8. "homepageOrdernzbget" => $GLOBALS['homepageOrdernzbget'],
  9. "homepageOrderjdownloader" => $GLOBALS['homepageOrderjdownloader'],
  10. "homepageOrdersabnzbd" => $GLOBALS['homepageOrdersabnzbd'],
  11. "homepageOrderplexnowplaying" => $GLOBALS['homepageOrderplexnowplaying'],
  12. "homepageOrderplexrecent" => $GLOBALS['homepageOrderplexrecent'],
  13. "homepageOrderplexplaylist" => $GLOBALS['homepageOrderplexplaylist'],
  14. "homepageOrderembynowplaying" => $GLOBALS['homepageOrderembynowplaying'],
  15. "homepageOrderembyrecent" => $GLOBALS['homepageOrderembyrecent'],
  16. "homepageOrderombi" => $GLOBALS['homepageOrderombi'],
  17. "homepageOrdercalendar" => $GLOBALS['homepageOrdercalendar'],
  18. "homepageOrdertransmission" => $GLOBALS['homepageOrdertransmission'],
  19. "homepageOrderqBittorrent" => $GLOBALS['homepageOrderqBittorrent'],
  20. "homepageOrderdeluge" => $GLOBALS['homepageOrderdeluge'],
  21. "homepageOrderrTorrent" => $GLOBALS['homepageOrderrTorrent'],
  22. "homepageOrderdownloader" => $GLOBALS['homepageOrderdownloader'],
  23. "homepageOrderhealthchecks" => $GLOBALS['homepageOrderhealthchecks'],
  24. "homepageOrderunifi" => $GLOBALS['homepageOrderunifi'],
  25. "homepageOrdertautulli" => $GLOBALS['homepageOrdertautulli'],
  26. "homepageOrderPihole" => $GLOBALS['homepageOrderPihole'],
  27. "homepageOrderMonitorr" => $GLOBALS['homepageOrderMonitorr'],
  28. "homepageOrderWeatherAndAir" => $GLOBALS['homepageOrderWeatherAndAir'],
  29. "homepageOrderSpeedtest" => $GLOBALS['homepageOrderSpeedtest'],
  30. "homepageOrderNetdata" => $GLOBALS['homepageOrderNetdata'],
  31. "homepageOrderOctoprint" => $GLOBALS['homepageOrderOctoprint'],
  32. "homepageOrderSonarrQueue" => $GLOBALS['homepageOrderSonarrQueue'],
  33. "homepageOrderRadarrQueue" => $GLOBALS['homepageOrderRadarrQueue'],
  34. );*/
  35. $hpOrderSearch = 'homepageOrder';
  36. $homepageItems = array_filter($GLOBALS, function ($k) use ($hpOrderSearch) {
  37. return strpos($k, $hpOrderSearch) !== false;
  38. }, ARRAY_FILTER_USE_KEY);
  39. asort($homepageItems);
  40. return $homepageItems;
  41. }
  42. function buildHomepage()
  43. {
  44. $homepageOrder = homepageOrder();
  45. $homepageBuilt = '';
  46. foreach ($homepageOrder as $key => $value) {
  47. $homepageBuilt .= buildHomepageItem($key);
  48. }
  49. return $homepageBuilt;
  50. }
  51. function buildHomepageItem($homepageItem)
  52. {
  53. $item = '<div id="' . $homepageItem . '">';
  54. switch ($homepageItem) {
  55. case 'homepageOrdercustomhtml':
  56. if ($GLOBALS['homepagCustomHTMLoneEnabled'] && qualifyRequest($GLOBALS['homepagCustomHTMLoneAuth'])) {
  57. $item .= ($GLOBALS['customHTMLone'] !== '') ? $GLOBALS['customHTMLone'] : '';
  58. }
  59. break;
  60. case 'homepageOrdercustomhtmlTwo':
  61. if ($GLOBALS['homepagCustomHTMLtwoEnabled'] && qualifyRequest($GLOBALS['homepagCustomHTMLtwoAuth'])) {
  62. $item .= ($GLOBALS['customHTMLtwo'] !== '') ? $GLOBALS['customHTMLtwo'] : '';
  63. }
  64. break;
  65. case 'homepageOrdernotice':
  66. break;
  67. case 'homepageOrdernoticeguest':
  68. break;
  69. case 'homepageOrderqBittorrent':
  70. if ($GLOBALS['homepageqBittorrentEnabled'] && qualifyRequest($GLOBALS['homepageqBittorrentAuth'])) {
  71. if ($GLOBALS['qBittorrentCombine']) {
  72. $item .= '
  73. <script>
  74. // homepageOrderqBittorrent
  75. buildDownloaderCombined(\'qBittorrent\');
  76. homepageDownloader("qBittorrent", "' . $GLOBALS['homepageDownloadRefresh'] . '");
  77. // End homepageOrderqBittorrent
  78. </script>
  79. ';
  80. } else {
  81. $item .= '<div class="white-box"><h2 class="text-center" lang="en">Loading Download Queue...</h2></div>';
  82. $item .= '
  83. <script>
  84. // homepageOrderqBittorrent
  85. $("#' . $homepageItem . '").html(buildDownloader("qBittorrent"));
  86. homepageDownloader("qBittorrent", "' . $GLOBALS['homepageDownloadRefresh'] . '");
  87. // End homepageOrderqBittorrent
  88. </script>
  89. ';
  90. }
  91. }
  92. break;
  93. case 'homepageOrderrTorrent':
  94. if ($GLOBALS['homepagerTorrentEnabled'] && qualifyRequest($GLOBALS['homepagerTorrentAuth'])) {
  95. if ($GLOBALS['rTorrentCombine']) {
  96. $item .= '
  97. <script>
  98. // homepageOrderrTorrent
  99. buildDownloaderCombined(\'rTorrent\');
  100. homepageDownloader("rTorrent", "' . $GLOBALS['homepageDownloadRefresh'] . '");
  101. // End homepageOrderrTorrent
  102. </script>
  103. ';
  104. } else {
  105. $item .= '<div class="white-box"><h2 class="text-center" lang="en">Loading Download Queue...</h2></div>';
  106. $item .= '
  107. <script>
  108. // homepageOrderrTorrent
  109. $("#' . $homepageItem . '").html(buildDownloader("rTorrent"));
  110. homepageDownloader("rTorrent", "' . $GLOBALS['homepageDownloadRefresh'] . '");
  111. // End homepageOrderrTorrent
  112. </script>
  113. ';
  114. }
  115. }
  116. break;
  117. case 'homepageOrderdeluge':
  118. if ($GLOBALS['homepageDelugeEnabled'] && qualifyRequest($GLOBALS['homepageDelugeAuth'])) {
  119. if ($GLOBALS['delugeCombine']) {
  120. $item .= '
  121. <script>
  122. // Deluge
  123. buildDownloaderCombined(\'deluge\');
  124. homepageDownloader("deluge", "' . $GLOBALS['homepageDownloadRefresh'] . '");
  125. // End Deluge
  126. </script>
  127. ';
  128. } else {
  129. $item .= '<div class="white-box"><h2 class="text-center" lang="en">Loading Download Queue...</h2></div>';
  130. $item .= '
  131. <script>
  132. // Deluge
  133. $("#' . $homepageItem . '").html(buildDownloader("deluge"));
  134. homepageDownloader("deluge", "' . $GLOBALS['homepageDownloadRefresh'] . '");
  135. // End Deluge
  136. </script>
  137. ';
  138. }
  139. }
  140. break;
  141. case 'homepageOrdertransmission':
  142. if ($GLOBALS['homepageTransmissionEnabled'] && qualifyRequest($GLOBALS['homepageTransmissionAuth'])) {
  143. if ($GLOBALS['transmissionCombine']) {
  144. $item .= '
  145. <script>
  146. // Transmission
  147. buildDownloaderCombined(\'transmission\');
  148. homepageDownloader("transmission", "' . $GLOBALS['homepageDownloadRefresh'] . '");
  149. // End Transmission
  150. </script>
  151. ';
  152. } else {
  153. $item .= '<div class="white-box"><h2 class="text-center" lang="en">Loading Download Queue...</h2></div>';
  154. $item .= '
  155. <script>
  156. // Transmission
  157. $("#' . $homepageItem . '").html(buildDownloader("transmission"));
  158. homepageDownloader("transmission", "' . $GLOBALS['homepageDownloadRefresh'] . '");
  159. // End Transmission
  160. </script>
  161. ';
  162. }
  163. }
  164. break;
  165. case 'homepageOrdernzbget':
  166. if ($GLOBALS['homepageNzbgetEnabled'] && qualifyRequest($GLOBALS['homepageNzbgetAuth'])) {
  167. if ($GLOBALS['nzbgetCombine']) {
  168. $item .= '
  169. <script>
  170. // NZBGet
  171. buildDownloaderCombined(\'nzbget\');
  172. homepageDownloader("nzbget", "' . $GLOBALS['homepageDownloadRefresh'] . '");
  173. // End NZBGet
  174. </script>
  175. ';
  176. } else {
  177. $item .= '<div class="white-box"><h2 class="text-center" lang="en">Loading Download Queue...</h2></div>';
  178. $item .= '
  179. <script>
  180. // NZBGet
  181. $("#' . $homepageItem . '").html(buildDownloader("nzbget"));
  182. homepageDownloader("nzbget", "' . $GLOBALS['homepageDownloadRefresh'] . '");
  183. // End NZBGet
  184. </script>
  185. ';
  186. }
  187. }
  188. break;
  189. case 'homepageOrderjdownloader':
  190. if ($GLOBALS['homepageJdownloaderEnabled'] && qualifyRequest($GLOBALS['homepageJdownloaderAuth'])) {
  191. if ($GLOBALS['jdownloaderCombine']) {
  192. $item .= '
  193. <script>
  194. // JDownloader
  195. buildDownloaderCombined(\'jdownloader\');
  196. homepageDownloader("jdownloader", "' . $GLOBALS['homepageDownloadRefresh'] . '");
  197. // End JDownloader
  198. </script>
  199. ';
  200. } else {
  201. $item .= '<div class="white-box"><h2 class="text-center" lang="en">Loading Download Queue...</h2></div>';
  202. $item .= '
  203. <script>
  204. // JDownloader
  205. $("#' . $homepageItem . '").html(buildDownloader("jdownloader"));
  206. homepageDownloader("jdownloader", "' . $GLOBALS['homepageDownloadRefresh'] . '");
  207. // End JDownloader
  208. </script>
  209. ';
  210. }
  211. }
  212. break;
  213. case 'homepageOrdersabnzbd':
  214. if ($GLOBALS['homepageSabnzbdEnabled'] && qualifyRequest($GLOBALS['homepageSabnzbdAuth'])) {
  215. if ($GLOBALS['sabnzbdCombine']) {
  216. $item .= '
  217. <script>
  218. // SabNZBd
  219. buildDownloaderCombined(\'sabnzbd\');
  220. homepageDownloader("sabnzbd", "' . $GLOBALS['homepageDownloadRefresh'] . '");
  221. // End SabNZBd
  222. </script>
  223. ';
  224. } else {
  225. $item .= '<div class="white-box"><h2 class="text-center" lang="en">Loading Download Queue...</h2></div>';
  226. $item .= '
  227. <script>
  228. // SabNZBd
  229. $("#' . $homepageItem . '").html(buildDownloader("sabnzbd"));
  230. homepageDownloader("sabnzbd", "' . $GLOBALS['homepageDownloadRefresh'] . '");
  231. // End SabNZBd
  232. </script>
  233. ';
  234. }
  235. }
  236. break;
  237. case 'homepageOrderplexnowplaying':
  238. if ($GLOBALS['homepagePlexStreams']) {
  239. $item .= '<div class="white-box"><h2 class="text-center" lang="en">Loading Now Playing...</h2></div>';
  240. $item .= '
  241. <script>
  242. // Plex Stream
  243. homepageStream("plex", "' . $GLOBALS['homepageStreamRefresh'] . '");
  244. // End Plex Stream
  245. </script>
  246. ';
  247. }
  248. break;
  249. case 'homepageOrderplexrecent':
  250. if ($GLOBALS['homepagePlexRecent']) {
  251. $item .= '<div class="white-box"><h2 class="text-center" lang="en">Loading Recent...</h2></div>';
  252. $item .= '
  253. <script>
  254. // Plex Recent
  255. homepageRecent("plex", "' . $GLOBALS['homepageRecentRefresh'] . '");
  256. // End Plex Recent
  257. </script>
  258. ';
  259. }
  260. break;
  261. case 'homepageOrderplexplaylist':
  262. if ($GLOBALS['homepagePlexPlaylist']) {
  263. $item .= '<div class="white-box"><h2 class="text-center" lang="en">Loading Playlists...</h2></div>';
  264. $item .= '
  265. <script>
  266. // Plex Playlist
  267. homepagePlaylist("plex");
  268. // End Plex Playlist
  269. </script>
  270. ';
  271. }
  272. break;
  273. case 'homepageOrderembynowplaying':
  274. if ($GLOBALS['homepageEmbyStreams'] && $GLOBALS['homepageEmbyEnabled']) {
  275. $item .= '<div class="white-box"><h2 class="text-center" lang="en">Loading Now Playing...</h2></div>';
  276. $item .= '
  277. <script>
  278. // Emby Stream
  279. homepageStream("emby", "' . $GLOBALS['homepageStreamRefresh'] . '");
  280. // End Emby Stream
  281. </script>
  282. ';
  283. }
  284. break;
  285. case 'homepageOrderembyrecent':
  286. if ($GLOBALS['homepageEmbyRecent'] && $GLOBALS['homepageEmbyEnabled']) {
  287. $item .= '<div class="white-box"><h2 class="text-center" lang="en">Loading Recent...</h2></div>';
  288. $item .= '
  289. <script>
  290. // Emby Recent
  291. homepageRecent("emby", "' . $GLOBALS['homepageRecentRefresh'] . '");
  292. // End Emby Recent
  293. </script>
  294. ';
  295. }
  296. break;
  297. case 'homepageOrderombi':
  298. if ($GLOBALS['homepageOmbiEnabled']) {
  299. $item .= '<div class="white-box"><h2 class="text-center" lang="en">Loading Requests...</h2></div>';
  300. $item .= '
  301. <script>
  302. // Ombi Requests
  303. homepageRequests("' . $GLOBALS['ombiRefresh'] . '");
  304. // End Ombi Requests
  305. </script>
  306. ';
  307. }
  308. break;
  309. case 'homepageOrdercalendar':
  310. if ($GLOBALS['homepageLidarrEnabled'] && qualifyRequest($GLOBALS['homepageLidarrAuth']) || $GLOBALS['homepageSonarrEnabled'] && qualifyRequest($GLOBALS['homepageSonarrAuth']) || ($GLOBALS['homepageRadarrEnabled'] && qualifyRequest($GLOBALS['homepageRadarrAuth'])) || ($GLOBALS['homepageSickrageEnabled'] && qualifyRequest($GLOBALS['homepageSickrageAuth'])) || ($GLOBALS['homepageCouchpotatoEnabled'] && qualifyRequest($GLOBALS['homepageCouchpotatoAuth'])) || ($GLOBALS['homepageCalendarEnabled'] && qualifyRequest($GLOBALS['homepageCalendarAuth']) && $GLOBALS['calendariCal'] !== '')) {
  311. $item .= '
  312. <div id="calendar" class="fc fc-ltr m-b-30"></div>
  313. <script>
  314. // Calendar
  315. homepageCalendar("' . $GLOBALS['calendarRefresh'] . '");
  316. // End Calendar
  317. </script>
  318. ';
  319. }
  320. break;
  321. case 'homepageOrderhealthchecks':
  322. if ($GLOBALS['homepageHealthChecksEnabled'] && qualifyRequest($GLOBALS['homepageHealthChecksAuth'])) {
  323. $item .= '<div class="white-box"><h2 class="text-center" lang="en">Loading Health Checks...</h2></div>';
  324. $item .= '
  325. <script>
  326. // Health Checks
  327. homepageHealthChecks("' . $GLOBALS['healthChecksTags'] . '","' . $GLOBALS['homepageHealthChecksRefresh'] . '");
  328. // End Health Checks
  329. </script>
  330. ';
  331. }
  332. break;
  333. case 'homepageOrderunifi':
  334. if ($GLOBALS['homepageUnifiEnabled'] && qualifyRequest($GLOBALS['homepageUnifiAuth'])) {
  335. $item .= '<div class="white-box"><h2 class="text-center" lang="en">Loading Unifi...</h2></div>';
  336. $item .= '
  337. <script>
  338. // Unifi
  339. homepageUnifi("' . $GLOBALS['homepageHealthChecksRefresh'] . '");
  340. // End Unifi
  341. </script>
  342. ';
  343. }
  344. break;
  345. case 'homepageOrdertautulli':
  346. if ($GLOBALS['homepageTautulliEnabled'] && qualifyRequest($GLOBALS['homepageTautulliAuth'])) {
  347. $item .= '<div class="white-box"><h2 class="text-center" lang="en">Loading Tautulli...</h2></div>';
  348. $item .= '
  349. <script>
  350. // Tautulli
  351. homepageTautulli("' . $GLOBALS['homepageTautulliRefresh'] . '");
  352. // End Tautulli
  353. </script>
  354. ';
  355. }
  356. break;
  357. case 'homepageOrderPihole':
  358. if ($GLOBALS['homepagePiholeEnabled']) {
  359. $item .= '<div class="white-box"><h2 class="text-center" lang="en">Loading Pi-hole Stats...</h2></div>';
  360. $item .= '
  361. <script>
  362. // Pi-hole Stats
  363. homepagePihole("' . $GLOBALS['homepagePiholeRefresh'] . '");
  364. // End Pi-hole Stats
  365. </script>
  366. ';
  367. }
  368. break;
  369. case 'homepageOrderMonitorr':
  370. if ($GLOBALS['homepageMonitorrEnabled']) {
  371. $item .= '<div class="white-box"><h2 class="text-center" lang="en">Loading Monitorr...</h2></div>';
  372. $item .= '
  373. <script>
  374. // Monitorr
  375. homepageMonitorr("' . $GLOBALS['homepageMonitorrRefresh'] . '");
  376. // End Monitorr
  377. </script>
  378. ';
  379. }
  380. break;
  381. case 'homepageOrderWeatherAndAir':
  382. if ($GLOBALS['homepageWeatherAndAirEnabled']) {
  383. $item .= '<div class="white-box"><h2 class="text-center" lang="en">Loading Weather And Air...</h2></div>';
  384. $item .= '
  385. <script>
  386. // Weather And Air
  387. homepageWeatherAndAir("' . $GLOBALS['homepageWeatherAndAirRefresh'] . '");
  388. // End Weather And Air
  389. </script>
  390. ';
  391. }
  392. break;
  393. case 'homepageOrderSpeedtest':
  394. if ($GLOBALS['homepageSpeedtestEnabled']) {
  395. $item .= '<div class="white-box"><h2 class="text-center" lang="en">Loading Speedtest...</h2></div>';
  396. $item .= '
  397. <script>
  398. // Speedtest
  399. homepageSpeedtest("' . $GLOBALS['homepageSpeedtestRefresh'] . '");
  400. // End Speedtest
  401. </script>
  402. ';
  403. }
  404. break;
  405. case 'homepageOrderNetdata':
  406. if ($GLOBALS['homepageNetdataEnabled']) {
  407. $item .= '<div class="white-box"><h2 class="text-center" lang="en">Loading Netdata...</h2></div>';
  408. $item .= '
  409. <script>
  410. // Netdata
  411. homepageNetdata("' . $GLOBALS['homepageNetdataRefresh'] . '");
  412. // End Netdata
  413. </script>
  414. ';
  415. }
  416. break;
  417. case 'homepageOrderOctoprint':
  418. if ($GLOBALS['homepageOctoprintEnabled']) {
  419. $item .= '<div class="white-box"><h2 class="text-center" lang="en">Loading Octoprint...</h2></div>';
  420. $item .= '
  421. <script>
  422. // Octoprint
  423. homepageOctoprint("' . $GLOBALS['homepageOctoprintRefresh'] . '");
  424. // End Octoprint
  425. </script>
  426. ';
  427. }
  428. case 'homepageOrderSonarrQueue':
  429. if ($GLOBALS['homepageSonarrQueueEnabled'] && qualifyRequest($GLOBALS['homepageSonarrQueueAuth'])) {
  430. if ($GLOBALS['homepageSonarrQueueCombine']) {
  431. $item .= '
  432. <script>
  433. // Sonarr Queue
  434. buildDownloaderCombined(\'sonarr\');
  435. homepageDownloader("sonarr", "' . $GLOBALS['homepageSonarrQueueRefresh'] . '");
  436. // End Sonarr Queue
  437. </script>
  438. ';
  439. } else {
  440. $item .= '<div class="white-box"><h2 class="text-center" lang="en">Loading Download Queue...</h2></div>';
  441. $item .= '
  442. <script>
  443. // Sonarr Queue
  444. $("#' . $homepageItem . '").html(buildDownloader("sonarr"));
  445. homepageDownloader("sonarr", "' . $GLOBALS['homepageSonarrQueueRefresh'] . '");
  446. // End Sonarr Queue
  447. </script>
  448. ';
  449. }
  450. }
  451. break;
  452. case 'homepageOrderRadarrQueue':
  453. if ($GLOBALS['homepageRadarrQueueEnabled'] && qualifyRequest($GLOBALS['homepageRadarrQueueAuth'])) {
  454. if ($GLOBALS['homepageRadarrQueueCombine']) {
  455. $item .= '
  456. <script>
  457. // Radarr Queue
  458. buildDownloaderCombined(\'radarr\');
  459. homepageDownloader("radarr", "' . $GLOBALS['homepageRadarrQueueRefresh'] . '");
  460. // End Radarr Queue
  461. </script>
  462. ';
  463. } else {
  464. $item .= '<div class="white-box"><h2 class="text-center" lang="en">Loading Download Queue...</h2></div>';
  465. $item .= '
  466. <script>
  467. // Radarr Queue
  468. $("#' . $homepageItem . '").html(buildDownloader("radarr"));
  469. homepageDownloader("radarr", "' . $GLOBALS['homepageRadarrQueueRefresh'] . '");
  470. // End Radarr Queue
  471. </script>
  472. ';
  473. }
  474. }
  475. break;
  476. default:
  477. # code...
  478. break;
  479. }
  480. return $item . '</div>';
  481. }
  482. function getHomepageList()
  483. {
  484. $groups = groupSelect();
  485. $ombiTvOptions = array(
  486. array(
  487. 'name' => 'All Seasons',
  488. 'value' => 'all'
  489. ),
  490. array(
  491. 'name' => 'First Season Only',
  492. 'value' => 'first'
  493. ),
  494. array(
  495. 'name' => 'Last Season Only',
  496. 'value' => 'last'
  497. ),
  498. );
  499. $mediaServers = array(
  500. array(
  501. 'name' => 'N/A',
  502. 'value' => ''
  503. ),
  504. array(
  505. 'name' => 'Plex',
  506. 'value' => 'plex'
  507. ),
  508. array(
  509. 'name' => 'Emby [Not Available]',
  510. 'value' => 'emby'
  511. )
  512. );
  513. $limit = array(
  514. array(
  515. 'name' => '1 Item',
  516. 'value' => '1'
  517. ),
  518. array(
  519. 'name' => '2 Items',
  520. 'value' => '2'
  521. ),
  522. array(
  523. 'name' => '3 Items',
  524. 'value' => '3'
  525. ),
  526. array(
  527. 'name' => '4 Items',
  528. 'value' => '4'
  529. ),
  530. array(
  531. 'name' => '5 Items',
  532. 'value' => '5'
  533. ),
  534. array(
  535. 'name' => '6 Items',
  536. 'value' => '6'
  537. ),
  538. array(
  539. 'name' => '7 Items',
  540. 'value' => '7'
  541. ),
  542. array(
  543. 'name' => '8 Items',
  544. 'value' => '8'
  545. ),
  546. array(
  547. 'name' => 'Unlimited',
  548. 'value' => '1000'
  549. ),
  550. );
  551. $day = array(
  552. array(
  553. 'name' => 'Sunday',
  554. 'value' => '0'
  555. ),
  556. array(
  557. 'name' => 'Monday',
  558. 'value' => '1'
  559. ),
  560. array(
  561. 'name' => 'Tueday',
  562. 'value' => '2'
  563. ),
  564. array(
  565. 'name' => 'Wednesday',
  566. 'value' => '3'
  567. ),
  568. array(
  569. 'name' => 'Thursday',
  570. 'value' => '4'
  571. ),
  572. array(
  573. 'name' => 'Friday',
  574. 'value' => '5'
  575. ),
  576. array(
  577. 'name' => 'Saturday',
  578. 'value' => '6'
  579. )
  580. );
  581. $calendarDefault = array(
  582. array(
  583. 'name' => 'Month',
  584. 'value' => 'month'
  585. ),
  586. array(
  587. 'name' => 'Day',
  588. 'value' => 'basicDay'
  589. ),
  590. array(
  591. 'name' => 'Week',
  592. 'value' => 'basicWeek'
  593. ),
  594. array(
  595. 'name' => 'List',
  596. 'value' => 'list'
  597. )
  598. );
  599. $timeFormat = array(
  600. array(
  601. 'name' => '6p',
  602. 'value' => 'h(:mm)t'
  603. ),
  604. array(
  605. 'name' => '6:00p',
  606. 'value' => 'h:mmt'
  607. ),
  608. array(
  609. 'name' => '6:00',
  610. 'value' => 'h:mm'
  611. ),
  612. array(
  613. 'name' => '18',
  614. 'value' => 'H(:mm)'
  615. ),
  616. array(
  617. 'name' => '18:00',
  618. 'value' => 'H:mm'
  619. )
  620. );
  621. $rTorrentSortOptions = array(
  622. array(
  623. 'name' => 'Date Desc',
  624. 'value' => 'dated'
  625. ),
  626. array(
  627. 'name' => 'Date Asc',
  628. 'value' => 'datea'
  629. ),
  630. array(
  631. 'name' => 'Hash Desc',
  632. 'value' => 'hashd'
  633. ),
  634. array(
  635. 'name' => 'Hash Asc',
  636. 'value' => 'hasha'
  637. ),
  638. array(
  639. 'name' => 'Name Desc',
  640. 'value' => 'named'
  641. ),
  642. array(
  643. 'name' => 'Name Asc',
  644. 'value' => 'namea'
  645. ),
  646. array(
  647. 'name' => 'Size Desc',
  648. 'value' => 'sized'
  649. ),
  650. array(
  651. 'name' => 'Size Asc',
  652. 'value' => 'sizea'
  653. ),
  654. array(
  655. 'name' => 'Label Desc',
  656. 'value' => 'labeld'
  657. ),
  658. array(
  659. 'name' => 'Label Asc',
  660. 'value' => 'labela'
  661. ),
  662. array(
  663. 'name' => 'Status Desc',
  664. 'value' => 'statusd'
  665. ),
  666. array(
  667. 'name' => 'Status Asc',
  668. 'value' => 'statusa'
  669. ),
  670. );
  671. $qBittorrentApiOptions = array(
  672. array(
  673. 'name' => 'V1',
  674. 'value' => '1'
  675. ),
  676. array(
  677. 'name' => 'V2',
  678. 'value' => '2'
  679. ),
  680. );
  681. $qBittorrentSortOptions = array(
  682. array(
  683. 'name' => 'Hash',
  684. 'value' => 'hash'
  685. ),
  686. array(
  687. 'name' => 'Name',
  688. 'value' => 'name'
  689. ),
  690. array(
  691. 'name' => 'Size',
  692. 'value' => 'size'
  693. ),
  694. array(
  695. 'name' => 'Progress',
  696. 'value' => 'progress'
  697. ),
  698. array(
  699. 'name' => 'Download Speed',
  700. 'value' => 'dlspeed'
  701. ),
  702. array(
  703. 'name' => 'Upload Speed',
  704. 'value' => 'upspeed'
  705. ),
  706. array(
  707. 'name' => 'Priority',
  708. 'value' => 'priority'
  709. ),
  710. array(
  711. 'name' => 'Number of Seeds',
  712. 'value' => 'num_seeds'
  713. ),
  714. array(
  715. 'name' => 'Number of Seeds in Swarm',
  716. 'value' => 'num_complete'
  717. ),
  718. array(
  719. 'name' => 'Number of Leechers',
  720. 'value' => 'num_leechs'
  721. ),
  722. array(
  723. 'name' => 'Number of Leechers in Swarm',
  724. 'value' => 'num_incomplete'
  725. ),
  726. array(
  727. 'name' => 'Ratio',
  728. 'value' => 'ratio'
  729. ),
  730. array(
  731. 'name' => 'ETA',
  732. 'value' => 'eta'
  733. ),
  734. array(
  735. 'name' => 'State',
  736. 'value' => 'state'
  737. ),
  738. array(
  739. 'name' => 'Category',
  740. 'value' => 'category'
  741. )
  742. );
  743. $xmlStatus = (extension_loaded('xmlrpc')) ? 'Installed' : 'Not Installed';
  744. return array(
  745. array(
  746. 'name' => 'Calendar',
  747. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  748. 'image' => 'plugins/images/tabs/calendar.png',
  749. 'category' => 'HOMEPAGE',
  750. 'settings' => array(
  751. 'Enable' => array(
  752. array(
  753. 'type' => 'switch',
  754. 'name' => 'homepageCalendarEnabled',
  755. 'label' => 'Enable iCal',
  756. 'value' => $GLOBALS['homepageCalendarEnabled']
  757. ),
  758. array(
  759. 'type' => 'select',
  760. 'name' => 'homepageCalendarAuth',
  761. 'label' => 'Minimum Authentication',
  762. 'value' => $GLOBALS['homepageCalendarAuth'],
  763. 'options' => $groups
  764. ),
  765. array(
  766. 'type' => 'input',
  767. 'name' => 'calendariCal',
  768. 'label' => 'iCal URL\'s',
  769. 'value' => $GLOBALS['calendariCal'],
  770. 'placeholder' => 'separate by comma\'s'
  771. ),
  772. ),
  773. 'Misc Options' => array(
  774. array(
  775. 'type' => 'number',
  776. 'name' => 'calendarStart',
  777. 'label' => '# of Days Before',
  778. 'value' => $GLOBALS['calendarStart'],
  779. 'placeholder' => ''
  780. ),
  781. array(
  782. 'type' => 'number',
  783. 'name' => 'calendarEnd',
  784. 'label' => '# of Days After',
  785. 'value' => $GLOBALS['calendarEnd'],
  786. 'placeholder' => ''
  787. ),
  788. array(
  789. 'type' => 'select',
  790. 'name' => 'calendarFirstDay',
  791. 'label' => 'Start Day',
  792. 'value' => $GLOBALS['calendarFirstDay'],
  793. 'options' => $day
  794. ),
  795. array(
  796. 'type' => 'select',
  797. 'name' => 'calendarDefault',
  798. 'label' => 'Default View',
  799. 'value' => $GLOBALS['calendarDefault'],
  800. 'options' => $calendarDefault
  801. ),
  802. array(
  803. 'type' => 'select',
  804. 'name' => 'calendarTimeFormat',
  805. 'label' => 'Time Format',
  806. 'value' => $GLOBALS['calendarTimeFormat'],
  807. 'options' => $timeFormat
  808. ),
  809. array(
  810. 'type' => 'select',
  811. 'name' => 'calendarLimit',
  812. 'label' => 'Items Per Day',
  813. 'value' => $GLOBALS['calendarLimit'],
  814. 'options' => $limit
  815. ),
  816. array(
  817. 'type' => 'select',
  818. 'name' => 'calendarRefresh',
  819. 'label' => 'Refresh Seconds',
  820. 'value' => $GLOBALS['calendarRefresh'],
  821. 'options' => optionTime()
  822. )
  823. ),
  824. )
  825. ),
  826. array(
  827. 'name' => 'Plex',
  828. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  829. 'image' => 'plugins/images/tabs/plex.png',
  830. 'category' => 'Media Server',
  831. //'license' => $GLOBALS['license'],
  832. 'settings' => array(
  833. 'Enable' => array(
  834. array(
  835. 'type' => 'switch',
  836. 'name' => 'homepagePlexEnabled',
  837. 'label' => 'Enable',
  838. 'value' => $GLOBALS['homepagePlexEnabled']
  839. ),
  840. array(
  841. 'type' => 'select',
  842. 'name' => 'homepagePlexAuth',
  843. 'label' => 'Minimum Authentication',
  844. 'value' => $GLOBALS['homepagePlexAuth'],
  845. 'options' => $groups
  846. )
  847. ),
  848. 'Connection' => array(
  849. array(
  850. 'type' => 'input',
  851. 'name' => 'plexURL',
  852. 'label' => 'URL',
  853. 'value' => $GLOBALS['plexURL'],
  854. 'help' => 'Please make sure to use local IP address and port - You also may use local dns name too.',
  855. 'placeholder' => 'http(s)://hostname:port'
  856. ),
  857. array(
  858. 'type' => 'password-alt',
  859. 'name' => 'plexToken',
  860. 'label' => 'Token',
  861. 'value' => $GLOBALS['plexToken']
  862. ),
  863. array(
  864. 'type' => 'password-alt',
  865. 'name' => 'plexID',
  866. 'label' => 'Plex Machine',
  867. 'value' => $GLOBALS['plexID']
  868. )
  869. ),
  870. 'Active Streams' => array(
  871. array(
  872. 'type' => 'switch',
  873. 'name' => 'homepagePlexStreams',
  874. 'label' => 'Enable',
  875. 'value' => $GLOBALS['homepagePlexStreams']
  876. ),
  877. array(
  878. 'type' => 'select',
  879. 'name' => 'homepagePlexStreamsAuth',
  880. 'label' => 'Minimum Authorization',
  881. 'value' => $GLOBALS['homepagePlexStreamsAuth'],
  882. 'options' => $groups
  883. ),
  884. array(
  885. 'type' => 'switch',
  886. 'name' => 'homepageShowStreamNames',
  887. 'label' => 'User Information',
  888. 'value' => $GLOBALS['homepageShowStreamNames']
  889. ),
  890. array(
  891. 'type' => 'select',
  892. 'name' => 'homepageShowStreamNamesAuth',
  893. 'label' => 'Minimum Authorization',
  894. 'value' => $GLOBALS['homepageShowStreamNamesAuth'],
  895. 'options' => $groups
  896. ),
  897. array(
  898. 'type' => 'select',
  899. 'name' => 'homepageStreamRefresh',
  900. 'label' => 'Refresh Seconds',
  901. 'value' => $GLOBALS['homepageStreamRefresh'],
  902. 'options' => optionTime()
  903. ),
  904. ),
  905. 'Recent Items' => array(
  906. array(
  907. 'type' => 'switch',
  908. 'name' => 'homepagePlexRecent',
  909. 'label' => 'Enable',
  910. 'value' => $GLOBALS['homepagePlexRecent']
  911. ),
  912. array(
  913. 'type' => 'select',
  914. 'name' => 'homepagePlexRecentAuth',
  915. 'label' => 'Minimum Authorization',
  916. 'value' => $GLOBALS['homepagePlexRecentAuth'],
  917. 'options' => $groups
  918. ),
  919. array(
  920. 'type' => 'number',
  921. 'name' => 'homepageRecentLimit',
  922. 'label' => 'Item Limit',
  923. 'value' => $GLOBALS['homepageRecentLimit'],
  924. ),
  925. array(
  926. 'type' => 'select',
  927. 'name' => 'homepageRecentRefresh',
  928. 'label' => 'Refresh Seconds',
  929. 'value' => $GLOBALS['homepageRecentRefresh'],
  930. 'options' => optionTime()
  931. ),
  932. ),
  933. 'Media Search' => array(
  934. array(
  935. 'type' => 'switch',
  936. 'name' => 'mediaSearch',
  937. 'label' => 'Enable',
  938. 'value' => $GLOBALS['mediaSearch']
  939. ),
  940. array(
  941. 'type' => 'select',
  942. 'name' => 'mediaSearchAuth',
  943. 'label' => 'Minimum Authorization',
  944. 'value' => $GLOBALS['mediaSearchAuth'],
  945. 'options' => $groups
  946. ),
  947. array(
  948. 'type' => 'select',
  949. 'name' => 'mediaSearchType',
  950. 'label' => 'Media Server',
  951. 'value' => $GLOBALS['mediaSearchType'],
  952. 'options' => $mediaServers
  953. ),
  954. ),
  955. 'Playlists' => array(
  956. array(
  957. 'type' => 'switch',
  958. 'name' => 'homepagePlexPlaylist',
  959. 'label' => 'Enable',
  960. 'value' => $GLOBALS['homepagePlexPlaylist']
  961. ),
  962. array(
  963. 'type' => 'select',
  964. 'name' => 'homepagePlexPlaylistAuth',
  965. 'label' => 'Minimum Authorization',
  966. 'value' => $GLOBALS['homepagePlexPlaylistAuth'],
  967. 'options' => $groups
  968. ),
  969. ),
  970. 'Misc Options' => array(
  971. array(
  972. 'type' => 'input',
  973. 'name' => 'plexTabName',
  974. 'label' => 'Plex Tab Name',
  975. 'value' => $GLOBALS['plexTabName'],
  976. 'placeholder' => 'Only use if you have Plex in a reverse proxy'
  977. ),
  978. array(
  979. 'type' => 'input',
  980. 'name' => 'plexTabURL',
  981. 'label' => 'Plex Tab WAN URL',
  982. 'value' => $GLOBALS['plexTabURL'],
  983. 'placeholder' => 'http(s)://hostname:port'
  984. ),
  985. array(
  986. 'type' => 'select',
  987. 'name' => 'cacheImageSize',
  988. 'label' => 'Image Cache Size',
  989. 'value' => $GLOBALS['cacheImageSize'],
  990. 'options' => array(
  991. array(
  992. 'name' => 'Low',
  993. 'value' => '.5'
  994. ),
  995. array(
  996. 'name' => '1x',
  997. 'value' => '1'
  998. ),
  999. array(
  1000. 'name' => '2x',
  1001. 'value' => '2'
  1002. ),
  1003. array(
  1004. 'name' => '3x',
  1005. 'value' => '3'
  1006. )
  1007. )
  1008. )
  1009. ),
  1010. 'Test Connection' => array(
  1011. array(
  1012. 'type' => 'blank',
  1013. 'label' => 'Please Save before Testing'
  1014. ),
  1015. array(
  1016. 'type' => 'button',
  1017. 'label' => '',
  1018. 'icon' => 'fa fa-flask',
  1019. 'class' => 'pull-right',
  1020. 'text' => 'Test Connection',
  1021. 'attr' => 'onclick="testAPIConnection(\'plex\')"'
  1022. ),
  1023. )
  1024. )
  1025. ),
  1026. array(
  1027. 'name' => 'Emby-Jellyfin',
  1028. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1029. 'image' => 'plugins/images/tabs/emby.png',
  1030. 'category' => 'Media Server',
  1031. 'settings' => array(
  1032. 'Enable' => array(
  1033. array(
  1034. 'type' => 'switch',
  1035. 'name' => 'homepageEmbyEnabled',
  1036. 'label' => 'Enable',
  1037. 'value' => $GLOBALS['homepageEmbyEnabled']
  1038. ),
  1039. array(
  1040. 'type' => 'select',
  1041. 'name' => 'homepageEmbyAuth',
  1042. 'label' => 'Minimum Authentication',
  1043. 'value' => $GLOBALS['homepageEmbyAuth'],
  1044. 'options' => $groups
  1045. )
  1046. ),
  1047. 'Connection' => array(
  1048. array(
  1049. 'type' => 'input',
  1050. 'name' => 'embyURL',
  1051. 'label' => 'URL',
  1052. 'value' => $GLOBALS['embyURL'],
  1053. 'help' => 'Please make sure to use local IP address and port - You also may use local dns name too.',
  1054. 'placeholder' => 'http(s)://hostname:port'
  1055. ),
  1056. array(
  1057. 'type' => 'password-alt',
  1058. 'name' => 'embyToken',
  1059. 'label' => 'Token',
  1060. 'value' => $GLOBALS['embyToken']
  1061. ),
  1062. array(
  1063. 'type' => 'switch',
  1064. 'name' => 'homepageJellyfinInstead',
  1065. 'label' => 'Jellyfin',
  1066. 'value' => $GLOBALS['homepageJellyfinInstead']
  1067. )
  1068. ),
  1069. 'Active Streams' => array(
  1070. array(
  1071. 'type' => 'switch',
  1072. 'name' => 'homepageEmbyStreams',
  1073. 'label' => 'Enable',
  1074. 'value' => $GLOBALS['homepageEmbyStreams']
  1075. ),
  1076. array(
  1077. 'type' => 'select',
  1078. 'name' => 'homepageEmbyStreamsAuth',
  1079. 'label' => 'Minimum Authorization',
  1080. 'value' => $GLOBALS['homepageEmbyStreamsAuth'],
  1081. 'options' => $groups
  1082. ),
  1083. array(
  1084. 'type' => 'switch',
  1085. 'name' => 'homepageShowStreamNames',
  1086. 'label' => 'User Information',
  1087. 'value' => $GLOBALS['homepageShowStreamNames']
  1088. ),
  1089. array(
  1090. 'type' => 'select',
  1091. 'name' => 'homepageShowStreamNamesAuth',
  1092. 'label' => 'Minimum Authorization',
  1093. 'value' => $GLOBALS['homepageShowStreamNamesAuth'],
  1094. 'options' => $groups
  1095. ),
  1096. array(
  1097. 'type' => 'select',
  1098. 'name' => 'homepageStreamRefresh',
  1099. 'label' => 'Refresh Seconds',
  1100. 'value' => $GLOBALS['homepageStreamRefresh'],
  1101. 'options' => optionTime()
  1102. ),
  1103. ),
  1104. 'Recent Items' => array(
  1105. array(
  1106. 'type' => 'switch',
  1107. 'name' => 'homepageEmbyRecent',
  1108. 'label' => 'Enable',
  1109. 'value' => $GLOBALS['homepageEmbyRecent']
  1110. ),
  1111. array(
  1112. 'type' => 'select',
  1113. 'name' => 'homepageEmbyRecentAuth',
  1114. 'label' => 'Minimum Authorization',
  1115. 'value' => $GLOBALS['homepageEmbyRecentAuth'],
  1116. 'options' => $groups
  1117. ),
  1118. array(
  1119. 'type' => 'number',
  1120. 'name' => 'homepageRecentLimit',
  1121. 'label' => 'Item Limit',
  1122. 'value' => $GLOBALS['homepageRecentLimit'],
  1123. ),
  1124. array(
  1125. 'type' => 'select',
  1126. 'name' => 'homepageRecentRefresh',
  1127. 'label' => 'Refresh Seconds',
  1128. 'value' => $GLOBALS['homepageRecentRefresh'],
  1129. 'options' => optionTime()
  1130. ),
  1131. ),
  1132. 'Misc Options' => array(
  1133. array(
  1134. 'type' => 'input',
  1135. 'name' => 'embyTabName',
  1136. 'label' => 'Emby Tab Name',
  1137. 'value' => $GLOBALS['embyTabName'],
  1138. 'placeholder' => 'Only use if you have Emby in a reverse proxy'
  1139. ),
  1140. array(
  1141. 'type' => 'input',
  1142. 'name' => 'embyTabURL',
  1143. 'label' => 'Emby Tab WAN URL',
  1144. 'value' => $GLOBALS['embyTabURL'],
  1145. 'placeholder' => 'http(s)://hostname:port'
  1146. ),
  1147. array(
  1148. 'type' => 'select',
  1149. 'name' => 'cacheImageSize',
  1150. 'label' => 'Image Cache Size',
  1151. 'value' => $GLOBALS['cacheImageSize'],
  1152. 'options' => array(
  1153. array(
  1154. 'name' => 'Low',
  1155. 'value' => '.5'
  1156. ),
  1157. array(
  1158. 'name' => '1x',
  1159. 'value' => '1'
  1160. ),
  1161. array(
  1162. 'name' => '2x',
  1163. 'value' => '2'
  1164. ),
  1165. array(
  1166. 'name' => '3x',
  1167. 'value' => '3'
  1168. )
  1169. )
  1170. )
  1171. )
  1172. )
  1173. ),
  1174. array(
  1175. 'name' => 'JDownloader',
  1176. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1177. 'image' => 'plugins/images/tabs/jdownloader.png',
  1178. 'category' => 'Downloader',
  1179. 'settings' => array(
  1180. 'custom' => '
  1181. <div class="row">
  1182. <div class="col-lg-12">
  1183. <div class="panel panel-info">
  1184. <div class="panel-heading">
  1185. <span lang="en">Notice</span>
  1186. </div>
  1187. <div class="panel-wrapper collapse in" aria-expanded="true">
  1188. <div class="panel-body">
  1189. <ul class="list-icons">
  1190. <li><i class="fa fa-chevron-right text-danger"></i> <a href="https://pypi.org/project/myjd-api/" target="_blank">Download [myjd-api] Module</a></li>
  1191. <li><i class="fa fa-chevron-right text-danger"></i> Add <b>/api/myjd</b> to the URL if you are using <a href="https://pypi.org/project/RSScrawler/" target="_blank">RSScrawler</a></li>
  1192. </ul>
  1193. </div>
  1194. </div>
  1195. </div>
  1196. </div>
  1197. </div>
  1198. ',
  1199. 'Enable' => array(
  1200. array(
  1201. 'type' => 'switch',
  1202. 'name' => 'homepageJdownloaderEnabled',
  1203. 'label' => 'Enable',
  1204. 'value' => $GLOBALS['homepageJdownloaderEnabled']
  1205. ),
  1206. array(
  1207. 'type' => 'select',
  1208. 'name' => 'homepageJdownloaderAuth',
  1209. 'label' => 'Minimum Authentication',
  1210. 'value' => $GLOBALS['homepageJdownloaderAuth'],
  1211. 'options' => $groups
  1212. )
  1213. ),
  1214. 'Connection' => array(
  1215. array(
  1216. 'type' => 'input',
  1217. 'name' => 'jdownloaderURL',
  1218. 'label' => 'URL',
  1219. 'value' => $GLOBALS['jdownloaderURL'],
  1220. 'help' => 'Please make sure to use local IP address and port - You also may use local dns name too.',
  1221. 'placeholder' => 'http(s)://hostname:port'
  1222. )
  1223. ),
  1224. 'Misc Options' => array(
  1225. array(
  1226. 'type' => 'select',
  1227. 'name' => 'homepageDownloadRefresh',
  1228. 'label' => 'Refresh Seconds',
  1229. 'value' => $GLOBALS['homepageDownloadRefresh'],
  1230. 'options' => optionTime()
  1231. ),
  1232. array(
  1233. 'type' => 'switch',
  1234. 'name' => 'jdownloaderCombine',
  1235. 'label' => 'Add to Combined Downloader',
  1236. 'value' => $GLOBALS['jdownloaderCombine']
  1237. ),
  1238. ),
  1239. 'Test Connection' => array(
  1240. array(
  1241. 'type' => 'blank',
  1242. 'label' => 'Please Save before Testing'
  1243. ),
  1244. array(
  1245. 'type' => 'button',
  1246. 'label' => '',
  1247. 'icon' => 'fa fa-flask',
  1248. 'class' => 'pull-right',
  1249. 'text' => 'Test Connection',
  1250. 'attr' => 'onclick="testAPIConnection(\'jdownloader\')"'
  1251. ),
  1252. )
  1253. )
  1254. ),
  1255. array(
  1256. 'name' => 'SabNZBD',
  1257. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1258. 'image' => 'plugins/images/tabs/sabnzbd.png',
  1259. 'category' => 'Downloader',
  1260. 'settings' => array(
  1261. 'Enable' => array(
  1262. array(
  1263. 'type' => 'switch',
  1264. 'name' => 'homepageSabnzbdEnabled',
  1265. 'label' => 'Enable',
  1266. 'value' => $GLOBALS['homepageSabnzbdEnabled']
  1267. ),
  1268. array(
  1269. 'type' => 'select',
  1270. 'name' => 'homepageSabnzbdAuth',
  1271. 'label' => 'Minimum Authentication',
  1272. 'value' => $GLOBALS['homepageSabnzbdAuth'],
  1273. 'options' => $groups
  1274. )
  1275. ),
  1276. 'Connection' => array(
  1277. array(
  1278. 'type' => 'input',
  1279. 'name' => 'sabnzbdURL',
  1280. 'label' => 'URL',
  1281. 'value' => $GLOBALS['sabnzbdURL'],
  1282. 'help' => 'Please make sure to use local IP address and port - You also may use local dns name too.',
  1283. 'placeholder' => 'http(s)://hostname:port'
  1284. ),
  1285. array(
  1286. 'type' => 'password-alt',
  1287. 'name' => 'sabnzbdToken',
  1288. 'label' => 'Token',
  1289. 'value' => $GLOBALS['sabnzbdToken']
  1290. )
  1291. ),
  1292. 'Misc Options' => array(
  1293. array(
  1294. 'type' => 'select',
  1295. 'name' => 'homepageDownloadRefresh',
  1296. 'label' => 'Refresh Seconds',
  1297. 'value' => $GLOBALS['homepageDownloadRefresh'],
  1298. 'options' => optionTime()
  1299. ),
  1300. array(
  1301. 'type' => 'switch',
  1302. 'name' => 'sabnzbdCombine',
  1303. 'label' => 'Add to Combined Downloader',
  1304. 'value' => $GLOBALS['sabnzbdCombine']
  1305. ),
  1306. ),
  1307. 'Test Connection' => array(
  1308. array(
  1309. 'type' => 'blank',
  1310. 'label' => 'Please Save before Testing'
  1311. ),
  1312. array(
  1313. 'type' => 'button',
  1314. 'label' => '',
  1315. 'icon' => 'fa fa-flask',
  1316. 'class' => 'pull-right',
  1317. 'text' => 'Test Connection',
  1318. 'attr' => 'onclick="testAPIConnection(\'sabnzbd\')"'
  1319. ),
  1320. )
  1321. )
  1322. ),
  1323. array(
  1324. 'name' => 'NZBGet',
  1325. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1326. 'image' => 'plugins/images/tabs/nzbget.png',
  1327. 'category' => 'Downloader',
  1328. 'settings' => array(
  1329. 'Enable' => array(
  1330. array(
  1331. 'type' => 'switch',
  1332. 'name' => 'homepageNzbgetEnabled',
  1333. 'label' => 'Enable',
  1334. 'value' => $GLOBALS['homepageNzbgetEnabled']
  1335. ),
  1336. array(
  1337. 'type' => 'select',
  1338. 'name' => 'homepageNzbgetAuth',
  1339. 'label' => 'Minimum Authentication',
  1340. 'value' => $GLOBALS['homepageNzbgetAuth'],
  1341. 'options' => $groups
  1342. )
  1343. ),
  1344. 'Connection' => array(
  1345. array(
  1346. 'type' => 'input',
  1347. 'name' => 'nzbgetURL',
  1348. 'label' => 'URL',
  1349. 'value' => $GLOBALS['nzbgetURL'],
  1350. 'help' => 'Please make sure to use local IP address and port - You also may use local dns name too.',
  1351. 'placeholder' => 'http(s)://hostname:port'
  1352. ),
  1353. array(
  1354. 'type' => 'input',
  1355. 'name' => 'nzbgetUsername',
  1356. 'label' => 'Username',
  1357. 'value' => $GLOBALS['nzbgetUsername']
  1358. ),
  1359. array(
  1360. 'type' => 'password',
  1361. 'name' => 'nzbgetPassword',
  1362. 'label' => 'Password',
  1363. 'value' => $GLOBALS['nzbgetPassword']
  1364. )
  1365. ),
  1366. 'Misc Options' => array(
  1367. array(
  1368. 'type' => 'select',
  1369. 'name' => 'homepageDownloadRefresh',
  1370. 'label' => 'Refresh Seconds',
  1371. 'value' => $GLOBALS['homepageDownloadRefresh'],
  1372. 'options' => optionTime()
  1373. ),
  1374. array(
  1375. 'type' => 'switch',
  1376. 'name' => 'nzbgetCombine',
  1377. 'label' => 'Add to Combined Downloader',
  1378. 'value' => $GLOBALS['nzbgetCombine']
  1379. ),
  1380. ),
  1381. 'Test Connection' => array(
  1382. array(
  1383. 'type' => 'blank',
  1384. 'label' => 'Please Save before Testing'
  1385. ),
  1386. array(
  1387. 'type' => 'button',
  1388. 'label' => '',
  1389. 'icon' => 'fa fa-flask',
  1390. 'class' => 'pull-right',
  1391. 'text' => 'Test Connection',
  1392. 'attr' => 'onclick="testAPIConnection(\'nzbget\')"'
  1393. ),
  1394. )
  1395. )
  1396. ),
  1397. array(
  1398. 'name' => 'Transmission',
  1399. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1400. 'image' => 'plugins/images/tabs/transmission.png',
  1401. 'category' => 'Downloader',
  1402. 'settings' => array(
  1403. 'Enable' => array(
  1404. array(
  1405. 'type' => 'switch',
  1406. 'name' => 'homepageTransmissionEnabled',
  1407. 'label' => 'Enable',
  1408. 'value' => $GLOBALS['homepageTransmissionEnabled']
  1409. ),
  1410. array(
  1411. 'type' => 'select',
  1412. 'name' => 'homepageTransmissionAuth',
  1413. 'label' => 'Minimum Authentication',
  1414. 'value' => $GLOBALS['homepageTransmissionAuth'],
  1415. 'options' => $groups
  1416. )
  1417. ),
  1418. 'Connection' => array(
  1419. array(
  1420. 'type' => 'input',
  1421. 'name' => 'transmissionURL',
  1422. 'label' => 'URL',
  1423. 'value' => $GLOBALS['transmissionURL'],
  1424. 'help' => 'Please make sure to use local IP address and port - You also may use local dns name too.',
  1425. 'placeholder' => 'http(s)://hostname:port'
  1426. ),
  1427. array(
  1428. 'type' => 'input',
  1429. 'name' => 'transmissionUsername',
  1430. 'label' => 'Username',
  1431. 'value' => $GLOBALS['transmissionUsername']
  1432. ),
  1433. array(
  1434. 'type' => 'password',
  1435. 'name' => 'transmissionPassword',
  1436. 'label' => 'Password',
  1437. 'value' => $GLOBALS['transmissionPassword']
  1438. )
  1439. ),
  1440. 'Misc Options' => array(
  1441. array(
  1442. 'type' => 'switch',
  1443. 'name' => 'transmissionHideSeeding',
  1444. 'label' => 'Hide Seeding',
  1445. 'value' => $GLOBALS['transmissionHideSeeding']
  1446. ), array(
  1447. 'type' => 'switch',
  1448. 'name' => 'transmissionHideCompleted',
  1449. 'label' => 'Hide Completed',
  1450. 'value' => $GLOBALS['transmissionHideCompleted']
  1451. ),
  1452. array(
  1453. 'type' => 'select',
  1454. 'name' => 'homepageDownloadRefresh',
  1455. 'label' => 'Refresh Seconds',
  1456. 'value' => $GLOBALS['homepageDownloadRefresh'],
  1457. 'options' => optionTime()
  1458. ),
  1459. array(
  1460. 'type' => 'switch',
  1461. 'name' => 'transmissionCombine',
  1462. 'label' => 'Add to Combined Downloader',
  1463. 'value' => $GLOBALS['transmissionCombine']
  1464. ),
  1465. )
  1466. )
  1467. ),
  1468. array(
  1469. 'name' => 'qBittorrent',
  1470. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1471. 'image' => 'plugins/images/tabs/qBittorrent.png',
  1472. 'category' => 'Downloader',
  1473. 'settings' => array(
  1474. 'Enable' => array(
  1475. array(
  1476. 'type' => 'switch',
  1477. 'name' => 'homepageqBittorrentEnabled',
  1478. 'label' => 'Enable',
  1479. 'value' => $GLOBALS['homepageqBittorrentEnabled']
  1480. ),
  1481. array(
  1482. 'type' => 'select',
  1483. 'name' => 'homepageqBittorrentAuth',
  1484. 'label' => 'Minimum Authentication',
  1485. 'value' => $GLOBALS['homepageqBittorrentAuth'],
  1486. 'options' => $groups
  1487. )
  1488. ),
  1489. 'Connection' => array(
  1490. array(
  1491. 'type' => 'input',
  1492. 'name' => 'qBittorrentURL',
  1493. 'label' => 'URL',
  1494. 'value' => $GLOBALS['qBittorrentURL'],
  1495. 'help' => 'Please make sure to use local IP address and port - You also may use local dns name too.',
  1496. 'placeholder' => 'http(s)://hostname:port'
  1497. ),
  1498. array(
  1499. 'type' => 'select',
  1500. 'name' => 'qBittorrentApiVersion',
  1501. 'label' => 'API Version',
  1502. 'value' => $GLOBALS['qBittorrentApiVersion'],
  1503. 'options' => $qBittorrentApiOptions
  1504. ),
  1505. array(
  1506. 'type' => 'input',
  1507. 'name' => 'qBittorrentUsername',
  1508. 'label' => 'Username',
  1509. 'value' => $GLOBALS['qBittorrentUsername']
  1510. ),
  1511. array(
  1512. 'type' => 'password',
  1513. 'name' => 'qBittorrentPassword',
  1514. 'label' => 'Password',
  1515. 'value' => $GLOBALS['qBittorrentPassword']
  1516. )
  1517. ),
  1518. 'Misc Options' => array(
  1519. array(
  1520. 'type' => 'switch',
  1521. 'name' => 'qBittorrentHideSeeding',
  1522. 'label' => 'Hide Seeding',
  1523. 'value' => $GLOBALS['qBittorrentHideSeeding']
  1524. ),
  1525. array(
  1526. 'type' => 'switch',
  1527. 'name' => 'qBittorrentHideCompleted',
  1528. 'label' => 'Hide Completed',
  1529. 'value' => $GLOBALS['qBittorrentHideCompleted']
  1530. ),
  1531. array(
  1532. 'type' => 'select',
  1533. 'name' => 'qBittorrentSortOrder',
  1534. 'label' => 'Order',
  1535. 'value' => $GLOBALS['qBittorrentSortOrder'],
  1536. 'options' => $qBittorrentSortOptions
  1537. ), array(
  1538. 'type' => 'switch',
  1539. 'name' => 'qBittorrentReverseSorting',
  1540. 'label' => 'Reverse Sorting',
  1541. 'value' => $GLOBALS['qBittorrentReverseSorting']
  1542. ),
  1543. array(
  1544. 'type' => 'select',
  1545. 'name' => 'homepageDownloadRefresh',
  1546. 'label' => 'Refresh Seconds',
  1547. 'value' => $GLOBALS['homepageDownloadRefresh'],
  1548. 'options' => optionTime()
  1549. ),
  1550. array(
  1551. 'type' => 'switch',
  1552. 'name' => 'qBittorrentCombine',
  1553. 'label' => 'Add to Combined Downloader',
  1554. 'value' => $GLOBALS['qBittorrentCombine']
  1555. ),
  1556. )
  1557. )
  1558. ),
  1559. array(
  1560. 'name' => 'rTorrent',
  1561. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1562. 'image' => 'plugins/images/tabs/rTorrent.png',
  1563. 'category' => 'Downloader',
  1564. 'settings' => array(
  1565. 'FYI' => array(
  1566. array(
  1567. 'type' => 'html',
  1568. 'label' => '',
  1569. 'override' => 12,
  1570. 'html' => '
  1571. <div class="row">
  1572. <div class="col-lg-12">
  1573. <div class="panel panel-info">
  1574. <div class="panel-heading">
  1575. <span lang="en">ATTENTION</span>
  1576. </div>
  1577. <div class="panel-wrapper collapse in" aria-expanded="true">
  1578. <div class="panel-body">
  1579. <h4 lang="en">This module requires XMLRPC</h4>
  1580. <span lang="en">Status: [ <b>' . $xmlStatus . '</b> ]</span>
  1581. <br/></br>
  1582. <span lang="en">
  1583. <h4><b>Note about API URL</b></h4>
  1584. Organizr appends the url with <code>/RPC2</code> unless the URL ends in <code>.php</code><br/>
  1585. <h5>Possible URLs:</h5>
  1586. <li>http://localhost:8080</li>
  1587. <li>https://domain.site/xmlrpc.php</li>
  1588. <li>https://seedbox.site/rutorrent/plugins/httprpc/action.php</li>
  1589. </span>
  1590. </div>
  1591. </div>
  1592. </div>
  1593. </div>
  1594. </div>
  1595. '
  1596. )
  1597. ),
  1598. 'Enable' => array(
  1599. array(
  1600. 'type' => 'switch',
  1601. 'name' => 'homepagerTorrentEnabled',
  1602. 'label' => 'Enable',
  1603. 'value' => $GLOBALS['homepagerTorrentEnabled']
  1604. ),
  1605. array(
  1606. 'type' => 'select',
  1607. 'name' => 'homepagerTorrentAuth',
  1608. 'label' => 'Minimum Authentication',
  1609. 'value' => $GLOBALS['homepagerTorrentAuth'],
  1610. 'options' => $groups
  1611. )
  1612. ),
  1613. 'Connection' => array(
  1614. array(
  1615. 'type' => 'input',
  1616. 'name' => 'rTorrentURL',
  1617. 'label' => 'URL',
  1618. 'value' => $GLOBALS['rTorrentURL'],
  1619. 'help' => 'Please make sure to use local IP address and port - You also may use local dns name too.',
  1620. 'placeholder' => 'http(s)://hostname:port'
  1621. ),
  1622. array(
  1623. 'type' => 'input',
  1624. 'name' => 'rTorrentURLOverride',
  1625. 'label' => 'rTorrent API URL Override',
  1626. 'value' => $GLOBALS['rTorrentURLOverride'],
  1627. 'help' => 'Only use if you cannot connect. Please make sure to use local IP address and port - You also may use local dns name too.',
  1628. 'placeholder' => 'http(s)://hostname:port/xmlrpc'
  1629. ),
  1630. array(
  1631. 'type' => 'input',
  1632. 'name' => 'rTorrentUsername',
  1633. 'label' => 'Username',
  1634. 'value' => $GLOBALS['rTorrentUsername']
  1635. ),
  1636. array(
  1637. 'type' => 'password',
  1638. 'name' => 'rTorrentPassword',
  1639. 'label' => 'Password',
  1640. 'value' => $GLOBALS['rTorrentPassword']
  1641. ),
  1642. array(
  1643. 'type' => 'switch',
  1644. 'name' => 'rTorrentDisableCertCheck',
  1645. 'label' => 'Disable Certificate Check',
  1646. 'value' => $GLOBALS['rTorrentDisableCertCheck']
  1647. ),
  1648. ),
  1649. 'Misc Options' => array(
  1650. array(
  1651. 'type' => 'switch',
  1652. 'name' => 'rTorrentHideSeeding',
  1653. 'label' => 'Hide Seeding',
  1654. 'value' => $GLOBALS['rTorrentHideSeeding']
  1655. ), array(
  1656. 'type' => 'switch',
  1657. 'name' => 'rTorrentHideCompleted',
  1658. 'label' => 'Hide Completed',
  1659. 'value' => $GLOBALS['rTorrentHideCompleted']
  1660. ),
  1661. array(
  1662. 'type' => 'select',
  1663. 'name' => 'rTorrentSortOrder',
  1664. 'label' => 'Order',
  1665. 'value' => $GLOBALS['rTorrentSortOrder'],
  1666. 'options' => $rTorrentSortOptions
  1667. ),
  1668. array(
  1669. 'type' => 'select',
  1670. 'name' => 'homepageDownloadRefresh',
  1671. 'label' => 'Refresh Seconds',
  1672. 'value' => $GLOBALS['homepageDownloadRefresh'],
  1673. 'options' => optionTime()
  1674. ),
  1675. array(
  1676. 'type' => 'number',
  1677. 'name' => 'rTorrentLimit',
  1678. 'label' => 'Item Limit',
  1679. 'value' => $GLOBALS['rTorrentLimit'],
  1680. ),
  1681. array(
  1682. 'type' => 'switch',
  1683. 'name' => 'rTorrentCombine',
  1684. 'label' => 'Add to Combined Downloader',
  1685. 'value' => $GLOBALS['rTorrentCombine']
  1686. ),
  1687. ),
  1688. 'Test Connection' => array(
  1689. array(
  1690. 'type' => 'blank',
  1691. 'label' => 'Please Save before Testing'
  1692. ),
  1693. array(
  1694. 'type' => 'button',
  1695. 'label' => '',
  1696. 'icon' => 'fa fa-flask',
  1697. 'class' => 'pull-right',
  1698. 'text' => 'Test Connection',
  1699. 'attr' => 'onclick="testAPIConnection(\'rtorrent\')"'
  1700. ),
  1701. )
  1702. )
  1703. ),
  1704. array(
  1705. 'name' => 'Deluge',
  1706. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1707. 'image' => 'plugins/images/tabs/deluge.png',
  1708. 'category' => 'Downloader',
  1709. 'settings' => array(
  1710. 'custom' => '
  1711. <div class="row">
  1712. <div class="col-lg-12">
  1713. <div class="panel panel-info">
  1714. <div class="panel-heading">
  1715. <span lang="en">Notice</span>
  1716. </div>
  1717. <div class="panel-wrapper collapse in" aria-expanded="true">
  1718. <div class="panel-body">
  1719. <ul class="list-icons">
  1720. <li><i class="fa fa-chevron-right text-danger"></i> <a href="https://github.com/idlesign/deluge-webapi/tree/master/dist" target="_blank">Download Plugin</a></li>
  1721. <li><i class="fa fa-chevron-right text-danger"></i> Open Deluge Web UI, go to "Preferences -> Plugins -> Install plugin" and choose egg file.</li>
  1722. <li><i class="fa fa-chevron-right text-danger"></i> Activate WebAPI plugin </li>
  1723. </ul>
  1724. </div>
  1725. </div>
  1726. </div>
  1727. </div>
  1728. </div>
  1729. ',
  1730. 'Enable' => array(
  1731. array(
  1732. 'type' => 'switch',
  1733. 'name' => 'homepageDelugeEnabled',
  1734. 'label' => 'Enable',
  1735. 'value' => $GLOBALS['homepageDelugeEnabled']
  1736. ),
  1737. array(
  1738. 'type' => 'select',
  1739. 'name' => 'homepageDelugeAuth',
  1740. 'label' => 'Minimum Authentication',
  1741. 'value' => $GLOBALS['homepageDelugeAuth'],
  1742. 'options' => $groups
  1743. )
  1744. ),
  1745. 'Connection' => array(
  1746. array(
  1747. 'type' => 'input',
  1748. 'name' => 'delugeURL',
  1749. 'label' => 'URL',
  1750. 'value' => $GLOBALS['delugeURL'],
  1751. 'help' => 'Please make sure to use local IP address and port - You also may use local dns name too.',
  1752. 'placeholder' => 'http(s)://hostname:port'
  1753. ),
  1754. array(
  1755. 'type' => 'password',
  1756. 'name' => 'delugePassword',
  1757. 'label' => 'Password',
  1758. 'value' => $GLOBALS['delugePassword']
  1759. )
  1760. ),
  1761. 'Misc Options' => array(
  1762. array(
  1763. 'type' => 'switch',
  1764. 'name' => 'delugeHideSeeding',
  1765. 'label' => 'Hide Seeding',
  1766. 'value' => $GLOBALS['delugeHideSeeding']
  1767. ), array(
  1768. 'type' => 'switch',
  1769. 'name' => 'delugeHideCompleted',
  1770. 'label' => 'Hide Completed',
  1771. 'value' => $GLOBALS['delugeHideCompleted']
  1772. ),
  1773. array(
  1774. 'type' => 'select',
  1775. 'name' => 'homepageDownloadRefresh',
  1776. 'label' => 'Refresh Seconds',
  1777. 'value' => $GLOBALS['homepageDownloadRefresh'],
  1778. 'options' => optionTime()
  1779. ),
  1780. array(
  1781. 'type' => 'switch',
  1782. 'name' => 'delugeCombine',
  1783. 'label' => 'Add to Combined Downloader',
  1784. 'value' => $GLOBALS['delugeCombine']
  1785. ),
  1786. ),
  1787. 'Test Connection' => array(
  1788. array(
  1789. 'type' => 'blank',
  1790. 'label' => 'Please Save before Testing'
  1791. ),
  1792. array(
  1793. 'type' => 'button',
  1794. 'label' => '',
  1795. 'icon' => 'fa fa-flask',
  1796. 'class' => 'pull-right',
  1797. 'text' => 'Test Connection',
  1798. 'attr' => 'onclick="testAPIConnection(\'deluge\')"'
  1799. ),
  1800. )
  1801. )
  1802. ),
  1803. array(
  1804. 'name' => 'Sonarr',
  1805. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1806. 'image' => 'plugins/images/tabs/sonarr.png',
  1807. 'category' => 'PVR',
  1808. 'settings' => array(
  1809. 'Enable' => array(
  1810. array(
  1811. 'type' => 'switch',
  1812. 'name' => 'homepageSonarrEnabled',
  1813. 'label' => 'Enable',
  1814. 'value' => $GLOBALS['homepageSonarrEnabled']
  1815. ),
  1816. array(
  1817. 'type' => 'select',
  1818. 'name' => 'homepageSonarrAuth',
  1819. 'label' => 'Minimum Authentication',
  1820. 'value' => $GLOBALS['homepageSonarrAuth'],
  1821. 'options' => $groups
  1822. )
  1823. ),
  1824. 'Connection' => array(
  1825. array(
  1826. 'type' => 'input',
  1827. 'name' => 'sonarrURL',
  1828. 'label' => 'URL',
  1829. 'value' => $GLOBALS['sonarrURL'],
  1830. 'help' => 'Please make sure to use local IP address and port - You also may use local dns name too.',
  1831. 'placeholder' => 'http(s)://hostname:port'
  1832. ),
  1833. array(
  1834. 'type' => 'password-alt',
  1835. 'name' => 'sonarrToken',
  1836. 'label' => 'Token',
  1837. 'value' => $GLOBALS['sonarrToken']
  1838. )
  1839. ),
  1840. 'Queue' => array(
  1841. array(
  1842. 'type' => 'switch',
  1843. 'name' => 'homepageSonarrQueueEnabled',
  1844. 'label' => 'Enable',
  1845. 'value' => $GLOBALS['homepageSonarrQueueEnabled']
  1846. ),
  1847. array(
  1848. 'type' => 'select',
  1849. 'name' => 'homepageSonarrQueueAuth',
  1850. 'label' => 'Minimum Authentication',
  1851. 'value' => $GLOBALS['homepageSonarrQueueAuth'],
  1852. 'options' => $groups
  1853. ),
  1854. array(
  1855. 'type' => 'switch',
  1856. 'name' => 'homepageSonarrQueueCombine',
  1857. 'label' => 'Add to Combined Downloader',
  1858. 'value' => $GLOBALS['homepageSonarrQueueCombine']
  1859. ),
  1860. array(
  1861. 'type' => 'select',
  1862. 'name' => 'homepageSonarrQueueRefresh',
  1863. 'label' => 'Refresh Seconds',
  1864. 'value' => $GLOBALS['homepageSonarrQueueRefresh'],
  1865. 'options' => optionTime()
  1866. ),
  1867. ),
  1868. 'Calendar' => array(
  1869. array(
  1870. 'type' => 'number',
  1871. 'name' => 'calendarStart',
  1872. 'label' => '# of Days Before',
  1873. 'value' => $GLOBALS['calendarStart'],
  1874. 'placeholder' => ''
  1875. ),
  1876. array(
  1877. 'type' => 'number',
  1878. 'name' => 'calendarEnd',
  1879. 'label' => '# of Days After',
  1880. 'value' => $GLOBALS['calendarEnd'],
  1881. 'placeholder' => ''
  1882. ),
  1883. array(
  1884. 'type' => 'select',
  1885. 'name' => 'calendarFirstDay',
  1886. 'label' => 'Start Day',
  1887. 'value' => $GLOBALS['calendarFirstDay'],
  1888. 'options' => $day
  1889. ),
  1890. array(
  1891. 'type' => 'select',
  1892. 'name' => 'calendarDefault',
  1893. 'label' => 'Default View',
  1894. 'value' => $GLOBALS['calendarDefault'],
  1895. 'options' => $calendarDefault
  1896. ),
  1897. array(
  1898. 'type' => 'select',
  1899. 'name' => 'calendarTimeFormat',
  1900. 'label' => 'Time Format',
  1901. 'value' => $GLOBALS['calendarTimeFormat'],
  1902. 'options' => $timeFormat
  1903. ),
  1904. array(
  1905. 'type' => 'select',
  1906. 'name' => 'calendarLimit',
  1907. 'label' => 'Items Per Day',
  1908. 'value' => $GLOBALS['calendarLimit'],
  1909. 'options' => $limit
  1910. ),
  1911. array(
  1912. 'type' => 'select',
  1913. 'name' => 'calendarRefresh',
  1914. 'label' => 'Refresh Seconds',
  1915. 'value' => $GLOBALS['calendarRefresh'],
  1916. 'options' => optionTime()
  1917. ),
  1918. array(
  1919. 'type' => 'switch',
  1920. 'name' => 'sonarrUnmonitored',
  1921. 'label' => 'Show Unmonitored',
  1922. 'value' => $GLOBALS['sonarrUnmonitored']
  1923. )
  1924. ),
  1925. 'Test Connection' => array(
  1926. array(
  1927. 'type' => 'blank',
  1928. 'label' => 'Please Save before Testing'
  1929. ),
  1930. array(
  1931. 'type' => 'button',
  1932. 'label' => '',
  1933. 'icon' => 'fa fa-flask',
  1934. 'class' => 'pull-right',
  1935. 'text' => 'Test Connection',
  1936. 'attr' => 'onclick="testAPIConnection(\'sonarr\')"'
  1937. ),
  1938. )
  1939. )
  1940. ),
  1941. array(
  1942. 'name' => 'Lidarr',
  1943. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1944. 'image' => 'plugins/images/tabs/lidarr.png',
  1945. 'category' => 'PMR',
  1946. 'settings' => array(
  1947. 'Enable' => array(
  1948. array(
  1949. 'type' => 'switch',
  1950. 'name' => 'homepageLidarrEnabled',
  1951. 'label' => 'Enable',
  1952. 'value' => $GLOBALS['homepageLidarrEnabled']
  1953. ),
  1954. array(
  1955. 'type' => 'select',
  1956. 'name' => 'homepageLidarrAuth',
  1957. 'label' => 'Minimum Authentication',
  1958. 'value' => $GLOBALS['homepageLidarrAuth'],
  1959. 'options' => $groups
  1960. )
  1961. ),
  1962. 'Connection' => array(
  1963. array(
  1964. 'type' => 'input',
  1965. 'name' => 'lidarrURL',
  1966. 'label' => 'URL',
  1967. 'value' => $GLOBALS['lidarrURL'],
  1968. 'help' => 'Please make sure to use local IP address and port - You also may use local dns name too.',
  1969. 'placeholder' => 'http(s)://hostname:port'
  1970. ),
  1971. array(
  1972. 'type' => 'password-alt',
  1973. 'name' => 'lidarrToken',
  1974. 'label' => 'Token',
  1975. 'value' => $GLOBALS['lidarrToken']
  1976. )
  1977. ),
  1978. 'Misc Options' => array(
  1979. array(
  1980. 'type' => 'number',
  1981. 'name' => 'calendarStart',
  1982. 'label' => '# of Days Before',
  1983. 'value' => $GLOBALS['calendarStart'],
  1984. 'placeholder' => ''
  1985. ),
  1986. array(
  1987. 'type' => 'number',
  1988. 'name' => 'calendarEnd',
  1989. 'label' => '# of Days After',
  1990. 'value' => $GLOBALS['calendarEnd'],
  1991. 'placeholder' => ''
  1992. ),
  1993. array(
  1994. 'type' => 'select',
  1995. 'name' => 'calendarFirstDay',
  1996. 'label' => 'Start Day',
  1997. 'value' => $GLOBALS['calendarFirstDay'],
  1998. 'options' => $day
  1999. ),
  2000. array(
  2001. 'type' => 'select',
  2002. 'name' => 'calendarDefault',
  2003. 'label' => 'Default View',
  2004. 'value' => $GLOBALS['calendarDefault'],
  2005. 'options' => $calendarDefault
  2006. ),
  2007. array(
  2008. 'type' => 'select',
  2009. 'name' => 'calendarTimeFormat',
  2010. 'label' => 'Time Format',
  2011. 'value' => $GLOBALS['calendarTimeFormat'],
  2012. 'options' => $timeFormat
  2013. ),
  2014. array(
  2015. 'type' => 'select',
  2016. 'name' => 'calendarLimit',
  2017. 'label' => 'Items Per Day',
  2018. 'value' => $GLOBALS['calendarLimit'],
  2019. 'options' => $limit
  2020. ),
  2021. array(
  2022. 'type' => 'select',
  2023. 'name' => 'calendarRefresh',
  2024. 'label' => 'Refresh Seconds',
  2025. 'value' => $GLOBALS['calendarRefresh'],
  2026. 'options' => optionTime()
  2027. ),
  2028. ),
  2029. 'Test Connection' => array(
  2030. array(
  2031. 'type' => 'blank',
  2032. 'label' => 'Please Save before Testing'
  2033. ),
  2034. array(
  2035. 'type' => 'button',
  2036. 'label' => '',
  2037. 'icon' => 'fa fa-flask',
  2038. 'class' => 'pull-right',
  2039. 'text' => 'Test Connection',
  2040. 'attr' => 'onclick="testAPIConnection(\'lidarr\')"'
  2041. ),
  2042. )
  2043. )
  2044. ),
  2045. array(
  2046. 'name' => 'Radarr',
  2047. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  2048. 'image' => 'plugins/images/tabs/radarr.png',
  2049. 'category' => 'PVR',
  2050. 'settings' => array(
  2051. 'Enable' => array(
  2052. array(
  2053. 'type' => 'switch',
  2054. 'name' => 'homepageRadarrEnabled',
  2055. 'label' => 'Enable',
  2056. 'value' => $GLOBALS['homepageRadarrEnabled']
  2057. ),
  2058. array(
  2059. 'type' => 'select',
  2060. 'name' => 'homepageRadarrAuth',
  2061. 'label' => 'Minimum Authentication',
  2062. 'value' => $GLOBALS['homepageRadarrAuth'],
  2063. 'options' => $groups
  2064. )
  2065. ),
  2066. 'Connection' => array(
  2067. array(
  2068. 'type' => 'input',
  2069. 'name' => 'radarrURL',
  2070. 'label' => 'URL',
  2071. 'value' => $GLOBALS['radarrURL'],
  2072. 'help' => 'Please make sure to use local IP address and port - You also may use local dns name too.',
  2073. 'placeholder' => 'http(s)://hostname:port'
  2074. ),
  2075. array(
  2076. 'type' => 'password-alt',
  2077. 'name' => 'radarrToken',
  2078. 'label' => 'Token',
  2079. 'value' => $GLOBALS['radarrToken']
  2080. )
  2081. ),
  2082. 'Queue' => array(
  2083. array(
  2084. 'type' => 'switch',
  2085. 'name' => 'homepageRadarrQueueEnabled',
  2086. 'label' => 'Enable',
  2087. 'value' => $GLOBALS['homepageRadarrQueueEnabled']
  2088. ),
  2089. array(
  2090. 'type' => 'select',
  2091. 'name' => 'homepageRadarrQueueAuth',
  2092. 'label' => 'Minimum Authentication',
  2093. 'value' => $GLOBALS['homepageRadarrQueueAuth'],
  2094. 'options' => $groups
  2095. ),
  2096. array(
  2097. 'type' => 'switch',
  2098. 'name' => 'homepageRadarrQueueCombine',
  2099. 'label' => 'Add to Combined Downloader',
  2100. 'value' => $GLOBALS['homepageRadarrQueueCombine']
  2101. ),
  2102. array(
  2103. 'type' => 'select',
  2104. 'name' => 'homepageRadarrQueueRefresh',
  2105. 'label' => 'Refresh Seconds',
  2106. 'value' => $GLOBALS['homepageRadarrQueueRefresh'],
  2107. 'options' => optionTime()
  2108. ),
  2109. ),
  2110. 'Calendar' => array(
  2111. array(
  2112. 'type' => 'number',
  2113. 'name' => 'calendarStart',
  2114. 'label' => '# of Days Before',
  2115. 'value' => $GLOBALS['calendarStart'],
  2116. 'placeholder' => ''
  2117. ),
  2118. array(
  2119. 'type' => 'number',
  2120. 'name' => 'calendarEnd',
  2121. 'label' => '# of Days After',
  2122. 'value' => $GLOBALS['calendarEnd'],
  2123. 'placeholder' => ''
  2124. ),
  2125. array(
  2126. 'type' => 'select',
  2127. 'name' => 'calendarFirstDay',
  2128. 'label' => 'Start Day',
  2129. 'value' => $GLOBALS['calendarFirstDay'],
  2130. 'options' => $day
  2131. ),
  2132. array(
  2133. 'type' => 'select',
  2134. 'name' => 'calendarDefault',
  2135. 'label' => 'Default View',
  2136. 'value' => $GLOBALS['calendarDefault'],
  2137. 'options' => $calendarDefault
  2138. ),
  2139. array(
  2140. 'type' => 'select',
  2141. 'name' => 'calendarTimeFormat',
  2142. 'label' => 'Time Format',
  2143. 'value' => $GLOBALS['calendarTimeFormat'],
  2144. 'options' => $timeFormat
  2145. ),
  2146. array(
  2147. 'type' => 'select',
  2148. 'name' => 'calendarLimit',
  2149. 'label' => 'Items Per Day',
  2150. 'value' => $GLOBALS['calendarLimit'],
  2151. 'options' => $limit
  2152. ),
  2153. array(
  2154. 'type' => 'select',
  2155. 'name' => 'calendarRefresh',
  2156. 'label' => 'Refresh Seconds',
  2157. 'value' => $GLOBALS['calendarRefresh'],
  2158. 'options' => optionTime()
  2159. )
  2160. ),
  2161. 'Test Connection' => array(
  2162. array(
  2163. 'type' => 'blank',
  2164. 'label' => 'Please Save before Testing'
  2165. ),
  2166. array(
  2167. 'type' => 'button',
  2168. 'label' => '',
  2169. 'icon' => 'fa fa-flask',
  2170. 'class' => 'pull-right',
  2171. 'text' => 'Test Connection',
  2172. 'attr' => 'onclick="testAPIConnection(\'radarr\')"'
  2173. ),
  2174. )
  2175. )
  2176. ),
  2177. array(
  2178. 'name' => 'CouchPotato',
  2179. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  2180. 'image' => 'plugins/images/tabs/couchpotato.png',
  2181. 'category' => 'PVR',
  2182. 'settings' => array(
  2183. 'Enable' => array(
  2184. array(
  2185. 'type' => 'switch',
  2186. 'name' => 'homepageCouchpotatoEnabled',
  2187. 'label' => 'Enable',
  2188. 'value' => $GLOBALS['homepageCouchpotatoEnabled']
  2189. ),
  2190. array(
  2191. 'type' => 'select',
  2192. 'name' => 'homepageCouchpotatoAuth',
  2193. 'label' => 'Minimum Authentication',
  2194. 'value' => $GLOBALS['homepageCouchpotatoAuth'],
  2195. 'options' => $groups
  2196. )
  2197. ),
  2198. 'Connection' => array(
  2199. array(
  2200. 'type' => 'input',
  2201. 'name' => 'couchpotatoURL',
  2202. 'label' => 'URL',
  2203. 'value' => $GLOBALS['couchpotatoURL'],
  2204. 'help' => 'Please make sure to use local IP address and port - You also may use local dns name too.',
  2205. 'placeholder' => 'http(s)://hostname:port'
  2206. ),
  2207. array(
  2208. 'type' => 'password-alt',
  2209. 'name' => 'couchpotatoToken',
  2210. 'label' => 'Token',
  2211. 'value' => $GLOBALS['couchpotatoToken']
  2212. )
  2213. ),
  2214. 'Misc Options' => array(
  2215. array(
  2216. 'type' => 'select',
  2217. 'name' => 'calendarFirstDay',
  2218. 'label' => 'Start Day',
  2219. 'value' => $GLOBALS['calendarFirstDay'],
  2220. 'options' => $day
  2221. ),
  2222. array(
  2223. 'type' => 'select',
  2224. 'name' => 'calendarDefault',
  2225. 'label' => 'Default View',
  2226. 'value' => $GLOBALS['calendarDefault'],
  2227. 'options' => $calendarDefault
  2228. ),
  2229. array(
  2230. 'type' => 'select',
  2231. 'name' => 'calendarTimeFormat',
  2232. 'label' => 'Time Format',
  2233. 'value' => $GLOBALS['calendarTimeFormat'],
  2234. 'options' => $timeFormat
  2235. ),
  2236. array(
  2237. 'type' => 'select',
  2238. 'name' => 'calendarLimit',
  2239. 'label' => 'Items Per Day',
  2240. 'value' => $GLOBALS['calendarLimit'],
  2241. 'options' => $limit
  2242. ),
  2243. array(
  2244. 'type' => 'select',
  2245. 'name' => 'calendarRefresh',
  2246. 'label' => 'Refresh Seconds',
  2247. 'value' => $GLOBALS['calendarRefresh'],
  2248. 'options' => optionTime()
  2249. )
  2250. )
  2251. )
  2252. ),
  2253. array(
  2254. 'name' => 'SickRage',
  2255. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  2256. 'image' => 'plugins/images/tabs/sickrage.png',
  2257. 'category' => 'PVR',
  2258. 'settings' => array(
  2259. 'Enable' => array(
  2260. array(
  2261. 'type' => 'switch',
  2262. 'name' => 'homepageSickrageEnabled',
  2263. 'label' => 'Enable',
  2264. 'value' => $GLOBALS['homepageSickrageEnabled']
  2265. ),
  2266. array(
  2267. 'type' => 'select',
  2268. 'name' => 'homepageSickrageAuth',
  2269. 'label' => 'Minimum Authentication',
  2270. 'value' => $GLOBALS['homepageSickrageAuth'],
  2271. 'options' => $groups
  2272. )
  2273. ),
  2274. 'Connection' => array(
  2275. array(
  2276. 'type' => 'input',
  2277. 'name' => 'sickrageURL',
  2278. 'label' => 'URL',
  2279. 'value' => $GLOBALS['sickrageURL'],
  2280. 'help' => 'Please make sure to use local IP address and port - You also may use local dns name too.',
  2281. 'placeholder' => 'http(s)://hostname:port'
  2282. ),
  2283. array(
  2284. 'type' => 'password-alt',
  2285. 'name' => 'sickrageToken',
  2286. 'label' => 'Token',
  2287. 'value' => $GLOBALS['sickrageToken']
  2288. )
  2289. ),
  2290. 'Misc Options' => array(
  2291. array(
  2292. 'type' => 'select',
  2293. 'name' => 'calendarFirstDay',
  2294. 'label' => 'Start Day',
  2295. 'value' => $GLOBALS['calendarFirstDay'],
  2296. 'options' => $day
  2297. ),
  2298. array(
  2299. 'type' => 'select',
  2300. 'name' => 'calendarDefault',
  2301. 'label' => 'Default View',
  2302. 'value' => $GLOBALS['calendarDefault'],
  2303. 'options' => $calendarDefault
  2304. ),
  2305. array(
  2306. 'type' => 'select',
  2307. 'name' => 'calendarTimeFormat',
  2308. 'label' => 'Time Format',
  2309. 'value' => $GLOBALS['calendarTimeFormat'],
  2310. 'options' => $timeFormat
  2311. ),
  2312. array(
  2313. 'type' => 'select',
  2314. 'name' => 'calendarLimit',
  2315. 'label' => 'Items Per Day',
  2316. 'value' => $GLOBALS['calendarLimit'],
  2317. 'options' => $limit
  2318. ),
  2319. array(
  2320. 'type' => 'select',
  2321. 'name' => 'calendarRefresh',
  2322. 'label' => 'Refresh Seconds',
  2323. 'value' => $GLOBALS['calendarRefresh'],
  2324. 'options' => optionTime()
  2325. )
  2326. )
  2327. )
  2328. ),
  2329. array(
  2330. 'name' => 'Ombi',
  2331. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  2332. 'image' => 'plugins/images/tabs/ombi.png',
  2333. 'category' => 'Requests',
  2334. 'settings' => array(
  2335. 'Enable' => array(
  2336. array(
  2337. 'type' => 'switch',
  2338. 'name' => 'homepageOmbiEnabled',
  2339. 'label' => 'Enable',
  2340. 'value' => $GLOBALS['homepageOmbiEnabled']
  2341. ),
  2342. array(
  2343. 'type' => 'select',
  2344. 'name' => 'homepageOmbiAuth',
  2345. 'label' => 'Minimum Authentication',
  2346. 'value' => $GLOBALS['homepageOmbiAuth'],
  2347. 'options' => $groups
  2348. )
  2349. ),
  2350. 'Connection' => array(
  2351. array(
  2352. 'type' => 'input',
  2353. 'name' => 'ombiURL',
  2354. 'label' => 'URL',
  2355. 'value' => $GLOBALS['ombiURL'],
  2356. 'help' => 'Please make sure to use local IP address and port - You also may use local dns name too.',
  2357. 'placeholder' => 'http(s)://hostname:port'
  2358. ),
  2359. array(
  2360. 'type' => 'password-alt',
  2361. 'name' => 'ombiToken',
  2362. 'label' => 'Token',
  2363. 'value' => $GLOBALS['ombiToken']
  2364. )
  2365. ),
  2366. 'Misc Options' => array(
  2367. array(
  2368. 'type' => 'select',
  2369. 'name' => 'homepageOmbiRequestAuth',
  2370. 'label' => 'Minimum Group to Request',
  2371. 'value' => $GLOBALS['homepageOmbiRequestAuth'],
  2372. 'options' => $groups
  2373. ),
  2374. array(
  2375. 'type' => 'select',
  2376. 'name' => 'ombiTvDefault',
  2377. 'label' => 'TV Show Default Request',
  2378. 'value' => $GLOBALS['ombiTvDefault'],
  2379. 'options' => $ombiTvOptions
  2380. ),
  2381. array(
  2382. 'type' => 'switch',
  2383. 'name' => 'ombiLimitUser',
  2384. 'label' => 'Limit to User',
  2385. 'value' => $GLOBALS['ombiLimitUser']
  2386. ),
  2387. array(
  2388. 'type' => 'number',
  2389. 'name' => 'ombiLimit',
  2390. 'label' => 'Item Limit',
  2391. 'value' => $GLOBALS['ombiLimit'],
  2392. ),
  2393. array(
  2394. 'type' => 'select',
  2395. 'name' => 'ombiRefresh',
  2396. 'label' => 'Refresh Seconds',
  2397. 'value' => $GLOBALS['ombiRefresh'],
  2398. 'options' => optionTime()
  2399. ),
  2400. array(
  2401. 'type' => 'switch',
  2402. 'name' => 'ombiAlias',
  2403. 'label' => 'Use Ombi Alias Names',
  2404. 'value' => $GLOBALS['ombiAlias'],
  2405. 'help' => 'Use Ombi Alias Names instead of Usernames - If Alias is blank, Alias will fallback to Username'
  2406. )
  2407. ),
  2408. 'Default Filter' => array(
  2409. array(
  2410. 'type' => 'switch',
  2411. 'name' => 'ombiDefaultFilterAvailable',
  2412. 'label' => 'Show Available',
  2413. 'value' => $GLOBALS['ombiDefaultFilterAvailable'],
  2414. 'help' => 'Show All Available Ombi Requests'
  2415. ),
  2416. array(
  2417. 'type' => 'switch',
  2418. 'name' => 'ombiDefaultFilterUnavailable',
  2419. 'label' => 'Show Unavailable',
  2420. 'value' => $GLOBALS['ombiDefaultFilterUnavailable'],
  2421. 'help' => 'Show All Unavailable Ombi Requests'
  2422. ),
  2423. array(
  2424. 'type' => 'switch',
  2425. 'name' => 'ombiDefaultFilterApproved',
  2426. 'label' => 'Show Approved',
  2427. 'value' => $GLOBALS['ombiDefaultFilterApproved'],
  2428. 'help' => 'Show All Approved Ombi Requests'
  2429. ),
  2430. array(
  2431. 'type' => 'switch',
  2432. 'name' => 'ombiDefaultFilterUnapproved',
  2433. 'label' => 'Show Unapproved',
  2434. 'value' => $GLOBALS['ombiDefaultFilterUnapproved'],
  2435. 'help' => 'Show All Unapproved Ombi Requests'
  2436. ),
  2437. array(
  2438. 'type' => 'switch',
  2439. 'name' => 'ombiDefaultFilterDenied',
  2440. 'label' => 'Show Denied',
  2441. 'value' => $GLOBALS['ombiDefaultFilterDenied'],
  2442. 'help' => 'Show All Denied Ombi Requests'
  2443. )
  2444. ),
  2445. 'Test Connection' => array(
  2446. array(
  2447. 'type' => 'blank',
  2448. 'label' => 'Please Save before Testing'
  2449. ),
  2450. array(
  2451. 'type' => 'button',
  2452. 'label' => '',
  2453. 'icon' => 'fa fa-flask',
  2454. 'class' => 'pull-right',
  2455. 'text' => 'Test Connection',
  2456. 'attr' => 'onclick="testAPIConnection(\'ombi\')"'
  2457. ),
  2458. )
  2459. )
  2460. ),
  2461. array(
  2462. 'name' => 'Unifi',
  2463. 'enabled' => true,
  2464. 'image' => 'plugins/images/tabs/ubnt.png',
  2465. 'category' => 'Monitor',
  2466. 'settings' => array(
  2467. 'Enable' => array(
  2468. array(
  2469. 'type' => 'switch',
  2470. 'name' => 'homepageUnifiEnabled',
  2471. 'label' => 'Enable',
  2472. 'value' => $GLOBALS['homepageUnifiEnabled']
  2473. ),
  2474. array(
  2475. 'type' => 'select',
  2476. 'name' => 'homepageUnifiAuth',
  2477. 'label' => 'Minimum Authentication',
  2478. 'value' => $GLOBALS['homepageUnifiAuth'],
  2479. 'options' => $groups
  2480. )
  2481. ),
  2482. 'Connection' => array(
  2483. array(
  2484. 'type' => 'input',
  2485. 'name' => 'unifiURL',
  2486. 'label' => 'URL',
  2487. 'value' => $GLOBALS['unifiURL'],
  2488. 'help' => 'URL for Unifi',
  2489. 'placeholder' => 'Unifi API URL'
  2490. ),
  2491. array(
  2492. 'type' => 'blank',
  2493. 'label' => ''
  2494. ),
  2495. array(
  2496. 'type' => 'input',
  2497. 'name' => 'unifiUsername',
  2498. 'label' => 'Username',
  2499. 'value' => $GLOBALS['unifiUsername']
  2500. ),
  2501. array(
  2502. 'type' => 'password',
  2503. 'name' => 'unifiPassword',
  2504. 'label' => 'Password',
  2505. 'value' => $GLOBALS['unifiPassword']
  2506. ),
  2507. array(
  2508. 'type' => 'input',
  2509. 'name' => 'unifiSiteName',
  2510. 'label' => 'Site Name',
  2511. 'value' => $GLOBALS['unifiSiteName'],
  2512. 'help' => 'Site Name - not Site ID nor Site Description',
  2513. ),
  2514. array(
  2515. 'type' => 'button',
  2516. 'label' => 'Grab Unifi Site',
  2517. 'icon' => 'fa fa-building',
  2518. 'text' => 'Get Unifi Site',
  2519. 'attr' => 'onclick="getUnifiSite(\'unifiSite\')"'
  2520. ),
  2521. ),
  2522. 'Misc Options' => array(
  2523. array(
  2524. 'type' => 'select',
  2525. 'name' => 'homepageUnifiRefresh',
  2526. 'label' => 'Refresh Seconds',
  2527. 'value' => $GLOBALS['homepageUnifiRefresh'],
  2528. 'options' => optionTime()
  2529. ),
  2530. ),
  2531. 'Test Connection' => array(
  2532. array(
  2533. 'type' => 'blank',
  2534. 'label' => 'Please Save before Testing'
  2535. ),
  2536. array(
  2537. 'type' => 'button',
  2538. 'label' => '',
  2539. 'icon' => 'fa fa-flask',
  2540. 'class' => 'pull-right',
  2541. 'text' => 'Test Connection',
  2542. 'attr' => 'onclick="testAPIConnection(\'unifi\')"'
  2543. ),
  2544. )
  2545. )
  2546. ),
  2547. array(
  2548. 'name' => 'HealthChecks',
  2549. 'enabled' => true,
  2550. 'image' => 'plugins/images/tabs/healthchecks.png',
  2551. 'category' => 'Monitor',
  2552. 'settings' => array(
  2553. 'Enable' => array(
  2554. array(
  2555. 'type' => 'switch',
  2556. 'name' => 'homepageHealthChecksEnabled',
  2557. 'label' => 'Enable',
  2558. 'value' => $GLOBALS['homepageHealthChecksEnabled']
  2559. ),
  2560. array(
  2561. 'type' => 'select',
  2562. 'name' => 'homepageHealthChecksAuth',
  2563. 'label' => 'Minimum Authentication',
  2564. 'value' => $GLOBALS['homepageHealthChecksAuth'],
  2565. 'options' => $groups
  2566. )
  2567. ),
  2568. 'Connection' => array(
  2569. array(
  2570. 'type' => 'input',
  2571. 'name' => 'healthChecksURL',
  2572. 'label' => 'URL',
  2573. 'value' => $GLOBALS['healthChecksURL'],
  2574. 'help' => 'URL for HealthChecks API',
  2575. 'placeholder' => 'HealthChecks API URL'
  2576. ),
  2577. array(
  2578. 'type' => 'password-alt',
  2579. 'name' => 'healthChecksToken',
  2580. 'label' => 'Token',
  2581. 'value' => $GLOBALS['healthChecksToken']
  2582. )
  2583. ),
  2584. 'Misc Options' => array(
  2585. array(
  2586. 'type' => 'input',
  2587. 'name' => 'healthChecksTags',
  2588. 'label' => 'Tags',
  2589. 'value' => $GLOBALS['healthChecksTags'],
  2590. 'help' => 'Pull only checks with this tag - Blank for all',
  2591. 'placeholder' => 'Multiple tags using CSV - tag1,tag2'
  2592. ),
  2593. array(
  2594. 'type' => 'select',
  2595. 'name' => 'homepageHealthChecksRefresh',
  2596. 'label' => 'Refresh Seconds',
  2597. 'value' => $GLOBALS['homepageHealthChecksRefresh'],
  2598. 'options' => optionTime()
  2599. ),
  2600. ),
  2601. )
  2602. ),
  2603. array(
  2604. 'name' => 'CustomHTML-1',
  2605. 'enabled' => (strpos('personal,business', $GLOBALS['license']) !== false) ? true : false,
  2606. 'image' => 'plugins/images/tabs/custom1.png',
  2607. 'category' => 'Custom',
  2608. 'settings' => array(
  2609. 'Enable' => array(
  2610. array(
  2611. 'type' => 'switch',
  2612. 'name' => 'homepagCustomHTMLoneEnabled',
  2613. 'label' => 'Enable',
  2614. 'value' => $GLOBALS['homepagCustomHTMLoneEnabled']
  2615. ),
  2616. array(
  2617. 'type' => 'select',
  2618. 'name' => 'homepagCustomHTMLoneAuth',
  2619. 'label' => 'Minimum Authentication',
  2620. 'value' => $GLOBALS['homepagCustomHTMLoneAuth'],
  2621. 'options' => $groups
  2622. )
  2623. ),
  2624. 'Code' => array(
  2625. array(
  2626. 'type' => 'textbox',
  2627. 'name' => 'customHTMLone',
  2628. 'class' => 'hidden customHTMLoneTextarea',
  2629. 'label' => '',
  2630. 'value' => $GLOBALS['customHTMLone'],
  2631. ),
  2632. array(
  2633. 'type' => 'html',
  2634. 'override' => 12,
  2635. 'label' => 'Custom HTML/JavaScript',
  2636. 'html' => '<button type="button" class="hidden savecustomHTMLoneTextarea btn btn-info btn-circle pull-right m-r-5 m-l-10"><i class="fa fa-save"></i> </button><div id="customHTMLoneEditor" style="height:300px">' . htmlentities($GLOBALS['customHTMLone']) . '</div>'
  2637. ),
  2638. )
  2639. )
  2640. ),
  2641. array(
  2642. 'name' => 'CustomHTML-2',
  2643. 'enabled' => (strpos('personal,business', $GLOBALS['license']) !== false) ? true : false,
  2644. 'image' => 'plugins/images/tabs/custom2.png',
  2645. 'category' => 'Custom',
  2646. 'settings' => array(
  2647. 'Enable' => array(
  2648. array(
  2649. 'type' => 'switch',
  2650. 'name' => 'homepagCustomHTMLtwoEnabled',
  2651. 'label' => 'Enable',
  2652. 'value' => $GLOBALS['homepagCustomHTMLtwoEnabled']
  2653. ),
  2654. array(
  2655. 'type' => 'select',
  2656. 'name' => 'homepagCustomHTMLtwoAuth',
  2657. 'label' => 'Minimum Authentication',
  2658. 'value' => $GLOBALS['homepagCustomHTMLtwoAuth'],
  2659. 'options' => $groups
  2660. )
  2661. ),
  2662. 'Code' => array(
  2663. array(
  2664. 'type' => 'textbox',
  2665. 'name' => 'customHTMLtwo',
  2666. 'class' => 'hidden customHTMLtwoTextarea',
  2667. 'label' => '',
  2668. 'value' => $GLOBALS['customHTMLtwo'],
  2669. ),
  2670. array(
  2671. 'type' => 'html',
  2672. 'override' => 12,
  2673. 'label' => 'Custom HTML/JavaScript',
  2674. 'html' => '<button type="button" class="hidden savecustomHTMLtwoTextarea btn btn-info btn-circle pull-right m-r-5 m-l-10"><i class="fa fa-save"></i> </button><div id="customHTMLtwoEditor" style="height:300px">' . htmlentities($GLOBALS['customHTMLtwo']) . '</div>'
  2675. ),
  2676. )
  2677. )
  2678. ),
  2679. array(
  2680. 'name' => 'Misc',
  2681. 'enabled' => true,
  2682. 'image' => 'plugins/images/organizr/logo-no-border.png',
  2683. 'category' => 'Custom',
  2684. 'settings' => array(
  2685. 'YouTube' => array(
  2686. array(
  2687. 'type' => 'input',
  2688. 'name' => 'youtubeAPI',
  2689. 'label' => 'Youtube API Key',
  2690. 'value' => $GLOBALS['youtubeAPI'],
  2691. 'help' => 'Please make sure to input this API key as the organizr one gets limited'
  2692. ),
  2693. array(
  2694. 'type' => 'html',
  2695. 'override' => 6,
  2696. 'label' => 'Instructions',
  2697. 'html' => '<a href="https://www.slickremix.com/docs/get-api-key-for-youtube/" target="_blank">Click here for instructions</a>'
  2698. ),
  2699. )
  2700. )
  2701. ),
  2702. array(
  2703. 'name' => 'Pi-hole',
  2704. 'enabled' => true,
  2705. 'image' => 'plugins/images/tabs/pihole.png',
  2706. 'category' => 'Monitor',
  2707. 'settings' => array(
  2708. 'Enable' => array(
  2709. array(
  2710. 'type' => 'switch',
  2711. 'name' => 'homepagePiholeEnabled',
  2712. 'label' => 'Enable',
  2713. 'value' => $GLOBALS['homepagePiholeEnabled']
  2714. ),
  2715. array(
  2716. 'type' => 'select',
  2717. 'name' => 'homepagePiholeAuth',
  2718. 'label' => 'Minimum Authentication',
  2719. 'value' => $GLOBALS['homepagePiholeAuth'],
  2720. 'options' => $groups
  2721. )
  2722. ),
  2723. 'Connection' => array(
  2724. array(
  2725. 'type' => 'input',
  2726. 'name' => 'piholeURL',
  2727. 'label' => 'URL',
  2728. 'value' => $GLOBALS['piholeURL'],
  2729. 'help' => 'Please make sure to use local IP address and port and to include \'/admin/\' at the end of the URL. You can add multiple Pi-holes by comma separating the URLs.',
  2730. 'placeholder' => 'http(s)://hostname:port/admin/'
  2731. ),
  2732. ),
  2733. 'Misc' => array(
  2734. array(
  2735. 'type' => 'switch',
  2736. 'name' => 'piholeHeaderToggle',
  2737. 'label' => 'Toggle Title',
  2738. 'value' => $GLOBALS['piholeHeaderToggle'],
  2739. 'help' => 'Shows/hides the title of this homepage module'
  2740. ),
  2741. array(
  2742. 'type' => 'switch',
  2743. 'name' => 'homepagePiholeCombine',
  2744. 'label' => 'Combine stat cards',
  2745. 'value' => $GLOBALS['homepagePiholeCombine'],
  2746. 'help' => 'This controls whether to combine the stats for multiple piholes into 1 card.',
  2747. ),
  2748. ),
  2749. )
  2750. ),
  2751. array(
  2752. 'name' => 'Tautulli',
  2753. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  2754. 'image' => 'plugins/images/tabs/tautulli.png',
  2755. 'category' => 'Monitor',
  2756. 'settings' => array(
  2757. 'Enable' => array(
  2758. array(
  2759. 'type' => 'switch',
  2760. 'name' => 'homepageTautulliEnabled',
  2761. 'label' => 'Enable',
  2762. 'value' => $GLOBALS['homepageTautulliEnabled']
  2763. ),
  2764. array(
  2765. 'type' => 'select',
  2766. 'name' => 'homepageTautulliAuth',
  2767. 'label' => 'Minimum Authentication',
  2768. 'value' => $GLOBALS['homepageTautulliAuth'],
  2769. 'options' => $groups
  2770. )
  2771. ),
  2772. 'Options' => array(
  2773. array(
  2774. 'type' => 'input',
  2775. 'name' => 'tautulliHeader',
  2776. 'label' => 'Title',
  2777. 'value' => $GLOBALS['tautulliHeader'],
  2778. 'help' => 'Sets the title of this homepage module'
  2779. ),
  2780. array(
  2781. 'type' => 'switch',
  2782. 'name' => 'tautulliHeaderToggle',
  2783. 'label' => 'Toggle Title',
  2784. 'value' => $GLOBALS['tautulliHeaderToggle'],
  2785. 'help' => 'Shows/hides the title of this homepage module'
  2786. )
  2787. ),
  2788. 'Connection' => array(
  2789. array(
  2790. 'type' => 'input',
  2791. 'name' => 'tautulliURL',
  2792. 'label' => 'URL',
  2793. 'value' => $GLOBALS['tautulliURL'],
  2794. 'help' => 'URL for Tautulli API, include the IP, the port and the base URL (e.g. /tautulli/) in the URL',
  2795. 'placeholder' => 'http://<ip>:<port>'
  2796. ),
  2797. array(
  2798. 'type' => 'password-alt',
  2799. 'name' => 'tautulliApikey',
  2800. 'label' => 'API Key',
  2801. 'value' => $GLOBALS['tautulliApikey']
  2802. ),
  2803. array(
  2804. 'type' => 'select',
  2805. 'name' => 'homepageTautulliRefresh',
  2806. 'label' => 'Refresh Seconds',
  2807. 'value' => $GLOBALS['homepageTautulliRefresh'],
  2808. 'options' => optionTime()
  2809. ),
  2810. ),
  2811. 'Library Stats' => array(
  2812. array(
  2813. 'type' => 'switch',
  2814. 'name' => 'tautulliLibraries',
  2815. 'label' => 'Libraries',
  2816. 'value' => $GLOBALS['tautulliLibraries'],
  2817. 'help' => 'Shows/hides the card with library information.',
  2818. ),
  2819. array(
  2820. 'type' => 'select',
  2821. 'name' => 'homepageTautulliLibraryAuth',
  2822. 'label' => 'Minimum Authentication',
  2823. 'value' => $GLOBALS['homepageTautulliLibraryAuth'],
  2824. 'options' => $groups
  2825. ),
  2826. ),
  2827. 'Viewing Stats' => array(
  2828. array(
  2829. 'type' => 'switch',
  2830. 'name' => 'tautulliPopularMovies',
  2831. 'label' => 'Popular Movies',
  2832. 'value' => $GLOBALS['tautulliPopularMovies'],
  2833. 'help' => 'Shows/hides the card with Popular Movies information.',
  2834. ),
  2835. array(
  2836. 'type' => 'switch',
  2837. 'name' => 'tautulliPopularTV',
  2838. 'label' => 'Popular TV',
  2839. 'value' => $GLOBALS['tautulliPopularTV'],
  2840. 'help' => 'Shows/hides the card with Popular TV information.',
  2841. ),
  2842. array(
  2843. 'type' => 'switch',
  2844. 'name' => 'tautulliTopMovies',
  2845. 'label' => 'Top Movies',
  2846. 'value' => $GLOBALS['tautulliTopMovies'],
  2847. 'help' => 'Shows/hides the card with Top Movies information.',
  2848. ),
  2849. array(
  2850. 'type' => 'switch',
  2851. 'name' => 'tautulliTopTV',
  2852. 'label' => 'Top TV',
  2853. 'value' => $GLOBALS['tautulliTopTV'],
  2854. 'help' => 'Shows/hides the card with Top TV information.',
  2855. ),
  2856. array(
  2857. 'type' => 'select',
  2858. 'name' => 'homepageTautulliViewsAuth',
  2859. 'label' => 'Minimum Authentication',
  2860. 'value' => $GLOBALS['homepageTautulliViewsAuth'],
  2861. 'options' => $groups
  2862. ),
  2863. ),
  2864. 'Misc Stats' => array(
  2865. array(
  2866. 'type' => 'switch',
  2867. 'name' => 'tautulliTopUsers',
  2868. 'label' => 'Top Users',
  2869. 'value' => $GLOBALS['tautulliTopUsers'],
  2870. 'help' => 'Shows/hides the card with Top Users information.',
  2871. ),
  2872. array(
  2873. 'type' => 'switch',
  2874. 'name' => 'tautulliTopPlatforms',
  2875. 'label' => 'Top Platforms',
  2876. 'value' => $GLOBALS['tautulliTopPlatforms'],
  2877. 'help' => 'Shows/hides the card with Top Platforms information.',
  2878. ),
  2879. array(
  2880. 'type' => 'select',
  2881. 'name' => 'homepageTautulliMiscAuth',
  2882. 'label' => 'Minimum Authentication',
  2883. 'value' => $GLOBALS['homepageTautulliMiscAuth'],
  2884. 'options' => $groups
  2885. ),
  2886. ),
  2887. )
  2888. ),
  2889. array(
  2890. 'name' => 'Monitorr',
  2891. 'enabled' => true,
  2892. 'image' => 'plugins/images/tabs/monitorr.png',
  2893. 'category' => 'Monitor',
  2894. 'settings' => array(
  2895. 'Enable' => array(
  2896. array(
  2897. 'type' => 'switch',
  2898. 'name' => 'homepageMonitorrEnabled',
  2899. 'label' => 'Enable',
  2900. 'value' => $GLOBALS['homepageMonitorrEnabled']
  2901. ),
  2902. array(
  2903. 'type' => 'select',
  2904. 'name' => 'homepageMonitorrAuth',
  2905. 'label' => 'Minimum Authentication',
  2906. 'value' => $GLOBALS['homepageMonitorrAuth'],
  2907. 'options' => $groups
  2908. )
  2909. ),
  2910. 'Connection' => array(
  2911. array(
  2912. 'type' => 'input',
  2913. 'name' => 'monitorrURL',
  2914. 'label' => 'URL',
  2915. 'value' => $GLOBALS['monitorrURL'],
  2916. 'help' => 'URL for Monitorr. Please use the revers proxy URL i.e. https://domain.com/monitorr/.',
  2917. 'placeholder' => 'http://domain.com/monitorr/'
  2918. ),
  2919. array(
  2920. 'type' => 'select',
  2921. 'name' => 'homepageMonitorrRefresh',
  2922. 'label' => 'Refresh Seconds',
  2923. 'value' => $GLOBALS['homepageMonitorrRefresh'],
  2924. 'options' => optionTime()
  2925. ),
  2926. ),
  2927. 'Options' => array(
  2928. array(
  2929. 'type' => 'input',
  2930. 'name' => 'monitorrHeader',
  2931. 'label' => 'Title',
  2932. 'value' => $GLOBALS['monitorrHeader'],
  2933. 'help' => 'Sets the title of this homepage module',
  2934. ),
  2935. array(
  2936. 'type' => 'switch',
  2937. 'name' => 'monitorrHeaderToggle',
  2938. 'label' => 'Toggle Title',
  2939. 'value' => $GLOBALS['monitorrHeaderToggle'],
  2940. 'help' => 'Shows/hides the title of this homepage module'
  2941. ),
  2942. array(
  2943. 'type' => 'switch',
  2944. 'name' => 'monitorrCompact',
  2945. 'label' => 'Compact view',
  2946. 'value' => $GLOBALS['monitorrCompact'],
  2947. 'help' => 'Toggles the compact view of this homepage module'
  2948. ),
  2949. ),
  2950. )
  2951. ),
  2952. array(
  2953. 'name' => 'Weather-Air',
  2954. 'enabled' => true,
  2955. 'image' => 'plugins/images/tabs/wind.png',
  2956. 'category' => 'Monitor',
  2957. 'settings' => array(
  2958. 'Enable' => array(
  2959. array(
  2960. 'type' => 'switch',
  2961. 'name' => 'homepageWeatherAndAirEnabled',
  2962. 'label' => 'Enable',
  2963. 'value' => $GLOBALS['homepageWeatherAndAirEnabled']
  2964. ),
  2965. array(
  2966. 'type' => 'select',
  2967. 'name' => 'homepageWeatherAndAirAuth',
  2968. 'label' => 'Minimum Authentication',
  2969. 'value' => $GLOBALS['homepageWeatherAndAirAuth'],
  2970. 'options' => $groups
  2971. )
  2972. ),
  2973. 'Connection' => array(
  2974. array(
  2975. 'type' => 'input',
  2976. 'name' => 'homepageWeatherAndAirLatitude',
  2977. 'label' => 'Latitude',
  2978. 'value' => $GLOBALS['homepageWeatherAndAirLatitude'],
  2979. 'help' => 'Please enter full latitude including minus if needed'
  2980. ),
  2981. array(
  2982. 'type' => 'input',
  2983. 'name' => 'homepageWeatherAndAirLongitude',
  2984. 'label' => 'Longitude',
  2985. 'value' => $GLOBALS['homepageWeatherAndAirLongitude'],
  2986. 'help' => 'Please enter full longitude including minus if needed'
  2987. ),
  2988. array(
  2989. 'type' => 'blank',
  2990. 'label' => ''
  2991. ),
  2992. array(
  2993. 'type' => 'button',
  2994. 'label' => '',
  2995. 'icon' => 'fa fa-search',
  2996. 'class' => 'pull-right',
  2997. 'text' => 'Need Help With Coordinates?',
  2998. 'attr' => 'onclick="showLookupCoordinatesModal()"'
  2999. ),
  3000. ),
  3001. 'Options' => array(
  3002. array(
  3003. 'type' => 'input',
  3004. 'name' => 'homepageWeatherAndAirWeatherHeader',
  3005. 'label' => 'Title',
  3006. 'value' => $GLOBALS['homepageWeatherAndAirWeatherHeader'],
  3007. 'help' => 'Sets the title of this homepage module',
  3008. ),
  3009. array(
  3010. 'type' => 'switch',
  3011. 'name' => 'homepageWeatherAndAirWeatherHeaderToggle',
  3012. 'label' => 'Toggle Title',
  3013. 'value' => $GLOBALS['homepageWeatherAndAirWeatherHeaderToggle'],
  3014. 'help' => 'Shows/hides the title of this homepage module'
  3015. ),
  3016. array(
  3017. 'type' => 'switch',
  3018. 'name' => 'homepageWeatherAndAirWeatherEnabled',
  3019. 'label' => 'Enable Weather',
  3020. 'value' => $GLOBALS['homepageWeatherAndAirWeatherEnabled'],
  3021. 'help' => 'Toggles the view module for Weather'
  3022. ),
  3023. array(
  3024. 'type' => 'switch',
  3025. 'name' => 'homepageWeatherAndAirAirQualityEnabled',
  3026. 'label' => 'Enable Air Quality',
  3027. 'value' => $GLOBALS['homepageWeatherAndAirAirQualityEnabled'],
  3028. 'help' => 'Toggles the view module for Air Quality'
  3029. ),
  3030. array(
  3031. 'type' => 'switch',
  3032. 'name' => 'homepageWeatherAndAirPollenEnabled',
  3033. 'label' => 'Enable Pollen',
  3034. 'value' => $GLOBALS['homepageWeatherAndAirPollenEnabled'],
  3035. 'help' => 'Toggles the view module for Pollen'
  3036. ),
  3037. array(
  3038. 'type' => 'select',
  3039. 'name' => 'homepageWeatherAndAirUnits',
  3040. 'label' => 'Unit of Measurement',
  3041. 'value' => $GLOBALS['homepageWeatherAndAirUnits'],
  3042. 'options' => array(
  3043. array(
  3044. 'name' => 'Imperial',
  3045. 'value' => 'imperial'
  3046. ),
  3047. array(
  3048. 'name' => 'Metric',
  3049. 'value' => 'metric'
  3050. )
  3051. )
  3052. ),
  3053. array(
  3054. 'type' => 'select',
  3055. 'name' => 'homepageWeatherAndAirRefresh',
  3056. 'label' => 'Refresh Seconds',
  3057. 'value' => $GLOBALS['homepageWeatherAndAirRefresh'],
  3058. 'options' => optionTime()
  3059. ),
  3060. ),
  3061. )
  3062. ),
  3063. array(
  3064. 'name' => 'Speedtest',
  3065. 'enabled' => true,
  3066. 'image' => 'plugins/images/tabs/speedtest-icon.png',
  3067. 'category' => 'Monitor',
  3068. 'settings' => array(
  3069. 'Enable' => array(
  3070. array(
  3071. 'type' => 'html',
  3072. 'override' => 6,
  3073. 'label' => 'Info',
  3074. 'html' => '<p>This homepage item requires <a href="https://github.com/henrywhitaker3/Speedtest-Tracker" target="_blank" rel="noreferrer noopener">Speedtest-Tracker <i class="fa fa-external-link" aria-hidden="true"></i></a> to be running on your network.</p>'
  3075. ),
  3076. array(
  3077. 'type' => 'switch',
  3078. 'name' => 'homepageSpeedtestEnabled',
  3079. 'label' => 'Enable',
  3080. 'value' => $GLOBALS['homepageSpeedtestEnabled']
  3081. ),
  3082. array(
  3083. 'type' => 'select',
  3084. 'name' => 'homepageSpeedtestAuth',
  3085. 'label' => 'Minimum Authentication',
  3086. 'value' => $GLOBALS['homepageSpeedtestAuth'],
  3087. 'options' => $groups
  3088. )
  3089. ),
  3090. 'Connection' => array(
  3091. array(
  3092. 'type' => 'input',
  3093. 'name' => 'speedtestURL',
  3094. 'label' => 'URL',
  3095. 'value' => $GLOBALS['speedtestURL'],
  3096. 'help' => 'Enter the IP:PORT of your speedtest instance e.g. http(s)://<ip>:<port>'
  3097. ),
  3098. ),
  3099. 'Options' => array(
  3100. array(
  3101. 'type' => 'input',
  3102. 'name' => 'speedtestHeader',
  3103. 'label' => 'Title',
  3104. 'value' => $GLOBALS['speedtestHeader'],
  3105. 'help' => 'Sets the title of this homepage module',
  3106. ),
  3107. array(
  3108. 'type' => 'switch',
  3109. 'name' => 'speedtestHeaderToggle',
  3110. 'label' => 'Toggle Title',
  3111. 'value' => $GLOBALS['speedtestHeaderToggle'],
  3112. 'help' => 'Shows/hides the title of this homepage module'
  3113. ),
  3114. ),
  3115. )
  3116. ),
  3117. netdataSettngsArray(),
  3118. array(
  3119. 'name' => 'Octoprint',
  3120. 'enabled' => true,
  3121. 'image' => 'plugins/images/tabs/octoprint.png',
  3122. 'category' => 'Monitor',
  3123. 'settings' => array(
  3124. 'Enable' => array(
  3125. array(
  3126. 'type' => 'switch',
  3127. 'name' => 'homepageOctoprintEnabled',
  3128. 'label' => 'Enable',
  3129. 'value' => $GLOBALS['homepageOctoprintEnabled']
  3130. ),
  3131. array(
  3132. 'type' => 'select',
  3133. 'name' => 'homepageOctoprintAuth',
  3134. 'label' => 'Minimum Authentication',
  3135. 'value' => $GLOBALS['homepageOctoprintAuth'],
  3136. 'options' => $groups
  3137. )
  3138. ),
  3139. 'Connection' => array(
  3140. array(
  3141. 'type' => 'input',
  3142. 'name' => 'octoprintURL',
  3143. 'label' => 'URL',
  3144. 'value' => $GLOBALS['octoprintURL'],
  3145. 'help' => 'Enter the IP:PORT of your Octoprint instance e.g. http://octopi.local'
  3146. ),
  3147. array(
  3148. 'type' => 'input',
  3149. 'name' => 'octoprintToken',
  3150. 'label' => 'API Key',
  3151. 'value' => $GLOBALS['octoprintToken'],
  3152. 'help' => 'Enter your Octoprint API key, found in Octoprints settings page.'
  3153. ),
  3154. ),
  3155. 'Options' => array(
  3156. array(
  3157. 'type' => 'input',
  3158. 'name' => 'octoprintHeader',
  3159. 'label' => 'Title',
  3160. 'value' => $GLOBALS['octoprintHeader'],
  3161. 'help' => 'Sets the title of this homepage module',
  3162. ),
  3163. array(
  3164. 'type' => 'switch',
  3165. 'name' => 'octoprintToggle',
  3166. 'label' => 'Toggle Title',
  3167. 'value' => $GLOBALS['octoprintHeaderToggle'],
  3168. 'help' => 'Shows/hides the title of this homepage module'
  3169. ),
  3170. ),
  3171. )
  3172. ),
  3173. );
  3174. }
  3175. function buildHomepageSettings()
  3176. {
  3177. $homepageOrder = homepageOrder();
  3178. $homepageList = '<h4>Drag Homepage Items to Order Them</h4><div id="homepage-items-sort" class="external-events">';
  3179. $inputList = '<form id="homepage-values" class="row">';
  3180. foreach ($homepageOrder as $key => $val) {
  3181. switch ($key) {
  3182. case 'homepageOrdercustomhtml':
  3183. $class = 'bg-info';
  3184. $image = 'plugins/images/tabs/custom1.png';
  3185. if (!$GLOBALS['homepagCustomHTMLoneEnabled']) {
  3186. $class .= ' faded';
  3187. }
  3188. break;
  3189. case 'homepageOrdercustomhtmlTwo':
  3190. $class = 'bg-info';
  3191. $image = 'plugins/images/tabs/custom2.png';
  3192. if (!$GLOBALS['homepagCustomHTMLtwoEnabled']) {
  3193. $class .= ' faded';
  3194. }
  3195. break;
  3196. case 'homepageOrdertransmission':
  3197. $class = 'bg-transmission';
  3198. $image = 'plugins/images/tabs/transmission.png';
  3199. if (!$GLOBALS['homepageTransmissionEnabled']) {
  3200. $class .= ' faded';
  3201. }
  3202. break;
  3203. case 'homepageOrdernzbget':
  3204. $class = 'bg-nzbget';
  3205. $image = 'plugins/images/tabs/nzbget.png';
  3206. if (!$GLOBALS['homepageNzbgetEnabled']) {
  3207. $class .= ' faded';
  3208. }
  3209. break;
  3210. case 'homepageOrderjdownloader':
  3211. $class = 'bg-sab';
  3212. $image = 'plugins/images/tabs/jdownloader.png';
  3213. if (!$GLOBALS['homepageJdownloaderEnabled']) {
  3214. $class .= ' faded';
  3215. }
  3216. break;
  3217. case 'homepageOrdersabnzbd':
  3218. $class = 'bg-sab';
  3219. $image = 'plugins/images/tabs/sabnzbd.png';
  3220. if (!$GLOBALS['homepageSabnzbdEnabled']) {
  3221. $class .= ' faded';
  3222. }
  3223. break;
  3224. case 'homepageOrderdeluge':
  3225. $class = 'bg-deluge';
  3226. $image = 'plugins/images/tabs/deluge.png';
  3227. if (!$GLOBALS['homepageDelugeEnabled']) {
  3228. $class .= ' faded';
  3229. }
  3230. break;
  3231. case 'homepageOrderqBittorrent':
  3232. $class = 'bg-qbit';
  3233. $image = 'plugins/images/tabs/qBittorrent.png';
  3234. if (!$GLOBALS['homepageqBittorrentEnabled']) {
  3235. $class .= ' faded';
  3236. }
  3237. break;
  3238. case 'homepageOrderrTorrent':
  3239. $class = 'bg-qbit';
  3240. $image = 'plugins/images/tabs/rTorrent.png';
  3241. if (!$GLOBALS['homepagerTorrentEnabled']) {
  3242. $class .= ' faded';
  3243. }
  3244. break;
  3245. case 'homepageOrderplexnowplaying':
  3246. case 'homepageOrderplexrecent':
  3247. case 'homepageOrderplexplaylist':
  3248. $class = 'bg-plex';
  3249. $image = 'plugins/images/tabs/plex.png';
  3250. if (!$GLOBALS['homepagePlexEnabled']) {
  3251. $class .= ' faded';
  3252. }
  3253. break;
  3254. case 'homepageOrderembynowplaying':
  3255. case 'homepageOrderembyrecent':
  3256. $class = 'bg-emby';
  3257. $image = 'plugins/images/tabs/emby.png';
  3258. if (!$GLOBALS['homepageEmbyEnabled']) {
  3259. $class .= ' faded';
  3260. }
  3261. break;
  3262. case 'homepageOrderombi':
  3263. $class = 'bg-inverse';
  3264. $image = 'plugins/images/tabs/ombi.png';
  3265. if (!$GLOBALS['homepageOmbiEnabled']) {
  3266. $class .= ' faded';
  3267. }
  3268. break;
  3269. case 'homepageOrdercalendar':
  3270. $class = 'bg-primary';
  3271. $image = 'plugins/images/tabs/calendar.png';
  3272. if (!$GLOBALS['homepageSonarrEnabled'] && !$GLOBALS['homepageRadarrEnabled'] && !$GLOBALS['homepageSickrageEnabled'] && !$GLOBALS['homepageCouchpotatoEnabled']) {
  3273. $class .= ' faded';
  3274. }
  3275. break;
  3276. case 'homepageOrderdownloader':
  3277. $class = 'bg-inverse';
  3278. $image = 'plugins/images/tabs/downloader.png';
  3279. if (!$GLOBALS['jdownloaderCombine'] && !$GLOBALS['sabnzbdCombine'] && !$GLOBALS['nzbgetCombine'] && !$GLOBALS['rTorrentCombine'] && !$GLOBALS['delugeCombine'] && !$GLOBALS['transmissionCombine'] && !$GLOBALS['qBittorrentCombine']) {
  3280. $class .= ' faded';
  3281. }
  3282. break;
  3283. case 'homepageOrderhealthchecks':
  3284. $class = 'bg-healthchecks';
  3285. $image = 'plugins/images/tabs/healthchecks.png';
  3286. if (!$GLOBALS['homepageHealthChecksEnabled']) {
  3287. $class .= ' faded';
  3288. }
  3289. break;
  3290. case 'homepageOrderunifi':
  3291. $class = 'bg-info';
  3292. $image = 'plugins/images/tabs/ubnt.png';
  3293. if (!$GLOBALS['homepageUnifiEnabled']) {
  3294. $class .= ' faded';
  3295. }
  3296. break;
  3297. case 'homepageOrdertautulli':
  3298. $class = 'bg-info';
  3299. $image = 'plugins/images/tabs/tautulli.png';
  3300. if (!$GLOBALS['homepageTautulliEnabled']) {
  3301. $class .= ' faded';
  3302. }
  3303. break;
  3304. case 'homepageOrderPihole':
  3305. $class = 'bg-info';
  3306. $image = 'plugins/images/tabs/pihole.png';
  3307. if (!$GLOBALS['homepagePiholeEnabled']) {
  3308. $class .= ' faded';
  3309. }
  3310. break;
  3311. case 'homepageOrderMonitorr':
  3312. $class = 'bg-info';
  3313. $image = 'plugins/images/tabs/monitorr.png';
  3314. if (!$GLOBALS['homepageMonitorrEnabled']) {
  3315. $class .= ' faded';
  3316. }
  3317. break;
  3318. case 'homepageOrderWeatherAndAir':
  3319. $class = 'bg-success';
  3320. $image = 'plugins/images/tabs/wind.png';
  3321. if (!$GLOBALS['homepageWeatherAndAirEnabled']) {
  3322. $class .= ' faded';
  3323. }
  3324. break;
  3325. case 'homepageOrderSpeedtest':
  3326. $class = 'bg-success';
  3327. $image = 'plugins/images/tabs/speedtest-icon.png';
  3328. if (!$GLOBALS['homepageSpeedtestEnabled']) {
  3329. $class .= ' faded';
  3330. }
  3331. break;
  3332. case 'homepageOrderNetdata':
  3333. $class = 'bg-success';
  3334. $image = 'plugins/images/tabs/netdata.png';
  3335. if (!$GLOBALS['homepageNetdataEnabled']) {
  3336. $class .= ' faded';
  3337. }
  3338. break;
  3339. case 'homepageOrderOctoprint':
  3340. $class = 'bg-success';
  3341. $image = 'plugins/images/tabs/octoprint.png';
  3342. if (!$GLOBALS['homepageOctoprintEnabled']) {
  3343. $class .= ' faded';
  3344. }
  3345. break;
  3346. case 'homepageOrderSonarrQueue':
  3347. $class = 'bg-sonarr';
  3348. $image = 'plugins/images/tabs/sonarr.png';
  3349. if (!$GLOBALS['homepageSonarrQueueEnabled']) {
  3350. $class .= ' faded';
  3351. }
  3352. break;
  3353. case 'homepageOrderRadarrQueue':
  3354. $class = 'bg-radarr';
  3355. $image = 'plugins/images/tabs/radarr.png';
  3356. if (!$GLOBALS['homepageRadarrQueueEnabled']) {
  3357. $class .= ' faded';
  3358. }
  3359. break;
  3360. default:
  3361. $class = 'blue-bg';
  3362. $image = '';
  3363. break;
  3364. }
  3365. $homepageList .= '
  3366. <div class="col-md-3 col-xs-12 sort-homepage m-t-10 hvr-grow clearfix">
  3367. <div class="homepage-drag fc-event ' . $class . ' lazyload" data-src="' . $image . '">
  3368. <span class="ordinal-position text-uppercase badge bg-org homepage-number" data-link="' . $key . '" style="float:left;width: 30px;">' . $val . '</span>
  3369. <span class="homepage-text">&nbsp; ' . strtoupper(substr($key, 13)) . '</span>
  3370. </div>
  3371. </div>
  3372. ';
  3373. $inputList .= '<input type="hidden" name="' . $key . '">';
  3374. }
  3375. $homepageList .= '</div>';
  3376. $inputList .= '</form>';
  3377. return $homepageList . $inputList;
  3378. }
  3379. function ombiTVDefault($type)
  3380. {
  3381. switch ($type) {
  3382. case 'all':
  3383. return ($type == $GLOBALS['ombiTvDefault']) ? true : false;
  3384. case 'first':
  3385. return ($type == $GLOBALS['ombiTvDefault']) ? true : false;
  3386. case 'last':
  3387. return ($type == $GLOBALS['ombiTvDefault']) ? true : false;
  3388. default:
  3389. return false;
  3390. }
  3391. return false;
  3392. }