homepage-functions.php 83 KB

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