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/src/Module/Theme.php b/src/Module/Theme.php index c904f1defd..87aa8dedda 100644 --- a/src/Module/Theme.php +++ b/src/Module/Theme.php @@ -32,19 +32,17 @@ class Theme extends BaseModule { public static function rawContent(array $parameters = []) { - header("Content-Type: text/css"); + header('Content-Type: text/css'); - $a = DI::app(); + $theme = Strings::sanitizeFilePathItem($parameters['theme']); - if ($a->argc == 4) { - $theme = $a->argv[2]; - $theme = Strings::sanitizeFilePathItem($theme); + if (file_exists("view/theme/$theme/theme.php")) { + require_once "view/theme/$theme/theme.php"; + } - // set the path for later use in the theme styles - $THEMEPATH = "view/theme/$theme"; - if (file_exists("view/theme/$theme/style.php")) { - require_once("view/theme/$theme/style.php"); - } + // set the path for later use in the theme styles + if (file_exists("view/theme/$theme/style.php")) { + require_once "view/theme/$theme/style.php"; } exit(); 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 @@ - - - - - - - -{{include file="field_select.tpl" field=$scheme}} +
+ + +
-{{if $nav_bg}}{{include file="field_input.tpl" field=$share_string}}{{/if}} +{{if $scheme_accent}} +
+

+ + + + + +
+{{/if}} + +{{if $share_string}}{{include file="field_input.tpl" field=$share_string}}{{/if}} {{if $nav_bg}}{{include file="field_colorinput.tpl" field=$nav_bg}}{{/if}} {{if $nav_icon_color}}{{include file="field_colorinput.tpl" field=$nav_icon_color}}{{/if}} {{if $link_color}}{{include file="field_colorinput.tpl" field=$link_color}}{{/if}} @@ -17,7 +63,7 @@
- +
@@ -183,7 +229,7 @@ }); -
+
diff --git a/view/theme/frio/theme.php b/view/theme/frio/theme.php index 687f87401d..4c37e42e73 100644 --- a/view/theme/frio/theme.php +++ b/view/theme/frio/theme.php @@ -21,6 +21,12 @@ use Friendica\Model\Contact; use Friendica\Module; use Friendica\Util\Strings; +const FRIO_SCHEME_ACCENT_BLUE = '#1e87c2'; +const FRIO_SCHEME_ACCENT_RED = '#b50404'; +const FRIO_SCHEME_ACCENT_PURPLE = '#a54bad'; +const FRIO_SCHEME_ACCENT_GREEN = '#218f39'; +const FRIO_SCHEME_ACCENT_PINK = '#d900a9'; + function frio_init(App $a) { global $frio; @@ -319,51 +325,3 @@ function frio_display_item(App $a, &$arr) } $arr['output']['subthread'] = $subthread; } - -/** - * @param int|null $uid - * @return string - * @see \Friendica\Core\Theme::getBackgroundColor() - */ -function frio_get_background_color(int $uid = null) -{ - $background_color = DI::config()->get('frio', 'background_color') ?: '#ededed'; - - if ($uid) { - $background_color = DI::pConfig()->get($uid, 'frio', 'background_color') ?: $background_color; - } - - $scheme = DI::config()->get('frio', 'scheme', DI::config()->get('frio', 'schema')); - $scheme = Strings::sanitizeFilePathItem($scheme); - - if ($scheme && ($scheme != '---') && file_exists('view/theme/frio/scheme/' . $scheme . '.php')) { - $schemefile = 'view/theme/frio/scheme/' . $scheme . '.php'; - require_once $schemefile; - } - - return $background_color; -} - -/** - * @param int|null $uid - * @return string - * @see \Friendica\Core\Theme::getThemeColor() - */ -function frio_get_theme_color(int $uid = null) -{ - $nav_bg = DI::config()->get('frio', 'nav_bg') ?: '#708fa0'; - - if ($uid) { - $nav_bg = DI::pConfig()->get($uid, 'frio', 'background_color') ?: $nav_bg; - } - - $scheme = DI::config()->get('frio', 'scheme', DI::config()->get('frio', 'schema')); - $scheme = Strings::sanitizeFilePathItem($scheme); - - if ($scheme && ($scheme != '---') && file_exists('view/theme/frio/scheme/' . $scheme . '.php')) { - $schemefile = 'view/theme/frio/scheme/' . $scheme . '.php'; - require_once $schemefile; - } - - return $nav_bg; -}