homepage-functions.php 44 KB

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