| Current Path : /home/wuectly/www/03cbe/ |
| Current File : /home/wuectly/www/03cbe/com_xmap.zip |
PK y[$]�6�
index.htmlnu &1i� <!DOCTYPE html><title></title>PK y[$]J��� � xmap.phpnu &1i� <?php
/**
* @version $Id$
* @copyright Copyright (C) 2005 - 2009 Joomla! Vargas. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @author Guillermo Vargas (guille@vargas.co.cr)
*/
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
// Include dependencies
jimport('joomla.application.component.controller');
# For compatibility with older versions of Joola 2.5
if (!class_exists('JControllerLegacy')){
class JControllerLegacy extends JController {
}
}
require_once(JPATH_COMPONENT.'/displayer.php');
$controller = JControllerLegacy::getInstance('Xmap');
$controller->execute(JRequest::getVar('task'));
$controller->redirect();
PK y[$]�6� views/index.htmlnu &1i� <!DOCTYPE html><title></title>PK y[$]E �ʵ � views/xml/metadata.xmlnu &1i� <?xml version="1.0" encoding="utf-8"?>
<metadata>
<view title="XML SITEMAP">
<message>
<![CDATA[TYPEXMLLAYDESC]]>
</message>
</view>
</metadata>
PK y[$]�㱊k k views/xml/tmpl/default.phpnu &1i� <?php
/**
* @version $Id$
* @copyright Copyright (C) 2005 - 2009 Joomla! Vargas. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @author Guillermo Vargas (guille@vargas.co.cr)
*/
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
// Create shortcut to parameters.
$params = $this->item->params;
$live_site = substr_replace(JURI::root(), "", -1, 1);
header('Content-type: text/xml; charset=utf-8');
echo '<?xml version="1.0" encoding="UTF-8"?>',"\n";
if (($this->item->params->get('beautify_xml', 1) == 1) && !$this->displayer->isNews) {
$params = '&filter_showtitle='.JRequest::getBool('filter_showtitle',0);
$params .= '&filter_showexcluded='.JRequest::getBool('filter_showexcluded',0);
$params .= (JRequest::getCmd('lang')?'&lang='.JRequest::getCmd('lang'):'');
echo '<?xml-stylesheet type="text/xsl" href="'. $live_site.'/index.php?option=com_xmap&view=xml&layout=xsl&tmpl=component&id='.$this->item->id.($this->isImages?'&images=1':'').$params.'"?>'."\n";
}
?>
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"<?php echo ($this->displayer->isImages? ' xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"':''); ?><?php echo ($this->displayer->isNews? ' xmlns:news="http://www.google.com/schemas/sitemap-news/0.9"':''); ?>>
<?php echo $this->loadTemplate('items'); ?>
</urlset>PK y[$]>_ views/xml/tmpl/default_items.phpnu &1i� <?php
/**
* @version $Id$
* @copyright Copyright (C) 2005 - 2009 Joomla! Vargas. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @author Guillermo Vargas (guille@vargas.co.cr)
*/
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
// Create shortcut to parameters.
$params = $this->state->get('params');
// Use the class defined in default_class.php to print the sitemap
$this->displayer->printSitemap();PK y[$]�6� views/xml/tmpl/index.htmlnu &1i� <!DOCTYPE html><title></title>PK y[$]�/T� � views/xml/tmpl/default_class.phpnu &1i� <?php
/**
* @version $Id$
* @copyright Copyright (C) 2005 - 2009 Joomla! Vargas. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @author Guillermo Vargas (guille@vargas.co.cr)
*/
// No direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
require_once(JPATH_COMPONENT . '/displayer.php');
class XmapXmlDisplayer extends XmapDisplayer
{
/**
*
* @var array Stores the list of links that have been already included in
* the sitemap to avoid duplicated items
*/
var $_links;
/**
*
* @var string
*/
var $view = 'xml';
protected $showTitle = false;
protected $showExcluded = false;
/**
*
* @var int Indicates if this is a google news sitemap or not
*/
var $isNews = 0;
/**
*
* @var int Indicates if this is a google news sitemap or not
*/
var $isImages = 0;
function __construct($config, $sitemap)
{
parent::__construct($config, $sitemap);
$this->uids = array();
$this->defaultLanguage = strtolower(JFactory::getLanguage()->getTag());
if (preg_match('/^([a-z]+)-.*/',$this->defaultLanguage,$matches) && !in_array($this->defaultLanguage, array(' zh-cn',' zh-tw')) ) {
$this->defaultLanguage = $matches[1];
}
$this->showTitle = JRequest::getBool('filter_showtitle', 0);
$this->showExcluded = JRequest::getBool('filter_showexcluded', 0);
$db = JFactory::getDbo();
$this->nullDate = $db->getNullDate();
}
/**
* Prints an XML node for the sitemap
*
* @param stdclass $node
*/
function printNode($node)
{
$node->isExcluded = false;
if ($this->isExcluded($node->id,$node->uid)) {
if (!$this->showExcluded || !$this->canEdit) {
return false;
}
$node->isExcluded = true;
}
if ($this->isNews && (!isset($node->newsItem) || !$node->newsItem)) {
return true;
}
// For images sitemaps only display pages with images
if ($this->isImages && (!isset($node->images) || !count($node->images))) {
return true;
}
// Get the item's URL
$link = JRoute::_($node->link, true, @$node->secure == 0 ? (JFactory::getURI()->isSSL() ? 1 : -1) : $node->secure);
if (!isset($node->browserNav))
$node->browserNav = 0;
if ($node->browserNav != 3 // ignore "no link"
&& empty($this->_links[$link])) { // ignore links that have been added already
$this->count++;
$this->_links[$link] = 1;
if (!isset($node->priority))
$node->priority = "0.5";
if (!isset($node->changefreq))
$node->changefreq = 'daily';
// Get the chancefrequency and priority for this item
$changefreq = $this->getProperty('changefreq', $node->changefreq, $node->id, 'xml', $node->uid);
$priority = $this->getProperty('priority', $node->priority, $node->id, 'xml', $node->uid);
echo '<url>' . "\n";
echo '<loc>', $link, '</loc>' . "\n";
if ($this->canEdit) {
if ($this->showTitle) {
echo '<title><![CDATA['.$node->name.']]></title>' . "\n";
}
if ($this->showExcluded) {
echo '<rowclass>',($node->isExcluded? 'excluded':''),'</rowclass>';
}
echo '<uid>', $node->uid, '</uid>' . "\n";
echo '<itemid>', $node->id, '</itemid>' . "\n";
}
$modified = (isset($node->modified) && $node->modified != FALSE && $node->modified != $this->nullDate && $node->modified != -1) ? $node->modified : NULL;
if (!$modified && $this->isNews) {
$modified = time();
}
if ($modified && !is_numeric($modified)){
$date = new JDate($modified);
$modified = $date->toUnix();
}
if ($modified) {
$modified = gmdate('Y-m-d\TH:i:s\Z', $modified);
}
// If this is not a news sitemap
if (!$this->isNews) {
if ($this->isImages) {
foreach ($node->images as $image) {
echo '<image:image>', "\n";
echo '<image:loc>', $image->src, '</image:loc>', "\n";
if ($image->title) {
$image->title = str_replace('&', '&', html_entity_decode($image->title, ENT_NOQUOTES, 'UTF-8'));
echo '<image:title>', $image->title, '</image:title>', "\n";
} else {
echo '<image:title />';
}
if (isset($image->license) && $image->license) {
echo '<image:license>',str_replace('&', '&',html_entity_decode($image->license, ENT_NOQUOTES, 'UTF-8')),'</image:license>',"\n";
}
echo '</image:image>', "\n";
}
} else {
if ($modified){
echo '<lastmod>', $modified, '</lastmod>' . "\n";
}
echo '<changefreq>', $changefreq, '</changefreq>' . "\n";
echo '<priority>', $priority, '</priority>' . "\n";
}
} else {
if (isset($node->keywords)) {
$keywords = htmlspecialchars($node->keywords);
} else {
$keywords = '';
}
if (!isset($node->language) || $node->language == '*') {
$node->language = $this->defaultLanguage;
}
echo "<news:news>\n";
echo '<news:publication>'."\n";
echo ' <news:name>'.(htmlspecialchars($this->sitemap->params->get('news_publication_name'))).'</news:name>'."\n";
echo ' <news:language>'.$node->language.'</news:language>'."\n";
echo '</news:publication>'."\n";
echo '<news:publication_date>', $modified, '</news:publication_date>' . "\n";
echo '<news:title><![CDATA['.$node->name.']]></news:title>' . "\n";
if ($keywords) {
echo '<news:keywords>', $keywords, '</news:keywords>' . "\n";
}
echo "</news:news>\n";
}
echo '</url>', "\n";
} else {
return empty($this->_links[$link]);
}
return true;
}
/**
*
* @param string $property The property that is needed
* @param string $value The default value if the property is not found
* @param int $Itemid The menu item id
* @param string $view (xml / html)
* @param int $uid Unique id of the element on the sitemap
* (the id asigned by the extension)
* @return string
*/
function getProperty($property, $value, $Itemid, $view, $uid)
{
if (isset($this->jview->sitemapItems[$view][$Itemid][$uid][$property])) {
return $this->jview->sitemapItems[$view][$Itemid][$uid][$property];
}
return $value;
}
/**
* Called on every level change
*
* @param int $level
* @return boolean
*/
function changeLevel($level)
{
return true;
}
/**
* Function called before displaying the menu
*
* @param stdclass $menu The menu node item
* @return boolean
*/
function startMenu($menu)
{
return true;
}
/**
* Function called after displaying the menu
*
* @param stdclass $menu The menu node item
* @return boolean
*/
function endMenu($menu)
{
return true;
}
}
PK y[$] Q�cL cL views/xml/tmpl/default_xsl.phpnu &1i� <?php
/**
* @version $Id$
* @copyright Copyright (C) 2005 - 2009 Joomla! Vargas. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @author Guillermo Vargas (guille@vargas.co.cr)
*/
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
header('Content-Type: text/xml; charset="utf-8"');
header('Content-Disposition: inline');
$showTitle = $this->canEdit && JRequest::getBool('filter_showtitle', 0);
$showExcluded = $this->canEdit && JRequest::getBool('filter_showexcluded', 0);
echo '<?xml version="1.0" encoding="UTF-8"?>',"\n";
?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xna="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" exclude-result-prefixes="xna">
<xsl:output indent="yes" method="html" omit-xml-declaration="yes"/>
<xsl:template match="/">
<html>
<head>
<title><?php echo JText::_('COM_XMAP_XML_FILE'); ?></title>
<script src="<?php echo JUri::base(); ?>media/system/js/mootools-core.js" type="text/javascript"></script>
<script src="<?php echo JUri::base(); ?>media/system/js/mootools-more.js" type="text/javascript"></script>
<style type="text/css">
<![CDATA[
<!--
h1 {
font-weight:bold;
font-size:1.5em;
margin-bottom:0;
margin-top:1px;
}
h2 {
font-weight:bold;
font-size:1.2em;
margin-bottom:0;
color:#707070;
margin-top:1px;
}
p.sml {
font-size:0.8em;
margin-top:0;
}
.sortup {
background-position: right center;
background-image: url(<?php echo JUri::base(); ?>components/com_xmap/assets/images/sortup.gif);
background-repeat: no-repeat;
font-style:italic;
white-space:pre;
}
.sortdown {
background-position: right center;
background-image: url(<?php echo JUri::base(); ?>components/com_xmap/assets/images/sortdown.gif);
background-repeat: no-repeat;
font-style:italic;
white-space:pre;
}
table.copyright {
width:100%;
border-top:1px solid #ddad08;
margin-top:1em;
text-align:center;
padding-top:1em;
vertical-align:top;
}
table.data {
font-size: 12px;
width: 100%;
border: 1px solid #000000;
clear:both;
}
table.data tr.header td {
background-color: #CCCCCC;
color: #FFFFFF;
font-weight: bold;
font-size: 14px;
}
.divoptions {
background:#fff;
border:1px solid #ccc;
position:absolute;
padding:5px;
}
.divoptions table {
width:100%;
}
.divoptions table td {
padding:0px;
border: 1px solid #ffffff;
border-bottom:1px solid #ccc;
font-size: 12px;
}
.divoptions table td:hover {
border: 1px solid blue;
}
.divoptions table td a {
text-decoration:none;
display:block;
width:100%;
}
.editable {
cursor:pointer;
background: url(<?php echo JUri::base(); ?>components/com_xmap/assets/images/arrow.gif) top right no-repeat;
padding-right:18px;
padding-right:18px;
border:1px solid #ffffff;
}
.editable:hover {
border-color:#cccccc;
}
#title {
float:left;
display:inline-block;
width:29%;
}
#instructions {
float:left;
display:inline-block;
font-size: 11px;
width:70%;
margin-bottom:10px;
}
#instructions>div {
border-radius: 5px;
padding: 10px;
background-color: #ccc;
}
#filter_options form { margin:0; }
#filter_options {border-radius: 5px; background-color:#fff;padding: 3px;}
.toggle-excluded {
width: 16px; height: 16px; display: inline-block; float: left; cursor: pointer;margin-right: 5px;
background: url(<?php echo JUri::base(); ?>components/com_xmap/assets/images/tick.png) no-repeat;
}
.excluded {
text-decoration:line-through;
}
.excluded .toggle-excluded {
background: url(<?php echo JUri::base(); ?>components/com_xmap/assets/images/unpublished.png) no-repeat;
}
div.imagelist {
border: 1px solid #ccc;
background-color: #eee;
padding: 5px;
width: auto;float:left;
}
span.images_count {
border: 1px solid #004080;
background-color: #0000FF;
color: #fff;
margin: 0 5px;
cursor: pointer;
padding:2px;
float: left;
}
<?php $doc = JFactory::getDocument(); if ($doc->direction == 'rtl') { ?>
body {
font-family: Tahoma;
}
body #header {
direction: rtl;
}
#title {
float: right;
}
<?php } ?>
-->
]]>
</style>
<script language="JavaScript">
<![CDATA[
var selectedColor = "blue";
var defaultColor = "black";
var hdrRows = 1;
var numeric = '..';
var desc = '..';
var html = '..';
var freq = '..';
function initXsl(tabName,fileType) {
hdrRows = 1;
if(fileType=="sitemap") {
numeric = ".3.";
desc = ".1.";
html = ".0.";
freq = ".2.";
initTable(tabName);
setSort(tabName, 0, 1);
}
else {
desc = ".1.";
html = ".0.";
initTable(tabName);
setSort(tabName, 0, 1);
}
}
function initTable(tabName) {
var theTab = document.getElementById(tabName);
for(r=0;r<hdrRows;r++)
for(c=0;c<theTab.rows[r].cells.length;c++)
if((r+theTab.rows[r].cells[c].rowSpan)>hdrRows)
hdrRows=r+theTab.rows[r].cells[c].rowSpan;
for(r=0;r<hdrRows; r++){
colNum = 0;
for(c=0;c<theTab.rows[r].cells.length;c++, colNum++){
if(theTab.rows[r].cells[c].colSpan<2){
theCell = theTab.rows[r].cells[c];
rTitle = theCell.innerHTML.replace(/<[^>]+>| /g,'');
if(rTitle>""){
theCell.title = "Change sort order for " + rTitle;
theCell.onmouseover = function(){setCursor(this, "selected")};
theCell.onmouseout = function(){setCursor(this, "default")};
var sortParams = 15; // bitmapped: numeric|desc|html|freq
if(numeric.indexOf("."+colNum+".")>-1) sortParams -= 1;
if(desc.indexOf("."+colNum+".")>-1) sortParams -= 2;
if(html.indexOf("."+colNum+".")>-1) sortParams -= 4;
if(freq.indexOf("."+colNum+".")>-1) sortParams -= 8;
theCell.onclick = new Function("sortTable(this,"+(colNum+r)+","+hdrRows+","+sortParams+")");
}
} else {
colNum = colNum+theTab.rows[r].cells[c].colSpan-1;
}
}
}
}
function setSort(tabName, colNum, sortDir) {
var theTab = document.getElementById(tabName);
theTab.rows[0].sCol = colNum;
theTab.rows[0].sDir = sortDir;
if (sortDir)
theTab.rows[0].cells[colNum].className='sortdown'
else
theTab.rows[0].cells[colNum].className='sortup';
}
function setCursor(theCell, mode){
rTitle = theCell.innerHTML.replace(/<[^>]+>| |\W/g,'');
if(mode=="selected"){
if(theCell.style.color!=selectedColor)
defaultColor = theCell.style.color;
theCell.style.color = selectedColor;
theCell.style.cursor = "pointer";
window.status = "Click to sort by '"+rTitle+"'";
} else {
theCell.style.color = defaultColor;
theCell.style.cursor = "";
window.status = "";
}
}
function sortTable(theCell, colNum, hdrRows, sortParams){
var typnum = !(sortParams & 1);
sDir = !(sortParams & 2);
var typhtml = !(sortParams & 4);
var typfreq = !(sortParams & 8);
var tBody = theCell.parentNode;
while(tBody.nodeName!="TBODY"){
tBody = tBody.parentNode;
}
var tabOrd = new Array();
if(tBody.rows[0].sCol==colNum) sDir = !tBody.rows[0].sDir;
if (tBody.rows[0].sCol>=0)
tBody.rows[0].cells[tBody.rows[0].sCol].className='';
tBody.rows[0].sCol = colNum;
tBody.rows[0].sDir = sDir;
if (sDir)
tBody.rows[0].cells[colNum].className='sortdown'
else
tBody.rows[0].cells[colNum].className='sortup';
for(i=0,r=hdrRows;r<tBody.rows.length;i++,r++){
colCont = tBody.rows[r].cells[colNum].innerHTML;
if(typhtml) colCont = colCont.replace(/<[^>]+>/g,'');
if(typnum) {
colCont*=1;
if(isNaN(colCont)) colCont = 0;
}
if(typfreq) {
switch(colCont.toLowerCase()) {
case "always": { colCont=0; break; }
case "hourly": { colCont=1; break; }
case "daily": { colCont=2; break; }
case "weekly": { colCont=3; break; }
case "monthly": { colCont=4; break; }
case "yearly": { colCont=5; break; }
case "never": { colCont=6; break; }
}
}
tabOrd[i] = [r, tBody.rows[r], colCont];
}
tabOrd.sort(compRows);
for(i=0,r=hdrRows;r<tBody.rows.length;i++,r++){
tBody.insertBefore(tabOrd[i][1],tBody.rows[r]);
}
window.status = "";
}
function compRows(a, b){
if(sDir){
if(a[2]>b[2]) return -1;
if(a[2]<b[2]) return 1;
} else {
if(a[2]>b[2]) return 1;
if(a[2]<b[2]) return -1;
}
return 0;
}
<?php if ($this->canEdit): ?>
var divOptions=null;
function showOptions (cell,options,uid,itemid,e) {
// var div = document.getElementById('div'+options);
var div = $('div'+options);
pos = div.getPosition();
if ( divOptions != null && div != divOptions ) {
closeOptions();
}
var myCell = $(cell);
div.style.top = (myCell.getTop()+20)+'px';
div.style.left = myCell.getLeft()+'px';
var dimensions = myCell.getSize();
div.style.width=dimensions.x+'px';
div.style.display='';
div.uid=uid;
div.itemid=itemid;
div.cell=myCell;
divOptions=div;
}
function closeOptions() {
divOptions.style.display='none';
divOptions=null;
}
function changeProperty(el,property) {
new Request.JSON({
url: '<?php echo JRoute::_('index.php?option=com_xmap&format=json&task=ajax.editElement&action=changeProperty',false); ?>',
onComplete: checkChangeResult.bind(divOptions),
method: 'get'
}).send('<?php echo JSession::getFormToken(); ?>=1&id='+sitemapid+'&uid='+divOptions.uid+'&itemid='+divOptions.itemid+'&property='+property+'&value='+el.innerHTML);
divOptions.cell.innerHTML=el.innerHTML;
divOptions.style.display='none';
return false;
}
function toggleExcluded(el,itemid, uid){
row = $(el).getParent('tr');
new Request.JSON({
url: '<?php echo JRoute::_('index.php?option=com_xmap&format=json&task=ajax.editElement&action=toggleElement',false); ?>',
onComplete: checkToggleExcluded.bind(row),
method: 'get'
}).send('<?php echo JSession::getFormToken(); ?>=1&id='+sitemapid+'&uid='+uid+'&itemid='+itemid);
}
function checkChangeResult(result,xmlResponse) {
}
function checkToggleExcluded(result,xmlResponse) {
if (result.result == 'OK') {
if (result.state == 1) {
this.removeClass('excluded');
} else {
this.addClass('excluded');
}
}
}
<?php endif; ?>
window.addEvent('domready',function(){
$$('div.imagelist').each(function(div){
div.slide = new Fx.Slide(div).hide();
})
$$('span.images_count').each(function(span){
span.addEvent('click',function(){
$(this.parentNode).getElement('div.imagelist').slide.toggle();
});
})
});
var sitemapid=<?php echo $this->item->id; ?>;
]]>
</script>
</head>
<body onLoad="initXsl('table0','sitemap');">
<div id="header">
<div id="title">
<h1 id="head1"><?php echo $this->item->title; ?></h1>
<span class="number_urls"><?php echo JText::_('COM_XMAP_NUMBER_OF_URLS'); ?>: <xsl:value-of select="count(xna:urlset/xna:url)"></xsl:value-of></span>
</div>
<div id="instructions">
<div>
<?php $sitemapUrl = 'index.php?option=com_xmap&view=xml&id='.$this->item->id; ?>
<?php if (!$this->user->get('id')): ?>
<p><?php echo JText::sprintf('COM_XMAP_LOGIN_AS_ADMIN_EDIT_SITEMAP', JRoute::_('index.php?option=com_users&view=login&return='.base64_encode($sitemapUrl))); ?></p>
<?php else: ?>
<?php $sitemapUrl = JUri::base(true).'/'.str_replace('&','&',$sitemapUrl); ?>
<p><?php echo JText::_('COM_XMAP_XML_SITEMAP_HELP'); ?></p>
<p dir="ltr"><b><?php echo JText::_('COM_XMAP_XML_SITEMAP_URL'); ?></b>: <?php echo $sitemapUrl; ?></p>
<div id="filter_options">
<form method="get" action="<?php echo JRoute::_('index.php?option=com_xmap&view=xml'); ?>">
<input type="hidden" name="option" value="com_xmap" />
<input type="hidden" name="view" value="xml" />
<input type="hidden" name="id" value="<?php echo $this->item->id; ?>" />
<label><input onClick="this.form.submit();"<?php echo ($showTitle? ' checked="checked"':''); ?> type="checkbox" value="1" name="filter_showtitle" /><?php echo JText::_('COM_XMAP_DISPLAY_TITLE'); ?></label>
<label><input onClick="this.form.submit();"<?php echo ($showExcluded? ' checked="checked"':''); ?> type="checkbox" value="1" name="filter_showexcluded" /><?php echo JText::_('COM_XMAP_DISPLAY_EXCLUDED_ITEMS'); ?></label>
</form>
</div>
<?php endif; ?>
</div>
</div>
<div style="width:100%;clear:both;height:1px;"></div>
</div>
<table id="table0" class="data">
<tr class="header">
<td><?php echo ($showTitle? JText::_('COM_XMAP_TITLE').' / ' : ''); ?><?php echo JText::_('COM_XMAP_URL'); ?></td>
<?php if (!$this->isImages): ?>
<td><?php echo JText::_('COM_XMAP_LASTMOD'); ?></td>
<td><?php echo JText::_('COM_XMAP_CHANGEFREQ'); ?></td>
<td><?php echo JText::_('COM_XMAP_PRIORITY'); ?></td>
<?php endif ?>
</tr>
<xsl:for-each select="xna:urlset/xna:url">
<?php if ($this->canEdit): ?>
<xsl:variable name="rowclass"><xsl:value-of select="xna:rowclass"/></xsl:variable>
<xsl:variable name="UID"><xsl:value-of select="xna:uid"/></xsl:variable>
<xsl:variable name="ItemID"><xsl:value-of select="xna:itemid"/></xsl:variable>
<?php else: ?>
<xsl:variable name="rowclass"></xsl:variable>
<?php endif; ?>
<tr class="{$rowclass}">
<td><?php if ($this->canEdit): ?><span class="toggle-excluded" onClick="toggleExcluded(this,'{$ItemID}','{$UID}')"></span><?php endif; ?>
<xsl:if test="count(image:image/image:loc) > 0">
<span class="images_count"><xsl:value-of select="count(image:image/image:loc)"></xsl:value-of> Images</span>
</xsl:if>
<xsl:variable name="sitemapURL"><xsl:value-of select="xna:loc"/></xsl:variable>
<div class="item_title"><xsl:value-of select="xna:title"/></div>
<a href="{$sitemapURL}" target="_blank" ref="nofollow"><xsl:value-of select="$sitemapURL"></xsl:value-of></a>
<xsl:if test="count(image:image/image:loc) > 0">
<div class="imagelist">
<xsl:for-each select="image:image">
<xsl:value-of select="image:loc"/> - <xsl:value-of select="image:title"/><br />
</xsl:for-each>
</div>
</xsl:if>
</td>
<?php if (!$this->isImages): ?>
<td><xsl:value-of select="xna:lastmod"/></td>
<?php if ($this->canEdit): ?>
<td class="editable" onClick="showOptions(this,'changefreq','{$UID}','{$ItemID}',event);" ><xsl:value-of select="xna:changefreq"/></td>
<td class="editable" onClick="showOptions(this,'priority','{$UID}','{$ItemID}',event);"><xsl:value-of select="xna:priority"/></td>
<?php else: ?>
<td><xsl:value-of select="xna:changefreq"/></td>
<td><xsl:value-of select="xna:priority"/></td>
<?php endif; ?>
<?php endif; ?>
</tr>
</xsl:for-each>
</table>
<div id="divchangefreq" class="divoptions" style="display:none;">
<div align="right"><a href="javascript:closeOptions();">x</a></div>
<table>
<tr><td><a href="#" onClick="return changeProperty(this,'changefreq');">always</a></td></tr>
<tr><td><a href="#" onClick="return changeProperty(this,'changefreq');">hourly</a></td></tr>
<tr><td><a href="#" onClick="return changeProperty(this,'changefreq');">daily</a></td></tr>
<tr><td><a href="#" onClick="return changeProperty(this,'changefreq');">weekly</a></td></tr>
<tr><td><a href="#" onClick="return changeProperty(this,'changefreq');">monthly</a></td></tr>
<tr><td><a href="#" onClick="return changeProperty(this,'changefreq');">yearly</a></td></tr>
<tr><td><a href="#" onClick="return changeProperty(this,'changefreq');">never</a></td></tr>
</table>
</div>
<div id="divpriority" class="divoptions" style="display:none;">
<div align="right"><a href="#" onClick="return closeOptions();">x</a></div>
<table>
<tr><td><a href="#" onClick="return changeProperty(this,'priority');">0</a></td></tr>
<tr><td><a href="#" onClick="return changeProperty(this,'priority');">0.1</a></td></tr>
<tr><td><a href="#" onClick="return changeProperty(this,'priority');">0.2</a></td></tr>
<tr><td><a href="#" onClick="return changeProperty(this,'priority');">0.3</a></td></tr>
<tr><td><a href="#" onClick="return changeProperty(this,'priority');">0.4</a></td></tr>
<tr><td><a href="#" onClick="return changeProperty(this,'priority');">0.5</a></td></tr>
<tr><td><a href="#" onClick="return changeProperty(this,'priority');">0.6</a></td></tr>
<tr><td><a href="#" onClick="return changeProperty(this,'priority');">0.7</a></td></tr>
<tr><td><a href="#" onClick="return changeProperty(this,'priority');">0.8</a></td></tr>
<tr><td><a href="#" onClick="return changeProperty(this,'priority');">0.9</a></td></tr>
<tr><td><a href="#" onClick="return changeProperty(this,'priority');">1</a></td></tr>
</table>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>PK y[$]�6� views/xml/index.htmlnu &1i� <!DOCTYPE html><title></title>PK y[$]�PJ� � views/xml/view.html.phpnu &1i� <?php
/**
* @version $Id$
* @copyright Copyright (C) 2005 - 2009 Joomla! Vargas. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @author Guillermo Vargas (guille@vargas.co.cr)
*/
// No direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport('joomla.application.component.view');
# For compatibility with older versions of Joola 2.5
if (!class_exists('JViewLegacy')){
class JViewLegacy extends JView {
}
}
/**
* XML Sitemap View class for the Xmap component
*
* @package Xmap
* @subpackage com_xmap
* @since 2.0
*/
class XmapViewXml extends JViewLegacy
{
protected $state;
protected $print;
protected $_obLevel;
function display($tpl = null)
{
// Initialise variables.
$app = JFactory::getApplication();
$this->user = JFactory::getUser();
$isNewsSitemap = JRequest::getInt('news',0);
$this->isImages = JRequest::getInt('images',0);
$model = $this->getModel('Sitemap');
$this->setModel($model);
// force to not display errors on XML sitemap
@ini_set('display_errors', 0);
# Increase memory and max execution time for XML sitemaps to make it work
# with very large sites
@ini_set('memory_limit','512M');
@ini_set('max_execution_time',300);
$layout = $this->getLayout();
$this->item = $this->get('Item');
$this->state = $this->get('State');
$this->canEdit = JFactory::getUser()->authorise('core.admin', 'com_xmap');
// For now, news sitemaps are not editable
$this->canEdit = $this->canEdit && !$isNewsSitemap;
if ($layout == 'xsl') {
return $this->displayXSL($layout);
}
// Get model data.
$this->items = $this->get('Items');
$this->sitemapItems = $this->get('SitemapItems');
$this->extensions = $this->get('Extensions');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
JError::raiseWarning(500, implode("\n", $errors));
return false;
}
// Add router helpers.
$this->item->slug = $this->item->alias ? ($this->item->id . ':' . $this->item->alias) : $this->item->id;
$this->item->rlink = JRoute::_('index.php?option=com_xmap&view=xml&id=' . $this->item->slug);
// Create a shortcut to the paramemters.
$params = &$this->state->params;
$offset = $this->state->get('page.offset');
if (!$this->item->params->get('access-view')) {
if ($this->user->get('guest')) {
// Redirect to login
$uri = JFactory::getURI();
$app->redirect(
'index.php?option=com_users&view=login&return=' . base64_encode($uri),
JText::_('Xmap_Error_Login_to_view_sitemap')
);
return;
} else {
JError::raiseWarning(403, JText::_('Xmap_Error_Not_auth'));
return;
}
}
// Override the layout.
if ($layout = $params->get('layout')) {
$this->setLayout($layout);
}
// Load the class used to display the sitemap
$this->loadTemplate('class');
$this->displayer = new XmapXmlDisplayer($params, $this->item);
$this->displayer->setJView($this);
$this->displayer->isNews = $isNewsSitemap;
$this->displayer->isImages = $this->isImages;
$this->displayer->canEdit = $this->canEdit;
$doCompression = ($this->item->params->get('compress_xml') && !ini_get('zlib.output_compression') && ini_get('output_handler') != 'ob_gzhandler');
$this->endAllBuffering();
if ($doCompression) {
ob_start();
}
parent::display($tpl);
$model = $this->getModel();
$model->hit($this->displayer->getCount());
if ($doCompression) {
$data = ob_get_contents();
JResponse::setBody($data);
@ob_end_clean();
echo JResponse::toString(true);
}
$this->recreateBuffering();
exit;
}
function displayXSL()
{
$this->setLayout('default');
$this->endAllBuffering();
parent::display('xsl');
$this->recreateBuffering();
exit;
}
private function endAllBuffering()
{
$this->_obLevel = ob_get_level();
$level = FALSE;
while (ob_get_level() > 0 && $level !== ob_get_level()) {
@ob_end_clean();
$level = ob_get_level();
}
}
private function recreateBuffering()
{
while($this->_obLevel--) {
ob_start();
}
}
}
PK y[$]��
� � views/html/metadata.xmlnu &1i� <?xml version="1.0" encoding="utf-8"?>
<metadata>
<view title="Sitemap">
<message>
<![CDATA[COM_XMAP_SITEMAP_HTML_VIEW_DEFAULT_DESC]]>
</message>
</view>
</metadata>
PK y[$]t��� � views/html/view.html.phpnu &1i� <?php
/**
* @version $Id$
* @copyright Copyright (C) 2005 - 2009 Joomla! Vargas. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @author Guillermo Vargas (guille@vargas.co.cr)
*/
// No direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
jimport('joomla.application.component.view');
# For compatibility with older versions of Joola 2.5
if (!class_exists('JViewLegacy')){
class JViewLegacy extends JView {
}
}
/**
* HTML Site map View class for the Xmap component
*
* @package Xmap
* @subpackage com_xmap
* @since 2.0
*/
class XmapViewHtml extends JViewLegacy
{
protected $state;
protected $print;
function display($tpl = null)
{
// Initialise variables.
$this->app = JFactory::getApplication();
$this->user = JFactory::getUser();
$doc = JFactory::getDocument();
// Get view related request variables.
$this->print = JRequest::getBool('print');
// Get model data.
$this->state = $this->get('State');
$this->item = $this->get('Item');
$this->items = $this->get('Items');
$this->canEdit = JFactory::getUser()->authorise('core.admin', 'com_xmap');
// Check for errors.
if (count($errors = $this->get('Errors'))) {
JError::raiseWarning(500, implode("\n", $errors));
return false;
}
$this->extensions = $this->get('Extensions');
// Add router helpers.
$this->item->slug = $this->item->alias ? ($this->item->id . ':' . $this->item->alias) : $this->item->id;
$this->item->rlink = JRoute::_('index.php?option=com_xmap&view=html&id=' . $this->item->slug);
// Create a shortcut to the paramemters.
$params = &$this->state->params;
$offset = $this->state->get('page.offset');
if ($params->get('include_css', 0)){
$doc->addStyleSheet(JURI::root().'components/com_xmap/assets/css/xmap.css');
}
// If a guest user, they may be able to log in to view the full article
// TODO: Does this satisfy the show not auth setting?
if (!$this->item->params->get('access-view')) {
if ($user->get('guest')) {
// Redirect to login
$uri = JFactory::getURI();
$app->redirect(
'index.php?option=com_users&view=login&return=' . base64_encode($uri),
JText::_('Xmap_Error_Login_to_view_sitemap')
);
return;
} else {
JError::raiseWarning(403, JText::_('Xmap_Error_Not_auth'));
return;
}
}
// Override the layout.
if ($layout = $params->get('layout')) {
$this->setLayout($layout);
}
// Load the class used to display the sitemap
$this->loadTemplate('class');
$this->displayer = new XmapHtmlDisplayer($params, $this->item);
$this->displayer->setJView($this);
$this->displayer->canEdit = $this->canEdit;
$this->_prepareDocument();
parent::display($tpl);
$model = $this->getModel();
$model->hit($this->displayer->getCount());
}
/**
* Prepares the document
*/
protected function _prepareDocument()
{
$app = JFactory::getApplication();
$pathway = $app->getPathway();
$menus = $app->getMenu();
$title = null;
// Because the application sets a default page title, we need to get it from the menu item itself
if ($menu = $menus->getActive()) {
if (isset($menu->query['view']) && isset($menu->query['id'])) {
if ($menu->query['view'] == 'html' && $menu->query['id'] == $this->item->id) {
$title = $menu->title;
if (empty($title)) {
$title = $app->getCfg('sitename');
} else if ($app->getCfg('sitename_pagetitles', 0) == 1) {
$title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title);
} else if ($app->getCfg('sitename_pagetitles', 0) == 2) {
$title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename'));
}
// set meta description and keywords from menu item's params
$params = new JRegistry();
$params->loadString($menu->params);
$this->document->setDescription($params->get('menu-meta_description'));
$this->document->setMetadata('keywords', $params->get('menu-meta_keywords'));
}
}
}
$this->document->setTitle($title);
if ($app->getCfg('MetaTitle') == '1') {
$this->document->setMetaData('title', $title);
}
if ($this->print) {
$this->document->setMetaData('robots', 'noindex, nofollow');
}
}
}
PK y[$]�6� views/html/index.htmlnu &1i� <!DOCTYPE html><title></title>PK y[$]���Q� � ! views/html/tmpl/default_class.phpnu &1i� <?php
/**
* @version $Id$
* @copyright Copyright (C) 2005 - 2009 Joomla! Vargas. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @author Guillermo Vargas (guille@vargas.co.cr)
*/
// No direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
require_once(JPATH_COMPONENT.'/displayer.php');
class XmapHtmlDisplayer extends XmapDisplayer {
var $level = -1;
var $_openList = '';
var $_closeList = '';
var $_closeItem = '';
var $_childs;
var $_width;
var $live_site = 0;
function __construct ($config, $sitemap) {
$this->view = 'html';
parent::__construct($config, $sitemap);
$this->_parent_children=array();
$this->_last_child=array();
$this->live_site = substr_replace(JURI::root(), "", -1, 1);
$user = JFactory::getUser();
}
function setJView($view)
{
parent::setJView($view);
$columns = $this->sitemap->params->get('columns',0);
if( $columns > 1 ) { // calculate column widths
$total = count($view->items);
$columns = $total < $columns? $total : $columns;
$this->_width = (100 / $columns) - 1;
$this->sitemap->params->set('columns',$columns);
}
}
/**
* Prints one node of the sitemap
*
*
* @param object $node
* @return boolean
*/
function printNode( &$node )
{
$out = '';
if ($this->isExcluded($node->id,$node->uid) && !$this->canEdit) {
return FALSE;
}
// To avoid duplicate children in the same parent
if ( !empty($this->_parent_children[$this->level][$node->uid]) ) {
return FALSE;
}
//var_dump($this->_parent_children[$this->level]);
$this->_parent_children[$this->level][$node->uid] = true;
$out .= $this->_closeItem;
$out .= $this->_openList;
$this->_openList = "";
$out .= '<li>';
if( !isset($node->browserNav) )
$node->browserNav = 0;
if ($node->browserNav != 3) {
$link = JRoute::_($node->link, true, @$node->secure);
}
$node->name = htmlspecialchars($node->name);
switch( $node->browserNav ) {
case 1: // open url in new window
$ext_image = '';
if ( $this->sitemap->params->get('exlinks') ) {
$ext_image = ' <img src="'. $this->live_site .'/components/com_xmap/assets/images/'. $this->sitemap->params->get('exlinks') .'" alt="' . JText::_('COM_XMAP_SHOW_AS_EXTERN_ALT') . '" title="' . JText::_('COM_XMAP_SHOW_AS_EXTERN_ALT') . '" border="0" />';
}
$out .= '<a href="'. $link .'" title="'. htmlspecialchars($node->name) .'" target="_blank">'. $node->name . $ext_image .'</a>';
break;
case 2: // open url in javascript popup window
$ext_image = '';
if( $this->sitemap->params->get('exlinks') ) {
$ext_image = ' <img src="'. $this->live_site .'/components/com_xmap/assets/images/'. $this->sitemap->params->get('exlinks') .'" alt="' . JText::_('COM_XMAP_SHOW_AS_EXTERN_ALT') . '" title="' . JText::_('COM_XMAP_SHOW_AS_EXTERN_ALT') . '" border="0" />';
}
$out .= '<a href="'. $link .'" title="'. $node->name .'" target="_blank" '. "onClick=\"javascript: window.open('". $link ."', '', 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=780,height=550'); return false;\">". $node->name . $ext_image."</a>";
break;
case 3: // no link
$out .= '<span>'. $node->name .'</span>';
break;
default: // open url in parent window
$out .= '<a href="'. $link .'" title="'. $node->name .'">'. $node->name .'</a>';
break;
}
$this->_closeItem = "</li>\n";
$this->_childs[$this->level]++;
echo $out;
if ($this->canEdit) {
if ( $this->isExcluded($node->id,$node->uid) ) {
$img = '<img src="'.$this->live_site.'/components/com_xmap/assets/images/unpublished.png" alt="v" title="'.JText::_('JUNPUBLISHED').'">';
$class= 'xmapexclon';
} else {
$img = '<img src="'.$this->live_site.'/components/com_xmap/assets/images/tick.png" alt="x" title="'.JText::_('JPUBLISHED').'" />';
$class= 'xmapexcloff';
}
echo ' <a href= "#" class="xmapexcl '.$class.'" rel="{uid:\''.$node->uid.'\',itemid:'.$node->id.'}">'.$img.'</a>';
}
$this->count++;
$this->_last_child[$this->level] = $node->uid;
return TRUE;
}
/**
* Moves sitemap level up or down
*/
function changeLevel( $level ) {
if ( $level > 0 ) {
# We do not print start ul here to avoid empty list, it's printed at the first child
$this->level += $level;
$this->_childs[$this->level]=0;
$this->_openList = "\n<ul class=\"level_".$this->level."\">\n";
$this->_closeItem = '';
// If we are moving up, then lets clean the children of this level
// because for sure this is a new set of links
if ( empty ($this->_last_child[$this->level-1]) || empty ($this->_parent_children[$this->level]['parent']) || $this->_parent_children[$this->level]['parent'] != $this->_last_child[$this->level-1] ) {
$this->_parent_children[$this->level]=array();
$this->_parent_children[$this->level]['parent'] = @$this->_last_child[$this->level-1];
}
} else {
if ($this->_childs[$this->level]){
echo $this->_closeItem."</ul>\n";
}
$this->_closeItem ='</li>';
$this->_openList = '';
$this->level += $level;
}
}
function startMenu(&$menu) {
if( $this->sitemap->params->get('columns') > 1 ) // use columns
echo '<div style="float:left;width:'.$this->_width.'%;">';
if( $this->sitemap->params->get('show_menutitle') ) // show menu titles
echo '<h2 class="menutitle">'.$menu->name.'</h2>';
}
function endMenu(&$menu) {
$sitemap=&$this->sitemap;
$this->_closeItem='';
if( $sitemap->params->get('columns')> 1 ) {
echo "</div>\n";
}
}
}
PK y[$]�6� views/html/tmpl/index.htmlnu &1i� <!DOCTYPE html><title></title>PK y[$]*�.` ` views/html/tmpl/default.phpnu &1i� <?php
/**
* @version $Id$
* @copyright Copyright (C) 2005 - 2009 Joomla! Vargas. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @author Guillermo Vargas (guille@vargas.co.cr)
*/
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers');
// Create shortcut to parameters.
$params = $this->item->params;
if ($this->displayer->canEdit) {
$live_site = JURI::root();
JHTML::_('behavior.framework', true);
$ajaxurl = "{$live_site}index.php?option=com_xmap&format=json&task=ajax.editElement&action=toggleElement&".JSession::getFormToken().'=1';
$css = '.xmapexcl img{ border:0px; }'."\n";
$css .= '.xmapexcloff { text-decoration:line-through; }';
//$css .= "\n.".$this->item->classname .' li {float:left;}';
$js = "
window.addEvent('domready',function (){
$$('.xmapexcl').each(function(el){
el.onclick = function(){
if (this && this.rel) {
options = JSON.decode(this.rel);
this.onComplete = checkExcludeResult
var myAjax = new Request.JSON({
url:'{$ajaxurl}',
onSuccess: checkExcludeResult.bind(this)
}).get({id:{$this->item->id},uid:options.uid,itemid:options.itemid});
}
return false;
};
});
});
checkExcludeResult = function (response) {
//this.set('class','xmapexcl xmapexcloff');
var imgs = this.getElementsByTagName('img');
if (response.result == 'OK') {
var state = response.state;
if (state==0) {
imgs[0].src='{$live_site}/components/com_xmap/assets/images/unpublished.png';
} else {
imgs[0].src='{$live_site}/components/com_xmap/assets/images/tick.png';
}
} else {
alert('The element couldn\\'t be published or upublished!');
}
}";
$doc = JFactory::getDocument();
$doc->addStyleDeclaration ($css);
$doc->addScriptDeclaration ($js);
}
?>
<div id="xmap">
<?php if ($params->get('show_page_heading', 1) && $params->get('page_heading') != '') : ?>
<h1>
<?php echo $this->escape($params->get('page_heading')); ?>
</h1>
<?php endif; ?>
<?php if ($params->get('access-edit') || $params->get('show_title') || $params->get('show_print_icon') || $params->get('show_email_icon')) : ?>
<ul>
<?php if (!$this->print) : ?>
<?php if ($params->get('show_print_icon')) : ?>
<li>
<?php echo JHtml::_('icon.print_popup', $this->item, $params); ?>
</li>
<?php endif; ?>
<?php if ($params->get('show_email_icon')) : ?>
<li>
<?php echo JHtml::_('icon.email', $this->item, $params); ?>
</li>
<?php endif; ?>
<?php else : ?>
<li>
<?php echo JHtml::_('icon.print_screen', $this->item, $params); ?>
</li>
<?php endif; ?>
</ul>
<?php endif; ?>
<?php if ($params->get('showintro', 1) ) : ?>
<?php echo $this->item->introtext; ?>
<?php endif; ?>
<?php echo $this->loadTemplate('items'); ?>
<?php if ($params->get('include_link', 1) ) : ?>
<div class="muted" style="font-size:10px;width:100%;clear:both;text-align:center;">Powered by <a href="http://www.jooxmap.com/">Xmap</a></div>
<?php endif; ?>
<span class="article_separator"> </span>
</div>PK y[$]�@
d� � ! views/html/tmpl/default_items.phpnu &1i� <?php
/**
* @version $Id$
* @copyright Copyright (C) 2005 - 2009 Joomla! Vargas. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @author Guillermo Vargas (guille@vargas.co.cr)
*/
// no direct access
defined('_JEXEC') or die;
// Create shortcut to parameters.
$params = $this->state->get('params');
// Use the class defined in default_class.php to print the sitemap
$this->displayer->printSitemap();PK y[$]L�4w� � views/html/tmpl/default.xmlnu &1i� <?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_XMAP_SITEMAP_HTML_VIEW_DEFAULT_TITLE">
<message>
<![CDATA[COM_XMAP_SITEMAP_HTML_VIEW_DEFAULT_DESC]]>
</message>
</layout>
<fields name="request">
<fieldset name="request"
addfieldpath="/administrator/components/com_xmap/models/fields">
<field
name="id"
type="modal_sitemaps"
default=""
required="true"
label="COM_XMAP_SELECT_AN_SITEMAP"
description="COM_XMAP_SELECT_A_SITEMAP" />
</fieldset>
</fields>
<!-- Add fields to the parameters object for the layout. -->
<fields name="params">
<!-- Basic options. -->
<fieldset name="basic"
label="COM_XMAP_ATTRIBS_SITEMAP_SETTINGS_LABEL">
<field
name="include_css"
type="list"
default="0"
label="COM_XMAP_INCLUDE_CSS_LABEL"
description="COM_XMAP_INCLUDE_CSS_DESC">
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
</fieldset>
</fields>
</metadata>
PK y[$]f��>