homepage-functions.php 42 KB

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