4
0

homepage-functions.php 44 KB

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