1
0
Fork 0

Merge pull request #9039 from MrPetovan/task/frio-accent-scheme

[frio] Add accented schemes including dark scheme and black scheme
This commit is contained in:
Tobias Diekershoff 2020-08-20 07:01:40 +02:00 committed by GitHub
commit 0d1fa70e2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 1471 additions and 846 deletions

View file

@ -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'];
}

View file

@ -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();