-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[374] Add Armory Updates page (updates.xml)
- Loading branch information
Showing
6 changed files
with
220 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
<?xml version="1.0"?> | ||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | ||
<xsl:output method="html" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"/> | ||
|
||
<xsl:include href="includes.xsl"/> | ||
|
||
<xsl:template match="updates"> | ||
|
||
<script type="text/javascript"> | ||
|
||
function toggleUpdate(theId) { | ||
elementId = document.getElementById('showHideUpdate'+theId); | ||
if (elementId.style.display == "block") { | ||
$("#replaceToggle"+theId).html("<xsl:value-of select="$loc/strs/unsorted/str[@id='armory.labels.open']"/>"); | ||
elementId.style.display = "none"; | ||
} else { | ||
$("#replaceToggle"+theId).html("<xsl:value-of select="$loc/strs/unsorted/str[@id='armory.labels.close']"/>"); | ||
elementId.style.display = "block"; | ||
} | ||
} | ||
</script> | ||
|
||
<div id="dataElement"> | ||
<div class="parchment-top" id="top"> | ||
<div class="parchment-content"> | ||
<div class="list"> | ||
<div class="full-list notab"> | ||
<div class="info-pane"> | ||
<div class="profile-wrapper"> | ||
<div class="generic-wrapper"> | ||
<div class="generic-right"> | ||
<div class="genericHeader"> | ||
<div class="update-content"> | ||
<xsl:call-template name="updatesContent" /> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
|
||
</xsl:template> | ||
|
||
|
||
<xsl:template name="updatesContent"> | ||
|
||
<h1><xsl:value-of select="$loc/strs/unsorted/str[@id='armory.updates.armoryupdates']"/></h1> | ||
<b><em><xsl:value-of select="$loc/strs/unsorted/str[@id='armory.updates.cache']"/></em></b> | ||
|
||
<xsl:for-each select="document(concat('../updates-feed.xml?lang=', $lang))/updates/update[not(contains(@exclude, $region))]"> | ||
<xsl:variable name="thePosition" select="position()" /> | ||
|
||
<h2> | ||
<xsl:value-of select="@date" /> | ||
<a href="#top" class="updateTop staticTip" onmouseover="setTipText('{$loc/strs/unsorted/str[@id='armory.labels.top']}');"></a> | ||
</h2> | ||
|
||
<xsl:for-each select="entry"> | ||
<a name="anchor{@key}"></a> | ||
<div class="update-item"> | ||
<div class="update-line-item" id="line{@key}"> | ||
<span><xsl:value-of select = "@title" /></span> | ||
<em class="toggleUpdate"> | ||
[ <a href="javascript: toggleUpdate('{@key}');" id="replaceToggle{@key}"> | ||
<xsl:choose> | ||
<xsl:when test="$thePosition = 1"> | ||
<xsl:value-of select="$loc/strs/unsorted/str[@id='armory.labels.close']"/> | ||
</xsl:when> | ||
<xsl:otherwise> | ||
<xsl:value-of select="$loc/strs/unsorted/str[@id='armory.labels.open']"/> | ||
</xsl:otherwise> | ||
</xsl:choose> | ||
</a> ] | ||
</em> | ||
</div> | ||
<div class="update-body" id="showHideUpdate{@key}" style="display: none;"> | ||
<xsl:if test="$thePosition = 1"> | ||
<xsl:attribute name="style">display: block;</xsl:attribute> | ||
</xsl:if> | ||
<p><xsl:apply-templates/></p> | ||
<div class="clear"></div> | ||
</div> | ||
</div> | ||
<div class="clear"></div> | ||
</xsl:for-each> | ||
|
||
</xsl:for-each> | ||
|
||
<script type="text/javascript"> | ||
$("#replaceTogglepinprofile").html("<xsl:value-of select="$loc/strs/unsorted/str[@id='armory.labels.close']"/>"); | ||
$("#showHideUpdatepinprofile").attr("style","display:block"); | ||
|
||
$("#replaceToggledesiredby").html("<xsl:value-of select="$loc/strs/unsorted/str[@id='armory.labels.close']"/>"); | ||
$("#showHideUpdatedesiredby").attr("style","display:block"); | ||
|
||
$("#replaceTogglefindupgrade").html("<xsl:value-of select="$loc/strs/unsorted/str[@id='armory.labels.close']"/>"); | ||
$("#showHideUpdatefindupgrade").attr("style","display:block"); | ||
|
||
if(($.browser.msie) && ($.browser.version == "6.0")){ | ||
$(".updateTop").hide(); | ||
} | ||
</script> | ||
|
||
|
||
</xsl:template> | ||
|
||
</xsl:stylesheet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<?php | ||
define('ARMORY_REVISION', 374); | ||
define('ARMORY_REVISION', 375); | ||
define('DB_VERSION', 'armory_r361'); | ||
define('CONFIG_VERSION', '0708201001'); | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
/** | ||
* @package World of Warcraft Armory | ||
* @version Release Candidate 1 | ||
* @revision 375 | ||
* @copyright (c) 2009-2010 Shadez | ||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
**/ | ||
|
||
define('__ARMORY__', true); | ||
if(!@include('includes/armory_loader.php')) { | ||
die('<b>Fatal error:</b> unable to load system files.'); | ||
} | ||
header('Content-type: text/xml'); | ||
$xml->XMLWriter()->startElement('updates'); | ||
$armory_news = $utils->GetArmoryNews(true); | ||
if(is_array($armory_news)) { | ||
foreach($armory_news as $news_item) { | ||
$xml->XMLWriter()->startElement('update'); | ||
$xml->XMLWriter()->writeAttribute('date', $news_item['date']); | ||
$xml->XMLWriter()->startElement('entry'); | ||
$xml->XMLWriter()->writeAttribute('key', $news_item['key']); | ||
$xml->XMLWriter()->writeAttribute('title', $news_item['title']); | ||
if(preg_match('/&/', $news_item['text'])) { | ||
$news_item['text'] = str_replace('&', '&', $news_item['text']); | ||
} | ||
$xml->XMLWriter()->writeRaw( $news_item['text'] ); | ||
$xml->XMLWriter()->endElement(); //entry | ||
$xml->XMLWriter()->endElement(); //update | ||
} | ||
} | ||
$xml->XMLWriter()->endElement(); //updates | ||
echo $xml->StopXML(); | ||
exit; | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
/** | ||
* @package World of Warcraft Armory | ||
* @version Release Candidate 1 | ||
* @revision 375 | ||
* @copyright (c) 2009-2010 Shadez | ||
* @license http://opensource.org/licenses/gpl-license.php GNU Public License | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; either version 2 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program; if not, write to the Free Software | ||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
**/ | ||
|
||
define('__ARMORY__', true); | ||
if(!@include('includes/armory_loader.php')) { | ||
die('<b>Fatal error:</b> unable to load system files.'); | ||
} | ||
header('Content-type: text/xml'); | ||
// Load XSLT template | ||
$xml->LoadXSLT('updates.xsl'); | ||
$xml->XMLWriter()->startElement('page'); | ||
$xml->XMLWriter()->writeAttribute('globalSearch', 1); | ||
$xml->XMLWriter()->writeAttribute('lang', $armory->GetLocale()); | ||
$xml->XMLWriter()->startElement('updates'); | ||
$xml->XMLWriter()->startElement('related-info'); | ||
$xml->XMLWriter()->endElement(); //related-info | ||
$xml->XMLWriter()->endElement(); //updates | ||
$xml->XMLWriter()->endElement(); //page | ||
echo $xml->StopXML(); | ||
exit; | ||
?> |