homepage-functions.php 69 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451
  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' => 'homepagePlexRecentAuth',
  747. 'label' => 'Minimum Authorization',
  748. 'value' => $GLOBALS['homepagePlexRecentAuth'],
  749. 'options' => $groups
  750. ),
  751. array(
  752. 'type' => 'number',
  753. 'name' => 'homepageRecentLimit',
  754. 'label' => 'Item Limit',
  755. 'value' => $GLOBALS['homepageRecentLimit'],
  756. ),
  757. array(
  758. 'type' => 'select',
  759. 'name' => 'homepageRecentRefresh',
  760. 'label' => 'Refresh Seconds',
  761. 'value' => $GLOBALS['homepageRecentRefresh'],
  762. 'options' => optionTime()
  763. ),
  764. ),
  765. 'Media Search' => array(
  766. array(
  767. 'type' => 'switch',
  768. 'name' => 'mediaSearch',
  769. 'label' => 'Enable',
  770. 'value' => $GLOBALS['mediaSearch']
  771. ),
  772. array(
  773. 'type' => 'select',
  774. 'name' => 'mediaSearchAuth',
  775. 'label' => 'Minimum Authorization',
  776. 'value' => $GLOBALS['mediaSearchAuth'],
  777. 'options' => $groups
  778. ),
  779. array(
  780. 'type' => 'select',
  781. 'name' => 'mediaSearchType',
  782. 'label' => 'Media Server',
  783. 'value' => $GLOBALS['mediaSearchType'],
  784. 'options' => $mediaServers
  785. ),
  786. ),
  787. 'Playlists' => array(
  788. array(
  789. 'type' => 'switch',
  790. 'name' => 'homepagePlexPlaylist',
  791. 'label' => 'Enable',
  792. 'value' => $GLOBALS['homepagePlexPlaylist']
  793. ),
  794. array(
  795. 'type' => 'select',
  796. 'name' => 'homepagePlexPlaylistAuth',
  797. 'label' => 'Minimum Authorization',
  798. 'value' => $GLOBALS['homepagePlexPlaylistAuth'],
  799. 'options' => $groups
  800. ),
  801. ),
  802. 'Misc Options' => array(
  803. array(
  804. 'type' => 'input',
  805. 'name' => 'plexTabName',
  806. 'label' => 'Plex Tab Name',
  807. 'value' => $GLOBALS['plexTabName'],
  808. 'placeholder' => 'Only use if you have Plex in a reverse proxy'
  809. ),
  810. array(
  811. 'type' => 'input',
  812. 'name' => 'plexTabURL',
  813. 'label' => 'Plex Tab WAN URL',
  814. 'value' => $GLOBALS['plexTabURL'],
  815. 'placeholder' => 'http(s)://hostname:port'
  816. ),
  817. array(
  818. 'type' => 'select',
  819. 'name' => 'cacheImageSize',
  820. 'label' => 'Image Cache Size',
  821. 'value' => $GLOBALS['cacheImageSize'],
  822. 'options' => array(
  823. array(
  824. 'name' => 'Low',
  825. 'value' => '.5'
  826. ),
  827. array(
  828. 'name' => '1x',
  829. 'value' => '1'
  830. ),
  831. array(
  832. 'name' => '2x',
  833. 'value' => '2'
  834. ),
  835. array(
  836. 'name' => '3x',
  837. 'value' => '3'
  838. )
  839. )
  840. )
  841. ),
  842. 'Test Connection' => array(
  843. array(
  844. 'type' => 'blank',
  845. 'label' => 'Please Save before Testing'
  846. ),
  847. array(
  848. 'type' => 'button',
  849. 'label' => '',
  850. 'icon' => 'fa fa-flask',
  851. 'class' => 'pull-right',
  852. 'text' => 'Test Connection',
  853. 'attr' => 'onclick="testAPIConnection(\'plex\')"'
  854. ),
  855. )
  856. )
  857. ),
  858. array(
  859. 'name' => 'Emby',
  860. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  861. 'image' => 'plugins/images/tabs/emby.png',
  862. 'category' => 'Media Server',
  863. 'settings' => array(
  864. 'Enable' => array(
  865. array(
  866. 'type' => 'switch',
  867. 'name' => 'homepageEmbyEnabled',
  868. 'label' => 'Enable',
  869. 'value' => $GLOBALS['homepageEmbyEnabled']
  870. ),
  871. array(
  872. 'type' => 'select',
  873. 'name' => 'homepageEmbyAuth',
  874. 'label' => 'Minimum Authentication',
  875. 'value' => $GLOBALS['homepageEmbyAuth'],
  876. 'options' => $groups
  877. )
  878. ),
  879. 'Connection' => array(
  880. array(
  881. 'type' => 'input',
  882. 'name' => 'embyURL',
  883. 'label' => 'URL',
  884. 'value' => $GLOBALS['embyURL'],
  885. 'help' => 'Please make sure to use local IP address and port - You also may use local dns name too.',
  886. 'placeholder' => 'http(s)://hostname:port'
  887. ),
  888. array(
  889. 'type' => 'password-alt',
  890. 'name' => 'embyToken',
  891. 'label' => 'Token',
  892. 'value' => $GLOBALS['embyToken']
  893. )
  894. ),
  895. 'Active Streams' => array(
  896. array(
  897. 'type' => 'switch',
  898. 'name' => 'homepageEmbyStreams',
  899. 'label' => 'Enable',
  900. 'value' => $GLOBALS['homepageEmbyStreams']
  901. ),
  902. array(
  903. 'type' => 'select',
  904. 'name' => 'homepageEmbyStreamsAuth',
  905. 'label' => 'Minimum Authorization',
  906. 'value' => $GLOBALS['homepageEmbyStreamsAuth'],
  907. 'options' => $groups
  908. ),
  909. array(
  910. 'type' => 'switch',
  911. 'name' => 'homepageShowStreamNames',
  912. 'label' => 'User Information',
  913. 'value' => $GLOBALS['homepageShowStreamNames']
  914. ),
  915. array(
  916. 'type' => 'select',
  917. 'name' => 'homepageShowStreamNamesAuth',
  918. 'label' => 'Minimum Authorization',
  919. 'value' => $GLOBALS['homepageShowStreamNamesAuth'],
  920. 'options' => $groups
  921. ),
  922. array(
  923. 'type' => 'select',
  924. 'name' => 'homepageStreamRefresh',
  925. 'label' => 'Refresh Seconds',
  926. 'value' => $GLOBALS['homepageStreamRefresh'],
  927. 'options' => optionTime()
  928. ),
  929. ),
  930. 'Recent Items' => array(
  931. array(
  932. 'type' => 'switch',
  933. 'name' => 'homepageEmbyRecent',
  934. 'label' => 'Enable',
  935. 'value' => $GLOBALS['homepageEmbyRecent']
  936. ),
  937. array(
  938. 'type' => 'select',
  939. 'name' => 'homepageEmbyRecentAuth',
  940. 'label' => 'Minimum Authorization',
  941. 'value' => $GLOBALS['homepageEmbyRecentAuth'],
  942. 'options' => $groups
  943. ),
  944. array(
  945. 'type' => 'number',
  946. 'name' => 'homepageRecentLimit',
  947. 'label' => 'Item Limit',
  948. 'value' => $GLOBALS['homepageRecentLimit'],
  949. ),
  950. array(
  951. 'type' => 'select',
  952. 'name' => 'homepageRecentRefresh',
  953. 'label' => 'Refresh Seconds',
  954. 'value' => $GLOBALS['homepageRecentRefresh'],
  955. 'options' => optionTime()
  956. ),
  957. ),
  958. 'Misc Options' => array(
  959. array(
  960. 'type' => 'input',
  961. 'name' => 'embyTabName',
  962. 'label' => 'Emby Tab Name',
  963. 'value' => $GLOBALS['embyTabName'],
  964. 'placeholder' => 'Only use if you have Emby in a reverse proxy'
  965. ),
  966. array(
  967. 'type' => 'input',
  968. 'name' => 'embyTabURL',
  969. 'label' => 'Emby Tab WAN URL',
  970. 'value' => $GLOBALS['embyTabURL'],
  971. 'placeholder' => 'http(s)://hostname:port'
  972. ),
  973. array(
  974. 'type' => 'select',
  975. 'name' => 'cacheImageSize',
  976. 'label' => 'Image Cache Size',
  977. 'value' => $GLOBALS['cacheImageSize'],
  978. 'options' => array(
  979. array(
  980. 'name' => 'Low',
  981. 'value' => '.5'
  982. ),
  983. array(
  984. 'name' => '1x',
  985. 'value' => '1'
  986. ),
  987. array(
  988. 'name' => '2x',
  989. 'value' => '2'
  990. ),
  991. array(
  992. 'name' => '3x',
  993. 'value' => '3'
  994. )
  995. )
  996. )
  997. )
  998. )
  999. ),
  1000. array(
  1001. 'name' => 'JDownloader',
  1002. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1003. 'image' => 'plugins/images/tabs/jdownloader.png',
  1004. 'category' => 'Downloader',
  1005. 'settings' => array(
  1006. 'custom' => '
  1007. <div class="row">
  1008. <div class="col-lg-12">
  1009. <div class="panel panel-info">
  1010. <div class="panel-heading">
  1011. <span lang="en">Notice</span>
  1012. </div>
  1013. <div class="panel-wrapper collapse in" aria-expanded="true">
  1014. <div class="panel-body">
  1015. <ul class="list-icons">
  1016. <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>
  1017. <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>
  1018. </ul>
  1019. </div>
  1020. </div>
  1021. </div>
  1022. </div>
  1023. </div>
  1024. ',
  1025. 'Enable' => array(
  1026. array(
  1027. 'type' => 'switch',
  1028. 'name' => 'homepageJdownloaderEnabled',
  1029. 'label' => 'Enable',
  1030. 'value' => $GLOBALS['homepageJdownloaderEnabled']
  1031. ),
  1032. array(
  1033. 'type' => 'select',
  1034. 'name' => 'homepageJdownloaderAuth',
  1035. 'label' => 'Minimum Authentication',
  1036. 'value' => $GLOBALS['homepageJdownloaderAuth'],
  1037. 'options' => $groups
  1038. )
  1039. ),
  1040. 'Connection' => array(
  1041. array(
  1042. 'type' => 'input',
  1043. 'name' => 'jdownloaderURL',
  1044. 'label' => 'URL',
  1045. 'value' => $GLOBALS['jdownloaderURL'],
  1046. 'help' => 'Please make sure to use local IP address and port - You also may use local dns name too.',
  1047. 'placeholder' => 'http(s)://hostname:port'
  1048. )
  1049. ),
  1050. 'Misc Options' => array(
  1051. array(
  1052. 'type' => 'select',
  1053. 'name' => 'homepageDownloadRefresh',
  1054. 'label' => 'Refresh Seconds',
  1055. 'value' => $GLOBALS['homepageDownloadRefresh'],
  1056. 'options' => optionTime()
  1057. ),
  1058. array(
  1059. 'type' => 'switch',
  1060. 'name' => 'jdownloaderCombine',
  1061. 'label' => 'Add to Combined Downloader',
  1062. 'value' => $GLOBALS['jdownloaderCombine']
  1063. ),
  1064. ),
  1065. 'Test Connection' => array(
  1066. array(
  1067. 'type' => 'blank',
  1068. 'label' => 'Please Save before Testing'
  1069. ),
  1070. array(
  1071. 'type' => 'button',
  1072. 'label' => '',
  1073. 'icon' => 'fa fa-flask',
  1074. 'class' => 'pull-right',
  1075. 'text' => 'Test Connection',
  1076. 'attr' => 'onclick="testAPIConnection(\'jdownloader\')"'
  1077. ),
  1078. )
  1079. )
  1080. ),
  1081. array(
  1082. 'name' => 'SabNZBD',
  1083. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1084. 'image' => 'plugins/images/tabs/sabnzbd.png',
  1085. 'category' => 'Downloader',
  1086. 'settings' => array(
  1087. 'Enable' => array(
  1088. array(
  1089. 'type' => 'switch',
  1090. 'name' => 'homepageSabnzbdEnabled',
  1091. 'label' => 'Enable',
  1092. 'value' => $GLOBALS['homepageSabnzbdEnabled']
  1093. ),
  1094. array(
  1095. 'type' => 'select',
  1096. 'name' => 'homepageSabnzbdAuth',
  1097. 'label' => 'Minimum Authentication',
  1098. 'value' => $GLOBALS['homepageSabnzbdAuth'],
  1099. 'options' => $groups
  1100. )
  1101. ),
  1102. 'Connection' => array(
  1103. array(
  1104. 'type' => 'input',
  1105. 'name' => 'sabnzbdURL',
  1106. 'label' => 'URL',
  1107. 'value' => $GLOBALS['sabnzbdURL'],
  1108. 'help' => 'Please make sure to use local IP address and port - You also may use local dns name too.',
  1109. 'placeholder' => 'http(s)://hostname:port'
  1110. ),
  1111. array(
  1112. 'type' => 'password-alt',
  1113. 'name' => 'sabnzbdToken',
  1114. 'label' => 'Token',
  1115. 'value' => $GLOBALS['sabnzbdToken']
  1116. )
  1117. ),
  1118. 'Misc Options' => array(
  1119. array(
  1120. 'type' => 'select',
  1121. 'name' => 'homepageDownloadRefresh',
  1122. 'label' => 'Refresh Seconds',
  1123. 'value' => $GLOBALS['homepageDownloadRefresh'],
  1124. 'options' => optionTime()
  1125. ),
  1126. array(
  1127. 'type' => 'switch',
  1128. 'name' => 'sabnzbdCombine',
  1129. 'label' => 'Add to Combined Downloader',
  1130. 'value' => $GLOBALS['sabnzbdCombine']
  1131. ),
  1132. ),
  1133. 'Test Connection' => array(
  1134. array(
  1135. 'type' => 'blank',
  1136. 'label' => 'Please Save before Testing'
  1137. ),
  1138. array(
  1139. 'type' => 'button',
  1140. 'label' => '',
  1141. 'icon' => 'fa fa-flask',
  1142. 'class' => 'pull-right',
  1143. 'text' => 'Test Connection',
  1144. 'attr' => 'onclick="testAPIConnection(\'sabnzbd\')"'
  1145. ),
  1146. )
  1147. )
  1148. ),
  1149. array(
  1150. 'name' => 'NZBGet',
  1151. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1152. 'image' => 'plugins/images/tabs/nzbget.png',
  1153. 'category' => 'Downloader',
  1154. 'settings' => array(
  1155. 'Enable' => array(
  1156. array(
  1157. 'type' => 'switch',
  1158. 'name' => 'homepageNzbgetEnabled',
  1159. 'label' => 'Enable',
  1160. 'value' => $GLOBALS['homepageNzbgetEnabled']
  1161. ),
  1162. array(
  1163. 'type' => 'select',
  1164. 'name' => 'homepageNzbgetAuth',
  1165. 'label' => 'Minimum Authentication',
  1166. 'value' => $GLOBALS['homepageNzbgetAuth'],
  1167. 'options' => $groups
  1168. )
  1169. ),
  1170. 'Connection' => array(
  1171. array(
  1172. 'type' => 'input',
  1173. 'name' => 'nzbgetURL',
  1174. 'label' => 'URL',
  1175. 'value' => $GLOBALS['nzbgetURL'],
  1176. 'help' => 'Please make sure to use local IP address and port - You also may use local dns name too.',
  1177. 'placeholder' => 'http(s)://hostname:port'
  1178. ),
  1179. array(
  1180. 'type' => 'input',
  1181. 'name' => 'nzbgetUsername',
  1182. 'label' => 'Username',
  1183. 'value' => $GLOBALS['nzbgetUsername']
  1184. ),
  1185. array(
  1186. 'type' => 'password',
  1187. 'name' => 'nzbgetPassword',
  1188. 'label' => 'Password',
  1189. 'value' => $GLOBALS['nzbgetPassword']
  1190. )
  1191. ),
  1192. 'Misc Options' => array(
  1193. array(
  1194. 'type' => 'select',
  1195. 'name' => 'homepageDownloadRefresh',
  1196. 'label' => 'Refresh Seconds',
  1197. 'value' => $GLOBALS['homepageDownloadRefresh'],
  1198. 'options' => optionTime()
  1199. ),
  1200. array(
  1201. 'type' => 'switch',
  1202. 'name' => 'nzbgetCombine',
  1203. 'label' => 'Add to Combined Downloader',
  1204. 'value' => $GLOBALS['nzbgetCombine']
  1205. ),
  1206. ),
  1207. 'Test Connection' => array(
  1208. array(
  1209. 'type' => 'blank',
  1210. 'label' => 'Please Save before Testing'
  1211. ),
  1212. array(
  1213. 'type' => 'button',
  1214. 'label' => '',
  1215. 'icon' => 'fa fa-flask',
  1216. 'class' => 'pull-right',
  1217. 'text' => 'Test Connection',
  1218. 'attr' => 'onclick="testAPIConnection(\'nzbget\')"'
  1219. ),
  1220. )
  1221. )
  1222. ),
  1223. array(
  1224. 'name' => 'Transmission',
  1225. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1226. 'image' => 'plugins/images/tabs/transmission.png',
  1227. 'category' => 'Downloader',
  1228. 'settings' => array(
  1229. 'Enable' => array(
  1230. array(
  1231. 'type' => 'switch',
  1232. 'name' => 'homepageTransmissionEnabled',
  1233. 'label' => 'Enable',
  1234. 'value' => $GLOBALS['homepageTransmissionEnabled']
  1235. ),
  1236. array(
  1237. 'type' => 'select',
  1238. 'name' => 'homepageTransmissionAuth',
  1239. 'label' => 'Minimum Authentication',
  1240. 'value' => $GLOBALS['homepageTransmissionAuth'],
  1241. 'options' => $groups
  1242. )
  1243. ),
  1244. 'Connection' => array(
  1245. array(
  1246. 'type' => 'input',
  1247. 'name' => 'transmissionURL',
  1248. 'label' => 'URL',
  1249. 'value' => $GLOBALS['transmissionURL'],
  1250. 'help' => 'Please make sure to use local IP address and port - You also may use local dns name too.',
  1251. 'placeholder' => 'http(s)://hostname:port'
  1252. ),
  1253. array(
  1254. 'type' => 'input',
  1255. 'name' => 'transmissionUsername',
  1256. 'label' => 'Username',
  1257. 'value' => $GLOBALS['transmissionUsername']
  1258. ),
  1259. array(
  1260. 'type' => 'password',
  1261. 'name' => 'transmissionPassword',
  1262. 'label' => 'Password',
  1263. 'value' => $GLOBALS['transmissionPassword']
  1264. )
  1265. ),
  1266. 'Misc Options' => array(
  1267. array(
  1268. 'type' => 'switch',
  1269. 'name' => 'transmissionHideSeeding',
  1270. 'label' => 'Hide Seeding',
  1271. 'value' => $GLOBALS['transmissionHideSeeding']
  1272. ), array(
  1273. 'type' => 'switch',
  1274. 'name' => 'transmissionHideCompleted',
  1275. 'label' => 'Hide Completed',
  1276. 'value' => $GLOBALS['transmissionHideCompleted']
  1277. ),
  1278. array(
  1279. 'type' => 'select',
  1280. 'name' => 'homepageDownloadRefresh',
  1281. 'label' => 'Refresh Seconds',
  1282. 'value' => $GLOBALS['homepageDownloadRefresh'],
  1283. 'options' => optionTime()
  1284. ),
  1285. array(
  1286. 'type' => 'switch',
  1287. 'name' => 'transmissionCombine',
  1288. 'label' => 'Add to Combined Downloader',
  1289. 'value' => $GLOBALS['transmissionCombine']
  1290. ),
  1291. )
  1292. )
  1293. ),
  1294. array(
  1295. 'name' => 'qBittorrent',
  1296. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1297. 'image' => 'plugins/images/tabs/qBittorrent.png',
  1298. 'category' => 'Downloader',
  1299. 'settings' => array(
  1300. 'Enable' => array(
  1301. array(
  1302. 'type' => 'switch',
  1303. 'name' => 'homepageqBittorrentEnabled',
  1304. 'label' => 'Enable',
  1305. 'value' => $GLOBALS['homepageqBittorrentEnabled']
  1306. ),
  1307. array(
  1308. 'type' => 'select',
  1309. 'name' => 'homepageqBittorrentAuth',
  1310. 'label' => 'Minimum Authentication',
  1311. 'value' => $GLOBALS['homepageqBittorrentAuth'],
  1312. 'options' => $groups
  1313. )
  1314. ),
  1315. 'Connection' => array(
  1316. array(
  1317. 'type' => 'input',
  1318. 'name' => 'qBittorrentURL',
  1319. 'label' => 'URL',
  1320. 'value' => $GLOBALS['qBittorrentURL'],
  1321. 'help' => 'Please make sure to use local IP address and port - You also may use local dns name too.',
  1322. 'placeholder' => 'http(s)://hostname:port'
  1323. ),
  1324. array(
  1325. 'type' => 'input',
  1326. 'name' => 'qBittorrentUsername',
  1327. 'label' => 'Username',
  1328. 'value' => $GLOBALS['qBittorrentUsername']
  1329. ),
  1330. array(
  1331. 'type' => 'password',
  1332. 'name' => 'qBittorrentPassword',
  1333. 'label' => 'Password',
  1334. 'value' => $GLOBALS['qBittorrentPassword']
  1335. )
  1336. ),
  1337. 'Misc Options' => array(
  1338. array(
  1339. 'type' => 'switch',
  1340. 'name' => 'qBittorrentHideSeeding',
  1341. 'label' => 'Hide Seeding',
  1342. 'value' => $GLOBALS['qBittorrentHideSeeding']
  1343. ), array(
  1344. 'type' => 'switch',
  1345. 'name' => 'qBittorrentHideCompleted',
  1346. 'label' => 'Hide Completed',
  1347. 'value' => $GLOBALS['qBittorrentHideCompleted']
  1348. ),
  1349. array(
  1350. 'type' => 'select',
  1351. 'name' => 'qBittorrentSortOrder',
  1352. 'label' => 'Order',
  1353. 'value' => $GLOBALS['qBittorrentSortOrder'],
  1354. 'options' => $qBittorrentSortOptions
  1355. ), array(
  1356. 'type' => 'switch',
  1357. 'name' => 'qBittorrentReverseSorting',
  1358. 'label' => 'Reverse Sorting',
  1359. 'value' => $GLOBALS['qBittorrentReverseSorting']
  1360. ),
  1361. array(
  1362. 'type' => 'select',
  1363. 'name' => 'homepageDownloadRefresh',
  1364. 'label' => 'Refresh Seconds',
  1365. 'value' => $GLOBALS['homepageDownloadRefresh'],
  1366. 'options' => optionTime()
  1367. ),
  1368. array(
  1369. 'type' => 'switch',
  1370. 'name' => 'qBittorrentCombine',
  1371. 'label' => 'Add to Combined Downloader',
  1372. 'value' => $GLOBALS['qBittorrentCombine']
  1373. ),
  1374. )
  1375. )
  1376. ),
  1377. array(
  1378. 'name' => 'rTorrent',
  1379. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1380. 'image' => 'plugins/images/tabs/rTorrent.png',
  1381. 'category' => 'Downloader',
  1382. 'settings' => array(
  1383. 'FYI' => array(
  1384. array(
  1385. 'type' => 'html',
  1386. 'label' => '',
  1387. 'override' => 12,
  1388. 'html' => '
  1389. <div class="row">
  1390. <div class="col-lg-12">
  1391. <div class="panel panel-info">
  1392. <div class="panel-heading">
  1393. <span lang="en">This module requires XMLRPC</span>
  1394. </div>
  1395. <div class="panel-wrapper collapse in" aria-expanded="true">
  1396. <div class="panel-body">
  1397. <span lang="en">Status: [ <b>' . $xmlStatus . '</b> ]</span>
  1398. </div>
  1399. </div>
  1400. </div>
  1401. </div>
  1402. </div>
  1403. '
  1404. )
  1405. ),
  1406. 'Enable' => array(
  1407. array(
  1408. 'type' => 'switch',
  1409. 'name' => 'homepagerTorrentEnabled',
  1410. 'label' => 'Enable',
  1411. 'value' => $GLOBALS['homepagerTorrentEnabled']
  1412. ),
  1413. array(
  1414. 'type' => 'select',
  1415. 'name' => 'homepagerTorrentAuth',
  1416. 'label' => 'Minimum Authentication',
  1417. 'value' => $GLOBALS['homepagerTorrentAuth'],
  1418. 'options' => $groups
  1419. )
  1420. ),
  1421. 'Connection' => array(
  1422. array(
  1423. 'type' => 'input',
  1424. 'name' => 'rTorrentURL',
  1425. 'label' => 'URL',
  1426. 'value' => $GLOBALS['rTorrentURL'],
  1427. '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.',
  1428. 'placeholder' => 'http(s)://hostname:port'
  1429. ),
  1430. array(
  1431. 'type' => 'input',
  1432. 'name' => 'rTorrentURLOverride',
  1433. 'label' => 'rTorrent API URL Override',
  1434. 'value' => $GLOBALS['rTorrentURLOverride'],
  1435. 'help' => 'Please make sure to use local IP address and port - You also may use local dns name too.',
  1436. 'placeholder' => 'http(s)://hostname:port/xmlrpc'
  1437. ),
  1438. array(
  1439. 'type' => 'input',
  1440. 'name' => 'rTorrentUsername',
  1441. 'label' => 'Username',
  1442. 'value' => $GLOBALS['rTorrentUsername']
  1443. ),
  1444. array(
  1445. 'type' => 'password',
  1446. 'name' => 'rTorrentPassword',
  1447. 'label' => 'Password',
  1448. 'value' => $GLOBALS['rTorrentPassword']
  1449. )
  1450. ),
  1451. 'Misc Options' => array(
  1452. array(
  1453. 'type' => 'switch',
  1454. 'name' => 'rTorrentHideSeeding',
  1455. 'label' => 'Hide Seeding',
  1456. 'value' => $GLOBALS['rTorrentHideSeeding']
  1457. ), array(
  1458. 'type' => 'switch',
  1459. 'name' => 'rTorrentHideCompleted',
  1460. 'label' => 'Hide Completed',
  1461. 'value' => $GLOBALS['rTorrentHideCompleted']
  1462. ),
  1463. array(
  1464. 'type' => 'select',
  1465. 'name' => 'rTorrentSortOrder',
  1466. 'label' => 'Order',
  1467. 'value' => $GLOBALS['rTorrentSortOrder'],
  1468. 'options' => $rTorrentSortOptions
  1469. ),
  1470. array(
  1471. 'type' => 'select',
  1472. 'name' => 'homepageDownloadRefresh',
  1473. 'label' => 'Refresh Seconds',
  1474. 'value' => $GLOBALS['homepageDownloadRefresh'],
  1475. 'options' => optionTime()
  1476. ),
  1477. array(
  1478. 'type' => 'switch',
  1479. 'name' => 'rTorrentCombine',
  1480. 'label' => 'Add to Combined Downloader',
  1481. 'value' => $GLOBALS['rTorrentCombine']
  1482. ),
  1483. ),
  1484. 'Test Connection' => array(
  1485. array(
  1486. 'type' => 'blank',
  1487. 'label' => 'Please Save before Testing'
  1488. ),
  1489. array(
  1490. 'type' => 'button',
  1491. 'label' => '',
  1492. 'icon' => 'fa fa-flask',
  1493. 'class' => 'pull-right',
  1494. 'text' => 'Test Connection',
  1495. 'attr' => 'onclick="testAPIConnection(\'rtorrent\')"'
  1496. ),
  1497. )
  1498. )
  1499. ),
  1500. array(
  1501. 'name' => 'Deluge',
  1502. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1503. 'image' => 'plugins/images/tabs/deluge.png',
  1504. 'category' => 'Downloader',
  1505. 'settings' => array(
  1506. 'custom' => '
  1507. <div class="row">
  1508. <div class="col-lg-12">
  1509. <div class="panel panel-info">
  1510. <div class="panel-heading">
  1511. <span lang="en">Notice</span>
  1512. </div>
  1513. <div class="panel-wrapper collapse in" aria-expanded="true">
  1514. <div class="panel-body">
  1515. <ul class="list-icons">
  1516. <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>
  1517. <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>
  1518. <li><i class="fa fa-chevron-right text-danger"></i> Activate WebAPI plugin </li>
  1519. </ul>
  1520. </div>
  1521. </div>
  1522. </div>
  1523. </div>
  1524. </div>
  1525. ',
  1526. 'Enable' => array(
  1527. array(
  1528. 'type' => 'switch',
  1529. 'name' => 'homepageDelugeEnabled',
  1530. 'label' => 'Enable',
  1531. 'value' => $GLOBALS['homepageDelugeEnabled']
  1532. ),
  1533. array(
  1534. 'type' => 'select',
  1535. 'name' => 'homepageDelugeAuth',
  1536. 'label' => 'Minimum Authentication',
  1537. 'value' => $GLOBALS['homepageDelugeAuth'],
  1538. 'options' => $groups
  1539. )
  1540. ),
  1541. 'Connection' => array(
  1542. array(
  1543. 'type' => 'input',
  1544. 'name' => 'delugeURL',
  1545. 'label' => 'URL',
  1546. 'value' => $GLOBALS['delugeURL'],
  1547. 'help' => 'Please make sure to use local IP address and port - You also may use local dns name too.',
  1548. 'placeholder' => 'http(s)://hostname:port'
  1549. ),
  1550. array(
  1551. 'type' => 'password',
  1552. 'name' => 'delugePassword',
  1553. 'label' => 'Password',
  1554. 'value' => $GLOBALS['delugePassword']
  1555. )
  1556. ),
  1557. 'Misc Options' => array(
  1558. array(
  1559. 'type' => 'switch',
  1560. 'name' => 'delugeHideSeeding',
  1561. 'label' => 'Hide Seeding',
  1562. 'value' => $GLOBALS['delugeHideSeeding']
  1563. ), array(
  1564. 'type' => 'switch',
  1565. 'name' => 'delugeHideCompleted',
  1566. 'label' => 'Hide Completed',
  1567. 'value' => $GLOBALS['delugeHideCompleted']
  1568. ),
  1569. array(
  1570. 'type' => 'select',
  1571. 'name' => 'homepageDownloadRefresh',
  1572. 'label' => 'Refresh Seconds',
  1573. 'value' => $GLOBALS['homepageDownloadRefresh'],
  1574. 'options' => optionTime()
  1575. ),
  1576. array(
  1577. 'type' => 'switch',
  1578. 'name' => 'delugeCombine',
  1579. 'label' => 'Add to Combined Downloader',
  1580. 'value' => $GLOBALS['delugeCombine']
  1581. ),
  1582. ),
  1583. 'Test Connection' => array(
  1584. array(
  1585. 'type' => 'blank',
  1586. 'label' => 'Please Save before Testing'
  1587. ),
  1588. array(
  1589. 'type' => 'button',
  1590. 'label' => '',
  1591. 'icon' => 'fa fa-flask',
  1592. 'class' => 'pull-right',
  1593. 'text' => 'Test Connection',
  1594. 'attr' => 'onclick="testAPIConnection(\'deluge\')"'
  1595. ),
  1596. )
  1597. )
  1598. ),
  1599. array(
  1600. 'name' => 'Sonarr',
  1601. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1602. 'image' => 'plugins/images/tabs/sonarr.png',
  1603. 'category' => 'PVR',
  1604. 'settings' => array(
  1605. 'Enable' => array(
  1606. array(
  1607. 'type' => 'switch',
  1608. 'name' => 'homepageSonarrEnabled',
  1609. 'label' => 'Enable',
  1610. 'value' => $GLOBALS['homepageSonarrEnabled']
  1611. ),
  1612. array(
  1613. 'type' => 'select',
  1614. 'name' => 'homepageSonarrAuth',
  1615. 'label' => 'Minimum Authentication',
  1616. 'value' => $GLOBALS['homepageSonarrAuth'],
  1617. 'options' => $groups
  1618. )
  1619. ),
  1620. 'Connection' => array(
  1621. array(
  1622. 'type' => 'input',
  1623. 'name' => 'sonarrURL',
  1624. 'label' => 'URL',
  1625. 'value' => $GLOBALS['sonarrURL'],
  1626. 'help' => 'Please make sure to use local IP address and port - You also may use local dns name too.',
  1627. 'placeholder' => 'http(s)://hostname:port'
  1628. ),
  1629. array(
  1630. 'type' => 'password-alt',
  1631. 'name' => 'sonarrToken',
  1632. 'label' => 'Token',
  1633. 'value' => $GLOBALS['sonarrToken']
  1634. )
  1635. ),
  1636. 'Misc Options' => array(
  1637. array(
  1638. 'type' => 'number',
  1639. 'name' => 'calendarStart',
  1640. 'label' => '# of Days Before',
  1641. 'value' => $GLOBALS['calendarStart'],
  1642. 'placeholder' => ''
  1643. ),
  1644. array(
  1645. 'type' => 'number',
  1646. 'name' => 'calendarEnd',
  1647. 'label' => '# of Days After',
  1648. 'value' => $GLOBALS['calendarEnd'],
  1649. 'placeholder' => ''
  1650. ),
  1651. array(
  1652. 'type' => 'select',
  1653. 'name' => 'calendarFirstDay',
  1654. 'label' => 'Start Day',
  1655. 'value' => $GLOBALS['calendarFirstDay'],
  1656. 'options' => $day
  1657. ),
  1658. array(
  1659. 'type' => 'select',
  1660. 'name' => 'calendarDefault',
  1661. 'label' => 'Default View',
  1662. 'value' => $GLOBALS['calendarDefault'],
  1663. 'options' => $calendarDefault
  1664. ),
  1665. array(
  1666. 'type' => 'select',
  1667. 'name' => 'calendarTimeFormat',
  1668. 'label' => 'Time Format',
  1669. 'value' => $GLOBALS['calendarTimeFormat'],
  1670. 'options' => $timeFormat
  1671. ),
  1672. array(
  1673. 'type' => 'select',
  1674. 'name' => 'calendarLimit',
  1675. 'label' => 'Items Per Day',
  1676. 'value' => $GLOBALS['calendarLimit'],
  1677. 'options' => $limit
  1678. ),
  1679. array(
  1680. 'type' => 'select',
  1681. 'name' => 'calendarRefresh',
  1682. 'label' => 'Refresh Seconds',
  1683. 'value' => $GLOBALS['calendarRefresh'],
  1684. 'options' => optionTime()
  1685. ),
  1686. array(
  1687. 'type' => 'switch',
  1688. 'name' => 'sonarrUnmonitored',
  1689. 'label' => 'Show Unmonitored',
  1690. 'value' => $GLOBALS['sonarrUnmonitored']
  1691. )
  1692. ),
  1693. 'Test Connection' => array(
  1694. array(
  1695. 'type' => 'blank',
  1696. 'label' => 'Please Save before Testing'
  1697. ),
  1698. array(
  1699. 'type' => 'button',
  1700. 'label' => '',
  1701. 'icon' => 'fa fa-flask',
  1702. 'class' => 'pull-right',
  1703. 'text' => 'Test Connection',
  1704. 'attr' => 'onclick="testAPIConnection(\'sonarr\')"'
  1705. ),
  1706. )
  1707. )
  1708. ),
  1709. array(
  1710. 'name' => 'Lidarr',
  1711. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1712. 'image' => 'plugins/images/tabs/lidarr.png',
  1713. 'category' => 'PMR',
  1714. 'settings' => array(
  1715. 'Enable' => array(
  1716. array(
  1717. 'type' => 'switch',
  1718. 'name' => 'homepageLidarrEnabled',
  1719. 'label' => 'Enable',
  1720. 'value' => $GLOBALS['homepageLidarrEnabled']
  1721. ),
  1722. array(
  1723. 'type' => 'select',
  1724. 'name' => 'homepageLidarrAuth',
  1725. 'label' => 'Minimum Authentication',
  1726. 'value' => $GLOBALS['homepageLidarrAuth'],
  1727. 'options' => $groups
  1728. )
  1729. ),
  1730. 'Connection' => array(
  1731. array(
  1732. 'type' => 'input',
  1733. 'name' => 'lidarrURL',
  1734. 'label' => 'URL',
  1735. 'value' => $GLOBALS['lidarrURL'],
  1736. 'help' => 'Please make sure to use local IP address and port - You also may use local dns name too.',
  1737. 'placeholder' => 'http(s)://hostname:port'
  1738. ),
  1739. array(
  1740. 'type' => 'password-alt',
  1741. 'name' => 'lidarrToken',
  1742. 'label' => 'Token',
  1743. 'value' => $GLOBALS['lidarrToken']
  1744. )
  1745. ),
  1746. 'Misc Options' => array(
  1747. array(
  1748. 'type' => 'number',
  1749. 'name' => 'calendarStart',
  1750. 'label' => '# of Days Before',
  1751. 'value' => $GLOBALS['calendarStart'],
  1752. 'placeholder' => ''
  1753. ),
  1754. array(
  1755. 'type' => 'number',
  1756. 'name' => 'calendarEnd',
  1757. 'label' => '# of Days After',
  1758. 'value' => $GLOBALS['calendarEnd'],
  1759. 'placeholder' => ''
  1760. ),
  1761. array(
  1762. 'type' => 'select',
  1763. 'name' => 'calendarFirstDay',
  1764. 'label' => 'Start Day',
  1765. 'value' => $GLOBALS['calendarFirstDay'],
  1766. 'options' => $day
  1767. ),
  1768. array(
  1769. 'type' => 'select',
  1770. 'name' => 'calendarDefault',
  1771. 'label' => 'Default View',
  1772. 'value' => $GLOBALS['calendarDefault'],
  1773. 'options' => $calendarDefault
  1774. ),
  1775. array(
  1776. 'type' => 'select',
  1777. 'name' => 'calendarTimeFormat',
  1778. 'label' => 'Time Format',
  1779. 'value' => $GLOBALS['calendarTimeFormat'],
  1780. 'options' => $timeFormat
  1781. ),
  1782. array(
  1783. 'type' => 'select',
  1784. 'name' => 'calendarLimit',
  1785. 'label' => 'Items Per Day',
  1786. 'value' => $GLOBALS['calendarLimit'],
  1787. 'options' => $limit
  1788. ),
  1789. array(
  1790. 'type' => 'select',
  1791. 'name' => 'calendarRefresh',
  1792. 'label' => 'Refresh Seconds',
  1793. 'value' => $GLOBALS['calendarRefresh'],
  1794. 'options' => optionTime()
  1795. ),
  1796. ),
  1797. 'Test Connection' => array(
  1798. array(
  1799. 'type' => 'blank',
  1800. 'label' => 'Please Save before Testing'
  1801. ),
  1802. array(
  1803. 'type' => 'button',
  1804. 'label' => '',
  1805. 'icon' => 'fa fa-flask',
  1806. 'class' => 'pull-right',
  1807. 'text' => 'Test Connection',
  1808. 'attr' => 'onclick="testAPIConnection(\'lidarr\')"'
  1809. ),
  1810. )
  1811. )
  1812. ),
  1813. array(
  1814. 'name' => 'Radarr',
  1815. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1816. 'image' => 'plugins/images/tabs/radarr.png',
  1817. 'category' => 'PVR',
  1818. 'settings' => array(
  1819. 'Enable' => array(
  1820. array(
  1821. 'type' => 'switch',
  1822. 'name' => 'homepageRadarrEnabled',
  1823. 'label' => 'Enable',
  1824. 'value' => $GLOBALS['homepageRadarrEnabled']
  1825. ),
  1826. array(
  1827. 'type' => 'select',
  1828. 'name' => 'homepageRadarrAuth',
  1829. 'label' => 'Minimum Authentication',
  1830. 'value' => $GLOBALS['homepageRadarrAuth'],
  1831. 'options' => $groups
  1832. )
  1833. ),
  1834. 'Connection' => array(
  1835. array(
  1836. 'type' => 'input',
  1837. 'name' => 'radarrURL',
  1838. 'label' => 'URL',
  1839. 'value' => $GLOBALS['radarrURL'],
  1840. 'help' => 'Please make sure to use local IP address and port - You also may use local dns name too.',
  1841. 'placeholder' => 'http(s)://hostname:port'
  1842. ),
  1843. array(
  1844. 'type' => 'password-alt',
  1845. 'name' => 'radarrToken',
  1846. 'label' => 'Token',
  1847. 'value' => $GLOBALS['radarrToken']
  1848. )
  1849. ),
  1850. 'Misc Options' => array(
  1851. array(
  1852. 'type' => 'number',
  1853. 'name' => 'calendarStart',
  1854. 'label' => '# of Days Before',
  1855. 'value' => $GLOBALS['calendarStart'],
  1856. 'placeholder' => ''
  1857. ),
  1858. array(
  1859. 'type' => 'number',
  1860. 'name' => 'calendarEnd',
  1861. 'label' => '# of Days After',
  1862. 'value' => $GLOBALS['calendarEnd'],
  1863. 'placeholder' => ''
  1864. ),
  1865. array(
  1866. 'type' => 'select',
  1867. 'name' => 'calendarFirstDay',
  1868. 'label' => 'Start Day',
  1869. 'value' => $GLOBALS['calendarFirstDay'],
  1870. 'options' => $day
  1871. ),
  1872. array(
  1873. 'type' => 'select',
  1874. 'name' => 'calendarDefault',
  1875. 'label' => 'Default View',
  1876. 'value' => $GLOBALS['calendarDefault'],
  1877. 'options' => $calendarDefault
  1878. ),
  1879. array(
  1880. 'type' => 'select',
  1881. 'name' => 'calendarTimeFormat',
  1882. 'label' => 'Time Format',
  1883. 'value' => $GLOBALS['calendarTimeFormat'],
  1884. 'options' => $timeFormat
  1885. ),
  1886. array(
  1887. 'type' => 'select',
  1888. 'name' => 'calendarLimit',
  1889. 'label' => 'Items Per Day',
  1890. 'value' => $GLOBALS['calendarLimit'],
  1891. 'options' => $limit
  1892. ),
  1893. array(
  1894. 'type' => 'select',
  1895. 'name' => 'calendarRefresh',
  1896. 'label' => 'Refresh Seconds',
  1897. 'value' => $GLOBALS['calendarRefresh'],
  1898. 'options' => optionTime()
  1899. )
  1900. ),
  1901. 'Test Connection' => array(
  1902. array(
  1903. 'type' => 'blank',
  1904. 'label' => 'Please Save before Testing'
  1905. ),
  1906. array(
  1907. 'type' => 'button',
  1908. 'label' => '',
  1909. 'icon' => 'fa fa-flask',
  1910. 'class' => 'pull-right',
  1911. 'text' => 'Test Connection',
  1912. 'attr' => 'onclick="testAPIConnection(\'radarr\')"'
  1913. ),
  1914. )
  1915. )
  1916. ),
  1917. array(
  1918. 'name' => 'CouchPotato',
  1919. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1920. 'image' => 'plugins/images/tabs/couchpotato.png',
  1921. 'category' => 'PVR',
  1922. 'settings' => array(
  1923. 'Enable' => array(
  1924. array(
  1925. 'type' => 'switch',
  1926. 'name' => 'homepageCouchpotatoEnabled',
  1927. 'label' => 'Enable',
  1928. 'value' => $GLOBALS['homepageCouchpotatoEnabled']
  1929. ),
  1930. array(
  1931. 'type' => 'select',
  1932. 'name' => 'homepageCouchpotatoAuth',
  1933. 'label' => 'Minimum Authentication',
  1934. 'value' => $GLOBALS['homepageCouchpotatoAuth'],
  1935. 'options' => $groups
  1936. )
  1937. ),
  1938. 'Connection' => array(
  1939. array(
  1940. 'type' => 'input',
  1941. 'name' => 'couchpotatoURL',
  1942. 'label' => 'URL',
  1943. 'value' => $GLOBALS['couchpotatoURL'],
  1944. 'help' => 'Please make sure to use local IP address and port - You also may use local dns name too.',
  1945. 'placeholder' => 'http(s)://hostname:port'
  1946. ),
  1947. array(
  1948. 'type' => 'password-alt',
  1949. 'name' => 'couchpotatoToken',
  1950. 'label' => 'Token',
  1951. 'value' => $GLOBALS['couchpotatoToken']
  1952. )
  1953. ),
  1954. 'Misc Options' => array(
  1955. array(
  1956. 'type' => 'select',
  1957. 'name' => 'calendarFirstDay',
  1958. 'label' => 'Start Day',
  1959. 'value' => $GLOBALS['calendarFirstDay'],
  1960. 'options' => $day
  1961. ),
  1962. array(
  1963. 'type' => 'select',
  1964. 'name' => 'calendarDefault',
  1965. 'label' => 'Default View',
  1966. 'value' => $GLOBALS['calendarDefault'],
  1967. 'options' => $calendarDefault
  1968. ),
  1969. array(
  1970. 'type' => 'select',
  1971. 'name' => 'calendarTimeFormat',
  1972. 'label' => 'Time Format',
  1973. 'value' => $GLOBALS['calendarTimeFormat'],
  1974. 'options' => $timeFormat
  1975. ),
  1976. array(
  1977. 'type' => 'select',
  1978. 'name' => 'calendarLimit',
  1979. 'label' => 'Items Per Day',
  1980. 'value' => $GLOBALS['calendarLimit'],
  1981. 'options' => $limit
  1982. ),
  1983. array(
  1984. 'type' => 'select',
  1985. 'name' => 'calendarRefresh',
  1986. 'label' => 'Refresh Seconds',
  1987. 'value' => $GLOBALS['calendarRefresh'],
  1988. 'options' => optionTime()
  1989. )
  1990. )
  1991. )
  1992. ),
  1993. array(
  1994. 'name' => 'SickRage',
  1995. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1996. 'image' => 'plugins/images/tabs/sickrage.png',
  1997. 'category' => 'PVR',
  1998. 'settings' => array(
  1999. 'Enable' => array(
  2000. array(
  2001. 'type' => 'switch',
  2002. 'name' => 'homepageSickrageEnabled',
  2003. 'label' => 'Enable',
  2004. 'value' => $GLOBALS['homepageSickrageEnabled']
  2005. ),
  2006. array(
  2007. 'type' => 'select',
  2008. 'name' => 'homepageSickrageAuth',
  2009. 'label' => 'Minimum Authentication',
  2010. 'value' => $GLOBALS['homepageSickrageAuth'],
  2011. 'options' => $groups
  2012. )
  2013. ),
  2014. 'Connection' => array(
  2015. array(
  2016. 'type' => 'input',
  2017. 'name' => 'sickrageURL',
  2018. 'label' => 'URL',
  2019. 'value' => $GLOBALS['sickrageURL'],
  2020. 'help' => 'Please make sure to use local IP address and port - You also may use local dns name too.',
  2021. 'placeholder' => 'http(s)://hostname:port'
  2022. ),
  2023. array(
  2024. 'type' => 'password-alt',
  2025. 'name' => 'sickrageToken',
  2026. 'label' => 'Token',
  2027. 'value' => $GLOBALS['sickrageToken']
  2028. )
  2029. ),
  2030. 'Misc Options' => array(
  2031. array(
  2032. 'type' => 'select',
  2033. 'name' => 'calendarFirstDay',
  2034. 'label' => 'Start Day',
  2035. 'value' => $GLOBALS['calendarFirstDay'],
  2036. 'options' => $day
  2037. ),
  2038. array(
  2039. 'type' => 'select',
  2040. 'name' => 'calendarDefault',
  2041. 'label' => 'Default View',
  2042. 'value' => $GLOBALS['calendarDefault'],
  2043. 'options' => $calendarDefault
  2044. ),
  2045. array(
  2046. 'type' => 'select',
  2047. 'name' => 'calendarTimeFormat',
  2048. 'label' => 'Time Format',
  2049. 'value' => $GLOBALS['calendarTimeFormat'],
  2050. 'options' => $timeFormat
  2051. ),
  2052. array(
  2053. 'type' => 'select',
  2054. 'name' => 'calendarLimit',
  2055. 'label' => 'Items Per Day',
  2056. 'value' => $GLOBALS['calendarLimit'],
  2057. 'options' => $limit
  2058. ),
  2059. array(
  2060. 'type' => 'select',
  2061. 'name' => 'calendarRefresh',
  2062. 'label' => 'Refresh Seconds',
  2063. 'value' => $GLOBALS['calendarRefresh'],
  2064. 'options' => optionTime()
  2065. )
  2066. )
  2067. )
  2068. ),
  2069. array(
  2070. 'name' => 'Ombi',
  2071. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  2072. 'image' => 'plugins/images/tabs/ombi.png',
  2073. 'category' => 'Requests',
  2074. 'settings' => array(
  2075. 'Enable' => array(
  2076. array(
  2077. 'type' => 'switch',
  2078. 'name' => 'homepageOmbiEnabled',
  2079. 'label' => 'Enable',
  2080. 'value' => $GLOBALS['homepageOmbiEnabled']
  2081. ),
  2082. array(
  2083. 'type' => 'select',
  2084. 'name' => 'homepageOmbiAuth',
  2085. 'label' => 'Minimum Authentication',
  2086. 'value' => $GLOBALS['homepageOmbiAuth'],
  2087. 'options' => $groups
  2088. )
  2089. ),
  2090. 'Connection' => array(
  2091. array(
  2092. 'type' => 'input',
  2093. 'name' => 'ombiURL',
  2094. 'label' => 'URL',
  2095. 'value' => $GLOBALS['ombiURL'],
  2096. 'help' => 'Please make sure to use local IP address and port - You also may use local dns name too.',
  2097. 'placeholder' => 'http(s)://hostname:port'
  2098. ),
  2099. array(
  2100. 'type' => 'password-alt',
  2101. 'name' => 'ombiToken',
  2102. 'label' => 'Token',
  2103. 'value' => $GLOBALS['ombiToken']
  2104. )
  2105. ),
  2106. 'Misc Options' => array(
  2107. array(
  2108. 'type' => 'select',
  2109. 'name' => 'homepageOmbiRequestAuth',
  2110. 'label' => 'Minimum Group to Request',
  2111. 'value' => $GLOBALS['homepageOmbiRequestAuth'],
  2112. 'options' => $groups
  2113. ),
  2114. array(
  2115. 'type' => 'select',
  2116. 'name' => 'ombiTvDefault',
  2117. 'label' => 'TV Show Default Request',
  2118. 'value' => $GLOBALS['ombiTvDefault'],
  2119. 'options' => $ombiTvOptions
  2120. ),
  2121. array(
  2122. 'type' => 'switch',
  2123. 'name' => 'ombiLimitUser',
  2124. 'label' => 'Limit to User',
  2125. 'value' => $GLOBALS['ombiLimitUser']
  2126. ),
  2127. array(
  2128. 'type' => 'number',
  2129. 'name' => 'ombiLimit',
  2130. 'label' => 'Item Limit',
  2131. 'value' => $GLOBALS['ombiLimit'],
  2132. ),
  2133. array(
  2134. 'type' => 'select',
  2135. 'name' => 'ombiRefresh',
  2136. 'label' => 'Refresh Seconds',
  2137. 'value' => $GLOBALS['ombiRefresh'],
  2138. 'options' => optionTime()
  2139. ),
  2140. array(
  2141. 'type' => 'switch',
  2142. 'name' => 'ombiAlias',
  2143. 'label' => 'Use Ombi Alias Names',
  2144. 'value' => $GLOBALS['ombiAlias'],
  2145. 'help' => 'Use Ombi Alias Names instead of Usernames - If Alias is blank, Alias will fallback to Username'
  2146. )
  2147. ),
  2148. 'Test Connection' => array(
  2149. array(
  2150. 'type' => 'blank',
  2151. 'label' => 'Please Save before Testing'
  2152. ),
  2153. array(
  2154. 'type' => 'button',
  2155. 'label' => '',
  2156. 'icon' => 'fa fa-flask',
  2157. 'class' => 'pull-right',
  2158. 'text' => 'Test Connection',
  2159. 'attr' => 'onclick="testAPIConnection(\'ombi\')"'
  2160. ),
  2161. )
  2162. )
  2163. ),
  2164. array(
  2165. 'name' => 'HealthChecks',
  2166. 'enabled' => true,
  2167. 'image' => 'plugins/images/tabs/healthchecks.png',
  2168. 'category' => 'Monitor',
  2169. 'settings' => array(
  2170. 'Enable' => array(
  2171. array(
  2172. 'type' => 'switch',
  2173. 'name' => 'homepageHealthChecksEnabled',
  2174. 'label' => 'Enable',
  2175. 'value' => $GLOBALS['homepageHealthChecksEnabled']
  2176. ),
  2177. array(
  2178. 'type' => 'select',
  2179. 'name' => 'homepageHealthChecksAuth',
  2180. 'label' => 'Minimum Authentication',
  2181. 'value' => $GLOBALS['homepageHealthChecksAuth'],
  2182. 'options' => $groups
  2183. )
  2184. ),
  2185. 'Connection' => array(
  2186. array(
  2187. 'type' => 'input',
  2188. 'name' => 'healthChecksURL',
  2189. 'label' => 'URL',
  2190. 'value' => $GLOBALS['healthChecksURL'],
  2191. 'help' => 'URL for HealthChecks API',
  2192. 'placeholder' => 'HealthChecks API URL'
  2193. ),
  2194. array(
  2195. 'type' => 'password-alt',
  2196. 'name' => 'healthChecksToken',
  2197. 'label' => 'Token',
  2198. 'value' => $GLOBALS['healthChecksToken']
  2199. )
  2200. ),
  2201. 'Misc Options' => array(
  2202. array(
  2203. 'type' => 'input',
  2204. 'name' => 'healthChecksTags',
  2205. 'label' => 'Tags',
  2206. 'value' => $GLOBALS['healthChecksTags'],
  2207. 'help' => 'Pull only checks with this tag - Blank for all',
  2208. 'placeholder' => 'Multiple tags using CSV - tag1,tag2'
  2209. ),
  2210. array(
  2211. 'type' => 'select',
  2212. 'name' => 'homepageHealthChecksRefresh',
  2213. 'label' => 'Refresh Seconds',
  2214. 'value' => $GLOBALS['homepageHealthChecksRefresh'],
  2215. 'options' => optionTime()
  2216. ),
  2217. ),
  2218. )
  2219. ),
  2220. array(
  2221. 'name' => 'CustomHTML-1',
  2222. 'enabled' => (strpos('personal,business', $GLOBALS['license']) !== false) ? true : false,
  2223. 'image' => 'plugins/images/tabs/custom1.png',
  2224. 'category' => 'Custom',
  2225. 'settings' => array(
  2226. 'Enable' => array(
  2227. array(
  2228. 'type' => 'switch',
  2229. 'name' => 'homepagCustomHTMLoneEnabled',
  2230. 'label' => 'Enable',
  2231. 'value' => $GLOBALS['homepagCustomHTMLoneEnabled']
  2232. ),
  2233. array(
  2234. 'type' => 'select',
  2235. 'name' => 'homepagCustomHTMLoneAuth',
  2236. 'label' => 'Minimum Authentication',
  2237. 'value' => $GLOBALS['homepagCustomHTMLoneAuth'],
  2238. 'options' => $groups
  2239. )
  2240. ),
  2241. 'Code' => array(
  2242. array(
  2243. 'type' => 'textbox',
  2244. 'name' => 'customHTMLone',
  2245. 'class' => 'hidden customHTMLoneTextarea',
  2246. 'label' => '',
  2247. 'value' => $GLOBALS['customHTMLone'],
  2248. ),
  2249. array(
  2250. 'type' => 'html',
  2251. 'override' => 12,
  2252. 'label' => 'Custom HTML/JavaScript',
  2253. '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>'
  2254. ),
  2255. )
  2256. )
  2257. ),
  2258. array(
  2259. 'name' => 'CustomHTML-2',
  2260. 'enabled' => (strpos('personal,business', $GLOBALS['license']) !== false) ? true : false,
  2261. 'image' => 'plugins/images/tabs/custom2.png',
  2262. 'category' => 'Custom',
  2263. 'settings' => array(
  2264. 'Enable' => array(
  2265. array(
  2266. 'type' => 'switch',
  2267. 'name' => 'homepagCustomHTMLtwoEnabled',
  2268. 'label' => 'Enable',
  2269. 'value' => $GLOBALS['homepagCustomHTMLtwoEnabled']
  2270. ),
  2271. array(
  2272. 'type' => 'select',
  2273. 'name' => 'homepagCustomHTMLtwoAuth',
  2274. 'label' => 'Minimum Authentication',
  2275. 'value' => $GLOBALS['homepagCustomHTMLtwoAuth'],
  2276. 'options' => $groups
  2277. )
  2278. ),
  2279. 'Code' => array(
  2280. array(
  2281. 'type' => 'textbox',
  2282. 'name' => 'customHTMLtwo',
  2283. 'class' => 'hidden customHTMLtwoTextarea',
  2284. 'label' => '',
  2285. 'value' => $GLOBALS['customHTMLtwo'],
  2286. ),
  2287. array(
  2288. 'type' => 'html',
  2289. 'override' => 12,
  2290. 'label' => 'Custom HTML/JavaScript',
  2291. '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>'
  2292. ),
  2293. )
  2294. )
  2295. )
  2296. );
  2297. }
  2298. function buildHomepageSettings()
  2299. {
  2300. $homepageOrder = homepageOrder();
  2301. $homepageList = '<h4>Drag Homepage Items to Order Them</h4><div id="homepage-items-sort" class="external-events">';
  2302. $inputList = '<form id="homepage-values" class="row">';
  2303. foreach ($homepageOrder as $key => $val) {
  2304. switch ($key) {
  2305. case 'homepageOrdercustomhtml':
  2306. $class = 'bg-info';
  2307. $image = 'plugins/images/tabs/custom1.png';
  2308. if (!$GLOBALS['homepagCustomHTMLoneEnabled']) {
  2309. $class .= ' faded';
  2310. }
  2311. break;
  2312. case 'homepageOrdercustomhtmlTwo':
  2313. $class = 'bg-info';
  2314. $image = 'plugins/images/tabs/custom2.png';
  2315. if (!$GLOBALS['homepagCustomHTMLtwoEnabled']) {
  2316. $class .= ' faded';
  2317. }
  2318. break;
  2319. case 'homepageOrdertransmission':
  2320. $class = 'bg-transmission';
  2321. $image = 'plugins/images/tabs/transmission.png';
  2322. if (!$GLOBALS['homepageTransmissionEnabled']) {
  2323. $class .= ' faded';
  2324. }
  2325. break;
  2326. case 'homepageOrdernzbget':
  2327. $class = 'bg-nzbget';
  2328. $image = 'plugins/images/tabs/nzbget.png';
  2329. if (!$GLOBALS['homepageNzbgetEnabled']) {
  2330. $class .= ' faded';
  2331. }
  2332. break;
  2333. case 'homepageOrderjdownloader':
  2334. $class = 'bg-sab';
  2335. $image = 'plugins/images/tabs/jdownloader.png';
  2336. if (!$GLOBALS['homepageJdownloaderEnabled']) {
  2337. $class .= ' faded';
  2338. }
  2339. break;
  2340. case 'homepageOrdersabnzbd':
  2341. $class = 'bg-sab';
  2342. $image = 'plugins/images/tabs/sabnzbd.png';
  2343. if (!$GLOBALS['homepageSabnzbdEnabled']) {
  2344. $class .= ' faded';
  2345. }
  2346. break;
  2347. case 'homepageOrderdeluge':
  2348. $class = 'bg-deluge';
  2349. $image = 'plugins/images/tabs/deluge.png';
  2350. if (!$GLOBALS['homepageDelugeEnabled']) {
  2351. $class .= ' faded';
  2352. }
  2353. break;
  2354. case 'homepageOrderqBittorrent':
  2355. $class = 'bg-qbit';
  2356. $image = 'plugins/images/tabs/qBittorrent.png';
  2357. if (!$GLOBALS['homepageqBittorrentEnabled']) {
  2358. $class .= ' faded';
  2359. }
  2360. break;
  2361. case 'homepageOrderrTorrent':
  2362. $class = 'bg-qbit';
  2363. $image = 'plugins/images/tabs/rTorrent.png';
  2364. if (!$GLOBALS['homepagerTorrentEnabled']) {
  2365. $class .= ' faded';
  2366. }
  2367. break;
  2368. case 'homepageOrderplexnowplaying':
  2369. case 'homepageOrderplexrecent':
  2370. case 'homepageOrderplexplaylist':
  2371. $class = 'bg-plex';
  2372. $image = 'plugins/images/tabs/plex.png';
  2373. if (!$GLOBALS['homepagePlexEnabled']) {
  2374. $class .= ' faded';
  2375. }
  2376. break;
  2377. case 'homepageOrderembynowplaying':
  2378. case 'homepageOrderembyrecent':
  2379. $class = 'bg-emby';
  2380. $image = 'plugins/images/tabs/emby.png';
  2381. if (!$GLOBALS['homepageEmbyEnabled']) {
  2382. $class .= ' faded';
  2383. }
  2384. break;
  2385. case 'homepageOrderombi':
  2386. $class = 'bg-inverse';
  2387. $image = 'plugins/images/tabs/ombi.png';
  2388. if (!$GLOBALS['homepageOmbiEnabled']) {
  2389. $class .= ' faded';
  2390. }
  2391. break;
  2392. case 'homepageOrdercalendar':
  2393. $class = 'bg-primary';
  2394. $image = 'plugins/images/tabs/calendar.png';
  2395. if (!$GLOBALS['homepageSonarrEnabled'] && !$GLOBALS['homepageRadarrEnabled'] && !$GLOBALS['homepageSickrageEnabled'] && !$GLOBALS['homepageCouchpotatoEnabled']) {
  2396. $class .= ' faded';
  2397. }
  2398. break;
  2399. case 'homepageOrderdownloader':
  2400. $class = 'bg-inverse';
  2401. $image = 'plugins/images/tabs/downloader.png';
  2402. if (!$GLOBALS['jdownloaderCombine'] && !$GLOBALS['sabnzbdCombine'] && !$GLOBALS['nzbgetCombine'] && !$GLOBALS['rTorrentCombine'] && !$GLOBALS['delugeCombine'] && !$GLOBALS['transmissionCombine'] && !$GLOBALS['qBittorrentCombine']) {
  2403. $class .= ' faded';
  2404. }
  2405. break;
  2406. case 'homepageOrderhealthchecks':
  2407. $class = 'bg-healthchecks';
  2408. $image = 'plugins/images/tabs/healthchecks.png';
  2409. if (!$GLOBALS['homepageHealthChecksEnabled']) {
  2410. $class .= ' faded';
  2411. }
  2412. break;
  2413. default:
  2414. $class = 'blue-bg';
  2415. $image = '';
  2416. break;
  2417. }
  2418. $homepageList .= '
  2419. <div class="col-md-3 col-xs-12 sort-homepage m-t-10 hvr-grow">
  2420. <div class="homepage-drag fc-event ' . $class . ' lazyload" data-src="' . $image . '">
  2421. <span class="ordinal-position text-uppercase badge bg-org homepage-number" data-link="' . $key . '" style="float:left;width: 30px;">' . $val . '</span>
  2422. <span class="homepage-text">&nbsp; ' . strtoupper(substr($key, 13)) . '</span>
  2423. </div>
  2424. </div>
  2425. ';
  2426. $inputList .= '<input type="hidden" name="' . $key . '">';
  2427. }
  2428. $homepageList .= '</div>';
  2429. $inputList .= '</form>';
  2430. return $homepageList . $inputList;
  2431. }
  2432. function ombiTVDefault($type)
  2433. {
  2434. switch ($type) {
  2435. case 'all':
  2436. return ($type == $GLOBALS['ombiTvDefault']) ? true : false;
  2437. case 'first':
  2438. return ($type == $GLOBALS['ombiTvDefault']) ? true : false;
  2439. case 'last':
  2440. return ($type == $GLOBALS['ombiTvDefault']) ? true : false;
  2441. default:
  2442. return false;
  2443. }
  2444. return false;
  2445. }