summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcatch2012-11-19 11:43:55 (GMT)
committercatch2012-11-19 11:43:55 (GMT)
commit782c30967c2af005e28752c3e1650b39ac9c2505 (patch)
tree436b177f145bdf3a3921b8839d3c14582344d4a0
parent53656a33e0299ede4da8a173ed3219597e529f7a (diff)
Issue #1167350 by sun, ry5n, iflista: Action links were ignored .
-rw-r--r--core/includes/menu.inc18
-rw-r--r--core/modules/block/lib/Drupal/block/Tests/BlockTest.php6
-rw-r--r--core/modules/system/system.theme-rtl.css14
-rw-r--r--core/modules/system/system.theme.css28
-rw-r--r--core/themes/bartik/css/style.css12
-rw-r--r--core/themes/seven/style.css47
6 files changed, 89 insertions, 36 deletions
diff --git a/core/includes/menu.inc b/core/includes/menu.inc
index d28316b..bbc5138 100644
--- a/core/includes/menu.inc
+++ b/core/includes/menu.inc
@@ -1654,18 +1654,16 @@ function theme_menu_local_task($variables) {
*/
function theme_menu_local_action($variables) {
$link = $variables['element']['#link'];
+ $link += array(
+ 'href' => '',
+ 'localized_options' => array(),
+ );
+ $link['localized_options']['attributes']['class'][] = 'button';
+ $link['localized_options']['attributes']['class'][] = 'add';
$output = '<li>';
- if (isset($link['href'])) {
- $output .= l($link['title'], $link['href'], isset($link['localized_options']) ? $link['localized_options'] : array());
- }
- elseif (!empty($link['localized_options']['html'])) {
- $output .= $link['title'];
- }
- else {
- $output .= check_plain($link['title']);
- }
- $output .= "</li>\n";
+ $output .= l($link['title'], $link['href'], $link['localized_options']);
+ $output .= "</li>";
return $output;
}
diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php
index b09f2d4..01d3b67 100644
--- a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php
+++ b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php
@@ -71,9 +71,11 @@ class BlockTest extends WebTestBase {
// Confirm that the add block link appears on block overview pages.
$this->drupalGet('admin/structure/block');
- $this->assertRaw(l('Add block', 'admin/structure/block/add'), 'Add block link is present on block overview page for default theme.');
+ $this->assertLink(t('Add block'));
+ $this->assertLinkByHref('admin/structure/block/add');
$this->drupalGet('admin/structure/block/list/seven');
- $this->assertRaw(l('Add block', 'admin/structure/block/list/seven/add'), 'Add block link is present on block overview page for non-default theme.');
+ $this->assertLink(t('Add block'));
+ $this->assertLinkByHref('admin/structure/block/list/seven/add');
// Confirm that hidden regions are not shown as options for block placement
// when adding a new block.
diff --git a/core/modules/system/system.theme-rtl.css b/core/modules/system/system.theme-rtl.css
index a8b5e0f..27b8ce7 100644
--- a/core/modules/system/system.theme-rtl.css
+++ b/core/modules/system/system.theme-rtl.css
@@ -76,6 +76,20 @@ ul.menu {
}
/**
+ * RTL Styles for link buttons and action links.
+ */
+.action-links li:first-child {
+ margin-left: auto;
+ margin-right: 0;
+}
+a.button.add:before {
+ margin-left: 0;
+ margin-right: -0.1em;
+ padding-left: 0.2em;
+ padding-right: 0;
+}
+
+/**
* RTL Styles for system messages.
*/
diff --git a/core/modules/system/system.theme.css b/core/modules/system/system.theme.css
index ad901ea..6a4a64d 100644
--- a/core/modules/system/system.theme.css
+++ b/core/modules/system/system.theme.css
@@ -335,6 +335,34 @@ ul.tabs {
}
/**
+ * Styles for link buttons and action links.
+ */
+.action-links {
+ list-style: none;
+ padding: 0;
+ margin: 1em 0;
+}
+.action-links li {
+ display: inline-block;
+ margin: 0 0.3em;
+}
+.action-links li:first-child {
+ margin-left: 0; /* LTR */
+}
+a.button {
+ display: inline-block;
+ line-height: 160%;
+ padding: 0.2em 0.5em 0.3em;
+ text-decoration: none;
+}
+a.button.add:before {
+ content: '+';
+ font-weight: 900;
+ margin-left: -0.1em; /* LTR */
+ padding-right: 0.2em; /* LTR */
+}
+
+/**
* Styles for system messages.
*/
div.messages {
diff --git a/core/themes/bartik/css/style.css b/core/themes/bartik/css/style.css
index 94ac775..9e781eb 100644
--- a/core/themes/bartik/css/style.css
+++ b/core/themes/bartik/css/style.css
@@ -1030,19 +1030,9 @@ div.tabs {
border-bottom: none;
border-radius: 5px;
}
-ul.action-links {
- list-style: none;
- margin: 5px;
- padding: 0.5em 1em;
-}
-ul.action-links li {
- display: inline-block;
- margin-left: 10px;
-}
ul.action-links li a {
padding-left: 15px;
- background: url(../images/add.png) no-repeat left center;
- margin: 0 10px 0 0;
+ margin: 0;
}
/* ---------------- Messages ----------------- */
diff --git a/core/themes/seven/style.css b/core/themes/seven/style.css
index 9c43ac9..bb0ad8c 100644
--- a/core/themes/seven/style.css
+++ b/core/themes/seven/style.css
@@ -709,20 +709,41 @@ select.form-select:focus {
.js input.throbbing {
background-position: 100% -16px;
}
-ul.action-links {
- margin: 1em 0;
- padding: 0 20px 0 20px; /* LTR */
- list-style-type: none;
- overflow: hidden;
-}
-ul.action-links li {
- float: left; /* LTR */
- margin: 0 1em 0 0; /* LTR */
+a.button.add {
+ background: #1078d8;
+ background-image: -webkit-linear-gradient(top, #419ff1, #1076d5);
+ background-image: -moz-linear-gradient(top, #419ff1, #1076d5);
+ background-image: -o-linear-gradient(top, #419ff1, #1076d5);
+ background-image: linear-gradient(to bottom, #419ff1, #1076d5);
+ border: 1px solid #0048c8;
+ border-radius: .4em;
+ -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4);
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4);
+ color: #fff;
+ font-size: 1em;
+ line-height: normal;
+ margin: 0;
+ padding: 4px 1em;
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.5);
+}
+a.button.add:focus,
+a.button.add:hover {
+ background-color: #419cf1;
+ background-image: -webkit-linear-gradient(top, #59abf3, #2a90ef);
+ background-image: -moz-linear-gradient(top, #59abf3, #2a90ef);
+ background-image: -o-linear-gradient(top, #59abf3, #2a90ef);
+ background-image: linear-gradient(to bottom, #59abf3, #2a90ef);
+ color: #fff;
}
-ul.action-links a {
- padding-left: 15px; /* LTR */
- background: transparent url(images/add.png) no-repeat 0 center;
- line-height: 30px;
+a.button.add:active {
+ background-color: #0e69be;
+ background-image: -webkit-linear-gradient(top, #0e69be, #2a93ef);
+ background-image: -moz-linear-gradient(top, #0e69be, #2a93ef);
+ background-image: -o-linear-gradient(top, #0e69be, #2a93ef);
+ background-image: -ms-linear-gradient(top, #0e69be, #2a93ef);
+ background-image: linear-gradient(to bottom, #0e69be, #2a93ef);
+ -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, .25);
+ box-shadow: inset 0 1px 2px rgba(0, 0, 0, .25);
}
/**