mirror of
https://github.com/processwire/processwire.git
synced 2025-08-09 16:26:59 +02:00
Fix issue processwire/processwire-issues#1206
This commit is contained in:
@@ -967,6 +967,7 @@ class AdminThemeUikit extends AdminThemeFramework implements Module, Configurabl
|
||||
* - `getURL` (bool): Return only the URL? (default=false)
|
||||
* - `getNative` (bool): Return only the ProcessWire brand logo? (default=false)
|
||||
* - `alt` (string): Alt attribute for <img> tag (default=auto)
|
||||
* - `height` (string): Height style to use for SVG images (default='')
|
||||
* @return string
|
||||
*
|
||||
*/
|
||||
@@ -981,10 +982,12 @@ class AdminThemeUikit extends AdminThemeFramework implements Module, Configurabl
|
||||
'getURL' => false,
|
||||
'getNative' => false,
|
||||
'alt' => '',
|
||||
'height' => '',
|
||||
);
|
||||
|
||||
$options = array_merge($defaults, $options);
|
||||
$logoURL = $this->get('logoURL');
|
||||
$svg = false;
|
||||
|
||||
if(empty($logoURL) || $options['getNative'] || strpos($logoURL, '//') !== false) {
|
||||
$native = true;
|
||||
@@ -993,6 +996,7 @@ class AdminThemeUikit extends AdminThemeFramework implements Module, Configurabl
|
||||
$logoURL = $config->urls->root . ltrim($logoURL, '/');
|
||||
$logoURL = $sanitizer->entities($logoURL);
|
||||
$native = false;
|
||||
$svg = strtolower(pathinfo($logoURL, PATHINFO_EXTENSION)) === 'svg';
|
||||
}
|
||||
|
||||
if($options['getURL']) return $logoURL;
|
||||
@@ -1002,7 +1006,9 @@ class AdminThemeUikit extends AdminThemeFramework implements Module, Configurabl
|
||||
$alt = "ProcessWire $config->version";
|
||||
}
|
||||
$class = 'pw-logo ' . ($native ? 'pw-logo-native' : 'pw-logo-custom');
|
||||
$img = "<img class='$class' src='$logoURL' alt='$alt' />";
|
||||
$attr = "class='$class' src='$logoURL' alt='$alt' ";
|
||||
if($svg && $options['height']) $attr .= "style='height:$options[height]' ";
|
||||
$img = "<img $attr/>";
|
||||
|
||||
return $img;
|
||||
}
|
||||
|
@@ -9,12 +9,14 @@ if(!defined("PROCESSWIRE")) die();
|
||||
/** @var Config $config */
|
||||
/** @var Notices $notices */
|
||||
|
||||
$logoOptions = array('height' => '40px');
|
||||
|
||||
?>
|
||||
<div id='pw-mastheads'>
|
||||
<header id='pw-masthead-mobile' class='pw-masthead uk-hidden uk-background-muted'>
|
||||
<div class='pw-container uk-container uk-container-expand<?php if(!$adminTheme->isLoggedIn) echo ' uk-text-center'; ?>'>
|
||||
<a href='<?php echo $adminTheme->isLoggedIn ? $config->urls->admin : $config->urls->root; ?>' class='pw-logo-link'>
|
||||
<?php echo $adminTheme->getLogo(); ?>
|
||||
<?php echo $adminTheme->getLogo($logoOptions); ?>
|
||||
</a>
|
||||
</div>
|
||||
</header>
|
||||
@@ -23,7 +25,7 @@ if(!defined("PROCESSWIRE")) die();
|
||||
<nav class='uk-navbar uk-navbar-container uk-navbar-transparent' uk-navbar>
|
||||
<div class='uk-navbar-left'>
|
||||
<a class="pw-logo-link uk-logo uk-margin-right" href='<?php echo $adminTheme->isLoggedIn ? $config->urls->admin : $config->urls->root; ?>'>
|
||||
<?php echo $adminTheme->getLogo(); ?>
|
||||
<?php echo $adminTheme->getLogo($logoOptions); ?>
|
||||
</a>
|
||||
<?php if($adminTheme->isLoggedIn): ?>
|
||||
<ul class='uk-navbar-nav pw-primary-nav'>
|
||||
|
Reference in New Issue
Block a user