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/css/area_main-content.less b/css/area_main-content.less index da0ecd7..c851248 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_site; @@ -23,7 +23,8 @@ } > div, - .section_highlight > div { + .section_highlight > div, + div[class^="level"] { > ul, > ol { &:not([class="tabs"]) > li { 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/de/lang.php b/lang/de/lang.php index 2e771c1..1dd858a 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'; $lang['head_menu_starred'] = 'gemerkte Seite'; @@ -54,6 +54,9 @@ $lang['osm_zoom_link_title'] = 'externer Link - öffnet in neuem Fenster' $lang['image_detail'] = 'Detailinformationen zum Bild'; +$lang['mode_edit'] = 'Seite bearbeiten'; +$lang['mode_detail'] = 'Details zum Bild'; + /** * colors */ diff --git a/lang/en/lang.php b/lang/en/lang.php index c6b6d5f..cbbf3c2 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'; @@ -53,6 +53,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 @@ -92,4 +94,4 @@ $lang['__background_alt__'] = 'table head, table cell (hover), struct La $lang['__text_alt__'] = 'table head (unlinked), table cell (hover), struct Label (hover) - font color (alternative)'; $lang['__border__'] = 'tables, form fields, blockquotes - border color'; -$lang['__default_border_radius__'] = 'wiki icons, content (top right) - border radius'; +$lang['__default_border_radius__'] = 'wiki icons, content (top right) - border radius'; \ No newline at end of file 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..a8c2680 100755 --- a/tpl/nav-breadcrumb.php +++ b/tpl/nav-breadcrumb.php @@ -1,11 +1,13 @@ + if ($conf['youarehere']): ?> +
++ breadcrumbSuffix(); + ?> +
- - - - - - +