homepage-functions.php 50 KB

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