homepage-functions.php 54 KB

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