homepage-functions.php 78 KB

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