homepage-functions.php 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255
  1. <?php
  2. //homepage order
  3. function homepageOrder(){
  4. $homepageOrder = array(
  5. "homepageOrdercustomhtml" => $GLOBALS['homepageOrdercustomhtml'],
  6. "homepageOrdernotice" => $GLOBALS['homepageOrdernotice'],
  7. "homepageOrderplexsearch" => $GLOBALS['homepageOrderplexsearch'],
  8. "homepageOrderspeedtest" => $GLOBALS['homepageOrderspeedtest'],
  9. "homepageOrdernzbget" => $GLOBALS['homepageOrdernzbget'],
  10. "homepageOrdersabnzbd" => $GLOBALS['homepageOrdersabnzbd'],
  11. "homepageOrderplexnowplaying" => $GLOBALS['homepageOrderplexnowplaying'],
  12. "homepageOrderplexrecent" => $GLOBALS['homepageOrderplexrecent'],
  13. "homepageOrderplexplaylist" => $GLOBALS['homepageOrderplexplaylist'],
  14. "homepageOrderembynowplaying" => $GLOBALS['homepageOrderembynowplaying'],
  15. "homepageOrderembyrecent" => $GLOBALS['homepageOrderembyrecent'],
  16. "homepageOrderombi" => $GLOBALS['homepageOrderombi'],
  17. "homepageOrdercalendar" => $GLOBALS['homepageOrdercalendar'],
  18. "homepageOrdernoticeguest" => $GLOBALS['homepageOrdernoticeguest'],
  19. "homepageOrdertransmission" => $GLOBALS['homepageOrdertransmission'],
  20. "homepageOrderqBittorrent" => $GLOBALS['homepageOrderqBittorrent'],
  21. "homepageOrderdeluge" => $GLOBALS['homepageOrderdeluge'],
  22. );
  23. asort($homepageOrder);
  24. return $homepageOrder;
  25. }
  26. function buildHomepage(){
  27. $homepageOrder = homepageOrder();
  28. $homepageBuilt = '';
  29. foreach ($homepageOrder as $key => $value) {
  30. $homepageBuilt .= buildHomepageItem($key);
  31. }
  32. return $homepageBuilt;
  33. }
  34. function buildHomepageItem($homepageItem){
  35. $item = '<div id="'.$homepageItem.'">';
  36. switch ($homepageItem) {
  37. case 'homepageOrderplexsearch':
  38. break;
  39. case 'homepageOrdercustomhtml':
  40. break;
  41. case 'homepageOrdernotice':
  42. break;
  43. case 'homepageOrdernoticeguest':
  44. break;
  45. case 'homepageOrderspeedtest':
  46. break;
  47. case 'homepageOrderqBittorrent':
  48. if($GLOBALS['homepageqBittorrentEnabled']){
  49. $item .= '
  50. <script>
  51. // homepageOrderqBittorrent
  52. homepageDownloader("qBittorrent", "'.$GLOBALS['homepageDownloadRefresh'].'");
  53. // End homepageOrderqBittorrent
  54. </script>
  55. ';
  56. }
  57. break;
  58. case 'homepageOrderdeluge':
  59. if($GLOBALS['homepageDelugeEnabled']){
  60. $item .= '
  61. <script>
  62. // Deluge
  63. homepageDownloader("deluge", "'.$GLOBALS['homepageDownloadRefresh'].'");
  64. // End Deluge
  65. </script>
  66. ';
  67. }
  68. break;
  69. case 'homepageOrdertransmission':
  70. if($GLOBALS['homepageTransmissionEnabled']){
  71. $item .= '
  72. <script>
  73. // Transmission
  74. homepageDownloader("transmission", "'.$GLOBALS['homepageDownloadRefresh'].'");
  75. // End Transmission
  76. </script>
  77. ';
  78. }
  79. break;
  80. case 'homepageOrdernzbget':
  81. if($GLOBALS['homepageNzbgetEnabled']){
  82. $item .= '
  83. <script>
  84. // NZBGet
  85. homepageDownloader("nzbget", "'.$GLOBALS['homepageDownloadRefresh'].'");
  86. // End NZBGet
  87. </script>
  88. ';
  89. }
  90. break;
  91. case 'homepageOrdersabnzbd':
  92. if($GLOBALS['homepageSabnzbdEnabled']){
  93. $item .= '
  94. <script>
  95. // SabNZBd
  96. homepageDownloader("sabnzbd", "'.$GLOBALS['homepageDownloadRefresh'].'");
  97. // End SabNZBd
  98. </script>
  99. ';
  100. }
  101. break;
  102. case 'homepageOrderplexnowplaying':
  103. if($GLOBALS['homepagePlexStreams']){
  104. $item .= '
  105. <script>
  106. // Plex Stream
  107. homepageStream("plex", "'.$GLOBALS['homepageStreamRefresh'].'");
  108. // End Plex Stream
  109. </script>
  110. ';
  111. }
  112. break;
  113. case 'homepageOrderplexrecent':
  114. if($GLOBALS['homepagePlexRecent']){
  115. $item .= '
  116. <script>
  117. // Plex Recent
  118. homepageRecent("plex", "'.$GLOBALS['homepageRecentRefresh'].'");
  119. // End Plex Recent
  120. </script>
  121. ';
  122. }
  123. break;
  124. case 'homepageOrderplexplaylist':
  125. break;
  126. case 'homepageOrderembynowplaying':
  127. if($GLOBALS['homepageEmbyStreams']){
  128. $item .= '
  129. <script>
  130. // Emby Stream
  131. homepageStream("emby", "'.$GLOBALS['homepageStreamRefresh'].'");
  132. // End Emby Stream
  133. </script>
  134. ';
  135. }
  136. break;
  137. case 'homepageOrderembyrecent':
  138. if($GLOBALS['homepageEmbyRecent']){
  139. $item .= '
  140. <script>
  141. // Emby Recent
  142. homepageRecent("emby", "'.$GLOBALS['homepageRecentRefresh'].'");
  143. // End Emby Recent
  144. </script>
  145. ';
  146. }
  147. break;
  148. case 'homepageOrderombi':
  149. break;
  150. case 'homepageOrdercalendar':
  151. $item .= '
  152. <div id="calendar" class="fc fc-ltr"></div>
  153. <script>
  154. // Calendar
  155. homepageCalendar("'.$GLOBALS['calendarRefresh'].'");
  156. // End Calendar
  157. </script>
  158. ';
  159. break;
  160. default:
  161. # code...
  162. break;
  163. }
  164. return $item.'</div>';
  165. }
  166. function getHomepageList(){
  167. $groups = groupSelect();
  168. $time = array(
  169. array(
  170. 'name' => '5',
  171. 'value' => '5000'
  172. ),
  173. array(
  174. 'name' => '10',
  175. 'value' => '10000'
  176. ),
  177. array(
  178. 'name' => '15',
  179. 'value' => '15000'
  180. ),
  181. array(
  182. 'name' => '30',
  183. 'value' => '30000'
  184. ),
  185. array(
  186. 'name' => '60 [1 Minute]',
  187. 'value' => '60000'
  188. ),
  189. array(
  190. 'name' => '300 [5 Minutes]',
  191. 'value' => '300000'
  192. ),
  193. array(
  194. 'name' => '900 [15 Minutes]',
  195. 'value' => '900000'
  196. ),
  197. array(
  198. 'name' => '1800 [30 Minutes]',
  199. 'value' => '1800000'
  200. ),
  201. array(
  202. 'name' => '3600 [1 Hour]',
  203. 'value' => '3600000'
  204. ),
  205. );
  206. $limit = array(
  207. array(
  208. 'name' => '1 Item',
  209. 'value' => '1'
  210. ),
  211. array(
  212. 'name' => '2 Items',
  213. 'value' => '2'
  214. ),
  215. array(
  216. 'name' => '3 Items',
  217. 'value' => '3'
  218. ),
  219. array(
  220. 'name' => '4 Items',
  221. 'value' => '4'
  222. ),
  223. array(
  224. 'name' => '5 Items',
  225. 'value' => '5'
  226. ),
  227. array(
  228. 'name' => '6 Items',
  229. 'value' => '6'
  230. ),
  231. array(
  232. 'name' => '7 Items',
  233. 'value' => '7'
  234. ),
  235. array(
  236. 'name' => '8 Items',
  237. 'value' => '8'
  238. ),
  239. array(
  240. 'name' => 'Unlimited',
  241. 'value' => '1000'
  242. ),
  243. );
  244. $day = array(
  245. array(
  246. 'name' => 'Sunday',
  247. 'value' => '0'
  248. ),
  249. array(
  250. 'name' => 'Monday',
  251. 'value' => '1'
  252. ),
  253. array(
  254. 'name' => 'Tueday',
  255. 'value' => '2'
  256. ),
  257. array(
  258. 'name' => 'Wednesday',
  259. 'value' => '3'
  260. ),
  261. array(
  262. 'name' => 'Thursday',
  263. 'value' => '4'
  264. ),
  265. array(
  266. 'name' => 'Friday',
  267. 'value' => '5'
  268. ),
  269. array(
  270. 'name' => 'Saturday',
  271. 'value' => '6'
  272. )
  273. );
  274. $calendarDefault = array(
  275. array(
  276. 'name' => 'Month',
  277. 'value' => 'month'
  278. ),
  279. array(
  280. 'name' => 'Day',
  281. 'value' => 'basicDay'
  282. ),
  283. array(
  284. 'name' => 'Week',
  285. 'value' => 'basicWeek'
  286. )
  287. );
  288. $timeFormat = array(
  289. array(
  290. 'name' => '6p',
  291. 'value' => 'h(:mm)t'
  292. ),
  293. array(
  294. 'name' => '6:00p',
  295. 'value' => 'h:mmt'
  296. ),
  297. array(
  298. 'name' => '6:00',
  299. 'value' => 'h:mm'
  300. ),
  301. array(
  302. 'name' => '18',
  303. 'value' => 'H(:mm)'
  304. ),
  305. array(
  306. 'name' => '18:00',
  307. 'value' => 'H:mm'
  308. )
  309. );
  310. $qBittorrentSortOptions = array(
  311. array(
  312. 'name' => 'Hash',
  313. 'value' => 'hash'
  314. ),
  315. array(
  316. 'name' => 'Name',
  317. 'value' => 'name'
  318. ),
  319. array(
  320. 'name' => 'Size',
  321. 'value' => 'size'
  322. ),
  323. array(
  324. 'name' => 'Progress',
  325. 'value' => 'progress'
  326. ),
  327. array(
  328. 'name' => 'Download Speed',
  329. 'value' => 'dlspeed'
  330. ),
  331. array(
  332. 'name' => 'Upload Speed',
  333. 'value' => 'upspeed'
  334. ),
  335. array(
  336. 'name' => 'Priority',
  337. 'value' => 'priority'
  338. ),
  339. array(
  340. 'name' => 'Number of Seeds',
  341. 'value' => 'num_seeds'
  342. ),
  343. array(
  344. 'name' => 'Number of Seeds in Swarm',
  345. 'value' => 'num_complete'
  346. ),
  347. array(
  348. 'name' => 'Number of Leechers',
  349. 'value' => 'num_leechs'
  350. ),
  351. array(
  352. 'name' => 'Number of Leechers in Swarm',
  353. 'value' => 'num_incomplete'
  354. ),
  355. array(
  356. 'name' => 'Ratio',
  357. 'value' => 'ratio'
  358. ),
  359. array(
  360. 'name' => 'ETA',
  361. 'value' => 'eta'
  362. ),
  363. array(
  364. 'name' => 'State',
  365. 'value' => 'state'
  366. ),
  367. array(
  368. 'name' => 'Category',
  369. 'value' => 'category'
  370. )
  371. );
  372. return array(
  373. array(
  374. 'name' => 'Plex',
  375. 'enabled' => true,
  376. 'image' => 'plugins/images/tabs/plex.png',
  377. 'category' => 'Media Server',
  378. 'settings' => array(
  379. 'Enable' => array(
  380. array(
  381. 'type' => 'switch',
  382. 'name' => 'homepagePlexEnabled',
  383. 'label' => 'Enable',
  384. 'value' => $GLOBALS['homepagePlexEnabled']
  385. ),
  386. array(
  387. 'type' => 'select',
  388. 'name' => 'homepagePlexAuth',
  389. 'label' => 'Minimum Authentication',
  390. 'value' => $GLOBALS['homepagePlexAuth'],
  391. 'options' => $groups
  392. )
  393. ),
  394. 'Connection' => array(
  395. array(
  396. 'type' => 'input',
  397. 'name' => 'plexURL',
  398. 'label' => 'URL',
  399. 'value' => $GLOBALS['plexURL'],
  400. 'placeholder' => 'http(s)://hostname:port'
  401. ),
  402. array(
  403. 'type' => 'input',
  404. 'name' => 'plexToken',
  405. 'label' => 'Token',
  406. 'value' => $GLOBALS['plexToken']
  407. ),
  408. array(
  409. 'type' => 'input',
  410. 'name' => 'plexID',
  411. 'label' => 'Plex Machine',
  412. 'value' => $GLOBALS['plexID']
  413. )
  414. ),
  415. 'Active Streams' => array(
  416. array(
  417. 'type' => 'switch',
  418. 'name' => 'homepagePlexStreams',
  419. 'label' => 'Enable',
  420. 'value' => $GLOBALS['homepagePlexStreams']
  421. ),
  422. array(
  423. 'type' => 'select',
  424. 'name' => 'homepagePlexStreamsAuth',
  425. 'label' => 'Minimum Authorization',
  426. 'value' => $GLOBALS['homepagePlexStreamsAuth'],
  427. 'options' => $groups
  428. ),
  429. array(
  430. 'type' => 'switch',
  431. 'name' => 'homepageShowStreamNames',
  432. 'label' => 'User Information',
  433. 'value' => $GLOBALS['homepageShowStreamNames']
  434. ),
  435. array(
  436. 'type' => 'select',
  437. 'name' => 'homepageShowStreamNamesAuth',
  438. 'label' => 'Minimum Authorization',
  439. 'value' => $GLOBALS['homepageShowStreamNamesAuth'],
  440. 'options' => $groups
  441. ),
  442. array(
  443. 'type' => 'select',
  444. 'name' => 'homepageStreamRefresh',
  445. 'label' => 'Refresh Seconds',
  446. 'value' => $GLOBALS['homepageStreamRefresh'],
  447. 'options' => $time
  448. ),
  449. ),
  450. 'Recent Items' => array(
  451. array(
  452. 'type' => 'switch',
  453. 'name' => 'homepagePlexRecent',
  454. 'label' => 'Enable',
  455. 'value' => $GLOBALS['homepagePlexRecent']
  456. ),
  457. array(
  458. 'type' => 'select',
  459. 'name' => 'homepagePlexRecentAuth',
  460. 'label' => 'Minimum Authorization',
  461. 'value' => $GLOBALS['homepagePlexRecentAuth'],
  462. 'options' => $groups
  463. ),
  464. array(
  465. 'type' => 'select',
  466. 'name' => 'homepageRecentRefresh',
  467. 'label' => 'Refresh Seconds',
  468. 'value' => $GLOBALS['homepageRecentRefresh'],
  469. 'options' => $time
  470. ),
  471. ),
  472. 'Misc Options' => array(
  473. array(
  474. 'type' => 'input',
  475. 'name' => 'plexTabName',
  476. 'label' => 'Plex Tab Name',
  477. 'value' => $GLOBALS['plexTabName'],
  478. 'placeholder' => 'Only use if you have Plex in a reverse proxy'
  479. ),
  480. array(
  481. 'type' => 'input',
  482. 'name' => 'plexTabURL',
  483. 'label' => 'Plex Tab WAN URL',
  484. 'value' => $GLOBALS['plexTabURL'],
  485. 'placeholder' => 'http(s)://hostname:port'
  486. )
  487. )
  488. )
  489. ),
  490. array(
  491. 'name' => 'Emby',
  492. 'enabled' => true,
  493. 'image' => 'plugins/images/tabs/emby.png',
  494. 'category' => 'Media Server',
  495. 'settings' => array(
  496. 'Enable' => array(
  497. array(
  498. 'type' => 'switch',
  499. 'name' => 'homepageEmbyEnabled',
  500. 'label' => 'Enable',
  501. 'value' => $GLOBALS['homepageEmbyEnabled']
  502. ),
  503. array(
  504. 'type' => 'select',
  505. 'name' => 'homepageEmbyAuth',
  506. 'label' => 'Minimum Authentication',
  507. 'value' => $GLOBALS['homepageEmbyAuth'],
  508. 'options' => $groups
  509. )
  510. ),
  511. 'Connection' => array(
  512. array(
  513. 'type' => 'input',
  514. 'name' => 'embyURL',
  515. 'label' => 'URL',
  516. 'value' => $GLOBALS['embyURL'],
  517. 'placeholder' => 'http(s)://hostname:port'
  518. ),
  519. array(
  520. 'type' => 'input',
  521. 'name' => 'embyToken',
  522. 'label' => 'Token',
  523. 'value' => $GLOBALS['embyToken']
  524. )
  525. ),
  526. 'Active Streams' => array(
  527. array(
  528. 'type' => 'switch',
  529. 'name' => 'homepageEmbyStreams',
  530. 'label' => 'Enable',
  531. 'value' => $GLOBALS['homepageEmbyStreams']
  532. ),
  533. array(
  534. 'type' => 'select',
  535. 'name' => 'homepageEmbyStreamsAuth',
  536. 'label' => 'Minimum Authorization',
  537. 'value' => $GLOBALS['homepageEmbyStreamsAuth'],
  538. 'options' => $groups
  539. ),
  540. array(
  541. 'type' => 'switch',
  542. 'name' => 'homepageShowStreamNames',
  543. 'label' => 'User Information',
  544. 'value' => $GLOBALS['homepageShowStreamNames']
  545. ),
  546. array(
  547. 'type' => 'select',
  548. 'name' => 'homepageShowStreamNamesAuth',
  549. 'label' => 'Minimum Authorization',
  550. 'value' => $GLOBALS['homepageShowStreamNamesAuth'],
  551. 'options' => $groups
  552. ),
  553. array(
  554. 'type' => 'select',
  555. 'name' => 'homepageStreamRefresh',
  556. 'label' => 'Refresh Seconds',
  557. 'value' => $GLOBALS['homepageStreamRefresh'],
  558. 'options' => $time
  559. ),
  560. ),
  561. 'Recent Items' => array(
  562. array(
  563. 'type' => 'switch',
  564. 'name' => 'homepageEmbyRecent',
  565. 'label' => 'Enable',
  566. 'value' => $GLOBALS['homepageEmbyRecent']
  567. ),
  568. array(
  569. 'type' => 'select',
  570. 'name' => 'homepageEmbyRecentAuth',
  571. 'label' => 'Minimum Authorization',
  572. 'value' => $GLOBALS['homepageEmbyRecentAuth'],
  573. 'options' => $groups
  574. ),
  575. array(
  576. 'type' => 'select',
  577. 'name' => 'homepageRecentRefresh',
  578. 'label' => 'Refresh Seconds',
  579. 'value' => $GLOBALS['homepageRecentRefresh'],
  580. 'options' => $time
  581. ),
  582. ),
  583. 'Misc Options' => array(
  584. array(
  585. 'type' => 'input',
  586. 'name' => 'embyTabName',
  587. 'label' => 'Emby Tab Name',
  588. 'value' => $GLOBALS['embyTabName'],
  589. 'placeholder' => 'Only use if you have Plex in a reverse proxy'
  590. ),
  591. array(
  592. 'type' => 'input',
  593. 'name' => 'embyTabURL',
  594. 'label' => 'Emby Tab WAN URL',
  595. 'value' => $GLOBALS['embyTabURL'],
  596. 'placeholder' => 'http(s)://hostname:port'
  597. )
  598. )
  599. )
  600. ),
  601. array(
  602. 'name' => 'SabNZBD',
  603. 'enabled' => false,
  604. 'image' => 'plugins/images/tabs/sabnzbd.png',
  605. 'category' => 'Downloader',
  606. 'settings' => array(
  607. 'Enable' => array(
  608. array(
  609. 'type' => 'switch',
  610. 'name' => 'homepageSabnzbdEnabled',
  611. 'label' => 'Enable',
  612. 'value' => $GLOBALS['homepageSabnzbdEnabled']
  613. ),
  614. array(
  615. 'type' => 'select',
  616. 'name' => 'homepageSabnzbdAuth',
  617. 'label' => 'Minimum Authentication',
  618. 'value' => $GLOBALS['homepageSabnzbdAuth'],
  619. 'options' => $groups
  620. )
  621. ),
  622. 'Connection' => array(
  623. array(
  624. 'type' => 'input',
  625. 'name' => 'sabnzbdURL',
  626. 'label' => 'URL',
  627. 'value' => $GLOBALS['sabnzbdURL'],
  628. 'placeholder' => 'http(s)://hostname:port'
  629. ),
  630. array(
  631. 'type' => 'input',
  632. 'name' => 'sabnzbdToken',
  633. 'label' => 'Token',
  634. 'value' => $GLOBALS['sabnzbdToken']
  635. )
  636. ),
  637. 'Misc Options' => array(
  638. array(
  639. 'type' => 'select',
  640. 'name' => 'homepageDownloadRefresh',
  641. 'label' => 'Refresh Seconds',
  642. 'value' => $GLOBALS['homepageDownloadRefresh'],
  643. 'options' => $time
  644. )
  645. )
  646. )
  647. ),
  648. array(
  649. 'name' => 'NZBGet',
  650. 'enabled' => false,
  651. 'image' => 'plugins/images/tabs/nzbget.png',
  652. 'category' => 'Downloader',
  653. 'settings' => array(
  654. 'Enable' => array(
  655. array(
  656. 'type' => 'switch',
  657. 'name' => 'homepageNzbgetEnabled',
  658. 'label' => 'Enable',
  659. 'value' => $GLOBALS['homepageNzbgetEnabled']
  660. ),
  661. array(
  662. 'type' => 'select',
  663. 'name' => 'homepageNzbgetAuth',
  664. 'label' => 'Minimum Authentication',
  665. 'value' => $GLOBALS['homepageNzbgetAuth'],
  666. 'options' => $groups
  667. )
  668. ),
  669. 'Connection' => array(
  670. array(
  671. 'type' => 'input',
  672. 'name' => 'nzbgetURL',
  673. 'label' => 'URL',
  674. 'value' => $GLOBALS['nzbgetURL'],
  675. 'placeholder' => 'http(s)://hostname:port'
  676. ),
  677. array(
  678. 'type' => 'input',
  679. 'name' => 'nzbgetUsername',
  680. 'label' => 'Username',
  681. 'value' => $GLOBALS['nzbgetUsername']
  682. ),
  683. array(
  684. 'type' => 'password',
  685. 'name' => 'nzbgetPassword',
  686. 'label' => 'Password',
  687. 'value' => $GLOBALS['nzbgetPassword']
  688. )
  689. ),
  690. 'Misc Options' => array(
  691. array(
  692. 'type' => 'select',
  693. 'name' => 'homepageDownloadRefresh',
  694. 'label' => 'Refresh Seconds',
  695. 'value' => $GLOBALS['homepageDownloadRefresh'],
  696. 'options' => $time
  697. )
  698. )
  699. )
  700. ),
  701. array(
  702. 'name' => 'Transmission',
  703. 'enabled' => false,
  704. 'image' => 'plugins/images/tabs/transmission.png',
  705. 'category' => 'Downloader',
  706. 'settings' => array(
  707. 'Enable' => array(
  708. array(
  709. 'type' => 'switch',
  710. 'name' => 'homepageTransmissionEnabled',
  711. 'label' => 'Enable',
  712. 'value' => $GLOBALS['homepageTransmissionEnabled']
  713. ),
  714. array(
  715. 'type' => 'select',
  716. 'name' => 'homepageTransmissionAuth',
  717. 'label' => 'Minimum Authentication',
  718. 'value' => $GLOBALS['homepageTransmissionAuth'],
  719. 'options' => $groups
  720. )
  721. ),
  722. 'Connection' => array(
  723. array(
  724. 'type' => 'input',
  725. 'name' => 'transmissionURL',
  726. 'label' => 'URL',
  727. 'value' => $GLOBALS['transmissionURL'],
  728. 'placeholder' => 'http(s)://hostname:port'
  729. ),
  730. array(
  731. 'type' => 'input',
  732. 'name' => 'transmissionUsername',
  733. 'label' => 'Username',
  734. 'value' => $GLOBALS['transmissionUsername']
  735. ),
  736. array(
  737. 'type' => 'password',
  738. 'name' => 'transmissionPassword',
  739. 'label' => 'Password',
  740. 'value' => $GLOBALS['transmissionPassword']
  741. )
  742. ),
  743. 'Misc Options' => array(
  744. array(
  745. 'type' => 'switch',
  746. 'name' => 'transmissionHideSeeding',
  747. 'label' => 'Hide Seeding',
  748. 'value' => $GLOBALS['transmissionHideSeeding']
  749. ),array(
  750. 'type' => 'switch',
  751. 'name' => 'transmissionHideCompleted',
  752. 'label' => 'Hide Completed',
  753. 'value' => $GLOBALS['transmissionHideCompleted']
  754. ),
  755. array(
  756. 'type' => 'select',
  757. 'name' => 'homepageDownloadRefresh',
  758. 'label' => 'Refresh Seconds',
  759. 'value' => $GLOBALS['homepageDownloadRefresh'],
  760. 'options' => $time
  761. )
  762. )
  763. )
  764. ),
  765. array(
  766. 'name' => 'qBittorrent',
  767. 'enabled' => false,
  768. 'image' => 'plugins/images/tabs/qBittorrent.png',
  769. 'category' => 'Downloader',
  770. 'settings' => array(
  771. 'Enable' => array(
  772. array(
  773. 'type' => 'switch',
  774. 'name' => 'homepageqBittorrentEnabled',
  775. 'label' => 'Enable',
  776. 'value' => $GLOBALS['homepageqBittorrentEnabled']
  777. ),
  778. array(
  779. 'type' => 'select',
  780. 'name' => 'homepageqBittorrentAuth',
  781. 'label' => 'Minimum Authentication',
  782. 'value' => $GLOBALS['homepageqBittorrentAuth'],
  783. 'options' => $groups
  784. )
  785. ),
  786. 'Connection' => array(
  787. array(
  788. 'type' => 'input',
  789. 'name' => 'qBittorrentURL',
  790. 'label' => 'URL',
  791. 'value' => $GLOBALS['qBittorrentURL'],
  792. 'placeholder' => 'http(s)://hostname:port'
  793. ),
  794. array(
  795. 'type' => 'input',
  796. 'name' => 'qBittorrentUsername',
  797. 'label' => 'Username',
  798. 'value' => $GLOBALS['qBittorrentUsername']
  799. ),
  800. array(
  801. 'type' => 'password',
  802. 'name' => 'qBittorrentPassword',
  803. 'label' => 'Password',
  804. 'value' => $GLOBALS['qBittorrentPassword']
  805. )
  806. ),
  807. 'Misc Options' => array(
  808. array(
  809. 'type' => 'switch',
  810. 'name' => 'qBittorrentHideSeeding',
  811. 'label' => 'Hide Seeding',
  812. 'value' => $GLOBALS['qBittorrentHideSeeding']
  813. ),array(
  814. 'type' => 'switch',
  815. 'name' => 'qBittorrentnHideCompleted',
  816. 'label' => 'Hide Completed',
  817. 'value' => $GLOBALS['qBittorrentHideCompleted']
  818. ),
  819. array(
  820. 'type' => 'select',
  821. 'name' => 'qBittorrentSortOrder',
  822. 'label' => 'Order',
  823. 'value' => $GLOBALS['qBittorrentSortOrder'],
  824. 'options' => $qBittorrentSortOptions
  825. ),array(
  826. 'type' => 'switch',
  827. 'name' => 'qBittorrentReverseSorting',
  828. 'label' => 'Reverse Sorting',
  829. 'value' => $GLOBALS['qBittorrentReverseSorting']
  830. ),
  831. array(
  832. 'type' => 'select',
  833. 'name' => 'homepageDownloadRefresh',
  834. 'label' => 'Refresh Seconds',
  835. 'value' => $GLOBALS['homepageDownloadRefresh'],
  836. 'options' => $time
  837. )
  838. )
  839. )
  840. ),
  841. array(
  842. 'name' => 'Deluge',
  843. 'enabled' => false,
  844. 'image' => 'plugins/images/tabs/deluge.png',
  845. 'category' => 'Downloader',
  846. 'settings' => array(
  847. 'custom' => '
  848. <div class="row">
  849. <div class="col-lg-12">
  850. <div class="panel panel-info">
  851. <div class="panel-heading">
  852. <span lang="en">Notice</span>
  853. </div>
  854. <div class="panel-wrapper collapse in" aria-expanded="true">
  855. <div class="panel-body">
  856. <ul class="list-icons">
  857. <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>
  858. <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>
  859. <li><i class="fa fa-chevron-right text-danger"></i> Activate WebAPI plugin </li>
  860. </ul>
  861. </div>
  862. </div>
  863. </div>
  864. </div>
  865. </div>
  866. ',
  867. 'Enable' => array(
  868. array(
  869. 'type' => 'switch',
  870. 'name' => 'homepageDelugeEnabled',
  871. 'label' => 'Enable',
  872. 'value' => $GLOBALS['homepageDelugeEnabled']
  873. ),
  874. array(
  875. 'type' => 'select',
  876. 'name' => 'homepageDelugeAuth',
  877. 'label' => 'Minimum Authentication',
  878. 'value' => $GLOBALS['homepageDelugeAuth'],
  879. 'options' => $groups
  880. )
  881. ),
  882. 'Connection' => array(
  883. array(
  884. 'type' => 'input',
  885. 'name' => 'delugeURL',
  886. 'label' => 'URL',
  887. 'value' => $GLOBALS['delugeURL'],
  888. 'placeholder' => 'http(s)://hostname:port'
  889. ),
  890. array(
  891. 'type' => 'password',
  892. 'name' => 'delugePassword',
  893. 'label' => 'Password',
  894. 'value' => $GLOBALS['delugePassword']
  895. )
  896. ),
  897. 'Misc Options' => array(
  898. array(
  899. 'type' => 'switch',
  900. 'name' => 'delugeHideSeeding',
  901. 'label' => 'Hide Seeding',
  902. 'value' => $GLOBALS['delugeHideSeeding']
  903. ),array(
  904. 'type' => 'switch',
  905. 'name' => 'delugeHideCompleted',
  906. 'label' => 'Hide Completed',
  907. 'value' => $GLOBALS['delugeHideCompleted']
  908. ),
  909. array(
  910. 'type' => 'select',
  911. 'name' => 'homepageDownloadRefresh',
  912. 'label' => 'Refresh Seconds',
  913. 'value' => $GLOBALS['homepageDownloadRefresh'],
  914. 'options' => $time
  915. )
  916. )
  917. )
  918. ),
  919. array(
  920. 'name' => 'Sonarr',
  921. 'enabled' => false,
  922. 'image' => 'plugins/images/tabs/sonarr.png',
  923. 'category' => 'PVR',
  924. 'settings' => array(
  925. 'Enable' => array(
  926. array(
  927. 'type' => 'switch',
  928. 'name' => 'homepageSonarrEnabled',
  929. 'label' => 'Enable',
  930. 'value' => $GLOBALS['homepageSonarrEnabled']
  931. ),
  932. array(
  933. 'type' => 'select',
  934. 'name' => 'homepageSonarrAuth',
  935. 'label' => 'Minimum Authentication',
  936. 'value' => $GLOBALS['homepageSonarrAuth'],
  937. 'options' => $groups
  938. )
  939. ),
  940. 'Connection' => array(
  941. array(
  942. 'type' => 'input',
  943. 'name' => 'sonarrURL',
  944. 'label' => 'URL',
  945. 'value' => $GLOBALS['sonarrURL'],
  946. 'placeholder' => 'http(s)://hostname:port'
  947. ),
  948. array(
  949. 'type' => 'input',
  950. 'name' => 'sonarrToken',
  951. 'label' => 'Token',
  952. 'value' => $GLOBALS['sonarrToken']
  953. )
  954. ),
  955. 'Misc Options' => array(
  956. array(
  957. 'type' => 'input',
  958. 'name' => 'calendarStart',
  959. 'label' => '# of Days Before',
  960. 'value' => $GLOBALS['calendarStart'],
  961. 'placeholder' => ''
  962. ),
  963. array(
  964. 'type' => 'input',
  965. 'name' => 'calendarEnd',
  966. 'label' => '# of Days After',
  967. 'value' => $GLOBALS['calendarEnd'],
  968. 'placeholder' => ''
  969. ),
  970. array(
  971. 'type' => 'select',
  972. 'name' => 'calendarFirstDay',
  973. 'label' => 'Start Day',
  974. 'value' => $GLOBALS['calendarFirstDay'],
  975. 'options' => $day
  976. ),
  977. array(
  978. 'type' => 'select',
  979. 'name' => 'calendarDefault',
  980. 'label' => 'Default View',
  981. 'value' => $GLOBALS['calendarDefault'],
  982. 'options' => $calendarDefault
  983. ),
  984. array(
  985. 'type' => 'select',
  986. 'name' => 'calendarTimeFormat',
  987. 'label' => 'Time Format',
  988. 'value' => $GLOBALS['calendarTimeFormat'],
  989. 'options' => $timeFormat
  990. ),
  991. array(
  992. 'type' => 'select',
  993. 'name' => 'calendarLimit',
  994. 'label' => 'Items Per Day',
  995. 'value' => $GLOBALS['calendarLimit'],
  996. 'options' => $limit
  997. ),
  998. array(
  999. 'type' => 'select',
  1000. 'name' => 'calendarRefresh',
  1001. 'label' => 'Refresh Seconds',
  1002. 'value' => $GLOBALS['calendarRefresh'],
  1003. 'options' => $time
  1004. )
  1005. )
  1006. )
  1007. ),
  1008. array(
  1009. 'name' => 'Radarr',
  1010. 'enabled' => false,
  1011. 'image' => 'plugins/images/tabs/radarr.png',
  1012. 'category' => 'PVR',
  1013. 'settings' => array(
  1014. 'Enable' => array(
  1015. array(
  1016. 'type' => 'switch',
  1017. 'name' => 'homepageRadarrEnabled',
  1018. 'label' => 'Enable',
  1019. 'value' => $GLOBALS['homepageRadarrEnabled']
  1020. ),
  1021. array(
  1022. 'type' => 'select',
  1023. 'name' => 'homepageRadarrAuth',
  1024. 'label' => 'Minimum Authentication',
  1025. 'value' => $GLOBALS['homepageRadarrAuth'],
  1026. 'options' => $groups
  1027. )
  1028. ),
  1029. 'Connection' => array(
  1030. array(
  1031. 'type' => 'input',
  1032. 'name' => 'radarrURL',
  1033. 'label' => 'URL',
  1034. 'value' => $GLOBALS['radarrURL'],
  1035. 'placeholder' => 'http(s)://hostname:port'
  1036. ),
  1037. array(
  1038. 'type' => 'input',
  1039. 'name' => 'radarrToken',
  1040. 'label' => 'Token',
  1041. 'value' => $GLOBALS['radarrToken']
  1042. )
  1043. ),
  1044. 'Misc Options' => array(
  1045. array(
  1046. 'type' => 'input',
  1047. 'name' => 'calendarStart',
  1048. 'label' => '# of Days Before',
  1049. 'value' => $GLOBALS['calendarStart'],
  1050. 'placeholder' => ''
  1051. ),
  1052. array(
  1053. 'type' => 'input',
  1054. 'name' => 'calendarEnd',
  1055. 'label' => '# of Days After',
  1056. 'value' => $GLOBALS['calendarEnd'],
  1057. 'placeholder' => ''
  1058. ),
  1059. array(
  1060. 'type' => 'select',
  1061. 'name' => 'calendarFirstDay',
  1062. 'label' => 'Start Day',
  1063. 'value' => $GLOBALS['calendarFirstDay'],
  1064. 'options' => $day
  1065. ),
  1066. array(
  1067. 'type' => 'select',
  1068. 'name' => 'calendarDefault',
  1069. 'label' => 'Default View',
  1070. 'value' => $GLOBALS['calendarDefault'],
  1071. 'options' => $calendarDefault
  1072. ),
  1073. array(
  1074. 'type' => 'select',
  1075. 'name' => 'calendarTimeFormat',
  1076. 'label' => 'Time Format',
  1077. 'value' => $GLOBALS['calendarTimeFormat'],
  1078. 'options' => $timeFormat
  1079. ),
  1080. array(
  1081. 'type' => 'select',
  1082. 'name' => 'calendarLimit',
  1083. 'label' => 'Items Per Day',
  1084. 'value' => $GLOBALS['calendarLimit'],
  1085. 'options' => $limit
  1086. ),
  1087. array(
  1088. 'type' => 'select',
  1089. 'name' => 'calendarRefresh',
  1090. 'label' => 'Refresh Seconds',
  1091. 'value' => $GLOBALS['calendarRefresh'],
  1092. 'options' => $time
  1093. )
  1094. )
  1095. )
  1096. ),
  1097. array(
  1098. 'name' => 'CouchPotato',
  1099. 'enabled' => false,
  1100. 'image' => 'plugins/images/tabs/couchpotato.png',
  1101. 'category' => 'PVR',
  1102. 'settings' => array(
  1103. 'Enable' => array(
  1104. array(
  1105. 'type' => 'switch',
  1106. 'name' => 'homepageCouchpotatoEnabled',
  1107. 'label' => 'Enable',
  1108. 'value' => $GLOBALS['homepageCouchpotatoEnabled']
  1109. ),
  1110. array(
  1111. 'type' => 'select',
  1112. 'name' => 'homepageCouchpotatoAuth',
  1113. 'label' => 'Minimum Authentication',
  1114. 'value' => $GLOBALS['homepageCouchpotatoAuth'],
  1115. 'options' => $groups
  1116. )
  1117. ),
  1118. 'Connection' => array(
  1119. array(
  1120. 'type' => 'input',
  1121. 'name' => 'couchpotatoURL',
  1122. 'label' => 'URL',
  1123. 'value' => $GLOBALS['couchpotatoURL'],
  1124. 'placeholder' => 'http(s)://hostname:port'
  1125. ),
  1126. array(
  1127. 'type' => 'input',
  1128. 'name' => 'couchpotatoToken',
  1129. 'label' => 'Token',
  1130. 'value' => $GLOBALS['couchpotatoToken']
  1131. )
  1132. ),
  1133. 'Misc Options' => array(
  1134. array(
  1135. 'type' => 'select',
  1136. 'name' => 'calendarFirstDay',
  1137. 'label' => 'Start Day',
  1138. 'value' => $GLOBALS['calendarFirstDay'],
  1139. 'options' => $day
  1140. ),
  1141. array(
  1142. 'type' => 'select',
  1143. 'name' => 'calendarDefault',
  1144. 'label' => 'Default View',
  1145. 'value' => $GLOBALS['calendarDefault'],
  1146. 'options' => $calendarDefault
  1147. ),
  1148. array(
  1149. 'type' => 'select',
  1150. 'name' => 'calendarTimeFormat',
  1151. 'label' => 'Time Format',
  1152. 'value' => $GLOBALS['calendarTimeFormat'],
  1153. 'options' => $timeFormat
  1154. ),
  1155. array(
  1156. 'type' => 'select',
  1157. 'name' => 'calendarLimit',
  1158. 'label' => 'Items Per Day',
  1159. 'value' => $GLOBALS['calendarLimit'],
  1160. 'options' => $limit
  1161. ),
  1162. array(
  1163. 'type' => 'select',
  1164. 'name' => 'calendarRefresh',
  1165. 'label' => 'Refresh Seconds',
  1166. 'value' => $GLOBALS['calendarRefresh'],
  1167. 'options' => $time
  1168. )
  1169. )
  1170. )
  1171. ),
  1172. array(
  1173. 'name' => 'SickRage',
  1174. 'enabled' => false,
  1175. 'image' => 'plugins/images/tabs/sickrage.png',
  1176. 'category' => 'PVR',
  1177. 'settings' => array(
  1178. 'Enable' => array(
  1179. array(
  1180. 'type' => 'switch',
  1181. 'name' => 'homepageSickrageEnabled',
  1182. 'label' => 'Enable',
  1183. 'value' => $GLOBALS['homepageSickrageEnabled']
  1184. ),
  1185. array(
  1186. 'type' => 'select',
  1187. 'name' => 'homepageSickrageAuth',
  1188. 'label' => 'Minimum Authentication',
  1189. 'value' => $GLOBALS['homepageSickrageAuth'],
  1190. 'options' => $groups
  1191. )
  1192. ),
  1193. 'Connection' => array(
  1194. array(
  1195. 'type' => 'input',
  1196. 'name' => 'sickrageURL',
  1197. 'label' => 'URL',
  1198. 'value' => $GLOBALS['sickrageURL'],
  1199. 'placeholder' => 'http(s)://hostname:port'
  1200. ),
  1201. array(
  1202. 'type' => 'input',
  1203. 'name' => 'sickrageToken',
  1204. 'label' => 'Token',
  1205. 'value' => $GLOBALS['sickrageToken']
  1206. )
  1207. ),
  1208. 'Misc Options' => array(
  1209. array(
  1210. 'type' => 'select',
  1211. 'name' => 'calendarFirstDay',
  1212. 'label' => 'Start Day',
  1213. 'value' => $GLOBALS['calendarFirstDay'],
  1214. 'options' => $day
  1215. ),
  1216. array(
  1217. 'type' => 'select',
  1218. 'name' => 'calendarDefault',
  1219. 'label' => 'Default View',
  1220. 'value' => $GLOBALS['calendarDefault'],
  1221. 'options' => $calendarDefault
  1222. ),
  1223. array(
  1224. 'type' => 'select',
  1225. 'name' => 'calendarTimeFormat',
  1226. 'label' => 'Time Format',
  1227. 'value' => $GLOBALS['calendarTimeFormat'],
  1228. 'options' => $timeFormat
  1229. ),
  1230. array(
  1231. 'type' => 'select',
  1232. 'name' => 'calendarLimit',
  1233. 'label' => 'Items Per Day',
  1234. 'value' => $GLOBALS['calendarLimit'],
  1235. 'options' => $limit
  1236. ),
  1237. array(
  1238. 'type' => 'select',
  1239. 'name' => 'calendarRefresh',
  1240. 'label' => 'Refresh Seconds',
  1241. 'value' => $GLOBALS['calendarRefresh'],
  1242. 'options' => $time
  1243. )
  1244. )
  1245. )
  1246. )
  1247. );
  1248. }