From b50ea48e0a0e6c89b3308144303d7a4a85d4870f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?"J.=20Rene=CC=81e=20Beach"?= Date: Wed, 31 Oct 2012 18:33:11 -0400 Subject: [PATCH] Issue #1137920 by jessebeach, kathryn531: Toolbar completely broken for small screen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit commit a5fcbf48df9cbfc849960992b37bb6a0300b0834 Author: J. Renée Beach Date: Wed Oct 31 18:19:43 2012 -0400 Issue #1137920 by jessebeach, kathryn531: Toolbar completely broken for small screen Signed-off-by: J. Renée Beach Signed-off-by: J. Renée Beach --- core/modules/shortcut/shortcut.base.css | 13 - core/modules/shortcut/shortcut.module | 43 +- core/modules/shortcut/shortcut.theme.css | 71 +-- core/modules/system/system.module | 10 +- .../modules/toolbar/config/toolbar.breakpoints.yml | 1 + core/modules/toolbar/config/toolbar.config.yml | 2 + core/modules/toolbar/css/toolbar.base-rtl.css | 25 + core/modules/toolbar/css/toolbar.base.css | 230 +++++++++ core/modules/toolbar/css/toolbar.icons.css | 79 +++ core/modules/toolbar/css/toolbar.theme-rtl.css | 7 + core/modules/toolbar/css/toolbar.theme.css | 255 ++++++++++ core/modules/toolbar/js/toolbar.js | 531 ++++++++++++++++++++ core/modules/toolbar/templates/toolbar.tpl.php | 17 +- core/modules/toolbar/toolbar-rtl.css | 37 -- core/modules/toolbar/toolbar.css | 129 ----- core/modules/toolbar/toolbar.info | 5 + core/modules/toolbar/toolbar.js | 115 ----- core/modules/toolbar/toolbar.module | 289 +++++------ core/modules/user/user.css | 11 + core/modules/user/user.module | 64 +++ 20 files changed, 1393 insertions(+), 541 deletions(-) create mode 100755 core/modules/toolbar/config/toolbar.breakpoints.yml create mode 100755 core/modules/toolbar/config/toolbar.config.yml create mode 100644 core/modules/toolbar/css/toolbar.base-rtl.css create mode 100644 core/modules/toolbar/css/toolbar.base.css create mode 100644 core/modules/toolbar/css/toolbar.icons-rtl.css create mode 100644 core/modules/toolbar/css/toolbar.icons.css create mode 100644 core/modules/toolbar/css/toolbar.theme-rtl.css create mode 100644 core/modules/toolbar/css/toolbar.theme.css create mode 100755 core/modules/toolbar/js/toolbar.js delete mode 100644 core/modules/toolbar/toolbar-rtl.css delete mode 100644 core/modules/toolbar/toolbar.css mode change 100644 => 100755 core/modules/toolbar/toolbar.info delete mode 100644 core/modules/toolbar/toolbar.js mode change 100644 => 100755 core/modules/toolbar/toolbar.module diff --git a/core/modules/shortcut/shortcut.base.css b/core/modules/shortcut/shortcut.base.css index 90a1046..5af1151 100644 --- a/core/modules/shortcut/shortcut.base.css +++ b/core/modules/shortcut/shortcut.base.css @@ -5,19 +5,6 @@ */ /** - * Toolbar. - */ -#edit-shortcuts { - float: right; /* LTR */ -} -#shortcut-toolbar ul { - float: left; /* LTR */ -} -#shortcut-toolbar .icon { - float: left; /* LTR */ -} - -/** * Add/remove links. */ .add-or-remove-shortcuts .icon { diff --git a/core/modules/shortcut/shortcut.module b/core/modules/shortcut/shortcut.module index 9bbb12a..9ec9e3d 100644 --- a/core/modules/shortcut/shortcut.module +++ b/core/modules/shortcut/shortcut.module @@ -713,18 +713,28 @@ function shortcut_preprocess_page(&$variables) { } /** - * Implements hook_page_alter(). - */ -function shortcut_page_alter(&$page) { - if (isset($page['page_top']['toolbar'])) { - // If the toolbar is available, add a pre-render function to display the - // current shortcuts in the toolbar drawer. - $page['page_top']['toolbar']['#pre_render'][] = 'shortcut_toolbar_pre_render'; - } + * Implements hook_toolbar_register_tabs(). + */ +function shortcut_toolbar_register_tabs() { + $tab['shortcuts'] = array( + 'tab' => array( + 'title' => t('Shortcuts'), + 'href' => '', + 'html' => FALSE, + 'attributes' => array( + 'title' => t('Shortcuts'), + ), + ), + 'tray' => array( + '#pre_render' => array('shortcut_toolbar_pre_render'), + ), + ); + + return $tab; } /** - * Pre-render function for adding shortcuts to the toolbar drawer. + * Pre-render function for adding shortcuts to the toolbar. */ function shortcut_toolbar_pre_render($toolbar) { $links = shortcut_renderable_links(); @@ -734,8 +744,6 @@ function shortcut_toolbar_pre_render($toolbar) { drupal_get_path('module', 'shortcut') . '/shortcut.theme.css', ), ); - $links['#prefix'] = '
'; - $links['#suffix'] = '
'; $shortcut_set = shortcut_current_displayed_set(); $configure_link = NULL; if (shortcut_set_edit_access($shortcut_set)) { @@ -747,13 +755,18 @@ function shortcut_toolbar_pre_render($toolbar) { ); } - $drawer = array( - 'shortcuts' => $links, + $links_wrapper = array( + 'shortcuts' => array( + '#type' => 'container', + '#attributes' => array( + 'class' => array('toolbar-list'), + ), + 'links' => $links, + ), 'configure' => $configure_link, ); - $toolbar['toolbar_drawer'][] = $drawer; - return $toolbar; + return $links_wrapper; } /** diff --git a/core/modules/shortcut/shortcut.theme.css b/core/modules/shortcut/shortcut.theme.css index 9e2dc69..d690169 100644 --- a/core/modules/shortcut/shortcut.theme.css +++ b/core/modules/shortcut/shortcut.theme.css @@ -5,45 +5,6 @@ */ /** - * Toolbar. - */ -.toolbar #edit-shortcuts { - line-height: 24px; - padding: 5px 10px; -} -#edit-shortcuts:focus, -#edit-shortcuts:hover, -#edit-shortcuts.active { - text-decoration: underline; -} -#shortcut-toolbar ul { - line-height: 24px; - margin-left: 5px; /* LTR */ - padding: 5px 0; -} -#shortcut-toolbar a { - border-radius: 5px; - margin-right: 5px; /* LTR */ - padding: 0 5px; -} -#shortcut-toolbar a:focus, -#shortcut-toolbar a:hover, -#shortcut-toolbar a.active:focus { - background: #555; -} -#shortcut-toolbar a.active:hover, -#shortcut-toolbar a.active { - background-color: #000; -} -#shortcut-toolbar .icon { - background-color: #444; - border-radius: 5px; - height: 30px; - margin-right: 5px; /* LTR */ - width: 30px; -} - -/** * Add/remove links. */ .add-or-remove-shortcuts .icon { @@ -65,15 +26,27 @@ .remove-shortcut a:hover .icon { background-position: -12px -12px; /* LTR */ } -.add-or-remove-shortcuts .text { - padding: 0 6px 0 10px; /* LTR */ + +/** + * Toolbar icon. + */ +.toolbar-main .shortcuts .tab { + background-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lPSJzdG9wLWNvbG9yOiNGRkZGRkYiLz4NCgk8c3RvcCAgb2Zmc2V0PSIxIiBzdHlsZT0ic3RvcC1jb2xvcjojRTVFNUU1Ii8+DQo8L2xpbmVhckdyYWRpZW50Pg0KPHBvbHlnb24gZmlsbD0idXJsKCNTVkdJRF8xXykiIHBvaW50cz0iMTMuNjM2LDAgMTMuNjM2LDEwMCA0OS42MzYsNzYuNzI3IDg2LjM2MywxMDAgODYuMzYzLDAgIi8+DQo8L3N2Zz4NCg==); +} +.toolbar-main #edit-shortcuts { + display: block; +} +.toolbar-main .vertical #edit-shortcuts { + text-align: right; + padding: 1em; } -.add-or-remove-shortcuts a:focus .text, -.add-or-remove-shortcuts a:hover .text { - background-color: #5f605b; - border-radius: 0 5px 5px 0; /* LTR */ - color: #fff; - cursor: pointer; - font-size: 10px; - line-height: 12px; +.toolbar-main .horizontal #edit-shortcuts { + border-left: 1px solid #d9d9d9; + float: left; + margin-left: 0.3333em; + padding: 1em 0.3333em 1em 0.6667em; } diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 98b0427..98d8010 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -1390,6 +1390,15 @@ function system_library_info() { ), ); + $libraries['matchMedia'] = array( + 'title' => 'window.matchMedia polyfill', + 'website' => 'http://drupal.org/node/1815602', + 'version' => '1.0', + 'js' => array( + 'core/misc/matchMedia.js' => array(), + ), + ); + // Farbtastic. $libraries['jquery.farbtastic'] = array( 'title' => 'Farbtastic', @@ -1893,7 +1902,6 @@ function system_library_info() { array('system', 'jquery'), ), ); - $libraries['drupal.tableselect'] = array( 'title' => 'Tableselect', 'version' => VERSION, diff --git a/core/modules/toolbar/config/toolbar.breakpoints.yml b/core/modules/toolbar/config/toolbar.breakpoints.yml new file mode 100755 index 0000000..0cae5cc --- /dev/null +++ b/core/modules/toolbar/config/toolbar.breakpoints.yml @@ -0,0 +1 @@ +wide: 'all and (min-width: 60em)' diff --git a/core/modules/toolbar/config/toolbar.config.yml b/core/modules/toolbar/config/toolbar.config.yml new file mode 100755 index 0000000..79522f0 --- /dev/null +++ b/core/modules/toolbar/config/toolbar.config.yml @@ -0,0 +1,2 @@ +breakpoints: + - 'module.toolbar.wide' diff --git a/core/modules/toolbar/css/toolbar.base-rtl.css b/core/modules/toolbar/css/toolbar.base-rtl.css new file mode 100644 index 0000000..00e0669 --- /dev/null +++ b/core/modules/toolbar/css/toolbar.base-rtl.css @@ -0,0 +1,25 @@ +.toolbar-main, +.toolbar-main * { + text-align: right; +} +.toolbar-main ul li { + float: right; +} +.toolbar-main ul li a { + display: inline-block; + float: none; + zoom: 1; +} +.toolbar-main-user { + float: left; +} +.toolbar-main .toolbar-main-user li { + float: none; + display: inline; +} +.toolbar-main-menu { + float: none; +} +.toolbar-main-home { + float: right; +} diff --git a/core/modules/toolbar/css/toolbar.base.css b/core/modules/toolbar/css/toolbar.base.css new file mode 100644 index 0000000..9dbf8d1 --- /dev/null +++ b/core/modules/toolbar/css/toolbar.base.css @@ -0,0 +1,230 @@ +/** + * @file toolbar.admin.css + * + * + * Aggressive resets so we can achieve a consistent look in hostile CSS + * environments. + */ +body.toolbar-tray-open { + -moz-box-sizing: border-box; + -o-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; +} +.toolbar-main, +.toolbar-main * { + -moz-box-sizing: border-box; + -o-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; + margin: 0; + outline: 0; + padding: 0; + vertical-align: baseline; +} +.toolbar-main { + font-size: 100%; + line-height: 1; +} +.toolbar-main ul, +.toolbar-main ul li, +.toolbar-main .menu li { + list-style: none; +} +.toolbar-main .menu li { + padding-top: 0; +} +/** + * Administration menu. + */ +.toolbar-main .bar { + left: 0; + position: absolute; + right: 0; + top: 0; + z-index: 600; +} +.toolbar-main .bar li { + display: block; +} +.toolbar-main .bar a { + display: block; +} +@media screen and (min-width: 16.5em) { + .toolbar-main .bar li { + float: left; /* LTR */ + } +} +@media screen and (min-width: 28.125em) { + .toolbar-main .bar { + position: fixed; + } +} +/** + * Toolbar tray. + */ +.toolbar-main .tray { + display: none; + overflow-x: hidden; + overflow-y: auto; +} +.toolbar-main .tray.vertical { + bottom: 0; + height: 100%; + left: -100%; + position: absolute; + width: 100%; + z-index: 600; +} +.toolbar-main .tray.horizontal { + left: 0; /* LTR */ + height: 0; + position: absolute; + width: 100%; + z-index: 600; +} +.toolar-main .tray .lining { + position: relative; +} +.toolbar-main .tray.vertical > .slider { + left: -100%; /* LTR */ + position: absolute; + width: 100%; +} +.toolbar-main .tray.active { + display: block; +} +.toolbar-main .horizontal.active { + height: auto; +} +.toolbar-main .tray.vertical.active, +.toolbar-main .tray.vertical.active > .slider { + left: 0; /* LTR */ +} +@media screen and (min-width: 16.5em) { + .toolbar-main .tray.vertical { + bottom: 0; + position: absolute; + width: 240px; + width: 15rem; + } +} +@media screen and (min-width: 28.125em) { + .toolbar-main .tray.horizontal, + .toolbar-main .tray.vertical { + position: fixed; + } +} +/** + * At larger screen sizes, the tray pushes the page content + * using padding instead of left. + */ +@media screen and (min-width: 28.125em) { + body.toolbar-tray-open.toolbar-vertical { + overflow: auto; + } + body.toolbar-tray-open.toolbar-vertical { + padding-left: 240px; + padding-left: 15rem; + } +} +/** + * Toolbar menus. + */ +.toolbar-main .menu { + list-style: none; + margin: 0; + padding: 0; +} +.toolbar-main .interactive-menu { + height: 100%; +} +.toolbar-main .interactive-menu-offset { + height: 100%; + position: relative; +} +.toolbar-main .box { + display: block; + line-height: 1em; /* this prevents the value "normal" from being returned as the line-height */ + position: relative; + width: auto; +} +.toolbar-main .dormant { + display: none; +} +.toolbar-main .trail > ul { /* Show the sub-menus */ + display: block; +} +.toolbar-main .active > ul { + z-index: 51; /* Pull the active trail li's above the other li's */ +} +.toolbar-main .tray .interactive-menu li { + display: block; +} +.toolbar-main .interactive-menu a { + display: block; + line-height: 1; + overflow: hidden; +} +.toolbar-main .tray .interactive-menu li a, +.toolbar-main .toolbar-list a { + display: block; +} +.toolbar-main .handle { + float: right; +} +.toolbar-main .handle:hover { + cursor: pointer; +} +.toolbar-main .horizontal .toolbar-list li { + float: left; +} +.toolbar-main .horizontal .toolbar-list li + li { + margin-left: 0.5em; /* LTR */ +} +.toolbar-main .horizontal .interactive-menu .handle, +.toolbar-main .horizontal .interactive-menu .level-2 { + display: none; +} +/** + * ToolBar icons. + */ +.toolbar-main .bar .tab, +.toolbar-main .bar .active .tab, +.toolbar-main .bar .tab:active, +.toolbar-main .level-1 > li > .box > a { + background-attachment: scroll; + background-color: transparent; + background-image: none; + background-position: -999em -999em; + background-repeat: no-repeat; +} +/** + * ToolBar tray orientation toggle. + */ +.toolbar-main .toggle-orientation { + display: none; +} +.toolbar-main .horizontal .toggle-orientation { + bottom: 0; + position: absolute; + right: 0; + top: 0; +} +.toolbar-main .vertical .toggle-orientation { + float: right; + width: 100%; +} +@media screen and (min-width: 16.5em) { + .toolbar-main .toggle-orientation { + display: block; + } + .toolbar-main .administration .toggle-orientation { + display: none; + } +} +@media screen and (min-width: 28.125em) { + .toolbar-main .administration .toggle-orientation { + display: block; + } +} diff --git a/core/modules/toolbar/css/toolbar.icons-rtl.css b/core/modules/toolbar/css/toolbar.icons-rtl.css new file mode 100644 index 0000000..e69de29 diff --git a/core/modules/toolbar/css/toolbar.icons.css b/core/modules/toolbar/css/toolbar.icons.css new file mode 100644 index 0000000..8ca753f --- /dev/null +++ b/core/modules/toolbar/css/toolbar.icons.css @@ -0,0 +1,79 @@ +/** + * @file toolbar.icons.css + */ + +@media screen and (min-width: 16.5em) { + .toolbar-main .bar .tab, + .toolbar-main .bar .active .tab, + .toolbar-main .bar .tab:active, + .toolbar-main .level-1 > li > .box > a { + background-size: 1.75em 1.75em; + } + .toolbar-main .bar .tab, + .toolbar-main .bar .active .tab, + .toolbar-main .bar .tab:active { + background-position: center center; + text-indent: -9999px; /* LTR */ + width: 3em; + } + .toolbar-main .level-1 > li > .box > a { + background-position: 0.4545em center; + padding-left: 2.5em; + } + .toolbar-main .level-2 { + margin-left: 2.1667em; + } + /* ToolBar bar icons. */ + .toolbar-main .bar .home .tab{ + background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNi4wLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB3aWR0aD0iMTAwcHgiIGhlaWdodD0iMTAwcHgiIHZpZXdCb3g9IjAgMCAxMDAgMTAwIiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCAxMDAgMTAwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxsaW5lYXJHcmFkaWVudCBpZD0iU1ZHSURfMV8iIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iNDkuOTk5NSIgeTE9IjYiIHgyPSI0OS45OTk1IiB5Mj0iOTIuNjIyMyI+DQoJPHN0b3AgIG9mZnNldD0iMCIgc3R5bGU9InN0b3AtY29sb3I6I0NDQ0NDQyIvPg0KCTxzdG9wICBvZmZzZXQ9IjEiIHN0eWxlPSJzdG9wLWNvbG9yOiM5OTk5OTkiLz4NCjwvbGluZWFyR3JhZGllbnQ+DQo8cG9seWdvbiBmaWxsPSJ1cmwoI1NWR0lEXzFfKSIgcG9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weCIgeT0iMHB4Ig0KCSB3aWR0aD0iMTAwcHgiIGhlaWdodD0iMTAwcHgiIHZpZXdCb3g9IjAgMCAxMDAgMTAwIiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCAxMDAgMTAwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxnPg0KCTxsaW5lYXJHcmFkaWVudCBpZD0iU1ZHSURfMV8iIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIiB4MT0iNDkuOTk5NSIgeTE9IjUiIHgyPSI0OS45OTk1IiB5Mj0iOTQuMDEyNiI+DQoJCTxzdG9wICBvZmZzZXQ9IjAiIHN0eWxlPSJzdG9wLWNvbG9yOiNDQ0NDQ0MiLz4NCgkJPHN0b3AgIG9mZnNldD0iMSIgc3R5bGU9InN0b3AtY29sb3I6Izk5OTk5OSIvPg0KCTwvbGluZWFyR3JhZGllbnQ+DQoJPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGZpbGw9InVybCgjU1ZHSURfMV8pIiBkPSJNMCw3Ni43Mjh2MTguMTgyaDEwMFY3Ni43MjhIMHogTTAsNHYxOC4xODJoMTAwVjRIMHoNCgkJIE0wLDQwLjM2M3YxOC4xODNoMTAwVjQwLjM2M0gweiIvPg0KPC9nPg0KPC9zdmc+DQo=); + } + .toolbar-main .bar .administration .tab:active, + .toolbar-main .bar .administration.active .tab { + background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNi4wLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dy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zLTAuNjA0LDQuMDA5LTEuODIzLDUuNzE2Yy0xLjIxOSwxLjcwOC0zLjcyOSwzLjkyLTcuNTM5LDYuNjQxDQoJYy0zLjk1NCwyLjkwNi02LjY3Niw1LjY0Mi04LjE2Niw4LjIxOWMtMS40OTEsMi41NzgtMi4yMzEsNS42MDctMi4yMzEsOS4wOTJ2NC4wMjlINTUuMjA5eiBNNDEuNTQ0LDg4LjI3MQ0KCWMxLjY2NywxLjYxMiw0LjAyOSwyLjQyMiw3LjA3OCwyLjQyMmMyLjk3MiwwLDUuMzAxLTAuODI0LDYuOTY4LTIuNDc4YzEuNjY1LTEuNjU1LDIuNTAzLTMuOTE0LDIuNTAzLTYuNzc2DQoJYzAtMi45NzYtMC44MjEtNS4yNTgtMi40NzYtNi44NjFjLTEuNjU0LTEuNTk4LTMuOTgtMi4zOTUtNi45OTUtMi4zOTVjLTMuMTIzLDAtNS40OTcsMC43ODItNy4xMywyLjM0Mg0KCWMtMS42MzUsMS41NTktMi40NDksMy44NjMtMi40NDksNi45MTRDMzkuMDQyLDg0LjM3OSwzOS44NzgsODYuNjU2LDQxLjU0NCw4OC4yNzF6Ii8+DQo8L3N2Zz4NCg==); + } +} + +@media screen and (min-width: 28.125em) { + .toolbar-main .bar .tab, + .toolbar-main .bar .active .tab, + .toolbar-main .bar .tab:active { + background-position: 0.5em center; + padding-left: 2.5em; /* LTR */ + text-indent: 0; + width: auto; + } +} diff --git a/core/modules/toolbar/css/toolbar.theme-rtl.css b/core/modules/toolbar/css/toolbar.theme-rtl.css new file mode 100644 index 0000000..e8cb8cf --- /dev/null +++ b/core/modules/toolbar/css/toolbar.theme-rtl.css @@ -0,0 +1,7 @@ +.toolbar-main .bar .menu li + li { + margin-left: auto; + margin-right: 1em; +} +.toolbar-main .shortcuts .menu li { + float: right; +} diff --git a/core/modules/toolbar/css/toolbar.theme.css b/core/modules/toolbar/css/toolbar.theme.css new file mode 100644 index 0000000..3259bca --- /dev/null +++ b/core/modules/toolbar/css/toolbar.theme.css @@ -0,0 +1,255 @@ +/** + * @file toolbar.theme.css + */ +.toolbar-main { + font-family: "Source Sans Pro", "Lucida Grande", Verdana, sans-serif; + /* Set base font size to 13px based on root ems. */ + font-size: 0.8125rem; + -moz-tap-highlight-color: rgba(0,0,0,0); + -o-tap-highlight-color: rgba(0,0,0,0); + -webkit-tap-highlight-color: rgba(0,0,0,0); + tap-highlight-color: rgba(0,0,0,0); + -moz-touch-callout: none; + -o-touch-callout: none; + -webkit-touch-callout: none; + touch-callout: none; +} +.toolbar-main a { + text-decoration: none; +} +.toolbar-main a:hover { + text-decoration: underline; +} +/** + * Toolbar bar. + */ +.toolbar-main .bar { + background-color: #0f0f0f; + box-shadow: 0 0 3px 1px rgba(0, 0, 0, 0.3333); + color: #dddddd; +} +.toolbar-main .bar li:hover { + background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.125) 20%, transparent 200%); + background-image: linear-gradient(rgba(255, 255, 255, 0.125) 20%, transparent 200%); +} +.toolbar-main .bar li.active { + background-image: -webkit-linear-gradient(rgba(255, 255, 255, 0.25) 20%, transparent 200%); + background-image: linear-gradient(rgba(255, 255, 255, 0.25) 20%, transparent 200%); +} +.toolbar-main .bar a { + color: #ffffff; + cursor: pointer; + padding: 1em 0.3333em; +} +@media screen and (min-width: 16.5em) { + .toolbar-main .bar a { + padding-left: 1.3333em; + padding-right: 1.3333em; + } +} +/** + * Toolbar tray. + */ +.toolbar-main .tray { + background-color: #ffffff; + border-right: 1px solid #aaaaaa; + box-shadow: 0px 0px 3px 1px rgba(0, 0, 0, 0.3333); +} +.toolbar-main .horizontal .tray { + background-color: #f5f5f5; +} +.toolbar-main .tray a { + color: #333333; +} +.toolbar-main .horizontal .toolbar-list { + background-color: #ffffff; +} +.toolbar-main .toolbar-list a { + padding: 1em 0.3333em; +} +.toolbar-main .vertical .toolbar-list { + border-bottom: 1px solid #dddddd; +} +.toolbar-main .vertical .toolbar-list a { + margin-right: 3.5em; +} +.toolbar-main .vertical .level-1 > li + li, +.toolbar-main .vertical .toolbar-list > li + li, +.toolbar-main .vertical .toolbar-list > .menu > li + li { + border-top: 1px solid #dddddd; +} +.toolbar-main .vertical .level-1 a { + font-weight: bold; +} +.toolbar-main .level-2 ul { + margin-left: 0.25em; +} +.toolbar-main .vertical .level-2 ul { + border-bottom-style: solid; + border-top-style: solid; + border-bottom-width: 1px; + border-top-width: 1px; +} +.toolbar-main .vertical .level-2 li:last-child > ul { + border-bottom: 0; +} +.toolbar-main .level-2 a { + color: #333333; + padding-bottom: 0.6667em; + padding-top: 0.6667em; +} +.toolbar-main .vertical .level-2 a { + font-weight: normal; +} +.toolbar-main .level-3 { + border-color: #cccccc; +} +.toolbar-main .level-3 li { + padding-left: 0.1667em; +} +.toolbar-main .level-3 > li { + background-color: #f5f5f5; +} +.toolbar-main .level-3 a { + color: #303030; +} +.toolbar-main .level-4 { + border-color: #bbbbbb; +} +.toolbar-main .level-4 > li { + background-color: #e5e5e5; +} +.toolbar-main .level-4 a { + color: #2d2d2d; +} +.toolbar-main .level-5 { + border-color: #aaaaaa; +} +.toolbar-main .level-5 > li { + background-color: #d5d5d5; +} +.toolbar-main .level-5 a { + color: #2a2a2a; +} +.toolbar-main .level-6 { + background-color: #c5c5c5; +} +.toolbar-main .level-6 > li{ + border-color: #888888; +} +.toolbar-main .level-6 a { + color: #272727; +} +.toolbar-main .level-7 { + background-color: #d5d5d5; +} +.toolbar-main .level-7 > li { + border-color: #777777; +} +.toolbar-main .level-7 a { + color: #242424; +} +.toolbar-main .level-8 { + background-color: #e5e5e5; +} +.toolbar-main .level-8 > li { + border-color: #666666; +} +.toolbar-main .level-8 a { + color: #212121; +} +.toolbar-main .level-9 { + background-color: #f5f5f5; +} +.toolbar-main .level-9 > li { + border-color: #555555; +} +.toolbar-main .level-9 a { + color: #1e1e1e; +} +/** + * ToolBar tray - horizontal. + */ +.toolbar-main .horizontal .level-1 > li.open > .box { + border-bottom-color: white; + border-bottom-width: 1px; + border-bottom-style: solid; + position: relative; + margin-top: -1px; + top: 1px; +} +.toolbar-main .horizontal .level-2 ul { + border-left: 1px solid #bcbcbc; +} +.toolbar-main .horizontal .level-2 a { + padding: 0.6667em 1em; +} + +/** + * Interactive menu. + */ + +.toolbar-main .handle { + background-attachment: scroll; + background-color: transparent; + background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNi4wLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB3aWR0aD0iMTAwcHgiIGhlaWdodD0iMTAwcHgiIHZpZXdCb3g9IjI1NiAzNDYgMTAwIDEwMCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAyNTYgMzQ2IDEwMCAxMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPGc+DQoJPHBhdGggZmlsbD0iIzk5OTk5OSIgZD0iTTI1NiwzOTZjMCwyNy41OTgsMjIuNCw1MCw1MCw1MGMyNy41OTgsMCw1MC0yMi40MDIsNTAtNTBjMC0yNy42LTIyLjQwMi01MC01MC01MA0KCQlDMjc4LjQsMzQ2LDI1NiwzNjguNCwyNTYsMzk2eiBNMjYxLDM5NmMwLTI0Ljg1MiwyMC4xNDktNDUsNDUtNDVjMjQuODU0LDAsNDUsMjAuMTQ4LDQ1LDQ1YzAsMjQuODU0LTIwLjE0Niw0NS00NSw0NQ0KCQlDMjgxLjE0OSw0NDEsMjYxLDQyMC44NTQsMjYxLDM5NnoiLz4NCgk8cG9seWdvbiBmaWxsPSIjNTE4MUMyIiBwb2ludHM9IjMwNiw0MTEgMjgxLDM4NiAzMzEsMzg2IAkiLz4NCjwvZz4NCjwvc3ZnPg0K); + background-origin: content-box; + background-position: center center; + background-repeat: no-repeat; + background-size: 100% 100%; + border: 0; + bottom: 0; + display: block; + font-size: 1em; + height: 100%; + padding: 0.6667em 0em; + position: absolute; + right: 0; + text-indent: -999em; + top: 0; + width: 3.5em; + z-index: 1; +} +.toolbar-main .level-2 .handle { + padding-bottom: 0.4545em; + padding-top: 0.4545em; +} +.toolbar-main .handle.open { + background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNi4wLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB3aWR0aD0iMTAwcHgiIGhlaWdodD0iMTAwcHgiIHZpZXdCb3g9IjI1NiAzNDYgMTAwIDEwMCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAyNTYgMzQ2IDEwMCAxMDAiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPHBhdGggZmlsbD0iIzk5OTk5OSIgZD0iTTM1NiwzOTZjMC0yNy42LTIyLjQwMi01MC01MC01MGMtMjcuNiwwLTUwLDIyLjQtNTAsNTBjMCwyNy41OTgsMjIuNCw1MCw1MCw1MA0KCUMzMzMuNTk4LDQ0NiwzNTYsNDIzLjU5OCwzNTYsMzk2eiBNMzUxLDM5NmMwLDI0Ljg0OS0yMC4xNTEsNDUtNDUsNDVjLTI0Ljg1NiwwLTQ1LTIwLjE1MS00NS00NWMwLTI0Ljg1NSwyMC4xNDQtNDUsNDUtNDUNCglDMzMwLjg0OSwzNTEsMzUxLDM3MS4xNDUsMzUxLDM5NnoiLz4NCjxwb2x5Z29uIGZpbGw9IiM3Nzc3NzciIHBvaW50cz0iMzA2LDM4MSAzMzEsNDA2IDI4MSw0MDYgIi8+DQo8L3N2Zz4NCg==); +} + +/* Orientation toggle */ + +.toolbar-main .toggle-orientation { + background-color: #f5f5f5; + padding: 1em; +} +.toolbar-main .horizontal .toggle-orientation { + border-left: 1px solid #c9c9c9; /* LTR */ +} +.toolbar-main .toggle-orientation > .lining { + background-color: #ffffff; + border: 1px solid #c9c9c9; + float: right; /* LTR */ + padding: 0.1667em; +} +.toolbar-main .toggle-orientation button { + background-color: transparent; + border: 1px solid #b0b0b0; + cursor: pointer; + display: inline-block; + float: left; + height: 0.9em; + text-indent: -999em; + width: 1.4562em; +} +.toolbar-main .toggle-orientation [value="vertical"] { + border-left-width: 7px; + margin-left: 0.5em; +} +.toolbar-main .toggle-orientation [value="horizontal"] { + border-top-width: 4px; +} +.toolbar-main .toggle-orientation .active { + border-color: #3F9AD3; +} diff --git a/core/modules/toolbar/js/toolbar.js b/core/modules/toolbar/js/toolbar.js new file mode 100755 index 0000000..c7bde50 --- /dev/null +++ b/core/modules/toolbar/js/toolbar.js @@ -0,0 +1,531 @@ +/** + * @file toolbar.js + * + * Defines the behavior of the Drupal administration toolbar. + */ +(function ($, _) { + +"use strict"; + +Drupal.toolbar = Drupal.toolbar || {}; +var transitionEnd = "transitionEnd.toolbar webkitTransitionEnd.toolbar transitionend.toolbar msTransitionEnd.toolbar oTransitionEnd.toolbar"; + +/** + * Attach toggling behavior and notify the overlay of the toolbar. + */ +Drupal.behaviors.toolbar = { + attach: function(context, settings) { + var options = _.extend(this.options, ('toolbar' in settings) ? settings.toolbar : {}); + var $toolbar = $(context).find('#toolbar').once('toolbar'); + if ($toolbar.length) { + $toolbar + .addClass('toolbar-main') + .on('trayregistered', decorateInteractiveMenu); + var toolbar = new ToolBar($toolbar, options); + var tray, $tray, $trays, tab, $tab, $tabs, name, i; + // Register trays. + Drupal.toolbar.trays = []; + $trays = $toolbar.find('.tray'); + for (i = 0; i < $trays.length; i++) { + $tray = $($trays[i]); + tray = new Tray($tray); + Drupal.toolbar.trays.push(tray); + $tray.data('toolbar', { + 'tray': tray + }); + toolbar.registerTray(tray); + } + // Associate the bar tabs with the trays. + Drupal.toolbar.tabs = []; + $tabs = $toolbar.find('.bar .tab'); + for (i = 0; i < $tabs.length; i++) { + $tab = $($tabs[i]); + tab = new Tab($tab); + Drupal.toolbar.tabs.push(tab); + name = tab.$el.data().toolbarTray || ''; + if (name.length) { + tray = toolbar.getTray(name); + $tab.data('toolbar', { + 'tab': tab + }); + tab.registerTray(tray); + toolbar.registerTab(tab); + } + } + // Set up switching between the vertical and horizontal presentation + // of the toolbar trays based on a breakpoint. + if (options.breakpoints && options.breakpoints['module.toolbar.wide'] !== undefined) { + var mql = matchMedia(options.breakpoints['module.toolbar.wide']); + mql.addListener(toolbar.mediaQueryChangeHandler); + toolbar.mediaQueries.push(mql); + if (mql.matches) { + toolbar.mediaQueryChangeHandler(mql); + } + } + } + }, + options: { + breakpoints: null + } +}; +/** + * A toolbar is an administration action button container. + */ +function ToolBar ($toolbar, options) { + this.$toolbar = $toolbar; + this.$bar = $toolbar.find('.bar'); + this.height = 0; + this.barHeight = 0; + this.trays = []; + this.tabs = []; + this.activeTab = null; + this.mediaQueries = []; + this.ui = { + 'activeClass': 'active', + 'trayOpenBodyClass': 'toolbar-tray-open', + }; + // Bind all ToolBar methods to the instance. + _.bindAll(this); + // Recalculate the offset top on screen resize. + // Use throttle to prevent setHeight from being called too frequently. + var setHeight = _.debounce(this.setHeight, 250); + $(window) + .on({ + 'resize.toolbar': setHeight + }); + // Toolbar event handlers. + this.$toolbar + .on('setup.toolbar', this.setHeight) + .on('click.toolbar', '.bar .tab', this.toggleTray) + .on('click.toolbar', '.tray .toggle-orientation button', this.orientationChangeHandler) + .on(transitionEnd, '.tray.active', this.setHeight) + .trigger('setup.toolbar'); +}; +/** + * Extend the prototype of the ToolBar class. + */ +$.extend(ToolBar.prototype, { + /** + * The height of the toolbar offsets the top of the page content. + * + * Page components can register with the offsettopchange event to know when + * the height of the toolbar changes. + */ + setHeight: function (event) { + var height = 0; + var tray, $tray, $trays, trayH; + this.barHeight = this.$bar.outerHeight(); + var bhpx = this.barHeight + 'px'; + height += this.barHeight; + // Set the top of the all the trays to the height of the bar. + $trays = this.$toolbar.find('.tray'); + for (var i = $trays.length - 1; i >= 0; i--) { + tray = $trays[i]; + if (!tray.style.top.length || (tray.style.top !== bhpx)) { + tray.style.top = bhpx; + } + }; + // Get the height of the active horizontal tray and include it in the total + // height of the toolbar. + $tray = $trays.filter('.active.horizontal'); + if ($tray.length > 0) { + var trayH = $tray.outerHeight(); + height += trayH; + } + // Indicate the height of the toolbar in the attribute data-offset-top. + if (this.height !== height) { + this.height = height; + this.$toolbar.attr('data-offset-top', height); + // Alter the padding on the top of the body element. + $('body').css('padding-top', height); + $(document).trigger('offsettopchange', height); + } + }, + /** + * + */ + registerTray: function (tray) { + this.trays.push(tray); + this.$toolbar.trigger('trayregistered', tray); + }, + /** + * + */ + toggleTray: function (event) { + var $tab = $(event.target); + var tab = $tab.data('toolbar').tab; + if (tab.tray) { + event.preventDefault(); + var disableTabs = _.without(this.tabs, tab); + for (var i = disableTabs.length - 1; i >= 0; i--) { + if (disableTabs[i]) { + disableTabs[i].toggle(false); + } + }; + tab.toggle(); + this.activeTab = (tab.active) ? tab : null; + this.setBodyState(); + this.setHeight(); + this.$toolbar.trigger('traytoggled', tab.tray); + } + }, + /** + * + */ + getTray: function (name) { + for (var i = 0; i < this.trays.length; i++) { + if (this.trays[i].name === name) { + return this.trays[i]; + } + } + return; + }, + /** + * + */ + registerTab: function (tab) { + this.tabs.push(tab); + this.$toolbar.trigger('tabregistered', tab); + }, + /** + * + */ + orientationChangeHandler: function (event) { + var $button = $(event.target); + var orientation = event.target.value; + var tray = $button.closest('.tray').data('toolbar').tray; + this.changeOrientation(tray, orientation, true); + this.setBodyState(); + this.setHeight(); + this.$toolbar.trigger('toolbarorientationchanged', orientation); + }, + /** + * + */ + mediaQueryChangeHandler: function (mql) { + var orientation = (mql.matches) ? 'horizontal' : 'vertical'; + this.changeOrientation(this.trays, orientation); + this.setBodyState(); + this.setHeight(); + this.$toolbar.trigger('toolbarorientationchanged', orientation); + }, + /** + * + */ + changeOrientation: function (trays, orientation, isOverride) { + trays = (!_.isArray(trays)) ? [trays] : trays; + for (var i = trays.length - 1; i >= 0; i--) { + trays[i].changeOrientation(orientation, isOverride); + }; + }, + /** + * + */ + setBodyState: function () { + var $body = $('body') + .removeClass('toolbar-vertical toolbar-horizontal'); + if (this.activeTab) { + $body + .addClass('toolbar-tray-open') + .addClass('toolbar-' + this.activeTab.tray.getOrientation()); + } + else { + $body + .removeClass('toolbar-tray-open'); + } + } +}); + +/** + * Toolbar tray. + */ +function Tray ($tray) { + this.$el = $tray; + this.name = this.$el.data()['toolbarTray'] || this.$el.attr('id') ||'no name'; + this.active = false; + this.orientation = 'vertical'; + this.isOrientationLocked = false; + this.setup.apply(this, arguments); +} + +/** + * Extend the prototype of the Tray. + */ +_.extend(Tray.prototype, { + /** + * + */ + setup: function () { + this.$el + .addClass(this.orientation) + .find('.lining') + .append(Drupal.theme('toolbarOrientationToggle')); + this.toggleOrientationToggle(); + }, + /** + * + */ + toggle: function (open) { + this.$el.toggleClass('active', open); + }, + /** + * + */ + changeOrientation: function (orientation, isOverride) { + if (isOverride && orientation === 'vertical') { + this.isOrientationLocked = true; + } + if (isOverride && orientation === 'horizontal') { + this.isOrientationLocked = false; + } + if (!this.isOrientationLocked && orientation === 'horizontal' && this.orientation === 'vertical') { + var self = this; + this.orientation = orientation; + this.$el + .removeClass('vertical') + .addClass('horizontal'); + this.toggleOrientationToggle(); + } + if (orientation === 'vertical' && this.orientation === 'horizontal') { + this.orientation = orientation; + this.$el + .removeClass('horizontal') + .addClass('vertical'); + this.toggleOrientationToggle(); + } + }, + /** + * + */ + getOrientation: function () { + return (this.isOrientationLocked) ? 'vertical' : this.orientation; + }, + /** + * Change the orientation toggle active state. + */ + toggleOrientationToggle: function () { + this.$el + .find('[value="' + this.orientation + '"]') + .removeClass('active') + .siblings() + .addClass('active'); + } +}); + +function Tab ($tab) { + this.$el = $tab; + this.active = false; + this.name = this.$el.data()['toolbarTray'] || this.$el.attr('id') ||'no name'; + this.tray; +} + +/** + * Extend the prototype of the Tray. + */ +_.extend(Tab.prototype, { + /** + * + */ + toggle: function (open) { + this.active = (open !== undefined) ? open : !this.active; + this.$el.parent('li').toggleClass('active', this.active); + if (this.tray) { + this.tray.toggle(this.active); + } + }, + /** + * + */ + registerTray: function (tray) { + this.tray = tray; + }, +}); + +/** + * A toggle is an interactive element often bound to a click handler. + * + * @return {String} + * A string representing a DOM fragment. + */ +Drupal.theme.toolbarOrientationToggle = function () { + return '
'; +}; +/** + * A toggle is an interactive element often bound to a click handler. + * + * @return {String} + * A string representing a DOM fragment. + */ +Drupal.theme.interactionMenuItemToggle = function (options) { + return ''; +}; + + +/** + * Interactive menu setup methods. + */ +function decorateInteractiveMenu (event, tray) { + if (tray.name === 'administration') { + tray.decorate = interactiveMenuDecorator(); + tray.decorate('.interactive-menu > .menu'); + } +} + +/** + * Decorate a menu with markup and classes for attaching behaviors. + */ +var interactiveMenuDecorator = function () { + + var ui = { + 'handleOpen': Drupal.t('Open'), + 'handleClose': Drupal.t('Close') + }; + + var processLists = function (event) { + event.stopPropagation(); + // Mark up the lists and items. + $(event.target) + .trigger('listChange'); + }; + var toggleList = function (event) { + // The toggle. + var $toggle = $(event.target); + var $item = $toggle.closest('li'); + var $list = $item.children('ul'); + var isHidden = $list.hasClass('dormant'); + // Close open siblings. + $item.siblings().filter('.open').find('.handle').trigger('click'); + // Toggle the item open state. + $item + [((isHidden) ? 'add' : 'remove') + 'Class']('open'); + // Toggle the item list visibility. + $list + [((isHidden) ? 'remove' : 'add') + 'Class']('dormant'); + // Twist the toggle. + $toggle + [((isHidden) ? 'add' : 'remove') + 'Class']('open'); + // Adjust the toggle text. + $toggle + .text((isHidden) ? ui.handleClose : ui.handleOpen) + .attr('aria-pressed', isHidden); + // Fire an event to signify that a list has been toggled. + $item.trigger('itemtoggled', [$item.parent().data('toolbar').level, !isHidden]); + }; + var initItems = function (event) { + // The accordion wrapper. + var $wrapper = $(event.target); + var rootClass = 'root'; + var boxClass = 'box'; + var handleClass = 'handle'; + // Get lists and items. + var $root = $wrapper.children('.' + rootClass); + var $ul = $wrapper.find('ul'); + var $li = $wrapper.find('li'); + // Basic setup + $ul + .each(function (index, element) { + $(this).data('toolbar', { + processed: false, + type: 'list', + level: NaN + }); + }); + // Initialize items and their links. + $li + .each(function (index, element) { + $(this).data('toolbar', { + processed: false, + type: 'item' + }); + }) + // Add a class to item links. + .children('a') + .wrap( + $('
', { + 'class': boxClass + }) + ) + .end() + // Add a handle to each list item if it has a menu. + .each(function (index, element) { + var $item = $(this); + if ($item.children('ul').length > 0) { + $item + .children('.' + boxClass) + .prepend(Drupal.theme('interactionMenuItemToggle', { + 'class': handleClass, + 'text': ui.handleOpen + }) + ); + } + }); + }; + /** + * Adds a level class to each list based on its depth in the menu. + */ + var markListLevels = function ($lists, level) { + level = (typeof level === 'object') ? 1 : level; + $lists + .addClass('level-' + level) + .each(function (index, element) { + $(this).data().toolbar.level = level; + }); + $lists = $lists.children('li').children('ul'); + if ($lists.length > 0) { + markListLevels($lists, (level + 1)); + } + }; + var setLevelVisibility = function ($lists, visibleAfter) { + var level; + $lists + .each(function (index, element) { + var $this = $(this); + level = $(this).data().toolbar.level; + if (level > visibleAfter) { + $this.addClass('dormant'); + } + else { + $this.addClass('visible'); + } + }); + $lists = $lists.children('li').children('ul'); + if ($lists.length > 0) { + setLevelVisibility($lists, visibleAfter); + } + }; + return function (selector) { + var context = this; + // Find any menus that have already been decorated. + var $wrapper = this.$el.find(selector); + // Decorate any menus that have not been. + $wrapper + .once('decorate-menu') + .addClass('clearfix') + .each(function (index, element) { + var $root = $(this).addClass('root'); + // Create a set of list-manipulation callbacks. + // Called when items are added or removed. + var listUpdate = $.Callbacks(); + listUpdate.add(_.bind(initItems, context)); + listUpdate.add(_.bind(markListLevels, context, $root)); + listUpdate.add(_.bind(setLevelVisibility, context, $root, 1)); + // Wrap the list in a div to provide a positioning context. + $wrapper = $().add($wrapper).add( + $root + .wrap('
') + .parent() + // Bind event handlers. + .on('setup.toolbar', _.bind(processLists, context)) + .on('listChange.toolbar', listUpdate.fire) + .on('click.toolbar', '.handle', _.bind(toggleList, context)) + /* @todo + .on('clean.toolbar.accordionMode', 'li', cleanItem) + .on('activate.toolbar.accordionMode', 'li', activateItem) + */ + .trigger('setup') + ); + }); + return $wrapper; + }; +}; +}(jQuery, _)); diff --git a/core/modules/toolbar/templates/toolbar.tpl.php b/core/modules/toolbar/templates/toolbar.tpl.php index b3d561c..572f4ff 100644 --- a/core/modules/toolbar/templates/toolbar.tpl.php +++ b/core/modules/toolbar/templates/toolbar.tpl.php @@ -19,15 +19,10 @@ * @ingroup themeable */ ?> - + + +
diff --git a/core/modules/toolbar/toolbar-rtl.css b/core/modules/toolbar/toolbar-rtl.css deleted file mode 100644 index e121547..0000000 --- a/core/modules/toolbar/toolbar-rtl.css +++ /dev/null @@ -1,37 +0,0 @@ - -#toolbar, -#toolbar * { - text-align: right; -} -#toolbar ul li { - float: right; -} -#toolbar ul li a { - display: inline-block; - float: none; - zoom: 1; -} -#toolbar div.toolbar-menu { - padding: 5px 50px 5px 50px; -} -#toolbar-user { - float: left; -} -#toolbar ul#toolbar-user li { - float: none; - display: inline; -} -#toolbar-menu { - float: none; -} -#toolbar-home { - float: right; -} -#toolbar ul li.home a { - position: absolute; - right: 10px; -} -#toolbar div.toolbar-menu a.toggle { - left: 10px; - right: auto; -} diff --git a/core/modules/toolbar/toolbar.css b/core/modules/toolbar/toolbar.css deleted file mode 100644 index bd18110..0000000 --- a/core/modules/toolbar/toolbar.css +++ /dev/null @@ -1,129 +0,0 @@ - -body.toolbar { - padding-top: 2.2em; -} -body.toolbar-drawer { - padding-top: 5.3em; -} - -/** - * Aggressive resets so we can achieve a consistent look in hostile CSS - * environments. - */ -#toolbar, -#toolbar * { - border: 0; - font-size: 100%; - line-height: inherit; - list-style: none; - margin: 0; - outline: 0; - padding: 0; - text-align: left; /* LTR */ - vertical-align: baseline; -} - -/** - * Base styles. - * - * We use a keyword for the toolbar font size to make it display consistently - * across different themes, while still allowing browsers to resize the text. - */ -#toolbar { - background: #666; - color: #ccc; - font: normal small "Lucida Grande", Verdana, sans-serif; - left: 0; - margin: 0 -20px; - padding: 0 20px; - position: fixed; - right: 0; - top: 0; - box-shadow: 0 3px 20px #000; - z-index: 600; -} -#toolbar div.collapsed { - display: none; - visibility: hidden; -} -#toolbar a { - color: #fff; - font-size: .846em; - text-decoration: none; -} -#toolbar ul li, -#toolbar ul li a { - float: left; /* LTR */ -} - -/** - * Administration menu. - */ -#toolbar div.toolbar-menu { - background: #000; - line-height: 20px; - padding: 5px 50px 5px 10px; /* LTR */ - position: relative; -} -#toolbar-home a span { - background: url(toolbar.png) no-repeat 0 -45px; - display: block; - height: 14px; - margin: 3px 0px; - text-indent: -9999px; - vertical-align: text-bottom; - width: 11px; -} -#toolbar-user { - float: right; /* LTR */ -} -#toolbar-menu { - float: left; /* LTR */ -} -#toolbar div.toolbar-menu a.toggle { - background: url(toolbar.png) 0 -20px no-repeat; - bottom: 0; - cursor: pointer; - height: 25px; - overflow: hidden; - position: absolute; - right: 10px; /* LTR */ - text-indent: -9999px; - width: 25px; -} -#toolbar div.toolbar-menu a.toggle:focus, -#toolbar div.toolbar-menu a.toggle:hover { - background-position: -50px -20px; -} -#toolbar div.toolbar-menu a.toggle-active { - background-position: -25px -20px; -} -#toolbar div.toolbar-menu a.toggle-active.toggle:focus, -#toolbar div.toolbar-menu a.toggle-active.toggle:hover { - background-position: -75px -20px; -} -#toolbar div.toolbar-menu ul li a { - padding: 0 10px; - border-radius: 10px; -} -#toolbar div.toolbar-menu ul li a:focus, -#toolbar div.toolbar-menu ul li a:hover, -#toolbar div.toolbar-menu ul li a:active, -#toolbar div.toolbar-menu ul li a.active:focus { - background: #444; -} -#toolbar div.toolbar-menu ul li a.active:hover, -#toolbar div.toolbar-menu ul li a.active:active, -#toolbar div.toolbar-menu ul li a.active, -#toolbar div.toolbar-menu ul li.active-trail a { - background: url(toolbar.png) 0 0 repeat-x; - text-shadow: #333 0 1px 0; -} - -/** - * Collapsed drawer of additional toolbar content. - */ -#toolbar div.toolbar-drawer { - position: relative; - padding: 0 10px; -} diff --git a/core/modules/toolbar/toolbar.info b/core/modules/toolbar/toolbar.info old mode 100644 new mode 100755 index 758dc9c..1f3a375 --- a/core/modules/toolbar/toolbar.info +++ b/core/modules/toolbar/toolbar.info @@ -3,3 +3,8 @@ description = Provides a toolbar that shows the top-level administration menu it core = 8.x package = Core version = VERSION + +dependencies[] = config +dependencies[] = breakpoint + +configure = admin/structure/toolbar diff --git a/core/modules/toolbar/toolbar.js b/core/modules/toolbar/toolbar.js deleted file mode 100644 index 2353050..0000000 --- a/core/modules/toolbar/toolbar.js +++ /dev/null @@ -1,115 +0,0 @@ -(function ($) { - -"use strict"; - -Drupal.toolbar = Drupal.toolbar || {}; - -/** - * Attach toggling behavior and notify the overlay of the toolbar. - */ -Drupal.behaviors.toolbar = { - attach: function(context, settings) { - var $toolbar = $('#toolbar').once('toolbar'); - if ($toolbar.length) { - - // Set the initial state of the toolbar. - Drupal.toolbar.init(); - - $(window).on('resize.toolbar', Drupal.toolbar.height); - - // Toggling toolbar drawer. - $toolbar.find('a.toggle').once('toolbar-toggle').click(function(e) { - e.preventDefault(); - Drupal.toolbar.toggle(); - // Allow resize event handlers to recalculate sizes/positions. - $(window).triggerHandler('resize'); - }); - } - } -}; - -/** - * Retrieve last saved cookie settings and set up the initial toolbar state. - */ -Drupal.toolbar.init = function() { - // Retrieve the collapsed status from a stored cookie. - var collapsed = $.cookie('Drupal.toolbar.collapsed'); - - // Expand or collapse the toolbar based on the cookie value. - if (collapsed === '1') { - Drupal.toolbar.collapse(); - } - else { - Drupal.toolbar.expand(); - } -}; - -/** - * Collapse the toolbar. - */ -Drupal.toolbar.collapse = function() { - var toggle_text = Drupal.t('Show shortcuts'); - $('#toolbar div.toolbar-drawer').addClass('collapsed'); - $('#toolbar a.toggle') - .removeClass('toggle-active') - .attr('title', toggle_text) - .html(toggle_text); - $('body').removeClass('toolbar-drawer').css('paddingTop', Drupal.toolbar.height()); - $.cookie( - 'Drupal.toolbar.collapsed', - 1, - { - path: Drupal.settings.basePath, - // The cookie should "never" expire. - expires: 36500 - } - ); - Drupal.toolbar.height(); - $(document).trigger('offsettopchange'); -}; - -/** - * Expand the toolbar. - */ -Drupal.toolbar.expand = function() { - var toggle_text = Drupal.t('Hide shortcuts'); - $('#toolbar div.toolbar-drawer').removeClass('collapsed'); - $('#toolbar a.toggle') - .addClass('toggle-active') - .attr('title', toggle_text) - .html(toggle_text); - $('body').addClass('toolbar-drawer').css('paddingTop', Drupal.toolbar.height()); - $.cookie( - 'Drupal.toolbar.collapsed', - 0, - { - path: Drupal.settings.basePath, - // The cookie should "never" expire. - expires: 36500 - } - ); - Drupal.toolbar.height(); - $(document).trigger('offsettopchange'); -}; - -/** - * Toggle the toolbar. - */ -Drupal.toolbar.toggle = function() { - if ($('#toolbar div.toolbar-drawer').hasClass('collapsed')) { - Drupal.toolbar.expand(); - } - else { - Drupal.toolbar.collapse(); - } -}; - -Drupal.toolbar.height = function() { - // @TODO this needs to be cached outside this function. - var $toolbar = $('#toolbar'); - var height = $toolbar.outerHeight(); - $toolbar.attr('data-offset-top', height); - return height; -}; - -})(jQuery); diff --git a/core/modules/toolbar/toolbar.module b/core/modules/toolbar/toolbar.module old mode 100644 new mode 100755 index a54743a..4d1d004 --- a/core/modules/toolbar/toolbar.module +++ b/core/modules/toolbar/toolbar.module @@ -41,87 +41,21 @@ function toolbar_theme($existing, $type, $theme, $path) { 'render element' => 'toolbar', 'template' => 'toolbar', ); - $items['toolbar_toggle'] = array( - 'variables' => array( - 'collapsed' => NULL, - 'attributes' => array(), - ), + $items['toolbar_tray'] = array( + 'render element' => 'element', ); return $items; } /** - * Implements hook_menu(). - */ -function toolbar_menu() { - $items['toolbar/toggle'] = array( - 'title' => 'Toggle drawer visibility', - 'type' => MENU_CALLBACK, - 'page callback' => 'toolbar_toggle_page', - 'access arguments' => array('access toolbar'), - ); - return $items; -} - -/** - * Page callback: Toggles the visibility of the toolbar drawer. - * - * @see toolbar_menu(). - */ -function toolbar_toggle_page() { - global $base_path; - // Toggle the value in the cookie. - setcookie('Drupal.toolbar.collapsed', !_toolbar_is_collapsed(), NULL, $base_path); - // Redirect the user from where he used the toggle element. - drupal_goto(); -} - -/** - * Formats an element used to toggle the toolbar drawer's visibility. - * - * @param $variables - * An associative array containing: - * - collapsed: A boolean value representing the toolbar drawer's visibility. - * - attributes: An associative array of HTML attributes. - * - * @return - * An HTML string representing the element for toggling. - * - * @ingroup themable - */ -function theme_toolbar_toggle($variables) { - if ($variables['collapsed']) { - $toggle_text = t('Show shortcuts'); - } - else { - $toggle_text = t('Hide shortcuts'); - $variables['attributes']['class'][] = 'toggle-active'; - } - return l($toggle_text, 'toolbar/toggle', array('query' => drupal_get_destination(), 'attributes' => array('title' => $toggle_text) + $variables['attributes'])); -} - -/** - * Determines the current state of the toolbar drawer's visibility. - * - * @return - * TRUE when drawer is collapsed, FALSE when it is expanded. - */ -function _toolbar_is_collapsed() { - // PHP converts dots into underscores in cookie names to avoid problems with - // its parser, so we use a converted cookie name. - return isset($_COOKIE['Drupal_toolbar_collapsed']) ? $_COOKIE['Drupal_toolbar_collapsed'] : 0; -} - -/** * Implements hook_page_build(). * - * Add admin toolbar to the page_top region automatically. + * Add admin toolbar to the page_bottom region automatically. */ function toolbar_page_build(&$page) { - $page['page_top']['toolbar'] = array( + $page['page_bottom']['toolbar'] = array( '#pre_render' => array('toolbar_pre_render'), '#access' => user_access('access toolbar'), - 'toolbar_drawer' => array(), ); } @@ -144,11 +78,8 @@ function toolbar_pre_render($toolbar) { * Add some page classes, so global page theming can adjust to the toolbar. */ function toolbar_preprocess_html(&$vars) { - if (isset($vars['page']['page_top']['toolbar']) && user_access('access toolbar')) { + if (isset($vars['page']['page_bottom']['toolbar']) && user_access('access toolbar')) { $vars['attributes']['class'][] = 'toolbar'; - if (!_toolbar_is_collapsed()) { - $vars['attributes']['class'][] = 'toolbar-drawer'; - } } } @@ -165,7 +96,7 @@ function toolbar_preprocess_toolbar(&$variables) { /** * Implements hook_system_info_alter(). * - * Indicate that the 'page_top' region (in which the toolbar will be displayed) + * Indicate that the 'page_bottom' region (in which the toolbar will be displayed) * is an overlay supplemental region that should be refreshed whenever its * content is updated. * @@ -174,7 +105,7 @@ function toolbar_preprocess_toolbar(&$variables) { */ function toolbar_system_info_alter(&$info, $file, $type) { if ($type == 'theme') { - $info['overlay_supplemental_regions'][] = 'page_top'; + $info['overlay_supplemental_regions'][] = 'page_bottom'; } } @@ -185,7 +116,6 @@ function toolbar_system_info_alter(&$info, $file, $type) { * Array of links and settings relating to the admin menu. */ function toolbar_view() { - global $user; $build = array( '#theme' => 'toolbar', @@ -196,76 +126,93 @@ function toolbar_view() { ), ); - // Retrieve the admin menu from the database. - $links = toolbar_menu_navigation_links(toolbar_get_menu_tree()); - $build['toolbar_menu'] = array( - '#theme' => 'links__toolbar_menu', - '#links' => $links, - '#attributes' => array('id' => 'toolbar-menu'), - '#heading' => array('text' => t('Administrative toolbar'), 'level' => 'h2', 'class' => 'element-invisible'), - ); - - // Add logout & user account links or login link. - if ($user->uid) { - $links = array( - 'account' => array( - 'title' => t('Hello @username', array('@username' => user_format_name($user))), - 'href' => 'user', - 'html' => TRUE, - 'attributes' => array('title' => t('User account')), - ), - 'logout' => array( - 'title' => t('Log out'), - 'href' => 'user/logout', - ), - ); - } - else { - $links = array( - 'login' => array( - 'title' => t('Log in'), - 'href' => 'user', - ), + // Get the configured breakpoint for switch from vertical to horizontal + // toolbar presentation. + $breakpoints = entity_load('breakpoint_group', 'module.toolbar.toolbar'); + if (!empty($breakpoints)) { + $build['#attached']['js'] = array( + array( + 'data' => array( + 'toolbar' => array( + 'breakpoints' => array(), + ), + ), + 'type' => 'setting', + ) ); + // // Load the breakpoints for toolbar. + foreach ($breakpoints->breakpoints as $key => $breakpoint) { + $build['#attached']['js'][0]['data']['toolbar']['breakpoints'][$key] = $breakpoint->mediaQuery; + } } - $build['toolbar_user'] = array( - '#theme' => 'links__toolbar_user', - '#links' => $links, - '#attributes' => array('id' => 'toolbar-user'), + + // Build the default toolbar navigation links. + // Retrieve the administration menu from the database. + $tree = toolbar_get_menu_tree(); + // Add attributes to the links before rendering. + toolbar_menu_navigation_links($tree); + $menu['toolbar_administration'] = array( + '#type' => 'container', + '#attributes' => array( + 'class' => array('interactive-menu toolbar-list'), + ), ); + $menu['toolbar_administration']['administration_menu'] = menu_tree_output($tree); - // Add a "home" link. - $link = array( + $toolbar_groups = array( 'home' => array( - 'title' => 'Home', - 'href' => '', - 'html' => TRUE, - 'attributes' => array('title' => t('Home')), + 'tab' => array( + 'title' => t('Home'), + 'href' => '', + 'html' => FALSE, + ), + ), + 'administration' => array( + 'tab' => array( + 'title' => t('Menu'), + 'href' => '', + 'html' => FALSE, + ), + 'tray' => $menu, ), - ); - $build['toolbar_home'] = array( - '#theme' => 'links', - '#links' => $link, - '#attributes' => array('id' => 'toolbar-home'), ); - // Add an anchor to be able to toggle the visibility of the drawer. - $build['toolbar_toggle'] = array( - '#theme' => 'toolbar_toggle', - '#collapsed' => _toolbar_is_collapsed(), - '#attributes' => array('class' => array('toggle')), - ); + // Get groups from other modules. + $toolbar_groups = array_merge($toolbar_groups, module_invoke_all('toolbar_register_tabs')); - // Prepare the drawer links CSS classes. - $toolbar_drawer_classes = array( - 'toolbar-drawer', - 'clearfix', - ); - if (_toolbar_is_collapsed()) { - $toolbar_drawer_classes[] = 'collapsed'; + // Bar tabs. + $toolbar_tabs = array(); + $toolbar_trays = array(); + foreach ($toolbar_groups as $category => $components) { + if (!empty($components['tab'])) { + // Provide a data attribute to each bar link that associates it with its tray. + $components['tab']['attributes']['data-toolbar-tray'] = $category; + if (!isset($components['tab']['attributes']['class'])) { + $components['tab']['attributes']['class'] = array(); + } + $components['tab']['attributes']['class'][] = 'tab'; + $components['tab']['attributes']['role'] = 'button'; + $toolbar_tabs[$category] = $components['tab']; + } + if (!empty($components['tray'])) { + $toolbar_trays[$category] = $components['tray']; + } } - $build['toolbar_drawer']['#type'] = 'container'; - $build['toolbar_drawer']['#attributes']['class'] = $toolbar_drawer_classes; + + // Assign the tabs to the build. + $build['toolbar_tabs'] = array( + '#theme' => 'links', + '#links' => $toolbar_tabs, + '#attributes' => array( + 'class' => array('bar', 'clearfix'), + ), + '#heading' => array('text' => t('Drupal toolbar'), 'level' => 'h2', 'class' => 'element-invisible'), + ); + //// Assign the tabs to the build. + $build['toolbar_trays'] = array( + '#theme' => 'toolbar_tray', + '#trays' => $toolbar_trays, + ); return $build; } @@ -280,14 +227,13 @@ function toolbar_get_menu_tree() { $tree = array(); $admin_link = db_query('SELECT * FROM {menu_links} WHERE menu_name = :menu_name AND module = :module AND link_path = :path', array(':menu_name' => 'admin', ':module' => 'system', ':path' => 'admin'))->fetchAssoc(); if ($admin_link) { - $tree = menu_build_tree('admin', array( - 'expanded' => array($admin_link['mlid']), - 'min_depth' => $admin_link['depth'] + 1, - 'max_depth' => $admin_link['depth'] + 1, - )); + $tree = menu_tree_all_data('admin'); } - - return $tree; + // Return the sub-menus of the admin menu root. + foreach ($tree as $key => $menu) { + return (!empty($tree[$key]['below'])) ? $tree[$key]['below'] : array(); + } + return array(); } /** @@ -299,34 +245,31 @@ function toolbar_get_menu_tree() { * @return * An array of links as defined above. */ -function toolbar_menu_navigation_links($tree) { - $links = array(); - foreach ($tree as $item) { - if (!$item['link']['hidden'] && $item['link']['access']) { - // Make sure we have a path specific ID in place, so we can attach icons - // and behaviors to the items. - $id = str_replace(array('/', '<', '>'), array('-', '', ''), $item['link']['href']); +function toolbar_menu_navigation_links(&$tree) { + foreach ($tree as $key => $item) { + // Configure sub-items. + if (!empty($item['below'])) { + toolbar_menu_navigation_links($tree[$key]['below']); + } + // Make sure we have a path specific ID in place, so we can attach icons + // and behaviors to the items. + $tree[$key]['link']['localized_options']['attributes']['id'] = 'toolbar-link-' . str_replace(array('/', '<', '>'), array('-', '', ''), $item['link']['link_path']); + } +} - $link = $item['link']['localized_options']; - $link['href'] = $item['link']['href']; - // Add icon placeholder. - $link['title'] = '' . check_plain($item['link']['title']); - // Add admin link ID. - $link['attributes'] = array('id' => 'toolbar-link-' . $id); - if (!empty($item['link']['description'])) { - $link['title'] .= ' (' . $item['link']['description'] . ')'; - $link['attributes']['title'] = $item['link']['description']; - } - $link['html'] = TRUE; +/** + * + */ +function theme_toolbar_tray($trays) { + $output = ''; - $class = ' path-' . $id; - if (toolbar_in_active_trail($item['link']['href'])) { - $class .= ' active-trail'; - } - $links['menu-' . $item['link']['mlid'] . $class] = $link; - } + foreach ($trays['element']['#trays'] as $key => $tray) { + $output .= ''; } - return $links; + + return $output; } /** @@ -365,13 +308,17 @@ function toolbar_library_info() { 'title' => 'Toolbar', 'version' => VERSION, 'js' => array( - drupal_get_path('module', 'toolbar') . '/toolbar.js' => array(), + drupal_get_path('module', 'toolbar') . '/js/toolbar.js' => array(), ), 'css' => array( - drupal_get_path('module', 'toolbar') . '/toolbar.css', + drupal_get_path('module', 'toolbar') . '/css/toolbar.base.css', + drupal_get_path('module', 'toolbar') . '/css/toolbar.theme.css', + drupal_get_path('module', 'toolbar') . '/css/toolbar.icons.css', ), 'dependencies' => array( + array('system', 'matchMedia'), array('system', 'jquery'), + array('system', 'underscore'), array('system', 'drupal'), array('system', 'drupalSettings'), array('system', 'jquery.once'), diff --git a/core/modules/user/user.css b/core/modules/user/user.css index 866ee40..3a727c0 100644 --- a/core/modules/user/user.css +++ b/core/modules/user/user.css @@ -88,3 +88,14 @@ div.password-suggestions ul { .profile dd { margin: 0 0 1em 0; } + +/** + * Toolbar icon. + */ +.toolbar-main .user .tab { + background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxNi4wLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+DQo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB3aWR0aD0iMTAwcHgiIGhlaWdodD0iMTAwcHgiIHZpZXdCb3g9IjAgMCAxMDAgMTAwIiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCAxMDAgMTAwIiB4bWw6c3BhY2U9InByZXNlcnZlIj4NCjxsaW5lYXJHcmFkaWVudCBpZD0iU1ZHSURfMV8iIGdyYWR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diff --git a/core/modules/user/user.module b/core/modules/user/user.module index 3173265..a7b1ec1 100644 --- a/core/modules/user/user.module +++ b/core/modules/user/user.module @@ -3068,6 +3068,70 @@ function user_file_download_access($field, EntityInterface $entity, File $file) } /** + * Implements hook_toolbar_register_tabs(). + */ +function user_toolbar_register_tabs() { + global $user; + + $tab['user'] = array( + 'tab' => array( + 'title' => user_format_name($user), + 'href' => '', + 'html' => FALSE, + ), + 'tray' => array( + '#pre_render' => array('user_toolbar_pre_render'), + ), + ); + + return $tab; +} + +/** + * Pre-render function for adding user account actions to the toolbar. + */ +function user_toolbar_pre_render($toolbar) { + global $user; + + // Add logout & user account links or login link. + if ($user->uid) { + $links = array( + 'logout' => array( + 'title' => t('Log out'), + 'href' => 'user/logout', + ), + 'account' => array( + 'title' => t('View profile'), + 'href' => 'user', + 'html' => TRUE, + 'attributes' => array( + 'title' => t('User account'), + ), + ), + ); + } + else { + $links = array( + 'login' => array( + 'title' => t('Log in'), + 'href' => 'user', + ), + ); + } + + $user_links = array( + '#theme' => 'links__toolbar_user', + '#links' => $links, + '#attributes' => array( + 'class' => array('toolbar-list'), + ), + '#heading' => array('text' => t('User account actions'), 'level' => 'h2', 'class' => 'element-invisible'), + ); + + return $user_links; +} + +/** * Implements hook_library_info(). */ function user_library_info() { -- 1.7.10.4