homepage-functions.php 81 KB

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