homepage-functions.php 36 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076
  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' => 'switch',
  818. 'name' => 'calendarLimit',
  819. 'label' => 'Limit Entries',
  820. 'value' => $GLOBALS['calendarLimit']
  821. ),
  822. array(
  823. 'type' => 'select',
  824. 'name' => 'calendarRefresh',
  825. 'label' => 'Refresh Seconds',
  826. 'value' => $GLOBALS['calendarRefresh'],
  827. 'options' => $time
  828. )
  829. )
  830. )
  831. ),
  832. array(
  833. 'name' => 'Radarr',
  834. 'enabled' => false,
  835. 'image' => 'plugins/images/tabs/radarr.png',
  836. 'category' => 'PVR',
  837. 'settings' => array(
  838. 'Enable' => array(
  839. array(
  840. 'type' => 'switch',
  841. 'name' => 'homepageRadarrEnabled',
  842. 'label' => 'Enable',
  843. 'value' => $GLOBALS['homepageRadarrEnabled']
  844. ),
  845. array(
  846. 'type' => 'select',
  847. 'name' => 'homepageRadarrAuth',
  848. 'label' => 'Minimum Authentication',
  849. 'value' => $GLOBALS['homepageRadarrAuth'],
  850. 'options' => $groups
  851. )
  852. ),
  853. 'Connection' => array(
  854. array(
  855. 'type' => 'input',
  856. 'name' => 'radarrURL',
  857. 'label' => 'URL',
  858. 'value' => $GLOBALS['radarrURL'],
  859. 'placeholder' => 'http(s)://hostname:port'
  860. ),
  861. array(
  862. 'type' => 'input',
  863. 'name' => 'radarrToken',
  864. 'label' => 'Token',
  865. 'value' => $GLOBALS['radarrToken']
  866. )
  867. ),
  868. 'Misc Options' => array(
  869. array(
  870. 'type' => 'input',
  871. 'name' => 'calendarStart',
  872. 'label' => '# of Days Before',
  873. 'value' => $GLOBALS['calendarStart'],
  874. 'placeholder' => ''
  875. ),
  876. array(
  877. 'type' => 'input',
  878. 'name' => 'calendarEnd',
  879. 'label' => '# of Days After',
  880. 'value' => $GLOBALS['calendarEnd'],
  881. 'placeholder' => ''
  882. ),
  883. array(
  884. 'type' => 'select',
  885. 'name' => 'calendarFirstDay',
  886. 'label' => 'Start Day',
  887. 'value' => $GLOBALS['calendarFirstDay'],
  888. 'options' => $day
  889. ),
  890. array(
  891. 'type' => 'select',
  892. 'name' => 'calendarDefault',
  893. 'label' => 'Default View',
  894. 'value' => $GLOBALS['calendarDefault'],
  895. 'options' => $calendarDefault
  896. ),
  897. array(
  898. 'type' => 'select',
  899. 'name' => 'calendarTimeFormat',
  900. 'label' => 'Time Format',
  901. 'value' => $GLOBALS['calendarTimeFormat'],
  902. 'options' => $timeFormat
  903. ),
  904. array(
  905. 'type' => 'switch',
  906. 'name' => 'calendarLimit',
  907. 'label' => 'Limit Entries',
  908. 'value' => $GLOBALS['calendarLimit']
  909. ),
  910. array(
  911. 'type' => 'select',
  912. 'name' => 'calendarRefresh',
  913. 'label' => 'Refresh Seconds',
  914. 'value' => $GLOBALS['calendarRefresh'],
  915. 'options' => $time
  916. )
  917. )
  918. )
  919. ),
  920. array(
  921. 'name' => 'CouchPotato',
  922. 'enabled' => false,
  923. 'image' => 'plugins/images/tabs/couchpotato.png',
  924. 'category' => 'PVR',
  925. 'settings' => array(
  926. 'Enable' => array(
  927. array(
  928. 'type' => 'switch',
  929. 'name' => 'homepageCouchpotatoEnabled',
  930. 'label' => 'Enable',
  931. 'value' => $GLOBALS['homepageCouchpotatoEnabled']
  932. ),
  933. array(
  934. 'type' => 'select',
  935. 'name' => 'homepageCouchpotatoAuth',
  936. 'label' => 'Minimum Authentication',
  937. 'value' => $GLOBALS['homepageCouchpotatoAuth'],
  938. 'options' => $groups
  939. )
  940. ),
  941. 'Connection' => array(
  942. array(
  943. 'type' => 'input',
  944. 'name' => 'couchpotatoURL',
  945. 'label' => 'URL',
  946. 'value' => $GLOBALS['couchpotatoURL'],
  947. 'placeholder' => 'http(s)://hostname:port'
  948. ),
  949. array(
  950. 'type' => 'input',
  951. 'name' => 'couchpotatoToken',
  952. 'label' => 'Token',
  953. 'value' => $GLOBALS['couchpotatoToken']
  954. )
  955. ),
  956. 'Misc Options' => array(
  957. array(
  958. 'type' => 'select',
  959. 'name' => 'calendarFirstDay',
  960. 'label' => 'Start Day',
  961. 'value' => $GLOBALS['calendarFirstDay'],
  962. 'options' => $day
  963. ),
  964. array(
  965. 'type' => 'select',
  966. 'name' => 'calendarDefault',
  967. 'label' => 'Default View',
  968. 'value' => $GLOBALS['calendarDefault'],
  969. 'options' => $calendarDefault
  970. ),
  971. array(
  972. 'type' => 'select',
  973. 'name' => 'calendarTimeFormat',
  974. 'label' => 'Time Format',
  975. 'value' => $GLOBALS['calendarTimeFormat'],
  976. 'options' => $timeFormat
  977. ),
  978. array(
  979. 'type' => 'switch',
  980. 'name' => 'calendarLimit',
  981. 'label' => 'Limit Entries',
  982. 'value' => $GLOBALS['calendarLimit']
  983. ),
  984. array(
  985. 'type' => 'select',
  986. 'name' => 'calendarRefresh',
  987. 'label' => 'Refresh Seconds',
  988. 'value' => $GLOBALS['calendarRefresh'],
  989. 'options' => $time
  990. )
  991. )
  992. )
  993. ),
  994. array(
  995. 'name' => 'SickRage',
  996. 'enabled' => false,
  997. 'image' => 'plugins/images/tabs/sickrage.png',
  998. 'category' => 'PVR',
  999. 'settings' => array(
  1000. 'Enable' => array(
  1001. array(
  1002. 'type' => 'switch',
  1003. 'name' => 'homepageSickrageEnabled',
  1004. 'label' => 'Enable',
  1005. 'value' => $GLOBALS['homepageSickrageEnabled']
  1006. ),
  1007. array(
  1008. 'type' => 'select',
  1009. 'name' => 'homepageSickrageAuth',
  1010. 'label' => 'Minimum Authentication',
  1011. 'value' => $GLOBALS['homepageSickrageAuth'],
  1012. 'options' => $groups
  1013. )
  1014. ),
  1015. 'Connection' => array(
  1016. array(
  1017. 'type' => 'input',
  1018. 'name' => 'sickrageURL',
  1019. 'label' => 'URL',
  1020. 'value' => $GLOBALS['sickrageURL'],
  1021. 'placeholder' => 'http(s)://hostname:port'
  1022. ),
  1023. array(
  1024. 'type' => 'input',
  1025. 'name' => 'sickrageToken',
  1026. 'label' => 'Token',
  1027. 'value' => $GLOBALS['sickrageToken']
  1028. )
  1029. ),
  1030. 'Misc Options' => array(
  1031. array(
  1032. 'type' => 'select',
  1033. 'name' => 'calendarFirstDay',
  1034. 'label' => 'Start Day',
  1035. 'value' => $GLOBALS['calendarFirstDay'],
  1036. 'options' => $day
  1037. ),
  1038. array(
  1039. 'type' => 'select',
  1040. 'name' => 'calendarDefault',
  1041. 'label' => 'Default View',
  1042. 'value' => $GLOBALS['calendarDefault'],
  1043. 'options' => $calendarDefault
  1044. ),
  1045. array(
  1046. 'type' => 'select',
  1047. 'name' => 'calendarTimeFormat',
  1048. 'label' => 'Time Format',
  1049. 'value' => $GLOBALS['calendarTimeFormat'],
  1050. 'options' => $timeFormat
  1051. ),
  1052. array(
  1053. 'type' => 'switch',
  1054. 'name' => 'calendarLimit',
  1055. 'label' => 'Limit Entries',
  1056. 'value' => $GLOBALS['calendarLimit']
  1057. ),
  1058. array(
  1059. 'type' => 'select',
  1060. 'name' => 'calendarRefresh',
  1061. 'label' => 'Refresh Seconds',
  1062. 'value' => $GLOBALS['calendarRefresh'],
  1063. 'options' => $time
  1064. )
  1065. )
  1066. )
  1067. )
  1068. );
  1069. }