homepage-functions.php 58 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177
  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. "homepageOrderrTorrent" => $GLOBALS['homepageOrderrTorrent'],
  21. "homepageOrderdownloader" => $GLOBALS['homepageOrderdownloader'],
  22. );
  23. asort($homepageOrder);
  24. return $homepageOrder;
  25. }
  26. function buildHomepage()
  27. {
  28. $homepageOrder = homepageOrder();
  29. $homepageBuilt = '';
  30. foreach ($homepageOrder as $key => $value) {
  31. $homepageBuilt .= buildHomepageItem($key);
  32. }
  33. return $homepageBuilt;
  34. }
  35. function buildHomepageItem($homepageItem)
  36. {
  37. $item = '<div id="' . $homepageItem . '">';
  38. switch ($homepageItem) {
  39. case 'homepageOrdercustomhtml':
  40. if ($GLOBALS['homepagCustomHTMLoneEnabled'] && qualifyRequest($GLOBALS['homepagCustomHTMLoneAuth'])) {
  41. $item .= ($GLOBALS['customHTMLone'] !== '') ? $GLOBALS['customHTMLone'] : '';
  42. }
  43. break;
  44. case 'homepageOrdercustomhtmlTwo':
  45. if ($GLOBALS['homepagCustomHTMLtwoEnabled'] && qualifyRequest($GLOBALS['homepagCustomHTMLtwoAuth'])) {
  46. $item .= ($GLOBALS['customHTMLtwo'] !== '') ? $GLOBALS['customHTMLtwo'] : '';
  47. }
  48. break;
  49. case 'homepageOrdernotice':
  50. break;
  51. case 'homepageOrdernoticeguest':
  52. break;
  53. case 'homepageOrderqBittorrent':
  54. if ($GLOBALS['homepageqBittorrentEnabled']) {
  55. if ($GLOBALS['qBittorrentCombine']) {
  56. $item .= '
  57. <script>
  58. // homepageOrderqBittorrent
  59. buildDownloaderCombined(\'qBittorrent\');
  60. homepageDownloader("qBittorrent", "' . $GLOBALS['homepageDownloadRefresh'] . '");
  61. // End homepageOrderqBittorrent
  62. </script>
  63. ';
  64. } else {
  65. $item .= '<div class="white-box"><h2 class="text-center" lang="en">Loading Download Queue...</h2></div>';
  66. $item .= '
  67. <script>
  68. // homepageOrderqBittorrent
  69. $("#' . $homepageItem . '").html(buildDownloader("qBittorrent"));
  70. homepageDownloader("qBittorrent", "' . $GLOBALS['homepageDownloadRefresh'] . '");
  71. // End homepageOrderqBittorrent
  72. </script>
  73. ';
  74. }
  75. }
  76. break;
  77. case 'homepageOrderrTorrent':
  78. if ($GLOBALS['homepagerTorrentEnabled']) {
  79. if ($GLOBALS['rTorrentCombine']) {
  80. $item .= '
  81. <script>
  82. // homepageOrderrTorrent
  83. buildDownloaderCombined(\'rTorrent\');
  84. homepageDownloader("rTorrent", "' . $GLOBALS['homepageDownloadRefresh'] . '");
  85. // End homepageOrderrTorrent
  86. </script>
  87. ';
  88. } else {
  89. $item .= '<div class="white-box"><h2 class="text-center" lang="en">Loading Download Queue...</h2></div>';
  90. $item .= '
  91. <script>
  92. // homepageOrderrTorrent
  93. $("#' . $homepageItem . '").html(buildDownloader("rTorrent"));
  94. homepageDownloader("rTorrent", "' . $GLOBALS['homepageDownloadRefresh'] . '");
  95. // End homepageOrderrTorrent
  96. </script>
  97. ';
  98. }
  99. }
  100. break;
  101. case 'homepageOrderdeluge':
  102. if ($GLOBALS['homepageDelugeEnabled']) {
  103. if ($GLOBALS['delugeCombine']) {
  104. $item .= '
  105. <script>
  106. // Deluge
  107. buildDownloaderCombined(\'deluge\');
  108. homepageDownloader("deluge", "' . $GLOBALS['homepageDownloadRefresh'] . '");
  109. // End Deluge
  110. </script>
  111. ';
  112. } else {
  113. $item .= '<div class="white-box"><h2 class="text-center" lang="en">Loading Download Queue...</h2></div>';
  114. $item .= '
  115. <script>
  116. // Deluge
  117. $("#' . $homepageItem . '").html(buildDownloader("deluge"));
  118. homepageDownloader("deluge", "' . $GLOBALS['homepageDownloadRefresh'] . '");
  119. // End Deluge
  120. </script>
  121. ';
  122. }
  123. }
  124. break;
  125. case 'homepageOrdertransmission':
  126. if ($GLOBALS['homepageTransmissionEnabled']) {
  127. if ($GLOBALS['transmissionCombine']) {
  128. $item .= '
  129. <script>
  130. // Transmission
  131. buildDownloaderCombined(\'transmission\');
  132. homepageDownloader("transmission", "' . $GLOBALS['homepageDownloadRefresh'] . '");
  133. // End Transmission
  134. </script>
  135. ';
  136. } else {
  137. $item .= '<div class="white-box"><h2 class="text-center" lang="en">Loading Download Queue...</h2></div>';
  138. $item .= '
  139. <script>
  140. // Transmission
  141. $("#' . $homepageItem . '").html(buildDownloader("transmission"));
  142. homepageDownloader("transmission", "' . $GLOBALS['homepageDownloadRefresh'] . '");
  143. // End Transmission
  144. </script>
  145. ';
  146. }
  147. }
  148. break;
  149. case 'homepageOrdernzbget':
  150. if ($GLOBALS['homepageNzbgetEnabled']) {
  151. if ($GLOBALS['nzbgetCombine']) {
  152. $item .= '
  153. <script>
  154. // NZBGet
  155. buildDownloaderCombined(\'nzbget\');
  156. homepageDownloader("nzbget", "' . $GLOBALS['homepageDownloadRefresh'] . '");
  157. // End NZBGet
  158. </script>
  159. ';
  160. } else {
  161. $item .= '<div class="white-box"><h2 class="text-center" lang="en">Loading Download Queue...</h2></div>';
  162. $item .= '
  163. <script>
  164. // NZBGet
  165. $("#' . $homepageItem . '").html(buildDownloader("nzbget"));
  166. homepageDownloader("nzbget", "' . $GLOBALS['homepageDownloadRefresh'] . '");
  167. // End NZBGet
  168. </script>
  169. ';
  170. }
  171. }
  172. break;
  173. case 'homepageOrdersabnzbd':
  174. if ($GLOBALS['homepageSabnzbdEnabled']) {
  175. if ($GLOBALS['sabnzbdCombine']) {
  176. $item .= '
  177. <script>
  178. // SabNZBd
  179. buildDownloaderCombined(\'sabnzbd\');
  180. homepageDownloader("sabnzbd", "' . $GLOBALS['homepageDownloadRefresh'] . '");
  181. // End SabNZBd
  182. </script>
  183. ';
  184. } else {
  185. $item .= '<div class="white-box"><h2 class="text-center" lang="en">Loading Download Queue...</h2></div>';
  186. $item .= '
  187. <script>
  188. // SabNZBd
  189. $("#' . $homepageItem . '").html(buildDownloader("sabnzbd"));
  190. homepageDownloader("sabnzbd", "' . $GLOBALS['homepageDownloadRefresh'] . '");
  191. // End SabNZBd
  192. </script>
  193. ';
  194. }
  195. }
  196. break;
  197. case 'homepageOrderplexnowplaying':
  198. if ($GLOBALS['homepagePlexStreams']) {
  199. $item .= '<div class="white-box"><h2 class="text-center" lang="en">Loading Now Playing...</h2></div>';
  200. $item .= '
  201. <script>
  202. // Plex Stream
  203. homepageStream("plex", "' . $GLOBALS['homepageStreamRefresh'] . '");
  204. // End Plex Stream
  205. </script>
  206. ';
  207. }
  208. break;
  209. case 'homepageOrderplexrecent':
  210. if ($GLOBALS['homepagePlexRecent']) {
  211. $item .= '<div class="white-box"><h2 class="text-center" lang="en">Loading Recent...</h2></div>';
  212. $item .= '
  213. <script>
  214. // Plex Recent
  215. homepageRecent("plex", "' . $GLOBALS['homepageRecentRefresh'] . '");
  216. // End Plex Recent
  217. </script>
  218. ';
  219. }
  220. break;
  221. case 'homepageOrderplexplaylist':
  222. if ($GLOBALS['homepagePlexPlaylist']) {
  223. $item .= '<div class="white-box"><h2 class="text-center" lang="en">Loading Playlists...</h2></div>';
  224. $item .= '
  225. <script>
  226. // Plex Playlist
  227. homepagePlaylist("plex");
  228. // End Plex Playlist
  229. </script>
  230. ';
  231. }
  232. break;
  233. case 'homepageOrderembynowplaying':
  234. if ($GLOBALS['homepageEmbyStreams']) {
  235. $item .= '<div class="white-box"><h2 class="text-center" lang="en">Loading Now Playing...</h2></div>';
  236. $item .= '
  237. <script>
  238. // Emby Stream
  239. homepageStream("emby", "' . $GLOBALS['homepageStreamRefresh'] . '");
  240. // End Emby Stream
  241. </script>
  242. ';
  243. }
  244. break;
  245. case 'homepageOrderembyrecent':
  246. if ($GLOBALS['homepageEmbyRecent']) {
  247. $item .= '<div class="white-box"><h2 class="text-center" lang="en">Loading Recent...</h2></div>';
  248. $item .= '
  249. <script>
  250. // Emby Recent
  251. homepageRecent("emby", "' . $GLOBALS['homepageRecentRefresh'] . '");
  252. // End Emby Recent
  253. </script>
  254. ';
  255. }
  256. break;
  257. case 'homepageOrderombi':
  258. if ($GLOBALS['homepageOmbiEnabled']) {
  259. $item .= '<div class="white-box"><h2 class="text-center" lang="en">Loading Requests...</h2></div>';
  260. $item .= '
  261. <script>
  262. // Ombi Requests
  263. homepageRequests("' . $GLOBALS['ombiRefresh'] . '");
  264. // End Ombi Requests
  265. </script>
  266. ';
  267. }
  268. break;
  269. case 'homepageOrdercalendar':
  270. if ($GLOBALS['homepageSonarrEnabled'] && qualifyRequest($GLOBALS['homepageSonarrAuth']) || ($GLOBALS['homepageRadarrEnabled'] && qualifyRequest($GLOBALS['homepageRadarrAuth'])) || ($GLOBALS['homepageSickrageEnabled'] && qualifyRequest($GLOBALS['homepageSickrageAuth'])) || ($GLOBALS['homepageCouchpotatoEnabled'] && qualifyRequest($GLOBALS['homepageCouchpotatoAuth'])) || ($GLOBALS['homepageCalendarEnabled'] && qualifyRequest($GLOBALS['homepageCalendarAuth']) && $GLOBALS['calendariCal'] !== '')) {
  271. $item .= '
  272. <div id="calendar" class="fc fc-ltr m-b-30"></div>
  273. <script>
  274. // Calendar
  275. homepageCalendar("' . $GLOBALS['calendarRefresh'] . '");
  276. // End Calendar
  277. </script>
  278. ';
  279. }
  280. break;
  281. default:
  282. # code...
  283. break;
  284. }
  285. return $item . '</div>';
  286. }
  287. function getHomepageList()
  288. {
  289. $groups = groupSelect();
  290. $mediaServers = array(
  291. array(
  292. 'name' => 'N/A',
  293. 'value' => ''
  294. ),
  295. array(
  296. 'name' => 'Plex',
  297. 'value' => 'plex'
  298. ),
  299. array(
  300. 'name' => 'Emby [Not Available]',
  301. 'value' => 'emby'
  302. )
  303. );
  304. $limit = array(
  305. array(
  306. 'name' => '1 Item',
  307. 'value' => '1'
  308. ),
  309. array(
  310. 'name' => '2 Items',
  311. 'value' => '2'
  312. ),
  313. array(
  314. 'name' => '3 Items',
  315. 'value' => '3'
  316. ),
  317. array(
  318. 'name' => '4 Items',
  319. 'value' => '4'
  320. ),
  321. array(
  322. 'name' => '5 Items',
  323. 'value' => '5'
  324. ),
  325. array(
  326. 'name' => '6 Items',
  327. 'value' => '6'
  328. ),
  329. array(
  330. 'name' => '7 Items',
  331. 'value' => '7'
  332. ),
  333. array(
  334. 'name' => '8 Items',
  335. 'value' => '8'
  336. ),
  337. array(
  338. 'name' => 'Unlimited',
  339. 'value' => '1000'
  340. ),
  341. );
  342. $day = array(
  343. array(
  344. 'name' => 'Sunday',
  345. 'value' => '0'
  346. ),
  347. array(
  348. 'name' => 'Monday',
  349. 'value' => '1'
  350. ),
  351. array(
  352. 'name' => 'Tueday',
  353. 'value' => '2'
  354. ),
  355. array(
  356. 'name' => 'Wednesday',
  357. 'value' => '3'
  358. ),
  359. array(
  360. 'name' => 'Thursday',
  361. 'value' => '4'
  362. ),
  363. array(
  364. 'name' => 'Friday',
  365. 'value' => '5'
  366. ),
  367. array(
  368. 'name' => 'Saturday',
  369. 'value' => '6'
  370. )
  371. );
  372. $calendarDefault = array(
  373. array(
  374. 'name' => 'Month',
  375. 'value' => 'month'
  376. ),
  377. array(
  378. 'name' => 'Day',
  379. 'value' => 'basicDay'
  380. ),
  381. array(
  382. 'name' => 'Week',
  383. 'value' => 'basicWeek'
  384. ),
  385. array(
  386. 'name' => 'List',
  387. 'value' => 'list'
  388. )
  389. );
  390. $timeFormat = array(
  391. array(
  392. 'name' => '6p',
  393. 'value' => 'h(:mm)t'
  394. ),
  395. array(
  396. 'name' => '6:00p',
  397. 'value' => 'h:mmt'
  398. ),
  399. array(
  400. 'name' => '6:00',
  401. 'value' => 'h:mm'
  402. ),
  403. array(
  404. 'name' => '18',
  405. 'value' => 'H(:mm)'
  406. ),
  407. array(
  408. 'name' => '18:00',
  409. 'value' => 'H:mm'
  410. )
  411. );
  412. $rTorrentSortOptions = array(
  413. array(
  414. 'name' => 'Date Desc',
  415. 'value' => 'dated'
  416. ),
  417. array(
  418. 'name' => 'Date Asc',
  419. 'value' => 'datea'
  420. ),
  421. array(
  422. 'name' => 'Hash Desc',
  423. 'value' => 'hashd'
  424. ),
  425. array(
  426. 'name' => 'Hash Asc',
  427. 'value' => 'hasha'
  428. ),
  429. array(
  430. 'name' => 'Name Desc',
  431. 'value' => 'named'
  432. ),
  433. array(
  434. 'name' => 'Name Asc',
  435. 'value' => 'namea'
  436. ),
  437. array(
  438. 'name' => 'Size Desc',
  439. 'value' => 'sized'
  440. ),
  441. array(
  442. 'name' => 'Size Asc',
  443. 'value' => 'sizea'
  444. ),
  445. array(
  446. 'name' => 'Label Desc',
  447. 'value' => 'labeld'
  448. ),
  449. array(
  450. 'name' => 'Label Asc',
  451. 'value' => 'labela'
  452. ),
  453. array(
  454. 'name' => 'Status Desc',
  455. 'value' => 'statusd'
  456. ),
  457. array(
  458. 'name' => 'Status Asc',
  459. 'value' => 'statusa'
  460. ),
  461. );
  462. $qBittorrentSortOptions = array(
  463. array(
  464. 'name' => 'Hash',
  465. 'value' => 'hash'
  466. ),
  467. array(
  468. 'name' => 'Name',
  469. 'value' => 'name'
  470. ),
  471. array(
  472. 'name' => 'Size',
  473. 'value' => 'size'
  474. ),
  475. array(
  476. 'name' => 'Progress',
  477. 'value' => 'progress'
  478. ),
  479. array(
  480. 'name' => 'Download Speed',
  481. 'value' => 'dlspeed'
  482. ),
  483. array(
  484. 'name' => 'Upload Speed',
  485. 'value' => 'upspeed'
  486. ),
  487. array(
  488. 'name' => 'Priority',
  489. 'value' => 'priority'
  490. ),
  491. array(
  492. 'name' => 'Number of Seeds',
  493. 'value' => 'num_seeds'
  494. ),
  495. array(
  496. 'name' => 'Number of Seeds in Swarm',
  497. 'value' => 'num_complete'
  498. ),
  499. array(
  500. 'name' => 'Number of Leechers',
  501. 'value' => 'num_leechs'
  502. ),
  503. array(
  504. 'name' => 'Number of Leechers in Swarm',
  505. 'value' => 'num_incomplete'
  506. ),
  507. array(
  508. 'name' => 'Ratio',
  509. 'value' => 'ratio'
  510. ),
  511. array(
  512. 'name' => 'ETA',
  513. 'value' => 'eta'
  514. ),
  515. array(
  516. 'name' => 'State',
  517. 'value' => 'state'
  518. ),
  519. array(
  520. 'name' => 'Category',
  521. 'value' => 'category'
  522. )
  523. );
  524. $xmlStatus = (extension_loaded('xmlrpc')) ? 'Installed' : 'Not Installed';
  525. return array(array(
  526. 'name' => 'Calendar',
  527. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  528. 'image' => 'plugins/images/tabs/calendar.png',
  529. 'category' => 'HOMEPAGE',
  530. 'settings' => array(
  531. 'Enable' => array(
  532. array(
  533. 'type' => 'switch',
  534. 'name' => 'homepageCalendarEnabled',
  535. 'label' => 'Enable iCal',
  536. 'value' => $GLOBALS['homepageCalendarEnabled']
  537. ),
  538. array(
  539. 'type' => 'select',
  540. 'name' => 'homepageCalendarAuth',
  541. 'label' => 'Minimum Authentication',
  542. 'value' => $GLOBALS['homepageCalendarAuth'],
  543. 'options' => $groups
  544. ),
  545. array(
  546. 'type' => 'input',
  547. 'name' => 'calendariCal',
  548. 'label' => 'iCal URL\'s',
  549. 'value' => $GLOBALS['calendariCal'],
  550. 'placeholder' => 'separate by comma\'s'
  551. ),
  552. ),
  553. 'Misc Options' => array(
  554. array(
  555. 'type' => 'number',
  556. 'name' => 'calendarStart',
  557. 'label' => '# of Days Before',
  558. 'value' => $GLOBALS['calendarStart'],
  559. 'placeholder' => ''
  560. ),
  561. array(
  562. 'type' => 'number',
  563. 'name' => 'calendarEnd',
  564. 'label' => '# of Days After',
  565. 'value' => $GLOBALS['calendarEnd'],
  566. 'placeholder' => ''
  567. ),
  568. array(
  569. 'type' => 'select',
  570. 'name' => 'calendarFirstDay',
  571. 'label' => 'Start Day',
  572. 'value' => $GLOBALS['calendarFirstDay'],
  573. 'options' => $day
  574. ),
  575. array(
  576. 'type' => 'select',
  577. 'name' => 'calendarDefault',
  578. 'label' => 'Default View',
  579. 'value' => $GLOBALS['calendarDefault'],
  580. 'options' => $calendarDefault
  581. ),
  582. array(
  583. 'type' => 'select',
  584. 'name' => 'calendarTimeFormat',
  585. 'label' => 'Time Format',
  586. 'value' => $GLOBALS['calendarTimeFormat'],
  587. 'options' => $timeFormat
  588. ),
  589. array(
  590. 'type' => 'select',
  591. 'name' => 'calendarLimit',
  592. 'label' => 'Items Per Day',
  593. 'value' => $GLOBALS['calendarLimit'],
  594. 'options' => $limit
  595. ),
  596. array(
  597. 'type' => 'select',
  598. 'name' => 'calendarRefresh',
  599. 'label' => 'Refresh Seconds',
  600. 'value' => $GLOBALS['calendarRefresh'],
  601. 'options' => optionTime()
  602. )
  603. ),
  604. )
  605. ),
  606. array(
  607. 'name' => 'Plex',
  608. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  609. 'image' => 'plugins/images/tabs/plex.png',
  610. 'category' => 'Media Server',
  611. //'license' => $GLOBALS['license'],
  612. 'settings' => array(
  613. 'Enable' => array(
  614. array(
  615. 'type' => 'switch',
  616. 'name' => 'homepagePlexEnabled',
  617. 'label' => 'Enable',
  618. 'value' => $GLOBALS['homepagePlexEnabled']
  619. ),
  620. array(
  621. 'type' => 'select',
  622. 'name' => 'homepagePlexAuth',
  623. 'label' => 'Minimum Authentication',
  624. 'value' => $GLOBALS['homepagePlexAuth'],
  625. 'options' => $groups
  626. )
  627. ),
  628. 'Connection' => array(
  629. array(
  630. 'type' => 'input',
  631. 'name' => 'plexURL',
  632. 'label' => 'URL',
  633. 'value' => $GLOBALS['plexURL'],
  634. 'placeholder' => 'http(s)://hostname:port'
  635. ),
  636. array(
  637. 'type' => 'password-alt',
  638. 'name' => 'plexToken',
  639. 'label' => 'Token',
  640. 'value' => $GLOBALS['plexToken']
  641. ),
  642. array(
  643. 'type' => 'password-alt',
  644. 'name' => 'plexID',
  645. 'label' => 'Plex Machine',
  646. 'value' => $GLOBALS['plexID']
  647. )
  648. ),
  649. 'Active Streams' => array(
  650. array(
  651. 'type' => 'switch',
  652. 'name' => 'homepagePlexStreams',
  653. 'label' => 'Enable',
  654. 'value' => $GLOBALS['homepagePlexStreams']
  655. ),
  656. array(
  657. 'type' => 'select',
  658. 'name' => 'homepagePlexStreamsAuth',
  659. 'label' => 'Minimum Authorization',
  660. 'value' => $GLOBALS['homepagePlexStreamsAuth'],
  661. 'options' => $groups
  662. ),
  663. array(
  664. 'type' => 'switch',
  665. 'name' => 'homepageShowStreamNames',
  666. 'label' => 'User Information',
  667. 'value' => $GLOBALS['homepageShowStreamNames']
  668. ),
  669. array(
  670. 'type' => 'select',
  671. 'name' => 'homepageShowStreamNamesAuth',
  672. 'label' => 'Minimum Authorization',
  673. 'value' => $GLOBALS['homepageShowStreamNamesAuth'],
  674. 'options' => $groups
  675. ),
  676. array(
  677. 'type' => 'select',
  678. 'name' => 'homepageStreamRefresh',
  679. 'label' => 'Refresh Seconds',
  680. 'value' => $GLOBALS['homepageStreamRefresh'],
  681. 'options' => optionTime()
  682. ),
  683. ),
  684. 'Recent Items' => array(
  685. array(
  686. 'type' => 'switch',
  687. 'name' => 'homepagePlexRecent',
  688. 'label' => 'Enable',
  689. 'value' => $GLOBALS['homepagePlexRecent']
  690. ),
  691. array(
  692. 'type' => 'select',
  693. 'name' => 'homepagePlexRecentAuth',
  694. 'label' => 'Minimum Authorization',
  695. 'value' => $GLOBALS['homepagePlexRecentAuth'],
  696. 'options' => $groups
  697. ),
  698. array(
  699. 'type' => 'number',
  700. 'name' => 'homepageRecentLimit',
  701. 'label' => 'Item Limit',
  702. 'value' => $GLOBALS['homepageRecentLimit'],
  703. ),
  704. array(
  705. 'type' => 'select',
  706. 'name' => 'homepageRecentRefresh',
  707. 'label' => 'Refresh Seconds',
  708. 'value' => $GLOBALS['homepageRecentRefresh'],
  709. 'options' => optionTime()
  710. ),
  711. ),
  712. 'Media Search' => array(
  713. array(
  714. 'type' => 'switch',
  715. 'name' => 'mediaSearch',
  716. 'label' => 'Enable',
  717. 'value' => $GLOBALS['mediaSearch']
  718. ),
  719. array(
  720. 'type' => 'select',
  721. 'name' => 'mediaSearchAuth',
  722. 'label' => 'Minimum Authorization',
  723. 'value' => $GLOBALS['mediaSearchAuth'],
  724. 'options' => $groups
  725. ),
  726. array(
  727. 'type' => 'select',
  728. 'name' => 'mediaSearchType',
  729. 'label' => 'Media Server',
  730. 'value' => $GLOBALS['mediaSearchType'],
  731. 'options' => $mediaServers
  732. ),
  733. ),
  734. 'Playlists' => array(
  735. array(
  736. 'type' => 'switch',
  737. 'name' => 'homepagePlexPlaylist',
  738. 'label' => 'Enable',
  739. 'value' => $GLOBALS['homepagePlexPlaylist']
  740. ),
  741. array(
  742. 'type' => 'select',
  743. 'name' => 'homepagePlexPlaylistAuth',
  744. 'label' => 'Minimum Authorization',
  745. 'value' => $GLOBALS['homepagePlexPlaylistAuth'],
  746. 'options' => $groups
  747. ),
  748. ),
  749. 'Misc Options' => array(
  750. array(
  751. 'type' => 'input',
  752. 'name' => 'plexTabName',
  753. 'label' => 'Plex Tab Name',
  754. 'value' => $GLOBALS['plexTabName'],
  755. 'placeholder' => 'Only use if you have Plex in a reverse proxy'
  756. ),
  757. array(
  758. 'type' => 'input',
  759. 'name' => 'plexTabURL',
  760. 'label' => 'Plex Tab WAN URL',
  761. 'value' => $GLOBALS['plexTabURL'],
  762. 'placeholder' => 'http(s)://hostname:port'
  763. ),
  764. array(
  765. 'type' => 'select',
  766. 'name' => 'cacheImageSize',
  767. 'label' => 'Image Cache Size',
  768. 'value' => $GLOBALS['cacheImageSize'],
  769. 'options' => array(
  770. array(
  771. 'name' => 'Low',
  772. 'value' => '.5'
  773. ),
  774. array(
  775. 'name' => '1x',
  776. 'value' => '1'
  777. ),
  778. array(
  779. 'name' => '2x',
  780. 'value' => '2'
  781. ),
  782. array(
  783. 'name' => '3x',
  784. 'value' => '3'
  785. )
  786. )
  787. )
  788. ),
  789. 'Test Connection' => array(
  790. array(
  791. 'type' => 'blank',
  792. 'label' => 'Please Save before Testing'
  793. ),
  794. array(
  795. 'type' => 'button',
  796. 'label' => '',
  797. 'icon' => 'fa fa-flask',
  798. 'class' => 'pull-right',
  799. 'text' => 'Test Connection',
  800. 'attr' => 'onclick="testAPIConnection(\'plex\')"'
  801. ),
  802. )
  803. )
  804. ),
  805. array(
  806. 'name' => 'Emby',
  807. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  808. 'image' => 'plugins/images/tabs/emby.png',
  809. 'category' => 'Media Server',
  810. 'settings' => array(
  811. 'Enable' => array(
  812. array(
  813. 'type' => 'switch',
  814. 'name' => 'homepageEmbyEnabled',
  815. 'label' => 'Enable',
  816. 'value' => $GLOBALS['homepageEmbyEnabled']
  817. ),
  818. array(
  819. 'type' => 'select',
  820. 'name' => 'homepageEmbyAuth',
  821. 'label' => 'Minimum Authentication',
  822. 'value' => $GLOBALS['homepageEmbyAuth'],
  823. 'options' => $groups
  824. )
  825. ),
  826. 'Connection' => array(
  827. array(
  828. 'type' => 'input',
  829. 'name' => 'embyURL',
  830. 'label' => 'URL',
  831. 'value' => $GLOBALS['embyURL'],
  832. 'placeholder' => 'http(s)://hostname:port'
  833. ),
  834. array(
  835. 'type' => 'password-alt',
  836. 'name' => 'embyToken',
  837. 'label' => 'Token',
  838. 'value' => $GLOBALS['embyToken']
  839. )
  840. ),
  841. 'Active Streams' => array(
  842. array(
  843. 'type' => 'switch',
  844. 'name' => 'homepageEmbyStreams',
  845. 'label' => 'Enable',
  846. 'value' => $GLOBALS['homepageEmbyStreams']
  847. ),
  848. array(
  849. 'type' => 'select',
  850. 'name' => 'homepageEmbyStreamsAuth',
  851. 'label' => 'Minimum Authorization',
  852. 'value' => $GLOBALS['homepageEmbyStreamsAuth'],
  853. 'options' => $groups
  854. ),
  855. array(
  856. 'type' => 'switch',
  857. 'name' => 'homepageShowStreamNames',
  858. 'label' => 'User Information',
  859. 'value' => $GLOBALS['homepageShowStreamNames']
  860. ),
  861. array(
  862. 'type' => 'select',
  863. 'name' => 'homepageShowStreamNamesAuth',
  864. 'label' => 'Minimum Authorization',
  865. 'value' => $GLOBALS['homepageShowStreamNamesAuth'],
  866. 'options' => $groups
  867. ),
  868. array(
  869. 'type' => 'select',
  870. 'name' => 'homepageStreamRefresh',
  871. 'label' => 'Refresh Seconds',
  872. 'value' => $GLOBALS['homepageStreamRefresh'],
  873. 'options' => optionTime()
  874. ),
  875. ),
  876. 'Recent Items' => array(
  877. array(
  878. 'type' => 'switch',
  879. 'name' => 'homepageEmbyRecent',
  880. 'label' => 'Enable',
  881. 'value' => $GLOBALS['homepageEmbyRecent']
  882. ),
  883. array(
  884. 'type' => 'select',
  885. 'name' => 'homepageEmbyRecentAuth',
  886. 'label' => 'Minimum Authorization',
  887. 'value' => $GLOBALS['homepageEmbyRecentAuth'],
  888. 'options' => $groups
  889. ),
  890. array(
  891. 'type' => 'number',
  892. 'name' => 'homepageRecentLimit',
  893. 'label' => 'Item Limit',
  894. 'value' => $GLOBALS['homepageRecentLimit'],
  895. ),
  896. array(
  897. 'type' => 'select',
  898. 'name' => 'homepageRecentRefresh',
  899. 'label' => 'Refresh Seconds',
  900. 'value' => $GLOBALS['homepageRecentRefresh'],
  901. 'options' => optionTime()
  902. ),
  903. ),
  904. 'Misc Options' => array(
  905. array(
  906. 'type' => 'input',
  907. 'name' => 'embyTabName',
  908. 'label' => 'Emby Tab Name',
  909. 'value' => $GLOBALS['embyTabName'],
  910. 'placeholder' => 'Only use if you have Emby in a reverse proxy'
  911. ),
  912. array(
  913. 'type' => 'input',
  914. 'name' => 'embyTabURL',
  915. 'label' => 'Emby Tab WAN URL',
  916. 'value' => $GLOBALS['embyTabURL'],
  917. 'placeholder' => 'http(s)://hostname:port'
  918. ),
  919. array(
  920. 'type' => 'select',
  921. 'name' => 'cacheImageSize',
  922. 'label' => 'Image Cache Size',
  923. 'value' => $GLOBALS['cacheImageSize'],
  924. 'options' => array(
  925. array(
  926. 'name' => 'Low',
  927. 'value' => '.5'
  928. ),
  929. array(
  930. 'name' => '1x',
  931. 'value' => '1'
  932. ),
  933. array(
  934. 'name' => '2x',
  935. 'value' => '2'
  936. ),
  937. array(
  938. 'name' => '3x',
  939. 'value' => '3'
  940. )
  941. )
  942. )
  943. )
  944. )
  945. ),
  946. array(
  947. 'name' => 'SabNZBD',
  948. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  949. 'image' => 'plugins/images/tabs/sabnzbd.png',
  950. 'category' => 'Downloader',
  951. 'settings' => array(
  952. 'Enable' => array(
  953. array(
  954. 'type' => 'switch',
  955. 'name' => 'homepageSabnzbdEnabled',
  956. 'label' => 'Enable',
  957. 'value' => $GLOBALS['homepageSabnzbdEnabled']
  958. ),
  959. array(
  960. 'type' => 'select',
  961. 'name' => 'homepageSabnzbdAuth',
  962. 'label' => 'Minimum Authentication',
  963. 'value' => $GLOBALS['homepageSabnzbdAuth'],
  964. 'options' => $groups
  965. )
  966. ),
  967. 'Connection' => array(
  968. array(
  969. 'type' => 'input',
  970. 'name' => 'sabnzbdURL',
  971. 'label' => 'URL',
  972. 'value' => $GLOBALS['sabnzbdURL'],
  973. 'placeholder' => 'http(s)://hostname:port'
  974. ),
  975. array(
  976. 'type' => 'password-alt',
  977. 'name' => 'sabnzbdToken',
  978. 'label' => 'Token',
  979. 'value' => $GLOBALS['sabnzbdToken']
  980. )
  981. ),
  982. 'Misc Options' => array(
  983. array(
  984. 'type' => 'select',
  985. 'name' => 'homepageDownloadRefresh',
  986. 'label' => 'Refresh Seconds',
  987. 'value' => $GLOBALS['homepageDownloadRefresh'],
  988. 'options' => optionTime()
  989. ),
  990. array(
  991. 'type' => 'switch',
  992. 'name' => 'sabnzbdCombine',
  993. 'label' => 'Add to Combined Downloader',
  994. 'value' => $GLOBALS['sabnzbdCombine']
  995. ),
  996. ),
  997. 'Test Connection' => array(
  998. array(
  999. 'type' => 'blank',
  1000. 'label' => 'Please Save before Testing'
  1001. ),
  1002. array(
  1003. 'type' => 'button',
  1004. 'label' => '',
  1005. 'icon' => 'fa fa-flask',
  1006. 'class' => 'pull-right',
  1007. 'text' => 'Test Connection',
  1008. 'attr' => 'onclick="testAPIConnection(\'sabnzbd\')"'
  1009. ),
  1010. )
  1011. )
  1012. ),
  1013. array(
  1014. 'name' => 'NZBGet',
  1015. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1016. 'image' => 'plugins/images/tabs/nzbget.png',
  1017. 'category' => 'Downloader',
  1018. 'settings' => array(
  1019. 'Enable' => array(
  1020. array(
  1021. 'type' => 'switch',
  1022. 'name' => 'homepageNzbgetEnabled',
  1023. 'label' => 'Enable',
  1024. 'value' => $GLOBALS['homepageNzbgetEnabled']
  1025. ),
  1026. array(
  1027. 'type' => 'select',
  1028. 'name' => 'homepageNzbgetAuth',
  1029. 'label' => 'Minimum Authentication',
  1030. 'value' => $GLOBALS['homepageNzbgetAuth'],
  1031. 'options' => $groups
  1032. )
  1033. ),
  1034. 'Connection' => array(
  1035. array(
  1036. 'type' => 'input',
  1037. 'name' => 'nzbgetURL',
  1038. 'label' => 'URL',
  1039. 'value' => $GLOBALS['nzbgetURL'],
  1040. 'placeholder' => 'http(s)://hostname:port'
  1041. ),
  1042. array(
  1043. 'type' => 'input',
  1044. 'name' => 'nzbgetUsername',
  1045. 'label' => 'Username',
  1046. 'value' => $GLOBALS['nzbgetUsername']
  1047. ),
  1048. array(
  1049. 'type' => 'password',
  1050. 'name' => 'nzbgetPassword',
  1051. 'label' => 'Password',
  1052. 'value' => $GLOBALS['nzbgetPassword']
  1053. )
  1054. ),
  1055. 'Misc Options' => array(
  1056. array(
  1057. 'type' => 'select',
  1058. 'name' => 'homepageDownloadRefresh',
  1059. 'label' => 'Refresh Seconds',
  1060. 'value' => $GLOBALS['homepageDownloadRefresh'],
  1061. 'options' => optionTime()
  1062. ),
  1063. array(
  1064. 'type' => 'switch',
  1065. 'name' => 'nzbgetCombine',
  1066. 'label' => 'Add to Combined Downloader',
  1067. 'value' => $GLOBALS['nzbgetCombine']
  1068. ),
  1069. ),
  1070. 'Test Connection' => array(
  1071. array(
  1072. 'type' => 'blank',
  1073. 'label' => 'Please Save before Testing'
  1074. ),
  1075. array(
  1076. 'type' => 'button',
  1077. 'label' => '',
  1078. 'icon' => 'fa fa-flask',
  1079. 'class' => 'pull-right',
  1080. 'text' => 'Test Connection',
  1081. 'attr' => 'onclick="testAPIConnection(\'nzbget\')"'
  1082. ),
  1083. )
  1084. )
  1085. ),
  1086. array(
  1087. 'name' => 'Transmission',
  1088. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1089. 'image' => 'plugins/images/tabs/transmission.png',
  1090. 'category' => 'Downloader',
  1091. 'settings' => array(
  1092. 'Enable' => array(
  1093. array(
  1094. 'type' => 'switch',
  1095. 'name' => 'homepageTransmissionEnabled',
  1096. 'label' => 'Enable',
  1097. 'value' => $GLOBALS['homepageTransmissionEnabled']
  1098. ),
  1099. array(
  1100. 'type' => 'select',
  1101. 'name' => 'homepageTransmissionAuth',
  1102. 'label' => 'Minimum Authentication',
  1103. 'value' => $GLOBALS['homepageTransmissionAuth'],
  1104. 'options' => $groups
  1105. )
  1106. ),
  1107. 'Connection' => array(
  1108. array(
  1109. 'type' => 'input',
  1110. 'name' => 'transmissionURL',
  1111. 'label' => 'URL',
  1112. 'value' => $GLOBALS['transmissionURL'],
  1113. 'placeholder' => 'http(s)://hostname:port'
  1114. ),
  1115. array(
  1116. 'type' => 'input',
  1117. 'name' => 'transmissionUsername',
  1118. 'label' => 'Username',
  1119. 'value' => $GLOBALS['transmissionUsername']
  1120. ),
  1121. array(
  1122. 'type' => 'password',
  1123. 'name' => 'transmissionPassword',
  1124. 'label' => 'Password',
  1125. 'value' => $GLOBALS['transmissionPassword']
  1126. )
  1127. ),
  1128. 'Misc Options' => array(
  1129. array(
  1130. 'type' => 'switch',
  1131. 'name' => 'transmissionHideSeeding',
  1132. 'label' => 'Hide Seeding',
  1133. 'value' => $GLOBALS['transmissionHideSeeding']
  1134. ), array(
  1135. 'type' => 'switch',
  1136. 'name' => 'transmissionHideCompleted',
  1137. 'label' => 'Hide Completed',
  1138. 'value' => $GLOBALS['transmissionHideCompleted']
  1139. ),
  1140. array(
  1141. 'type' => 'select',
  1142. 'name' => 'homepageDownloadRefresh',
  1143. 'label' => 'Refresh Seconds',
  1144. 'value' => $GLOBALS['homepageDownloadRefresh'],
  1145. 'options' => optionTime()
  1146. ),
  1147. array(
  1148. 'type' => 'switch',
  1149. 'name' => 'transmissionCombine',
  1150. 'label' => 'Add to Combined Downloader',
  1151. 'value' => $GLOBALS['transmissionCombine']
  1152. ),
  1153. )
  1154. )
  1155. ),
  1156. array(
  1157. 'name' => 'qBittorrent',
  1158. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1159. 'image' => 'plugins/images/tabs/qBittorrent.png',
  1160. 'category' => 'Downloader',
  1161. 'settings' => array(
  1162. 'Enable' => array(
  1163. array(
  1164. 'type' => 'switch',
  1165. 'name' => 'homepageqBittorrentEnabled',
  1166. 'label' => 'Enable',
  1167. 'value' => $GLOBALS['homepageqBittorrentEnabled']
  1168. ),
  1169. array(
  1170. 'type' => 'select',
  1171. 'name' => 'homepageqBittorrentAuth',
  1172. 'label' => 'Minimum Authentication',
  1173. 'value' => $GLOBALS['homepageqBittorrentAuth'],
  1174. 'options' => $groups
  1175. )
  1176. ),
  1177. 'Connection' => array(
  1178. array(
  1179. 'type' => 'input',
  1180. 'name' => 'qBittorrentURL',
  1181. 'label' => 'URL',
  1182. 'value' => $GLOBALS['qBittorrentURL'],
  1183. 'placeholder' => 'http(s)://hostname:port'
  1184. ),
  1185. array(
  1186. 'type' => 'input',
  1187. 'name' => 'qBittorrentUsername',
  1188. 'label' => 'Username',
  1189. 'value' => $GLOBALS['qBittorrentUsername']
  1190. ),
  1191. array(
  1192. 'type' => 'password',
  1193. 'name' => 'qBittorrentPassword',
  1194. 'label' => 'Password',
  1195. 'value' => $GLOBALS['qBittorrentPassword']
  1196. )
  1197. ),
  1198. 'Misc Options' => array(
  1199. array(
  1200. 'type' => 'switch',
  1201. 'name' => 'qBittorrentHideSeeding',
  1202. 'label' => 'Hide Seeding',
  1203. 'value' => $GLOBALS['qBittorrentHideSeeding']
  1204. ), array(
  1205. 'type' => 'switch',
  1206. 'name' => 'qBittorrentHideCompleted',
  1207. 'label' => 'Hide Completed',
  1208. 'value' => $GLOBALS['qBittorrentHideCompleted']
  1209. ),
  1210. array(
  1211. 'type' => 'select',
  1212. 'name' => 'qBittorrentSortOrder',
  1213. 'label' => 'Order',
  1214. 'value' => $GLOBALS['qBittorrentSortOrder'],
  1215. 'options' => $qBittorrentSortOptions
  1216. ), array(
  1217. 'type' => 'switch',
  1218. 'name' => 'qBittorrentReverseSorting',
  1219. 'label' => 'Reverse Sorting',
  1220. 'value' => $GLOBALS['qBittorrentReverseSorting']
  1221. ),
  1222. array(
  1223. 'type' => 'select',
  1224. 'name' => 'homepageDownloadRefresh',
  1225. 'label' => 'Refresh Seconds',
  1226. 'value' => $GLOBALS['homepageDownloadRefresh'],
  1227. 'options' => optionTime()
  1228. ),
  1229. array(
  1230. 'type' => 'switch',
  1231. 'name' => 'qBittorrentCombine',
  1232. 'label' => 'Add to Combined Downloader',
  1233. 'value' => $GLOBALS['qBittorrentCombine']
  1234. ),
  1235. )
  1236. )
  1237. ),
  1238. array(
  1239. 'name' => 'rTorrent',
  1240. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1241. 'image' => 'plugins/images/tabs/rTorrent.png',
  1242. 'category' => 'Downloader',
  1243. 'settings' => array(
  1244. 'FYI' => array(
  1245. array(
  1246. 'type' => 'html',
  1247. 'label' => '',
  1248. 'override' => 12,
  1249. 'html' => '
  1250. <div class="row">
  1251. <div class="col-lg-12">
  1252. <div class="panel panel-info">
  1253. <div class="panel-heading">
  1254. <span lang="en">This module requires XMLRPC</span>
  1255. </div>
  1256. <div class="panel-wrapper collapse in" aria-expanded="true">
  1257. <div class="panel-body">
  1258. <span lang="en">Status: [ <b>' . $xmlStatus . '</b> ]</span>
  1259. </div>
  1260. </div>
  1261. </div>
  1262. </div>
  1263. </div>
  1264. '
  1265. )
  1266. ),
  1267. 'Enable' => array(
  1268. array(
  1269. 'type' => 'switch',
  1270. 'name' => 'homepagerTorrentEnabled',
  1271. 'label' => 'Enable',
  1272. 'value' => $GLOBALS['homepagerTorrentEnabled']
  1273. ),
  1274. array(
  1275. 'type' => 'select',
  1276. 'name' => 'homepagerTorrentAuth',
  1277. 'label' => 'Minimum Authentication',
  1278. 'value' => $GLOBALS['homepagerTorrentAuth'],
  1279. 'options' => $groups
  1280. )
  1281. ),
  1282. 'Connection' => array(
  1283. array(
  1284. 'type' => 'input',
  1285. 'name' => 'rTorrentURL',
  1286. 'label' => 'URL',
  1287. 'value' => $GLOBALS['rTorrentURL'],
  1288. 'placeholder' => 'http(s)://hostname:port'
  1289. ),
  1290. array(
  1291. 'type' => 'input',
  1292. 'name' => 'rTorrentUsername',
  1293. 'label' => 'Username',
  1294. 'value' => $GLOBALS['rTorrentUsername']
  1295. ),
  1296. array(
  1297. 'type' => 'password',
  1298. 'name' => 'rTorrentPassword',
  1299. 'label' => 'Password',
  1300. 'value' => $GLOBALS['rTorrentPassword']
  1301. )
  1302. ),
  1303. 'Misc Options' => array(
  1304. array(
  1305. 'type' => 'switch',
  1306. 'name' => 'rTorrentHideSeeding',
  1307. 'label' => 'Hide Seeding',
  1308. 'value' => $GLOBALS['rTorrentHideSeeding']
  1309. ), array(
  1310. 'type' => 'switch',
  1311. 'name' => 'rTorrentHideCompleted',
  1312. 'label' => 'Hide Completed',
  1313. 'value' => $GLOBALS['rTorrentHideCompleted']
  1314. ),
  1315. array(
  1316. 'type' => 'select',
  1317. 'name' => 'rTorrentSortOrder',
  1318. 'label' => 'Order',
  1319. 'value' => $GLOBALS['rTorrentSortOrder'],
  1320. 'options' => $rTorrentSortOptions
  1321. ),
  1322. array(
  1323. 'type' => 'select',
  1324. 'name' => 'homepageDownloadRefresh',
  1325. 'label' => 'Refresh Seconds',
  1326. 'value' => $GLOBALS['homepageDownloadRefresh'],
  1327. 'options' => optionTime()
  1328. ),
  1329. array(
  1330. 'type' => 'switch',
  1331. 'name' => 'rTorrentCombine',
  1332. 'label' => 'Add to Combined Downloader',
  1333. 'value' => $GLOBALS['rTorrentCombine']
  1334. ),
  1335. ),
  1336. 'Test Connection' => array(
  1337. array(
  1338. 'type' => 'blank',
  1339. 'label' => 'Please Save before Testing'
  1340. ),
  1341. array(
  1342. 'type' => 'button',
  1343. 'label' => '',
  1344. 'icon' => 'fa fa-flask',
  1345. 'class' => 'pull-right',
  1346. 'text' => 'Test Connection',
  1347. 'attr' => 'onclick="testAPIConnection(\'rtorrent\')"'
  1348. ),
  1349. )
  1350. )
  1351. ),
  1352. array(
  1353. 'name' => 'Deluge',
  1354. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1355. 'image' => 'plugins/images/tabs/deluge.png',
  1356. 'category' => 'Downloader',
  1357. 'settings' => array(
  1358. 'custom' => '
  1359. <div class="row">
  1360. <div class="col-lg-12">
  1361. <div class="panel panel-info">
  1362. <div class="panel-heading">
  1363. <span lang="en">Notice</span>
  1364. </div>
  1365. <div class="panel-wrapper collapse in" aria-expanded="true">
  1366. <div class="panel-body">
  1367. <ul class="list-icons">
  1368. <li><i class="fa fa-chevron-right text-danger"></i> <a href="https://github.com/idlesign/deluge-webapi/tree/master/dist" target="_blank">Download Plugin</a></li>
  1369. <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>
  1370. <li><i class="fa fa-chevron-right text-danger"></i> Activate WebAPI plugin </li>
  1371. </ul>
  1372. </div>
  1373. </div>
  1374. </div>
  1375. </div>
  1376. </div>
  1377. ',
  1378. 'Enable' => array(
  1379. array(
  1380. 'type' => 'switch',
  1381. 'name' => 'homepageDelugeEnabled',
  1382. 'label' => 'Enable',
  1383. 'value' => $GLOBALS['homepageDelugeEnabled']
  1384. ),
  1385. array(
  1386. 'type' => 'select',
  1387. 'name' => 'homepageDelugeAuth',
  1388. 'label' => 'Minimum Authentication',
  1389. 'value' => $GLOBALS['homepageDelugeAuth'],
  1390. 'options' => $groups
  1391. )
  1392. ),
  1393. 'Connection' => array(
  1394. array(
  1395. 'type' => 'input',
  1396. 'name' => 'delugeURL',
  1397. 'label' => 'URL',
  1398. 'value' => $GLOBALS['delugeURL'],
  1399. 'placeholder' => 'http(s)://hostname:port'
  1400. ),
  1401. array(
  1402. 'type' => 'password',
  1403. 'name' => 'delugePassword',
  1404. 'label' => 'Password',
  1405. 'value' => $GLOBALS['delugePassword']
  1406. )
  1407. ),
  1408. 'Misc Options' => array(
  1409. array(
  1410. 'type' => 'switch',
  1411. 'name' => 'delugeHideSeeding',
  1412. 'label' => 'Hide Seeding',
  1413. 'value' => $GLOBALS['delugeHideSeeding']
  1414. ), array(
  1415. 'type' => 'switch',
  1416. 'name' => 'delugeHideCompleted',
  1417. 'label' => 'Hide Completed',
  1418. 'value' => $GLOBALS['delugeHideCompleted']
  1419. ),
  1420. array(
  1421. 'type' => 'select',
  1422. 'name' => 'homepageDownloadRefresh',
  1423. 'label' => 'Refresh Seconds',
  1424. 'value' => $GLOBALS['homepageDownloadRefresh'],
  1425. 'options' => optionTime()
  1426. ),
  1427. array(
  1428. 'type' => 'switch',
  1429. 'name' => 'delugeCombine',
  1430. 'label' => 'Add to Combined Downloader',
  1431. 'value' => $GLOBALS['delugeCombine']
  1432. ),
  1433. ),
  1434. 'Test Connection' => array(
  1435. array(
  1436. 'type' => 'blank',
  1437. 'label' => 'Please Save before Testing'
  1438. ),
  1439. array(
  1440. 'type' => 'button',
  1441. 'label' => '',
  1442. 'icon' => 'fa fa-flask',
  1443. 'class' => 'pull-right',
  1444. 'text' => 'Test Connection',
  1445. 'attr' => 'onclick="testAPIConnection(\'deluge\')"'
  1446. ),
  1447. )
  1448. )
  1449. ),
  1450. array(
  1451. 'name' => 'Sonarr',
  1452. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1453. 'image' => 'plugins/images/tabs/sonarr.png',
  1454. 'category' => 'PVR',
  1455. 'settings' => array(
  1456. 'Enable' => array(
  1457. array(
  1458. 'type' => 'switch',
  1459. 'name' => 'homepageSonarrEnabled',
  1460. 'label' => 'Enable',
  1461. 'value' => $GLOBALS['homepageSonarrEnabled']
  1462. ),
  1463. array(
  1464. 'type' => 'select',
  1465. 'name' => 'homepageSonarrAuth',
  1466. 'label' => 'Minimum Authentication',
  1467. 'value' => $GLOBALS['homepageSonarrAuth'],
  1468. 'options' => $groups
  1469. )
  1470. ),
  1471. 'Connection' => array(
  1472. array(
  1473. 'type' => 'input',
  1474. 'name' => 'sonarrURL',
  1475. 'label' => 'URL',
  1476. 'value' => $GLOBALS['sonarrURL'],
  1477. 'placeholder' => 'http(s)://hostname:port'
  1478. ),
  1479. array(
  1480. 'type' => 'password-alt',
  1481. 'name' => 'sonarrToken',
  1482. 'label' => 'Token',
  1483. 'value' => $GLOBALS['sonarrToken']
  1484. )
  1485. ),
  1486. 'Misc Options' => array(
  1487. array(
  1488. 'type' => 'number',
  1489. 'name' => 'calendarStart',
  1490. 'label' => '# of Days Before',
  1491. 'value' => $GLOBALS['calendarStart'],
  1492. 'placeholder' => ''
  1493. ),
  1494. array(
  1495. 'type' => 'number',
  1496. 'name' => 'calendarEnd',
  1497. 'label' => '# of Days After',
  1498. 'value' => $GLOBALS['calendarEnd'],
  1499. 'placeholder' => ''
  1500. ),
  1501. array(
  1502. 'type' => 'select',
  1503. 'name' => 'calendarFirstDay',
  1504. 'label' => 'Start Day',
  1505. 'value' => $GLOBALS['calendarFirstDay'],
  1506. 'options' => $day
  1507. ),
  1508. array(
  1509. 'type' => 'select',
  1510. 'name' => 'calendarDefault',
  1511. 'label' => 'Default View',
  1512. 'value' => $GLOBALS['calendarDefault'],
  1513. 'options' => $calendarDefault
  1514. ),
  1515. array(
  1516. 'type' => 'select',
  1517. 'name' => 'calendarTimeFormat',
  1518. 'label' => 'Time Format',
  1519. 'value' => $GLOBALS['calendarTimeFormat'],
  1520. 'options' => $timeFormat
  1521. ),
  1522. array(
  1523. 'type' => 'select',
  1524. 'name' => 'calendarLimit',
  1525. 'label' => 'Items Per Day',
  1526. 'value' => $GLOBALS['calendarLimit'],
  1527. 'options' => $limit
  1528. ),
  1529. array(
  1530. 'type' => 'select',
  1531. 'name' => 'calendarRefresh',
  1532. 'label' => 'Refresh Seconds',
  1533. 'value' => $GLOBALS['calendarRefresh'],
  1534. 'options' => optionTime()
  1535. ),
  1536. array(
  1537. 'type' => 'switch',
  1538. 'name' => 'sonarrUnmonitored',
  1539. 'label' => 'Show Unmonitored',
  1540. 'value' => $GLOBALS['sonarrUnmonitored']
  1541. )
  1542. ),
  1543. 'Test Connection' => array(
  1544. array(
  1545. 'type' => 'blank',
  1546. 'label' => 'Please Save before Testing'
  1547. ),
  1548. array(
  1549. 'type' => 'button',
  1550. 'label' => '',
  1551. 'icon' => 'fa fa-flask',
  1552. 'class' => 'pull-right',
  1553. 'text' => 'Test Connection',
  1554. 'attr' => 'onclick="testAPIConnection(\'sonarr\')"'
  1555. ),
  1556. )
  1557. )
  1558. ),
  1559. array(
  1560. 'name' => 'Lidarr',
  1561. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1562. 'image' => 'plugins/images/tabs/lidarr.png',
  1563. 'category' => 'PMR',
  1564. 'settings' => array(
  1565. 'Enable' => array(
  1566. array(
  1567. 'type' => 'switch',
  1568. 'name' => 'homepageLidarrEnabled',
  1569. 'label' => 'Enable',
  1570. 'value' => $GLOBALS['homepageLidarrEnabled']
  1571. ),
  1572. array(
  1573. 'type' => 'select',
  1574. 'name' => 'homepageLidarrAuth',
  1575. 'label' => 'Minimum Authentication',
  1576. 'value' => $GLOBALS['homepageLidarrAuth'],
  1577. 'options' => $groups
  1578. )
  1579. ),
  1580. 'Connection' => array(
  1581. array(
  1582. 'type' => 'input',
  1583. 'name' => 'lidarrURL',
  1584. 'label' => 'URL',
  1585. 'value' => $GLOBALS['lidarrURL'],
  1586. 'placeholder' => 'http(s)://hostname:port'
  1587. ),
  1588. array(
  1589. 'type' => 'password-alt',
  1590. 'name' => 'lidarrToken',
  1591. 'label' => 'Token',
  1592. 'value' => $GLOBALS['lidarrToken']
  1593. )
  1594. ),
  1595. 'Misc Options' => array(
  1596. array(
  1597. 'type' => 'number',
  1598. 'name' => 'calendarStart',
  1599. 'label' => '# of Days Before',
  1600. 'value' => $GLOBALS['calendarStart'],
  1601. 'placeholder' => ''
  1602. ),
  1603. array(
  1604. 'type' => 'number',
  1605. 'name' => 'calendarEnd',
  1606. 'label' => '# of Days After',
  1607. 'value' => $GLOBALS['calendarEnd'],
  1608. 'placeholder' => ''
  1609. ),
  1610. array(
  1611. 'type' => 'select',
  1612. 'name' => 'calendarFirstDay',
  1613. 'label' => 'Start Day',
  1614. 'value' => $GLOBALS['calendarFirstDay'],
  1615. 'options' => $day
  1616. ),
  1617. array(
  1618. 'type' => 'select',
  1619. 'name' => 'calendarDefault',
  1620. 'label' => 'Default View',
  1621. 'value' => $GLOBALS['calendarDefault'],
  1622. 'options' => $calendarDefault
  1623. ),
  1624. array(
  1625. 'type' => 'select',
  1626. 'name' => 'calendarTimeFormat',
  1627. 'label' => 'Time Format',
  1628. 'value' => $GLOBALS['calendarTimeFormat'],
  1629. 'options' => $timeFormat
  1630. ),
  1631. array(
  1632. 'type' => 'select',
  1633. 'name' => 'calendarLimit',
  1634. 'label' => 'Items Per Day',
  1635. 'value' => $GLOBALS['calendarLimit'],
  1636. 'options' => $limit
  1637. ),
  1638. array(
  1639. 'type' => 'select',
  1640. 'name' => 'calendarRefresh',
  1641. 'label' => 'Refresh Seconds',
  1642. 'value' => $GLOBALS['calendarRefresh'],
  1643. 'options' => optionTime()
  1644. ),
  1645. ),
  1646. 'Test Connection' => array(
  1647. array(
  1648. 'type' => 'blank',
  1649. 'label' => 'Please Save before Testing'
  1650. ),
  1651. array(
  1652. 'type' => 'button',
  1653. 'label' => '',
  1654. 'icon' => 'fa fa-flask',
  1655. 'class' => 'pull-right',
  1656. 'text' => 'Test Connection',
  1657. 'attr' => 'onclick="testAPIConnection(\'lidarr\')"'
  1658. ),
  1659. )
  1660. )
  1661. ),
  1662. array(
  1663. 'name' => 'Radarr',
  1664. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1665. 'image' => 'plugins/images/tabs/radarr.png',
  1666. 'category' => 'PVR',
  1667. 'settings' => array(
  1668. 'Enable' => array(
  1669. array(
  1670. 'type' => 'switch',
  1671. 'name' => 'homepageRadarrEnabled',
  1672. 'label' => 'Enable',
  1673. 'value' => $GLOBALS['homepageRadarrEnabled']
  1674. ),
  1675. array(
  1676. 'type' => 'select',
  1677. 'name' => 'homepageRadarrAuth',
  1678. 'label' => 'Minimum Authentication',
  1679. 'value' => $GLOBALS['homepageRadarrAuth'],
  1680. 'options' => $groups
  1681. )
  1682. ),
  1683. 'Connection' => array(
  1684. array(
  1685. 'type' => 'input',
  1686. 'name' => 'radarrURL',
  1687. 'label' => 'URL',
  1688. 'value' => $GLOBALS['radarrURL'],
  1689. 'placeholder' => 'http(s)://hostname:port'
  1690. ),
  1691. array(
  1692. 'type' => 'password-alt',
  1693. 'name' => 'radarrToken',
  1694. 'label' => 'Token',
  1695. 'value' => $GLOBALS['radarrToken']
  1696. )
  1697. ),
  1698. 'Misc Options' => array(
  1699. array(
  1700. 'type' => 'number',
  1701. 'name' => 'calendarStart',
  1702. 'label' => '# of Days Before',
  1703. 'value' => $GLOBALS['calendarStart'],
  1704. 'placeholder' => ''
  1705. ),
  1706. array(
  1707. 'type' => 'number',
  1708. 'name' => 'calendarEnd',
  1709. 'label' => '# of Days After',
  1710. 'value' => $GLOBALS['calendarEnd'],
  1711. 'placeholder' => ''
  1712. ),
  1713. array(
  1714. 'type' => 'select',
  1715. 'name' => 'calendarFirstDay',
  1716. 'label' => 'Start Day',
  1717. 'value' => $GLOBALS['calendarFirstDay'],
  1718. 'options' => $day
  1719. ),
  1720. array(
  1721. 'type' => 'select',
  1722. 'name' => 'calendarDefault',
  1723. 'label' => 'Default View',
  1724. 'value' => $GLOBALS['calendarDefault'],
  1725. 'options' => $calendarDefault
  1726. ),
  1727. array(
  1728. 'type' => 'select',
  1729. 'name' => 'calendarTimeFormat',
  1730. 'label' => 'Time Format',
  1731. 'value' => $GLOBALS['calendarTimeFormat'],
  1732. 'options' => $timeFormat
  1733. ),
  1734. array(
  1735. 'type' => 'select',
  1736. 'name' => 'calendarLimit',
  1737. 'label' => 'Items Per Day',
  1738. 'value' => $GLOBALS['calendarLimit'],
  1739. 'options' => $limit
  1740. ),
  1741. array(
  1742. 'type' => 'select',
  1743. 'name' => 'calendarRefresh',
  1744. 'label' => 'Refresh Seconds',
  1745. 'value' => $GLOBALS['calendarRefresh'],
  1746. 'options' => optionTime()
  1747. )
  1748. ),
  1749. 'Test Connection' => array(
  1750. array(
  1751. 'type' => 'blank',
  1752. 'label' => 'Please Save before Testing'
  1753. ),
  1754. array(
  1755. 'type' => 'button',
  1756. 'label' => '',
  1757. 'icon' => 'fa fa-flask',
  1758. 'class' => 'pull-right',
  1759. 'text' => 'Test Connection',
  1760. 'attr' => 'onclick="testAPIConnection(\'radarr\')"'
  1761. ),
  1762. )
  1763. )
  1764. ),
  1765. array(
  1766. 'name' => 'CouchPotato',
  1767. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1768. 'image' => 'plugins/images/tabs/couchpotato.png',
  1769. 'category' => 'PVR',
  1770. 'settings' => array(
  1771. 'Enable' => array(
  1772. array(
  1773. 'type' => 'switch',
  1774. 'name' => 'homepageCouchpotatoEnabled',
  1775. 'label' => 'Enable',
  1776. 'value' => $GLOBALS['homepageCouchpotatoEnabled']
  1777. ),
  1778. array(
  1779. 'type' => 'select',
  1780. 'name' => 'homepageCouchpotatoAuth',
  1781. 'label' => 'Minimum Authentication',
  1782. 'value' => $GLOBALS['homepageCouchpotatoAuth'],
  1783. 'options' => $groups
  1784. )
  1785. ),
  1786. 'Connection' => array(
  1787. array(
  1788. 'type' => 'input',
  1789. 'name' => 'couchpotatoURL',
  1790. 'label' => 'URL',
  1791. 'value' => $GLOBALS['couchpotatoURL'],
  1792. 'placeholder' => 'http(s)://hostname:port'
  1793. ),
  1794. array(
  1795. 'type' => 'password-alt',
  1796. 'name' => 'couchpotatoToken',
  1797. 'label' => 'Token',
  1798. 'value' => $GLOBALS['couchpotatoToken']
  1799. )
  1800. ),
  1801. 'Misc Options' => array(
  1802. array(
  1803. 'type' => 'select',
  1804. 'name' => 'calendarFirstDay',
  1805. 'label' => 'Start Day',
  1806. 'value' => $GLOBALS['calendarFirstDay'],
  1807. 'options' => $day
  1808. ),
  1809. array(
  1810. 'type' => 'select',
  1811. 'name' => 'calendarDefault',
  1812. 'label' => 'Default View',
  1813. 'value' => $GLOBALS['calendarDefault'],
  1814. 'options' => $calendarDefault
  1815. ),
  1816. array(
  1817. 'type' => 'select',
  1818. 'name' => 'calendarTimeFormat',
  1819. 'label' => 'Time Format',
  1820. 'value' => $GLOBALS['calendarTimeFormat'],
  1821. 'options' => $timeFormat
  1822. ),
  1823. array(
  1824. 'type' => 'select',
  1825. 'name' => 'calendarLimit',
  1826. 'label' => 'Items Per Day',
  1827. 'value' => $GLOBALS['calendarLimit'],
  1828. 'options' => $limit
  1829. ),
  1830. array(
  1831. 'type' => 'select',
  1832. 'name' => 'calendarRefresh',
  1833. 'label' => 'Refresh Seconds',
  1834. 'value' => $GLOBALS['calendarRefresh'],
  1835. 'options' => optionTime()
  1836. )
  1837. )
  1838. )
  1839. ),
  1840. array(
  1841. 'name' => 'SickRage',
  1842. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1843. 'image' => 'plugins/images/tabs/sickrage.png',
  1844. 'category' => 'PVR',
  1845. 'settings' => array(
  1846. 'Enable' => array(
  1847. array(
  1848. 'type' => 'switch',
  1849. 'name' => 'homepageSickrageEnabled',
  1850. 'label' => 'Enable',
  1851. 'value' => $GLOBALS['homepageSickrageEnabled']
  1852. ),
  1853. array(
  1854. 'type' => 'select',
  1855. 'name' => 'homepageSickrageAuth',
  1856. 'label' => 'Minimum Authentication',
  1857. 'value' => $GLOBALS['homepageSickrageAuth'],
  1858. 'options' => $groups
  1859. )
  1860. ),
  1861. 'Connection' => array(
  1862. array(
  1863. 'type' => 'input',
  1864. 'name' => 'sickrageURL',
  1865. 'label' => 'URL',
  1866. 'value' => $GLOBALS['sickrageURL'],
  1867. 'placeholder' => 'http(s)://hostname:port'
  1868. ),
  1869. array(
  1870. 'type' => 'password-alt',
  1871. 'name' => 'sickrageToken',
  1872. 'label' => 'Token',
  1873. 'value' => $GLOBALS['sickrageToken']
  1874. )
  1875. ),
  1876. 'Misc Options' => array(
  1877. array(
  1878. 'type' => 'select',
  1879. 'name' => 'calendarFirstDay',
  1880. 'label' => 'Start Day',
  1881. 'value' => $GLOBALS['calendarFirstDay'],
  1882. 'options' => $day
  1883. ),
  1884. array(
  1885. 'type' => 'select',
  1886. 'name' => 'calendarDefault',
  1887. 'label' => 'Default View',
  1888. 'value' => $GLOBALS['calendarDefault'],
  1889. 'options' => $calendarDefault
  1890. ),
  1891. array(
  1892. 'type' => 'select',
  1893. 'name' => 'calendarTimeFormat',
  1894. 'label' => 'Time Format',
  1895. 'value' => $GLOBALS['calendarTimeFormat'],
  1896. 'options' => $timeFormat
  1897. ),
  1898. array(
  1899. 'type' => 'select',
  1900. 'name' => 'calendarLimit',
  1901. 'label' => 'Items Per Day',
  1902. 'value' => $GLOBALS['calendarLimit'],
  1903. 'options' => $limit
  1904. ),
  1905. array(
  1906. 'type' => 'select',
  1907. 'name' => 'calendarRefresh',
  1908. 'label' => 'Refresh Seconds',
  1909. 'value' => $GLOBALS['calendarRefresh'],
  1910. 'options' => optionTime()
  1911. )
  1912. )
  1913. )
  1914. ),
  1915. array(
  1916. 'name' => 'Ombi',
  1917. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1918. 'image' => 'plugins/images/tabs/ombi.png',
  1919. 'category' => 'Requests',
  1920. 'settings' => array(
  1921. 'Enable' => array(
  1922. array(
  1923. 'type' => 'switch',
  1924. 'name' => 'homepageOmbiEnabled',
  1925. 'label' => 'Enable',
  1926. 'value' => $GLOBALS['homepageOmbiEnabled']
  1927. ),
  1928. array(
  1929. 'type' => 'select',
  1930. 'name' => 'homepageOmbiAuth',
  1931. 'label' => 'Minimum Authentication',
  1932. 'value' => $GLOBALS['homepageOmbiAuth'],
  1933. 'options' => $groups
  1934. )
  1935. ),
  1936. 'Connection' => array(
  1937. array(
  1938. 'type' => 'input',
  1939. 'name' => 'ombiURL',
  1940. 'label' => 'URL',
  1941. 'value' => $GLOBALS['ombiURL'],
  1942. 'placeholder' => 'http(s)://hostname:port'
  1943. ),
  1944. array(
  1945. 'type' => 'password-alt',
  1946. 'name' => 'ombiToken',
  1947. 'label' => 'Token',
  1948. 'value' => $GLOBALS['ombiToken']
  1949. )
  1950. ),
  1951. 'Misc Options' => array(
  1952. array(
  1953. 'type' => 'select',
  1954. 'name' => 'homepageOmbiRequestAuth',
  1955. 'label' => 'Minimum Group to Request',
  1956. 'value' => $GLOBALS['homepageOmbiRequestAuth'],
  1957. 'options' => $groups
  1958. ),
  1959. array(
  1960. 'type' => 'switch',
  1961. 'name' => 'ombiLimitUser',
  1962. 'label' => 'Limit to User',
  1963. 'value' => $GLOBALS['ombiLimitUser']
  1964. ),
  1965. array(
  1966. 'type' => 'select',
  1967. 'name' => 'ombiRefresh',
  1968. 'label' => 'Refresh Seconds',
  1969. 'value' => $GLOBALS['ombiRefresh'],
  1970. 'options' => optionTime()
  1971. )
  1972. )
  1973. )
  1974. ),
  1975. array(
  1976. 'name' => 'CustomHTML-1',
  1977. 'enabled' => (strpos('personal,business', $GLOBALS['license']) !== false) ? true : false,
  1978. 'image' => 'plugins/images/tabs/custom1.png',
  1979. 'category' => 'Custom',
  1980. 'settings' => array(
  1981. 'Enable' => array(
  1982. array(
  1983. 'type' => 'switch',
  1984. 'name' => 'homepagCustomHTMLoneEnabled',
  1985. 'label' => 'Enable',
  1986. 'value' => $GLOBALS['homepagCustomHTMLoneEnabled']
  1987. ),
  1988. array(
  1989. 'type' => 'select',
  1990. 'name' => 'homepagCustomHTMLoneAuth',
  1991. 'label' => 'Minimum Authentication',
  1992. 'value' => $GLOBALS['homepagCustomHTMLoneAuth'],
  1993. 'options' => $groups
  1994. )
  1995. ),
  1996. 'Code' => array(
  1997. array(
  1998. 'type' => 'textbox',
  1999. 'name' => 'customHTMLone',
  2000. 'class' => 'hidden customHTMLoneTextarea',
  2001. 'label' => '',
  2002. 'value' => $GLOBALS['customHTMLone'],
  2003. ),
  2004. array(
  2005. 'type' => 'html',
  2006. 'override' => 12,
  2007. 'label' => 'Custom HTML/JavaScript',
  2008. '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>'
  2009. ),
  2010. )
  2011. )
  2012. ),
  2013. array(
  2014. 'name' => 'CustomHTML-2',
  2015. 'enabled' => (strpos('personal,business', $GLOBALS['license']) !== false) ? true : false,
  2016. 'image' => 'plugins/images/tabs/custom2.png',
  2017. 'category' => 'Custom',
  2018. 'settings' => array(
  2019. 'Enable' => array(
  2020. array(
  2021. 'type' => 'switch',
  2022. 'name' => 'homepagCustomHTMLtwoEnabled',
  2023. 'label' => 'Enable',
  2024. 'value' => $GLOBALS['homepagCustomHTMLtwoEnabled']
  2025. ),
  2026. array(
  2027. 'type' => 'select',
  2028. 'name' => 'homepagCustomHTMLtwoAuth',
  2029. 'label' => 'Minimum Authentication',
  2030. 'value' => $GLOBALS['homepagCustomHTMLtwoAuth'],
  2031. 'options' => $groups
  2032. )
  2033. ),
  2034. 'Code' => array(
  2035. array(
  2036. 'type' => 'textbox',
  2037. 'name' => 'customHTMLtwo',
  2038. 'class' => 'hidden customHTMLtwoTextarea',
  2039. 'label' => '',
  2040. 'value' => $GLOBALS['customHTMLtwo'],
  2041. ),
  2042. array(
  2043. 'type' => 'html',
  2044. 'override' => 12,
  2045. 'label' => 'Custom HTML/JavaScript',
  2046. '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>'
  2047. ),
  2048. )
  2049. )
  2050. )
  2051. );
  2052. }
  2053. function buildHomepageSettings()
  2054. {
  2055. $homepageOrder = homepageOrder();
  2056. $homepageList = '<h4>Drag Homepage Items to Order Them</h4><div id="homepage-items-sort" class="external-events">';
  2057. $inputList = '<form id="homepage-values" class="row">';
  2058. foreach ($homepageOrder as $key => $val) {
  2059. switch ($key) {
  2060. case 'homepageOrdercustomhtml':
  2061. $class = 'bg-info';
  2062. $image = 'plugins/images/tabs/custom1.png';
  2063. if (!$GLOBALS['homepagCustomHTMLoneEnabled']) {
  2064. $class .= ' faded';
  2065. }
  2066. break;
  2067. case 'homepageOrdercustomhtmlTwo':
  2068. $class = 'bg-info';
  2069. $image = 'plugins/images/tabs/custom2.png';
  2070. if (!$GLOBALS['homepagCustomHTMLtwoEnabled']) {
  2071. $class .= ' faded';
  2072. }
  2073. break;
  2074. case 'homepageOrdertransmission':
  2075. $class = 'bg-transmission';
  2076. $image = 'plugins/images/tabs/transmission.png';
  2077. if (!$GLOBALS['homepageTransmissionEnabled']) {
  2078. $class .= ' faded';
  2079. }
  2080. break;
  2081. case 'homepageOrdernzbget':
  2082. $class = 'bg-nzbget';
  2083. $image = 'plugins/images/tabs/nzbget.png';
  2084. if (!$GLOBALS['homepageNzbgetEnabled']) {
  2085. $class .= ' faded';
  2086. }
  2087. break;
  2088. case 'homepageOrdersabnzbd':
  2089. $class = 'bg-sab';
  2090. $image = 'plugins/images/tabs/sabnzbd.png';
  2091. if (!$GLOBALS['homepageSabnzbdEnabled']) {
  2092. $class .= ' faded';
  2093. }
  2094. break;
  2095. case 'homepageOrderdeluge':
  2096. $class = 'bg-deluge';
  2097. $image = 'plugins/images/tabs/deluge.png';
  2098. if (!$GLOBALS['homepageDelugeEnabled']) {
  2099. $class .= ' faded';
  2100. }
  2101. break;
  2102. case 'homepageOrderqBittorrent':
  2103. $class = 'bg-qbit';
  2104. $image = 'plugins/images/tabs/qBittorrent.png';
  2105. if (!$GLOBALS['homepageqBittorrentEnabled']) {
  2106. $class .= ' faded';
  2107. }
  2108. break;
  2109. case 'homepageOrderrTorrent':
  2110. $class = 'bg-qbit';
  2111. $image = 'plugins/images/tabs/rTorrent.png';
  2112. if (!$GLOBALS['homepagerTorrentEnabled']) {
  2113. $class .= ' faded';
  2114. }
  2115. break;
  2116. case 'homepageOrderplexnowplaying':
  2117. case 'homepageOrderplexrecent':
  2118. case 'homepageOrderplexplaylist':
  2119. $class = 'bg-plex';
  2120. $image = 'plugins/images/tabs/plex.png';
  2121. if (!$GLOBALS['homepagePlexEnabled']) {
  2122. $class .= ' faded';
  2123. }
  2124. break;
  2125. case 'homepageOrderembynowplaying':
  2126. case 'homepageOrderembyrecent':
  2127. $class = 'bg-emby';
  2128. $image = 'plugins/images/tabs/emby.png';
  2129. if (!$GLOBALS['homepageEmbyEnabled']) {
  2130. $class .= ' faded';
  2131. }
  2132. break;
  2133. case 'homepageOrderombi':
  2134. $class = 'bg-inverse';
  2135. $image = 'plugins/images/tabs/ombi.png';
  2136. if (!$GLOBALS['homepageOmbiEnabled']) {
  2137. $class .= ' faded';
  2138. }
  2139. break;
  2140. case 'homepageOrdercalendar':
  2141. $class = 'bg-primary';
  2142. $image = 'plugins/images/tabs/calendar.png';
  2143. if (!$GLOBALS['homepageSonarrEnabled'] && !$GLOBALS['homepageRadarrEnabled'] && !$GLOBALS['homepageSickrageEnabled'] && !$GLOBALS['homepageCouchpotatoEnabled']) {
  2144. $class .= ' faded';
  2145. }
  2146. break;
  2147. case 'homepageOrderdownloader':
  2148. $class = 'bg-inverse';
  2149. $image = 'plugins/images/tabs/downloader.png';
  2150. if (!$GLOBALS['sabnzbdCombine'] && !$GLOBALS['nzbgetCombine'] && !$GLOBALS['rTorrentCombine'] && !$GLOBALS['delugeCombine'] && !$GLOBALS['transmissionCombine'] && !$GLOBALS['qBittorrentCombine']) {
  2151. $class .= ' faded';
  2152. }
  2153. break;
  2154. default:
  2155. $class = 'blue-bg';
  2156. $image = '';
  2157. break;
  2158. }
  2159. $homepageList .= '
  2160. <div class="col-md-3 col-xs-12 sort-homepage m-t-10 hvr-grow">
  2161. <div class="homepage-drag fc-event ' . $class . ' lazyload" data-src="' . $image . '">
  2162. <span class="ordinal-position text-uppercase badge bg-org homepage-number" data-link="' . $key . '" style="float:left;width: 30px;">' . $val . '</span>
  2163. <span class="homepage-text">&nbsp; ' . strtoupper(substr($key, 13)) . '</span>
  2164. </div>
  2165. </div>
  2166. ';
  2167. $inputList .= '<input type="hidden" name="' . $key . '">';
  2168. }
  2169. $homepageList .= '</div>';
  2170. $inputList .= '</form>';
  2171. return $homepageList . $inputList;
  2172. }