homepage-functions.php 64 KB

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