homepage-functions.php 76 KB

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