homepage-functions.php 49 KB

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