Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Poirier2019-08-06 15:13:05 +0000
committerChristopher Guindon2019-08-19 14:50:05 +0000
commite8eb7f5a9fd8a8e0ca78ce7ea3ae939a377f4a72 (patch)
tree0541e634c6393d04f43c74bad472bb873590402c
parent7b69b49f211f767ebe34e9420be66ed028ade19a (diff)
downloadeclipse.org-common-e8eb7f5a9fd8a8e0ca78ce7ea3ae939a377f4a72.tar.gz
eclipse.org-common-e8eb7f5a9fd8a8e0ca78ce7ea3ae939a377f4a72.tar.xz
eclipse.org-common-e8eb7f5a9fd8a8e0ca78ce7ea3ae939a377f4a72.zip
Bug 534152 - Use featured story xml in featured footer section
Change-Id: I8b61bcdc25f2335027acf2a69ac8cfea34afb1df Signed-off-by: Eric Poirier <eric.poirier@eclipse-foundation.org>
-rw-r--r--classes/themes/baseTheme.class.php33
-rw-r--r--classes/themes/quicksilver.class.php26
-rw-r--r--data/featured-story.xml21
3 files changed, 56 insertions, 24 deletions
diff --git a/classes/themes/baseTheme.class.php b/classes/themes/baseTheme.class.php
index 1717a025..1ae7e023 100644
--- a/classes/themes/baseTheme.class.php
+++ b/classes/themes/baseTheme.class.php
@@ -105,6 +105,11 @@ class BaseTheme {
protected $extra_header_html = "";
/**
+ * Featured story xml path
+ */
+ protected $featured_story_xml = "";
+
+ /**
* Links for the footer
*
* @var array
@@ -342,18 +347,42 @@ class BaseTheme {
}
/**
+ * Get a featured story xml path
+ *
+ * @return string
+ */
+ public function getFeaturedStoryXml() {
+ if (empty($this->featured_story_xml)) {
+ $this->setFeaturedStoryXml();
+ }
+ return $this->featured_story_xml;
+ }
+
+ /**
+ * Set a featured story xml path
+ *
+ * @param string $url
+ */
+ public function setFeaturedStoryXml($url = "") {
+ $this->featured_story_xml = realpath(dirname(__FILE__) . "/../../data/featured-story.xml");
+ if (!empty($url) && file_exists($url)) {
+ $this->featured_story_xml = $url;
+ }
+ }
+
+ /**
* Get a featured story from the provided xml file
*
* @param $xml_file
*
* @return array
*/
- public function getFeaturedStory($xml_file) {
+ public function getFeaturedStory() {
$App = $this->_getApp();
require_once($App->getBasePath() . '/classes/ads/featuredStory.class.php');
$FeaturedStory = new FeaturedStory();
if ($FeaturedStory instanceof FeaturedStory) {
- $FeaturedStory->setXmlData($xml_file);
+ $FeaturedStory->setXmlData($this->getFeaturedStoryXml());
$featured_story = $FeaturedStory->getFeaturedStory();
if (!empty($featured_story)) {
if (!empty($featured_story['bg_image'])) {
diff --git a/classes/themes/quicksilver.class.php b/classes/themes/quicksilver.class.php
index ea30d2bc..ca2b921c 100644
--- a/classes/themes/quicksilver.class.php
+++ b/classes/themes/quicksilver.class.php
@@ -174,27 +174,7 @@ EOHTML;
}
}
- $btn_url = $this->buildUrl("https://www.eclipse.org/go/PROMO_ECLIPSEIDE_FOOTER", array(
- 'query' => array(
- 'utm_source' => "eclipse_foundation",
- 'utm_medium' => "featured_footer",
- 'utm_campaign' => "eclipse_ide_2019_06",
- ),
- 'absolute' => TRUE
- ));
- $content = '<p style="font-size:16px;">Now Available</p>
- <h2 style="font-size:52px;"><strong>Eclipse IDE 2019-06</strong></h2>
- <p>Get the latest version of the Eclipse IDE.</p>
- <ul class="list-inline">
- <li><a class="btn btn-primary" href="'. $btn_url .'">Download</a></li>
- <li><a class="btn btn-default" href="https://www.eclipse.org/eclipseide/">Learn More</a></li>
- </ul>';
-
- if(time() >= strtotime("15 July 2019 8:00") && time() < strtotime("31 July 2019 8:00")) {
- $content = '<h2><strong>New eBook: The Business Value of Open Source</strong></h2>
- <p>Fuel your company\'s digital transformation with the help of our free eBook!</p>
- <a class="btn btn-primary btn-lg" href="http://bit.ly/2l9NHoW">Download now</a>';
- }
+ $featured_story = $this->getFeaturedStory($this->getFeaturedStoryXml());
return <<<EOHTML
<!-- Sign Up to our Newsletter -->
@@ -202,7 +182,9 @@ EOHTML;
<div class="container">
<div class="row">
<div class="{$main_container_col}">
- {$content}
+ {$featured_story['title']}
+ {$featured_story['body']}
+ {$featured_story['link']}
</div>
{$promo_html}
</div>
diff --git a/data/featured-story.xml b/data/featured-story.xml
new file mode 100644
index 00000000..d61084e0
--- /dev/null
+++ b/data/featured-story.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<featured_story>
+ <item>
+ <prefix><![CDATA[<p class="featured-story-description margin-top-10 margin-bottom-0">Now Available</p>]]></prefix>
+ <title><![CDATA[<h2 class="margin-top-30"><strong>Eclipse IDE 2019-06</strong></h2>]]></title>
+ <body><![CDATA[<p>Get the latest version of the Eclipse IDE.</p>]]></body>
+ <link><![CDATA[<a class="btn btn-primary btn-lg" href="https://www.eclipse.org/go/PROMO_ECLIPSEIDE_FOOTER@FEATURED_STORY?utm_source=eclipse_foundation&utm_medium=featured_story&utm_campaign=eclipse_ide_2019_06">Download</a> <a class="btn btn-primary btn-lg" href="/eclipseide/">Learn More</a>]]></link>
+ <start_date></start_date>
+ <end_date></end_date>
+ <bg_image>images/2019-06-bg.jpg</bg_image>
+ </item>
+ <item>
+ <prefix></prefix>
+ <title><![CDATA[<h2 class="margin-top-30"><strong>New eBook: The Business Value of Open Source</strong></h2>]]></title>
+ <body><![CDATA[<p>Fuel your company's digital transformation with the help of our free eBook!</p>]]></body>
+ <link><![CDATA[<a class="btn btn-primary btn-lg" href="http://bit.ly/2l9NHoW">Download now</a>]]></link>
+ <start_date>15 July 2019 8:00</start_date>
+ <end_date>31 July 2019 8:00</end_date>
+ <bg_image>images/ebook-banner.jpg</bg_image>
+ </item>
+</featured_story> \ No newline at end of file

Back to the top