Skip to content

Commit

Permalink
Merge branch 'hotfix/editbtn-pageid'
Browse files Browse the repository at this point in the history
  • Loading branch information
giterlizzi committed Jun 27, 2019
2 parents a9ae9cb + fca8142 commit 55c1a78
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 10 deletions.
1 change: 1 addition & 0 deletions RELEASE.md
Expand Up @@ -55,6 +55,7 @@ Enjoy!
### Patches
* Fixed "PHP Notice" for `MAX_FILE_SIZE`
* Fixed Bootswatch Theme selection behavior
* Fixed navbar "Edit button" behavior
* #421: Fixed "showIndividualTool" issue (thanks to @AmritasyaPutra)
* #422: Fixed graphic incompatibility for Folded plugin (thanks to @virk)
* #423: Fixed PHP warnings for Page Tools (thanks to @fschmittlein)
Expand Down
27 changes: 26 additions & 1 deletion css/template.less
Expand Up @@ -427,10 +427,35 @@ div#picker2 {
}


.pageId a.label {
#dokuwiki__pageheader p a.label {
white-space: initial;
}

/* Page ID */
[data-img-id] .pageId {

&::after {
content: " }}";
}

&::before {
content: "{{ ";
}

}

[data-page-id] .pageId {

&::after {
content: " ]]";
}

&::before {
content: "[[ ";
}

}


.mode_search li {
list-style-type: none;
Expand Down
4 changes: 2 additions & 2 deletions detail.php
Expand Up @@ -323,9 +323,9 @@

<?php require_once('tpl/breadcrumbs.php'); ?>

<p class="pageId text-right">
<p class="text-right">
<?php if($TEMPLATE->getConf('showPageId')): ?>
<span class="ml-1 label label-primary">{{<?php echo hsc(tpl_img_getTag('IPTC.Headline',$IMG)); ?>}}</span>
<span class="pageId ml-1 label label-primary"><?php echo hsc(tpl_img_getTag('IPTC.Headline',$IMG)); ?></span>
<?php endif; ?>
</p>

Expand Down
4 changes: 2 additions & 2 deletions main.php
Expand Up @@ -60,15 +60,15 @@

<?php require_once(template('tpl/breadcrumbs.php')); ?>

<p class="pageId text-right">
<p class="text-right">
<?php

if ($TEMPLATE->getConf('tagsOnTop') && $tag = $TEMPLATE->getPlugin('tag')) {
echo implode('', array_map('trim', explode(',', $tag->td($ID))));
}

if ($TEMPLATE->getConf('showPageId')) {
echo '<span class="ml-1 label label-primary">[['. hsc($ID) .']]</span>';
echo '<span class="pageId ml-1 label label-primary">'. hsc($ID) .'</span>';
}

?>
Expand Down
36 changes: 31 additions & 5 deletions tpl/navbar.php
Expand Up @@ -102,11 +102,37 @@

<ul class="nav navbar-nav">

<?php if ($TEMPLATE->getConf('showEditBtn')): ?>
<li class="dw-action-icon hidden-xs">
<?php tpl_actionlink('edit', '<span class="sr-only">', '</span>'); ?>
</li>
<?php endif; ?>
<?php

if ($TEMPLATE->getConf('showEditBtn')) {

$action = null;

global $ACT;

if ($ACT == 'edit') {
$action = 'show';
}
if ($ACT == 'show') {
$action = 'edit';
}

if ($action && $edit_action = $TEMPLATE->getToolMenuItem('page', $action)) {

$edit_attr = $edit_action->getLinkAttributes();

$edit_html = '<li class="hidden-xs"><a '. buildAttributes($edit_attr) . '>';
$edit_html .= \inlineSVG($edit_action->getSvg());
#$edit_html .= hsc($edit_action->getLabel());
$edit_html .= "</a></li>";

echo $edit_html;

}

}

?>

<?php if ($TEMPLATE->getConf('fluidContainerBtn')): ?>
<li class="hidden-xs <?php echo ($TEMPLATE->getFluidContainerStatus() ? 'active' : '')?>">
Expand Down

0 comments on commit 55c1a78

Please sign in to comment.