diff --git a/mod/cal.php b/mod/cal.php index 0e8e8a2af3..1ac11dc98b 100644 --- a/mod/cal.php +++ b/mod/cal.php @@ -105,6 +105,11 @@ function cal_content(App $a) // get the translation strings for the callendar $i18n = Event::getStrings(); + DI::page()->registerStylesheet('view/asset/fullcalendar/dist/fullcalendar.min.css'); + DI::page()->registerStylesheet('view/asset/fullcalendar/dist/fullcalendar.print.min.css', 'print'); + DI::page()->registerFooterScript('view/asset/moment/min/moment-with-locales.min.js'); + DI::page()->registerFooterScript('view/asset/fullcalendar/dist/fullcalendar.min.js'); + $htpl = Renderer::getMarkupTemplate('event_head.tpl'); DI::page()['htmlhead'] .= Renderer::replaceMacros($htpl, [ '$module_url' => '/cal/' . $a->data['user']['nickname'], diff --git a/mod/events.php b/mod/events.php index 69f6b6f326..d82fbd818e 100644 --- a/mod/events.php +++ b/mod/events.php @@ -256,6 +256,11 @@ function events_content(App $a) // get the translation strings for the callendar $i18n = Event::getStrings(); + DI::page()->registerStylesheet('view/asset/fullcalendar/dist/fullcalendar.min.css'); + DI::page()->registerStylesheet('view/asset/fullcalendar/dist/fullcalendar.print.min.css', 'print'); + DI::page()->registerFooterScript('view/asset/moment/min/moment-with-locales.min.js'); + DI::page()->registerFooterScript('view/asset/fullcalendar/dist/fullcalendar.min.js'); + $htpl = Renderer::getMarkupTemplate('event_head.tpl'); DI::page()['htmlhead'] .= Renderer::replaceMacros($htpl, [ '$module_url' => '/events', diff --git a/src/App/Page.php b/src/App/Page.php index d3365a16c1..c2bfb38878 100644 --- a/src/App/Page.php +++ b/src/App/Page.php @@ -165,11 +165,10 @@ class Page implements ArrayAccess * The path can be absolute or relative to the Friendica installation base folder. * * @param string $path - * + * @param string $media * @see Page::initHead() - * */ - public function registerStylesheet($path) + public function registerStylesheet($path, string $media = 'screen') { $path = Network::appendQueryParam($path, ['v' => FRIENDICA_VERSION]); @@ -177,7 +176,7 @@ class Page implements ArrayAccess $path = mb_substr($path, mb_strlen($this->basePath . DIRECTORY_SEPARATOR)); } - $this->stylesheets[] = trim($path, '/'); + $this->stylesheets[trim($path, '/')] = $media; } /** @@ -252,7 +251,7 @@ class Page implements ArrayAccess '$shortcut_icon' => $shortcut_icon, '$touch_icon' => $touch_icon, '$block_public' => intval($config->get('system', 'block_public')), - '$stylesheets' => array_unique($this->stylesheets), + '$stylesheets' => $this->stylesheets, ]) . $this->page['htmlhead']; } diff --git a/view/templates/event_head.tpl b/view/templates/event_head.tpl index 463ba720e2..8990c6fb25 100644 --- a/view/templates/event_head.tpl +++ b/view/templates/event_head.tpl @@ -1,9 +1,3 @@ - - - - - - -