From 1d0a170f6e5056fea69d8f95ed1e98323950bff7 Mon Sep 17 00:00:00 2001 From: Silke Pisulla Date: Mon, 24 Apr 2017 15:13:56 +0200 Subject: [PATCH 1/6] SPR-882: section edit button improvements --- css/area_main-content.less | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/css/area_main-content.less b/css/area_main-content.less index d5db8a5..ea92ac9 100755 --- a/css/area_main-content.less +++ b/css/area_main-content.less @@ -6,7 +6,7 @@ #dokuwiki__content.main-content { - .level2 { + div[class^="level"] { p a.media { img { border: 1px dotted @ini_background; @@ -23,7 +23,8 @@ } > div, - .section_highlight > div { + .section_highlight > div, + div[class^="level"] > div { > ul, > ol { &:not([class="tabs"]) > li { From c98cbfb79a898c799d3680bc95e54fe4caa12470 Mon Sep 17 00:00:00 2001 From: Silke Pisulla Date: Mon, 24 Apr 2017 15:21:37 +0200 Subject: [PATCH 2/6] SPR-882: section edit button improvements --- css/area_main-content.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/css/area_main-content.less b/css/area_main-content.less index ea92ac9..1afe783 100755 --- a/css/area_main-content.less +++ b/css/area_main-content.less @@ -24,7 +24,7 @@ > div, .section_highlight > div, - div[class^="level"] > div { + div[class^="level"] { > ul, > ol { &:not([class="tabs"]) > li { From 4a1a2863dbd840c3cb0772c6adca687418dc4539 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Gro=C3=9Fe?= Date: Wed, 26 Apr 2017 12:05:32 +0200 Subject: [PATCH 3/6] Check the correct conf-option for hierarchical breadcrumbs SPR-969 --- tpl/nav-breadcrumb.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tpl/nav-breadcrumb.php b/tpl/nav-breadcrumb.php index 4ce634a..45dc061 100755 --- a/tpl/nav-breadcrumb.php +++ b/tpl/nav-breadcrumb.php @@ -1,7 +1,7 @@ + if ($conf['youarehere']): ?>
From 84f9464195fd1a808286d784d9f8370497d1d934 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Wed, 26 Apr 2017 14:57:49 +0200 Subject: [PATCH 4/6] SPR-972 add more info to the breadcrumb * add the current admin plugin to the breadcrumb * use proper translations for the various modes * do no longer rely on JavaScript for the enhanced breadcrumb * add image name in breadcrumb for detail view --- Template.php | 46 ++++++++++++++++++++++++++++++++++++++++++ js/breadcrumb.js | 30 --------------------------- lang/en/lang.php | 3 ++- script.js | 1 - tpl/nav-breadcrumb.php | 13 +++++++----- 5 files changed, 56 insertions(+), 37 deletions(-) delete mode 100644 js/breadcrumb.js diff --git a/Template.php b/Template.php index b2924d9..ba66389 100644 --- a/Template.php +++ b/Template.php @@ -205,4 +205,50 @@ class Template { echo $mobile; } } + + /** + * Add the current mode information to the hierarchical breadcrumbs + */ + public function breadcrumbSuffix() { + global $ACT; + global $lang; + global $INPUT; + global $ID; + global $conf; + global $IMG; + if($ACT == 'show') return; + + // find an apropriate label for the current mode + if($ACT) { + $label = tpl_getLang('mode_' . $ACT); + if(!$label) { + if(isset($lang['btn_' . $ACT])) { + $label = $lang['btn_' . $ACT]; + } else { + $label = $ACT; + } + } + } else { + // actually we would need to create a proper namespace breadcrumb path here, + // but this is the most simplest thing we can do for now + if(defined('DOKU_MEDIADETAIL')) { + $label = hsc(noNS($IMG)); + } else { + return; + } + } + + if($ACT == 'admin' && $INPUT->has('page')) { + $link = wl($ID, array('do' => 'admin')); + echo ' : ' . $label . ''; + + /** @var \DokuWiki_Admin_Plugin $plugin */ + $plugin = plugin_load('admin', $INPUT->str('page')); + if(!$plugin) return; + + $label = $plugin->getMenuText($conf['lang']); + } + + echo ' : ' . $label . ''; + } } diff --git a/js/breadcrumb.js b/js/breadcrumb.js deleted file mode 100644 index 7825584..0000000 --- a/js/breadcrumb.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * Sets up the breadcrumb behaviour (adds do / ACT status information) - * or adds tpl_getLang('image_detail') on detail template - */ -(function($) { - - - var setBreadcrumbSuffix = function(){ - - var $breadcrumb = $('.breadcrumbs'); - if (!$breadcrumb.length) return; - - - /** - * add ACT status to breadcrumb (if not show) - * or tpl_getLang('image_detail') on detail.php - */ - var mode = $breadcrumb.attr('data-do'); - if(mode && mode.indexOf('show') !== 0){ - var markup = ' : ' + mode + ''; - $breadcrumb.find('p').append(markup); - } - }; - - $(function(){ - setBreadcrumbSuffix(); - }); - - -})(jQuery); diff --git a/lang/en/lang.php b/lang/en/lang.php index 9c7d137..0e13cd3 100755 --- a/lang/en/lang.php +++ b/lang/en/lang.php @@ -51,7 +51,8 @@ $lang['osm_zoom_link_text'] = 'view larger map'; $lang['osm_zoom_link_title'] = 'external link opens new window'; $lang['image_detail'] = 'image details'; - +$lang['mode_edit'] = 'Editing Page'; +$lang['mode_detail'] = 'Image Details'; /** * colors diff --git a/script.js b/script.js index 11e9ce9..503fea9 100755 --- a/script.js +++ b/script.js @@ -8,4 +8,3 @@ /* DOKUWIKI:include js/meta-box.js */ /* DOKUWIKI:include js/sidebar.js */ -/* DOKUWIKI:include js/breadcrumb.js */ diff --git a/tpl/nav-breadcrumb.php b/tpl/nav-breadcrumb.php index 4ce634a..8332fb3 100755 --- a/tpl/nav-breadcrumb.php +++ b/tpl/nav-breadcrumb.php @@ -1,11 +1,14 @@ +if($conf['breadcrumbs']): ?> -
-

+
+

breadcrumbSuffix(); + ?>

- + From a2076f06902b01b31c2bf298eb69b03a79777aef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jana=20Deutschla=CC=88nder?= Date: Wed, 26 Apr 2017 15:53:38 +0200 Subject: [PATCH 5/6] SPR-969: change wording for head_breadcrumb in head_breadcrumb_youarehere to show that it is used for hierarchical breadcrumbs (conf-option youarehere) --- lang/de/lang.php | 2 +- lang/en/lang.php | 2 +- tpl/nav-breadcrumb.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lang/de/lang.php b/lang/de/lang.php index 62db31d..1273ce6 100755 --- a/lang/de/lang.php +++ b/lang/de/lang.php @@ -20,7 +20,7 @@ $lang['head_magic_matcher'] = 'MagicMatcher'; $lang['head_quick_search'] = 'wikiübergreifende Schnellsuche'; $lang['head_menu_main'] = 'Hauptmenü'; $lang['head_menu_status'] = 'Seitenstatus'; -$lang['head_breadcrumb'] = 'Standortanzeiger'; +$lang['head_breadcrumb_youarehere'] = 'Standortanzeiger'; $lang['head_menu_trace'] = 'Zuletzt Angesehen'; $lang['head_meta_box'] = 'Metainformationen zur Seite'; diff --git a/lang/en/lang.php b/lang/en/lang.php index 9c7d137..3f20956 100755 --- a/lang/en/lang.php +++ b/lang/en/lang.php @@ -20,7 +20,7 @@ $lang['head_magic_matcher'] = 'MagicMatcher'; $lang['head_quick_search'] = 'quick search'; $lang['head_menu_main'] = 'main menu'; $lang['head_menu_status'] = 'site status'; -$lang['head_breadcrumb'] = 'location indicator'; +$lang['head_breadcrumb_youarehere'] = 'location indicator'; $lang['head_menu_trace'] = 'Last Visited Pages'; $lang['head_meta_box'] = 'meta data for this page'; $lang['head_menu_starred'] = 'Starred Pages'; diff --git a/tpl/nav-breadcrumb.php b/tpl/nav-breadcrumb.php index 45dc061..1ab1359 100755 --- a/tpl/nav-breadcrumb.php +++ b/tpl/nav-breadcrumb.php @@ -4,7 +4,7 @@ if ($conf['youarehere']): ?> -
+

From cbf9c4a6f02001fc16eeca01e7942bc502d26a14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jana=20Deutschla=CC=88nder?= Date: Wed, 26 Apr 2017 16:00:43 +0200 Subject: [PATCH 6/6] fix conf-option --- tpl/nav-breadcrumb.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tpl/nav-breadcrumb.php b/tpl/nav-breadcrumb.php index 8332fb3..7be3e68 100755 --- a/tpl/nav-breadcrumb.php +++ b/tpl/nav-breadcrumb.php @@ -1,7 +1,7 @@ +if($conf['hereyouare']): ?>