<?php
namespace OCA\NotesTutorial\Settings;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\IConfig;
use OCP\IL10N;
use OCP\Settings\ISettings;
class NotesAdmin implements ISettings {
/** @var IL10N */
private $l;
/** @var IURLGenerator */
private $urlGenerator;
/** @var IConfig */
private $config;
/** @var IL10N $l*/
private $l;
public function __construct(IConfig $config, IL10N $l) {
$this->config = $config;
$this->l = $l;
}
/**
* @return TemplateResponse
*/
public function getForm() {
$parameters = array('key' => 'test');
return new TemplateResponse('notestutorial', 'admin', $parameters, '');
}
public function getSection() {
return 'notestutorial'; // 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 10;
}
}
This would be my code for the admin section:
<?php
namespace OCA\NotesTutorial\Sections;
use OCP\IL10N;
use OCP\IURLGenerator;
use OCP\Settings\IIconSection ;
class NotesAdmin implements IIconSection {
/** @var IL10N */
private $l;
/** @var IURLGenerator */
private $urlGenerator;
public function __construct(IL10N $l, IURLGenerator $urlGenerator) {
$this->l = $l;
$this->urlGenerator = $urlGenerator;
}
public function getIcon() {
return $this->urlGenerator->imagePath('notestutorial', 'app.svg');
}
public function getID() {
return 'notestutorial';
}
public function getName() {
return 'Notes tutorial';
}
public function getPriority() {
return 98;
}
}