homepage-functions.php 54 KB

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