homepage-functions.php 73 KB

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