homepage-functions.php 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731
  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. $limit = array(
  219. array(
  220. 'name' => '1 Item',
  221. 'value' => '1'
  222. ),
  223. array(
  224. 'name' => '2 Items',
  225. 'value' => '2'
  226. ),
  227. array(
  228. 'name' => '3 Items',
  229. 'value' => '3'
  230. ),
  231. array(
  232. 'name' => '4 Items',
  233. 'value' => '4'
  234. ),
  235. array(
  236. 'name' => '5 Items',
  237. 'value' => '5'
  238. ),
  239. array(
  240. 'name' => '6 Items',
  241. 'value' => '6'
  242. ),
  243. array(
  244. 'name' => '7 Items',
  245. 'value' => '7'
  246. ),
  247. array(
  248. 'name' => '8 Items',
  249. 'value' => '8'
  250. ),
  251. array(
  252. 'name' => 'Unlimited',
  253. 'value' => '1000'
  254. ),
  255. );
  256. $day = array(
  257. array(
  258. 'name' => 'Sunday',
  259. 'value' => '0'
  260. ),
  261. array(
  262. 'name' => 'Monday',
  263. 'value' => '1'
  264. ),
  265. array(
  266. 'name' => 'Tueday',
  267. 'value' => '2'
  268. ),
  269. array(
  270. 'name' => 'Wednesday',
  271. 'value' => '3'
  272. ),
  273. array(
  274. 'name' => 'Thursday',
  275. 'value' => '4'
  276. ),
  277. array(
  278. 'name' => 'Friday',
  279. 'value' => '5'
  280. ),
  281. array(
  282. 'name' => 'Saturday',
  283. 'value' => '6'
  284. )
  285. );
  286. $calendarDefault = array(
  287. array(
  288. 'name' => 'Month',
  289. 'value' => 'month'
  290. ),
  291. array(
  292. 'name' => 'Day',
  293. 'value' => 'basicDay'
  294. ),
  295. array(
  296. 'name' => 'Week',
  297. 'value' => 'basicWeek'
  298. ),
  299. array(
  300. 'name' => 'List',
  301. 'value' => 'list'
  302. )
  303. );
  304. $timeFormat = array(
  305. array(
  306. 'name' => '6p',
  307. 'value' => 'h(:mm)t'
  308. ),
  309. array(
  310. 'name' => '6:00p',
  311. 'value' => 'h:mmt'
  312. ),
  313. array(
  314. 'name' => '6:00',
  315. 'value' => 'h:mm'
  316. ),
  317. array(
  318. 'name' => '18',
  319. 'value' => 'H(:mm)'
  320. ),
  321. array(
  322. 'name' => '18:00',
  323. 'value' => 'H:mm'
  324. )
  325. );
  326. $qBittorrentSortOptions = array(
  327. array(
  328. 'name' => 'Hash',
  329. 'value' => 'hash'
  330. ),
  331. array(
  332. 'name' => 'Name',
  333. 'value' => 'name'
  334. ),
  335. array(
  336. 'name' => 'Size',
  337. 'value' => 'size'
  338. ),
  339. array(
  340. 'name' => 'Progress',
  341. 'value' => 'progress'
  342. ),
  343. array(
  344. 'name' => 'Download Speed',
  345. 'value' => 'dlspeed'
  346. ),
  347. array(
  348. 'name' => 'Upload Speed',
  349. 'value' => 'upspeed'
  350. ),
  351. array(
  352. 'name' => 'Priority',
  353. 'value' => 'priority'
  354. ),
  355. array(
  356. 'name' => 'Number of Seeds',
  357. 'value' => 'num_seeds'
  358. ),
  359. array(
  360. 'name' => 'Number of Seeds in Swarm',
  361. 'value' => 'num_complete'
  362. ),
  363. array(
  364. 'name' => 'Number of Leechers',
  365. 'value' => 'num_leechs'
  366. ),
  367. array(
  368. 'name' => 'Number of Leechers in Swarm',
  369. 'value' => 'num_incomplete'
  370. ),
  371. array(
  372. 'name' => 'Ratio',
  373. 'value' => 'ratio'
  374. ),
  375. array(
  376. 'name' => 'ETA',
  377. 'value' => 'eta'
  378. ),
  379. array(
  380. 'name' => 'State',
  381. 'value' => 'state'
  382. ),
  383. array(
  384. 'name' => 'Category',
  385. 'value' => 'category'
  386. )
  387. );
  388. return array(array(
  389. 'name' => 'Calendar',
  390. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  391. 'image' => 'plugins/images/tabs/calendar.png',
  392. 'category' => 'HOMEPAGE',
  393. 'settings' => array(
  394. 'Enable' => array(
  395. array(
  396. 'type' => 'switch',
  397. 'name' => 'homepageCalendarEnabled',
  398. 'label' => 'Enable iCal',
  399. 'value' => $GLOBALS['homepageCalendarEnabled']
  400. ),
  401. array(
  402. 'type' => 'select',
  403. 'name' => 'homepageCalendarAuth',
  404. 'label' => 'Minimum Authentication',
  405. 'value' => $GLOBALS['homepageCalendarAuth'],
  406. 'options' => $groups
  407. ),
  408. array(
  409. 'type' => 'input',
  410. 'name' => 'calendariCal',
  411. 'label' => 'iCal URL\'s',
  412. 'value' => $GLOBALS['calendariCal'],
  413. 'placeholder' => 'separate by comma\'s'
  414. ),
  415. ),
  416. 'Misc Options' => array(
  417. array(
  418. 'type' => 'number',
  419. 'name' => 'calendarStart',
  420. 'label' => '# of Days Before',
  421. 'value' => $GLOBALS['calendarStart'],
  422. 'placeholder' => ''
  423. ),
  424. array(
  425. 'type' => 'number',
  426. 'name' => 'calendarEnd',
  427. 'label' => '# of Days After',
  428. 'value' => $GLOBALS['calendarEnd'],
  429. 'placeholder' => ''
  430. ),
  431. array(
  432. 'type' => 'select',
  433. 'name' => 'calendarFirstDay',
  434. 'label' => 'Start Day',
  435. 'value' => $GLOBALS['calendarFirstDay'],
  436. 'options' => $day
  437. ),
  438. array(
  439. 'type' => 'select',
  440. 'name' => 'calendarDefault',
  441. 'label' => 'Default View',
  442. 'value' => $GLOBALS['calendarDefault'],
  443. 'options' => $calendarDefault
  444. ),
  445. array(
  446. 'type' => 'select',
  447. 'name' => 'calendarTimeFormat',
  448. 'label' => 'Time Format',
  449. 'value' => $GLOBALS['calendarTimeFormat'],
  450. 'options' => $timeFormat
  451. ),
  452. array(
  453. 'type' => 'select',
  454. 'name' => 'calendarLimit',
  455. 'label' => 'Items Per Day',
  456. 'value' => $GLOBALS['calendarLimit'],
  457. 'options' => $limit
  458. ),
  459. array(
  460. 'type' => 'select',
  461. 'name' => 'calendarRefresh',
  462. 'label' => 'Refresh Seconds',
  463. 'value' => $GLOBALS['calendarRefresh'],
  464. 'options' => optionTime()
  465. )
  466. ),
  467. )
  468. ),
  469. array(
  470. 'name' => 'Plex',
  471. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  472. 'image' => 'plugins/images/tabs/plex.png',
  473. 'category' => 'Media Server',
  474. //'license' => $GLOBALS['license'],
  475. 'settings' => array(
  476. 'Enable' => array(
  477. array(
  478. 'type' => 'switch',
  479. 'name' => 'homepagePlexEnabled',
  480. 'label' => 'Enable',
  481. 'value' => $GLOBALS['homepagePlexEnabled']
  482. ),
  483. array(
  484. 'type' => 'select',
  485. 'name' => 'homepagePlexAuth',
  486. 'label' => 'Minimum Authentication',
  487. 'value' => $GLOBALS['homepagePlexAuth'],
  488. 'options' => $groups
  489. )
  490. ),
  491. 'Connection' => array(
  492. array(
  493. 'type' => 'input',
  494. 'name' => 'plexURL',
  495. 'label' => 'URL',
  496. 'value' => $GLOBALS['plexURL'],
  497. 'placeholder' => 'http(s)://hostname:port'
  498. ),
  499. array(
  500. 'type' => 'password-alt',
  501. 'name' => 'plexToken',
  502. 'label' => 'Token',
  503. 'value' => $GLOBALS['plexToken']
  504. ),
  505. array(
  506. 'type' => 'password-alt',
  507. 'name' => 'plexID',
  508. 'label' => 'Plex Machine',
  509. 'value' => $GLOBALS['plexID']
  510. )
  511. ),
  512. 'Active Streams' => array(
  513. array(
  514. 'type' => 'switch',
  515. 'name' => 'homepagePlexStreams',
  516. 'label' => 'Enable',
  517. 'value' => $GLOBALS['homepagePlexStreams']
  518. ),
  519. array(
  520. 'type' => 'select',
  521. 'name' => 'homepagePlexStreamsAuth',
  522. 'label' => 'Minimum Authorization',
  523. 'value' => $GLOBALS['homepagePlexStreamsAuth'],
  524. 'options' => $groups
  525. ),
  526. array(
  527. 'type' => 'switch',
  528. 'name' => 'homepageShowStreamNames',
  529. 'label' => 'User Information',
  530. 'value' => $GLOBALS['homepageShowStreamNames']
  531. ),
  532. array(
  533. 'type' => 'select',
  534. 'name' => 'homepageShowStreamNamesAuth',
  535. 'label' => 'Minimum Authorization',
  536. 'value' => $GLOBALS['homepageShowStreamNamesAuth'],
  537. 'options' => $groups
  538. ),
  539. array(
  540. 'type' => 'select',
  541. 'name' => 'homepageStreamRefresh',
  542. 'label' => 'Refresh Seconds',
  543. 'value' => $GLOBALS['homepageStreamRefresh'],
  544. 'options' => optionTime()
  545. ),
  546. ),
  547. 'Recent Items' => array(
  548. array(
  549. 'type' => 'switch',
  550. 'name' => 'homepagePlexRecent',
  551. 'label' => 'Enable',
  552. 'value' => $GLOBALS['homepagePlexRecent']
  553. ),
  554. array(
  555. 'type' => 'select',
  556. 'name' => 'homepagePlexRecentAuth',
  557. 'label' => 'Minimum Authorization',
  558. 'value' => $GLOBALS['homepagePlexRecentAuth'],
  559. 'options' => $groups
  560. ),
  561. array(
  562. 'type' => 'number',
  563. 'name' => 'homepageRecentLimit',
  564. 'label' => 'Item Limit',
  565. 'value' => $GLOBALS['homepageRecentLimit'],
  566. ),
  567. array(
  568. 'type' => 'select',
  569. 'name' => 'homepageRecentRefresh',
  570. 'label' => 'Refresh Seconds',
  571. 'value' => $GLOBALS['homepageRecentRefresh'],
  572. 'options' => optionTime()
  573. ),
  574. ),
  575. 'Media Search' => array(
  576. array(
  577. 'type' => 'switch',
  578. 'name' => 'mediaSearch',
  579. 'label' => 'Enable',
  580. 'value' => $GLOBALS['mediaSearch']
  581. ),
  582. array(
  583. 'type' => 'select',
  584. 'name' => 'mediaSearchAuth',
  585. 'label' => 'Minimum Authorization',
  586. 'value' => $GLOBALS['mediaSearchAuth'],
  587. 'options' => $groups
  588. ),
  589. array(
  590. 'type' => 'select',
  591. 'name' => 'mediaSearchType',
  592. 'label' => 'Media Server',
  593. 'value' => $GLOBALS['mediaSearchType'],
  594. 'options' => $mediaServers
  595. ),
  596. ),
  597. 'Playlists' => array(
  598. array(
  599. 'type' => 'switch',
  600. 'name' => 'homepagePlexPlaylist',
  601. 'label' => 'Enable',
  602. 'value' => $GLOBALS['homepagePlexPlaylist']
  603. ),
  604. array(
  605. 'type' => 'select',
  606. 'name' => 'homepagePlexPlaylistAuth',
  607. 'label' => 'Minimum Authorization',
  608. 'value' => $GLOBALS['homepagePlexPlaylistAuth'],
  609. 'options' => $groups
  610. ),
  611. ),
  612. 'Misc Options' => array(
  613. array(
  614. 'type' => 'input',
  615. 'name' => 'plexTabName',
  616. 'label' => 'Plex Tab Name',
  617. 'value' => $GLOBALS['plexTabName'],
  618. 'placeholder' => 'Only use if you have Plex in a reverse proxy'
  619. ),
  620. array(
  621. 'type' => 'input',
  622. 'name' => 'plexTabURL',
  623. 'label' => 'Plex Tab WAN URL',
  624. 'value' => $GLOBALS['plexTabURL'],
  625. 'placeholder' => 'http(s)://hostname:port'
  626. )
  627. ),
  628. 'Test Connection' => array(
  629. array(
  630. 'type' => 'blank',
  631. 'label' => 'Please Save before Testing'
  632. ),
  633. array(
  634. 'type' => 'button',
  635. 'label' => '',
  636. 'icon' => 'fa fa-flask',
  637. 'class' => 'pull-right',
  638. 'text' => 'Test Connection',
  639. 'attr' => 'onclick="testAPIConnection(\'plex\')"'
  640. ),
  641. )
  642. )
  643. ),
  644. array(
  645. 'name' => 'Emby',
  646. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  647. 'image' => 'plugins/images/tabs/emby.png',
  648. 'category' => 'Media Server',
  649. 'settings' => array(
  650. 'Enable' => array(
  651. array(
  652. 'type' => 'switch',
  653. 'name' => 'homepageEmbyEnabled',
  654. 'label' => 'Enable',
  655. 'value' => $GLOBALS['homepageEmbyEnabled']
  656. ),
  657. array(
  658. 'type' => 'select',
  659. 'name' => 'homepageEmbyAuth',
  660. 'label' => 'Minimum Authentication',
  661. 'value' => $GLOBALS['homepageEmbyAuth'],
  662. 'options' => $groups
  663. )
  664. ),
  665. 'Connection' => array(
  666. array(
  667. 'type' => 'input',
  668. 'name' => 'embyURL',
  669. 'label' => 'URL',
  670. 'value' => $GLOBALS['embyURL'],
  671. 'placeholder' => 'http(s)://hostname:port'
  672. ),
  673. array(
  674. 'type' => 'password-alt',
  675. 'name' => 'embyToken',
  676. 'label' => 'Token',
  677. 'value' => $GLOBALS['embyToken']
  678. )
  679. ),
  680. 'Active Streams' => array(
  681. array(
  682. 'type' => 'switch',
  683. 'name' => 'homepageEmbyStreams',
  684. 'label' => 'Enable',
  685. 'value' => $GLOBALS['homepageEmbyStreams']
  686. ),
  687. array(
  688. 'type' => 'select',
  689. 'name' => 'homepageEmbyStreamsAuth',
  690. 'label' => 'Minimum Authorization',
  691. 'value' => $GLOBALS['homepageEmbyStreamsAuth'],
  692. 'options' => $groups
  693. ),
  694. array(
  695. 'type' => 'switch',
  696. 'name' => 'homepageShowStreamNames',
  697. 'label' => 'User Information',
  698. 'value' => $GLOBALS['homepageShowStreamNames']
  699. ),
  700. array(
  701. 'type' => 'select',
  702. 'name' => 'homepageShowStreamNamesAuth',
  703. 'label' => 'Minimum Authorization',
  704. 'value' => $GLOBALS['homepageShowStreamNamesAuth'],
  705. 'options' => $groups
  706. ),
  707. array(
  708. 'type' => 'select',
  709. 'name' => 'homepageStreamRefresh',
  710. 'label' => 'Refresh Seconds',
  711. 'value' => $GLOBALS['homepageStreamRefresh'],
  712. 'options' => optionTime()
  713. ),
  714. ),
  715. 'Recent Items' => array(
  716. array(
  717. 'type' => 'switch',
  718. 'name' => 'homepageEmbyRecent',
  719. 'label' => 'Enable',
  720. 'value' => $GLOBALS['homepageEmbyRecent']
  721. ),
  722. array(
  723. 'type' => 'select',
  724. 'name' => 'homepageEmbyRecentAuth',
  725. 'label' => 'Minimum Authorization',
  726. 'value' => $GLOBALS['homepageEmbyRecentAuth'],
  727. 'options' => $groups
  728. ),
  729. array(
  730. 'type' => 'number',
  731. 'name' => 'homepageRecentLimit',
  732. 'label' => 'Item Limit',
  733. 'value' => $GLOBALS['homepageRecentLimit'],
  734. ),
  735. array(
  736. 'type' => 'select',
  737. 'name' => 'homepageRecentRefresh',
  738. 'label' => 'Refresh Seconds',
  739. 'value' => $GLOBALS['homepageRecentRefresh'],
  740. 'options' => optionTime()
  741. ),
  742. ),
  743. 'Misc Options' => array(
  744. array(
  745. 'type' => 'input',
  746. 'name' => 'embyTabName',
  747. 'label' => 'Emby Tab Name',
  748. 'value' => $GLOBALS['embyTabName'],
  749. 'placeholder' => 'Only use if you have Emby in a reverse proxy'
  750. ),
  751. array(
  752. 'type' => 'input',
  753. 'name' => 'embyTabURL',
  754. 'label' => 'Emby Tab WAN URL',
  755. 'value' => $GLOBALS['embyTabURL'],
  756. 'placeholder' => 'http(s)://hostname:port'
  757. )
  758. )
  759. )
  760. ),
  761. array(
  762. 'name' => 'SabNZBD',
  763. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  764. 'image' => 'plugins/images/tabs/sabnzbd.png',
  765. 'category' => 'Downloader',
  766. 'settings' => array(
  767. 'Enable' => array(
  768. array(
  769. 'type' => 'switch',
  770. 'name' => 'homepageSabnzbdEnabled',
  771. 'label' => 'Enable',
  772. 'value' => $GLOBALS['homepageSabnzbdEnabled']
  773. ),
  774. array(
  775. 'type' => 'select',
  776. 'name' => 'homepageSabnzbdAuth',
  777. 'label' => 'Minimum Authentication',
  778. 'value' => $GLOBALS['homepageSabnzbdAuth'],
  779. 'options' => $groups
  780. )
  781. ),
  782. 'Connection' => array(
  783. array(
  784. 'type' => 'input',
  785. 'name' => 'sabnzbdURL',
  786. 'label' => 'URL',
  787. 'value' => $GLOBALS['sabnzbdURL'],
  788. 'placeholder' => 'http(s)://hostname:port'
  789. ),
  790. array(
  791. 'type' => 'password-alt',
  792. 'name' => 'sabnzbdToken',
  793. 'label' => 'Token',
  794. 'value' => $GLOBALS['sabnzbdToken']
  795. )
  796. ),
  797. 'Misc Options' => array(
  798. array(
  799. 'type' => 'select',
  800. 'name' => 'homepageDownloadRefresh',
  801. 'label' => 'Refresh Seconds',
  802. 'value' => $GLOBALS['homepageDownloadRefresh'],
  803. 'options' => optionTime()
  804. )
  805. ),
  806. 'Test Connection' => array(
  807. array(
  808. 'type' => 'blank',
  809. 'label' => 'Please Save before Testing'
  810. ),
  811. array(
  812. 'type' => 'button',
  813. 'label' => '',
  814. 'icon' => 'fa fa-flask',
  815. 'class' => 'pull-right',
  816. 'text' => 'Test Connection',
  817. 'attr' => 'onclick="testAPIConnection(\'sabnzbd\')"'
  818. ),
  819. )
  820. )
  821. ),
  822. array(
  823. 'name' => 'NZBGet',
  824. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  825. 'image' => 'plugins/images/tabs/nzbget.png',
  826. 'category' => 'Downloader',
  827. 'settings' => array(
  828. 'Enable' => array(
  829. array(
  830. 'type' => 'switch',
  831. 'name' => 'homepageNzbgetEnabled',
  832. 'label' => 'Enable',
  833. 'value' => $GLOBALS['homepageNzbgetEnabled']
  834. ),
  835. array(
  836. 'type' => 'select',
  837. 'name' => 'homepageNzbgetAuth',
  838. 'label' => 'Minimum Authentication',
  839. 'value' => $GLOBALS['homepageNzbgetAuth'],
  840. 'options' => $groups
  841. )
  842. ),
  843. 'Connection' => array(
  844. array(
  845. 'type' => 'input',
  846. 'name' => 'nzbgetURL',
  847. 'label' => 'URL',
  848. 'value' => $GLOBALS['nzbgetURL'],
  849. 'placeholder' => 'http(s)://hostname:port'
  850. ),
  851. array(
  852. 'type' => 'input',
  853. 'name' => 'nzbgetUsername',
  854. 'label' => 'Username',
  855. 'value' => $GLOBALS['nzbgetUsername']
  856. ),
  857. array(
  858. 'type' => 'password',
  859. 'name' => 'nzbgetPassword',
  860. 'label' => 'Password',
  861. 'value' => $GLOBALS['nzbgetPassword']
  862. )
  863. ),
  864. 'Misc Options' => array(
  865. array(
  866. 'type' => 'select',
  867. 'name' => 'homepageDownloadRefresh',
  868. 'label' => 'Refresh Seconds',
  869. 'value' => $GLOBALS['homepageDownloadRefresh'],
  870. 'options' => optionTime()
  871. )
  872. ),
  873. 'Test Connection' => array(
  874. array(
  875. 'type' => 'blank',
  876. 'label' => 'Please Save before Testing'
  877. ),
  878. array(
  879. 'type' => 'button',
  880. 'label' => '',
  881. 'icon' => 'fa fa-flask',
  882. 'class' => 'pull-right',
  883. 'text' => 'Test Connection',
  884. 'attr' => 'onclick="testAPIConnection(\'nzbget\')"'
  885. ),
  886. )
  887. )
  888. ),
  889. array(
  890. 'name' => 'Transmission',
  891. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  892. 'image' => 'plugins/images/tabs/transmission.png',
  893. 'category' => 'Downloader',
  894. 'settings' => array(
  895. 'Enable' => array(
  896. array(
  897. 'type' => 'switch',
  898. 'name' => 'homepageTransmissionEnabled',
  899. 'label' => 'Enable',
  900. 'value' => $GLOBALS['homepageTransmissionEnabled']
  901. ),
  902. array(
  903. 'type' => 'select',
  904. 'name' => 'homepageTransmissionAuth',
  905. 'label' => 'Minimum Authentication',
  906. 'value' => $GLOBALS['homepageTransmissionAuth'],
  907. 'options' => $groups
  908. )
  909. ),
  910. 'Connection' => array(
  911. array(
  912. 'type' => 'input',
  913. 'name' => 'transmissionURL',
  914. 'label' => 'URL',
  915. 'value' => $GLOBALS['transmissionURL'],
  916. 'placeholder' => 'http(s)://hostname:port'
  917. ),
  918. array(
  919. 'type' => 'input',
  920. 'name' => 'transmissionUsername',
  921. 'label' => 'Username',
  922. 'value' => $GLOBALS['transmissionUsername']
  923. ),
  924. array(
  925. 'type' => 'password',
  926. 'name' => 'transmissionPassword',
  927. 'label' => 'Password',
  928. 'value' => $GLOBALS['transmissionPassword']
  929. )
  930. ),
  931. 'Misc Options' => array(
  932. array(
  933. 'type' => 'switch',
  934. 'name' => 'transmissionHideSeeding',
  935. 'label' => 'Hide Seeding',
  936. 'value' => $GLOBALS['transmissionHideSeeding']
  937. ), array(
  938. 'type' => 'switch',
  939. 'name' => 'transmissionHideCompleted',
  940. 'label' => 'Hide Completed',
  941. 'value' => $GLOBALS['transmissionHideCompleted']
  942. ),
  943. array(
  944. 'type' => 'select',
  945. 'name' => 'homepageDownloadRefresh',
  946. 'label' => 'Refresh Seconds',
  947. 'value' => $GLOBALS['homepageDownloadRefresh'],
  948. 'options' => optionTime()
  949. )
  950. )
  951. )
  952. ),
  953. array(
  954. 'name' => 'qBittorrent',
  955. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  956. 'image' => 'plugins/images/tabs/qBittorrent.png',
  957. 'category' => 'Downloader',
  958. 'settings' => array(
  959. 'Enable' => array(
  960. array(
  961. 'type' => 'switch',
  962. 'name' => 'homepageqBittorrentEnabled',
  963. 'label' => 'Enable',
  964. 'value' => $GLOBALS['homepageqBittorrentEnabled']
  965. ),
  966. array(
  967. 'type' => 'select',
  968. 'name' => 'homepageqBittorrentAuth',
  969. 'label' => 'Minimum Authentication',
  970. 'value' => $GLOBALS['homepageqBittorrentAuth'],
  971. 'options' => $groups
  972. )
  973. ),
  974. 'Connection' => array(
  975. array(
  976. 'type' => 'input',
  977. 'name' => 'qBittorrentURL',
  978. 'label' => 'URL',
  979. 'value' => $GLOBALS['qBittorrentURL'],
  980. 'placeholder' => 'http(s)://hostname:port'
  981. ),
  982. array(
  983. 'type' => 'input',
  984. 'name' => 'qBittorrentUsername',
  985. 'label' => 'Username',
  986. 'value' => $GLOBALS['qBittorrentUsername']
  987. ),
  988. array(
  989. 'type' => 'password',
  990. 'name' => 'qBittorrentPassword',
  991. 'label' => 'Password',
  992. 'value' => $GLOBALS['qBittorrentPassword']
  993. )
  994. ),
  995. 'Misc Options' => array(
  996. array(
  997. 'type' => 'switch',
  998. 'name' => 'qBittorrentHideSeeding',
  999. 'label' => 'Hide Seeding',
  1000. 'value' => $GLOBALS['qBittorrentHideSeeding']
  1001. ), array(
  1002. 'type' => 'switch',
  1003. 'name' => 'qBittorrentHideCompleted',
  1004. 'label' => 'Hide Completed',
  1005. 'value' => $GLOBALS['qBittorrentHideCompleted']
  1006. ),
  1007. array(
  1008. 'type' => 'select',
  1009. 'name' => 'qBittorrentSortOrder',
  1010. 'label' => 'Order',
  1011. 'value' => $GLOBALS['qBittorrentSortOrder'],
  1012. 'options' => $qBittorrentSortOptions
  1013. ), array(
  1014. 'type' => 'switch',
  1015. 'name' => 'qBittorrentReverseSorting',
  1016. 'label' => 'Reverse Sorting',
  1017. 'value' => $GLOBALS['qBittorrentReverseSorting']
  1018. ),
  1019. array(
  1020. 'type' => 'select',
  1021. 'name' => 'homepageDownloadRefresh',
  1022. 'label' => 'Refresh Seconds',
  1023. 'value' => $GLOBALS['homepageDownloadRefresh'],
  1024. 'options' => optionTime()
  1025. )
  1026. )
  1027. )
  1028. ),
  1029. array(
  1030. 'name' => 'Deluge',
  1031. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1032. 'image' => 'plugins/images/tabs/deluge.png',
  1033. 'category' => 'Downloader',
  1034. 'settings' => array(
  1035. 'custom' => '
  1036. <div class="row">
  1037. <div class="col-lg-12">
  1038. <div class="panel panel-info">
  1039. <div class="panel-heading">
  1040. <span lang="en">Notice</span>
  1041. </div>
  1042. <div class="panel-wrapper collapse in" aria-expanded="true">
  1043. <div class="panel-body">
  1044. <ul class="list-icons">
  1045. <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>
  1046. <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>
  1047. <li><i class="fa fa-chevron-right text-danger"></i> Activate WebAPI plugin </li>
  1048. </ul>
  1049. </div>
  1050. </div>
  1051. </div>
  1052. </div>
  1053. </div>
  1054. ',
  1055. 'Enable' => array(
  1056. array(
  1057. 'type' => 'switch',
  1058. 'name' => 'homepageDelugeEnabled',
  1059. 'label' => 'Enable',
  1060. 'value' => $GLOBALS['homepageDelugeEnabled']
  1061. ),
  1062. array(
  1063. 'type' => 'select',
  1064. 'name' => 'homepageDelugeAuth',
  1065. 'label' => 'Minimum Authentication',
  1066. 'value' => $GLOBALS['homepageDelugeAuth'],
  1067. 'options' => $groups
  1068. )
  1069. ),
  1070. 'Connection' => array(
  1071. array(
  1072. 'type' => 'input',
  1073. 'name' => 'delugeURL',
  1074. 'label' => 'URL',
  1075. 'value' => $GLOBALS['delugeURL'],
  1076. 'placeholder' => 'http(s)://hostname:port'
  1077. ),
  1078. array(
  1079. 'type' => 'password',
  1080. 'name' => 'delugePassword',
  1081. 'label' => 'Password',
  1082. 'value' => $GLOBALS['delugePassword']
  1083. )
  1084. ),
  1085. 'Misc Options' => array(
  1086. array(
  1087. 'type' => 'switch',
  1088. 'name' => 'delugeHideSeeding',
  1089. 'label' => 'Hide Seeding',
  1090. 'value' => $GLOBALS['delugeHideSeeding']
  1091. ), array(
  1092. 'type' => 'switch',
  1093. 'name' => 'delugeHideCompleted',
  1094. 'label' => 'Hide Completed',
  1095. 'value' => $GLOBALS['delugeHideCompleted']
  1096. ),
  1097. array(
  1098. 'type' => 'select',
  1099. 'name' => 'homepageDownloadRefresh',
  1100. 'label' => 'Refresh Seconds',
  1101. 'value' => $GLOBALS['homepageDownloadRefresh'],
  1102. 'options' => optionTime()
  1103. )
  1104. ),
  1105. 'Test Connection' => array(
  1106. array(
  1107. 'type' => 'blank',
  1108. 'label' => 'Please Save before Testing'
  1109. ),
  1110. array(
  1111. 'type' => 'button',
  1112. 'label' => '',
  1113. 'icon' => 'fa fa-flask',
  1114. 'class' => 'pull-right',
  1115. 'text' => 'Test Connection',
  1116. 'attr' => 'onclick="testAPIConnection(\'deluge\')"'
  1117. ),
  1118. )
  1119. )
  1120. ),
  1121. array(
  1122. 'name' => 'Sonarr',
  1123. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1124. 'image' => 'plugins/images/tabs/sonarr.png',
  1125. 'category' => 'PVR',
  1126. 'settings' => array(
  1127. 'Enable' => array(
  1128. array(
  1129. 'type' => 'switch',
  1130. 'name' => 'homepageSonarrEnabled',
  1131. 'label' => 'Enable',
  1132. 'value' => $GLOBALS['homepageSonarrEnabled']
  1133. ),
  1134. array(
  1135. 'type' => 'select',
  1136. 'name' => 'homepageSonarrAuth',
  1137. 'label' => 'Minimum Authentication',
  1138. 'value' => $GLOBALS['homepageSonarrAuth'],
  1139. 'options' => $groups
  1140. )
  1141. ),
  1142. 'Connection' => array(
  1143. array(
  1144. 'type' => 'input',
  1145. 'name' => 'sonarrURL',
  1146. 'label' => 'URL',
  1147. 'value' => $GLOBALS['sonarrURL'],
  1148. 'placeholder' => 'http(s)://hostname:port'
  1149. ),
  1150. array(
  1151. 'type' => 'password-alt',
  1152. 'name' => 'sonarrToken',
  1153. 'label' => 'Token',
  1154. 'value' => $GLOBALS['sonarrToken']
  1155. )
  1156. ),
  1157. 'Misc Options' => array(
  1158. array(
  1159. 'type' => 'number',
  1160. 'name' => 'calendarStart',
  1161. 'label' => '# of Days Before',
  1162. 'value' => $GLOBALS['calendarStart'],
  1163. 'placeholder' => ''
  1164. ),
  1165. array(
  1166. 'type' => 'number',
  1167. 'name' => 'calendarEnd',
  1168. 'label' => '# of Days After',
  1169. 'value' => $GLOBALS['calendarEnd'],
  1170. 'placeholder' => ''
  1171. ),
  1172. array(
  1173. 'type' => 'select',
  1174. 'name' => 'calendarFirstDay',
  1175. 'label' => 'Start Day',
  1176. 'value' => $GLOBALS['calendarFirstDay'],
  1177. 'options' => $day
  1178. ),
  1179. array(
  1180. 'type' => 'select',
  1181. 'name' => 'calendarDefault',
  1182. 'label' => 'Default View',
  1183. 'value' => $GLOBALS['calendarDefault'],
  1184. 'options' => $calendarDefault
  1185. ),
  1186. array(
  1187. 'type' => 'select',
  1188. 'name' => 'calendarTimeFormat',
  1189. 'label' => 'Time Format',
  1190. 'value' => $GLOBALS['calendarTimeFormat'],
  1191. 'options' => $timeFormat
  1192. ),
  1193. array(
  1194. 'type' => 'select',
  1195. 'name' => 'calendarLimit',
  1196. 'label' => 'Items Per Day',
  1197. 'value' => $GLOBALS['calendarLimit'],
  1198. 'options' => $limit
  1199. ),
  1200. array(
  1201. 'type' => 'select',
  1202. 'name' => 'calendarRefresh',
  1203. 'label' => 'Refresh Seconds',
  1204. 'value' => $GLOBALS['calendarRefresh'],
  1205. 'options' => optionTime()
  1206. ),
  1207. array(
  1208. 'type' => 'switch',
  1209. 'name' => 'sonarrUnmonitored',
  1210. 'label' => 'Show Unmonitored',
  1211. 'value' => $GLOBALS['sonarrUnmonitored']
  1212. )
  1213. ),
  1214. 'Test Connection' => array(
  1215. array(
  1216. 'type' => 'blank',
  1217. 'label' => 'Please Save before Testing'
  1218. ),
  1219. array(
  1220. 'type' => 'button',
  1221. 'label' => '',
  1222. 'icon' => 'fa fa-flask',
  1223. 'class' => 'pull-right',
  1224. 'text' => 'Test Connection',
  1225. 'attr' => 'onclick="testAPIConnection(\'sonarr\')"'
  1226. ),
  1227. )
  1228. )
  1229. ),
  1230. array(
  1231. 'name' => 'Radarr',
  1232. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1233. 'image' => 'plugins/images/tabs/radarr.png',
  1234. 'category' => 'PVR',
  1235. 'settings' => array(
  1236. 'Enable' => array(
  1237. array(
  1238. 'type' => 'switch',
  1239. 'name' => 'homepageRadarrEnabled',
  1240. 'label' => 'Enable',
  1241. 'value' => $GLOBALS['homepageRadarrEnabled']
  1242. ),
  1243. array(
  1244. 'type' => 'select',
  1245. 'name' => 'homepageRadarrAuth',
  1246. 'label' => 'Minimum Authentication',
  1247. 'value' => $GLOBALS['homepageRadarrAuth'],
  1248. 'options' => $groups
  1249. )
  1250. ),
  1251. 'Connection' => array(
  1252. array(
  1253. 'type' => 'input',
  1254. 'name' => 'radarrURL',
  1255. 'label' => 'URL',
  1256. 'value' => $GLOBALS['radarrURL'],
  1257. 'placeholder' => 'http(s)://hostname:port'
  1258. ),
  1259. array(
  1260. 'type' => 'password-alt',
  1261. 'name' => 'radarrToken',
  1262. 'label' => 'Token',
  1263. 'value' => $GLOBALS['radarrToken']
  1264. )
  1265. ),
  1266. 'Misc Options' => array(
  1267. array(
  1268. 'type' => 'number',
  1269. 'name' => 'calendarStart',
  1270. 'label' => '# of Days Before',
  1271. 'value' => $GLOBALS['calendarStart'],
  1272. 'placeholder' => ''
  1273. ),
  1274. array(
  1275. 'type' => 'number',
  1276. 'name' => 'calendarEnd',
  1277. 'label' => '# of Days After',
  1278. 'value' => $GLOBALS['calendarEnd'],
  1279. 'placeholder' => ''
  1280. ),
  1281. array(
  1282. 'type' => 'select',
  1283. 'name' => 'calendarFirstDay',
  1284. 'label' => 'Start Day',
  1285. 'value' => $GLOBALS['calendarFirstDay'],
  1286. 'options' => $day
  1287. ),
  1288. array(
  1289. 'type' => 'select',
  1290. 'name' => 'calendarDefault',
  1291. 'label' => 'Default View',
  1292. 'value' => $GLOBALS['calendarDefault'],
  1293. 'options' => $calendarDefault
  1294. ),
  1295. array(
  1296. 'type' => 'select',
  1297. 'name' => 'calendarTimeFormat',
  1298. 'label' => 'Time Format',
  1299. 'value' => $GLOBALS['calendarTimeFormat'],
  1300. 'options' => $timeFormat
  1301. ),
  1302. array(
  1303. 'type' => 'select',
  1304. 'name' => 'calendarLimit',
  1305. 'label' => 'Items Per Day',
  1306. 'value' => $GLOBALS['calendarLimit'],
  1307. 'options' => $limit
  1308. ),
  1309. array(
  1310. 'type' => 'select',
  1311. 'name' => 'calendarRefresh',
  1312. 'label' => 'Refresh Seconds',
  1313. 'value' => $GLOBALS['calendarRefresh'],
  1314. 'options' => optionTime()
  1315. )
  1316. ),
  1317. 'Test Connection' => array(
  1318. array(
  1319. 'type' => 'blank',
  1320. 'label' => 'Please Save before Testing'
  1321. ),
  1322. array(
  1323. 'type' => 'button',
  1324. 'label' => '',
  1325. 'icon' => 'fa fa-flask',
  1326. 'class' => 'pull-right',
  1327. 'text' => 'Test Connection',
  1328. 'attr' => 'onclick="testAPIConnection(\'radarr\')"'
  1329. ),
  1330. )
  1331. )
  1332. ),
  1333. array(
  1334. 'name' => 'CouchPotato',
  1335. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1336. 'image' => 'plugins/images/tabs/couchpotato.png',
  1337. 'category' => 'PVR',
  1338. 'settings' => array(
  1339. 'Enable' => array(
  1340. array(
  1341. 'type' => 'switch',
  1342. 'name' => 'homepageCouchpotatoEnabled',
  1343. 'label' => 'Enable',
  1344. 'value' => $GLOBALS['homepageCouchpotatoEnabled']
  1345. ),
  1346. array(
  1347. 'type' => 'select',
  1348. 'name' => 'homepageCouchpotatoAuth',
  1349. 'label' => 'Minimum Authentication',
  1350. 'value' => $GLOBALS['homepageCouchpotatoAuth'],
  1351. 'options' => $groups
  1352. )
  1353. ),
  1354. 'Connection' => array(
  1355. array(
  1356. 'type' => 'input',
  1357. 'name' => 'couchpotatoURL',
  1358. 'label' => 'URL',
  1359. 'value' => $GLOBALS['couchpotatoURL'],
  1360. 'placeholder' => 'http(s)://hostname:port'
  1361. ),
  1362. array(
  1363. 'type' => 'password-alt',
  1364. 'name' => 'couchpotatoToken',
  1365. 'label' => 'Token',
  1366. 'value' => $GLOBALS['couchpotatoToken']
  1367. )
  1368. ),
  1369. 'Misc Options' => array(
  1370. array(
  1371. 'type' => 'select',
  1372. 'name' => 'calendarFirstDay',
  1373. 'label' => 'Start Day',
  1374. 'value' => $GLOBALS['calendarFirstDay'],
  1375. 'options' => $day
  1376. ),
  1377. array(
  1378. 'type' => 'select',
  1379. 'name' => 'calendarDefault',
  1380. 'label' => 'Default View',
  1381. 'value' => $GLOBALS['calendarDefault'],
  1382. 'options' => $calendarDefault
  1383. ),
  1384. array(
  1385. 'type' => 'select',
  1386. 'name' => 'calendarTimeFormat',
  1387. 'label' => 'Time Format',
  1388. 'value' => $GLOBALS['calendarTimeFormat'],
  1389. 'options' => $timeFormat
  1390. ),
  1391. array(
  1392. 'type' => 'select',
  1393. 'name' => 'calendarLimit',
  1394. 'label' => 'Items Per Day',
  1395. 'value' => $GLOBALS['calendarLimit'],
  1396. 'options' => $limit
  1397. ),
  1398. array(
  1399. 'type' => 'select',
  1400. 'name' => 'calendarRefresh',
  1401. 'label' => 'Refresh Seconds',
  1402. 'value' => $GLOBALS['calendarRefresh'],
  1403. 'options' => optionTime()
  1404. )
  1405. )
  1406. )
  1407. ),
  1408. array(
  1409. 'name' => 'SickRage',
  1410. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1411. 'image' => 'plugins/images/tabs/sickrage.png',
  1412. 'category' => 'PVR',
  1413. 'settings' => array(
  1414. 'Enable' => array(
  1415. array(
  1416. 'type' => 'switch',
  1417. 'name' => 'homepageSickrageEnabled',
  1418. 'label' => 'Enable',
  1419. 'value' => $GLOBALS['homepageSickrageEnabled']
  1420. ),
  1421. array(
  1422. 'type' => 'select',
  1423. 'name' => 'homepageSickrageAuth',
  1424. 'label' => 'Minimum Authentication',
  1425. 'value' => $GLOBALS['homepageSickrageAuth'],
  1426. 'options' => $groups
  1427. )
  1428. ),
  1429. 'Connection' => array(
  1430. array(
  1431. 'type' => 'input',
  1432. 'name' => 'sickrageURL',
  1433. 'label' => 'URL',
  1434. 'value' => $GLOBALS['sickrageURL'],
  1435. 'placeholder' => 'http(s)://hostname:port'
  1436. ),
  1437. array(
  1438. 'type' => 'password-alt',
  1439. 'name' => 'sickrageToken',
  1440. 'label' => 'Token',
  1441. 'value' => $GLOBALS['sickrageToken']
  1442. )
  1443. ),
  1444. 'Misc Options' => array(
  1445. array(
  1446. 'type' => 'select',
  1447. 'name' => 'calendarFirstDay',
  1448. 'label' => 'Start Day',
  1449. 'value' => $GLOBALS['calendarFirstDay'],
  1450. 'options' => $day
  1451. ),
  1452. array(
  1453. 'type' => 'select',
  1454. 'name' => 'calendarDefault',
  1455. 'label' => 'Default View',
  1456. 'value' => $GLOBALS['calendarDefault'],
  1457. 'options' => $calendarDefault
  1458. ),
  1459. array(
  1460. 'type' => 'select',
  1461. 'name' => 'calendarTimeFormat',
  1462. 'label' => 'Time Format',
  1463. 'value' => $GLOBALS['calendarTimeFormat'],
  1464. 'options' => $timeFormat
  1465. ),
  1466. array(
  1467. 'type' => 'select',
  1468. 'name' => 'calendarLimit',
  1469. 'label' => 'Items Per Day',
  1470. 'value' => $GLOBALS['calendarLimit'],
  1471. 'options' => $limit
  1472. ),
  1473. array(
  1474. 'type' => 'select',
  1475. 'name' => 'calendarRefresh',
  1476. 'label' => 'Refresh Seconds',
  1477. 'value' => $GLOBALS['calendarRefresh'],
  1478. 'options' => optionTime()
  1479. )
  1480. )
  1481. )
  1482. ),
  1483. array(
  1484. 'name' => 'Ombi',
  1485. 'enabled' => (strpos('personal', $GLOBALS['license']) !== false) ? true : false,
  1486. 'image' => 'plugins/images/tabs/ombi.png',
  1487. 'category' => 'Requests',
  1488. 'settings' => array(
  1489. 'Enable' => array(
  1490. array(
  1491. 'type' => 'switch',
  1492. 'name' => 'homepageOmbiEnabled',
  1493. 'label' => 'Enable',
  1494. 'value' => $GLOBALS['homepageOmbiEnabled']
  1495. ),
  1496. array(
  1497. 'type' => 'select',
  1498. 'name' => 'homepageOmbiAuth',
  1499. 'label' => 'Minimum Authentication',
  1500. 'value' => $GLOBALS['homepageOmbiAuth'],
  1501. 'options' => $groups
  1502. )
  1503. ),
  1504. 'Connection' => array(
  1505. array(
  1506. 'type' => 'input',
  1507. 'name' => 'ombiURL',
  1508. 'label' => 'URL',
  1509. 'value' => $GLOBALS['ombiURL'],
  1510. 'placeholder' => 'http(s)://hostname:port'
  1511. ),
  1512. array(
  1513. 'type' => 'password-alt',
  1514. 'name' => 'ombiToken',
  1515. 'label' => 'Token',
  1516. 'value' => $GLOBALS['ombiToken']
  1517. )
  1518. ),
  1519. 'Misc Options' => array(
  1520. array(
  1521. 'type' => 'select',
  1522. 'name' => 'homepageOmbiRequestAuth',
  1523. 'label' => 'Minimum Group to Request',
  1524. 'value' => $GLOBALS['homepageOmbiRequestAuth'],
  1525. 'options' => $groups
  1526. ),
  1527. array(
  1528. 'type' => 'switch',
  1529. 'name' => 'ombiLimitUser',
  1530. 'label' => 'Limit to User',
  1531. 'value' => $GLOBALS['ombiLimitUser']
  1532. ),
  1533. array(
  1534. 'type' => 'select',
  1535. 'name' => 'ombiRefresh',
  1536. 'label' => 'Refresh Seconds',
  1537. 'value' => $GLOBALS['ombiRefresh'],
  1538. 'options' => optionTime()
  1539. )
  1540. )
  1541. )
  1542. ),
  1543. array(
  1544. 'name' => 'CustomHTML-1',
  1545. 'enabled' => (strpos('personal,business', $GLOBALS['license']) !== false) ? true : false,
  1546. 'image' => 'plugins/images/tabs/custom1.png',
  1547. 'category' => 'Custom',
  1548. 'settings' => array(
  1549. 'Enable' => array(
  1550. array(
  1551. 'type' => 'switch',
  1552. 'name' => 'homepagCustomHTMLoneEnabled',
  1553. 'label' => 'Enable',
  1554. 'value' => $GLOBALS['homepagCustomHTMLoneEnabled']
  1555. ),
  1556. array(
  1557. 'type' => 'select',
  1558. 'name' => 'homepagCustomHTMLoneAuth',
  1559. 'label' => 'Minimum Authentication',
  1560. 'value' => $GLOBALS['homepagCustomHTMLoneAuth'],
  1561. 'options' => $groups
  1562. )
  1563. ),
  1564. 'Code' => array(
  1565. array(
  1566. 'type' => 'textbox',
  1567. 'name' => 'customHTMLone',
  1568. 'class' => 'hidden customHTMLoneTextarea',
  1569. 'label' => '',
  1570. 'value' => $GLOBALS['customHTMLone'],
  1571. ),
  1572. array(
  1573. 'type' => 'html',
  1574. 'override' => 12,
  1575. 'label' => 'Custom HTML/JavaScript',
  1576. '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>'
  1577. ),
  1578. )
  1579. )
  1580. ),
  1581. array(
  1582. 'name' => 'CustomHTML-2',
  1583. 'enabled' => (strpos('personal,business', $GLOBALS['license']) !== false) ? true : false,
  1584. 'image' => 'plugins/images/tabs/custom2.png',
  1585. 'category' => 'Custom',
  1586. 'settings' => array(
  1587. 'Enable' => array(
  1588. array(
  1589. 'type' => 'switch',
  1590. 'name' => 'homepagCustomHTMLtwoEnabled',
  1591. 'label' => 'Enable',
  1592. 'value' => $GLOBALS['homepagCustomHTMLtwoEnabled']
  1593. ),
  1594. array(
  1595. 'type' => 'select',
  1596. 'name' => 'homepagCustomHTMLtwoAuth',
  1597. 'label' => 'Minimum Authentication',
  1598. 'value' => $GLOBALS['homepagCustomHTMLtwoAuth'],
  1599. 'options' => $groups
  1600. )
  1601. ),
  1602. 'Code' => array(
  1603. array(
  1604. 'type' => 'textbox',
  1605. 'name' => 'customHTMLtwo',
  1606. 'class' => 'hidden customHTMLtwoTextarea',
  1607. 'label' => '',
  1608. 'value' => $GLOBALS['customHTMLtwo'],
  1609. ),
  1610. array(
  1611. 'type' => 'html',
  1612. 'override' => 12,
  1613. 'label' => 'Custom HTML/JavaScript',
  1614. '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>'
  1615. ),
  1616. )
  1617. )
  1618. )
  1619. );
  1620. }
  1621. function buildHomepageSettings()
  1622. {
  1623. $homepageOrder = homepageOrder();
  1624. $homepageList = '<h4>Drag Homepage Items to Order Them</h4><div id="homepage-items-sort" class="external-events">';
  1625. $inputList = '<form id="homepage-values" class="row">';
  1626. foreach ($homepageOrder as $key => $val) {
  1627. switch ($key) {
  1628. case 'homepageOrdercustomhtml':
  1629. $class = 'bg-info';
  1630. $image = 'plugins/images/tabs/custom1.png';
  1631. if (!$GLOBALS['homepagCustomHTMLoneEnabled']) {
  1632. $class .= ' faded';
  1633. }
  1634. break;
  1635. case 'homepageOrdercustomhtmlTwo':
  1636. $class = 'bg-info';
  1637. $image = 'plugins/images/tabs/custom2.png';
  1638. if (!$GLOBALS['homepagCustomHTMLtwoEnabled']) {
  1639. $class .= ' faded';
  1640. }
  1641. break;
  1642. case 'homepageOrdertransmission':
  1643. $class = 'bg-transmission';
  1644. $image = 'plugins/images/tabs/transmission.png';
  1645. if (!$GLOBALS['homepageTransmissionEnabled']) {
  1646. $class .= ' faded';
  1647. }
  1648. break;
  1649. case 'homepageOrdernzbget':
  1650. $class = 'bg-nzbget';
  1651. $image = 'plugins/images/tabs/nzbget.png';
  1652. if (!$GLOBALS['homepageNzbgetEnabled']) {
  1653. $class .= ' faded';
  1654. }
  1655. break;
  1656. case 'homepageOrdersabnzbd':
  1657. $class = 'bg-sab';
  1658. $image = 'plugins/images/tabs/sabnzbd.png';
  1659. if (!$GLOBALS['homepageSabnzbdEnabled']) {
  1660. $class .= ' faded';
  1661. }
  1662. break;
  1663. case 'homepageOrderdeluge':
  1664. $class = 'bg-deluge';
  1665. $image = 'plugins/images/tabs/deluge.png';
  1666. if (!$GLOBALS['homepageDelugeEnabled']) {
  1667. $class .= ' faded';
  1668. }
  1669. break;
  1670. case 'homepageOrderqBittorrent':
  1671. $class = 'bg-qbit';
  1672. $image = 'plugins/images/tabs/qBittorrent.png';
  1673. if (!$GLOBALS['homepageqBittorrentEnabled']) {
  1674. $class .= ' faded';
  1675. }
  1676. break;
  1677. case 'homepageOrderplexnowplaying':
  1678. case 'homepageOrderplexrecent':
  1679. case 'homepageOrderplexplaylist':
  1680. $class = 'bg-plex';
  1681. $image = 'plugins/images/tabs/plex.png';
  1682. if (!$GLOBALS['homepagePlexEnabled']) {
  1683. $class .= ' faded';
  1684. }
  1685. break;
  1686. case 'homepageOrderembynowplaying':
  1687. case 'homepageOrderembyrecent':
  1688. $class = 'bg-emby';
  1689. $image = 'plugins/images/tabs/emby.png';
  1690. if (!$GLOBALS['homepageEmbyEnabled']) {
  1691. $class .= ' faded';
  1692. }
  1693. break;
  1694. case 'homepageOrderombi':
  1695. $class = 'bg-inverse';
  1696. $image = 'plugins/images/tabs/ombi.png';
  1697. if (!$GLOBALS['homepageOmbiEnabled']) {
  1698. $class .= ' faded';
  1699. }
  1700. break;
  1701. case 'homepageOrdercalendar':
  1702. $class = 'bg-primary';
  1703. $image = 'plugins/images/tabs/calendar.png';
  1704. if (!$GLOBALS['homepageSonarrEnabled'] && !$GLOBALS['homepageRadarrEnabled'] && !$GLOBALS['homepageSickrageEnabled'] && !$GLOBALS['homepageCouchpotatoEnabled']) {
  1705. $class .= ' faded';
  1706. }
  1707. break;
  1708. default:
  1709. $class = 'blue-bg';
  1710. $image = '';
  1711. break;
  1712. }
  1713. $homepageList .= '
  1714. <div class="col-md-3 col-xs-12 sort-homepage m-t-10 hvr-grow">
  1715. <div class="homepage-drag fc-event ' . $class . ' lazyload" data-src="' . $image . '">
  1716. <span class="ordinal-position text-uppercase badge bg-org homepage-number" data-link="' . $key . '" style="float:left;width: 30px;">' . $val . '</span>
  1717. <span class="homepage-text">&nbsp; ' . strtoupper(substr($key, 13)) . '</span>
  1718. </div>
  1719. </div>
  1720. ';
  1721. $inputList .= '<input type="hidden" name="' . $key . '">';
  1722. }
  1723. $homepageList .= '</div>';
  1724. $inputList .= '</form>';
  1725. return $homepageList . $inputList;
  1726. }