homepage-functions.php 71 KB

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