Extend interfaces

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2017-05-16 01:40:36 +02:00
parent 560ab2e911
commit b68fdb473d
No known key found for this signature in database
GPG Key ID: 7424F1874854DF23
2 changed files with 53 additions and 0 deletions

View File

@ -337,6 +337,24 @@ class Manager implements IManager {
return $forms;
}
/**
* @param string $section
* @return ISection[]
*/
private function getBuiltInPersonalSettings($section) {
$forms = [];
try {
if ($section === 'personal-info') {
/** @var ISettings $form */
$form = new Personal\PersonalInfo();
$forms[$form->getPriority()] = [$form];
}
} catch (QueryException $e) {
// skip
}
return $forms;
}
/**
* @inheritdoc
*/
@ -358,4 +376,22 @@ class Manager implements IManager {
ksort($settings);
return $settings;
}
/**
* @inheritdoc
*/
public function getPersonalSections() {
$sections = [
0 => [new Section('personal-info', $this->l->t('Personal info'), 0, $this->url->imagePath('core', 'actions/info.svg'))],
];
return $sections;
}
/**
* @inheritdoc
*/
public function getPersonalSettings($section) {
$settings = $this->getBuiltInPersonalSettings($section);
return $settings;
}
}

View File

@ -87,6 +87,14 @@ interface IManager {
*/
public function getAdminSections();
/**
* returns a list of the personal sections
*
* @return array array of ISection[] where key is the priority
* @since 12.0.0
*/
public function getPersonalSections();
/**
* returns a list of the admin settings
*
@ -95,4 +103,13 @@ interface IManager {
* @since 9.1.0
*/
public function getAdminSettings($section);
/**
* returns a list of the personal settings
*
* @param string $section the section id for which to load the settings
* @return array array of IPersonal[] where key is the priority
* @since 12.0.0
*/
public function getPersonalSettings($section);
}