homepage-functions.php 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984
  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. $day = array(
  222. array(
  223. 'name' => 'Sunday',
  224. 'value' => '0'
  225. ),
  226. array(
  227. 'name' => 'Monday',
  228. 'value' => '1'
  229. ),
  230. array(
  231. 'name' => 'Tueday',
  232. 'value' => '2'
  233. ),
  234. array(
  235. 'name' => 'Wednesday',
  236. 'value' => '3'
  237. ),
  238. array(
  239. 'name' => 'Thursday',
  240. 'value' => '4'
  241. ),
  242. array(
  243. 'name' => 'Friday',
  244. 'value' => '5'
  245. ),
  246. array(
  247. 'name' => 'Saturday',
  248. 'value' => '6'
  249. )
  250. );
  251. $calendarDefault = array(
  252. array(
  253. 'name' => 'Month',
  254. 'value' => 'month'
  255. ),
  256. array(
  257. 'name' => 'Day',
  258. 'value' => 'basicDay'
  259. ),
  260. array(
  261. 'name' => 'Week',
  262. 'value' => 'basicWeek'
  263. )
  264. );
  265. $timeFormat = array(
  266. array(
  267. 'name' => '6p',
  268. 'value' => 'h(:mm)t'
  269. ),
  270. array(
  271. 'name' => '6:00p',
  272. 'value' => 'h:mmt'
  273. ),
  274. array(
  275. 'name' => '6:00',
  276. 'value' => 'h:mm'
  277. ),
  278. array(
  279. 'name' => '18',
  280. 'value' => 'H(:mm)'
  281. ),
  282. array(
  283. 'name' => '18:00',
  284. 'value' => 'H:mm'
  285. )
  286. );
  287. return array(
  288. array(
  289. 'name' => 'Plex',
  290. 'enabled' => true,
  291. 'image' => 'plugins/images/tabs/plex.png',
  292. 'category' => 'Media Server',
  293. 'settings' => array(
  294. 'Enable' => array(
  295. array(
  296. 'type' => 'switch',
  297. 'name' => 'homepagePlexEnabled',
  298. 'label' => 'Enable',
  299. 'value' => $GLOBALS['homepagePlexEnabled']
  300. ),
  301. array(
  302. 'type' => 'select',
  303. 'name' => 'homepagePlexAuth',
  304. 'label' => 'Minimum Authentication',
  305. 'value' => $GLOBALS['homepagePlexAuth'],
  306. 'options' => $groups
  307. )
  308. ),
  309. 'Connection' => array(
  310. array(
  311. 'type' => 'input',
  312. 'name' => 'plexURL',
  313. 'label' => 'URL',
  314. 'value' => $GLOBALS['plexURL'],
  315. 'placeholder' => 'http(s)://hostname:port'
  316. ),
  317. array(
  318. 'type' => 'input',
  319. 'name' => 'plexToken',
  320. 'label' => 'Token',
  321. 'value' => $GLOBALS['plexToken']
  322. ),
  323. array(
  324. 'type' => 'input',
  325. 'name' => 'plexID',
  326. 'label' => 'Plex Machine',
  327. 'value' => $GLOBALS['plexID']
  328. )
  329. ),
  330. 'Active Streams' => array(
  331. array(
  332. 'type' => 'switch',
  333. 'name' => 'homepagePlexStreams',
  334. 'label' => 'Enable',
  335. 'value' => $GLOBALS['homepagePlexStreams']
  336. ),
  337. array(
  338. 'type' => 'select',
  339. 'name' => 'homepagePlexStreamsAuth',
  340. 'label' => 'Minimum Authorization',
  341. 'value' => $GLOBALS['homepagePlexStreamsAuth'],
  342. 'options' => $groups
  343. ),
  344. array(
  345. 'type' => 'switch',
  346. 'name' => 'homepageShowStreamNames',
  347. 'label' => 'User Information',
  348. 'value' => $GLOBALS['homepageShowStreamNames']
  349. ),
  350. array(
  351. 'type' => 'select',
  352. 'name' => 'homepageShowStreamNamesAuth',
  353. 'label' => 'Minimum Authorization',
  354. 'value' => $GLOBALS['homepageShowStreamNamesAuth'],
  355. 'options' => $groups
  356. ),
  357. array(
  358. 'type' => 'select',
  359. 'name' => 'homepageStreamRefresh',
  360. 'label' => 'Refresh Seconds',
  361. 'value' => $GLOBALS['homepageStreamRefresh'],
  362. 'options' => $time
  363. ),
  364. ),
  365. 'Recent Items' => array(
  366. array(
  367. 'type' => 'switch',
  368. 'name' => 'homepagePlexRecent',
  369. 'label' => 'Enable',
  370. 'value' => $GLOBALS['homepagePlexRecent']
  371. ),
  372. array(
  373. 'type' => 'select',
  374. 'name' => 'homepagePlexRecentAuth',
  375. 'label' => 'Minimum Authorization',
  376. 'value' => $GLOBALS['homepagePlexRecentAuth'],
  377. 'options' => $groups
  378. ),
  379. array(
  380. 'type' => 'select',
  381. 'name' => 'homepageRecentRefresh',
  382. 'label' => 'Refresh Seconds',
  383. 'value' => $GLOBALS['homepageRecentRefresh'],
  384. 'options' => $time
  385. ),
  386. ),
  387. 'Misc Options' => array(
  388. array(
  389. 'type' => 'input',
  390. 'name' => 'plexTabName',
  391. 'label' => 'Plex Tab Name',
  392. 'value' => $GLOBALS['plexTabName'],
  393. 'placeholder' => 'Only use if you have Plex in a reverse proxy'
  394. ),
  395. array(
  396. 'type' => 'input',
  397. 'name' => 'plexTabURL',
  398. 'label' => 'Plex Tab WAN URL',
  399. 'value' => $GLOBALS['plexTabURL'],
  400. 'placeholder' => 'http(s)://hostname:port'
  401. )
  402. )
  403. )
  404. ),
  405. array(
  406. 'name' => 'Emby',
  407. 'enabled' => true,
  408. 'image' => 'plugins/images/tabs/emby.png',
  409. 'category' => 'Media Server',
  410. 'settings' => array(
  411. 'Enable' => array(
  412. array(
  413. 'type' => 'switch',
  414. 'name' => 'homepageEmbyEnabled',
  415. 'label' => 'Enable',
  416. 'value' => $GLOBALS['homepageEmbyEnabled']
  417. ),
  418. array(
  419. 'type' => 'select',
  420. 'name' => 'homepageEmbyAuth',
  421. 'label' => 'Minimum Authentication',
  422. 'value' => $GLOBALS['homepageEmbyAuth'],
  423. 'options' => $groups
  424. )
  425. ),
  426. 'Connection' => array(
  427. array(
  428. 'type' => 'input',
  429. 'name' => 'embyURL',
  430. 'label' => 'URL',
  431. 'value' => $GLOBALS['embyURL'],
  432. 'placeholder' => 'http(s)://hostname:port'
  433. ),
  434. array(
  435. 'type' => 'input',
  436. 'name' => 'embyToken',
  437. 'label' => 'Token',
  438. 'value' => $GLOBALS['embyToken']
  439. )
  440. ),
  441. 'Active Streams' => array(
  442. array(
  443. 'type' => 'switch',
  444. 'name' => 'homepageEmbyStreams',
  445. 'label' => 'Enable',
  446. 'value' => $GLOBALS['homepageEmbyStreams']
  447. ),
  448. array(
  449. 'type' => 'select',
  450. 'name' => 'homepageEmbyStreamsAuth',
  451. 'label' => 'Minimum Authorization',
  452. 'value' => $GLOBALS['homepageEmbyStreamsAuth'],
  453. 'options' => $groups
  454. ),
  455. array(
  456. 'type' => 'switch',
  457. 'name' => 'homepageShowStreamNames',
  458. 'label' => 'User Information',
  459. 'value' => $GLOBALS['homepageShowStreamNames']
  460. ),
  461. array(
  462. 'type' => 'select',
  463. 'name' => 'homepageShowStreamNamesAuth',
  464. 'label' => 'Minimum Authorization',
  465. 'value' => $GLOBALS['homepageShowStreamNamesAuth'],
  466. 'options' => $groups
  467. ),
  468. array(
  469. 'type' => 'select',
  470. 'name' => 'homepageStreamRefresh',
  471. 'label' => 'Refresh Seconds',
  472. 'value' => $GLOBALS['homepageStreamRefresh'],
  473. 'options' => $time
  474. ),
  475. ),
  476. 'Recent Items' => array(
  477. array(
  478. 'type' => 'switch',
  479. 'name' => 'homepageEmbyRecent',
  480. 'label' => 'Enable',
  481. 'value' => $GLOBALS['homepageEmbyRecent']
  482. ),
  483. array(
  484. 'type' => 'select',
  485. 'name' => 'homepageEmbyRecentAuth',
  486. 'label' => 'Minimum Authorization',
  487. 'value' => $GLOBALS['homepageEmbyRecentAuth'],
  488. 'options' => $groups
  489. ),
  490. array(
  491. 'type' => 'select',
  492. 'name' => 'homepageRecentRefresh',
  493. 'label' => 'Refresh Seconds',
  494. 'value' => $GLOBALS['homepageRecentRefresh'],
  495. 'options' => $time
  496. ),
  497. ),
  498. 'Misc Options' => array(
  499. array(
  500. 'type' => 'input',
  501. 'name' => 'embyTabName',
  502. 'label' => 'Emby Tab Name',
  503. 'value' => $GLOBALS['embyTabName'],
  504. 'placeholder' => 'Only use if you have Plex in a reverse proxy'
  505. ),
  506. array(
  507. 'type' => 'input',
  508. 'name' => 'embyTabURL',
  509. 'label' => 'Emby Tab WAN URL',
  510. 'value' => $GLOBALS['embyTabURL'],
  511. 'placeholder' => 'http(s)://hostname:port'
  512. )
  513. )
  514. )
  515. ),
  516. array(
  517. 'name' => 'SabNZBD',
  518. 'enabled' => false,
  519. 'image' => 'plugins/images/tabs/sabnzbd.png',
  520. 'category' => 'Downloader',
  521. 'settings' => array(
  522. 'Enable' => array(
  523. array(
  524. 'type' => 'switch',
  525. 'name' => 'homepageSabnzbdEnabled',
  526. 'label' => 'Enable',
  527. 'value' => $GLOBALS['homepageSabnzbdEnabled']
  528. ),
  529. array(
  530. 'type' => 'select',
  531. 'name' => 'homepageSabnzbdAuth',
  532. 'label' => 'Minimum Authentication',
  533. 'value' => $GLOBALS['homepageSabnzbdAuth'],
  534. 'options' => $groups
  535. )
  536. ),
  537. 'Connection' => array(
  538. array(
  539. 'type' => 'input',
  540. 'name' => 'sabnzbdURL',
  541. 'label' => 'URL',
  542. 'value' => $GLOBALS['sabnzbdURL'],
  543. 'placeholder' => 'http(s)://hostname:port'
  544. ),
  545. array(
  546. 'type' => 'input',
  547. 'name' => 'sabnzbdToken',
  548. 'label' => 'Token',
  549. 'value' => $GLOBALS['sabnzbdToken']
  550. )
  551. ),
  552. 'Misc Options' => array(
  553. array(
  554. 'type' => 'select',
  555. 'name' => 'homepageDownloadRefresh',
  556. 'label' => 'Refresh Seconds',
  557. 'value' => $GLOBALS['homepageDownloadRefresh'],
  558. 'options' => $time
  559. )
  560. )
  561. )
  562. ),
  563. array(
  564. 'name' => 'NZBGet',
  565. 'enabled' => false,
  566. 'image' => 'plugins/images/tabs/nzbget.png',
  567. 'category' => 'Downloader',
  568. 'settings' => array(
  569. 'Enable' => array(
  570. array(
  571. 'type' => 'switch',
  572. 'name' => 'homepageNzbgetEnabled',
  573. 'label' => 'Enable',
  574. 'value' => $GLOBALS['homepageNzbgetEnabled']
  575. ),
  576. array(
  577. 'type' => 'select',
  578. 'name' => 'homepageNzbgetAuth',
  579. 'label' => 'Minimum Authentication',
  580. 'value' => $GLOBALS['homepageNzbgetAuth'],
  581. 'options' => $groups
  582. )
  583. ),
  584. 'Connection' => array(
  585. array(
  586. 'type' => 'input',
  587. 'name' => 'nzbgetURL',
  588. 'label' => 'URL',
  589. 'value' => $GLOBALS['nzbgetURL'],
  590. 'placeholder' => 'http(s)://hostname:port'
  591. ),
  592. array(
  593. 'type' => 'input',
  594. 'name' => 'nzbgetUsername',
  595. 'label' => 'Username',
  596. 'value' => $GLOBALS['nzbgetUsername']
  597. ),
  598. array(
  599. 'type' => 'password',
  600. 'name' => 'nzbgetPassword',
  601. 'label' => 'Password',
  602. 'value' => $GLOBALS['nzbgetPassword']
  603. )
  604. ),
  605. 'Misc Options' => array(
  606. array(
  607. 'type' => 'select',
  608. 'name' => 'homepageDownloadRefresh',
  609. 'label' => 'Refresh Seconds',
  610. 'value' => $GLOBALS['homepageDownloadRefresh'],
  611. 'options' => $time
  612. )
  613. )
  614. )
  615. ),
  616. array(
  617. 'name' => 'Transmission',
  618. 'enabled' => false,
  619. 'image' => 'plugins/images/tabs/transmission.png',
  620. 'category' => 'Downloader',
  621. 'settings' => array(
  622. 'Enable' => array(
  623. array(
  624. 'type' => 'switch',
  625. 'name' => 'homepageTransmissionEnabled',
  626. 'label' => 'Enable',
  627. 'value' => $GLOBALS['homepageTransmissionEnabled']
  628. ),
  629. array(
  630. 'type' => 'select',
  631. 'name' => 'homepageTransmissionAuth',
  632. 'label' => 'Minimum Authentication',
  633. 'value' => $GLOBALS['homepageTransmissionAuth'],
  634. 'options' => $groups
  635. )
  636. ),
  637. 'Connection' => array(
  638. array(
  639. 'type' => 'input',
  640. 'name' => 'transmissionURL',
  641. 'label' => 'URL',
  642. 'value' => $GLOBALS['transmissionURL'],
  643. 'placeholder' => 'http(s)://hostname:port'
  644. ),
  645. array(
  646. 'type' => 'input',
  647. 'name' => 'transmissionUsername',
  648. 'label' => 'Username',
  649. 'value' => $GLOBALS['transmissionUsername']
  650. ),
  651. array(
  652. 'type' => 'password',
  653. 'name' => 'transmissionPassword',
  654. 'label' => 'Password',
  655. 'value' => $GLOBALS['transmissionPassword']
  656. )
  657. ),
  658. 'Misc Options' => array(
  659. array(
  660. 'type' => 'switch',
  661. 'name' => 'transmissionHideSeeding',
  662. 'label' => 'Hide Seeding',
  663. 'value' => $GLOBALS['transmissionHideSeeding']
  664. ),array(
  665. 'type' => 'switch',
  666. 'name' => 'transmissionHideCompleted',
  667. 'label' => 'Hide Completed',
  668. 'value' => $GLOBALS['transmissionHideCompleted']
  669. ),
  670. array(
  671. 'type' => 'select',
  672. 'name' => 'homepageDownloadRefresh',
  673. 'label' => 'Refresh Seconds',
  674. 'value' => $GLOBALS['homepageDownloadRefresh'],
  675. 'options' => $time
  676. )
  677. )
  678. )
  679. ),
  680. array(
  681. 'name' => 'qBittorrent',
  682. 'enabled' => false,
  683. 'image' => 'plugins/images/tabs/qBittorrent.png',
  684. 'category' => 'Downloader',
  685. 'settings' => array(
  686. 'Enable' => array(
  687. array(
  688. 'type' => 'switch',
  689. 'name' => 'homepageqBittorrentEnabled',
  690. 'label' => 'Enable',
  691. 'value' => $GLOBALS['homepageqBittorrentEnabled']
  692. ),
  693. array(
  694. 'type' => 'select',
  695. 'name' => 'homepageqBittorrentAuth',
  696. 'label' => 'Minimum Authentication',
  697. 'value' => $GLOBALS['homepageqBittorrentAuth'],
  698. 'options' => $groups
  699. )
  700. ),
  701. 'Connection' => array(
  702. array(
  703. 'type' => 'input',
  704. 'name' => 'qBittorrentURL',
  705. 'label' => 'URL',
  706. 'value' => $GLOBALS['qBittorrentURL'],
  707. 'placeholder' => 'http(s)://hostname:port'
  708. ),
  709. array(
  710. 'type' => 'input',
  711. 'name' => 'qBittorrentUsername',
  712. 'label' => 'Username',
  713. 'value' => $GLOBALS['qBittorrentUsername']
  714. ),
  715. array(
  716. 'type' => 'password',
  717. 'name' => 'qBittorrentPassword',
  718. 'label' => 'Password',
  719. 'value' => $GLOBALS['qBittorrentPassword']
  720. )
  721. ),
  722. 'Misc Options' => array(
  723. array(
  724. 'type' => 'switch',
  725. 'name' => 'qBittorrentHideSeeding',
  726. 'label' => 'Hide Seeding',
  727. 'value' => $GLOBALS['qBittorrentHideSeeding']
  728. ),array(
  729. 'type' => 'switch',
  730. 'name' => 'qBittorrentnHideCompleted',
  731. 'label' => 'Hide Completed',
  732. 'value' => $GLOBALS['qBittorrentHideCompleted']
  733. ),
  734. array(
  735. 'type' => 'select',
  736. 'name' => 'homepageDownloadRefresh',
  737. 'label' => 'Refresh Seconds',
  738. 'value' => $GLOBALS['homepageDownloadRefresh'],
  739. 'options' => $time
  740. )
  741. )
  742. )
  743. ),
  744. array(
  745. 'name' => 'Sonarr',
  746. 'enabled' => false,
  747. 'image' => 'plugins/images/tabs/sonarr.png',
  748. 'category' => 'PVR',
  749. 'settings' => array(
  750. 'Enable' => array(
  751. array(
  752. 'type' => 'switch',
  753. 'name' => 'homepageSonarrEnabled',
  754. 'label' => 'Enable',
  755. 'value' => $GLOBALS['homepageSonarrEnabled']
  756. ),
  757. array(
  758. 'type' => 'select',
  759. 'name' => 'homepageSonarrAuth',
  760. 'label' => 'Minimum Authentication',
  761. 'value' => $GLOBALS['homepageSonarrAuth'],
  762. 'options' => $groups
  763. )
  764. ),
  765. 'Connection' => array(
  766. array(
  767. 'type' => 'input',
  768. 'name' => 'sonarrURL',
  769. 'label' => 'URL',
  770. 'value' => $GLOBALS['sonarrURL'],
  771. 'placeholder' => 'http(s)://hostname:port'
  772. ),
  773. array(
  774. 'type' => 'input',
  775. 'name' => 'sonarrToken',
  776. 'label' => 'Token',
  777. 'value' => $GLOBALS['sonarrToken']
  778. )
  779. ),
  780. 'Misc Options' => array(
  781. array(
  782. 'type' => 'input',
  783. 'name' => 'calendarStart',
  784. 'label' => '# of Days Before',
  785. 'value' => $GLOBALS['calendarStart'],
  786. 'placeholder' => ''
  787. ),
  788. array(
  789. 'type' => 'input',
  790. 'name' => 'calendarEnd',
  791. 'label' => '# of Days After',
  792. 'value' => $GLOBALS['calendarEnd'],
  793. 'placeholder' => ''
  794. ),
  795. array(
  796. 'type' => 'select',
  797. 'name' => 'calendarFirstDay',
  798. 'label' => 'Start Day',
  799. 'value' => $GLOBALS['calendarFirstDay'],
  800. 'options' => $day
  801. ),
  802. array(
  803. 'type' => 'select',
  804. 'name' => 'calendarDefault',
  805. 'label' => 'Default View',
  806. 'value' => $GLOBALS['calendarDefault'],
  807. 'options' => $calendarDefault
  808. ),
  809. array(
  810. 'type' => 'select',
  811. 'name' => 'calendarTimeFormat',
  812. 'label' => 'Time Format',
  813. 'value' => $GLOBALS['calendarTimeFormat'],
  814. 'options' => $timeFormat
  815. ),
  816. array(
  817. 'type' => 'select',
  818. 'name' => 'calendarRefresh',
  819. 'label' => 'Refresh Seconds',
  820. 'value' => $GLOBALS['calendarRefresh'],
  821. 'options' => $time
  822. )
  823. )
  824. )
  825. ),
  826. array(
  827. 'name' => 'Radarr',
  828. 'enabled' => false,
  829. 'image' => 'plugins/images/tabs/radarr.png',
  830. 'category' => 'PVR',
  831. 'settings' => array(
  832. 'Enable' => array(
  833. array(
  834. 'type' => 'switch',
  835. 'name' => 'homepageRadarrEnabled',
  836. 'label' => 'Enable',
  837. 'value' => $GLOBALS['homepageRadarrEnabled']
  838. ),
  839. array(
  840. 'type' => 'select',
  841. 'name' => 'homepageRadarrAuth',
  842. 'label' => 'Minimum Authentication',
  843. 'value' => $GLOBALS['homepageRadarrAuth'],
  844. 'options' => $groups
  845. )
  846. ),
  847. 'Connection' => array(
  848. array(
  849. 'type' => 'input',
  850. 'name' => 'radarrURL',
  851. 'label' => 'URL',
  852. 'value' => $GLOBALS['radarrURL'],
  853. 'placeholder' => 'http(s)://hostname:port'
  854. ),
  855. array(
  856. 'type' => 'input',
  857. 'name' => 'radarrToken',
  858. 'label' => 'Token',
  859. 'value' => $GLOBALS['radarrToken']
  860. )
  861. ),
  862. 'Misc Options' => array(
  863. array(
  864. 'type' => 'input',
  865. 'name' => 'calendarStart',
  866. 'label' => '# of Days Before',
  867. 'value' => $GLOBALS['calendarStart'],
  868. 'placeholder' => ''
  869. ),
  870. array(
  871. 'type' => 'input',
  872. 'name' => 'calendarEnd',
  873. 'label' => '# of Days After',
  874. 'value' => $GLOBALS['calendarEnd'],
  875. 'placeholder' => ''
  876. ),
  877. array(
  878. 'type' => 'select',
  879. 'name' => 'calendarFirstDay',
  880. 'label' => 'Start Day',
  881. 'value' => $GLOBALS['calendarFirstDay'],
  882. 'options' => $day
  883. ),
  884. array(
  885. 'type' => 'select',
  886. 'name' => 'calendarDefault',
  887. 'label' => 'Default View',
  888. 'value' => $GLOBALS['calendarDefault'],
  889. 'options' => $calendarDefault
  890. ),
  891. array(
  892. 'type' => 'select',
  893. 'name' => 'calendarTimeFormat',
  894. 'label' => 'Time Format',
  895. 'value' => $GLOBALS['calendarTimeFormat'],
  896. 'options' => $timeFormat
  897. ),
  898. array(
  899. 'type' => 'select',
  900. 'name' => 'calendarRefresh',
  901. 'label' => 'Refresh Seconds',
  902. 'value' => $GLOBALS['calendarRefresh'],
  903. 'options' => $time
  904. )
  905. )
  906. )
  907. ),
  908. array(
  909. 'name' => 'SickRage',
  910. 'enabled' => false,
  911. 'image' => 'plugins/images/tabs/sickrage.png',
  912. 'category' => 'PVR',
  913. 'settings' => array(
  914. 'Enable' => array(
  915. array(
  916. 'type' => 'switch',
  917. 'name' => 'homepageSickrageEnabled',
  918. 'label' => 'Enable',
  919. 'value' => $GLOBALS['homepageSickrageEnabled']
  920. ),
  921. array(
  922. 'type' => 'select',
  923. 'name' => 'homepageSickrageAuth',
  924. 'label' => 'Minimum Authentication',
  925. 'value' => $GLOBALS['homepageSickrageAuth'],
  926. 'options' => $groups
  927. )
  928. ),
  929. 'Connection' => array(
  930. array(
  931. 'type' => 'input',
  932. 'name' => 'sickrageURL',
  933. 'label' => 'URL',
  934. 'value' => $GLOBALS['sickrageURL'],
  935. 'placeholder' => 'http(s)://hostname:port'
  936. ),
  937. array(
  938. 'type' => 'input',
  939. 'name' => 'sickrageToken',
  940. 'label' => 'Token',
  941. 'value' => $GLOBALS['sickrageToken']
  942. )
  943. ),
  944. 'Misc Options' => array(
  945. array(
  946. 'type' => 'select',
  947. 'name' => 'calendarFirstDay',
  948. 'label' => 'Start Day',
  949. 'value' => $GLOBALS['calendarFirstDay'],
  950. 'options' => $day
  951. ),
  952. array(
  953. 'type' => 'select',
  954. 'name' => 'calendarDefault',
  955. 'label' => 'Default View',
  956. 'value' => $GLOBALS['calendarDefault'],
  957. 'options' => $calendarDefault
  958. ),
  959. array(
  960. 'type' => 'select',
  961. 'name' => 'calendarTimeFormat',
  962. 'label' => 'Time Format',
  963. 'value' => $GLOBALS['calendarTimeFormat'],
  964. 'options' => $timeFormat
  965. ),
  966. array(
  967. 'type' => 'select',
  968. 'name' => 'calendarRefresh',
  969. 'label' => 'Refresh Seconds',
  970. 'value' => $GLOBALS['calendarRefresh'],
  971. 'options' => $time
  972. )
  973. )
  974. )
  975. )
  976. );
  977. }