homepage-functions.php 54 KB

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