homepage-functions.php 70 KB

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