Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Guindon2015-08-19 17:48:04 +0000
committerchristopher Guindon2015-08-19 18:18:02 +0000
commit71c82b738f78dd5e023bfcd56af2e187ed8d65b2 (patch)
tree0e2c0fe6281c27ad2edfde595705d5b6936bbc33
parente1455d6902d9fea5a19b8abcb338f6e7830c2f01 (diff)
downloadeclipse.org-common-71c82b738f78dd5e023bfcd56af2e187ed8d65b2.tar.gz
eclipse.org-common-71c82b738f78dd5e023bfcd56af2e187ed8d65b2.tar.xz
eclipse.org-common-71c82b738f78dd5e023bfcd56af2e187ed8d65b2.zip
[Bug 437263] new website download button confusing
Signed-off-by: Christopher Guindon <chris.guindon@eclipse.org>
-rw-r--r--system/breadcrumbs.class.php20
-rw-r--r--themes/solstice/app.php16
2 files changed, 30 insertions, 6 deletions
diff --git a/system/breadcrumbs.class.php b/system/breadcrumbs.class.php
index f68ae0b6..6f15fbfc 100644
--- a/system/breadcrumbs.class.php
+++ b/system/breadcrumbs.class.php
@@ -59,6 +59,7 @@ class Breadcrumb extends Menu {
"screenshots" => "Screenshots",
"site_login" => "My Account",
"users" => "Getting started",
+ "" => "", //Homepage
);
function getCrumbList() {
@@ -151,11 +152,15 @@ class Breadcrumb extends Menu {
function addCrumb($_Text, $_URL, $_Target) {
$_Text = strip_tags($_Text);
- # Menu Items must be added at position 1
- $Crumb = new Link($_Text, $_URL, $_Target, 0);
- # Add incoming menuitem
- $this->CrumbList[count($this->CrumbList)] = $Crumb;
+ // We don't need to add a crumb if there is no text for it.
+ if (!empty($_Text)) {
+ # Menu Items must be added at position 1
+ $Crumb = new Link($_Text, $_URL, $_Target, 0);
+
+ # Add incoming menuitem
+ $this->CrumbList[count($this->CrumbList)] = $Crumb;
+ }
}
function getCrumbCount() {
@@ -163,9 +168,14 @@ class Breadcrumb extends Menu {
}
function getCrumbAt($_Pos) {
- if($_Pos < $this->getCrumbCount()) {
+ if ($_Pos < $this->getCrumbCount()) {
return $this->CrumbList[$_Pos];
}
+ // If link does not exist, return an empty link object
+ else {
+ $Crumb = new Link('', '', '', 0);
+ return $Crumb;
+ }
}
/**
diff --git a/themes/solstice/app.php b/themes/solstice/app.php
index ea014412..e4a163cc 100644
--- a/themes/solstice/app.php
+++ b/themes/solstice/app.php
@@ -104,10 +104,24 @@ class Solstice {
$variables['theme_variables']['breadcrumbs_classes'] = 'defaut-breadcrumbs hidden-print';
}
- $classes = array();
+ $classes = array();
+ $crumb1 = $Breadcrumb->getCrumbAt(1)->getText();
+ $url_parts = explode('/', str_ireplace(array('http://', 'https://'), '', $_SERVER['REQUEST_URI']));
+ $directory = strtolower($url_parts[1]);
if (!empty($variables['theme_variables']['btn_cfa']['hide']) && $variables['theme_variables']['btn_cfa']['hide'] === TRUE) {
$classes[] = 'hidden-cfa-button';
}
+ // Make sure this is a project and not the project sub-directory on
+ // eclipse.org
+ elseif ($crumb1 === 'Projects' && $directory != 'projects') {
+ // If the user is not trying to override this button, let's change
+ // it for all of our project websites.
+ if (empty($variables['theme_variables']['btn_cfa']['text']) && empty($variables['theme_variables']['btn_cfa']['url'])) {
+ $variables['theme_variables']['btn_cfa']['text'] = 'Donate';
+ $variables['theme_variables']['btn_cfa']['href'] = 'https://www.eclipse.org/donate/';
+ $variables['theme_variables']['btn_cfa']['class'] = 'btn btn-huge btn-info';
+ }
+ }
$deprecated = "";
$items = array();

Back to the top