homepage-functions.php 61 KB

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