homepage-functions.php 61 KB

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