homepage-functions.php 75 KB

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