homepage-functions.php 44 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664
  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' => 'select',
  521. 'name' => 'homepageRecentRefresh',
  522. 'label' => 'Refresh Seconds',
  523. 'value' => $GLOBALS['homepageRecentRefresh'],
  524. 'options' => $time
  525. ),
  526. ),
  527. 'Media Search' => array(
  528. array(
  529. 'type' => 'switch',
  530. 'name' => 'mediaSearch',
  531. 'label' => 'Enable',
  532. 'value' => $GLOBALS['mediaSearch']
  533. ),
  534. array(
  535. 'type' => 'select',
  536. 'name' => 'mediaSearchAuth',
  537. 'label' => 'Minimum Authorization',
  538. 'value' => $GLOBALS['mediaSearchAuth'],
  539. 'options' => $groups
  540. ),
  541. array(
  542. 'type' => 'select',
  543. 'name' => 'mediaSearchType',
  544. 'label' => 'Media Server',
  545. 'value' => $GLOBALS['mediaSearchType'],
  546. 'options' => $mediaServers
  547. ),
  548. ),
  549. 'Playlists' => array(
  550. array(
  551. 'type' => 'switch',
  552. 'name' => 'homepagePlexPlaylist',
  553. 'label' => 'Enable',
  554. 'value' => $GLOBALS['homepagePlexPlaylist']
  555. ),
  556. array(
  557. 'type' => 'select',
  558. 'name' => 'homepagePlexPlaylistAuth',
  559. 'label' => 'Minimum Authorization',
  560. 'value' => $GLOBALS['homepagePlexPlaylistAuth'],
  561. 'options' => $groups
  562. ),
  563. ),
  564. 'Misc Options' => array(
  565. array(
  566. 'type' => 'input',
  567. 'name' => 'plexTabName',
  568. 'label' => 'Plex Tab Name',
  569. 'value' => $GLOBALS['plexTabName'],
  570. 'placeholder' => 'Only use if you have Plex in a reverse proxy'
  571. ),
  572. array(
  573. 'type' => 'input',
  574. 'name' => 'plexTabURL',
  575. 'label' => 'Plex Tab WAN URL',
  576. 'value' => $GLOBALS['plexTabURL'],
  577. 'placeholder' => 'http(s)://hostname:port'
  578. )
  579. ),
  580. 'Test Connection' => array(
  581. array(
  582. 'type' => 'blank',
  583. 'label' => ''
  584. ),
  585. array(
  586. 'type' => 'button',
  587. 'label' => '',
  588. 'icon' => 'fa fa-flask',
  589. 'class' => 'pull-right',
  590. 'text' => 'Test Connection',
  591. 'attr' => 'onclick="testAPIConnection(\'plex\')"'
  592. ),
  593. )
  594. )
  595. ),
  596. array(
  597. 'name' => 'Emby',
  598. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  599. 'image' => 'plugins/images/tabs/emby.png',
  600. 'category' => 'Media Server',
  601. 'settings' => array(
  602. 'Enable' => array(
  603. array(
  604. 'type' => 'switch',
  605. 'name' => 'homepageEmbyEnabled',
  606. 'label' => 'Enable',
  607. 'value' => $GLOBALS['homepageEmbyEnabled']
  608. ),
  609. array(
  610. 'type' => 'select',
  611. 'name' => 'homepageEmbyAuth',
  612. 'label' => 'Minimum Authentication',
  613. 'value' => $GLOBALS['homepageEmbyAuth'],
  614. 'options' => $groups
  615. )
  616. ),
  617. 'Connection' => array(
  618. array(
  619. 'type' => 'input',
  620. 'name' => 'embyURL',
  621. 'label' => 'URL',
  622. 'value' => $GLOBALS['embyURL'],
  623. 'placeholder' => 'http(s)://hostname:port'
  624. ),
  625. array(
  626. 'type' => 'password-alt',
  627. 'name' => 'embyToken',
  628. 'label' => 'Token',
  629. 'value' => $GLOBALS['embyToken']
  630. )
  631. ),
  632. 'Active Streams' => array(
  633. array(
  634. 'type' => 'switch',
  635. 'name' => 'homepageEmbyStreams',
  636. 'label' => 'Enable',
  637. 'value' => $GLOBALS['homepageEmbyStreams']
  638. ),
  639. array(
  640. 'type' => 'select',
  641. 'name' => 'homepageEmbyStreamsAuth',
  642. 'label' => 'Minimum Authorization',
  643. 'value' => $GLOBALS['homepageEmbyStreamsAuth'],
  644. 'options' => $groups
  645. ),
  646. array(
  647. 'type' => 'switch',
  648. 'name' => 'homepageShowStreamNames',
  649. 'label' => 'User Information',
  650. 'value' => $GLOBALS['homepageShowStreamNames']
  651. ),
  652. array(
  653. 'type' => 'select',
  654. 'name' => 'homepageShowStreamNamesAuth',
  655. 'label' => 'Minimum Authorization',
  656. 'value' => $GLOBALS['homepageShowStreamNamesAuth'],
  657. 'options' => $groups
  658. ),
  659. array(
  660. 'type' => 'select',
  661. 'name' => 'homepageStreamRefresh',
  662. 'label' => 'Refresh Seconds',
  663. 'value' => $GLOBALS['homepageStreamRefresh'],
  664. 'options' => $time
  665. ),
  666. ),
  667. 'Recent Items' => array(
  668. array(
  669. 'type' => 'switch',
  670. 'name' => 'homepageEmbyRecent',
  671. 'label' => 'Enable',
  672. 'value' => $GLOBALS['homepageEmbyRecent']
  673. ),
  674. array(
  675. 'type' => 'select',
  676. 'name' => 'homepageEmbyRecentAuth',
  677. 'label' => 'Minimum Authorization',
  678. 'value' => $GLOBALS['homepageEmbyRecentAuth'],
  679. 'options' => $groups
  680. ),
  681. array(
  682. 'type' => 'select',
  683. 'name' => 'homepageRecentRefresh',
  684. 'label' => 'Refresh Seconds',
  685. 'value' => $GLOBALS['homepageRecentRefresh'],
  686. 'options' => $time
  687. ),
  688. ),
  689. 'Misc Options' => array(
  690. array(
  691. 'type' => 'input',
  692. 'name' => 'embyTabName',
  693. 'label' => 'Emby Tab Name',
  694. 'value' => $GLOBALS['embyTabName'],
  695. 'placeholder' => 'Only use if you have Emby in a reverse proxy'
  696. ),
  697. array(
  698. 'type' => 'input',
  699. 'name' => 'embyTabURL',
  700. 'label' => 'Emby Tab WAN URL',
  701. 'value' => $GLOBALS['embyTabURL'],
  702. 'placeholder' => 'http(s)://hostname:port'
  703. )
  704. )
  705. )
  706. ),
  707. array(
  708. 'name' => 'SabNZBD',
  709. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  710. 'image' => 'plugins/images/tabs/sabnzbd.png',
  711. 'category' => 'Downloader',
  712. 'settings' => array(
  713. 'Enable' => array(
  714. array(
  715. 'type' => 'switch',
  716. 'name' => 'homepageSabnzbdEnabled',
  717. 'label' => 'Enable',
  718. 'value' => $GLOBALS['homepageSabnzbdEnabled']
  719. ),
  720. array(
  721. 'type' => 'select',
  722. 'name' => 'homepageSabnzbdAuth',
  723. 'label' => 'Minimum Authentication',
  724. 'value' => $GLOBALS['homepageSabnzbdAuth'],
  725. 'options' => $groups
  726. )
  727. ),
  728. 'Connection' => array(
  729. array(
  730. 'type' => 'input',
  731. 'name' => 'sabnzbdURL',
  732. 'label' => 'URL',
  733. 'value' => $GLOBALS['sabnzbdURL'],
  734. 'placeholder' => 'http(s)://hostname:port'
  735. ),
  736. array(
  737. 'type' => 'password-alt',
  738. 'name' => 'sabnzbdToken',
  739. 'label' => 'Token',
  740. 'value' => $GLOBALS['sabnzbdToken']
  741. )
  742. ),
  743. 'Misc Options' => array(
  744. array(
  745. 'type' => 'select',
  746. 'name' => 'homepageDownloadRefresh',
  747. 'label' => 'Refresh Seconds',
  748. 'value' => $GLOBALS['homepageDownloadRefresh'],
  749. 'options' => $time
  750. )
  751. ),
  752. 'Test Connection' => array(
  753. array(
  754. 'type' => 'blank',
  755. 'label' => ''
  756. ),
  757. array(
  758. 'type' => 'button',
  759. 'label' => '',
  760. 'icon' => 'fa fa-flask',
  761. 'class' => 'pull-right',
  762. 'text' => 'Test Connection',
  763. 'attr' => 'onclick="testAPIConnection(\'sabnzbd\')"'
  764. ),
  765. )
  766. )
  767. ),
  768. array(
  769. 'name' => 'NZBGet',
  770. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  771. 'image' => 'plugins/images/tabs/nzbget.png',
  772. 'category' => 'Downloader',
  773. 'settings' => array(
  774. 'Enable' => array(
  775. array(
  776. 'type' => 'switch',
  777. 'name' => 'homepageNzbgetEnabled',
  778. 'label' => 'Enable',
  779. 'value' => $GLOBALS['homepageNzbgetEnabled']
  780. ),
  781. array(
  782. 'type' => 'select',
  783. 'name' => 'homepageNzbgetAuth',
  784. 'label' => 'Minimum Authentication',
  785. 'value' => $GLOBALS['homepageNzbgetAuth'],
  786. 'options' => $groups
  787. )
  788. ),
  789. 'Connection' => array(
  790. array(
  791. 'type' => 'input',
  792. 'name' => 'nzbgetURL',
  793. 'label' => 'URL',
  794. 'value' => $GLOBALS['nzbgetURL'],
  795. 'placeholder' => 'http(s)://hostname:port'
  796. ),
  797. array(
  798. 'type' => 'input',
  799. 'name' => 'nzbgetUsername',
  800. 'label' => 'Username',
  801. 'value' => $GLOBALS['nzbgetUsername']
  802. ),
  803. array(
  804. 'type' => 'password',
  805. 'name' => 'nzbgetPassword',
  806. 'label' => 'Password',
  807. 'value' => $GLOBALS['nzbgetPassword']
  808. )
  809. ),
  810. 'Misc Options' => array(
  811. array(
  812. 'type' => 'select',
  813. 'name' => 'homepageDownloadRefresh',
  814. 'label' => 'Refresh Seconds',
  815. 'value' => $GLOBALS['homepageDownloadRefresh'],
  816. 'options' => $time
  817. )
  818. ),
  819. 'Test Connection' => array(
  820. array(
  821. 'type' => 'blank',
  822. 'label' => ''
  823. ),
  824. array(
  825. 'type' => 'button',
  826. 'label' => '',
  827. 'icon' => 'fa fa-flask',
  828. 'class' => 'pull-right',
  829. 'text' => 'Test Connection',
  830. 'attr' => 'onclick="testAPIConnection(\'nzbget\')"'
  831. ),
  832. )
  833. )
  834. ),
  835. array(
  836. 'name' => 'Transmission',
  837. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  838. 'image' => 'plugins/images/tabs/transmission.png',
  839. 'category' => 'Downloader',
  840. 'settings' => array(
  841. 'Enable' => array(
  842. array(
  843. 'type' => 'switch',
  844. 'name' => 'homepageTransmissionEnabled',
  845. 'label' => 'Enable',
  846. 'value' => $GLOBALS['homepageTransmissionEnabled']
  847. ),
  848. array(
  849. 'type' => 'select',
  850. 'name' => 'homepageTransmissionAuth',
  851. 'label' => 'Minimum Authentication',
  852. 'value' => $GLOBALS['homepageTransmissionAuth'],
  853. 'options' => $groups
  854. )
  855. ),
  856. 'Connection' => array(
  857. array(
  858. 'type' => 'input',
  859. 'name' => 'transmissionURL',
  860. 'label' => 'URL',
  861. 'value' => $GLOBALS['transmissionURL'],
  862. 'placeholder' => 'http(s)://hostname:port'
  863. ),
  864. array(
  865. 'type' => 'input',
  866. 'name' => 'transmissionUsername',
  867. 'label' => 'Username',
  868. 'value' => $GLOBALS['transmissionUsername']
  869. ),
  870. array(
  871. 'type' => 'password',
  872. 'name' => 'transmissionPassword',
  873. 'label' => 'Password',
  874. 'value' => $GLOBALS['transmissionPassword']
  875. )
  876. ),
  877. 'Misc Options' => array(
  878. array(
  879. 'type' => 'switch',
  880. 'name' => 'transmissionHideSeeding',
  881. 'label' => 'Hide Seeding',
  882. 'value' => $GLOBALS['transmissionHideSeeding']
  883. ), array(
  884. 'type' => 'switch',
  885. 'name' => 'transmissionHideCompleted',
  886. 'label' => 'Hide Completed',
  887. 'value' => $GLOBALS['transmissionHideCompleted']
  888. ),
  889. array(
  890. 'type' => 'select',
  891. 'name' => 'homepageDownloadRefresh',
  892. 'label' => 'Refresh Seconds',
  893. 'value' => $GLOBALS['homepageDownloadRefresh'],
  894. 'options' => $time
  895. )
  896. )
  897. )
  898. ),
  899. array(
  900. 'name' => 'qBittorrent',
  901. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  902. 'image' => 'plugins/images/tabs/qBittorrent.png',
  903. 'category' => 'Downloader',
  904. 'settings' => array(
  905. 'Enable' => array(
  906. array(
  907. 'type' => 'switch',
  908. 'name' => 'homepageqBittorrentEnabled',
  909. 'label' => 'Enable',
  910. 'value' => $GLOBALS['homepageqBittorrentEnabled']
  911. ),
  912. array(
  913. 'type' => 'select',
  914. 'name' => 'homepageqBittorrentAuth',
  915. 'label' => 'Minimum Authentication',
  916. 'value' => $GLOBALS['homepageqBittorrentAuth'],
  917. 'options' => $groups
  918. )
  919. ),
  920. 'Connection' => array(
  921. array(
  922. 'type' => 'input',
  923. 'name' => 'qBittorrentURL',
  924. 'label' => 'URL',
  925. 'value' => $GLOBALS['qBittorrentURL'],
  926. 'placeholder' => 'http(s)://hostname:port'
  927. ),
  928. array(
  929. 'type' => 'input',
  930. 'name' => 'qBittorrentUsername',
  931. 'label' => 'Username',
  932. 'value' => $GLOBALS['qBittorrentUsername']
  933. ),
  934. array(
  935. 'type' => 'password',
  936. 'name' => 'qBittorrentPassword',
  937. 'label' => 'Password',
  938. 'value' => $GLOBALS['qBittorrentPassword']
  939. )
  940. ),
  941. 'Misc Options' => array(
  942. array(
  943. 'type' => 'switch',
  944. 'name' => 'qBittorrentHideSeeding',
  945. 'label' => 'Hide Seeding',
  946. 'value' => $GLOBALS['qBittorrentHideSeeding']
  947. ), array(
  948. 'type' => 'switch',
  949. 'name' => 'qBittorrentHideCompleted',
  950. 'label' => 'Hide Completed',
  951. 'value' => $GLOBALS['qBittorrentHideCompleted']
  952. ),
  953. array(
  954. 'type' => 'select',
  955. 'name' => 'qBittorrentSortOrder',
  956. 'label' => 'Order',
  957. 'value' => $GLOBALS['qBittorrentSortOrder'],
  958. 'options' => $qBittorrentSortOptions
  959. ), array(
  960. 'type' => 'switch',
  961. 'name' => 'qBittorrentReverseSorting',
  962. 'label' => 'Reverse Sorting',
  963. 'value' => $GLOBALS['qBittorrentReverseSorting']
  964. ),
  965. array(
  966. 'type' => 'select',
  967. 'name' => 'homepageDownloadRefresh',
  968. 'label' => 'Refresh Seconds',
  969. 'value' => $GLOBALS['homepageDownloadRefresh'],
  970. 'options' => $time
  971. )
  972. )
  973. )
  974. ),
  975. array(
  976. 'name' => 'Deluge',
  977. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  978. 'image' => 'plugins/images/tabs/deluge.png',
  979. 'category' => 'Downloader',
  980. 'settings' => array(
  981. 'custom' => '
  982. <div class="row">
  983. <div class="col-lg-12">
  984. <div class="panel panel-info">
  985. <div class="panel-heading">
  986. <span lang="en">Notice</span>
  987. </div>
  988. <div class="panel-wrapper collapse in" aria-expanded="true">
  989. <div class="panel-body">
  990. <ul class="list-icons">
  991. <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>
  992. <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>
  993. <li><i class="fa fa-chevron-right text-danger"></i> Activate WebAPI plugin </li>
  994. </ul>
  995. </div>
  996. </div>
  997. </div>
  998. </div>
  999. </div>
  1000. ',
  1001. 'Enable' => array(
  1002. array(
  1003. 'type' => 'switch',
  1004. 'name' => 'homepageDelugeEnabled',
  1005. 'label' => 'Enable',
  1006. 'value' => $GLOBALS['homepageDelugeEnabled']
  1007. ),
  1008. array(
  1009. 'type' => 'select',
  1010. 'name' => 'homepageDelugeAuth',
  1011. 'label' => 'Minimum Authentication',
  1012. 'value' => $GLOBALS['homepageDelugeAuth'],
  1013. 'options' => $groups
  1014. )
  1015. ),
  1016. 'Connection' => array(
  1017. array(
  1018. 'type' => 'input',
  1019. 'name' => 'delugeURL',
  1020. 'label' => 'URL',
  1021. 'value' => $GLOBALS['delugeURL'],
  1022. 'placeholder' => 'http(s)://hostname:port'
  1023. ),
  1024. array(
  1025. 'type' => 'password',
  1026. 'name' => 'delugePassword',
  1027. 'label' => 'Password',
  1028. 'value' => $GLOBALS['delugePassword']
  1029. )
  1030. ),
  1031. 'Misc Options' => array(
  1032. array(
  1033. 'type' => 'switch',
  1034. 'name' => 'delugeHideSeeding',
  1035. 'label' => 'Hide Seeding',
  1036. 'value' => $GLOBALS['delugeHideSeeding']
  1037. ), array(
  1038. 'type' => 'switch',
  1039. 'name' => 'delugeHideCompleted',
  1040. 'label' => 'Hide Completed',
  1041. 'value' => $GLOBALS['delugeHideCompleted']
  1042. ),
  1043. array(
  1044. 'type' => 'select',
  1045. 'name' => 'homepageDownloadRefresh',
  1046. 'label' => 'Refresh Seconds',
  1047. 'value' => $GLOBALS['homepageDownloadRefresh'],
  1048. 'options' => $time
  1049. )
  1050. ),
  1051. 'Test Connection' => array(
  1052. array(
  1053. 'type' => 'blank',
  1054. 'label' => ''
  1055. ),
  1056. array(
  1057. 'type' => 'button',
  1058. 'label' => '',
  1059. 'icon' => 'fa fa-flask',
  1060. 'class' => 'pull-right',
  1061. 'text' => 'Test Connection',
  1062. 'attr' => 'onclick="testAPIConnection(\'deluge\')"'
  1063. ),
  1064. )
  1065. )
  1066. ),
  1067. array(
  1068. 'name' => 'Sonarr',
  1069. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1070. 'image' => 'plugins/images/tabs/sonarr.png',
  1071. 'category' => 'PVR',
  1072. 'settings' => array(
  1073. 'Enable' => array(
  1074. array(
  1075. 'type' => 'switch',
  1076. 'name' => 'homepageSonarrEnabled',
  1077. 'label' => 'Enable',
  1078. 'value' => $GLOBALS['homepageSonarrEnabled']
  1079. ),
  1080. array(
  1081. 'type' => 'select',
  1082. 'name' => 'homepageSonarrAuth',
  1083. 'label' => 'Minimum Authentication',
  1084. 'value' => $GLOBALS['homepageSonarrAuth'],
  1085. 'options' => $groups
  1086. )
  1087. ),
  1088. 'Connection' => array(
  1089. array(
  1090. 'type' => 'input',
  1091. 'name' => 'sonarrURL',
  1092. 'label' => 'URL',
  1093. 'value' => $GLOBALS['sonarrURL'],
  1094. 'placeholder' => 'http(s)://hostname:port'
  1095. ),
  1096. array(
  1097. 'type' => 'password-alt',
  1098. 'name' => 'sonarrToken',
  1099. 'label' => 'Token',
  1100. 'value' => $GLOBALS['sonarrToken']
  1101. )
  1102. ),
  1103. 'Misc Options' => array(
  1104. array(
  1105. 'type' => 'input',
  1106. 'name' => 'calendarStart',
  1107. 'label' => '# of Days Before',
  1108. 'value' => $GLOBALS['calendarStart'],
  1109. 'placeholder' => ''
  1110. ),
  1111. array(
  1112. 'type' => 'input',
  1113. 'name' => 'calendarEnd',
  1114. 'label' => '# of Days After',
  1115. 'value' => $GLOBALS['calendarEnd'],
  1116. 'placeholder' => ''
  1117. ),
  1118. array(
  1119. 'type' => 'select',
  1120. 'name' => 'calendarFirstDay',
  1121. 'label' => 'Start Day',
  1122. 'value' => $GLOBALS['calendarFirstDay'],
  1123. 'options' => $day
  1124. ),
  1125. array(
  1126. 'type' => 'select',
  1127. 'name' => 'calendarDefault',
  1128. 'label' => 'Default View',
  1129. 'value' => $GLOBALS['calendarDefault'],
  1130. 'options' => $calendarDefault
  1131. ),
  1132. array(
  1133. 'type' => 'select',
  1134. 'name' => 'calendarTimeFormat',
  1135. 'label' => 'Time Format',
  1136. 'value' => $GLOBALS['calendarTimeFormat'],
  1137. 'options' => $timeFormat
  1138. ),
  1139. array(
  1140. 'type' => 'select',
  1141. 'name' => 'calendarLimit',
  1142. 'label' => 'Items Per Day',
  1143. 'value' => $GLOBALS['calendarLimit'],
  1144. 'options' => $limit
  1145. ),
  1146. array(
  1147. 'type' => 'select',
  1148. 'name' => 'calendarRefresh',
  1149. 'label' => 'Refresh Seconds',
  1150. 'value' => $GLOBALS['calendarRefresh'],
  1151. 'options' => $time
  1152. )
  1153. ),
  1154. 'Test Connection' => array(
  1155. array(
  1156. 'type' => 'blank',
  1157. 'label' => ''
  1158. ),
  1159. array(
  1160. 'type' => 'button',
  1161. 'label' => '',
  1162. 'icon' => 'fa fa-flask',
  1163. 'class' => 'pull-right',
  1164. 'text' => 'Test Connection',
  1165. 'attr' => 'onclick="testAPIConnection(\'sonarr\')"'
  1166. ),
  1167. )
  1168. )
  1169. ),
  1170. array(
  1171. 'name' => 'Radarr',
  1172. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1173. 'image' => 'plugins/images/tabs/radarr.png',
  1174. 'category' => 'PVR',
  1175. 'settings' => array(
  1176. 'Enable' => array(
  1177. array(
  1178. 'type' => 'switch',
  1179. 'name' => 'homepageRadarrEnabled',
  1180. 'label' => 'Enable',
  1181. 'value' => $GLOBALS['homepageRadarrEnabled']
  1182. ),
  1183. array(
  1184. 'type' => 'select',
  1185. 'name' => 'homepageRadarrAuth',
  1186. 'label' => 'Minimum Authentication',
  1187. 'value' => $GLOBALS['homepageRadarrAuth'],
  1188. 'options' => $groups
  1189. )
  1190. ),
  1191. 'Connection' => array(
  1192. array(
  1193. 'type' => 'input',
  1194. 'name' => 'radarrURL',
  1195. 'label' => 'URL',
  1196. 'value' => $GLOBALS['radarrURL'],
  1197. 'placeholder' => 'http(s)://hostname:port'
  1198. ),
  1199. array(
  1200. 'type' => 'password-alt',
  1201. 'name' => 'radarrToken',
  1202. 'label' => 'Token',
  1203. 'value' => $GLOBALS['radarrToken']
  1204. )
  1205. ),
  1206. 'Misc Options' => array(
  1207. array(
  1208. 'type' => 'input',
  1209. 'name' => 'calendarStart',
  1210. 'label' => '# of Days Before',
  1211. 'value' => $GLOBALS['calendarStart'],
  1212. 'placeholder' => ''
  1213. ),
  1214. array(
  1215. 'type' => 'input',
  1216. 'name' => 'calendarEnd',
  1217. 'label' => '# of Days After',
  1218. 'value' => $GLOBALS['calendarEnd'],
  1219. 'placeholder' => ''
  1220. ),
  1221. array(
  1222. 'type' => 'select',
  1223. 'name' => 'calendarFirstDay',
  1224. 'label' => 'Start Day',
  1225. 'value' => $GLOBALS['calendarFirstDay'],
  1226. 'options' => $day
  1227. ),
  1228. array(
  1229. 'type' => 'select',
  1230. 'name' => 'calendarDefault',
  1231. 'label' => 'Default View',
  1232. 'value' => $GLOBALS['calendarDefault'],
  1233. 'options' => $calendarDefault
  1234. ),
  1235. array(
  1236. 'type' => 'select',
  1237. 'name' => 'calendarTimeFormat',
  1238. 'label' => 'Time Format',
  1239. 'value' => $GLOBALS['calendarTimeFormat'],
  1240. 'options' => $timeFormat
  1241. ),
  1242. array(
  1243. 'type' => 'select',
  1244. 'name' => 'calendarLimit',
  1245. 'label' => 'Items Per Day',
  1246. 'value' => $GLOBALS['calendarLimit'],
  1247. 'options' => $limit
  1248. ),
  1249. array(
  1250. 'type' => 'select',
  1251. 'name' => 'calendarRefresh',
  1252. 'label' => 'Refresh Seconds',
  1253. 'value' => $GLOBALS['calendarRefresh'],
  1254. 'options' => $time
  1255. )
  1256. ),
  1257. 'Test Connection' => array(
  1258. array(
  1259. 'type' => 'blank',
  1260. 'label' => ''
  1261. ),
  1262. array(
  1263. 'type' => 'button',
  1264. 'label' => '',
  1265. 'icon' => 'fa fa-flask',
  1266. 'class' => 'pull-right',
  1267. 'text' => 'Test Connection',
  1268. 'attr' => 'onclick="testAPIConnection(\'radarr\')"'
  1269. ),
  1270. )
  1271. )
  1272. ),
  1273. array(
  1274. 'name' => 'CouchPotato',
  1275. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1276. 'image' => 'plugins/images/tabs/couchpotato.png',
  1277. 'category' => 'PVR',
  1278. 'settings' => array(
  1279. 'Enable' => array(
  1280. array(
  1281. 'type' => 'switch',
  1282. 'name' => 'homepageCouchpotatoEnabled',
  1283. 'label' => 'Enable',
  1284. 'value' => $GLOBALS['homepageCouchpotatoEnabled']
  1285. ),
  1286. array(
  1287. 'type' => 'select',
  1288. 'name' => 'homepageCouchpotatoAuth',
  1289. 'label' => 'Minimum Authentication',
  1290. 'value' => $GLOBALS['homepageCouchpotatoAuth'],
  1291. 'options' => $groups
  1292. )
  1293. ),
  1294. 'Connection' => array(
  1295. array(
  1296. 'type' => 'input',
  1297. 'name' => 'couchpotatoURL',
  1298. 'label' => 'URL',
  1299. 'value' => $GLOBALS['couchpotatoURL'],
  1300. 'placeholder' => 'http(s)://hostname:port'
  1301. ),
  1302. array(
  1303. 'type' => 'password-alt',
  1304. 'name' => 'couchpotatoToken',
  1305. 'label' => 'Token',
  1306. 'value' => $GLOBALS['couchpotatoToken']
  1307. )
  1308. ),
  1309. 'Misc Options' => array(
  1310. array(
  1311. 'type' => 'select',
  1312. 'name' => 'calendarFirstDay',
  1313. 'label' => 'Start Day',
  1314. 'value' => $GLOBALS['calendarFirstDay'],
  1315. 'options' => $day
  1316. ),
  1317. array(
  1318. 'type' => 'select',
  1319. 'name' => 'calendarDefault',
  1320. 'label' => 'Default View',
  1321. 'value' => $GLOBALS['calendarDefault'],
  1322. 'options' => $calendarDefault
  1323. ),
  1324. array(
  1325. 'type' => 'select',
  1326. 'name' => 'calendarTimeFormat',
  1327. 'label' => 'Time Format',
  1328. 'value' => $GLOBALS['calendarTimeFormat'],
  1329. 'options' => $timeFormat
  1330. ),
  1331. array(
  1332. 'type' => 'select',
  1333. 'name' => 'calendarLimit',
  1334. 'label' => 'Items Per Day',
  1335. 'value' => $GLOBALS['calendarLimit'],
  1336. 'options' => $limit
  1337. ),
  1338. array(
  1339. 'type' => 'select',
  1340. 'name' => 'calendarRefresh',
  1341. 'label' => 'Refresh Seconds',
  1342. 'value' => $GLOBALS['calendarRefresh'],
  1343. 'options' => $time
  1344. )
  1345. )
  1346. )
  1347. ),
  1348. array(
  1349. 'name' => 'SickRage',
  1350. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1351. 'image' => 'plugins/images/tabs/sickrage.png',
  1352. 'category' => 'PVR',
  1353. 'settings' => array(
  1354. 'Enable' => array(
  1355. array(
  1356. 'type' => 'switch',
  1357. 'name' => 'homepageSickrageEnabled',
  1358. 'label' => 'Enable',
  1359. 'value' => $GLOBALS['homepageSickrageEnabled']
  1360. ),
  1361. array(
  1362. 'type' => 'select',
  1363. 'name' => 'homepageSickrageAuth',
  1364. 'label' => 'Minimum Authentication',
  1365. 'value' => $GLOBALS['homepageSickrageAuth'],
  1366. 'options' => $groups
  1367. )
  1368. ),
  1369. 'Connection' => array(
  1370. array(
  1371. 'type' => 'input',
  1372. 'name' => 'sickrageURL',
  1373. 'label' => 'URL',
  1374. 'value' => $GLOBALS['sickrageURL'],
  1375. 'placeholder' => 'http(s)://hostname:port'
  1376. ),
  1377. array(
  1378. 'type' => 'password-alt',
  1379. 'name' => 'sickrageToken',
  1380. 'label' => 'Token',
  1381. 'value' => $GLOBALS['sickrageToken']
  1382. )
  1383. ),
  1384. 'Misc Options' => array(
  1385. array(
  1386. 'type' => 'select',
  1387. 'name' => 'calendarFirstDay',
  1388. 'label' => 'Start Day',
  1389. 'value' => $GLOBALS['calendarFirstDay'],
  1390. 'options' => $day
  1391. ),
  1392. array(
  1393. 'type' => 'select',
  1394. 'name' => 'calendarDefault',
  1395. 'label' => 'Default View',
  1396. 'value' => $GLOBALS['calendarDefault'],
  1397. 'options' => $calendarDefault
  1398. ),
  1399. array(
  1400. 'type' => 'select',
  1401. 'name' => 'calendarTimeFormat',
  1402. 'label' => 'Time Format',
  1403. 'value' => $GLOBALS['calendarTimeFormat'],
  1404. 'options' => $timeFormat
  1405. ),
  1406. array(
  1407. 'type' => 'select',
  1408. 'name' => 'calendarLimit',
  1409. 'label' => 'Items Per Day',
  1410. 'value' => $GLOBALS['calendarLimit'],
  1411. 'options' => $limit
  1412. ),
  1413. array(
  1414. 'type' => 'select',
  1415. 'name' => 'calendarRefresh',
  1416. 'label' => 'Refresh Seconds',
  1417. 'value' => $GLOBALS['calendarRefresh'],
  1418. 'options' => $time
  1419. )
  1420. )
  1421. )
  1422. ),
  1423. array(
  1424. 'name' => 'Ombi',
  1425. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1426. 'image' => 'plugins/images/tabs/ombi.png',
  1427. 'category' => 'Requests',
  1428. 'settings' => array(
  1429. 'Enable' => array(
  1430. array(
  1431. 'type' => 'switch',
  1432. 'name' => 'homepageOmbiEnabled',
  1433. 'label' => 'Enable',
  1434. 'value' => $GLOBALS['homepageOmbiEnabled']
  1435. ),
  1436. array(
  1437. 'type' => 'select',
  1438. 'name' => 'homepageOmbiAuth',
  1439. 'label' => 'Minimum Authentication',
  1440. 'value' => $GLOBALS['homepageOmbiAuth'],
  1441. 'options' => $groups
  1442. )
  1443. ),
  1444. 'Connection' => array(
  1445. array(
  1446. 'type' => 'input',
  1447. 'name' => 'ombiURL',
  1448. 'label' => 'URL',
  1449. 'value' => $GLOBALS['ombiURL'],
  1450. 'placeholder' => 'http(s)://hostname:port'
  1451. ),
  1452. array(
  1453. 'type' => 'password-alt',
  1454. 'name' => 'ombiToken',
  1455. 'label' => 'Token',
  1456. 'value' => $GLOBALS['ombiToken']
  1457. )
  1458. ),
  1459. 'Misc Options' => array(
  1460. array(
  1461. 'type' => 'switch',
  1462. 'name' => 'ombiLimitUser',
  1463. 'label' => 'Limit to User',
  1464. 'value' => $GLOBALS['ombiLimitUser']
  1465. ),
  1466. array(
  1467. 'type' => 'select',
  1468. 'name' => 'ombiRefresh',
  1469. 'label' => 'Refresh Seconds',
  1470. 'value' => $GLOBALS['ombiRefresh'],
  1471. 'options' => $time
  1472. )
  1473. )
  1474. )
  1475. ),
  1476. array(
  1477. 'name' => 'CustomHTML-1',
  1478. 'enabled' => (strpos('personal,business', $GLOBALS['license']) !== false) ? true : false,
  1479. 'image' => 'plugins/images/tabs/custom1.png',
  1480. 'category' => 'Custom',
  1481. 'settings' => array(
  1482. 'Enable' => array(
  1483. array(
  1484. 'type' => 'switch',
  1485. 'name' => 'homepagCustomHTMLoneEnabled',
  1486. 'label' => 'Enable',
  1487. 'value' => $GLOBALS['homepagCustomHTMLoneEnabled']
  1488. ),
  1489. array(
  1490. 'type' => 'select',
  1491. 'name' => 'homepagCustomHTMLoneAuth',
  1492. 'label' => 'Minimum Authentication',
  1493. 'value' => $GLOBALS['homepagCustomHTMLoneAuth'],
  1494. 'options' => $groups
  1495. )
  1496. ),
  1497. 'Code' => array(
  1498. array(
  1499. 'type' => 'textbox',
  1500. 'name' => 'customHTMLone',
  1501. 'class' => 'hidden customHTMLoneTextarea',
  1502. 'label' => '',
  1503. 'value' => $GLOBALS['customHTMLone'],
  1504. ),
  1505. array(
  1506. 'type' => 'html',
  1507. 'override' => 12,
  1508. 'label' => 'Custom HTML/JavaScript',
  1509. '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>'
  1510. ),
  1511. )
  1512. )
  1513. ),
  1514. array(
  1515. 'name' => 'CustomHTML-2',
  1516. 'enabled' => (strpos('personal,business', $GLOBALS['license']) !== false) ? true : false,
  1517. 'image' => 'plugins/images/tabs/custom2.png',
  1518. 'category' => 'Custom',
  1519. 'settings' => array(
  1520. 'Enable' => array(
  1521. array(
  1522. 'type' => 'switch',
  1523. 'name' => 'homepagCustomHTMLtwoEnabled',
  1524. 'label' => 'Enable',
  1525. 'value' => $GLOBALS['homepagCustomHTMLtwoEnabled']
  1526. ),
  1527. array(
  1528. 'type' => 'select',
  1529. 'name' => 'homepagCustomHTMLtwoAuth',
  1530. 'label' => 'Minimum Authentication',
  1531. 'value' => $GLOBALS['homepagCustomHTMLtwoAuth'],
  1532. 'options' => $groups
  1533. )
  1534. ),
  1535. 'Code' => array(
  1536. array(
  1537. 'type' => 'textbox',
  1538. 'name' => 'customHTMLtwo',
  1539. 'class' => 'hidden customHTMLtwoTextarea',
  1540. 'label' => '',
  1541. 'value' => $GLOBALS['customHTMLtwo'],
  1542. ),
  1543. array(
  1544. 'type' => 'html',
  1545. 'override' => 12,
  1546. 'label' => 'Custom HTML/JavaScript',
  1547. '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>'
  1548. ),
  1549. )
  1550. )
  1551. )
  1552. );
  1553. }
  1554. function buildHomepageSettings()
  1555. {
  1556. $homepageOrder = homepageOrder();
  1557. $homepageList = '<h4>Drag Homepage Items to Order Them</h4><div id="homepage-items-sort" class="external-events">';
  1558. $inputList = '<form id="homepage-values" class="row">';
  1559. foreach ($homepageOrder as $key => $val) {
  1560. switch ($key) {
  1561. case 'homepageOrdercustomhtml':
  1562. $class = 'bg-info';
  1563. $image = 'plugins/images/tabs/custom1.png';
  1564. if (!$GLOBALS['homepagCustomHTMLoneEnabled']) {
  1565. $class .= ' faded';
  1566. }
  1567. break;
  1568. case 'homepageOrdercustomhtmlTwo':
  1569. $class = 'bg-info';
  1570. $image = 'plugins/images/tabs/custom2.png';
  1571. if (!$GLOBALS['homepagCustomHTMLtwoEnabled']) {
  1572. $class .= ' faded';
  1573. }
  1574. break;
  1575. case 'homepageOrdertransmission':
  1576. $class = 'bg-transmission';
  1577. $image = 'plugins/images/tabs/transmission.png';
  1578. if (!$GLOBALS['homepageTransmissionEnabled']) {
  1579. $class .= ' faded';
  1580. }
  1581. break;
  1582. case 'homepageOrdernzbget':
  1583. $class = 'bg-nzbget';
  1584. $image = 'plugins/images/tabs/nzbget.png';
  1585. if (!$GLOBALS['homepageNzbgetEnabled']) {
  1586. $class .= ' faded';
  1587. }
  1588. break;
  1589. case 'homepageOrdersabnzbd':
  1590. $class = 'bg-sab';
  1591. $image = 'plugins/images/tabs/sabnzbd.png';
  1592. if (!$GLOBALS['homepageSabnzbdEnabled']) {
  1593. $class .= ' faded';
  1594. }
  1595. break;
  1596. case 'homepageOrderdeluge':
  1597. $class = 'bg-deluge';
  1598. $image = 'plugins/images/tabs/deluge.png';
  1599. if (!$GLOBALS['homepageDelugeEnabled']) {
  1600. $class .= ' faded';
  1601. }
  1602. break;
  1603. case 'homepageOrderqBittorrent':
  1604. $class = 'bg-qbit';
  1605. $image = 'plugins/images/tabs/qBittorrent.png';
  1606. if (!$GLOBALS['homepageqBittorrentEnabled']) {
  1607. $class .= ' faded';
  1608. }
  1609. break;
  1610. case 'homepageOrderplexnowplaying':
  1611. case 'homepageOrderplexrecent':
  1612. case 'homepageOrderplexplaylist':
  1613. $class = 'bg-plex';
  1614. $image = 'plugins/images/tabs/plex.png';
  1615. if (!$GLOBALS['homepagePlexEnabled']) {
  1616. $class .= ' faded';
  1617. }
  1618. break;
  1619. case 'homepageOrderembynowplaying':
  1620. case 'homepageOrderembyrecent':
  1621. $class = 'bg-emby';
  1622. $image = 'plugins/images/tabs/emby.png';
  1623. if (!$GLOBALS['homepageEmbyEnabled']) {
  1624. $class .= ' faded';
  1625. }
  1626. break;
  1627. case 'homepageOrderombi':
  1628. $class = 'bg-inverse';
  1629. $image = 'plugins/images/tabs/ombi.png';
  1630. if (!$GLOBALS['homepageOmbiEnabled']) {
  1631. $class .= ' faded';
  1632. }
  1633. break;
  1634. case 'homepageOrdercalendar':
  1635. $class = 'bg-primary';
  1636. $image = 'plugins/images/tabs/calendar.png';
  1637. if (!$GLOBALS['homepageSonarrEnabled'] && !$GLOBALS['homepageRadarrEnabled'] && !$GLOBALS['homepageSickrageEnabled'] && !$GLOBALS['homepageCouchpotatoEnabled']) {
  1638. $class .= ' faded';
  1639. }
  1640. break;
  1641. default:
  1642. $class = 'blue-bg';
  1643. $image = '';
  1644. break;
  1645. }
  1646. $homepageList .= '
  1647. <div class="col-md-3 col-xs-12 sort-homepage m-t-10 hvr-grow">
  1648. <div class="homepage-drag fc-event ' . $class . ' lazyload" data-src="' . $image . '">
  1649. <span class="ordinal-position text-uppercase badge bg-org homepage-number" data-link="' . $key . '" style="float:left;width: 30px;">' . $val . '</span>
  1650. <span class="homepage-text">&nbsp; ' . strtoupper(substr($key, 13)) . '</span>
  1651. </div>
  1652. </div>
  1653. ';
  1654. $inputList .= '<input type="hidden" name="' . $key . '">';
  1655. }
  1656. $homepageList .= '</div>';
  1657. $inputList .= '</form>';
  1658. return $homepageList . $inputList;
  1659. }