homepage-functions.php 96 KB

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