@@ -91,10 +91,27 @@ public function insert(&$tpl, $variable, $value, $block_title = '') {
9191 *
9292 * @throws xoctException
9393 */
94- public function insertThumbnail (&$ tpl , $ block_title = 'thumbnail ' , $ variable = 'THUMBNAIL ' ) {
95- $ this ->insert ($ tpl , $ variable , $ this ->getThumbnailHTML (), $ block_title );
94+ public function insertPreviewImage (&$ tpl , $ block_title = 'preview_image ' , $ variable = 'PREVIEW_IMAGE ' ) {
95+ $ this ->insert ($ tpl , $ variable , $ this ->getPreviewImageHTML (), $ block_title );
9696 }
9797
98+ /**
99+ * @return string
100+ * @throws xoctException
101+ */
102+ public function getPreviewImageHTML () {
103+ $ preview_image_tpl = self ::plugin ()->template ('default/tpl.event_preview_image.html ' );
104+ $ preview_image_tpl ->setVariable ('ID ' , $ this ->event ->getIdentifier ());
105+ $ preview_image_tpl ->setVariable ('THUMBNAIL ' , $ this ->getThumbnailHTML ());
106+ return $ preview_image_tpl ->get ();
107+ }
108+
109+ /**
110+ * @return string
111+ */
112+ public function getPreviewLink () {
113+ return 'data-preview_link=" ' . $ this ->event ->getIdentifier () . '" ' ;
114+ }
98115
99116 /**
100117 * @return string
@@ -135,6 +152,7 @@ public function getPlayerLinkHTML($button_type = 'btn-info') {
135152 $ link_tpl = self ::plugin ()->template ('default/tpl.player_link.html ' );
136153 $ link_tpl ->setVariable ('LINK_TEXT ' , self ::plugin ()->translate ($ this ->event ->isLiveEvent () ? 'player_live ' : 'player ' , self ::LANG_MODULE ));
137154 $ link_tpl ->setVariable ('BUTTON_TYPE ' , $ button_type );
155+ $ link_tpl ->setVariable ('PREVIEW_LINK ' , $ this ->getPreviewLink ());
138156 $ link_tpl ->setVariable ('TARGET ' , '_blank ' );
139157 if (PluginConfig::getConfig (PluginConfig::F_USE_MODALS )) {
140158 $ modal = $ this ->getPlayerModal ();
0 commit comments