-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
81 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
namespace OCA\Solid\Sections; | ||
|
||
use OCP\IL10N; | ||
use OCP\IURLGenerator; | ||
use OCP\Settings\IIconSection; | ||
|
||
class SolidAdmin implements IIconSection { | ||
private IL10N $l; | ||
private IURLGenerator $urlGenerator; | ||
|
||
public function __construct(IL10N $l, IURLGenerator $urlGenerator) { | ||
$this->l = $l; | ||
$this->urlGenerator = $urlGenerator; | ||
} | ||
|
||
public function getIcon(): string { | ||
return $this->urlGenerator->imagePath('core', 'actions/settings-dark.svg'); | ||
} | ||
|
||
public function getID(): string { | ||
return 'solid'; | ||
} | ||
|
||
public function getName(): string { | ||
return $this->l->t('Solid'); | ||
} | ||
|
||
public function getPriority(): int { | ||
return 98; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
namespace OCA\Solid\Settings; | ||
|
||
use OCP\AppFramework\Http\TemplateResponse; | ||
use OCP\IConfig; | ||
use OCP\IL10N; | ||
use OCP\Settings\ISettings; | ||
use OCA\Solid\ServerConfig; | ||
|
||
class SolidAdmin implements ISettings { | ||
private IL10N $l; | ||
private IConfig $config; | ||
private ServerConfig $serverConfig; | ||
|
||
public function __construct(IConfig $config, IL10N $l, ServerConfig $serverConfig) { | ||
$this->config = $config; | ||
$this->l = $l; | ||
$this->serverConfig = $serverConfig; | ||
} | ||
|
||
/** | ||
* @return TemplateResponse | ||
*/ | ||
public function getForm() { | ||
$parameters = [ | ||
'privateKey' => $this->serverConfig->getPrivateKey(), | ||
'encryptionKey' => $this->serverConfig->getEncryptionKey() | ||
]; | ||
|
||
return new TemplateResponse('solid', 'admin', $parameters, ''); | ||
} | ||
|
||
public function getSection() { | ||
return 'solid'; // Name of the previously created section. | ||
} | ||
|
||
/** | ||
* @return int whether the form should be rather on the top or bottom of | ||
* the admin section. The forms are arranged in ascending order of the | ||
* priority values. It is required to return a value between 0 and 100. | ||
* | ||
* E.g.: 70 | ||
*/ | ||
public function getPriority() { | ||
return 70; | ||
} | ||
} |