homepage-functions.php 61 KB

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