homepage-functions.php 77 KB

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