homepage-functions.php 36 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118
  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. return array(
  326. array(
  327. 'name' => 'Plex',
  328. 'enabled' => true,
  329. 'image' => 'plugins/images/tabs/plex.png',
  330. 'category' => 'Media Server',
  331. 'settings' => array(
  332. 'Enable' => array(
  333. array(
  334. 'type' => 'switch',
  335. 'name' => 'homepagePlexEnabled',
  336. 'label' => 'Enable',
  337. 'value' => $GLOBALS['homepagePlexEnabled']
  338. ),
  339. array(
  340. 'type' => 'select',
  341. 'name' => 'homepagePlexAuth',
  342. 'label' => 'Minimum Authentication',
  343. 'value' => $GLOBALS['homepagePlexAuth'],
  344. 'options' => $groups
  345. )
  346. ),
  347. 'Connection' => array(
  348. array(
  349. 'type' => 'input',
  350. 'name' => 'plexURL',
  351. 'label' => 'URL',
  352. 'value' => $GLOBALS['plexURL'],
  353. 'placeholder' => 'http(s)://hostname:port'
  354. ),
  355. array(
  356. 'type' => 'input',
  357. 'name' => 'plexToken',
  358. 'label' => 'Token',
  359. 'value' => $GLOBALS['plexToken']
  360. ),
  361. array(
  362. 'type' => 'input',
  363. 'name' => 'plexID',
  364. 'label' => 'Plex Machine',
  365. 'value' => $GLOBALS['plexID']
  366. )
  367. ),
  368. 'Active Streams' => array(
  369. array(
  370. 'type' => 'switch',
  371. 'name' => 'homepagePlexStreams',
  372. 'label' => 'Enable',
  373. 'value' => $GLOBALS['homepagePlexStreams']
  374. ),
  375. array(
  376. 'type' => 'select',
  377. 'name' => 'homepagePlexStreamsAuth',
  378. 'label' => 'Minimum Authorization',
  379. 'value' => $GLOBALS['homepagePlexStreamsAuth'],
  380. 'options' => $groups
  381. ),
  382. array(
  383. 'type' => 'switch',
  384. 'name' => 'homepageShowStreamNames',
  385. 'label' => 'User Information',
  386. 'value' => $GLOBALS['homepageShowStreamNames']
  387. ),
  388. array(
  389. 'type' => 'select',
  390. 'name' => 'homepageShowStreamNamesAuth',
  391. 'label' => 'Minimum Authorization',
  392. 'value' => $GLOBALS['homepageShowStreamNamesAuth'],
  393. 'options' => $groups
  394. ),
  395. array(
  396. 'type' => 'select',
  397. 'name' => 'homepageStreamRefresh',
  398. 'label' => 'Refresh Seconds',
  399. 'value' => $GLOBALS['homepageStreamRefresh'],
  400. 'options' => $time
  401. ),
  402. ),
  403. 'Recent Items' => array(
  404. array(
  405. 'type' => 'switch',
  406. 'name' => 'homepagePlexRecent',
  407. 'label' => 'Enable',
  408. 'value' => $GLOBALS['homepagePlexRecent']
  409. ),
  410. array(
  411. 'type' => 'select',
  412. 'name' => 'homepagePlexRecentAuth',
  413. 'label' => 'Minimum Authorization',
  414. 'value' => $GLOBALS['homepagePlexRecentAuth'],
  415. 'options' => $groups
  416. ),
  417. array(
  418. 'type' => 'select',
  419. 'name' => 'homepageRecentRefresh',
  420. 'label' => 'Refresh Seconds',
  421. 'value' => $GLOBALS['homepageRecentRefresh'],
  422. 'options' => $time
  423. ),
  424. ),
  425. 'Misc Options' => array(
  426. array(
  427. 'type' => 'input',
  428. 'name' => 'plexTabName',
  429. 'label' => 'Plex Tab Name',
  430. 'value' => $GLOBALS['plexTabName'],
  431. 'placeholder' => 'Only use if you have Plex in a reverse proxy'
  432. ),
  433. array(
  434. 'type' => 'input',
  435. 'name' => 'plexTabURL',
  436. 'label' => 'Plex Tab WAN URL',
  437. 'value' => $GLOBALS['plexTabURL'],
  438. 'placeholder' => 'http(s)://hostname:port'
  439. )
  440. )
  441. )
  442. ),
  443. array(
  444. 'name' => 'Emby',
  445. 'enabled' => true,
  446. 'image' => 'plugins/images/tabs/emby.png',
  447. 'category' => 'Media Server',
  448. 'settings' => array(
  449. 'Enable' => array(
  450. array(
  451. 'type' => 'switch',
  452. 'name' => 'homepageEmbyEnabled',
  453. 'label' => 'Enable',
  454. 'value' => $GLOBALS['homepageEmbyEnabled']
  455. ),
  456. array(
  457. 'type' => 'select',
  458. 'name' => 'homepageEmbyAuth',
  459. 'label' => 'Minimum Authentication',
  460. 'value' => $GLOBALS['homepageEmbyAuth'],
  461. 'options' => $groups
  462. )
  463. ),
  464. 'Connection' => array(
  465. array(
  466. 'type' => 'input',
  467. 'name' => 'embyURL',
  468. 'label' => 'URL',
  469. 'value' => $GLOBALS['embyURL'],
  470. 'placeholder' => 'http(s)://hostname:port'
  471. ),
  472. array(
  473. 'type' => 'input',
  474. 'name' => 'embyToken',
  475. 'label' => 'Token',
  476. 'value' => $GLOBALS['embyToken']
  477. )
  478. ),
  479. 'Active Streams' => array(
  480. array(
  481. 'type' => 'switch',
  482. 'name' => 'homepageEmbyStreams',
  483. 'label' => 'Enable',
  484. 'value' => $GLOBALS['homepageEmbyStreams']
  485. ),
  486. array(
  487. 'type' => 'select',
  488. 'name' => 'homepageEmbyStreamsAuth',
  489. 'label' => 'Minimum Authorization',
  490. 'value' => $GLOBALS['homepageEmbyStreamsAuth'],
  491. 'options' => $groups
  492. ),
  493. array(
  494. 'type' => 'switch',
  495. 'name' => 'homepageShowStreamNames',
  496. 'label' => 'User Information',
  497. 'value' => $GLOBALS['homepageShowStreamNames']
  498. ),
  499. array(
  500. 'type' => 'select',
  501. 'name' => 'homepageShowStreamNamesAuth',
  502. 'label' => 'Minimum Authorization',
  503. 'value' => $GLOBALS['homepageShowStreamNamesAuth'],
  504. 'options' => $groups
  505. ),
  506. array(
  507. 'type' => 'select',
  508. 'name' => 'homepageStreamRefresh',
  509. 'label' => 'Refresh Seconds',
  510. 'value' => $GLOBALS['homepageStreamRefresh'],
  511. 'options' => $time
  512. ),
  513. ),
  514. 'Recent Items' => array(
  515. array(
  516. 'type' => 'switch',
  517. 'name' => 'homepageEmbyRecent',
  518. 'label' => 'Enable',
  519. 'value' => $GLOBALS['homepageEmbyRecent']
  520. ),
  521. array(
  522. 'type' => 'select',
  523. 'name' => 'homepageEmbyRecentAuth',
  524. 'label' => 'Minimum Authorization',
  525. 'value' => $GLOBALS['homepageEmbyRecentAuth'],
  526. 'options' => $groups
  527. ),
  528. array(
  529. 'type' => 'select',
  530. 'name' => 'homepageRecentRefresh',
  531. 'label' => 'Refresh Seconds',
  532. 'value' => $GLOBALS['homepageRecentRefresh'],
  533. 'options' => $time
  534. ),
  535. ),
  536. 'Misc Options' => array(
  537. array(
  538. 'type' => 'input',
  539. 'name' => 'embyTabName',
  540. 'label' => 'Emby Tab Name',
  541. 'value' => $GLOBALS['embyTabName'],
  542. 'placeholder' => 'Only use if you have Plex in a reverse proxy'
  543. ),
  544. array(
  545. 'type' => 'input',
  546. 'name' => 'embyTabURL',
  547. 'label' => 'Emby Tab WAN URL',
  548. 'value' => $GLOBALS['embyTabURL'],
  549. 'placeholder' => 'http(s)://hostname:port'
  550. )
  551. )
  552. )
  553. ),
  554. array(
  555. 'name' => 'SabNZBD',
  556. 'enabled' => false,
  557. 'image' => 'plugins/images/tabs/sabnzbd.png',
  558. 'category' => 'Downloader',
  559. 'settings' => array(
  560. 'Enable' => array(
  561. array(
  562. 'type' => 'switch',
  563. 'name' => 'homepageSabnzbdEnabled',
  564. 'label' => 'Enable',
  565. 'value' => $GLOBALS['homepageSabnzbdEnabled']
  566. ),
  567. array(
  568. 'type' => 'select',
  569. 'name' => 'homepageSabnzbdAuth',
  570. 'label' => 'Minimum Authentication',
  571. 'value' => $GLOBALS['homepageSabnzbdAuth'],
  572. 'options' => $groups
  573. )
  574. ),
  575. 'Connection' => array(
  576. array(
  577. 'type' => 'input',
  578. 'name' => 'sabnzbdURL',
  579. 'label' => 'URL',
  580. 'value' => $GLOBALS['sabnzbdURL'],
  581. 'placeholder' => 'http(s)://hostname:port'
  582. ),
  583. array(
  584. 'type' => 'input',
  585. 'name' => 'sabnzbdToken',
  586. 'label' => 'Token',
  587. 'value' => $GLOBALS['sabnzbdToken']
  588. )
  589. ),
  590. 'Misc Options' => array(
  591. array(
  592. 'type' => 'select',
  593. 'name' => 'homepageDownloadRefresh',
  594. 'label' => 'Refresh Seconds',
  595. 'value' => $GLOBALS['homepageDownloadRefresh'],
  596. 'options' => $time
  597. )
  598. )
  599. )
  600. ),
  601. array(
  602. 'name' => 'NZBGet',
  603. 'enabled' => false,
  604. 'image' => 'plugins/images/tabs/nzbget.png',
  605. 'category' => 'Downloader',
  606. 'settings' => array(
  607. 'Enable' => array(
  608. array(
  609. 'type' => 'switch',
  610. 'name' => 'homepageNzbgetEnabled',
  611. 'label' => 'Enable',
  612. 'value' => $GLOBALS['homepageNzbgetEnabled']
  613. ),
  614. array(
  615. 'type' => 'select',
  616. 'name' => 'homepageNzbgetAuth',
  617. 'label' => 'Minimum Authentication',
  618. 'value' => $GLOBALS['homepageNzbgetAuth'],
  619. 'options' => $groups
  620. )
  621. ),
  622. 'Connection' => array(
  623. array(
  624. 'type' => 'input',
  625. 'name' => 'nzbgetURL',
  626. 'label' => 'URL',
  627. 'value' => $GLOBALS['nzbgetURL'],
  628. 'placeholder' => 'http(s)://hostname:port'
  629. ),
  630. array(
  631. 'type' => 'input',
  632. 'name' => 'nzbgetUsername',
  633. 'label' => 'Username',
  634. 'value' => $GLOBALS['nzbgetUsername']
  635. ),
  636. array(
  637. 'type' => 'password',
  638. 'name' => 'nzbgetPassword',
  639. 'label' => 'Password',
  640. 'value' => $GLOBALS['nzbgetPassword']
  641. )
  642. ),
  643. 'Misc Options' => array(
  644. array(
  645. 'type' => 'select',
  646. 'name' => 'homepageDownloadRefresh',
  647. 'label' => 'Refresh Seconds',
  648. 'value' => $GLOBALS['homepageDownloadRefresh'],
  649. 'options' => $time
  650. )
  651. )
  652. )
  653. ),
  654. array(
  655. 'name' => 'Transmission',
  656. 'enabled' => false,
  657. 'image' => 'plugins/images/tabs/transmission.png',
  658. 'category' => 'Downloader',
  659. 'settings' => array(
  660. 'Enable' => array(
  661. array(
  662. 'type' => 'switch',
  663. 'name' => 'homepageTransmissionEnabled',
  664. 'label' => 'Enable',
  665. 'value' => $GLOBALS['homepageTransmissionEnabled']
  666. ),
  667. array(
  668. 'type' => 'select',
  669. 'name' => 'homepageTransmissionAuth',
  670. 'label' => 'Minimum Authentication',
  671. 'value' => $GLOBALS['homepageTransmissionAuth'],
  672. 'options' => $groups
  673. )
  674. ),
  675. 'Connection' => array(
  676. array(
  677. 'type' => 'input',
  678. 'name' => 'transmissionURL',
  679. 'label' => 'URL',
  680. 'value' => $GLOBALS['transmissionURL'],
  681. 'placeholder' => 'http(s)://hostname:port'
  682. ),
  683. array(
  684. 'type' => 'input',
  685. 'name' => 'transmissionUsername',
  686. 'label' => 'Username',
  687. 'value' => $GLOBALS['transmissionUsername']
  688. ),
  689. array(
  690. 'type' => 'password',
  691. 'name' => 'transmissionPassword',
  692. 'label' => 'Password',
  693. 'value' => $GLOBALS['transmissionPassword']
  694. )
  695. ),
  696. 'Misc Options' => array(
  697. array(
  698. 'type' => 'switch',
  699. 'name' => 'transmissionHideSeeding',
  700. 'label' => 'Hide Seeding',
  701. 'value' => $GLOBALS['transmissionHideSeeding']
  702. ),array(
  703. 'type' => 'switch',
  704. 'name' => 'transmissionHideCompleted',
  705. 'label' => 'Hide Completed',
  706. 'value' => $GLOBALS['transmissionHideCompleted']
  707. ),
  708. array(
  709. 'type' => 'select',
  710. 'name' => 'homepageDownloadRefresh',
  711. 'label' => 'Refresh Seconds',
  712. 'value' => $GLOBALS['homepageDownloadRefresh'],
  713. 'options' => $time
  714. )
  715. )
  716. )
  717. ),
  718. array(
  719. 'name' => 'qBittorrent',
  720. 'enabled' => false,
  721. 'image' => 'plugins/images/tabs/qBittorrent.png',
  722. 'category' => 'Downloader',
  723. 'settings' => array(
  724. 'Enable' => array(
  725. array(
  726. 'type' => 'switch',
  727. 'name' => 'homepageqBittorrentEnabled',
  728. 'label' => 'Enable',
  729. 'value' => $GLOBALS['homepageqBittorrentEnabled']
  730. ),
  731. array(
  732. 'type' => 'select',
  733. 'name' => 'homepageqBittorrentAuth',
  734. 'label' => 'Minimum Authentication',
  735. 'value' => $GLOBALS['homepageqBittorrentAuth'],
  736. 'options' => $groups
  737. )
  738. ),
  739. 'Connection' => array(
  740. array(
  741. 'type' => 'input',
  742. 'name' => 'qBittorrentURL',
  743. 'label' => 'URL',
  744. 'value' => $GLOBALS['qBittorrentURL'],
  745. 'placeholder' => 'http(s)://hostname:port'
  746. ),
  747. array(
  748. 'type' => 'input',
  749. 'name' => 'qBittorrentUsername',
  750. 'label' => 'Username',
  751. 'value' => $GLOBALS['qBittorrentUsername']
  752. ),
  753. array(
  754. 'type' => 'password',
  755. 'name' => 'qBittorrentPassword',
  756. 'label' => 'Password',
  757. 'value' => $GLOBALS['qBittorrentPassword']
  758. )
  759. ),
  760. 'Misc Options' => array(
  761. array(
  762. 'type' => 'switch',
  763. 'name' => 'qBittorrentHideSeeding',
  764. 'label' => 'Hide Seeding',
  765. 'value' => $GLOBALS['qBittorrentHideSeeding']
  766. ),array(
  767. 'type' => 'switch',
  768. 'name' => 'qBittorrentnHideCompleted',
  769. 'label' => 'Hide Completed',
  770. 'value' => $GLOBALS['qBittorrentHideCompleted']
  771. ),
  772. array(
  773. 'type' => 'select',
  774. 'name' => 'homepageDownloadRefresh',
  775. 'label' => 'Refresh Seconds',
  776. 'value' => $GLOBALS['homepageDownloadRefresh'],
  777. 'options' => $time
  778. )
  779. )
  780. )
  781. ),
  782. array(
  783. 'name' => 'Sonarr',
  784. 'enabled' => false,
  785. 'image' => 'plugins/images/tabs/sonarr.png',
  786. 'category' => 'PVR',
  787. 'settings' => array(
  788. 'Enable' => array(
  789. array(
  790. 'type' => 'switch',
  791. 'name' => 'homepageSonarrEnabled',
  792. 'label' => 'Enable',
  793. 'value' => $GLOBALS['homepageSonarrEnabled']
  794. ),
  795. array(
  796. 'type' => 'select',
  797. 'name' => 'homepageSonarrAuth',
  798. 'label' => 'Minimum Authentication',
  799. 'value' => $GLOBALS['homepageSonarrAuth'],
  800. 'options' => $groups
  801. )
  802. ),
  803. 'Connection' => array(
  804. array(
  805. 'type' => 'input',
  806. 'name' => 'sonarrURL',
  807. 'label' => 'URL',
  808. 'value' => $GLOBALS['sonarrURL'],
  809. 'placeholder' => 'http(s)://hostname:port'
  810. ),
  811. array(
  812. 'type' => 'input',
  813. 'name' => 'sonarrToken',
  814. 'label' => 'Token',
  815. 'value' => $GLOBALS['sonarrToken']
  816. )
  817. ),
  818. 'Misc Options' => array(
  819. array(
  820. 'type' => 'input',
  821. 'name' => 'calendarStart',
  822. 'label' => '# of Days Before',
  823. 'value' => $GLOBALS['calendarStart'],
  824. 'placeholder' => ''
  825. ),
  826. array(
  827. 'type' => 'input',
  828. 'name' => 'calendarEnd',
  829. 'label' => '# of Days After',
  830. 'value' => $GLOBALS['calendarEnd'],
  831. 'placeholder' => ''
  832. ),
  833. array(
  834. 'type' => 'select',
  835. 'name' => 'calendarFirstDay',
  836. 'label' => 'Start Day',
  837. 'value' => $GLOBALS['calendarFirstDay'],
  838. 'options' => $day
  839. ),
  840. array(
  841. 'type' => 'select',
  842. 'name' => 'calendarDefault',
  843. 'label' => 'Default View',
  844. 'value' => $GLOBALS['calendarDefault'],
  845. 'options' => $calendarDefault
  846. ),
  847. array(
  848. 'type' => 'select',
  849. 'name' => 'calendarTimeFormat',
  850. 'label' => 'Time Format',
  851. 'value' => $GLOBALS['calendarTimeFormat'],
  852. 'options' => $timeFormat
  853. ),
  854. array(
  855. 'type' => 'select',
  856. 'name' => 'calendarLimit',
  857. 'label' => 'Items Per Day',
  858. 'value' => $GLOBALS['calendarLimit'],
  859. 'options' => $limit
  860. ),
  861. array(
  862. 'type' => 'select',
  863. 'name' => 'calendarRefresh',
  864. 'label' => 'Refresh Seconds',
  865. 'value' => $GLOBALS['calendarRefresh'],
  866. 'options' => $time
  867. )
  868. )
  869. )
  870. ),
  871. array(
  872. 'name' => 'Radarr',
  873. 'enabled' => false,
  874. 'image' => 'plugins/images/tabs/radarr.png',
  875. 'category' => 'PVR',
  876. 'settings' => array(
  877. 'Enable' => array(
  878. array(
  879. 'type' => 'switch',
  880. 'name' => 'homepageRadarrEnabled',
  881. 'label' => 'Enable',
  882. 'value' => $GLOBALS['homepageRadarrEnabled']
  883. ),
  884. array(
  885. 'type' => 'select',
  886. 'name' => 'homepageRadarrAuth',
  887. 'label' => 'Minimum Authentication',
  888. 'value' => $GLOBALS['homepageRadarrAuth'],
  889. 'options' => $groups
  890. )
  891. ),
  892. 'Connection' => array(
  893. array(
  894. 'type' => 'input',
  895. 'name' => 'radarrURL',
  896. 'label' => 'URL',
  897. 'value' => $GLOBALS['radarrURL'],
  898. 'placeholder' => 'http(s)://hostname:port'
  899. ),
  900. array(
  901. 'type' => 'input',
  902. 'name' => 'radarrToken',
  903. 'label' => 'Token',
  904. 'value' => $GLOBALS['radarrToken']
  905. )
  906. ),
  907. 'Misc Options' => array(
  908. array(
  909. 'type' => 'input',
  910. 'name' => 'calendarStart',
  911. 'label' => '# of Days Before',
  912. 'value' => $GLOBALS['calendarStart'],
  913. 'placeholder' => ''
  914. ),
  915. array(
  916. 'type' => 'input',
  917. 'name' => 'calendarEnd',
  918. 'label' => '# of Days After',
  919. 'value' => $GLOBALS['calendarEnd'],
  920. 'placeholder' => ''
  921. ),
  922. array(
  923. 'type' => 'select',
  924. 'name' => 'calendarFirstDay',
  925. 'label' => 'Start Day',
  926. 'value' => $GLOBALS['calendarFirstDay'],
  927. 'options' => $day
  928. ),
  929. array(
  930. 'type' => 'select',
  931. 'name' => 'calendarDefault',
  932. 'label' => 'Default View',
  933. 'value' => $GLOBALS['calendarDefault'],
  934. 'options' => $calendarDefault
  935. ),
  936. array(
  937. 'type' => 'select',
  938. 'name' => 'calendarTimeFormat',
  939. 'label' => 'Time Format',
  940. 'value' => $GLOBALS['calendarTimeFormat'],
  941. 'options' => $timeFormat
  942. ),
  943. array(
  944. 'type' => 'select',
  945. 'name' => 'calendarLimit',
  946. 'label' => 'Items Per Day',
  947. 'value' => $GLOBALS['calendarLimit'],
  948. 'options' => $limit
  949. ),
  950. array(
  951. 'type' => 'select',
  952. 'name' => 'calendarRefresh',
  953. 'label' => 'Refresh Seconds',
  954. 'value' => $GLOBALS['calendarRefresh'],
  955. 'options' => $time
  956. )
  957. )
  958. )
  959. ),
  960. array(
  961. 'name' => 'CouchPotato',
  962. 'enabled' => false,
  963. 'image' => 'plugins/images/tabs/couchpotato.png',
  964. 'category' => 'PVR',
  965. 'settings' => array(
  966. 'Enable' => array(
  967. array(
  968. 'type' => 'switch',
  969. 'name' => 'homepageCouchpotatoEnabled',
  970. 'label' => 'Enable',
  971. 'value' => $GLOBALS['homepageCouchpotatoEnabled']
  972. ),
  973. array(
  974. 'type' => 'select',
  975. 'name' => 'homepageCouchpotatoAuth',
  976. 'label' => 'Minimum Authentication',
  977. 'value' => $GLOBALS['homepageCouchpotatoAuth'],
  978. 'options' => $groups
  979. )
  980. ),
  981. 'Connection' => array(
  982. array(
  983. 'type' => 'input',
  984. 'name' => 'couchpotatoURL',
  985. 'label' => 'URL',
  986. 'value' => $GLOBALS['couchpotatoURL'],
  987. 'placeholder' => 'http(s)://hostname:port'
  988. ),
  989. array(
  990. 'type' => 'input',
  991. 'name' => 'couchpotatoToken',
  992. 'label' => 'Token',
  993. 'value' => $GLOBALS['couchpotatoToken']
  994. )
  995. ),
  996. 'Misc Options' => array(
  997. array(
  998. 'type' => 'select',
  999. 'name' => 'calendarFirstDay',
  1000. 'label' => 'Start Day',
  1001. 'value' => $GLOBALS['calendarFirstDay'],
  1002. 'options' => $day
  1003. ),
  1004. array(
  1005. 'type' => 'select',
  1006. 'name' => 'calendarDefault',
  1007. 'label' => 'Default View',
  1008. 'value' => $GLOBALS['calendarDefault'],
  1009. 'options' => $calendarDefault
  1010. ),
  1011. array(
  1012. 'type' => 'select',
  1013. 'name' => 'calendarTimeFormat',
  1014. 'label' => 'Time Format',
  1015. 'value' => $GLOBALS['calendarTimeFormat'],
  1016. 'options' => $timeFormat
  1017. ),
  1018. array(
  1019. 'type' => 'select',
  1020. 'name' => 'calendarLimit',
  1021. 'label' => 'Items Per Day',
  1022. 'value' => $GLOBALS['calendarLimit'],
  1023. 'options' => $limit
  1024. ),
  1025. array(
  1026. 'type' => 'select',
  1027. 'name' => 'calendarRefresh',
  1028. 'label' => 'Refresh Seconds',
  1029. 'value' => $GLOBALS['calendarRefresh'],
  1030. 'options' => $time
  1031. )
  1032. )
  1033. )
  1034. ),
  1035. array(
  1036. 'name' => 'SickRage',
  1037. 'enabled' => false,
  1038. 'image' => 'plugins/images/tabs/sickrage.png',
  1039. 'category' => 'PVR',
  1040. 'settings' => array(
  1041. 'Enable' => array(
  1042. array(
  1043. 'type' => 'switch',
  1044. 'name' => 'homepageSickrageEnabled',
  1045. 'label' => 'Enable',
  1046. 'value' => $GLOBALS['homepageSickrageEnabled']
  1047. ),
  1048. array(
  1049. 'type' => 'select',
  1050. 'name' => 'homepageSickrageAuth',
  1051. 'label' => 'Minimum Authentication',
  1052. 'value' => $GLOBALS['homepageSickrageAuth'],
  1053. 'options' => $groups
  1054. )
  1055. ),
  1056. 'Connection' => array(
  1057. array(
  1058. 'type' => 'input',
  1059. 'name' => 'sickrageURL',
  1060. 'label' => 'URL',
  1061. 'value' => $GLOBALS['sickrageURL'],
  1062. 'placeholder' => 'http(s)://hostname:port'
  1063. ),
  1064. array(
  1065. 'type' => 'input',
  1066. 'name' => 'sickrageToken',
  1067. 'label' => 'Token',
  1068. 'value' => $GLOBALS['sickrageToken']
  1069. )
  1070. ),
  1071. 'Misc Options' => array(
  1072. array(
  1073. 'type' => 'select',
  1074. 'name' => 'calendarFirstDay',
  1075. 'label' => 'Start Day',
  1076. 'value' => $GLOBALS['calendarFirstDay'],
  1077. 'options' => $day
  1078. ),
  1079. array(
  1080. 'type' => 'select',
  1081. 'name' => 'calendarDefault',
  1082. 'label' => 'Default View',
  1083. 'value' => $GLOBALS['calendarDefault'],
  1084. 'options' => $calendarDefault
  1085. ),
  1086. array(
  1087. 'type' => 'select',
  1088. 'name' => 'calendarTimeFormat',
  1089. 'label' => 'Time Format',
  1090. 'value' => $GLOBALS['calendarTimeFormat'],
  1091. 'options' => $timeFormat
  1092. ),
  1093. array(
  1094. 'type' => 'select',
  1095. 'name' => 'calendarLimit',
  1096. 'label' => 'Items Per Day',
  1097. 'value' => $GLOBALS['calendarLimit'],
  1098. 'options' => $limit
  1099. ),
  1100. array(
  1101. 'type' => 'select',
  1102. 'name' => 'calendarRefresh',
  1103. 'label' => 'Refresh Seconds',
  1104. 'value' => $GLOBALS['calendarRefresh'],
  1105. 'options' => $time
  1106. )
  1107. )
  1108. )
  1109. )
  1110. );
  1111. }