4
0

homepage-functions.php 59 KB

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