homepage-functions.php 55 KB

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