Move calendar/event stylesheets/scripts registration to modules
- Add media parameter to Page->registerStylesheet - Fixes CSS precedence with custom theme stylesheet
This commit is contained in:
parent
4b15b9fe56
commit
2e286d6a57
7 changed files with 20 additions and 21 deletions
|
@ -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'];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue