Skip to content

Commit

Permalink
Added support for namespace logo links
Browse files Browse the repository at this point in the history
  • Loading branch information
LouisOuellet committed Mar 7, 2024
1 parent 9e31394 commit 633ba5c
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 13 deletions.
1 change: 1 addition & 0 deletions conf/default.php
Expand Up @@ -18,6 +18,7 @@
$conf['useToolbar'] = 0;
$conf['useTooltips'] = 0;
$conf['doLogoChangesByNamespace'] = 0;
$conf['doLogoLinkChangesByNamespace'] = 0;

$conf['_plugins'] = '';
$conf['defaultAddNewPage'] = '';
Expand Down
25 changes: 13 additions & 12 deletions conf/metadata.php
Expand Up @@ -8,18 +8,19 @@

if (!defined('DOKU_INC')) die();

$meta['_tools'] = array('fieldset');
$meta['showPageToolsTitle'] = array('onoff');
$meta['showSiteToolsTitle'] = array('onoff');
$meta['showUserToolsTitle'] = array('onoff');
$meta['doSiteToolsRequireLogin'] = array('onoff');
$meta['_tools'] = array('fieldset');
$meta['showPageToolsTitle'] = array('onoff');
$meta['showSiteToolsTitle'] = array('onoff');
$meta['showUserToolsTitle'] = array('onoff');
$meta['doSiteToolsRequireLogin'] = array('onoff');

$meta['_extra'] = array('fieldset');
$meta['useToolbar'] = array('onoff');
$meta['useTooltips'] = array('onoff');
$meta['doLogoChangesByNamespace'] = array('onoff');
$meta['_extra'] = array('fieldset');
$meta['useToolbar'] = array('onoff');
$meta['useTooltips'] = array('onoff');
$meta['doLogoChangesByNamespace'] = array('onoff');
$meta['doLogoLinkChangesByNamespace'] = array('onoff');

$meta['_plugins'] = array('fieldset');
$meta['defaultAddNewPage'] = array('string');
$meta['_plugins'] = array('fieldset');
$meta['defaultAddNewPage'] = array('string');

$meta['_customizations'] = array('fieldset');
$meta['_customizations'] = array('fieldset');
1 change: 1 addition & 0 deletions lang/en/settings.php
Expand Up @@ -16,6 +16,7 @@
$lang['useToolbar'] = 'Enable the toolbar';
$lang['useTooltips'] = 'Enable the tooltips';
$lang['doLogoChangesByNamespace'] = 'Should the logo changes be by namespace';
$lang['doLogoLinkChangesByNamespace'] = 'Should the logo link changes be by namespace';

$lang['_plugins'] = 'Configure Plugins';
$lang['defaultAddNewPage'] = 'Namespace for AddNewPage plugin';
Expand Down
1 change: 1 addition & 0 deletions lang/fr/settings.php
Expand Up @@ -16,6 +16,7 @@
$lang['useToolbar'] = 'Active la barre d\'outils';
$lang['useTooltips'] = 'Active les infobulles';
$lang['doLogoChangesByNamespace'] = 'Les changements de logo doivent-ils être par espace de noms';
$lang['doLogoLinkChangesByNamespace'] = 'Les changements de liens logo doivent-ils être par espace de noms';

$lang['_plugins'] = 'Configure les Extensions';
$lang['defaultAddNewPage'] = 'Namespace pour l\'extension AddNewPage';
Expand Down
6 changes: 5 additions & 1 deletion tpl_functions.php
Expand Up @@ -39,8 +39,12 @@ function tpl_getLogo()
$logoImages[] = ':wiki:logo.png';
$logoImages[] = 'images/logo.png';
$logo = tpl_getMediaFile($logoImages, false, $logoSize);
$link = wl();
if(tpl_getConf('doLogoLinkChangesByNamespace')){
$link = str_replace(['/_media','logo.png'],['','index'],$logo);
}

$return .= '<a class="site-logo" href="'.wl().'" title="'.$conf['title'].'" rel="home" accesskey="h" title="[H]">';
$return .= '<a class="site-logo" href="'.$link.'" title="'.$conf['title'].'" rel="home" accesskey="h" title="[H]">';
$return .= '<img src="'.$logo.'" '.$logoSize[3].' alt="" class="no-grav header-image" />';
$return .= '</a>';

Expand Down

0 comments on commit 633ba5c

Please sign in to comment.