homepage-functions.php 62 KB

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