page: cosmetic refactor

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/672/head
Varun Patil 2023-05-26 09:26:45 -07:00
parent 0c5e1cb5b0
commit 24644c646f
1 changed files with 3 additions and 8 deletions

View File

@ -11,28 +11,23 @@ use OCP\AppFramework\Http\Template\PublicTemplateResponse;
use OCP\AppFramework\Http\TemplateResponse; use OCP\AppFramework\Http\TemplateResponse;
use OCP\EventDispatcher\IEventDispatcher; use OCP\EventDispatcher\IEventDispatcher;
use OCP\IRequest; use OCP\IRequest;
use OCP\IUserSession;
use OCP\Util as OCPUtil;
class PageController extends Controller class PageController extends Controller
{ {
protected $userId; protected $userId;
protected $appName; protected $appName;
protected IEventDispatcher $eventDispatcher; protected IEventDispatcher $eventDispatcher;
private IUserSession $userSession;
public function __construct( public function __construct(
string $AppName, string $AppName,
IRequest $request, IRequest $request,
$UserId, $UserId,
IEventDispatcher $eventDispatcher, IEventDispatcher $eventDispatcher
IUserSession $userSession
) { ) {
parent::__construct($AppName, $request); parent::__construct($AppName, $request);
$this->userId = $UserId; $this->userId = $UserId;
$this->appName = $AppName; $this->appName = $AppName;
$this->eventDispatcher = $eventDispatcher; $this->eventDispatcher = $eventDispatcher;
$this->userSession = $userSession;
} }
/** /**
@ -49,12 +44,12 @@ class PageController extends Controller
} }
// Scripts // Scripts
OCPUtil::addScript($this->appName, 'memories-main'); \OCP\Util::addScript($this->appName, 'memories-main');
// Extra translations // Extra translations
if (Util::recognizeIsEnabled()) { if (Util::recognizeIsEnabled()) {
// Auto translation for tags // Auto translation for tags
OCPUtil::addTranslations('recognize'); \OCP\Util::addTranslations('recognize');
} }
$response = new TemplateResponse($this->appName, 'main', self::getMainParams()); $response = new TemplateResponse($this->appName, 'main', self::getMainParams());