homepage-functions.php 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583
  1. <?php
  2. //homepage order
  3. function homepageOrder(){
  4. $homepageOrder = array(
  5. "homepageOrdercustomhtml" => $GLOBALS['homepageOrdercustomhtml'],
  6. "homepageOrdercustomhtmlTwo" => $GLOBALS['homepageOrdercustomhtmlTwo'],
  7. "homepageOrdernzbget" => $GLOBALS['homepageOrdernzbget'],
  8. "homepageOrdersabnzbd" => $GLOBALS['homepageOrdersabnzbd'],
  9. "homepageOrderplexnowplaying" => $GLOBALS['homepageOrderplexnowplaying'],
  10. "homepageOrderplexrecent" => $GLOBALS['homepageOrderplexrecent'],
  11. "homepageOrderplexplaylist" => $GLOBALS['homepageOrderplexplaylist'],
  12. "homepageOrderembynowplaying" => $GLOBALS['homepageOrderembynowplaying'],
  13. "homepageOrderembyrecent" => $GLOBALS['homepageOrderembyrecent'],
  14. "homepageOrderombi" => $GLOBALS['homepageOrderombi'],
  15. "homepageOrdercalendar" => $GLOBALS['homepageOrdercalendar'],
  16. "homepageOrdertransmission" => $GLOBALS['homepageOrdertransmission'],
  17. "homepageOrderqBittorrent" => $GLOBALS['homepageOrderqBittorrent'],
  18. "homepageOrderdeluge" => $GLOBALS['homepageOrderdeluge'],
  19. );
  20. asort($homepageOrder);
  21. return $homepageOrder;
  22. }
  23. function buildHomepage(){
  24. $homepageOrder = homepageOrder();
  25. $homepageBuilt = '';
  26. foreach ($homepageOrder as $key => $value) {
  27. $homepageBuilt .= buildHomepageItem($key);
  28. }
  29. return $homepageBuilt;
  30. }
  31. function buildHomepageItem($homepageItem){
  32. $item = '<div id="'.$homepageItem.'">';
  33. switch ($homepageItem) {
  34. case 'homepageOrdercustomhtml':
  35. if($GLOBALS['homepagCustomHTMLoneEnabled'] && qualifyRequest($GLOBALS['homepagCustomHTMLoneAuth']) ){
  36. $item .= ($GLOBALS['customHTMLone'] !== '') ? $GLOBALS['customHTMLone'] : '';
  37. }
  38. break;
  39. case 'homepageOrdercustomhtmlTwo':
  40. if($GLOBALS['homepagCustomHTMLtwoEnabled'] && qualifyRequest($GLOBALS['homepagCustomHTMLtwoAuth']) ){
  41. $item .= ($GLOBALS['customHTMLtwo'] !== '') ? $GLOBALS['customHTMLtwo'] : '';
  42. }
  43. break;
  44. case 'homepageOrdernotice':
  45. break;
  46. case 'homepageOrdernoticeguest':
  47. break;
  48. case 'homepageOrderqBittorrent':
  49. if($GLOBALS['homepageqBittorrentEnabled']){
  50. $item .= '<div class="white-box animated zoomIn"><h2 class="text-center" lang="en">Loading Download Queue...</h2></div>';
  51. $item .= '
  52. <script>
  53. // homepageOrderqBittorrent
  54. homepageDownloader("qBittorrent", "'.$GLOBALS['homepageDownloadRefresh'].'");
  55. // End homepageOrderqBittorrent
  56. </script>
  57. ';
  58. }
  59. break;
  60. case 'homepageOrderdeluge':
  61. if($GLOBALS['homepageDelugeEnabled']){
  62. $item .= '<div class="white-box animated zoomIn"><h2 class="text-center" lang="en">Loading Download Queue...</h2></div>';
  63. $item .= '
  64. <script>
  65. // Deluge
  66. homepageDownloader("deluge", "'.$GLOBALS['homepageDownloadRefresh'].'");
  67. // End Deluge
  68. </script>
  69. ';
  70. }
  71. break;
  72. case 'homepageOrdertransmission':
  73. if($GLOBALS['homepageTransmissionEnabled']){
  74. $item .= '<div class="white-box animated zoomIn"><h2 class="text-center" lang="en">Loading Download Queue...</h2></div>';
  75. $item .= '
  76. <script>
  77. // Transmission
  78. homepageDownloader("transmission", "'.$GLOBALS['homepageDownloadRefresh'].'");
  79. // End Transmission
  80. </script>
  81. ';
  82. }
  83. break;
  84. case 'homepageOrdernzbget':
  85. if($GLOBALS['homepageNzbgetEnabled']){
  86. $item .= '<div class="white-box animated zoomIn"><h2 class="text-center" lang="en">Loading Download Queue...</h2></div>';
  87. $item .= '
  88. <script>
  89. // NZBGet
  90. homepageDownloader("nzbget", "'.$GLOBALS['homepageDownloadRefresh'].'");
  91. // End NZBGet
  92. </script>
  93. ';
  94. }
  95. break;
  96. case 'homepageOrdersabnzbd':
  97. if($GLOBALS['homepageSabnzbdEnabled']){
  98. $item .= '<div class="white-box animated zoomIn"><h2 class="text-center" lang="en">Loading Download Queue...</h2></div>';
  99. $item .= '
  100. <script>
  101. // SabNZBd
  102. homepageDownloader("sabnzbd", "'.$GLOBALS['homepageDownloadRefresh'].'");
  103. // End SabNZBd
  104. </script>
  105. ';
  106. }
  107. break;
  108. case 'homepageOrderplexnowplaying':
  109. if($GLOBALS['homepagePlexStreams']){
  110. $item .= '<div class="white-box animated zoomIn"><h2 class="text-center" lang="en">Loading Now Playing...</h2></div>';
  111. $item .= '
  112. <script>
  113. // Plex Stream
  114. homepageStream("plex", "'.$GLOBALS['homepageStreamRefresh'].'");
  115. // End Plex Stream
  116. </script>
  117. ';
  118. }
  119. break;
  120. case 'homepageOrderplexrecent':
  121. if($GLOBALS['homepagePlexRecent']){
  122. $item .= '<div class="white-box animated zoomIn"><h2 class="text-center" lang="en">Loading Recent...</h2></div>';
  123. $item .= '
  124. <script>
  125. // Plex Recent
  126. homepageRecent("plex", "'.$GLOBALS['homepageRecentRefresh'].'");
  127. // End Plex Recent
  128. </script>
  129. ';
  130. }
  131. break;
  132. case 'homepageOrderplexplaylist':
  133. if($GLOBALS['homepagePlexPlaylist']){
  134. $item .= '<div class="white-box animated zoomIn"><h2 class="text-center" lang="en">Loading Playlists...</h2></div>';
  135. $item .= '
  136. <script>
  137. // Plex Playlist
  138. homepagePlaylist("plex");
  139. // End Plex Playlist
  140. </script>
  141. ';
  142. }
  143. break;
  144. case 'homepageOrderembynowplaying':
  145. if($GLOBALS['homepageEmbyStreams']){
  146. $item .= '<div class="white-box animated zoomIn"><h2 class="text-center" lang="en">Loading Now Playing...</h2></div>';
  147. $item .= '
  148. <script>
  149. // Emby Stream
  150. homepageStream("emby", "'.$GLOBALS['homepageStreamRefresh'].'");
  151. // End Emby Stream
  152. </script>
  153. ';
  154. }
  155. break;
  156. case 'homepageOrderembyrecent':
  157. if($GLOBALS['homepageEmbyRecent']){
  158. $item .= '<div class="white-box animated zoomIn"><h2 class="text-center" lang="en">Loading Recent...</h2></div>';
  159. $item .= '
  160. <script>
  161. // Emby Recent
  162. homepageRecent("emby", "'.$GLOBALS['homepageRecentRefresh'].'");
  163. // End Emby Recent
  164. </script>
  165. ';
  166. }
  167. break;
  168. case 'homepageOrderombi':
  169. if($GLOBALS['homepageOmbiEnabled']){
  170. $item .= '<div class="white-box animated zoomIn"><h2 class="text-center" lang="en">Loading Requests...</h2></div>';
  171. $item .= '
  172. <script>
  173. // Ombi Requests
  174. homepageRequests("'.$GLOBALS['ombiRefresh'].'");
  175. // End Ombi Requests
  176. </script>
  177. ';
  178. }
  179. break;
  180. case 'homepageOrdercalendar':
  181. if($GLOBALS['homepageSonarrEnabled'] && qualifyRequest($GLOBALS['homepageSonarrAuth']) || ($GLOBALS['homepageRadarrEnabled'] && qualifyRequest($GLOBALS['homepageRadarrAuth'])) || ($GLOBALS['homepageSickrageEnabled'] && qualifyRequest($GLOBALS['homepageSickrageAuth'])) || ($GLOBALS['homepageCouchpotatoEnabled'] && qualifyRequest($GLOBALS['homepageCouchpotatoAuth']))){
  182. $item .= '
  183. <div id="calendar" class="fc fc-ltr animated zoomIn"></div>
  184. <script>
  185. // Calendar
  186. homepageCalendar("'.$GLOBALS['calendarRefresh'].'");
  187. // End Calendar
  188. </script>
  189. ';
  190. }
  191. break;
  192. default:
  193. # code...
  194. break;
  195. }
  196. return $item.'</div>';
  197. }
  198. function getHomepageList(){
  199. $groups = groupSelect();
  200. $mediaServers = array(
  201. array(
  202. 'name' => 'N/A',
  203. 'value' => ''
  204. ),
  205. array(
  206. 'name' => 'Plex',
  207. 'value' => 'plex'
  208. ),
  209. array(
  210. 'name' => 'Emby [Not Available]',
  211. 'value' => 'emby'
  212. )
  213. );
  214. $time = array(
  215. array(
  216. 'name' => '5',
  217. 'value' => '5000'
  218. ),
  219. array(
  220. 'name' => '10',
  221. 'value' => '10000'
  222. ),
  223. array(
  224. 'name' => '15',
  225. 'value' => '15000'
  226. ),
  227. array(
  228. 'name' => '30',
  229. 'value' => '30000'
  230. ),
  231. array(
  232. 'name' => '60 [1 Minute]',
  233. 'value' => '60000'
  234. ),
  235. array(
  236. 'name' => '300 [5 Minutes]',
  237. 'value' => '300000'
  238. ),
  239. array(
  240. 'name' => '900 [15 Minutes]',
  241. 'value' => '900000'
  242. ),
  243. array(
  244. 'name' => '1800 [30 Minutes]',
  245. 'value' => '1800000'
  246. ),
  247. array(
  248. 'name' => '3600 [1 Hour]',
  249. 'value' => '3600000'
  250. ),
  251. );
  252. $limit = array(
  253. array(
  254. 'name' => '1 Item',
  255. 'value' => '1'
  256. ),
  257. array(
  258. 'name' => '2 Items',
  259. 'value' => '2'
  260. ),
  261. array(
  262. 'name' => '3 Items',
  263. 'value' => '3'
  264. ),
  265. array(
  266. 'name' => '4 Items',
  267. 'value' => '4'
  268. ),
  269. array(
  270. 'name' => '5 Items',
  271. 'value' => '5'
  272. ),
  273. array(
  274. 'name' => '6 Items',
  275. 'value' => '6'
  276. ),
  277. array(
  278. 'name' => '7 Items',
  279. 'value' => '7'
  280. ),
  281. array(
  282. 'name' => '8 Items',
  283. 'value' => '8'
  284. ),
  285. array(
  286. 'name' => 'Unlimited',
  287. 'value' => '1000'
  288. ),
  289. );
  290. $day = array(
  291. array(
  292. 'name' => 'Sunday',
  293. 'value' => '0'
  294. ),
  295. array(
  296. 'name' => 'Monday',
  297. 'value' => '1'
  298. ),
  299. array(
  300. 'name' => 'Tueday',
  301. 'value' => '2'
  302. ),
  303. array(
  304. 'name' => 'Wednesday',
  305. 'value' => '3'
  306. ),
  307. array(
  308. 'name' => 'Thursday',
  309. 'value' => '4'
  310. ),
  311. array(
  312. 'name' => 'Friday',
  313. 'value' => '5'
  314. ),
  315. array(
  316. 'name' => 'Saturday',
  317. 'value' => '6'
  318. )
  319. );
  320. $calendarDefault = array(
  321. array(
  322. 'name' => 'Month',
  323. 'value' => 'month'
  324. ),
  325. array(
  326. 'name' => 'Day',
  327. 'value' => 'basicDay'
  328. ),
  329. array(
  330. 'name' => 'Week',
  331. 'value' => 'basicWeek'
  332. )
  333. );
  334. $timeFormat = array(
  335. array(
  336. 'name' => '6p',
  337. 'value' => 'h(:mm)t'
  338. ),
  339. array(
  340. 'name' => '6:00p',
  341. 'value' => 'h:mmt'
  342. ),
  343. array(
  344. 'name' => '6:00',
  345. 'value' => 'h:mm'
  346. ),
  347. array(
  348. 'name' => '18',
  349. 'value' => 'H(:mm)'
  350. ),
  351. array(
  352. 'name' => '18:00',
  353. 'value' => 'H:mm'
  354. )
  355. );
  356. $qBittorrentSortOptions = array(
  357. array(
  358. 'name' => 'Hash',
  359. 'value' => 'hash'
  360. ),
  361. array(
  362. 'name' => 'Name',
  363. 'value' => 'name'
  364. ),
  365. array(
  366. 'name' => 'Size',
  367. 'value' => 'size'
  368. ),
  369. array(
  370. 'name' => 'Progress',
  371. 'value' => 'progress'
  372. ),
  373. array(
  374. 'name' => 'Download Speed',
  375. 'value' => 'dlspeed'
  376. ),
  377. array(
  378. 'name' => 'Upload Speed',
  379. 'value' => 'upspeed'
  380. ),
  381. array(
  382. 'name' => 'Priority',
  383. 'value' => 'priority'
  384. ),
  385. array(
  386. 'name' => 'Number of Seeds',
  387. 'value' => 'num_seeds'
  388. ),
  389. array(
  390. 'name' => 'Number of Seeds in Swarm',
  391. 'value' => 'num_complete'
  392. ),
  393. array(
  394. 'name' => 'Number of Leechers',
  395. 'value' => 'num_leechs'
  396. ),
  397. array(
  398. 'name' => 'Number of Leechers in Swarm',
  399. 'value' => 'num_incomplete'
  400. ),
  401. array(
  402. 'name' => 'Ratio',
  403. 'value' => 'ratio'
  404. ),
  405. array(
  406. 'name' => 'ETA',
  407. 'value' => 'eta'
  408. ),
  409. array(
  410. 'name' => 'State',
  411. 'value' => 'state'
  412. ),
  413. array(
  414. 'name' => 'Category',
  415. 'value' => 'category'
  416. )
  417. );
  418. return array(
  419. array(
  420. 'name' => 'Plex',
  421. 'enabled' => true,
  422. 'image' => 'plugins/images/tabs/plex.png',
  423. 'category' => 'Media Server',
  424. 'settings' => array(
  425. 'Enable' => array(
  426. array(
  427. 'type' => 'switch',
  428. 'name' => 'homepagePlexEnabled',
  429. 'label' => 'Enable',
  430. 'value' => $GLOBALS['homepagePlexEnabled']
  431. ),
  432. array(
  433. 'type' => 'select',
  434. 'name' => 'homepagePlexAuth',
  435. 'label' => 'Minimum Authentication',
  436. 'value' => $GLOBALS['homepagePlexAuth'],
  437. 'options' => $groups
  438. )
  439. ),
  440. 'Connection' => array(
  441. array(
  442. 'type' => 'input',
  443. 'name' => 'plexURL',
  444. 'label' => 'URL',
  445. 'value' => $GLOBALS['plexURL'],
  446. 'placeholder' => 'http(s)://hostname:port'
  447. ),
  448. array(
  449. 'type' => 'password-alt',
  450. 'name' => 'plexToken',
  451. 'label' => 'Token',
  452. 'value' => $GLOBALS['plexToken']
  453. ),
  454. array(
  455. 'type' => 'password-alt',
  456. 'name' => 'plexID',
  457. 'label' => 'Plex Machine',
  458. 'value' => $GLOBALS['plexID']
  459. )
  460. ),
  461. 'Active Streams' => array(
  462. array(
  463. 'type' => 'switch',
  464. 'name' => 'homepagePlexStreams',
  465. 'label' => 'Enable',
  466. 'value' => $GLOBALS['homepagePlexStreams']
  467. ),
  468. array(
  469. 'type' => 'select',
  470. 'name' => 'homepagePlexStreamsAuth',
  471. 'label' => 'Minimum Authorization',
  472. 'value' => $GLOBALS['homepagePlexStreamsAuth'],
  473. 'options' => $groups
  474. ),
  475. array(
  476. 'type' => 'switch',
  477. 'name' => 'homepageShowStreamNames',
  478. 'label' => 'User Information',
  479. 'value' => $GLOBALS['homepageShowStreamNames']
  480. ),
  481. array(
  482. 'type' => 'select',
  483. 'name' => 'homepageShowStreamNamesAuth',
  484. 'label' => 'Minimum Authorization',
  485. 'value' => $GLOBALS['homepageShowStreamNamesAuth'],
  486. 'options' => $groups
  487. ),
  488. array(
  489. 'type' => 'select',
  490. 'name' => 'homepageStreamRefresh',
  491. 'label' => 'Refresh Seconds',
  492. 'value' => $GLOBALS['homepageStreamRefresh'],
  493. 'options' => $time
  494. ),
  495. ),
  496. 'Recent Items' => array(
  497. array(
  498. 'type' => 'switch',
  499. 'name' => 'homepagePlexRecent',
  500. 'label' => 'Enable',
  501. 'value' => $GLOBALS['homepagePlexRecent']
  502. ),
  503. array(
  504. 'type' => 'select',
  505. 'name' => 'homepagePlexRecentAuth',
  506. 'label' => 'Minimum Authorization',
  507. 'value' => $GLOBALS['homepagePlexRecentAuth'],
  508. 'options' => $groups
  509. ),
  510. array(
  511. 'type' => 'select',
  512. 'name' => 'homepageRecentRefresh',
  513. 'label' => 'Refresh Seconds',
  514. 'value' => $GLOBALS['homepageRecentRefresh'],
  515. 'options' => $time
  516. ),
  517. ),
  518. 'Media Search' => array(
  519. array(
  520. 'type' => 'switch',
  521. 'name' => 'mediaSearch',
  522. 'label' => 'Enable',
  523. 'value' => $GLOBALS['mediaSearch']
  524. ),
  525. array(
  526. 'type' => 'select',
  527. 'name' => 'mediaSearchAuth',
  528. 'label' => 'Minimum Authorization',
  529. 'value' => $GLOBALS['mediaSearchAuth'],
  530. 'options' => $groups
  531. ),
  532. array(
  533. 'type' => 'select',
  534. 'name' => 'mediaSearchType',
  535. 'label' => 'Media Server',
  536. 'value' => $GLOBALS['mediaSearchType'],
  537. 'options' => $mediaServers
  538. ),
  539. ),
  540. 'Playlists' => array(
  541. array(
  542. 'type' => 'switch',
  543. 'name' => 'homepagePlexPlaylist',
  544. 'label' => 'Enable',
  545. 'value' => $GLOBALS['homepagePlexPlaylist']
  546. ),
  547. array(
  548. 'type' => 'select',
  549. 'name' => 'homepagePlexPlaylistAuth',
  550. 'label' => 'Minimum Authorization',
  551. 'value' => $GLOBALS['homepagePlexPlaylistAuth'],
  552. 'options' => $groups
  553. ),
  554. ),
  555. 'Misc Options' => array(
  556. array(
  557. 'type' => 'input',
  558. 'name' => 'plexTabName',
  559. 'label' => 'Plex Tab Name',
  560. 'value' => $GLOBALS['plexTabName'],
  561. 'placeholder' => 'Only use if you have Plex in a reverse proxy'
  562. ),
  563. array(
  564. 'type' => 'input',
  565. 'name' => 'plexTabURL',
  566. 'label' => 'Plex Tab WAN URL',
  567. 'value' => $GLOBALS['plexTabURL'],
  568. 'placeholder' => 'http(s)://hostname:port'
  569. )
  570. )
  571. )
  572. ),
  573. array(
  574. 'name' => 'Emby',
  575. 'enabled' => true,
  576. 'image' => 'plugins/images/tabs/emby.png',
  577. 'category' => 'Media Server',
  578. 'settings' => array(
  579. 'Enable' => array(
  580. array(
  581. 'type' => 'switch',
  582. 'name' => 'homepageEmbyEnabled',
  583. 'label' => 'Enable',
  584. 'value' => $GLOBALS['homepageEmbyEnabled']
  585. ),
  586. array(
  587. 'type' => 'select',
  588. 'name' => 'homepageEmbyAuth',
  589. 'label' => 'Minimum Authentication',
  590. 'value' => $GLOBALS['homepageEmbyAuth'],
  591. 'options' => $groups
  592. )
  593. ),
  594. 'Connection' => array(
  595. array(
  596. 'type' => 'input',
  597. 'name' => 'embyURL',
  598. 'label' => 'URL',
  599. 'value' => $GLOBALS['embyURL'],
  600. 'placeholder' => 'http(s)://hostname:port'
  601. ),
  602. array(
  603. 'type' => 'password-alt',
  604. 'name' => 'embyToken',
  605. 'label' => 'Token',
  606. 'value' => $GLOBALS['embyToken']
  607. )
  608. ),
  609. 'Active Streams' => array(
  610. array(
  611. 'type' => 'switch',
  612. 'name' => 'homepageEmbyStreams',
  613. 'label' => 'Enable',
  614. 'value' => $GLOBALS['homepageEmbyStreams']
  615. ),
  616. array(
  617. 'type' => 'select',
  618. 'name' => 'homepageEmbyStreamsAuth',
  619. 'label' => 'Minimum Authorization',
  620. 'value' => $GLOBALS['homepageEmbyStreamsAuth'],
  621. 'options' => $groups
  622. ),
  623. array(
  624. 'type' => 'switch',
  625. 'name' => 'homepageShowStreamNames',
  626. 'label' => 'User Information',
  627. 'value' => $GLOBALS['homepageShowStreamNames']
  628. ),
  629. array(
  630. 'type' => 'select',
  631. 'name' => 'homepageShowStreamNamesAuth',
  632. 'label' => 'Minimum Authorization',
  633. 'value' => $GLOBALS['homepageShowStreamNamesAuth'],
  634. 'options' => $groups
  635. ),
  636. array(
  637. 'type' => 'select',
  638. 'name' => 'homepageStreamRefresh',
  639. 'label' => 'Refresh Seconds',
  640. 'value' => $GLOBALS['homepageStreamRefresh'],
  641. 'options' => $time
  642. ),
  643. ),
  644. 'Recent Items' => array(
  645. array(
  646. 'type' => 'switch',
  647. 'name' => 'homepageEmbyRecent',
  648. 'label' => 'Enable',
  649. 'value' => $GLOBALS['homepageEmbyRecent']
  650. ),
  651. array(
  652. 'type' => 'select',
  653. 'name' => 'homepageEmbyRecentAuth',
  654. 'label' => 'Minimum Authorization',
  655. 'value' => $GLOBALS['homepageEmbyRecentAuth'],
  656. 'options' => $groups
  657. ),
  658. array(
  659. 'type' => 'select',
  660. 'name' => 'homepageRecentRefresh',
  661. 'label' => 'Refresh Seconds',
  662. 'value' => $GLOBALS['homepageRecentRefresh'],
  663. 'options' => $time
  664. ),
  665. ),
  666. 'Misc Options' => array(
  667. array(
  668. 'type' => 'input',
  669. 'name' => 'embyTabName',
  670. 'label' => 'Emby Tab Name',
  671. 'value' => $GLOBALS['embyTabName'],
  672. 'placeholder' => 'Only use if you have Plex in a reverse proxy'
  673. ),
  674. array(
  675. 'type' => 'input',
  676. 'name' => 'embyTabURL',
  677. 'label' => 'Emby Tab WAN URL',
  678. 'value' => $GLOBALS['embyTabURL'],
  679. 'placeholder' => 'http(s)://hostname:port'
  680. )
  681. )
  682. )
  683. ),
  684. array(
  685. 'name' => 'SabNZBD',
  686. 'enabled' => false,
  687. 'image' => 'plugins/images/tabs/sabnzbd.png',
  688. 'category' => 'Downloader',
  689. 'settings' => array(
  690. 'Enable' => array(
  691. array(
  692. 'type' => 'switch',
  693. 'name' => 'homepageSabnzbdEnabled',
  694. 'label' => 'Enable',
  695. 'value' => $GLOBALS['homepageSabnzbdEnabled']
  696. ),
  697. array(
  698. 'type' => 'select',
  699. 'name' => 'homepageSabnzbdAuth',
  700. 'label' => 'Minimum Authentication',
  701. 'value' => $GLOBALS['homepageSabnzbdAuth'],
  702. 'options' => $groups
  703. )
  704. ),
  705. 'Connection' => array(
  706. array(
  707. 'type' => 'input',
  708. 'name' => 'sabnzbdURL',
  709. 'label' => 'URL',
  710. 'value' => $GLOBALS['sabnzbdURL'],
  711. 'placeholder' => 'http(s)://hostname:port'
  712. ),
  713. array(
  714. 'type' => 'password-alt',
  715. 'name' => 'sabnzbdToken',
  716. 'label' => 'Token',
  717. 'value' => $GLOBALS['sabnzbdToken']
  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' => 'NZBGet',
  733. 'enabled' => false,
  734. 'image' => 'plugins/images/tabs/nzbget.png',
  735. 'category' => 'Downloader',
  736. 'settings' => array(
  737. 'Enable' => array(
  738. array(
  739. 'type' => 'switch',
  740. 'name' => 'homepageNzbgetEnabled',
  741. 'label' => 'Enable',
  742. 'value' => $GLOBALS['homepageNzbgetEnabled']
  743. ),
  744. array(
  745. 'type' => 'select',
  746. 'name' => 'homepageNzbgetAuth',
  747. 'label' => 'Minimum Authentication',
  748. 'value' => $GLOBALS['homepageNzbgetAuth'],
  749. 'options' => $groups
  750. )
  751. ),
  752. 'Connection' => array(
  753. array(
  754. 'type' => 'input',
  755. 'name' => 'nzbgetURL',
  756. 'label' => 'URL',
  757. 'value' => $GLOBALS['nzbgetURL'],
  758. 'placeholder' => 'http(s)://hostname:port'
  759. ),
  760. array(
  761. 'type' => 'input',
  762. 'name' => 'nzbgetUsername',
  763. 'label' => 'Username',
  764. 'value' => $GLOBALS['nzbgetUsername']
  765. ),
  766. array(
  767. 'type' => 'password',
  768. 'name' => 'nzbgetPassword',
  769. 'label' => 'Password',
  770. 'value' => $GLOBALS['nzbgetPassword']
  771. )
  772. ),
  773. 'Misc Options' => array(
  774. array(
  775. 'type' => 'select',
  776. 'name' => 'homepageDownloadRefresh',
  777. 'label' => 'Refresh Seconds',
  778. 'value' => $GLOBALS['homepageDownloadRefresh'],
  779. 'options' => $time
  780. )
  781. )
  782. )
  783. ),
  784. array(
  785. 'name' => 'Transmission',
  786. 'enabled' => false,
  787. 'image' => 'plugins/images/tabs/transmission.png',
  788. 'category' => 'Downloader',
  789. 'settings' => array(
  790. 'Enable' => array(
  791. array(
  792. 'type' => 'switch',
  793. 'name' => 'homepageTransmissionEnabled',
  794. 'label' => 'Enable',
  795. 'value' => $GLOBALS['homepageTransmissionEnabled']
  796. ),
  797. array(
  798. 'type' => 'select',
  799. 'name' => 'homepageTransmissionAuth',
  800. 'label' => 'Minimum Authentication',
  801. 'value' => $GLOBALS['homepageTransmissionAuth'],
  802. 'options' => $groups
  803. )
  804. ),
  805. 'Connection' => array(
  806. array(
  807. 'type' => 'input',
  808. 'name' => 'transmissionURL',
  809. 'label' => 'URL',
  810. 'value' => $GLOBALS['transmissionURL'],
  811. 'placeholder' => 'http(s)://hostname:port'
  812. ),
  813. array(
  814. 'type' => 'input',
  815. 'name' => 'transmissionUsername',
  816. 'label' => 'Username',
  817. 'value' => $GLOBALS['transmissionUsername']
  818. ),
  819. array(
  820. 'type' => 'password',
  821. 'name' => 'transmissionPassword',
  822. 'label' => 'Password',
  823. 'value' => $GLOBALS['transmissionPassword']
  824. )
  825. ),
  826. 'Misc Options' => array(
  827. array(
  828. 'type' => 'switch',
  829. 'name' => 'transmissionHideSeeding',
  830. 'label' => 'Hide Seeding',
  831. 'value' => $GLOBALS['transmissionHideSeeding']
  832. ),array(
  833. 'type' => 'switch',
  834. 'name' => 'transmissionHideCompleted',
  835. 'label' => 'Hide Completed',
  836. 'value' => $GLOBALS['transmissionHideCompleted']
  837. ),
  838. array(
  839. 'type' => 'select',
  840. 'name' => 'homepageDownloadRefresh',
  841. 'label' => 'Refresh Seconds',
  842. 'value' => $GLOBALS['homepageDownloadRefresh'],
  843. 'options' => $time
  844. )
  845. )
  846. )
  847. ),
  848. array(
  849. 'name' => 'qBittorrent',
  850. 'enabled' => false,
  851. 'image' => 'plugins/images/tabs/qBittorrent.png',
  852. 'category' => 'Downloader',
  853. 'settings' => array(
  854. 'Enable' => array(
  855. array(
  856. 'type' => 'switch',
  857. 'name' => 'homepageqBittorrentEnabled',
  858. 'label' => 'Enable',
  859. 'value' => $GLOBALS['homepageqBittorrentEnabled']
  860. ),
  861. array(
  862. 'type' => 'select',
  863. 'name' => 'homepageqBittorrentAuth',
  864. 'label' => 'Minimum Authentication',
  865. 'value' => $GLOBALS['homepageqBittorrentAuth'],
  866. 'options' => $groups
  867. )
  868. ),
  869. 'Connection' => array(
  870. array(
  871. 'type' => 'input',
  872. 'name' => 'qBittorrentURL',
  873. 'label' => 'URL',
  874. 'value' => $GLOBALS['qBittorrentURL'],
  875. 'placeholder' => 'http(s)://hostname:port'
  876. ),
  877. array(
  878. 'type' => 'input',
  879. 'name' => 'qBittorrentUsername',
  880. 'label' => 'Username',
  881. 'value' => $GLOBALS['qBittorrentUsername']
  882. ),
  883. array(
  884. 'type' => 'password',
  885. 'name' => 'qBittorrentPassword',
  886. 'label' => 'Password',
  887. 'value' => $GLOBALS['qBittorrentPassword']
  888. )
  889. ),
  890. 'Misc Options' => array(
  891. array(
  892. 'type' => 'switch',
  893. 'name' => 'qBittorrentHideSeeding',
  894. 'label' => 'Hide Seeding',
  895. 'value' => $GLOBALS['qBittorrentHideSeeding']
  896. ),array(
  897. 'type' => 'switch',
  898. 'name' => 'qBittorrentnHideCompleted',
  899. 'label' => 'Hide Completed',
  900. 'value' => $GLOBALS['qBittorrentHideCompleted']
  901. ),
  902. array(
  903. 'type' => 'select',
  904. 'name' => 'qBittorrentSortOrder',
  905. 'label' => 'Order',
  906. 'value' => $GLOBALS['qBittorrentSortOrder'],
  907. 'options' => $qBittorrentSortOptions
  908. ),array(
  909. 'type' => 'switch',
  910. 'name' => 'qBittorrentReverseSorting',
  911. 'label' => 'Reverse Sorting',
  912. 'value' => $GLOBALS['qBittorrentReverseSorting']
  913. ),
  914. array(
  915. 'type' => 'select',
  916. 'name' => 'homepageDownloadRefresh',
  917. 'label' => 'Refresh Seconds',
  918. 'value' => $GLOBALS['homepageDownloadRefresh'],
  919. 'options' => $time
  920. )
  921. )
  922. )
  923. ),
  924. array(
  925. 'name' => 'Deluge',
  926. 'enabled' => false,
  927. 'image' => 'plugins/images/tabs/deluge.png',
  928. 'category' => 'Downloader',
  929. 'settings' => array(
  930. 'custom' => '
  931. <div class="row">
  932. <div class="col-lg-12">
  933. <div class="panel panel-info">
  934. <div class="panel-heading">
  935. <span lang="en">Notice</span>
  936. </div>
  937. <div class="panel-wrapper collapse in" aria-expanded="true">
  938. <div class="panel-body">
  939. <ul class="list-icons">
  940. <li><i class="fa fa-chevron-right text-danger"></i> <a href="https://github.com/idlesign/deluge-webapi/raw/master/dist/WebAPI-0.2.0-py2.7.egg" target="_blank">Download Plugin</a></li>
  941. <li><i class="fa fa-chevron-right text-danger"></i> Open Deluge Web UI, go to "Preferences -> Plugins -> Install plugin" and choose egg file.</li>
  942. <li><i class="fa fa-chevron-right text-danger"></i> Activate WebAPI plugin </li>
  943. </ul>
  944. </div>
  945. </div>
  946. </div>
  947. </div>
  948. </div>
  949. ',
  950. 'Enable' => array(
  951. array(
  952. 'type' => 'switch',
  953. 'name' => 'homepageDelugeEnabled',
  954. 'label' => 'Enable',
  955. 'value' => $GLOBALS['homepageDelugeEnabled']
  956. ),
  957. array(
  958. 'type' => 'select',
  959. 'name' => 'homepageDelugeAuth',
  960. 'label' => 'Minimum Authentication',
  961. 'value' => $GLOBALS['homepageDelugeAuth'],
  962. 'options' => $groups
  963. )
  964. ),
  965. 'Connection' => array(
  966. array(
  967. 'type' => 'input',
  968. 'name' => 'delugeURL',
  969. 'label' => 'URL',
  970. 'value' => $GLOBALS['delugeURL'],
  971. 'placeholder' => 'http(s)://hostname:port'
  972. ),
  973. array(
  974. 'type' => 'password',
  975. 'name' => 'delugePassword',
  976. 'label' => 'Password',
  977. 'value' => $GLOBALS['delugePassword']
  978. )
  979. ),
  980. 'Misc Options' => array(
  981. array(
  982. 'type' => 'switch',
  983. 'name' => 'delugeHideSeeding',
  984. 'label' => 'Hide Seeding',
  985. 'value' => $GLOBALS['delugeHideSeeding']
  986. ),array(
  987. 'type' => 'switch',
  988. 'name' => 'delugeHideCompleted',
  989. 'label' => 'Hide Completed',
  990. 'value' => $GLOBALS['delugeHideCompleted']
  991. ),
  992. array(
  993. 'type' => 'select',
  994. 'name' => 'homepageDownloadRefresh',
  995. 'label' => 'Refresh Seconds',
  996. 'value' => $GLOBALS['homepageDownloadRefresh'],
  997. 'options' => $time
  998. )
  999. )
  1000. )
  1001. ),
  1002. array(
  1003. 'name' => 'Sonarr',
  1004. 'enabled' => false,
  1005. 'image' => 'plugins/images/tabs/sonarr.png',
  1006. 'category' => 'PVR',
  1007. 'settings' => array(
  1008. 'Enable' => array(
  1009. array(
  1010. 'type' => 'switch',
  1011. 'name' => 'homepageSonarrEnabled',
  1012. 'label' => 'Enable',
  1013. 'value' => $GLOBALS['homepageSonarrEnabled']
  1014. ),
  1015. array(
  1016. 'type' => 'select',
  1017. 'name' => 'homepageSonarrAuth',
  1018. 'label' => 'Minimum Authentication',
  1019. 'value' => $GLOBALS['homepageSonarrAuth'],
  1020. 'options' => $groups
  1021. )
  1022. ),
  1023. 'Connection' => array(
  1024. array(
  1025. 'type' => 'input',
  1026. 'name' => 'sonarrURL',
  1027. 'label' => 'URL',
  1028. 'value' => $GLOBALS['sonarrURL'],
  1029. 'placeholder' => 'http(s)://hostname:port'
  1030. ),
  1031. array(
  1032. 'type' => 'password-alt',
  1033. 'name' => 'sonarrToken',
  1034. 'label' => 'Token',
  1035. 'value' => $GLOBALS['sonarrToken']
  1036. )
  1037. ),
  1038. 'Misc Options' => array(
  1039. array(
  1040. 'type' => 'input',
  1041. 'name' => 'calendarStart',
  1042. 'label' => '# of Days Before',
  1043. 'value' => $GLOBALS['calendarStart'],
  1044. 'placeholder' => ''
  1045. ),
  1046. array(
  1047. 'type' => 'input',
  1048. 'name' => 'calendarEnd',
  1049. 'label' => '# of Days After',
  1050. 'value' => $GLOBALS['calendarEnd'],
  1051. 'placeholder' => ''
  1052. ),
  1053. array(
  1054. 'type' => 'select',
  1055. 'name' => 'calendarFirstDay',
  1056. 'label' => 'Start Day',
  1057. 'value' => $GLOBALS['calendarFirstDay'],
  1058. 'options' => $day
  1059. ),
  1060. array(
  1061. 'type' => 'select',
  1062. 'name' => 'calendarDefault',
  1063. 'label' => 'Default View',
  1064. 'value' => $GLOBALS['calendarDefault'],
  1065. 'options' => $calendarDefault
  1066. ),
  1067. array(
  1068. 'type' => 'select',
  1069. 'name' => 'calendarTimeFormat',
  1070. 'label' => 'Time Format',
  1071. 'value' => $GLOBALS['calendarTimeFormat'],
  1072. 'options' => $timeFormat
  1073. ),
  1074. array(
  1075. 'type' => 'select',
  1076. 'name' => 'calendarLimit',
  1077. 'label' => 'Items Per Day',
  1078. 'value' => $GLOBALS['calendarLimit'],
  1079. 'options' => $limit
  1080. ),
  1081. array(
  1082. 'type' => 'select',
  1083. 'name' => 'calendarRefresh',
  1084. 'label' => 'Refresh Seconds',
  1085. 'value' => $GLOBALS['calendarRefresh'],
  1086. 'options' => $time
  1087. )
  1088. )
  1089. )
  1090. ),
  1091. array(
  1092. 'name' => 'Radarr',
  1093. 'enabled' => false,
  1094. 'image' => 'plugins/images/tabs/radarr.png',
  1095. 'category' => 'PVR',
  1096. 'settings' => array(
  1097. 'Enable' => array(
  1098. array(
  1099. 'type' => 'switch',
  1100. 'name' => 'homepageRadarrEnabled',
  1101. 'label' => 'Enable',
  1102. 'value' => $GLOBALS['homepageRadarrEnabled']
  1103. ),
  1104. array(
  1105. 'type' => 'select',
  1106. 'name' => 'homepageRadarrAuth',
  1107. 'label' => 'Minimum Authentication',
  1108. 'value' => $GLOBALS['homepageRadarrAuth'],
  1109. 'options' => $groups
  1110. )
  1111. ),
  1112. 'Connection' => array(
  1113. array(
  1114. 'type' => 'input',
  1115. 'name' => 'radarrURL',
  1116. 'label' => 'URL',
  1117. 'value' => $GLOBALS['radarrURL'],
  1118. 'placeholder' => 'http(s)://hostname:port'
  1119. ),
  1120. array(
  1121. 'type' => 'password-alt',
  1122. 'name' => 'radarrToken',
  1123. 'label' => 'Token',
  1124. 'value' => $GLOBALS['radarrToken']
  1125. )
  1126. ),
  1127. 'Misc Options' => array(
  1128. array(
  1129. 'type' => 'input',
  1130. 'name' => 'calendarStart',
  1131. 'label' => '# of Days Before',
  1132. 'value' => $GLOBALS['calendarStart'],
  1133. 'placeholder' => ''
  1134. ),
  1135. array(
  1136. 'type' => 'input',
  1137. 'name' => 'calendarEnd',
  1138. 'label' => '# of Days After',
  1139. 'value' => $GLOBALS['calendarEnd'],
  1140. 'placeholder' => ''
  1141. ),
  1142. array(
  1143. 'type' => 'select',
  1144. 'name' => 'calendarFirstDay',
  1145. 'label' => 'Start Day',
  1146. 'value' => $GLOBALS['calendarFirstDay'],
  1147. 'options' => $day
  1148. ),
  1149. array(
  1150. 'type' => 'select',
  1151. 'name' => 'calendarDefault',
  1152. 'label' => 'Default View',
  1153. 'value' => $GLOBALS['calendarDefault'],
  1154. 'options' => $calendarDefault
  1155. ),
  1156. array(
  1157. 'type' => 'select',
  1158. 'name' => 'calendarTimeFormat',
  1159. 'label' => 'Time Format',
  1160. 'value' => $GLOBALS['calendarTimeFormat'],
  1161. 'options' => $timeFormat
  1162. ),
  1163. array(
  1164. 'type' => 'select',
  1165. 'name' => 'calendarLimit',
  1166. 'label' => 'Items Per Day',
  1167. 'value' => $GLOBALS['calendarLimit'],
  1168. 'options' => $limit
  1169. ),
  1170. array(
  1171. 'type' => 'select',
  1172. 'name' => 'calendarRefresh',
  1173. 'label' => 'Refresh Seconds',
  1174. 'value' => $GLOBALS['calendarRefresh'],
  1175. 'options' => $time
  1176. )
  1177. )
  1178. )
  1179. ),
  1180. array(
  1181. 'name' => 'CouchPotato',
  1182. 'enabled' => false,
  1183. 'image' => 'plugins/images/tabs/couchpotato.png',
  1184. 'category' => 'PVR',
  1185. 'settings' => array(
  1186. 'Enable' => array(
  1187. array(
  1188. 'type' => 'switch',
  1189. 'name' => 'homepageCouchpotatoEnabled',
  1190. 'label' => 'Enable',
  1191. 'value' => $GLOBALS['homepageCouchpotatoEnabled']
  1192. ),
  1193. array(
  1194. 'type' => 'select',
  1195. 'name' => 'homepageCouchpotatoAuth',
  1196. 'label' => 'Minimum Authentication',
  1197. 'value' => $GLOBALS['homepageCouchpotatoAuth'],
  1198. 'options' => $groups
  1199. )
  1200. ),
  1201. 'Connection' => array(
  1202. array(
  1203. 'type' => 'input',
  1204. 'name' => 'couchpotatoURL',
  1205. 'label' => 'URL',
  1206. 'value' => $GLOBALS['couchpotatoURL'],
  1207. 'placeholder' => 'http(s)://hostname:port'
  1208. ),
  1209. array(
  1210. 'type' => 'password-alt',
  1211. 'name' => 'couchpotatoToken',
  1212. 'label' => 'Token',
  1213. 'value' => $GLOBALS['couchpotatoToken']
  1214. )
  1215. ),
  1216. 'Misc Options' => array(
  1217. array(
  1218. 'type' => 'select',
  1219. 'name' => 'calendarFirstDay',
  1220. 'label' => 'Start Day',
  1221. 'value' => $GLOBALS['calendarFirstDay'],
  1222. 'options' => $day
  1223. ),
  1224. array(
  1225. 'type' => 'select',
  1226. 'name' => 'calendarDefault',
  1227. 'label' => 'Default View',
  1228. 'value' => $GLOBALS['calendarDefault'],
  1229. 'options' => $calendarDefault
  1230. ),
  1231. array(
  1232. 'type' => 'select',
  1233. 'name' => 'calendarTimeFormat',
  1234. 'label' => 'Time Format',
  1235. 'value' => $GLOBALS['calendarTimeFormat'],
  1236. 'options' => $timeFormat
  1237. ),
  1238. array(
  1239. 'type' => 'select',
  1240. 'name' => 'calendarLimit',
  1241. 'label' => 'Items Per Day',
  1242. 'value' => $GLOBALS['calendarLimit'],
  1243. 'options' => $limit
  1244. ),
  1245. array(
  1246. 'type' => 'select',
  1247. 'name' => 'calendarRefresh',
  1248. 'label' => 'Refresh Seconds',
  1249. 'value' => $GLOBALS['calendarRefresh'],
  1250. 'options' => $time
  1251. )
  1252. )
  1253. )
  1254. ),
  1255. array(
  1256. 'name' => 'SickRage',
  1257. 'enabled' => false,
  1258. 'image' => 'plugins/images/tabs/sickrage.png',
  1259. 'category' => 'PVR',
  1260. 'settings' => array(
  1261. 'Enable' => array(
  1262. array(
  1263. 'type' => 'switch',
  1264. 'name' => 'homepageSickrageEnabled',
  1265. 'label' => 'Enable',
  1266. 'value' => $GLOBALS['homepageSickrageEnabled']
  1267. ),
  1268. array(
  1269. 'type' => 'select',
  1270. 'name' => 'homepageSickrageAuth',
  1271. 'label' => 'Minimum Authentication',
  1272. 'value' => $GLOBALS['homepageSickrageAuth'],
  1273. 'options' => $groups
  1274. )
  1275. ),
  1276. 'Connection' => array(
  1277. array(
  1278. 'type' => 'input',
  1279. 'name' => 'sickrageURL',
  1280. 'label' => 'URL',
  1281. 'value' => $GLOBALS['sickrageURL'],
  1282. 'placeholder' => 'http(s)://hostname:port'
  1283. ),
  1284. array(
  1285. 'type' => 'password-alt',
  1286. 'name' => 'sickrageToken',
  1287. 'label' => 'Token',
  1288. 'value' => $GLOBALS['sickrageToken']
  1289. )
  1290. ),
  1291. 'Misc Options' => array(
  1292. array(
  1293. 'type' => 'select',
  1294. 'name' => 'calendarFirstDay',
  1295. 'label' => 'Start Day',
  1296. 'value' => $GLOBALS['calendarFirstDay'],
  1297. 'options' => $day
  1298. ),
  1299. array(
  1300. 'type' => 'select',
  1301. 'name' => 'calendarDefault',
  1302. 'label' => 'Default View',
  1303. 'value' => $GLOBALS['calendarDefault'],
  1304. 'options' => $calendarDefault
  1305. ),
  1306. array(
  1307. 'type' => 'select',
  1308. 'name' => 'calendarTimeFormat',
  1309. 'label' => 'Time Format',
  1310. 'value' => $GLOBALS['calendarTimeFormat'],
  1311. 'options' => $timeFormat
  1312. ),
  1313. array(
  1314. 'type' => 'select',
  1315. 'name' => 'calendarLimit',
  1316. 'label' => 'Items Per Day',
  1317. 'value' => $GLOBALS['calendarLimit'],
  1318. 'options' => $limit
  1319. ),
  1320. array(
  1321. 'type' => 'select',
  1322. 'name' => 'calendarRefresh',
  1323. 'label' => 'Refresh Seconds',
  1324. 'value' => $GLOBALS['calendarRefresh'],
  1325. 'options' => $time
  1326. )
  1327. )
  1328. )
  1329. ),
  1330. array(
  1331. 'name' => 'Ombi',
  1332. 'enabled' => false,
  1333. 'image' => 'plugins/images/tabs/ombi.png',
  1334. 'category' => 'Requests',
  1335. 'settings' => array(
  1336. 'Enable' => array(
  1337. array(
  1338. 'type' => 'switch',
  1339. 'name' => 'homepageOmbiEnabled',
  1340. 'label' => 'Enable',
  1341. 'value' => $GLOBALS['homepageOmbiEnabled']
  1342. ),
  1343. array(
  1344. 'type' => 'select',
  1345. 'name' => 'homepageOmbiAuth',
  1346. 'label' => 'Minimum Authentication',
  1347. 'value' => $GLOBALS['homepageOmbiAuth'],
  1348. 'options' => $groups
  1349. )
  1350. ),
  1351. 'Connection' => array(
  1352. array(
  1353. 'type' => 'input',
  1354. 'name' => 'ombiURL',
  1355. 'label' => 'URL',
  1356. 'value' => $GLOBALS['ombiURL'],
  1357. 'placeholder' => 'http(s)://hostname:port'
  1358. ),
  1359. array(
  1360. 'type' => 'password-alt',
  1361. 'name' => 'ombiToken',
  1362. 'label' => 'Token',
  1363. 'value' => $GLOBALS['ombiToken']
  1364. )
  1365. ),
  1366. 'Misc Options' => array(
  1367. array(
  1368. 'type' => 'switch',
  1369. 'name' => 'ombiLimitUser',
  1370. 'label' => 'Limit to User',
  1371. 'value' => $GLOBALS['ombiLimitUser']
  1372. ),
  1373. array(
  1374. 'type' => 'select',
  1375. 'name' => 'ombiRefresh',
  1376. 'label' => 'Refresh Seconds',
  1377. 'value' => $GLOBALS['ombiRefresh'],
  1378. 'options' => $time
  1379. )
  1380. )
  1381. )
  1382. ),
  1383. array(
  1384. 'name' => 'CustomHTML-1',
  1385. 'enabled' => false,
  1386. 'image' => 'plugins/images/tabs/custom1.png',
  1387. 'category' => 'Custom',
  1388. 'settings' => array(
  1389. 'Enable' => array(
  1390. array(
  1391. 'type' => 'switch',
  1392. 'name' => 'homepagCustomHTMLoneEnabled',
  1393. 'label' => 'Enable',
  1394. 'value' => $GLOBALS['homepagCustomHTMLoneEnabled']
  1395. ),
  1396. array(
  1397. 'type' => 'select',
  1398. 'name' => 'homepagCustomHTMLoneAuth',
  1399. 'label' => 'Minimum Authentication',
  1400. 'value' => $GLOBALS['homepagCustomHTMLoneAuth'],
  1401. 'options' => $groups
  1402. )
  1403. ),
  1404. 'Code' => array(
  1405. array(
  1406. 'type' => 'textbox',
  1407. 'name' => 'customHTMLone',
  1408. 'class' => 'hidden customHTMLoneTextarea',
  1409. 'label' => '',
  1410. 'value' => $GLOBALS['customHTMLone'],
  1411. ),
  1412. array(
  1413. 'type' => 'html',
  1414. 'override' => 12,
  1415. 'label' => 'Custom HTML/JavaScript',
  1416. 'html' => '<button type="button" class="hidden savecustomHTMLoneTextarea btn btn-info btn-circle pull-right m-r-5 m-l-10"><i class="fa fa-save"></i> </button><div id="customHTMLoneEditor" style="height:300px">'.htmlentities($GLOBALS['customHTMLone']).'</div>'
  1417. ),
  1418. )
  1419. )
  1420. ),
  1421. array(
  1422. 'name' => 'CustomHTML-2',
  1423. 'enabled' => false,
  1424. 'image' => 'plugins/images/tabs/custom2.png',
  1425. 'category' => 'Custom',
  1426. 'settings' => array(
  1427. 'Enable' => array(
  1428. array(
  1429. 'type' => 'switch',
  1430. 'name' => 'homepagCustomHTMLtwoEnabled',
  1431. 'label' => 'Enable',
  1432. 'value' => $GLOBALS['homepagCustomHTMLtwoEnabled']
  1433. ),
  1434. array(
  1435. 'type' => 'select',
  1436. 'name' => 'homepagCustomHTMLtwoAuth',
  1437. 'label' => 'Minimum Authentication',
  1438. 'value' => $GLOBALS['homepagCustomHTMLtwoAuth'],
  1439. 'options' => $groups
  1440. )
  1441. ),
  1442. 'Code' => array(
  1443. array(
  1444. 'type' => 'textbox',
  1445. 'name' => 'customHTMLtwo',
  1446. 'class' => 'hidden customHTMLtwoTextarea',
  1447. 'label' => '',
  1448. 'value' => $GLOBALS['customHTMLtwo'],
  1449. ),
  1450. array(
  1451. 'type' => 'html',
  1452. 'override' => 12,
  1453. 'label' => 'Custom HTML/JavaScript',
  1454. 'html' => '<button type="button" class="hidden savecustomHTMLtwoTextarea btn btn-info btn-circle pull-right m-r-5 m-l-10"><i class="fa fa-save"></i> </button><div id="customHTMLtwoEditor" style="height:300px">'.htmlentities($GLOBALS['customHTMLtwo']).'</div>'
  1455. ),
  1456. )
  1457. )
  1458. )
  1459. );
  1460. }
  1461. function buildHomepageSettings(){
  1462. $homepageOrder = homepageOrder();
  1463. $homepageList = '<h4>Drag Homepage Items to Order Them</h4><div id="homepage-items" class="external-events">';
  1464. $inputList = '<form id="homepage-values" class="row">';
  1465. foreach ($homepageOrder as $key => $val) {
  1466. switch ($key) {
  1467. case 'homepageOrdercustomhtml':
  1468. $class = 'bg-info';
  1469. $image = 'plugins/images/tabs/custom1.png';
  1470. if(!$GLOBALS['homepagCustomHTMLoneEnabled']){
  1471. $class .= ' faded';
  1472. }
  1473. break;
  1474. case 'homepageOrdercustomhtmlTwo':
  1475. $class = 'bg-info';
  1476. $image = 'plugins/images/tabs/custom2.png';
  1477. if(!$GLOBALS['homepagCustomHTMLtwoEnabled']){
  1478. $class .= ' faded';
  1479. }
  1480. break;
  1481. case 'homepageOrdertransmission':
  1482. $class = 'bg-transmission';
  1483. $image = 'plugins/images/tabs/transmission.png';
  1484. if(!$GLOBALS['homepageTransmissionEnabled']){
  1485. $class .= ' faded';
  1486. }
  1487. break;
  1488. case 'homepageOrdernzbget':
  1489. $class = 'bg-nzbget';
  1490. $image = 'plugins/images/tabs/nzbget.png';
  1491. if(!$GLOBALS['homepageNzbgetEnabled']){
  1492. $class .= ' faded';
  1493. }
  1494. break;
  1495. case 'homepageOrdersabnzbd':
  1496. $class = 'bg-sab';
  1497. $image = 'plugins/images/tabs/sabnzbd.png';
  1498. if(!$GLOBALS['homepageSabnzbdEnabled']){
  1499. $class .= ' faded';
  1500. }
  1501. break;
  1502. case 'homepageOrderdeluge':
  1503. $class = 'bg-deluge';
  1504. $image = 'plugins/images/tabs/deluge.png';
  1505. if(!$GLOBALS['homepageDelugeEnabled']){
  1506. $class .= ' faded';
  1507. }
  1508. break;
  1509. case 'homepageOrderqBittorrent':
  1510. $class = 'bg-qbit';
  1511. $image = 'plugins/images/tabs/qBittorrent.png';
  1512. if(!$GLOBALS['homepageqBittorrentEnabled']){
  1513. $class .= ' faded';
  1514. }
  1515. break;
  1516. case 'homepageOrderplexnowplaying':
  1517. case 'homepageOrderplexrecent':
  1518. case 'homepageOrderplexplaylist':
  1519. $class = 'bg-plex';
  1520. $image = 'plugins/images/tabs/plex.png';
  1521. if(!$GLOBALS['homepagePlexEnabled']){
  1522. $class .= ' faded';
  1523. }
  1524. break;
  1525. case 'homepageOrderembynowplaying':
  1526. case 'homepageOrderembyrecent':
  1527. $class = 'bg-emby';
  1528. $image = 'plugins/images/tabs/emby.png';
  1529. if(!$GLOBALS['homepageEmbyEnabled']){
  1530. $class .= ' faded';
  1531. }
  1532. break;
  1533. case 'homepageOrderombi':
  1534. $class = 'bg-inverse';
  1535. $image = 'plugins/images/tabs/ombi.png';
  1536. if(!$GLOBALS['homepageOmbiEnabled']){
  1537. $class .= ' faded';
  1538. }
  1539. break;
  1540. case 'homepageOrdercalendar':
  1541. $class = 'bg-primary';
  1542. $image = 'plugins/images/tabs/calendar.png';
  1543. if(!$GLOBALS['homepageSonarrEnabled'] && !$GLOBALS['homepageRadarrEnabled'] && !$GLOBALS['homepageSickrageEnabled'] && !$GLOBALS['homepageCouchpotatoEnabled']){
  1544. $class .= ' faded';
  1545. }
  1546. break;
  1547. default:
  1548. $class = 'blue-bg';
  1549. $image = '';
  1550. break;
  1551. }
  1552. $homepageList .= '
  1553. <div class="col-md-3 sort-homepage m-t-10 hvr-grow">
  1554. <div class="homepage-drag fc-event '.$class.' lazyload" data-src="'.$image.'">
  1555. <span class="ordinal-position text-uppercase badge bg-org homepage-number" data-link="'.$key.'" style="float:left;width: 30px;">'.$val.'</span>
  1556. <span class="homepage-text">&nbsp; '.strtoupper(substr($key, 13)).'</span>
  1557. </div>
  1558. </div>
  1559. <!--
  1560. <div class="col-lg-2 col-md-2 col-sm-4 col-xs-4 sort-homepage m-b-10">
  1561. <div class="white-box bg-org '.$class.'">
  1562. <div class="el-card-item p-0">
  1563. <div class="el-card-avatar el-overlay-1 m-0">
  1564. <img class="lazyload loaded" data-src="'.$image.'">
  1565. </div>
  1566. <div class="el-card-content">
  1567. <h3 class="box-title">'.strtoupper(substr($key, 13)).'</h3>
  1568. <small class="elip ordinal-position text-uppercase p-b-10" data-link="'.$key.'">'.$val.'</small>
  1569. </div>
  1570. </div>
  1571. </div>
  1572. </div>
  1573. -->
  1574. ';
  1575. $inputList .= '<input type="hidden" name="'.$key.'">';
  1576. }
  1577. $homepageList .= '</div>';
  1578. $inputList .= '</form>';
  1579. return $homepageList.$inputList;
  1580. }