homepage-functions.php 47 KB

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