diff options
author | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2016-08-11 14:48:21 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@arthur-schiwon.de> | 2016-08-11 14:48:21 +0200 |
commit | 14ddf9d923ba78a9b938d6eb6050d71aaef22ed6 (patch) | |
tree | a99f04e1a2569421c522e7a28c5e9c8381930cab /lib | |
parent | f3b15a9ab97ce4498bafc731dc24350e98a7cb51 (diff) | |
download | nextcloud-server-14ddf9d923ba78a9b938d6eb6050d71aaef22ed6.tar.gz nextcloud-server-14ddf9d923ba78a9b938d6eb6050d71aaef22ed6.zip |
rename IAdmin to ISettings, the interface is not bound to a specific settings scope
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Settings/Admin/Encryption.php | 4 | ||||
-rw-r--r-- | lib/private/Settings/Admin/Logging.php | 4 | ||||
-rw-r--r-- | lib/private/Settings/Admin/Server.php | 4 | ||||
-rw-r--r-- | lib/private/Settings/Admin/Sharing.php | 4 | ||||
-rw-r--r-- | lib/private/Settings/Admin/TipsTricks.php | 4 | ||||
-rw-r--r-- | lib/private/Settings/Manager.php | 20 | ||||
-rw-r--r-- | lib/public/Settings/ISettings.php (renamed from lib/public/Settings/IAdmin.php) | 5 |
7 files changed, 24 insertions, 21 deletions
diff --git a/lib/private/Settings/Admin/Encryption.php b/lib/private/Settings/Admin/Encryption.php index 331ddf54520..ceae5aa6d3f 100644 --- a/lib/private/Settings/Admin/Encryption.php +++ b/lib/private/Settings/Admin/Encryption.php @@ -26,9 +26,9 @@ namespace OC\Settings\Admin; use OC\Encryption\Manager; use OCP\AppFramework\Http\TemplateResponse; use OCP\IUserManager; -use OCP\Settings\IAdmin; +use OCP\Settings\ISettings; -class Encryption implements IAdmin { +class Encryption implements ISettings { /** @var Manager */ private $manager; diff --git a/lib/private/Settings/Admin/Logging.php b/lib/private/Settings/Admin/Logging.php index b05ea93388d..3097070577d 100644 --- a/lib/private/Settings/Admin/Logging.php +++ b/lib/private/Settings/Admin/Logging.php @@ -26,9 +26,9 @@ namespace OC\Settings\Admin; use OC\Log\File as LogFile; use OCP\AppFramework\Http\TemplateResponse; use OCP\IConfig; -use OCP\Settings\IAdmin; +use OCP\Settings\ISettings; -class Logging implements IAdmin { +class Logging implements ISettings { /** @var IConfig */ private $config; diff --git a/lib/private/Settings/Admin/Server.php b/lib/private/Settings/Admin/Server.php index ee2da154da2..4f1edcf4691 100644 --- a/lib/private/Settings/Admin/Server.php +++ b/lib/private/Settings/Admin/Server.php @@ -29,9 +29,9 @@ use Doctrine\DBAL\Platforms\SqlitePlatform; use OCP\AppFramework\Http\TemplateResponse; use OCP\IConfig; use OCP\IDBConnection; -use OCP\Settings\IAdmin; +use OCP\Settings\ISettings; -class Server implements IAdmin { +class Server implements ISettings { /** @var IDBConnection|Connection */ private $db; diff --git a/lib/private/Settings/Admin/Sharing.php b/lib/private/Settings/Admin/Sharing.php index 088021f9057..d186dbed981 100644 --- a/lib/private/Settings/Admin/Sharing.php +++ b/lib/private/Settings/Admin/Sharing.php @@ -25,9 +25,9 @@ namespace OC\Settings\Admin; use OCP\AppFramework\Http\TemplateResponse; use OCP\IConfig; -use OCP\Settings\IAdmin; +use OCP\Settings\ISettings; -class Sharing implements IAdmin { +class Sharing implements ISettings { /** @var IConfig */ private $config; diff --git a/lib/private/Settings/Admin/TipsTricks.php b/lib/private/Settings/Admin/TipsTricks.php index 331c33db1c1..217ddacd443 100644 --- a/lib/private/Settings/Admin/TipsTricks.php +++ b/lib/private/Settings/Admin/TipsTricks.php @@ -25,9 +25,9 @@ namespace OC\Settings\Admin; use OCP\AppFramework\Http\TemplateResponse; use OCP\IConfig; -use OCP\Settings\IAdmin; +use OCP\Settings\ISettings; -class TipsTricks implements IAdmin { +class TipsTricks implements ISettings { /** @var IConfig */ private $config; diff --git a/lib/private/Settings/Manager.php b/lib/private/Settings/Manager.php index fa762003c1d..4c96dd07fde 100644 --- a/lib/private/Settings/Manager.php +++ b/lib/private/Settings/Manager.php @@ -30,7 +30,7 @@ use OCP\IDBConnection; use OCP\IL10N; use OCP\ILogger; use OCP\IUserManager; -use OCP\Settings\IAdmin; +use OCP\Settings\ISettings; use OCP\Settings\IManager; use OCP\Settings\ISection; @@ -119,7 +119,7 @@ class Manager implements IManager { ]); } - private function addAdminSettings(IAdmin $settings) { + private function addAdminSettings(ISettings $settings) { $this->add(self::TABLE_ADMIN_SETTINGS, [ 'class' => get_class($settings), 'section' => $settings->getSection(), @@ -136,7 +136,7 @@ class Manager implements IManager { $query->execute(); } - private function updateAdminSettings(IAdmin $settings) { + private function updateAdminSettings(ISettings $settings) { $this->update( self::TABLE_ADMIN_SETTINGS, 'class', @@ -210,14 +210,14 @@ class Manager implements IManager { } try { - /** @var IAdmin $settings */ + /** @var ISettings $settings */ $settings = $this->query($settingsClassName); } catch (QueryException $e) { // cancel return; } - if(!$settings instanceof IAdmin) { + if(!$settings instanceof ISettings) { $this->log->error( 'Admin section instance must implement \OCP\ISection. Invalid class: {class}', ['class' => $settingsClassName] @@ -283,27 +283,27 @@ class Manager implements IManager { $forms = []; try { if($section === 'server') { - /** @var IAdmin $form */ + /** @var ISettings $form */ $form = new Admin\Server($this->dbc, $this->config); $forms[$form->getPriority()] = [$form]; } if($section === 'encryption') { - /** @var IAdmin $form */ + /** @var ISettings $form */ $form = new Admin\Encryption($this->encryptionManager, $this->userManager); $forms[$form->getPriority()] = [$form]; } if($section === 'sharing') { - /** @var IAdmin $form */ + /** @var ISettings $form */ $form = new Admin\Sharing($this->config); $forms[$form->getPriority()] = [$form]; } if($section === 'logging') { - /** @var IAdmin $form */ + /** @var ISettings $form */ $form = new Admin\Logging($this->config); $forms[$form->getPriority()] = [$form]; } if($section === 'tips-tricks') { - /** @var IAdmin $form */ + /** @var ISettings $form */ $form = new Admin\TipsTricks($this->config); $forms[$form->getPriority()] = [$form]; } diff --git a/lib/public/Settings/IAdmin.php b/lib/public/Settings/ISettings.php index 74977256a18..07d265a533e 100644 --- a/lib/public/Settings/IAdmin.php +++ b/lib/public/Settings/ISettings.php @@ -25,15 +25,17 @@ namespace OCP\Settings; use OCP\AppFramework\Http\TemplateResponse; -interface IAdmin { +interface ISettings { /** * @return TemplateResponse returns the instance with all parameters set, ready to be rendered + * @since 9.1 */ public function getForm(); /** * @return string the section ID, e.g. 'sharing' + * @since 9.1 */ public function getSection(); @@ -43,6 +45,7 @@ interface IAdmin { * priority values. It is required to return a value between 0 and 100. * * E.g.: 70 + * @since 9.1 */ public function getPriority(); } |