33
44namespace MichalSpacekCz \Admin \Presenters ;
55
6- use MichalSpacekCz \Form \TalkFormFactory ;
76use MichalSpacekCz \Form \TalkSlidesFormFactory ;
87use MichalSpacekCz \Http \HttpInput ;
98use MichalSpacekCz \Media \Exceptions \ContentTypeException ;
10- use MichalSpacekCz \Media \VideoThumbnails ;
119use MichalSpacekCz \Talks \Exceptions \TalkDoesNotExistException ;
1210use MichalSpacekCz \Talks \Talk ;
11+ use MichalSpacekCz \Talks \TalkInputs ;
12+ use MichalSpacekCz \Talks \TalkInputsFactory ;
1313use MichalSpacekCz \Talks \Talks ;
1414use MichalSpacekCz \Talks \TalkSlides ;
1515use Nette \Application \BadRequestException ;
@@ -33,9 +33,8 @@ class TalksPresenter extends BasePresenter
3333 public function __construct (
3434 private readonly Talks $ talks ,
3535 private readonly TalkSlides $ talkSlides ,
36- private readonly TalkFormFactory $ talkFormFactory ,
36+ private readonly TalkInputsFactory $ talkInputsFactory ,
3737 private readonly TalkSlidesFormFactory $ talkSlidesFormFactory ,
38- private readonly VideoThumbnails $ videoThumbnails ,
3938 private readonly HttpInput $ httpInput ,
4039 ) {
4140 parent ::__construct ();
@@ -47,8 +46,6 @@ public function renderDefault(): void
4746 $ this ->template ->pageTitle = $ this ->translator ->translate ('messages.title.talks ' );
4847 $ this ->template ->upcomingTalks = $ this ->talks ->getUpcoming ();
4948 $ this ->template ->talks = $ this ->talks ->getAll ();
50- $ this ->template ->videoThumbnailWidth = $ this ->videoThumbnails ->getWidth ();
51- $ this ->template ->videoThumbnailHeight = $ this ->videoThumbnails ->getHeight ();
5249 }
5350
5451
@@ -62,8 +59,6 @@ public function actionTalk(string $param): void
6259
6360 $ this ->template ->pageTitle = $ this ->talks ->pageTitle ('messages.title.talk ' , $ this ->talk );
6461 $ this ->template ->talk = $ this ->talk ;
65- $ this ->template ->videoThumbnailWidth = $ this ->videoThumbnails ->getWidth ();
66- $ this ->template ->videoThumbnailHeight = $ this ->videoThumbnails ->getHeight ();
6762 }
6863
6964
@@ -88,26 +83,15 @@ public function actionSlides(string $param): void
8883 }
8984
9085
91- protected function createComponentEditTalk (): Form
86+ protected function createComponentEditTalkInputs (): TalkInputs
9287 {
93- return $ this ->talkFormFactory ->create (
94- function (Html $ message ): never {
95- $ this ->flashMessage ($ message );
96- $ this ->redirect ('Talks: ' );
97- },
98- $ this ->talk ,
99- );
88+ return $ this ->talkInputsFactory ->createFor ($ this ->talk );
10089 }
10190
10291
103- protected function createComponentAddTalk (): Form
92+ protected function createComponentAddTalkInputs (): TalkInputs
10493 {
105- return $ this ->talkFormFactory ->create (
106- function (Html $ message ): never {
107- $ this ->flashMessage ($ message );
108- $ this ->redirect ('Talks: ' );
109- },
110- );
94+ return $ this ->talkInputsFactory ->create ();
11195 }
11296
11397
0 commit comments