homepage-functions.php 38 KB

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