homepage-functions.php 68 KB

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