66class PresentationSpeaker extends DataObject
77 implements IPresentationSpeaker
88{
9+ static $ default_published_presentation_types = [
10+ IPresentationType::Keynotes,
11+ IPresentationType::Panel,
12+ IPresentationType::Presentation,
13+ IPresentationType::LightingTalks,
14+ IPresentationType::Workshop,
15+ IPresentationType::Fishbowl
16+ ];
17+
18+ static $ default_regular_presentation_types = [
19+ IPresentationType::Keynotes,
20+ IPresentationType::Panel,
21+ IPresentationType::Presentation,
22+ IPresentationType::Workshop
23+ ];
924
1025 use SummitEntityMetaTagGenerator;
1126
@@ -385,20 +400,23 @@ public function AllRelatedPresentations()
385400 */
386401 public function PublishedPresentations ($ summit_id = null , $ role = IPresentationSpeaker::RoleSpeaker, $ exclude_privates_tracks = true , array $ excluded_tracks = [])
387402 {
388- $ types = [
389- IPresentationType::Keynotes,
390- IPresentationType::Panel,
391- IPresentationType::Presentation,
392- IPresentationType::LightingTalks,
393- IPresentationType::Workshop,
394- IPresentationType::Fishbowl
395- ];
403+ $ regular_types = [];
404+
405+ if (is_null (!$ summit_id ))
406+ {
407+ $ summit = Summit::get ()->byID ($ summit_id );
408+ if ($ summit )
409+ $ regular_types = $ summit ->getPublishedPresentationTypesList ();
410+ }
411+
412+ if (count ($ regular_types ))
413+ $ regular_types = self ::$ default_published_presentation_types ;
396414
397415 return $ this ->PublishedPresentationsByType
398416 (
399417 $ summit_id ,
400418 $ role ,
401- $ types ,
419+ $ regular_types ,
402420 $ exclude_privates_tracks ,
403421 $ excluded_tracks
404422 );
@@ -419,16 +437,23 @@ public function PublishedRegularPresentations
419437 array $ excluded_tracks = []
420438 )
421439 {
440+ $ regular_types = [];
441+
442+ if (is_null (!$ summit_id ))
443+ {
444+ $ summit = Summit::get ()->byID ($ summit_id );
445+ if ($ summit )
446+ $ regular_types = $ summit ->getRegularPresentationTypesList ();
447+ }
448+
449+ if (count ($ regular_types ))
450+ $ regular_types = self ::$ default_regular_presentation_types ;
451+
422452 $ list = $ this ->PublishedPresentationsByType
423453 (
424454 $ summit_id ,
425455 $ role ,
426- [
427- IPresentationType::Keynotes,
428- IPresentationType::Panel,
429- IPresentationType::Presentation,
430- IPresentationType::Workshop
431- ],
456+ $ regular_types ,
432457 true ,
433458 $ excluded_tracks
434459 )->toArray ();
@@ -438,12 +463,7 @@ public function PublishedRegularPresentations
438463 (
439464 $ summit_id ,
440465 IPresentationSpeaker::RoleSpeaker,
441- [
442- IPresentationType::Keynotes,
443- IPresentationType::Panel,
444- IPresentationType::Presentation,
445- IPresentationType::Workshop
446- ],
466+ $ regular_types ,
447467 true ,
448468 $ excluded_tracks
449469 );
@@ -530,16 +550,23 @@ public function hasPublishedLightningPresentations
530550 public function PublishedPresentationsByType (
531551 $ summit_id = null ,
532552 $ role = IPresentationSpeaker::RoleSpeaker,
533- array $ types_slugs = [
534- IPresentationType::Keynotes,
535- IPresentationType::Panel,
536- IPresentationType::Presentation,
537- IPresentationType::Workshop,
538- IPresentationType::LightingTalks
539- ],
553+ array $ types_slugs = [],
540554 $ exclude_privates_tracks = true ,
541555 array $ excluded_tracks = []
542556 ){
557+ if (!count ($ types_slugs )){
558+
559+ if (is_null (!$ summit_id ))
560+ {
561+ $ summit = Summit::get ()->byID ($ summit_id );
562+ if ($ summit )
563+ $ types_slugs = $ summit ->getRegularPresentationTypesList ();
564+ }
565+
566+ if (count ($ types_slugs ))
567+ $ types_slugs = self ::$ default_regular_presentation_types ;
568+ }
569+
543570 $ summit = !$ summit_id ? Summit::get_active () : Summit::get ()->byID ($ summit_id );
544571 if (!$ summit ) return false ;
545572
0 commit comments