homepage-functions.php 40 KB

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