homepage-functions.php 54 KB

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