|
33 | 33 | use OCA\UpdateNotification\UpdateChecker; |
34 | 34 | use OCP\AppFramework\Http\TemplateResponse; |
35 | 35 | use OCP\AppFramework\Services\IInitialState; |
| 36 | +use OCP\IAppConfig; |
36 | 37 | use OCP\IConfig; |
37 | 38 | use OCP\IDateTimeFormatter; |
38 | 39 | use OCP\IGroupManager; |
|
45 | 46 | use Psr\Log\LoggerInterface; |
46 | 47 |
|
47 | 48 | class Admin implements ISettings { |
48 | | - private IConfig $config; |
49 | | - private UpdateChecker $updateChecker; |
50 | | - private IGroupManager $groupManager; |
51 | | - private IDateTimeFormatter $dateTimeFormatter; |
52 | | - private IFactory $l10nFactory; |
53 | | - private IRegistry $subscriptionRegistry; |
54 | | - private IUserManager $userManager; |
55 | | - private LoggerInterface $logger; |
56 | | - private IInitialState $initialState; |
57 | | - |
58 | 49 | public function __construct( |
59 | | - IConfig $config, |
60 | | - UpdateChecker $updateChecker, |
61 | | - IGroupManager $groupManager, |
62 | | - IDateTimeFormatter $dateTimeFormatter, |
63 | | - IFactory $l10nFactory, |
64 | | - IRegistry $subscriptionRegistry, |
65 | | - IUserManager $userManager, |
66 | | - LoggerInterface $logger, |
67 | | - IInitialState $initialState |
| 50 | + private IConfig $config, |
| 51 | + private IAppConfig $appConfig, |
| 52 | + private UpdateChecker $updateChecker, |
| 53 | + private IGroupManager $groupManager, |
| 54 | + private IDateTimeFormatter $dateTimeFormatter, |
| 55 | + private IFactory $l10nFactory, |
| 56 | + private IRegistry $subscriptionRegistry, |
| 57 | + private IUserManager $userManager, |
| 58 | + private LoggerInterface $logger, |
| 59 | + private IInitialState $initialState |
68 | 60 | ) { |
69 | | - $this->config = $config; |
70 | | - $this->updateChecker = $updateChecker; |
71 | | - $this->groupManager = $groupManager; |
72 | | - $this->dateTimeFormatter = $dateTimeFormatter; |
73 | | - $this->l10nFactory = $l10nFactory; |
74 | | - $this->subscriptionRegistry = $subscriptionRegistry; |
75 | | - $this->userManager = $userManager; |
76 | | - $this->logger = $logger; |
77 | | - $this->initialState = $initialState; |
78 | 61 | } |
79 | 62 |
|
80 | 63 | public function getForm(): TemplateResponse { |
81 | | - $lastUpdateCheckTimestamp = (int)$this->config->getAppValue('core', 'lastupdatedat'); |
| 64 | + $lastUpdateCheckTimestamp = $this->appConfig->getValueInt('core', 'lastupdatedat'); |
82 | 65 | $lastUpdateCheck = $this->dateTimeFormatter->formatDateTime($lastUpdateCheckTimestamp); |
83 | 66 |
|
84 | 67 | $channels = [ |
|
0 commit comments