. */ namespace OCA\SideMenu\Settings; use OCP\AppFramework\Http\TemplateResponse; use OCP\IL10N; use OCP\ILogger; use OCP\Settings\ISettings; use OCP\IConfig; use OCP\IUserSession; class Personal implements ISettings { /** * @var IL10N */ private $l; /** * @var ILogger */ private $logger; /** * @var IConfig */ private $config; /** * @var IUserSession */ private $userSession; public function __construct(IL10N $l, ILogger $logger, IConfig $config, IUserSession $userSession) { $this->l = $l; $this->logger = $logger; $this->config = $config; $this->userSession = $userSession; } /** * @return TemplateResponse */ public function getForm() { $user = $this->userSession->getUser(); $parameters = [ 'enabled' => $this->config->getUserValue($user->getUid(), 'side_menu', 'enabled', '1'), ]; return new TemplateResponse('side_menu', 'settings/personal-form', $parameters, ''); } /** * @return string the section ID, e.g. 'sharing' */ public function getSection() { return 'side_menu'; } /** * @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; } }