Your IP : 216.73.217.68


Current Path : /home/w/u/e/wuectly/www/03cbe/
Upload File :
Current File : /home/w/u/e/wuectly/www/03cbe/com_xmap.tar

index.html000060400000000036152455302450006541 0ustar00<!DOCTYPE html><title></title>xmap.php000060400000001327152455302450006226 0ustar00<?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();
views/index.html000060400000000036152455302450007676 0ustar00<!DOCTYPE html><title></title>views/xml/metadata.xml000060400000000265152455302450011007 0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
    <view title="XML SITEMAP">
        <message>
            <![CDATA[TYPEXMLLAYDESC]]>
        </message>
    </view>
</metadata>
views/xml/tmpl/default.php000060400000003153152455302450011615 0ustar00<?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  = '&amp;filter_showtitle='.JRequest::getBool('filter_showtitle',0);
    $params .= '&amp;filter_showexcluded='.JRequest::getBool('filter_showexcluded',0);
    $params .= (JRequest::getCmd('lang')?'&amp;lang='.JRequest::getCmd('lang'):'');
    echo '<?xml-stylesheet type="text/xsl" href="'. $live_site.'/index.php?option=com_xmap&amp;view=xml&amp;layout=xsl&amp;tmpl=component&amp;id='.$this->item->id.($this->isImages?'&amp;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>views/xml/tmpl/default_items.php000060400000001007152455302450013012 0ustar00<?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();views/xml/tmpl/index.html000060400000000036152455302450011452 0ustar00<!DOCTYPE html><title></title>views/xml/tmpl/default_class.php000060400000017601152455302450013005 0ustar00<?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('&', '&amp;', 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('&', '&amp;',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;
    }
}
views/xml/tmpl/default_xsl.php000060400000046143152455302450012511 0ustar00<?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(/<[^>]+>|&nbsp;/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(/<[^>]+>|&nbsp;|\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('&','&amp;',$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) &gt; 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) &gt; 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>views/xml/index.html000060400000000036152455302450010476 0ustar00<!DOCTYPE html><title></title>views/xml/view.html.php000060400000011347152455302450011136 0ustar00<?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();
        }
    }

}
views/html/metadata.xml000060400000000312152455302450011144 0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
    <view title="Sitemap">
        <message>
            <![CDATA[COM_XMAP_SITEMAP_HTML_VIEW_DEFAULT_DESC]]>
        </message>
    </view>
</metadata>
views/html/view.html.php000060400000011747152455302450011306 0ustar00<?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');
        }
    }

}
views/html/index.html000060400000000036152455302450010642 0ustar00<!DOCTYPE html><title></title>views/html/tmpl/default_class.php000060400000014670152455302450013154 0ustar00<?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 = '&nbsp;<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 = '&nbsp;<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";
        }
    }
}
views/html/tmpl/index.html000060400000000036152455302450011616 0ustar00<!DOCTYPE html><title></title>views/html/tmpl/default.php000060400000007140152455302450011761 0ustar00<?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">&nbsp;</span>
</div>views/html/tmpl/default_items.php000060400000000766152455302450013171 0ustar00<?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();views/html/tmpl/default.xml000060400000002314152455302450011770 0ustar00<?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>
metadata.xml000060400000000076152455302450007052 0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
</metadata>
router.php000060400000011213152455302450006574 0ustar00<?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)
 */
defined( '_JEXEC' ) or die( 'Restricted access' );
/**
 * Content Component Route Helper
 *
 * @package        Xmap
 * @subpackage    com_xmap
 * @since 2.0
 */
class XmapRoute
{

    /**
     * @param    int $id            The id of the article.
     * @param    int    $categoryId    An optional category id.
     *
     * @return    string    The routed link.
     */
    public static function sitemap($id, $view = 'html')
    {
        $needles = array(
            'html' => (int) $id
        );

        //Create the link
        $link = 'index.php?option=com_xmap&view='.$view.'&id='. $id;

        if ($itemId = self::_findItemId($needles)) {
            $link .= '&Itemid='.$itemId;
        };

        return $link;
    }


    protected static function _findItemId($needles)
    {
        // Prepare the reverse lookup array.
        if (self::$lookup === null)
        {
            self::$lookup = array();

            $component    = &JComponentHelper::getComponent('com_xmap');
            $menus        = &JApplication::getMenu('site', array());
            $items        = $menus->getItems('component_id', $component->id);

            foreach ($items as &$item)
            {
                if (isset($item->query) && isset($item->query['view']))
                {
                    $view = $item->query['view'];
                    if (!isset(self::$lookup[$view])) {
                        self::$lookup[$view] = array();
                    }
                    if (isset($item->query['id'])) {
                        self::$lookup[$view][$item->query['id']] = $item->id;
                    }
                }
            }
        }

        $match = null;

        foreach ($needles as $view => $id)
        {
            if (isset(self::$lookup[$view]))
            {
                if (isset(self::$lookup[$view][$id])) {
                    return self::$lookup[$view][$id];
                }
            }
        }

        return null;
    }
}

/**
 * Build the route for the com_content component
 *
 * @param    array    An array of URL arguments
 *
 * @return    array    The URL arguments to use to assemble the subsequent URL.
 */
function XmapBuildRoute(&$query)
{
    $segments = array();

    // get a menu item based on Itemid or currently active
    $app = JFactory::getApplication();
    $menu = $app->getMenu();

    if (empty($query['Itemid'])) {
        $menuItem = $menu->getActive();
    }
    else {
        $menuItem = $menu->getItem($query['Itemid']);
    }
    $mView    = (empty($menuItem->query['view'])) ? null : $menuItem->query['view'];
    $mId      = (empty($menuItem->query['id'])) ? null : $menuItem->query['id'];

    if ( !empty($query['Itemid']) ) {
        unset($query['view']);
        unset($query['id']);
    } else {
        if ( !empty($query['view']) ) {
             $segments[] = $query['view'];
        }
    }


    if (isset($query['id']))
    {
        if (empty($query['Itemid'])) {
            $segments[] = $query['id'];
        }
        else
        {
            if (isset($menuItem->query['id']))
            {
                if ($query['id'] != $mId) {
                    $segments[] = $query['id'];
                }
            }
            else {
                $segments[] = $query['id'];
            }
        }
        unset($query['id']);
    };

    if (isset($query['layout']))
    {
        if (!empty($query['Itemid']) && isset($menuItem->query['layout']))
        {
            if ($query['layout'] == $menuItem->query['layout']) {

                unset($query['layout']);
            }
        }
        else
        {
            if ($query['layout'] == 'default') {
                unset($query['layout']);
            }
        }
    };

    return $segments;
}

/**
 * Parse the segments of a URL.
 *
 * @param    array    The segments of the URL to parse.
 *
 * @return    array    The URL attributes to be used by the application.
 */
function XmapParseRoute($segments)
{
    $vars = array();

    //G et the active menu item.
    $app  = JFactory::getApplication();
    $menu = $app->getMenu();
    $item = $menu->getActive();

    // Count route segments
    $count = count($segments);

    // Standard routing for articles.
    if (!isset($item))
    {
        $vars['view'] = $segments[0];
        $vars['id']   = $segments[$count - 1];
        return $vars;
    }

    $vars['view'] = $item->query['view'];
    $vars['id']   = $item->query['id'];

    return $vars;
}
helpers/xmap.php000060400000020244152455302450007667 0ustar00<?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.database.query');

/**
 * Xmap Component Sitemap Model
 *
 * @package        Xmap
 * @subpackage     com_xmap
 * @since          2.0
 */
class XmapHelper
{

    public static function &getMenuItems($selections)
    {
        $db = JFactory::getDbo();
        $app = JFactory::getApplication();
        $user = JFactory::getUser();
        $list = array();

        foreach ($selections as $menutype => $menuOptions) {
            // Initialize variables.
            // Get the menu items as a tree.
            $query = $db->getQuery(true);
            $query->select(
                    'n.id, n.title, n.alias, n.path, n.level, n.link, '
                  . 'n.type, n.params, n.home, n.parent_id'
                  . ',n.'.$db->quoteName('browserNav')
                  );
            $query->from('#__menu AS n');
            $query->join('INNER', ' #__menu AS p ON p.lft = 0');
            $query->where('n.lft > p.lft');
            $query->where('n.lft < p.rgt');
            $query->order('n.lft');

            // Filter over the appropriate menu.
            $query->where('n.menutype = ' . $db->quote($menutype));

            // Filter over authorized access levels and publishing state.
            $query->where('n.published = 1');
            $query->where('n.access IN (' . implode(',', (array) $user->getAuthorisedViewLevels()) . ')');

            // Filter by language
            if ($app->getLanguageFilter()) {
                $query->where('n.language in ('.$db->quote(JFactory::getLanguage()->getTag()).','.$db->quote('*').')');
            }

            // Get the list of menu items.
            $db->setQuery($query);
            $tmpList = $db->loadObjectList('id');
            $list[$menutype] = array();

            // Check for a database error.
            if ($db->getErrorNum()) {
                JError::raiseWarning(021, $db->getErrorMsg());
                return array();
            }

            // Set some values to make nested HTML rendering easier.
            foreach ($tmpList as $id => $item) {
                $item->items = array();

                $params = new JRegistry($item->params);
                $item->uid = 'itemid'.$item->id;

                if (preg_match('#^/?index.php.*option=(com_[^&]+)#', $item->link, $matches)) {
                    $item->option = $matches[1];
                    $componentParams = clone(JComponentHelper::getParams($item->option));
                    $componentParams->merge($params);
                    //$params->merge($componentParams);
                    $params = $componentParams;
                } else {
                    $item->option = null;
                }

                $item->params = $params;

                if ($item->type != 'separator') {

                    $item->priority = $menuOptions['priority'];
                    $item->changefreq = $menuOptions['changefreq'];

                    XmapHelper::prepareMenuItem($item);
                } else {
                    $item->priority = null;
                    $item->changefreq = null;
                }

                if ($item->parent_id > 1) {
                    $tmpList[$item->parent_id]->items[$item->id] = $item;
                } else {
                    $list[$menutype][$item->id] = $item;
                }
            }
        }
        return $list;
    }

    public static function &getExtensions()
    {
        static $list;

        jimport('joomla.html.parameter');

        if ($list != null) {
            return $list;
        }
        $db = JFactory::getDBO();

        $list = array();
        // Get the menu items as a tree.
        $query = $db->getQuery(true);
        $query->select('*');
        $query->from('#__extensions AS n');
        $query->where('n.folder = \'xmap\'');
        $query->where('n.enabled = 1');

        // Get the list of menu items.
        $db->setQuery($query);
        $extensions = $db->loadObjectList('element');

        foreach ($extensions as $element => $extension) {
            if (file_exists(JPATH_PLUGINS . '/' . $extension->folder . '/' . $element. '/'. $element . '.php')) {
                require_once(JPATH_PLUGINS . '/' . $extension->folder . '/' . $element. '/'. $element . '.php');
                $params = new JRegistry($extension->params);
                $extension->params = $params->toArray();
                $list[$element] = $extension;
            }
        }

        return $list;
    }

    /**
     * Call the function prepareMenuItem of the extension for the item (if any)
     *
     * @param    object        Menu item object
     *
     * @return    void
     */
    public static function prepareMenuItem($item)
    {
        $extensions = XmapHelper::getExtensions();
        if (!empty($extensions[$item->option])) {
            $className = 'xmap_' . $item->option;
            $obj = new $className;
            if (method_exists($obj, 'prepareMenuItem')) {
                $obj->prepareMenuItem($item,$extensions[$item->option]->params);
            }
        }
    }


    static function getImages($text,$max)
    {
        if (!isset($urlBase)) {
            $urlBase = JURI::base();
            $urlBaseLen = strlen($urlBase);
        }

        $images = null;
        $matches = $matches1 = $matches2 = array();
        // Look <img> tags
        preg_match_all('/<img[^>]*?(?:(?:[^>]*src="(?P<src>[^"]+)")|(?:[^>]*alt="(?P<alt>[^"]+)")|(?:[^>]*title="(?P<title>[^"]+)"))+[^>]*>/i', $text, $matches1, PREG_SET_ORDER);
        // Loog for <a> tags with href to images
        preg_match_all('/<a[^>]*?(?:(?:[^>]*href="(?P<src>[^"]+\.(gif|png|jpg|jpeg))")|(?:[^>]*alt="(?P<alt>[^"]+)")|(?:[^>]*title="(?P<title>[^"]+)"))+[^>]*>/i', $text, $matches2, PREG_SET_ORDER);
        $matches = array_merge($matches1,$matches2);
        if (count($matches)) {
            $images = array();

            $count = count($matches);
            $j = 0;
            for ($i = 0; $i < $count && $j < $max; $i++) {
                if (trim($matches[$i]['src']) && (substr($matches[$i]['src'], 0, 1) == '/' || !preg_match('/^https?:\/\//i', $matches[$i]['src']) || substr($matches[$i]['src'], 0, $urlBaseLen) == $urlBase)) {
                    $src = $matches[$i]['src'];
                    if (substr($src, 0, 1) == '/') {
                        $src = substr($src, 1);
                    }
                    if (!preg_match('/^https?:\//i', $src)) {
                        $src = $urlBase . $src;
                    }
                    $image = new stdClass;
                    $image->src = $src;
                    $image->title = (isset($matches[$i]['title']) ? $matches[$i]['title'] : @$matches[$i]['alt']);
                    $images[] = $image;
                    $j++;
                }
            }
        }
        return $images;
    }

    static function getPagebreaks($text,$baseLink)
    {
        $matches = $subnodes = array();
        if (preg_match_all(
                '/<hr\s*[^>]*?(?:(?:\s*alt="(?P<alt>[^"]+)")|(?:\s*title="(?P<title>[^"]+)"))+[^>]*>/i',
                $text, $matches, PREG_SET_ORDER)
        ) {
            $i = 2;
            foreach ($matches as $match) {
                if (strpos($match[0], 'class="system-pagebreak"') !== FALSE) {
                    $link = $baseLink . '&limitstart=' . ($i - 1);

                    if (@$match['alt']) {
                        $title = stripslashes($match['alt']);
                    } elseif (@$match['title']) {
                        $title = stripslashes($match['title']);
                    } else {
                        $title = JText::sprintf('Page #', $i);
                    }
                    $subnode = new stdclass();
                    $subnode->name = $title;
                    $subnode->expandible = false;
                    $subnode->link = $link;
                    $subnodes[] = $subnode;
                    $i++;
                }
            }

        }
        return $subnodes;
    }
}
helpers/index.html000060400000000036152455302450010203 0ustar00<!DOCTYPE html><title></title>displayer.php000060400000020047152455302450007255 0ustar00<?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' );

class XmapDisplayer {

    /**
     *
     * @var int  Counter for the number of links on the sitemap
     */
    protected $count;
    /**
     *
     * @var JView
     */
    protected $jview;

    public $config;
    public $sitemap;
    /**
     *
     * @var int   Current timestamp
     */
    public $now;
    public $userLevels;
    /**
     *
     * @var string  The current value for the request var "view" (eg. html, xml)
     */
    public $view;

    public $canEdit;

    function __construct($config,$sitemap)
    {
        jimport('joomla.utilities.date');
        jimport('joomla.user.helper');
        $user = JFactory::getUser();
        $groups = array_keys(JUserHelper::getUserGroups($user->get('id')));
        $date = new JDate();

        $this->userLevels    = (array)$user->getAuthorisedViewLevels();
        // Deprecated: should use userLevels from now on
        // $this->gid = $user->gid;
        $this->now    = $date->toUnix();
        $this->config    = $config;
        $this->sitemap    = $sitemap;
        $this->isNews   = false;
        $this->isImages    = false;
        $this->count    = 0;
        $this->canEdit  = false;
    }

    public function printNode( &$node ) {
        return false;
    }

    public function printSitemap()
    {
        foreach ($this->jview->items as $menutype => &$items) {

            $node = new stdclass();

            $node->uid = "menu-".$menutype;
            $node->menutype = $menutype;
            $node->priority = null;
            $node->changefreq = null;
            // $node->priority = $menu->priority;
            // $node->changefreq = $menu->changefreq;
            $node->browserNav = 3;
            $node->type = 'separator';
            /**
             * @todo allow the user to provide the module used to display that menu, or some other
             * workaround
             */
            $node->name = $this->getMenuTitle($menutype,'mod_menu'); // Get the name of this menu

            $this->startMenu($node);
            $this->printMenuTree($node, $items);
            $this->endMenu($node);
        }
    }

    public function setJView($view)
    {
        $this->jview = $view;
    }

    public function getMenuTitle($menutype,$module='mod_menu')
    {
        $app = JFactory::getApplication();
        $db = JFactory::getDbo();
        $title = $extra = '';

        // Filter by language
        if ($app->getLanguageFilter()) {
            $extra = ' AND language in ('.$db->quote(JFactory::getLanguage()->getTag()).','.$db->quote('*').')';
        }

        $db->setQuery(
             "SELECT * FROM #__modules WHERE module='{$module}' AND params "
            ."LIKE '%\"menutype\":\"{$menutype}\"%' AND access IN (".implode(',',$this->userLevels).") "
            ."AND published=1 AND client_id=0 "
            . $extra
            . "LIMIT 1"
        );
        $module = $db->loadObject();
        if ($module) {
            $title = $module->title;
        }
        return $title;
    }

    protected function startMenu(&$node)
    {
        return true;
    }
    protected function endMenu(&$node)
    {
        return true;
    }
    protected function printMenuTree($menu,&$items)
    {
        $this->changeLevel(1);

        $router = JSite::getRouter();

        foreach ( $items as $i => $item ) {                   // Add each menu entry to the root tree.
            $excludeExternal = false;

            $node = new stdclass;

            $node->id           = $item->id;
            $node->uid          = $item->uid;
            $node->name         = $item->title;               // displayed name of node
            // $node->parent    = $item->parent;              // id of parent node
            $node->browserNav   = $item->browserNav;          // how to open link
            $node->priority     = $item->priority;
            $node->changefreq   = $item->changefreq;
            $node->type         = $item->type;                // menuentry-type
            $node->menutype     = $menu->menutype;            // menuentry-type
            $node->home         = $item->home;                // If it's a home menu entry
            // $node->link      = isset( $item->link ) ? htmlspecialchars( $item->link ) : '';
            $node->link         = $item->link;
            $node->option       = $item->option;
            $node->modified     = @$item->modified;
            $node->secure       = $item->params->get('secure');

            // New on Xmap 2.0: send the menu params
            $node->params =& $item->params;

            if ($node->home == 1) {
                // Correct the URL for the home page.
                $node->link = JURI::base();
            }
            switch ($item->type)
            {
                case 'separator':
                    $node->browserNav=3;
                    break;
                case 'url':
                    if ((strpos($item->link, 'index.php?') === 0) && (strpos($item->link, 'Itemid=') === false)) {
                        // If this is an internal Joomla link, ensure the Itemid is set.
                        $node->link = $node->link.'&Itemid='.$node->id;
                    } else {
                        $excludeExternal = ($this->view == 'xml');
                    }
                    break;
                case 'alias':
                    // If this is an alias use the item id stored in the parameters to make the link.
                    $node->link = 'index.php?Itemid='.$item->params->get('aliasoptions');
                    break;
                default:
                    if ($router->getMode() == JROUTER_MODE_SEF) {
                        $node->link = 'index.php?Itemid='.$node->id;
                    }
                    elseif (!$node->home) {
                        $node->link .= '&Itemid='.$node->id;
                    }
                    break;
            }

            if ($excludeExternal || $this->printNode($node)) {

                //Restore the original link
                $node->link             = $item->link;
                $this->printMenuTree($node,$item->items);
                $matches=array();
                //if ( preg_match('#^/?index.php.*option=(com_[^&]+)#',$node->link,$matches) ) {
                if ( $node->option ) {
                    if ( !empty($this->jview->extensions[$node->option]) ) {
                         $node->uid = $node->option;
                        $className = 'xmap_'.$node->option;
                        $result = call_user_func_array(array($className, 'getTree'),array(&$this,&$node,&$this->jview->extensions[$node->option]->params));
                    }
                }
                //XmapPlugins::printTree( $this, $node, $this->jview->extensions );    // Determine the menu entry's type and call it's handler
            }
        }
        $this->changeLevel(-1);
    }

    public function changeLevel($step)
    {
        return true;
    }

    public function getCount()
    {
        return $this->count;
    }

    public function &getExcludedItems() {
        static $_excluded_items;
        if (!isset($_excluded_items)) {
            $_excluded_items = array();
            $registry = new JRegistry('_default');
            $registry->loadString($this->sitemap->excluded_items);
            $_excluded_items = $registry->toArray();
        }
        return $_excluded_items;
    }

    public function isExcluded($itemid,$uid) {
        $excludedItems = $this->getExcludedItems();
        $items = NULL;
        if (!empty($excludedItems[$itemid])) {
            if (is_object($excludedItems[$itemid])) {
                $excludedItems[$itemid] = (array) $excludedItems[$itemid];
            }
            $items =& $excludedItems[$itemid];
        }
        if (!$items) {
            return false;
        }
        return ( in_array($uid, $items));
    }
}
controller.php000060400000003623152455302450007445 0ustar00<?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.controller');

/**
 * Xmap Component Controller
 *
 * @package        Xmap
 * @subpackage     com_xmap
 * @since          2.0
 */
class XmapController extends JControllerLegacy
{

    /**
     * Method to display a view.
     *
     * @param   boolean         If true, the view output will be cached
     * @param   array           An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
     *
     * @return  JController     This object to support chaining.
     * @since   1.5
     */
    public function display($cachable = false, $urlparams = false)
    {
        $cachable = true;

        $id         = JRequest::getInt('id');
        $viewName   = JRequest::getCmd('view');
        $viewLayout = JRequest::getCmd('layout', 'default');

        $user = JFactory::getUser();

        if ($user->get('id') || !in_array($viewName, array('html', 'xml')) || $viewLayout == 'xsl') {
            $cachable = false;
        }

        if ($viewName) {
            $document = JFactory::getDocument();
            $viewType = $document->getType();
            $view = $this->getView($viewName, $viewType, '', array('base_path' => $this->basePath, 'layout' => $viewLayout));
            $sitemapmodel = $this->getModel('Sitemap');
            $view->setModel($sitemapmodel, true);
        }

        $safeurlparams = array('id' => 'INT', 'itemid' => 'INT', 'uid' => 'CMD', 'action' => 'CMD', 'property' => 'CMD', 'value' => 'CMD');

        parent::display($cachable, $safeurlparams);

        return $this;
    }

}
models/index.html000060400000000036152455302450010024 0ustar00<!DOCTYPE html><title></title>models/sitemap.php000060400000023144152455302450010207 0ustar00<?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;

jimport('joomla.application.component.modelitem');
jimport('joomla.database.query');
require_once(JPATH_COMPONENT . '/helpers/xmap.php');

/**
 * Xmap Component Sitemap Model
 *
 * @package        Xmap
 * @subpackage     com_xmap
 * @since          2.0
 */
class XmapModelSitemap extends JModelItem
{

    /**
     * Model context string.
     *
     * @var        string
     */
    protected $_context = 'com_xmap.sitemap';
    protected $_extensions = null;

    static $items = array();
    /**
     * Method to auto-populate the model state.
     *
     * @return     void
     */
    protected function populateState()
    {
        $app = JFactory::getApplication('site');

        // Load state from the request.
        $pk = JRequest::getInt('id');
        $this->setState('sitemap.id', $pk);

        $offset = JRequest::getInt('limitstart');
        $this->setState('list.offset', $offset);

        // Load the parameters.
        $params = $app->getParams();
        $this->setState('params', $params);

        // TODO: Tune these values based on other permissions.
        $this->setState('filter.published', 1);
        $this->setState('filter.access', true);
    }

    /**
     * Method to get sitemap data.
     *
     * @param    integer    The id of the article.
     *
     * @return   mixed      Menu item data object on success, false on failure.
     */
    public function &getItem($pk = null)
    {
        // Initialize variables.
        $db = $this->getDbo();
        $pk = (!empty($pk)) ? $pk : (int) $this->getState('sitemap.id');

        // If not sitemap specified, select the default one
        if (!$pk) {
            $query = $db->getQuery(true);
            $query->select('id')->from('#__xmap_sitemap')->where('is_default=1');
            $db->setQuery($query);
            $pk = $db->loadResult();
        }

        if ($this->_item === null) {
            $this->_item = array();
        }

        if (!isset($this->_item[$pk])) {
            try {
                $query = $db->getQuery(true);

                $query->select($this->getState('item.select', 'a.*'));
                $query->from('#__xmap_sitemap AS a');

                $query->where('a.id = ' . (int) $pk);

                // Filter by published state.
                $published = $this->getState('filter.published');
                if (is_numeric($published)) {
                    $query->where('a.state = ' . (int) $published);
                }

                // Filter by access level.
                if ($access = $this->getState('filter.access')) {
                    $user = JFactory::getUser();
                    $groups = implode(',', $user->getAuthorisedViewLevels());
                    $query->where('a.access IN (' . $groups . ')');
                }

                $this->_db->setQuery($query);

                $data = $this->_db->loadObject();

                if ($error = $this->_db->getErrorMsg()) {
                    throw new Exception($error);
                }

                if (empty($data)) {
                    throw new Exception(JText::_('COM_XMAP_ERROR_SITEMAP_NOT_FOUND'));
                }

                // Check for published state if filter set.
                if (is_numeric($published) && $data->state != $published) {
                    throw new Exception(JText::_('COM_XMAP_ERROR_SITEMAP_NOT_FOUND'));
                }

                // Convert parameter fields to objects.
                $registry = new JRegistry('_default');
                $registry->loadString($data->attribs);
                $data->params = clone $this->getState('params');
                $data->params->merge($registry);

                // Convert the selections field to an array.
                $registry = new JRegistry('_default');
                $registry->loadString($data->selections);
                $data->selections = $registry->toArray();

                // Compute access permissions.
                if ($access) {
                    // If the access filter has been set, we already know this user can view.
                    $data->params->set('access-view', true);
                } else {
                    // If no access filter is set, the layout takes some responsibility for display of limited information.
                    $user = &JFactory::getUser();
                    $groups = $user->authorisedLevels();

                    $data->params->set('access-view', in_array($data->access, $groups));
                }
                // TODO: Type 2 permission checks?

                $this->_item[$pk] = $data;
            } catch (Exception $e) {
                $this->setError($e->getMessage());
                $this->_item[$pk] = false;
            }
        }

        return $this->_item[$pk];
    }

    public function getItems()
    {
        if ($item = $this->getItem()) {
            return XmapHelper::getMenuItems($item->selections);
        }
        return false;
    }

    function getExtensions()
    {
        return XmapHelper::getExtensions();
    }

    /**
     * Increment the hit counter for the sitemap.
     *
     * @param    int        Optional primary key of the sitemap to increment.
     *
     * @return   boolean    True if successful; false otherwise and internal error set.
     */
    public function hit($count)
    {
        // Initialize variables.
        $pk = (int) $this->getState('sitemap.id');

        $view = JRequest::getCmd('view', 'html');
        if ($view != 'xml' && $view != 'html') {
            return false;
        }

        $this->_db->setQuery(
            'UPDATE #__xmap_sitemap' .
            ' SET views_' . $view . ' = views_' . $view . ' + 1, count_' . $view . ' = ' . $count . ', lastvisit_' . $view . ' = ' . JFactory::getDate()->toUnix() .
            ' WHERE id = ' . (int) $pk
        );

        if (!$this->_db->query()) {
            $this->setError($this->_db->getErrorMsg());
            return false;
        }

        return true;
    }

    public function getSitemapItems($view=null)
    {
        if (!isset($view)) {
            $view = JRequest::getCmd('view');
        }
        $db = JFactory::getDBO();
        $pk = (int) $this->getState('sitemap.id');

        if (self::$items !== NULL && isset(self::$items[$view])) {
            return;
        }
        $query = "select * from #__xmap_items where view='$view' and sitemap_id=" . $pk;
        $db->setQuery($query);
        $rows = $db->loadObjectList();
        self::$items[$view] = array();
        foreach ($rows as $row) {
            self::$items[$view][$row->itemid] = array();
            self::$items[$view][$row->itemid][$row->uid] = array();
            $pairs = explode(';', $row->properties);
            foreach ($pairs as $pair) {
                if (strpos($pair, '=') !== FALSE) {
                    list($property, $value) = explode('=', $pair);
                    self::$items[$view][$row->itemid][$row->uid][$property] = $value;
                }
            }
        }
        return self::$items;
    }

    function chageItemPropery($uid, $itemid, $view, $property, $value)
    {
        $items = $this->getSitemapItems($view);
        $db = JFactory::getDBO();
        $pk = (int) $this->getState('sitemap.id');

        $isNew = false;
        if (empty($items[$view][$itemid][$uid])) {
            $items[$view][$itemid][$uid] = array();
            $isNew = true;
        }
        $items[$view][$itemid][$uid][$property] = $value;
        $sep = $properties = '';
        foreach ($items[$view][$itemid][$uid] as $k => $v) {
            $properties .= $sep . $k . '=' . $v;
            $sep = ';';
        }
        if (!$isNew) {
            $query = 'UPDATE #__xmap_items SET properties=\'' . $db->escape($properties) . "' where uid='" . $db->escape($uid) . "' and itemid=$itemid and view='$view' and sitemap_id=" . $pk;
        } else {
            $query = 'INSERT #__xmap_items (uid,itemid,view,sitemap_id,properties) values ( \'' . $db->escape($uid) . "',$itemid,'$view',$pk,'" . $db->escape($properties) . "')";
        }
        $db->setQuery($query);
        //echo $db->getQuery();exit;
        if ($db->query()) {
            return true;
        } else {
            return false;
        }
    }

    function toggleItem($uid, $itemid)
    {
        $app = JFactory::getApplication('site');
        $sitemap = $this->getItem();

        $displayer = new XmapDisplayer($app->getParams(), $sitemap);

        $excludedItems = $displayer->getExcludedItems();
        if (isset($excludedItems[$itemid])) {
            $excludedItems[$itemid] = (array) $excludedItems[$itemid];
        }
        if (!$displayer->isExcluded($itemid, $uid)) {
            $excludedItems[$itemid][] = $uid;
            $state = 0;
        } else {
            if (is_array($excludedItems[$itemid]) && count($excludedItems[$itemid])) {
                $excludedItems[$itemid] = array_filter($excludedItems[$itemid], create_function('$var', 'return ($var != \'' . $uid . '\');'));
            } else {
                unset($excludedItems[$itemid]);
            }
            $state = 1;
        }

        $registry = new JRegistry('_default');
        $registry->loadArray($excludedItems);
        $str = $registry->toString();

        $db = JFactory::getDBO();
        $query = "UPDATE #__xmap_sitemap set excluded_items='" . $db->escape($str) . "' where id=" . $sitemap->id;
        $db->setQuery($query);
        $db->query();
        return $state;
    }

}
assets/index.html000060400000000036152455302450010043 0ustar00<!DOCTYPE html><title></title>assets/css/index.html000060400000000036152455302450010633 0ustar00<!DOCTYPE html><title></title>assets/css/xmap.css000060400000001104152455302450010312 0ustar00/* list-style: pos1 pos2 po3;
 * parameter:
 * pos1: none | disc | circle | square
 * pos2: inside | outside
 * pos3: none | url('arrow.gif')
 * more info under: http://www.w3schools.com/css/css_list.asp
 */

#xmap ul {
    display : block;
    list-style : none;
    margin : 0;
    padding : 0;
}
#xmap ul li {
    margin : 0;
    padding : 0;
    background : transparent;
}
#xmap a img {
    border : none;
}
#xmap ul.level_0 ul {
    list-style : inside square;
    padding : 0;
}
#xmap ul.level_1 li {
    padding : 0 1em 0 1em;
}
#xmap .active {
    font-style : italic;
}
assets/xsl/index.html000060400000000036152455302450010651 0ustar00<!DOCTYPE html><title></title>assets/xsl/gssadmin.xsl000060400000031565152455302450011224 0ustar00<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xna="http://www.sitemaps.org/schemas/sitemap/0.9" exclude-result-prefixes="xna">
<xsl:output indent="yes" method="html" omit-xml-declaration="yes"/>
<xsl:template match="/">
<html>
<head>
<title>Google Sitemap File</title>
<script src="media/system/js/mootools.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(http://www.google.com/webmasters/sitemaps/images/sortup.gif);
        background-repeat: no-repeat;
        font-style:italic;
        white-space:pre;
    }
    .sortdown {
        background-position: right center;
        background-image: url(http://www.google.com/webmasters/sitemaps/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;
    }
    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(components/com_xmap/images/arrow.gif) top right no-repeat;
        padding-right:18px;
        padding-right:18px;
        border:1px solid #ffffff;
    }
    .editable:hover {
        border-color:#cccccc;
    }
    -->
    ]]>
</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, 3, 1);
        }
        else {
            desc = ".1.";
            html = ".0.";
            initTable(tabName);
            setSort(tabName, 1, 1);
        }
      
        var theURL = document.getElementById("head1");
        theURL.innerHTML += ' ' + location;
        document.title += ': ' + location;
    }

    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(/<[^>]+>|&nbsp;/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(/<[^>]+>|&nbsp;|\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;
    }

    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.size.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) {
        var myAjax = new Ajax('index.php?option=com_xmap&tmpl=component&task=editElement&action=changeProperty&sitemap='+sitemapid+'&uid='+divOptions.uid+'&itemid='+divOptions.itemid+'&property='+property+'&value='+el.innerHTML,{
            onComplete: checkChangeResult.bind(divOptions)
        }).request();
        divOptions.cell.innerHTML=el.innerHTML;
        divOptions.style.display='none';
        return false;
    }

    function checkChangeResult(result,xmlResponse) {
    }

    function getURLparam( name ) {
        name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
        var regexS = "[\\?&]"+name+"=([^&#]*)";
        var regex = new RegExp( regexS );
        var results = regex.exec( window.location.href );
        if( results == null )
            return "";
        else
            return results[1];
    }

    var sitemapid=getURLparam('sitemap');

    ]]>
</script>
</head>
<body onLoad="initXsl('table0','sitemap');">
    <h1 id="head1">Site Map</h1>
    <h2>Number of URLs in this Sitemap: <xsl:value-of select="count(xna:urlset/xna:url)"></xsl:value-of></h2>
    <table id="table0" class="data">
        <tr class="header">
            <td>Sitemap URL</td>
            <td>Last modification date</td>
            <td>Change freq.</td>
            <td>Priority</td>
        </tr>
        <xsl:for-each select="xna:urlset/xna:url">
        <xsl:variable name="UID"><xsl:value-of select="xna:uid"/></xsl:variable>
        <xsl:variable name="ItemID"><xsl:value-of select="xna:itemid"/></xsl:variable>
        <tr>
            <td>
                <xsl:variable name="sitemapURL"><xsl:value-of select="xna:loc"/></xsl:variable>
                <a href="{$sitemapURL}" target="_blank" ref="nofollow"><xsl:value-of select="$sitemapURL"></xsl:value-of></a>
            </td>
            <td><xsl:value-of select="xna:lastmod"/></td>
            <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>
        </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>
assets/xsl/gss.xsl000060400000017573152455302450010216 0ustar00<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xna="http://www.sitemaps.org/schemas/sitemap/0.9" exclude-result-prefixes="xna">
<xsl:output indent="yes" method="html" omit-xml-declaration="yes"/>
<xsl:template match="/">
<html>
<head>
<title>Google Sitemap File</title>
<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(http://www.google.com/webmasters/sitemaps/images/sortup.gif);
        background-repeat: no-repeat;
        font-style:italic;
        white-space:pre;
    }
    .sortdown {
        background-position: right center;
        background-image: url(http://www.google.com/webmasters/sitemaps/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;
    }
    table.data tr.header td{
        background-color: #CCCCCC;
        color: #FFFFFF;
        font-weight: bold;
        font-size: 14px;
    }
    -->
    ]]>
</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, 3, 1);
        }
        else {
            desc = ".1.";
            html = ".0.";
            initTable(tabName);
            setSort(tabName, 1, 1);
        }

        var theURL = document.getElementById("head1");
        theURL.innerHTML += ' ' + location;
        document.title += ': ' + location;
    }

    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(/<[^>]+>|&nbsp;/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(/<[^>]+>|&nbsp;|\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;
    }

    ]]>
</script>
</head>
<body onLoad="initXsl('table0','sitemap');">
    <h1 id="head1">Site Map</h1>
    <h2>Number of URLs in this Sitemap: <xsl:value-of select="count(xna:urlset/xna:url)"></xsl:value-of></h2>
    <table id="table0" class="data">
        <tr class="header">
            <td>Sitemap URL</td>
            <td>Last modification date</td>
            <td>Change freq.</td>
            <td>Priority</td>
        </tr>
        <xsl:for-each select="xna:urlset/xna:url">
        <tr>
            <td>
                <xsl:variable name="sitemapURL"><xsl:value-of select="xna:loc"/></xsl:variable>
                <a href="{$sitemapURL}" target="_blank" ref="nofollow"><xsl:value-of select="$sitemapURL"></xsl:value-of></a>
            </td>
            <td><xsl:value-of select="xna:lastmod"/></td>
            <td><xsl:value-of select="xna:changefreq"/></td>
            <td><xsl:value-of select="xna:priority"/></td>
        </tr>
        </xsl:for-each>
    </table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
assets/images/sortup.gif000060400000000166152455302450011342 0ustar00GIF89a�������'���xy�]^!�,@#��I�#�=�BPM1zG��c�[��������O;assets/images/img_green.gif000060400000000130152455302450011731 0ustar00GIF89a��f3!�,@H���oE5Th,\2���9@��6�]�1f�$;assets/images/txt_red.gif000060400000000072152455302450011453 0ustar00GIF89a		�����!�,		�����{�Q�"�yP;assets/images/unpublished.png000060400000001114152455302450012341 0ustar00�PNG


IHDR(-SsBIT��O��PLTE����も�RR�::����

夤����((����tt����%%��66���붶�oo����

䒒�CC����cc�������??�{{�))����33�mm��HH����\\�rr�����22�;;�����LL�99�**������##��{{�))�MM�88�ff�ssta�`<tRNS�������������������������������������������������������������b	pHYs��~�tEXtSoftwareMacromedia Fireworks 8�h�x�IDAT�]ω�0`PT���k���)�(
*�`���i��K�S�_)�Hf����;��z7�(����,�S�Ns^�("%��Z�"�LD��^]_	�䲩=]˛�@��6g��=;`J1]����)�|hjƖX����A��.3�t�<6D��QQ�#裣��?���_L�@������oIEND�B`�assets/images/img_orange.gif000060400000000112152455302450012104 0ustar00GIF89a��� !�,@����&LH(����Z��t=S�a��;assets/images/tick.png000060400000000777152455302450010767 0ustar00�PNG


IHDR(-SsBIT��O��PLTEL�	�֥��R��ԟ��c� ������~���V���`���k�/���W����߲֖��}_���]���g�$�渌�PP�
���ݱ\�v�B����������r��[���\T�
��I�׃�ߩ��\���R���W�l�%�Ұ��p�5��΄a�T���`���8tRNS�������������������������������������������������������em�	pHYs��~�tEXtSoftwareMacromedia Fireworks 8�h�xIDAT�c�Eh|C4e6Tci-mn3Y���X4@�HC��RF`k5y�@|a55~�;���L�X����}U�K�u$%%吜.o��ć�EQ�����89Ř�1}���&���<IEND�B`�assets/images/index.html000060400000000036152455302450011310 0ustar00<!DOCTYPE html><title></title>assets/images/img_red.gif000060400000000112152455302450011403 0ustar00GIF89a��3X!�,@����&LH(����Z��t=S�a��;assets/images/txt_blue.gif000060400000000072152455302450011630 0ustar00GIF89a		�33����!�,		@����~42�Kߕ�
;assets/images/txt_orange.gif000060400000000072152455302450012154 0ustar00GIF89a		��}���!�,		@����~42�Kߕ�
;assets/images/txt_grey.gif000060400000000072152455302450011647 0ustar00GIF89a		����!�,		�����{�Q�"�yP;assets/images/img_blue.gif000060400000000111152455302450011557 0ustar00GIF89a����f�!�,@��&��`B ���ֵ*.��Dv!�z;assets/images/img_grey.gif000060400000000112152455302450011577 0ustar00GIF89a����!�,@����`B!���ֵ*.�`=#�]H�;assets/images/sortdown.gif000060400000000133152455302450011657 0ustar00GIF89a��������'���xy�]^!�,@ ��0BfĹ���:�['�
4�h�XY�|�Sd�;assets/images/txt_green.gif000060400000000072152455302450012001 0ustar00GIF89a		�f����!�,		@����~42�Kߕ�
;assets/images/arrow.gif000060400000001524152455302450011137 0ustar00GIF89a����������������������������3f���3333f3�3�3�ff3fff�f�f���3�f��������3�f̙�����3�f������3333f3�3�3�3333333f33�33�33�3f3f33ff3f�3f�3f�3�3�33�f3��3��3��3�3�33�f3̙3��3�3�3�33�f3��3��3��ff3fff�f�f�f3f33f3ff3�f3�f3�ffff3fffff�ff�ff�f�f�3f�ff��f��f��f�f�3f�ff̙f��f�f�f�3f�ff��f��f����3�f���̙��3�33�3f�3��3̙3��f�f3�ff�f��f̙f�����3��f�����̙������3��f�̙��̙�����3��f�����̙����3�f�������3�33�3f�3��3��3��f�f3�ff�f��f��f�̙̙3̙f̙�̙�̙�����3��f�̙�������3�f��������3�f������3�33�3f�3��3�3��f�f3�ff�f��f�f�����3��f������������3��f�̙��������3��f��������,9H����*\Ȑ��#J���ŋ�1#B�5&�@�B?�L.�Ӱ�˗
;controllers/ajax.json.php000060400000004424152455302450011523 0ustar00<?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;

jimport('joomla.application.component.controller');

/**
 * Xmap Ajax Controller
 *
 * @package      Xmap
 * @subpackage   com_xmap
 * @since        2.0
 */
class XmapControllerAjax extends JControllerLegacy
{

    public function editElement()
    {
        JSession::checkToken('get') or jexit(JText::_('JINVALID_TOKEN'));

        jimport('joomla.utilities.date');
        jimport('joomla.user.helper');
        $user = JFactory::getUser();
        $groups = array_keys(JUserHelper::getUserGroups($user->get('id')));
        $result = new JRegistry('_default');
        $sitemapId = JREquest::getInt('id');

        if (!$user->authorise('core.edit', 'com_xmap.sitemap.'.$sitemapId)) {
            $result->setValue('result', 'KO');
            $result->setValue('message', 'You are not authorized to perform this action!');
        } else {
            $model = $this->getModel('sitemap');
            if ($model->getItem()) {
                $action = JRequest::getCmd('action', '');
                $uid = JRequest::getCmd('uid', '');
                $itemid = JRequest::getInt('itemid', '');
                switch ($action) {
                    case 'toggleElement':
                        if ($uid && $itemid) {
                            $state = $model->toggleItem($uid, $itemid);
                        }
                        break;
                    case 'changeProperty':
                        $uid = JRequest::getCmd('uid', '');
                        $property = JRequest::getCmd('property', '');
                        $value = JRequest::getCmd('value', '');
                        if ($uid && $itemid && $uid && $property) {
                            $state = $model->chageItemPropery($uid, $itemid, 'xml', $property, $value);
                        }
                        break;
                }
            }
            $result->set('result', 'OK');
            $result->set('state', $state);
            $result->set('message', '');
        }

        echo $result->toString();
    }
}controllers/index.html000060400000000036152455302450011107 0ustar00<!DOCTYPE html><title></title>tables/index.html000060400000000036152455704340010017 0ustar00<!DOCTYPE html><title></title>tables/sitemap.php000060400000014415152455704340010203 0ustar00<?php
/**
 * @version       $Id$
 * @copyright     Copyright (C) 2007 - 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;

/**
 * @package         Xmap
 * @subpackage      com_xmap
 * @since           2.0
 */
class XmapTableSitemap extends JTable
{

    /**
     * @var int Primary key
     */
    var $id = null;
    /**
     * @var string
     */
    var $title = null;
    /**
     * @var string
     */
    var $alias = null;
    /**
     * @var string
     */
    var $introtext = null;
    /**
     * @var string
     */
    var $metakey = null;
    /**
     * @var string
     */
    var $attribs = null;
    /**
     * @var string
     */
    var $selections = null;
    /**
     * @var string
     */
    var $created = null;
    /**
     * @var string
     */
    var $metadesc = null;
    /**
     * @var string
     */
    var $excluded_items = null;
    /**
     * @var int
     */
    var $is_default = 0;
    /**
     * @var int
     */
    var $state = 0;
    /**
     * @var int
     */
    var $access = 0;
    /**
     * @var int
     */
    var $count_xml = 0;
    /**
     * @var int
     */
    var $count_html = 0;
    /**
     * @var int
     */
    var $views_xml = 0;
    /**
     * @var int
     */
    var $views_html = 0;
    /**
     * @var int
     */
    var $lastvisit_xml = 0;
    /**
     * @var int
     */
    var $lastvisit_html = 0;

    /**
     * @param    JDatabase    A database connector object
     */
    function __construct(&$db)
    {
        parent::__construct('#__xmap_sitemap', 'id', $db);
    }

    /**
     * Overloaded bind function
     *
     * @access      public
     * @param       array $hash named array
     * @return      null|string  null is operation was satisfactory, otherwise returns an error
     * @see         JTable:bind
     * @since       2.0
     */
    function bind($array, $ignore = '')
    {
        if (isset($array['attribs']) && is_array($array['attribs'])) {
            $registry = new JRegistry();
            $registry->loadArray($array['attribs']);
            $array['attribs'] = $registry->toString();
        }

        if (isset($array['selections']) && is_array($array['selections'])) {
            $selections = array();
            foreach ($array['selections'] as $i => $menu) {
                $selections[$menu] = array(
                    'priority' => $array['selections_priority'][$i],
                    'changefreq' => $array['selections_changefreq'][$i],
                    'ordering' => $i
                );
            }

            $registry = new JRegistry();
            $registry->loadArray($selections);
            $array['selections'] = $registry->toString();
        }

        if (isset($array['metadata']) && is_array($array['metadata'])) {
            $registry = new JRegistry();
            $registry->loadArray($array['metadata']);
            $array['metadata'] = $registry->toString();
        }

        return parent::bind($array, $ignore);
    }

    /**
     * Overloaded check function
     *
     * @access      public
     * @return      boolean
     * @see         JTable::check
     * @since       2.0
     */
    function check()
    {

        if (empty($this->title)) {
            $this->setError(JText::_('Sitemap must have a title'));
            return false;
        }

        if (empty($this->alias)) {
            $this->alias = $this->title;
        }
        $this->alias = JApplication::stringURLSafe($this->alias);

        if (trim(str_replace('-', '', $this->alias)) == '') {
            $datenow = &JFactory::getDate();
            $this->alias = $datenow->format("Y-m-d-H-i-s");
        }

        return true;
    }

    /**
     * Overriden JTable::store to set modified data and user id.
     *
     * @param       boolean True to update fields even if they are null.
     * @return      boolean True on success.
     * @since       2.0
     */
    public function store($updateNulls = false)
    {
        $date = JFactory::getDate();
        if (!$this->id) {
            $this->created = $date->toSql();
        }
        return parent::store($updateNulls);
    }

    /**
     * Method to set the publishing state for a row or list of rows in the database
     * table.
     *
     * @param       mixed   An optional array of primary key values to update.  If not
     *                      set the instance property value is used.
     * @param       integer The publishing state. eg. [0 = unpublished, 1 = published]
     * @param       integer The user id of the user performing the operation.
     * @return      boolean True on success.
     * @since       2.0
     */
    public function publish($pks = null, $state = 1, $userId = 0)
    {
        // Initialize variables.
        $k = $this->_tbl_key;

        // Sanitize input.
        JArrayHelper::toInteger($pks);
        $userId = (int) $userId;
        $state = (int) $state;

        // If there are no primary keys set check to see if the instance key is set.
        if (empty($pks)) {
            if ($this->$k) {
                $pks = array($this->$k);
            }
            // Nothing to set publishing state on, return false.
            else {
                $this->setError(JText::_('No_Rows_Selected'));
                return false;
            }
        }

        // Build the WHERE clause for the primary keys.
        $where = $k . '=' . implode(' OR ' . $k . '=', $pks);


        // Update the publishing state for rows with the given primary keys.
        $query =  $this->_db->getQuery(true)
                       ->update($this->_db->quoteName('#__xmap_sitemap'))
                       ->set($this->_db->quoteName('state').' = '. (int) $state)
                       ->where($where);

        $this->_db->setQuery($query);
        $this->_db->query();

        // Check for a database error.
        if ($this->_db->getErrorNum()) {
            $this->setError($this->_db->getErrorMsg());
            return false;
        }

        // If the JTable instance value is in the list of primary keys that were set, set the instance.
        if (in_array($this->$k, $pks)) {
            $this->state = $state;
        }

        $this->setError('');
        return true;
    }

}
LICENSE.txt000060400000042630152455704340006401 0ustar00GNU GENERAL PUBLIC LICENSE
				Version 2, June 1991

 Copyright (C) 1989, 1991 Free Software Foundation, Inc.
 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

				Preamble

  The licenses for most software are designed to take away your
freedom to share and change it.  By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users.  This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it.  (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.)  You can apply it to
your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.

  To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.

  For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have.  You must make sure that they, too, receive or can get the
source code.  And you must show them these terms so they know their
rights.

  We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.

  Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software.  If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.

  Finally, any free program is threatened constantly by software
patents.  We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary.  To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.

  The precise terms and conditions for copying, distribution and
modification follow.

			GNU GENERAL PUBLIC LICENSE
   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

  0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License.  The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language.  (Hereinafter, translation is included without limitation in
the term "modification".)  Each licensee is addressed as "you".

Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope.  The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.

  1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.

You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.

  2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:

	a) You must cause the modified files to carry prominent notices
	stating that you changed the files and the date of any change.

	b) You must cause any work that you distribute or publish, that in
	whole or in part contains or is derived from the Program or any
	part thereof, to be licensed as a whole at no charge to all third
	parties under the terms of this License.

	c) If the modified program normally reads commands interactively
	when run, you must cause it, when started running for such
	interactive use in the most ordinary way, to print or display an
	announcement including an appropriate copyright notice and a
	notice that there is no warranty (or else, saying that you provide
	a warranty) and that users may redistribute the program under
	these conditions, and telling the user how to view a copy of this
	License.  (Exception: if the Program itself is interactive but
	does not normally print such an announcement, your work based on
	the Program is not required to print an announcement.)

These requirements apply to the modified work as a whole.  If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works.  But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.

Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.

In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.

  3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:

	a) Accompany it with the complete corresponding machine-readable
	source code, which must be distributed under the terms of Sections
	1 and 2 above on a medium customarily used for software interchange; or,

	b) Accompany it with a written offer, valid for at least three
	years, to give any third party, for a charge no more than your
	cost of physically performing source distribution, a complete
	machine-readable copy of the corresponding source code, to be
	distributed under the terms of Sections 1 and 2 above on a medium
	customarily used for software interchange; or,

	c) Accompany it with the information you received as to the offer
	to distribute corresponding source code.  (This alternative is
	allowed only for noncommercial distribution and only if you
	received the program in object code or executable form with such
	an offer, in accord with Subsection b above.)

The source code for a work means the preferred form of the work for
making modifications to it.  For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable.  However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.

If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.

  4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License.  Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.

  5. You are not required to accept this License, since you have not
signed it.  However, nothing else grants you permission to modify or
distribute the Program or its derivative works.  These actions are
prohibited by law if you do not accept this License.  Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.

  6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions.  You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.

  7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all.  For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.

If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.

It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices.  Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.

This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.

  8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded.  In such case, this License incorporates
the limitation as if written in the body of this License.

  9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time.  Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.

Each version is given a distinguishing version number.  If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation.  If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.

  10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission.  For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this.  Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.

				NO WARRANTY

  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.

  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.

			 END OF TERMS AND CONDITIONS

		How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

	<one line to give the program's name and a brief idea of what it does.>
	Copyright (C) <year>  <name of author>

	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


Also add information on how to contact you by electronic and paper mail.

If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:

	Gnomovision version 69, Copyright (C) year name of author
	Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
	This is free software, and you are welcome to redistribute it
	under certain conditions; type `show c' for details.

The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License.  Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.

You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary.  Here is a sample; alter the names:

  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
  `Gnomovision' (which makes passes at compilers) written by James Hacker.

  <signature of Ty Coon>, 1 April 1989
  Ty Coon, President of Vice

This General Public License does not permit incorporating your program into
proprietary programs.  If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library.  If this is what you want to do, use the GNU Library General
Public License instead of this License.
helpers/html/index.html000060400000000036152455704340011153 0ustar00<!DOCTYPE html><title></title>helpers/html/xmap.php000060400000003061152455704340010635 0ustar00<?php
/**
 * @version     $Id$
 * @copyright   Copyright (C) 2007 - 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;

JTable::addIncludePath( JPATH_COMPONENT . '/tables' );

/**
 * @package       Xmap
 * @subpackage    com_xmap
 */
abstract class JHtmlXmap
{

    /**
     * @param    string  $name
     * @param    string  $value
     * @param    int     $j
     */
    public static function priorities($name, $value = '0.5', $j)
    {
        // Array of options
        for ($i=0.1; $i<=1;$i+=0.1) {
            $options[] = JHTML::_('select.option',$i,$i);;
        }
        return JHtml::_('select.genericlist', $options, $name, null, 'value', 'text', $value, $name.$j);
    }

    /**
     * @param    string  $name
     * @param    string  $value
     * @param    int     $j
     */
    public static function changefrequency($name, $value = 'weekly', $j)
    {
        // Array of options
        $options[] = JHTML::_('select.option','hourly','hourly');
        $options[] = JHTML::_('select.option','daily','daily');
        $options[] = JHTML::_('select.option','weekly','weekly');
        $options[] = JHTML::_('select.option','monthly','monthly');
        $options[] = JHTML::_('select.option','yearly','yearly');
        $options[] = JHTML::_('select.option','never','never');
        return JHtml::_('select.genericlist', $options, $name, null, 'value', 'text', $value, $name.$j);
    }

}
controllers/sitemaps.php000060400000004110152455704340011451 0ustar00<?php
/**
 * @version     $Id$
 * @copyright   Copyright (C) 2007 - 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;

jimport('joomla.application.component.controlleradmin');

/**
 * @package     Xmap
 * @subpackage  com_xmap
 * @since       2.0
 */
class XmapControllerSitemaps extends JControllerAdmin
{

    protected $text_prefix = 'COM_XMAP_SITEMAPS';

    /**
     * Constructor
     */
    public function __construct($config = array())
    {
        parent::__construct($config);

        $this->registerTask('unpublish',    'publish');
        $this->registerTask('trash',        'publish');
        $this->registerTask('unfeatured',   'featured');
    }


    /**
     * Method to toggle the default sitemap.
     *
     * @return      void
     * @since       2.0
     */
    function setDefault()
    {
        // Check for request forgeries
        JRequest::checkToken() or die('Invalid Token');

        // Get items to publish from the request.
        $cid = JRequest::getVar('cid', 0, '', 'array');
        $id  = @$cid[0];

        if (!$id) {
            JError::raiseWarning(500, JText::_('Select an item to set as default'));
        }
        else
        {
            // Get the model.
            $model = $this->getModel();

            // Publish the items.
            if (!$model->setDefault($id)) {
                JError::raiseWarning(500, $model->getError());
            }
        }

        $this->setRedirect('index.php?option=com_xmap&view=sitemaps');
    }

    /**
     * Proxy for getModel.
     *
     * @param    string    $name    The name of the model.
     * @param    string    $prefix    The prefix for the PHP class name.
     *
     * @return    JModel
     * @since    2.0
     */
    public function getModel($name = 'Sitemap', $prefix = 'XmapModel', $config = array('ignore_request' => true))
    {
        $model = parent::getModel($name, $prefix, $config);

        return $model;
    }
}controllers/sitemap.php000060400000002053152455704340011272 0ustar00<?php
/**
 * @version     $Id$
 * @copyright   Copyright (C) 2007 - 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;

jimport('joomla.application.component.controllerform');

/**
 * @package     Xmap
 * @subpackage  com_xmap
 * @since       2.0
 */
class XmapControllerSitemap extends JControllerForm
{
    /**
     * Method override to check if the user can edit an existing record.
     *
     * @param    array    An array of input data.
     * @param    string   The name of the key for the primary key.
     *
     * @return   boolean
     */
    protected function _allowEdit($data = array(), $key = 'id')
    {
        // Initialise variables.
        $recordId = (int) isset($data[$key]) ? $data[$key] : 0;

        // Assets are being tracked, so no need to look into the category.
        return JFactory::getUser()->authorise('core.edit', 'com_xmap.sitemap.'.$recordId);
    }
}install/install.utf8.sql000060400000002164152455704340011276 0ustar00CREATE TABLE IF NOT EXISTS `#__xmap_sitemap` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(255) DEFAULT NULL,
  `alias` varchar(255) DEFAULT NULL,
  `introtext` text DEFAULT NULL,
  `metadesc` text DEFAULT NULL,
  `metakey` text DEFAULT NULL,
  `attribs` text DEFAULT NULL,
  `selections` text DEFAULT NULL,
  `excluded_items` text DEFAULT NULL,
  `is_default` int(1) DEFAULT 0,
  `state` int(2) DEFAULT NULL,
  `access` int DEFAULT NULL,
  `created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  `count_xml` int(11) DEFAULT NULL,
  `count_html` int(11) DEFAULT NULL,
  `views_xml` int(11) DEFAULT NULL,
  `views_html` int(11) DEFAULT NULL,
  `lastvisit_xml` int(11) DEFAULT NULL,
  `lastvisit_html` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `#__xmap_items` (
  `uid` varchar(100) NOT NULL,
  `itemid` int(11) NOT NULL,
  `view` varchar(10) NOT NULL,
  `sitemap_id` int(11) NOT NULL,
  `properties` varchar(300) DEFAULT NULL,
  PRIMARY KEY (`uid`,`itemid`,`view`,`sitemap_id`),
  KEY `uid` (`uid`,`itemid`),
  KEY `view` (`view`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8install/uninstall.utf8.sql000060400000000071152455704340011634 0ustar00drop table `#__xmap_items`;
drop table `#__xmap_sitemap`;install/uninstall.postgresql.sql000060400000000071152455704340013151 0ustar00drop table "#__xmap_items";
drop table "#__xmap_sitemap";install/install.postgresql.sql000060400000002253152455704340012612 0ustar00CREATE TABLE "#__xmap_sitemap" (
  "id" serial NOT NULL,
  "title" character varying(255) DEFAULT NULL,
  "alias" character varying(255) DEFAULT NULL,
  "introtext" text DEFAULT NULL,
  "metadesc" text DEFAULT NULL,
  "metakey" text DEFAULT NULL,
  "attribs" text DEFAULT NULL,
  "selections" text DEFAULT NULL,
  "excluded_items" text DEFAULT NULL,
  "is_default" integer DEFAULT 0,
  "state" integer DEFAULT NULL,
  "access" integer DEFAULT NULL,
  "created" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL,
  "count_xml" integer DEFAULT NULL,
  "count_html" integer DEFAULT NULL,
  "views_xml" integer DEFAULT NULL,
  "views_html" integer DEFAULT NULL,
  "lastvisit_xml" integer DEFAULT NULL,
  "lastvisit_html" integer DEFAULT NULL,
  PRIMARY KEY ("id")
);

CREATE TABLE "#__xmap_items" (
  "uid" character varying(100) NOT NULL,
  "itemid" integer NOT NULL,
  "view" character varying(10) NOT NULL,
  "sitemap_id" integer NOT NULL,
  "properties" varchar(300) DEFAULT NULL,
  PRIMARY KEY ("uid","itemid","view","sitemap_id")
);

CREATE INDEX "#__xmap_items_idx_uid" on "#__xmap_items" ("uid", "itemid");
CREATE INDEX "#__xmap_items_idx_view" on "#__xmap_items" ("view");
install/index.html000060400000000036152455704340010213 0ustar00<!DOCTYPE html><title></title>models/fields/xmapmenus.php000060400000014304152455704340012032 0ustar00<?php
/**
 * @version          $Id$
 * @copyright        Copyright (C) 2007 - 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)
 */
defined('_JEXEC') or die;

jimport('joomla.html.html');
require_once JPATH_LIBRARIES . '/joomla/form/fields/list.php';

/**
 * Menus Form Field class for the Xmap Component
 *
 * @package      Xmap
 * @subpackage   com_xmap
 * @since        2.0
 */
class JFormFieldXmapmenus extends JFormFieldList
{

    /**
     * The field type.
     *
     * @var      string
     */
    public $type = 'Xmapmenus';

    /**
     * Method to get a list of options for a list input.
     *
     * @return   array        An array of JHtml options.
     */
    protected function _getOptions()
    {
        $db = JFactory::getDbo();
        $query = $db->getQuery(true);

        //$currentMenus = array_keys(get_object_vars($this->value));
        $currentMenus = array();

        $query->select('menutype As value, title As text');
        $query->from('#__menu_types AS a');
        $query->order('a.title');

        // Get the options.
        $db->setQuery($query);
        // echo $db->getQuery();
        $menus = $db->loadObjectList('value');
        $options = array();

        // Add the current sitemap menus in the defined order to the list
        foreach ($currentMenus as $menutype) {
            if (!empty($menus[$menutype])) {
                $options[] = $menus[$menutype];
            }
        }

        // Add the rest of the menus to the list (if any)
        foreach ($menus as $menutype => $menu) {
            if (!in_array($menutype, $currentMenus)) {
                $options[] = $menu;
            }
        }

        // Check for a database error.
        if ($db->getErrorNum()) {
            JError::raiseWarning(500, $db->getErrorMsg());
        }

        $options = array_merge(
                       parent::getOptions(),
                       $options
        );
        return $options;
    }

    /**
     * Method to get the field input.
     *
     * @return      string      The field input.
     */
    protected function getInput()
    {
        $disabled = $this->element['disabled'] == 'true' ? true : false;
        $readonly = $this->element['readonly'] == 'true' ? true : false;
        $attributes = ' ';

        $type = 'radio';
        if ($v = $this->element['size']) {
            $attributes .= 'size="' . $v . '" ';
        }
        if ($v = $this->element['class']) {
            $attributes .= 'class="' . $v . '" ';
        } else {
            $attributes .= 'class="inputbox" ';
        }
        if ($m = $this->element['multiple']) {
            $type = 'checkbox';
        }

        $value = $this->value;
        if (!is_array($value)) {
            // Convert the selections field to an array.
            $registry = new JRegistry;
            $registry->loadString($value);
            $value = $registry->toArray();
        }

        $doc = JFactory::getDocument();
        $doc->addScriptDeclaration("
        window.addEvent('domready',function(){
            \$\$('div.xmap-menu-options select').addEvent('mouseover',function(event){xmapMenusSortable.detach();})
            \$\$('div.xmap-menu-options select').addEvent('mouseout',function(event){xmapMenusSortable.attach();})
            var xmapMenusSortable = new Sortables(\$('ul_" . $this->inputId . "'),{
                clone:true,
                revert: true,
                preventDefault: true,
                onStart: function(el) {
                    el.setStyle('background','#bbb');
                },
                onComplete: function(el) {
                    el.setStyle('background','#eee');
                }
            });
        });");

        if ($disabled || $readonly) {
            $attributes .= 'disabled="disabled"';
        }
        $options = (array) $this->_getOptions();
        $return = '<ul id="ul_' . $this->inputId . '" class="ul_sortable">';

        // Create a regular list.
        $i = 0;

        //Lets show the enabled menus first
        $this->currentItems = array_keys($value);
        // Sort the menu options
        uasort($options, array($this, 'myCompare'));

        foreach ($options as $option) {
            $prioritiesName = preg_replace('/(jform\[[^\]]+)(\].*)/', '$1_priority$2', $this->name);
            $changefreqName = preg_replace('/(jform\[[^\]]+)(\].*)/', '$1_changefreq$2', $this->name);
            $selected = (isset($value[$option->value]) ? ' checked="checked"' : '');
            $i++;
            $return .= '<li id="menu_' . $i . '">';
            $return .= '<input type="' . $type . '" id="' . $this->id . '_' . $i . '" name="' . $this->name . '" value="' . $option->value . '"' . $attributes . $selected . ' />';
            $return .= '<label for="' . $this->id . '_' . $i . '" class="menu_label">' . $option->text . '</label>';
            $return .= '<div class="xmap-menu-options" id="menu_options_' . $i . '">';
            $return .= '<label class="control-label">' . JText::_('XMAP_PRIORITY') . '</label>';
            $return .= '<div class="controls">' . JHTML::_('xmap.priorities', $prioritiesName, ($selected ? $value[$option->value]['priority'] : '0.5'), $i) . '</div>';
            $return .= '<label class="control-label">' . JText::_('XMAP_CHANGE_FREQUENCY') . '</label>';
            $return .= '<div class="controls">' . JHTML::_('xmap.changefrequency', $changefreqName, ($selected ? $value[$option->value]['changefreq'] : 'weekly'), $i) . '</div>';
            $return .= '</div>';
            $return .= '</li>';
        }
        $return .= "</ul>";
        return $return;
    }

    public function myCompare($a, $b) {
        $indexA = array_search($a->value, $this->currentItems);
        $indexB = array_search($b->value, $this->currentItems);
        if ($indexA === $indexB && $indexA !== false) {
            return 0;
        }
        if ($indexA === false && $indexA === $indexB) {
            return ($a->value < $b->value) ? -1 : 1;
        }

        if ($indexA === false) {
            return 1;
        }
        if ($indexB === false) {
            return -1;
        }

        return ($indexA < $indexB) ? -1 : 1;
    }

}
models/fields/modal/sitemaps.php000060400000006102152455704340012733 0ustar00<?php
/**
 * @version          $Id$
 * @copyright        Copyright (C) 2007 - 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)
 */
defined('_JEXEC') or die;

jimport('joomla.form.field');

/**
 * Supports a modal sitemap picker.
 *
 * @package             Xmap
 * @subpackage          com_xmap
 * @since               2.0
 */
class JFormFieldModal_Sitemaps extends JFormField
{

    /**
     * The field type.
     *
     * @var    string
     */
    protected $type = 'Modal_Sitemaps';

    /**
     * Method to get a list of options for a sitemaps list input.
     *
     * @return    array        An array of JHtml options.
     */
    protected function getInput()
    {
        // Initialise variables.
        $db  = JFactory::getDBO();
        $doc = JFactory::getDocument();

        // Load the modal behavior.
        JHtml::_('behavior.modal', 'a.modal');

        // Get the title of the linked chart
        if ($this->value) {
            $db->setQuery(
                    'SELECT title' .
                    ' FROM #__xmap_sitemap' .
                    ' WHERE id = ' . (int) $this->value
            );
            $title = $db->loadResult();

            if ($error = $db->getErrorMsg()) {
                JError::raiseWarning(500, $error);
            }
        } else {
            $title = '';
        }

        if (empty($title)) {
            $title = JText::_('COM_XMAP_SELECT_AN_SITEMAP');
        }

        $doc->addScriptDeclaration(
                  "function jSelectSitemap_" . $this->id . "(id, title, object) {
                       $('" . $this->id . "_id').value = id;
                       $('" . $this->id . "_name').value = title;
                       SqueezeBox.close();
                  }"
        );

        $link = 'index.php?option=com_xmap&amp;view=sitemaps&amp;layout=modal&amp;tmpl=component&amp;function=jSelectSitemap_' . $this->id;

        JHTML::_('behavior.modal', 'a.modal');
        $html = '<span class="input-append">';
        $html .= "\n" . '<input class="input-medium" type="text" id="' . $this->id . '_name" value="' . htmlspecialchars($title, ENT_QUOTES, 'UTF-8') . '" disabled="disabled" />';
        if(version_compare(JVERSION,'3.0.0','ge'))
            $html .= '<a class="modal btn" title="' . JText::_('COM_XMAP_CHANGE_SITEMAP') . '"  href="' . $link . '" rel="{handler: \'iframe\', size: {x: 800, y: 450}}"><i class="icon-file"></i> ' . JText::_('COM_XMAP_CHANGE_SITEMAP_BUTTON') . '</a>' . "\n";
        else
            $html .= '<div class="button2-left"><div class="blank"><a class="modal btn" title="' . JText::_('COM_XMAP_CHANGE_SITEMAP') . '"  href="' . $link . '" rel="{handler: \'iframe\', size: {x: 800, y: 450}}"><i class="icon-file"></i> ' . JText::_('COM_XMAP_CHANGE_SITEMAP_BUTTON') . '</a></div></div>' . "\n";
        $html .= '</span>';
        $html .= "\n" . '<input type="hidden" id="' . $this->id . '_id" name="' . $this->name . '" value="' . (int) $this->value . '" />';
        return $html;
    }

}models/fields/modal/index.html000060400000000036152455704340012372 0ustar00<!DOCTYPE html><title></title>models/fields/index.html000060400000000036152455704340011276 0ustar00<!DOCTYPE html><title></title>models/sitemaps.php000060400000013570152455704340010400 0ustar00<?php
/**
 * @version       $Id$
 * @copyright     Copyright (C) 2007 - 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;

jimport('joomla.application.component.modellist');
jimport('joomla.database.query');

/**
 * Sitemaps Model Class
 *
 * @package         Xmap
 * @subpackage      com_xmap
 * @since           2.0
 */
class XmapModelSitemaps extends JModelList
{
    /**
     * Constructor.
     *
     * @param    array    An optional associative array of configuration settings.
     * @see      JController
     * @since    1.6
     */
    public function __construct($config = array())
    {
        if (empty($config['filter_fields'])) {
            $config['filter_fields'] = array(
                'id', 'a.id',
                'title', 'a.title',
                'alias', 'a.alias',
                'checked_out', 'a.checked_out',
                'checked_out_time', 'a.checked_out_time',
                'catid', 'a.catid', 'category_title',
                'state', 'a.state',
                'access', 'a.access', 'access_level',
                'created', 'a.created',
                'created_by', 'a.created_by',
                'ordering', 'a.ordering',
                'featured', 'a.featured',
                'language', 'a.language',
                'hits', 'a.hits',
                'publish_up', 'a.publish_up',
                'publish_down', 'a.publish_down',
            );
        }

        parent::__construct($config);
    }

    /**
     * Method to auto-populate the model state.
     *
     * @since       2.0
     */
    protected function populateState($ordering = null, $direction = null)
    {
        // Adjust the context to support modal layouts.
        if ($layout = JRequest::getVar('layout')) {
            $this->context .= '.'.$layout;
        }

        $access = $this->getUserStateFromRequest($this->context.'.filter.access', 'filter_access', 0, 'int');
        $this->setState('filter.access', $access);

        $published = $this->getUserStateFromRequest($this->context.'.filter.published', 'filter_published', '');
        $this->setState('filter.published', $published);

        $search = $this->getUserStateFromRequest($this->context.'.filter.search', 'filter_search');
        $this->setState('filter.search', $search);

        // List state information.
        parent::populateState('a.title', 'asc');
    }

    /**
     * Method to get a store id based on model configuration state.
     *
     * This is necessary because the model is used by the component and
     * different modules that might need different sets of data or different
     * ordering requirements.
     *
     * @param   string      $id A prefix for the store id.
     *
     * @return  string      A store id.
     */
    protected function getStoreId($id = '')
    {
        // Compile the store id.
        $id .= ':'.$this->getState('filter.search');
        $id .= ':'.$this->getState('filter.access');
        $id .= ':'.$this->getState('filter.published');

        return parent::getStoreId($id);
    }

    /**
     * @param       boolean True to join selected foreign information
     *
     * @return      string
     */
    protected function getListQuery($resolveFKs = true)
    {
        $db     = $this->getDbo();
        // Create a new query object.
        $query = $db->getQuery(true);

        // Select the required fields from the table.
        $query->select(
                $this->getState(
                          'list.select',
                          'a.*')
        );
        $query->from('#__xmap_sitemap AS a');

        // Join over the asset groups.
        $query->select('ag.title AS access_level');
        $query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');

        // Filter by access level.
        if ($access = $this->getState('filter.access')) {
            $query->where('a.access = ' . (int) $access);
        }

        // Filter by published state
        $published = $this->getState('filter.published');
        if (is_numeric($published)) {
            $query->where('a.state = ' . (int) $published);
        } else if ($published === '') {
            $query->where('(a.state = 0 OR a.state = 1)');
        }

        // Filter by search in title.
        $search = $this->getState('filter.search');
        if (!empty($search)) {
            if (stripos($search, 'id:') === 0) {
                $query->where('a.id = '.(int) substr($search, 3));
            }
            else {
                $search = $db->Quote('%'.$db->escape($search, true).'%');
                $query->where('(a.title LIKE '.$search.' OR a.alias LIKE '.$search.')');
            }
        }

        // Add the list ordering clause.
        $query->order($db->escape($this->state->get('list.ordering', 'a.title')) . ' ' . $db->escape($this->state->get('list.direction', 'ASC')));
        //echo nl2br(str_replace('#__','jos_',$query));
        return $query;
    }

    public function getExtensionsMessage()
    {
        $db    = $this->getDbo();
        $query = $db->getQuery(true);
        $query->select('e.*');
        $query->from($db->quoteName('#__extensions'). 'AS e');
        $query->join('INNER', '#__extensions AS p ON e.element=p.element and p.enabled=0 and p.type=\'plugin\' and p.folder=\'xmap\'');
        $query->where('e.type=\'component\' and e.enabled=1');

        $db->setQuery($query);
        $extensions = $db->loadObjectList();
        if ( count($extensions) ) {
            $sep = $extensionsNameList = '';
            foreach ($extensions as $extension) {
                $extensionsNameList .= "$sep$extension->element";
                $sep = ', ';
            }

            return JText::sprintf('XMAP_MESSAGE_EXTENSIONS_DISABLED',$extensionsNameList);
        } else {
            return "";
        }
    }

}
models/forms/sitemap.xml000060400000023173152455704340011354 0ustar00<?xml version="1.0" encoding="utf-8"?>
<!-- $Id$ -->
<form>
    <fields addpath="administrator/components/com_xmap/elements">
        <field
            id="id"
            name="id"
            type="hidden"
            label="XMAP_ID_LABEL"
            size="10"
            default="0"
            required="true"
            readonly="true"/>

        <field
            id="title"
            name="title"
            type="text"
            label="JGLOBAL_TITLE"
            description="JFIELD_TITLE_DESC"
            class="inputbox input-xlarge"
            labelclass="control-label"
            size="30"
            required="true" />

        <field
            id="alias"
            name="alias"
            type="text"
            label="JFIELD_ALIAS_LABEL"
            description="JFIELD_ALIAS_DESC"
            class="inputbox"
            labelclass="control-label"
            size="30"
            default=""/>

        <field
            id="introtext"
            name="introtext"
            type="editor"
            class="inputbox"
            labelclass="control-label"
            label="XMAP_INTROTEXT_LABEL"
            description="XMAP_INTROTEXT_DESC"
            filter="safehtml"
            default=""/>

        <field
            id="is_default"
            name="is_default"
            type="hidden"
            class="inputbox"
            size="1"
            default="0" />

        <field
            id="state"
            name="state"
            type="list"
            label="JSTATUS"
            description="JFIELD_PUBLISHED_DESC"
            class="inputbox"
            labelclass="control-label"
            size="1"
            default="1">
            <option
                value="1">
                JPUBLISHED</option>
            <option
                value="0">
                JUNPUBLISHED</option>
        </field>

        <field
            id="created"
            name="created"
            type="calendar"
            label="XMAP_CREATED_LABEL"
            description="XMAP_CREATED_DESC"
            class="inputbox"
            labelclass="control-label"
            size="16"
            format="%Y-%m-%d %H-%M-%S" />

        <field
            id="access"
            name="access"
            type="accesslevel"
            label="JFIELD_ACCESS_LABEL"
            description="JFIELD_ACCESS_DESC"
            class="inputbox"
            labelclass="control-label"
            size="1" />

        <field
            id="count_html"
            name="hits"
            type="text"
            label="XMAP_HITSHTML_LABEL"
            description="XMAP_HITS_DESC"
            class="readonly"
            labelclass="control-label"
            size="6"
            readonly="true"
            filter="unset"/>

        <field
            id="count_xml"
            name="hits"
            type="text"
            label="XMAP_HITSXML_LABEL"
            description="XMAP_HITS_DESC"
            class="readonly"
            labelclass="control-label"
            size="6"
            readonly="true"
            filter="unset"/>

        <field
            id="visits_html"
            name="visits_html"
            type="text"
            label="XMAP_VISITSHTML_LABEL"
            description="XMAP_HITS_DESC"
            class="readonly"
            labelclass="control-label"
            size="6"
            readonly="true"
            filter="unset"/>

        <field
            id="visits_xml"
            name="visits_xml"
            type="text"
            label="XMAP_VISITSXML_LABEL"
            description="XMAP_HITS_DESC"
            class="readonly"
            labelclass="control-label"
            size="6"
            readonly="true"
            filter="unset"/>

        <field
            id="selections"
            name="selections"
            type="xmapmenus"
            label="XMAP_MENUASSIGMENT_LABEL"
            description="XMAP_MENUASSIGMENT_DESC"
            class="inputbox"
            labelclass="control-label"
            multiple="multiple"
            array="true"
            size="5"/>

        <field
            id="selections_priority"
            name="selections_priority"
            type="hidden"
            class="inputbox"
            labelclass="control-label"
            multiple="multiple"
            size="5"/>

        <field
            id="selections_changefreq"
            name="selections_changefreq"
            type="hidden"
            class="inputbox"
            labelclass="control-label"
            multiple="multiple"
            size="5"/>
    </fields>

    <fields name="attribs">
        <fieldset name="general" label="XMAP_FIELDSET_OPTIONS">

            <field
                name="showintro"
                type="radio"
                class="btn-group"
                labelclass="control-label"
                label="XMAP_ATTRIBS_SHOW_INTRO_LABEL"
                description="XMAP_ATTRIBS_SHOW_INTRO_DESC"
                default="1">
                <option
                    value="0">JNO</option>
                <option
                    value="1">JYES</option>
            </field>

            <field
                name="show_menutitle"
                type="radio"
                class="btn-group"
                label="XMAP_ATTRIBS_SHOW_MENU_TITLE_LABEL"
                description="XMAP_ATTRIBS_SHOW_MENU_TITLE_DESC"
                labelclass="control-label"
                default="1">
                <option
                    value="0">JNO</option>
                <option
                    value="1">JYES</option>
            </field>

            <field
                name="classname"
                type="text"
                default=""
                label="XMAP_ATTRIBS_CLASSNAME_LABEL"
                labelclass="control-label"
                description="XMAP_ATTRIBS_CLASSNAME_DESC" />

            <field
                name="columns"
                type="text"
                default=""
                labelclass="control-label"
                label="XMAP_ATTRIBS_COLUMNS_LABEL"
                description="XMAP_ATTRIBS_COLUMNS_DESC" />

            <field
                name="exlinks"
                type="radio"
                class="btn-group"
                labelclass="control-label"
                label="XMAP_ATTRIBS_EXTERNAL_LINKS_LABEL"
                description="XMAP_ATTRIBS_EXTERNAL_LINKS_DESC"
                default="1">
                <option
                    value="0">JNO</option>
                <option
                    value="1">JYES</option>
            </field>

            <field
                name="exlinks"
                type="list"
                label="XMAP_ATTRIBS_EXTERNAL_LINKS_IMAGE_LABEL"
                description="XMAP_ATTRIBS_EXTERNAL_LINKS_IMAGE_DESC"
                labelclass="control-label"
                default="1">
                <option
                    value="img_blue.gif">img_blue.gif</option>
                <option
                    value="img_green.gif">img_green.gif</option>
                <option
                    value="img_grey.gif">img_grey.gif</option>
                <option
                    value="img_orange.gif">img_orange.gif</option>
                <option
                    value="img_red.gif">img_red.gif</option>
                <option
                    value="txt_blue.gif">txt_blue.gif</option>
                <option
                    value="txt_green.gif">txt_green.gif</option>
                <option
                    value="txt_grey.gif">txt_grey.gif</option>
                <option
                    value="txt_orange.gif">txt_orange.gif</option>
                <option
                    value="txt_red.gif">txt_red.gif</option>
            </field>

            <field
                name="compress_xml"
                type="radio"
                class="btn-group"
                label="XMAP_ATTRIBS_COMPRESS_XML_LABEL"
                description="XMAP_ATTRIBS_COMPRESS_XML_DESC"
                labelclass="control-label"
                default="1">
                <option
                    value="0">JNO</option>
                <option
                    value="1">JYES</option>
            </field>

            <field
                name="beautify_xml"
                type="radio"
                class="btn-group"
                label="XMAP_ATTRIBS_BEAUTIFY_XML_LABEL"
                description="XMAP_ATTRIBS_BEAUTIFY_XML_DESC"
                labelclass="control-label"
                default="1">
                <option
                    value="0">JNO</option>
                <option
                    value="1">JYES</option>
            </field>

            <field
                name="include_link"
                type="radio"
                class="btn-group"
                label="XMAP_ATTRIBS_INCLUDE_LINK_LABEL"
                description="XMAP_ATTRIBS_INCLUDE_LINK_DESC"
                labelclass="control-label"
                default="1">
                <option
                    value="0">JNO</option>
                <option
                    value="1">JYES</option>
            </field>
        </fieldset>

        <fieldset name="news" label="XMAP_FIELDSET_NEWS_OPTIONS">
          <field
              name="news_publication_name"
              type="text"
              default=""
              labelclass="control-label"
              label="XMAP_ATTRIBS_NEWS_PUBLICATION_NAME_LABEL"
              description="XMAP_ATTRIBS_NEWS_PUBLICATION_NAME_DESC" />
<!--
          <field
              name="news_posts_keywords"
              type="text"
              default=""
              label="XMAP_ATTRIBS_NEWS_POSTS_KEYWORDS_LABEL"
              description="XMAP_ATTRIBS_NEWS_POSTS_KEYWORDS_DESC" />
-->
        </fieldset>
    </fields>

</form>
models/forms/extension.xml000060400000002766152455704340011733 0ustar00<?xml version="1.0" encoding="utf-8"?>
<!-- $Id$ -->
<form>
    <fieldset addpath="administrator/components/com_xmap/elements">

        <field
            name="extension_id"
            label="JGLOBAL_FIELD_ID_LABEL"
            description ="JGLOBAL_FIELD_ID_DESC"
            type="text"
            default="0"
            required="true"
            readonly="true"
            class="readonly" />

        <field
            id="name"
            name="name"
            type="text"
            label="JGLOBAL_TITLE"
            description="JFIELD_TITLE_DESC"
            class="inputbox"
            size="29"
            required="true" />

        <field
            name="enabled"
            type="list"
            label="JFIELD_PUBLISHED_LABEL"
            description="JFIELD_PUBLISHED_DESC"
            default="1">
            <option
                value="0">JNO</option>
            <option
                value="1">Yes</option>
        </field>
        
        <field
            name="folder"
            type="hidden"
            class="readonly"
            size="20"
            label="COM_PLUGINS_FIELD_FOLDER_LABEL"
            description="COM_PLUGINS_FIELD_FOLDER_DESC"
            readonly="true" />

        <field
            name="element"
            type="hidden"
            class="readonly"
            size="20"
            label="COM_PLUGINS_FIELD_ELEMENT_LABEL"
            description="COM_PLUGINS_FIELD_ELEMENT_DESC"
            readonly="true" />
        
    </fieldset>
</form>
models/forms/index.html000060400000000036152455704340011156 0ustar00<!DOCTYPE html><title></title>views/sitemap/index.html000060400000000036152455704340011344 0ustar00<!DOCTYPE html><title></title>views/sitemap/view.html.php000060400000014126152455704340012002 0ustar00<?php
/**
 * @version             $Id$
 * @copyright           Copyright (C) 2007 - 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;

jimport('joomla.application.component.view');

# For compatibility with older versions of Joola 2.5
if (!class_exists('JViewLegacy')){
    class JViewLegacy extends JView {

    }
}

/**
 * @package    Xmap
 * @subpackage com_xmap
 */
class XmapViewSitemap extends JViewLegacy
{

    protected $item;
    protected $list;
    protected $form;
    protected $state;

    /**
     * Display the view
     *
     * @access    public
     */
    function display($tpl = null)
    {
        $app = JFactory::getApplication();
        $this->state = $this->get('State');
        $this->item = $this->get('Item');
        $this->form = $this->get('Form');

        $version = new JVersion;

        // Check for errors.
        if (count($errors = $this->get('Errors'))) {
            JError::raiseError(500, implode("\n", $errors));
            return false;
        }

        JHTML::stylesheet('administrator/components/com_xmap/css/xmap.css');
        // Convert dates from UTC
        $offset = $app->getCfg('offset');
        if (intval($this->item->created)) {
            $this->item->created = JHtml::date($this->item->created, '%Y-%m-%d %H-%M-%S', $offset);
        }

        $this->_setToolbar();

        if (version_compare($version->getShortVersion(), '3.0.0', '<')) {
            $tpl = 'legacy';
        }
        parent::display($tpl);
        JRequest::setVar('hidemainmenu', true);
    }

    /**
     * Display the view
     *
     * @access    public
     */
    function navigator($tpl = null)
    {
        require_once(JPATH_COMPONENT_SITE . '/helpers/xmap.php');
        $app = JFactory::getApplication();
        $this->state = $this->get('State');
        $this->item = $this->get('Item');

        # $menuItems = XmapHelper::getMenuItems($item->selections);
        # $extensions = XmapHelper::getExtensions();
        // Check for errors.
        if (count($errors = $this->get('Errors'))) {
            JError::raiseError(500, implode("\n", $errors));
            return false;
        }

        JHTML::script('mootree.js', 'media/system/js/');
        JHTML::stylesheet('mootree.css', 'media/system/css/');

        $this->loadTemplate('class');
        $displayer = new XmapNavigatorDisplayer($state->params, $this->item);

        parent::display($tpl);
    }

    function navigatorLinks($tpl = null)
    {

        require_once(JPATH_COMPONENT_SITE . '/helpers/xmap.php');
        $link = urldecode(JRequest::getVar('link', ''));
        $name = JRequest::getCmd('e_name', '');
        $Itemid = JRequest::getInt('Itemid');

        $this->item = $this->get('Item');
        $this->state = $this->get('State');
        $menuItems = XmapHelper::getMenuItems($item->selections);
        $extensions = XmapHelper::getExtensions();

        $this->loadTemplate('class');
        $nav = new XmapNavigatorDisplayer($state->params, $item);
        $nav->setExtensions($extensions);

        $this->list = array();
        // Show the menu list
        if (!$link && !$Itemid) {
            foreach ($menuItems as $menutype => &$menu) {
                $menu = new stdclass();
                #$menu->id = 0;
                #$menu->menutype = $menutype;

                $node = new stdClass;
                $node->uid = "menu-" . $menutype;
                $node->menutype = $menutype;
                $node->ordering = $item->selections->$menutype->ordering;
                $node->priority = $item->selections->$menutype->priority;
                $node->changefreq = $item->selections->$menutype->changefreq;
                $node->browserNav = 3;
                $node->type = 'separator';
                if (!$node->name = $nav->getMenuTitle($menutype, @$menu->module)) {
                    $node->name = $menutype;
                }
                $node->link = '-menu-' . $menutype;
                $node->expandible = true;
                $node->selectable = false;
                //$node->name = $this->getMenuTitle($menutype,@$menu->module);    // get the mod_mainmenu title from modules table

                $this->list[] = $node;
            }
        } else {
            $parent = new stdClass;
            if ($Itemid) {
                // Expand a menu Item
                $items = &JSite::getMenu();
                $node = & $items->getItem($Itemid);
                if (isset($menuItems[$node->menutype])) {
                    $parent->name = $node->title;
                    $parent->id = $node->id;
                    $parent->uid = 'itemid' . $node->id;
                    $parent->link = $link;
                    $parent->type = $node->type;
                    $parent->browserNav = $node->browserNav;
                    $parent->priority = $item->selections->{$node->menutype}->priority;
                    $parent->changefreq = $item->selections->{$node->menutype}->changefreq;
                    $parent->menutype = $node->menutype;
                    $parent->selectable = false;
                    $parent->expandible = true;
                }
            } else {
                $parent->id = 1;
                $parent->link = $link;
            }
            $this->list = $nav->expandLink($parent);
        }

        parent::display('links');
        exit;
    }

    /**
     * Display the toolbar
     *
     * @access    private
     */
    function _setToolbar()
    {
        $user = JFactory::getUser();
        $isNew = ($this->item->id == 0);

        JToolBarHelper::title(JText::_('XMAP_PAGE_' . ($isNew ? 'ADD_SITEMAP' : 'EDIT_SITEMAP')), 'article-add.png');

        JToolBarHelper::apply('sitemap.apply', 'JTOOLBAR_APPLY');
        JToolBarHelper::save('sitemap.save', 'JTOOLBAR_SAVE');
        JToolBarHelper::save2new('sitemap.save2new');
        if (!$isNew) {
            JToolBarHelper::save2copy('sitemap.save2copy');
        }
        JToolBarHelper::cancel('sitemap.cancel', 'JTOOLBAR_CLOSE');
    }

}
views/sitemap/tmpl/edit_legacy.php000060400000006324152455704340013313 0ustar00<?php
/**
 * @version          $Id$
 * @copyright        Copyright (C) 2007 - 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)
 */
defined('_JEXEC') or die;

// Include the component HTML helpers.
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');

jimport('joomla.html.pane');

// Load the tooltip behavior.
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
?>
<script type="text/javascript">
<!--
    function submitbutton(task)
    {
        if (task == 'sitemap.cancel' || document.formvalidator.isValid($('adminForm'))) {
            submitform(task);
        }
    }
// -->
</script>

<form action="<?php echo JRoute::_('index.php?option=com_xmap&layout=edit&id='.$this->item->id); ?>" method="post" name="adminForm" id="adminForm" class="form-validate">

    <div class="width-60 fltlft">
        <fieldset class="adminform">
            <?php echo $this->form->getLabel('id'); ?>
            <?php echo $this->form->getInput('id'); ?>

            <?php echo $this->form->getLabel('title'); ?>
            <?php echo $this->form->getInput('title'); ?>

            <?php echo $this->form->getLabel('alias'); ?>
            <?php echo $this->form->getInput('alias'); ?>

            <?php echo $this->form->getLabel('state'); ?>
            <?php echo $this->form->getInput('state'); ?>

            <?php echo $this->form->getLabel('access'); ?>
            <?php echo $this->form->getInput('access'); ?>

            <div class="clr"></div>
            <?php echo $this->form->getLabel('introtext'); ?><br />
            <div class="clr"></div>
            <?php echo $this->form->getInput('introtext'); ?>
        </fieldset>
    </div>

    <div class="width-40" style="float:left">
        <?php echo JHtml::_('sliders.start', 'xmap-sliders-' . $this->item->id, array('useCookie' => 1)); ?>
        <?php echo JHtml::_('sliders.panel', JText::_('XMAP_FIELDSET_MENUS'), 'menus-details'); ?>
        <?php echo $this->form->getInput('selections'); ?>
        <?php
            $fieldSets = $this->form->getFieldsets('attribs');
            foreach ($fieldSets as $name => $fieldSet) :
                echo JHtml::_('sliders.panel', JText::_($fieldSet->label), $name . '-options');
                if (isset($fieldSet->description) && trim($fieldSet->description)) :
                    echo '<p class="tip">' . $this->escape(JText::_($fieldSet->description)) . '</p>';
                endif;
        ?>
                <fieldset class="panelform">
                    <ul class="adminformlist">
                    <?php foreach ($this->form->getFieldset($name) as $field) : ?>
                        <li>
                            <?php echo $field->label; ?>
                            <?php echo $field->input; ?>
                        </li>
                    <?php endforeach; ?>
                    </ul>
                </fieldset>
        <?php endforeach; ?>

        <?php echo JHtml::_('sliders.end'); ?>
    </div>

    <input type="hidden" name="task" value="" />
    <?php echo $this->form->getInput('is_default'); ?>
    <?php echo JHtml::_('form.token'); ?>
</form>
<div class="clr"></div>
views/sitemap/tmpl/navigator.php000060400000007537152455704340013043 0ustar00<?php
/**
 * @version             $Id$
 * @copyright        Copyright (C) 2007 - 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)
 */

defined('_JEXEC') or die;

$name = JRequest::getCmd('e_name');

$doc =& JFactory::getDocument();
$doc->addScriptDeclaration('
    var tree;
    var autotext = \'\';
    insertLink = function (){
        var link = $(\'f_link\').get(\'value\');
        var text = $(\'f_text\').get(\'value\');
        var title = $(\'f_title\').get(\'value\');
        var cssstyle = $(\'f_cssstyle\').get(\'value\');
        var cssclass = $(\'f_cssclass\').get(\'value\');
        if (link != \'\' && text != \'\') {
            var extra =\'\';
            if (title != \'\') {
                extra = extra + \' title=\'+title.replace(\'"\',\'&quot;\')+\'"\';
            }
            if (cssclass != \'\') {
                extra = extra + \' class=\'+cssclass.replace(\'"\',\'&quot;\')+\'"\';
            }
            if (cssstyle != \'\') {
                extra = extra + \' style=\'+cssstyle.replace(\'"\',\'&quot;\')+\'"\';
            }
            var tag = "<a href=\""+link+"\" "+extra+">"+text+"</a>";
            window.parent.jInsertEditorText(tag, "'.htmlspecialchars($name).'");
        }
        window.parent.SqueezeBox.close();
    };
    window.addEvent("domready",function(){
        tree =  new MooTreeControl({ 
        div: \'xmap-nav_tree\', 
        mode: \'files\',
        grid: true,
        theme: \'../media/media/images/mootree.gif\',
        onSelect: function (node,state) {
            if (typeof node.data.link != \'undefined\' && node.data.selectable == \'true\') {
                document.adminForm.link.value = node.data.link;
                if (document.adminForm.text.value == autotext ) {
                    document.adminForm.text.value = node.text;
                    autotext =  node.text;
                }
            }
        }
    },{
        text: \'Home\',
        open: true
    });
    tree.root.load(\'index.php?option=com_xmap&task=navigator-links&sitemap='.$this->item->id.'&e_name='.$name.'&tmpl=component\');
    });
    ');
?>
<div id="xmap-nav_tree" style="height:250px;overflow:auto;border:1px solid #CCC;"></div>
    <div id="xmap-nav_linkinfo" style="margin-top:3px;border:1px solid #CCC;height:120px;">
        <form name="adminForm" action="#" onSubmit="return false;">
        <table width="100%">
            <tr>
                <td><?php echo JText::_('Xmap_Link_Text'); ?></td>
                <td colspan="3"><input type="text" name="text" id="f_text" value="" size="30" /></td>
            </tr>
            <tr>
                <td><?php echo JText::_('Xmap_Link_Title'); ?></td>
                <td colspan="3"><input type="text" name="title" id="f_title"  value="" size="30" /></td>
            </tr>
            <tr>
                <td><?php echo JText::_('Xmap_Link_Link'); ?></td>
                <td colspan="3"><input type="text" name="link" id="f_link"  value="" size="50" /></td>
            </tr>
            <tr>
                <td><?php echo JText::_('Xmap_Link_Style'); ?></td>
                <td><input type="text" name="cssstyle" id="f_cssstyle"  value="" /></td>
                <td><?php echo JText::_('Xmap_Link_Class'); ?></td>
                <td><input type="text" name="cssclass" id="f_cssclass"  value="" /></td>
            </tr>
            <tr>
                <td colspan="4" align="right">
                    <button name="cssstyle" id="f_cssstyle" onclick="insertLink();"><?php echo JText::_('OK'); ?></button> 
                    <button name="cssstyle" id="f_cssstyle" onclick="window.parent.SqueezeBox.close();"><?php echo JText::_('Cancel'); ?></button>
                </td>
           </tr>
        </table>
    </form>
</div>
<ul id="xmap-nav"></ul>
views/sitemap/tmpl/edit.php000060400000012250152455704340011762 0ustar00<?php
/**
 * @version          $Id$
 * @copyright        Copyright (C) 2007 - 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)
 */
defined('_JEXEC') or die;

// Include the component HTML helpers.
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');

// Load the tooltip behavior.
JHtml::_('behavior.tooltip');
JHtml::_('behavior.formvalidation');
if(version_compare(JVERSION,'3.0.0','ge')) {
    JHtml::_('formbehavior.chosen', 'select');
}
?>
<script type="text/javascript">
<!--
    function submitbutton(task)
    {
        if (task == 'sitemap.cancel' || document.formvalidator.isValid($('adminForm'))) {
            submitform(task);
        }
    }
// -->
</script>
<form action="<?php echo JRoute::_('index.php?option=com_xmap&layout=edit&id='.$this->item->id); ?>" method="post" name="adminForm" id="adminForm" class="form-validate">
    <div class="row-fluid">
        <!-- Begin Content -->
        <div class="span10 form-horizontal">
            <ul class="nav nav-tabs">
                <li class="active"><a href="#general" data-toggle="tab"><?php echo JText::_('XMAP_SITEMAP_DETAILS_FIELDSET');?></a></li>
                <li><a href="#attrib-menus" data-toggle="tab"><?php echo JText::_('XMAP_FIELDSET_MENUS');?></a></li>
                <?php
                $fieldSets = $this->form->getFieldsets('attribs');
                foreach ($fieldSets as $name => $fieldSet) :
                ?>
                <li><a href="#attrib-<?php echo $name;?>" data-toggle="tab"><?php echo JText::_($fieldSet->label);?></a></li>
                <?php
                endforeach;
                ?>
            </ul>

            <div class="tab-content">
                <div class="tab-pane active" id="general">
                    <div class="row-fluid">
                        <div class="span10">
                            <div class="control-group">
                                <?php echo $this->form->getLabel('title'); ?>
                                <div class="controls">
                                    <?php echo $this->form->getInput('title'); ?>
                                </div>
                            </div>
                            <div class="control-group">
                                <?php echo $this->form->getLabel('alias'); ?>
                                <div class="controls">
                                    <?php echo $this->form->getInput('alias'); ?>
                                </div>
                            </div>
                            <div class="control-group">
                                <?php echo $this->form->getLabel('state'); ?>
                                <div class="controls">
                                    <?php echo $this->form->getInput('state'); ?>
                                </div>
                            </div>
                            <div class="control-group">
                                <?php echo $this->form->getLabel('access'); ?>
                                <div class="controls">
                                    <?php echo $this->form->getInput('access'); ?>
                                </div>
                            </div>
                            <div class="control-group">
                                <div class="clr"></div>
                                <?php echo $this->form->getLabel('introtext'); ?><br />
                                <div class="clr"></div>
                                <div class="controls">
                                    <?php echo $this->form->getInput('introtext'); ?>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="tab-pane" id="attrib-menus">
                    <div style="width:500px">
                        <?php echo $this->form->getInput('selections'); ?>
                    </div>
                </div>
                <?php
                $fieldSets = $this->form->getFieldsets('attribs');
                foreach ($fieldSets as $name => $fieldSet) :
                ?>
                <div class="tab-pane" id="attrib-<?php echo $name;?>">
                    <?php
                    if (isset($fieldSet->description) && trim($fieldSet->description)) :
                        echo '<p class="tip">' . $this->escape(JText::_($fieldSet->description)) . '</p>';
                    endif;

                    foreach ($this->form->getFieldset($name) as $field) :
                    ?>
                    <div class="control-group">
                        <?php echo $field->label; ?>
                        <div class="controls">
                            <?php echo $field->input; ?>
                        </div>
                    </div>
                    <?php endforeach; ?>
                </div>
                <?php endforeach; ?>
            </div>
        </div>
    </div>

    <input type="hidden" name="task" value="" />
    <?php echo $this->form->getInput('is_default'); ?>
    <?php echo JHtml::_('form.token'); ?>
</form>
<div class="clr"></div>
views/sitemap/tmpl/navigator_class.php000060400000010063152455704340014214 0ustar00<?php
/**
 * @version             $Id$
 * @copyright           Copyright (C) 2007 - 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;

require_once(JPATH_COMPONENT_SITE.'/displayer.php');

class XmapNavigatorDisplayer extends XmapDisplayer {

    function __construct(&$config, &$sitemap) {
        $this->_list=array();
        $this->view='navigator';
    
        parent::__construct( $config, $sitemap);    
    }
    
    function printNode( &$node ) {
        if (!isset($node->selectable )) {
            $node->selectable=true;
        }
        // For extentions that doesn't set this property as this is new in Xmap 1.2.3
        if (!isset($node->expandible )) { 
            $node->expandible = true;
        }
        if ( empty($this->_list[$node->uid]) ) { // Avoid duplicated items
            $this->_list[$node->uid] = $node;
        }
        return false;
    }

    function &expandLink(&$parent)    {
        $items = &JSite::getMenu();
        $extensions = &$this->_extensions;
        $rows = null;
        if (strpos($parent->link,'-menu-') === 0 ) {
            $menutype = str_replace('-menu-','',$parent->link);
            // Get Menu Items
            $rows = $items->getItems('menutype', $menutype);
        } elseif ($parent->id) {
            $rows = $items->getItems('parent_id', $parent->id);
        }

        if ( $rows ) {
            foreach ($rows as $item) {
                if ($item->parent_id == $parent->id) {
                    $node = new stdclass;
                    $node->name = $item->title;
                    $node->id   = $item->id;
                    $node->uid  = 'itemid'.$item->id;
                    $node->link = $item->link;
                    $node->expandible = true;
                    $node->selectable=true;
                    // Prepare the node link
                    XmapHelper::prepareMenuItem($node);
                    if ( $item->home ) {
                        $node->link = JURI::root();
                    } elseif (substr($item->link,0,9) == 'index.php' && $item->type != 'url' ) {
                        if ($item->type == 'menulink') {// For Joomla 1.5 SEF compatibility
                            $params = new JParameter($item->params);
                            $node->link     = 'index.php?Itemid=' . $params->get('menu_item');
                        } elseif ( strpos($item->link,'Itemid=') === FALSE ){
                            $node->link     = 'index.php?Itemid=' . $node->id;
                        }
                    } elseif ($item->type == 'separator') {
                        $node->selectable=false;
                    }
                    $this->printNode($node);  // Add to the internal list
                }
            }

        }
        if ($parent->id) {
            $option = null;
            if ( preg_match('#^/?index.php.*option=(com_[^&]+)#',$parent->link,$matches) ) {
                $option = $matches[1];
            }
            $Itemid = JRequest::getInt('Itemid');
            if (!$option && $Itemid) {
                $item = $items->getItem($Itemid);
                $link_query = parse_url( $item->link );
                parse_str( html_entity_decode($link_query['query']), $link_vars);
                $option = JArrayHelper::getValue($link_vars,'option','');
                if ( $option ) {
                    $parent->link = $item->link;
                }
            }
            if ( $option ) {
                if ( !empty($extensions[$option]) ) {
                    $parent->uid = $option;
                    $className = 'xmap_'.$option;
                    $result = call_user_func_array(array($className, 'getTree'),array(&$this,&$parent,$extensions[$option]->params));
                }
            }
        }
        return $this->_list;;
    }

    function &getParam($arr, $name, $def) {
        $var = JArrayHelper::getValue( $arr, $name, $def, '' );
        return $var;
    }
}
views/sitemap/tmpl/index.html000060400000000036152455704340012320 0ustar00<!DOCTYPE html><title></title>views/sitemap/tmpl/navigator_links.php000060400000002051152455704340014225 0ustar00<?php
/**
 * @version          $Id$
 * @copyright        Copyright (C) 2007 - 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)
 */

defined('_JEXEC') or die;

header('Content-type: text/xml');

$name = JRequest::getCmd('e_name');
?>
<?xml version="1.0" encoding="UTF-8" ?>
<nodes>
<?php foreach ($this->list as $node) {
    $load = 'index.php?option=com_xmap&amp;task=navigator-links&amp;sitemap='.$this->item->id.'&amp;e_name='.$name.(isset($node->id)?'&amp;Itemid='.$node->id:'').(isset($node->link)?'&amp;link='.urlencode($node->link):'').'&amp;tmpl=component';
?>
    <node text="<?php echo htmlentities($node->name); ?>" <?php echo ($node->expandible?" openicon=\"_open\" icon=\"_closed\" load=\"$load\"":' icon="_doc"'); ?> uid="<?php $node->uid; ?>" link="<?php echo str_replace(array('&amp;','&'),array('&','&amp;'),$node->link); ?>" selectable="<?php echo ($node->selectable?'true':'false'); ?>" />
<?php } ?>
</nodes>
views/sitemaps/tmpl/index.html000060400000000036152455704340012503 0ustar00<!DOCTYPE html><title></title>views/sitemaps/tmpl/default_legacy.php000060400000021765152455704340014203 0ustar00<?php
/**
 * @version     $Id$
 * @copyright   Copyright (C) 2007 - 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;

JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');

$n = count($this->items);

$baseUrl = JUri::root();

$version = new JVersion;

?>
<form action="<?php echo JRoute::_('index.php?option=com_xmap&view=sitemaps');?>" method="post" name="adminForm" id="adminForm">
    <fieldset class="filter clearfix">
        <div class="left">
            <label for="search">
                <?php echo JText::_('JSearch_Filter_Label'); ?>
            </label>
            <input type="text" name="filter_search" id="filter_search" value="<?php echo $this->state->get('filter.search'); ?>" size="60" title="<?php echo JText::_('Xmap_Filter_Search_Desc'); ?>" />

            <button type="submit">
                <?php echo JText::_('JSearch_Filter_Submit'); ?></button>
            <button type="button" onclick="$('filter_search').value='';this.form.submit();">
                <?php echo JText::_('JSearch_Filter_Clear'); ?></button>
        </div>

        <div class="right">
            <select name="filter_access" class="inputbox" onchange="this.form.submit()">
                <option value=""><?php echo JText::_('JOption_Select_Access');?></option>
                <?php echo JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'));?>
            </select>

            <select name="filter_published" class="inputbox" onchange="this.form.submit()">
                <option value=""><?php echo JText::_('JOption_Select_Published');?></option>
                <?php echo JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true);?>
            </select>

        </div>
    </fieldset>

    <table class="adminlist">
        <thead>
            <tr>
                <th width="20">
                    <input type="checkbox" name="toggle" value="" onclick="checkAll(this)" />
                </th>
                <th class="title">
                    <?php echo JHtml::_('grid.sort', 'Xmap_Heading_Sitemap', 'a.title', $this->state->get('list.direction'), $this->state->get('list.ordering')); ?>
                </th>
                <th width="5%">
                    <?php echo JHtml::_('grid.sort', 'Xmap_Heading_Published', 'a.state', $this->state->get('list.direction'), $this->state->get('list.ordering')); ?>
                </th>
                <th width="10%">
                    <?php echo JHtml::_('grid.sort',  'Xmap_Heading_Access', 'access_level', $this->state->get('list.direction'), $this->state->get('list.ordering')); ?>
                </th>
                <th width="10%" class="nowrap">
                    <?php echo JText::_('Xmap_Heading_Html_Stats'); ?><br />
                    (<?php echo JText::_('Xmap_Heading_Num_Links') . ' / '. JText::_('Xmap_Heading_Num_Hits') . ' / ' . JText::_('Xmap_Heading_Last_Visit'); ?>)
                </th>
                <th width="10%" class="nowrap">
                    <?php echo JText::_('Xmap_Heading_Xml_Stats'); ?><br />
                    <?php echo JText::_('Xmap_Heading_Num_Links') . '/'. JText::_('Xmap_Heading_Num_Hits') . '/' . JText::_('Xmap_Heading_Last_Visit'); ?>
                </th>
                <th width="1%" class="nowrap">
                    <?php echo JHtml::_('grid.sort', 'Xmap_Heading_ID', 'a.id', $this->state->get('list.direction'), $this->state->get('list.ordering')); ?>
                </th>
            </tr>
        </thead>
        <tfoot>
            <tr>
                <td colspan="15">
                    <?php echo $this->pagination->getListFooter(); ?>
                </td>
            </tr>
        </tfoot>
        <tbody>
        <?php foreach ($this->items as $i => $item) :

            $now = JFactory::getDate()->toUnix();
            if ( !$item->lastvisit_html ) {
                $htmlDate = JText::_('Date_Never');
            }elseif ( $item->lastvisit_html > ($now-3600)) { // Less than one hour
                $htmlDate = JText::sprintf('Date_Minutes_Ago',intval(($now-$item->lastvisit_html)/60));
            } elseif ( $item->lastvisit_html > ($now-86400)) { // Less than one day
                $hours = intval (($now-$item->lastvisit_html)/3600 );
                $htmlDate = JText::sprintf('Date_Hours_Minutes_Ago',$hours,($now-($hours*3600)-$item->lastvisit_html)/60);
            } elseif ( $item->lastvisit_html > ($now-259200)) { // Less than three days
                $days = intval(($now-$item->lastvisit_html)/86400);
                $htmlDate = JText::sprintf('Date_Days_Hours_Ago',$days,intval(($now-($days*86400)-$item->lastvisit_html)/3600));
            } else {
                $date = new JDate($item->lastvisit_html);
                $htmlDate = $date->format('Y-m-d H:i');
            }

            if ( !$item->lastvisit_xml ) {
                $xmlDate = JText::_('Date_Never');
            } elseif ( $item->lastvisit_xml > ($now-3600)) { // Less than one hour
                $xmlDate = JText::sprintf('Date_Minutes_Ago',intval(($now-$item->lastvisit_xml)/60));
            } elseif ( $item->lastvisit_xml > ($now-86400)) { // Less than one day
                $hours = intval (($now-$item->lastvisit_xml)/3600 );
                $xmlDate = JText::sprintf('Date_Hours_Minutes_Ago',$hours,($now-($hours*3600)-$item->lastvisit_xml)/60);
            } elseif ( $item->lastvisit_xml > ($now-259200)) { // Less than three days
                $days = intval(($now-$item->lastvisit_xml)/86400);
                $xmlDate = JText::sprintf('Date_Days_Hours_Ago',$days,intval(($now-($days*86400)-$item->lastvisit_xml)/3600));
            } else {
                $date = new JDate($item->lastvisit_xml);
                $xmlDate = $date->format('Y-m-d H:i');
            }

        ?>
            <tr class="row<?php echo $i % 2; ?>">
                <td class="center">
                    <?php echo JHtml::_('grid.id', $i, $item->id); ?>
                </td>
                <td>
                    <a href="<?php echo JRoute::_('index.php?option=com_xmap&task=sitemap.edit&id='.$item->id);?>">
                        <?php echo $this->escape($item->title); ?></a>
                        <?php if ($item->is_default == 1) : ?>
                            <?php if (version_compare($version->getShortVersion(), '3.0.0', '>=')): ?>
                                <span class="icon-featured"></span>
                            <?php else: ?>
                                <img src="templates/bluestork/images/menu/icon-16-default.png" alt="<?php echo JText::_('Default'); ?>" />
                            <?php endif; ?>
                        <?php endif; ?>
                            <?php if ($item->state): ?>
                                <small>[<a href="<?php echo $baseUrl. 'index.php?option=com_xmap&amp;view=xml&tmpl=component&id='.$item->id; ?>" target="_blank" title="<?php echo JText::_('XMAP_XML_LINK_TOOLTIP',true); ?>"><?php echo JText::_('XMAP_XML_LINK'); ?></a>]</small>
                                <small>[<a href="<?php echo $baseUrl. 'index.php?option=com_xmap&amp;view=xml&tmpl=component&news=1&id='.$item->id; ?>" target="_blank" title="<?php echo JText::_('XMAP_NEWS_LINK_TOOLTIP',true); ?>"><?php echo JText::_('XMAP_NEWS_LINK'); ?></a>]</small>
                                <small>[<a href="<?php echo $baseUrl. 'index.php?option=com_xmap&amp;view=xml&tmpl=component&images=1&id='.$item->id; ?>" target="_blank" title="<?php echo JText::_('XMAP_IMAGES_LINK_TOOLTIP',true); ?>"><?php echo JText::_('XMAP_IMAGES_LINK'); ?></a>]</small>
                            <?php endif; ?>
                                <br />
								<small>(<?php echo $this->escape($item->alias); ?>)</small>
                </td>
                <td class="center">
                    <?php echo JHtml::_('jgrid.published', $item->state, $i, 'sitemaps.'); ?>
                </td>
                <td class="center">
                    <?php echo $this->escape($item->access_level); ?>
                </td>
                <td class="center">
                    <?php echo $item->count_html .' / '.$item->views_html. ' / ' . $htmlDate; ?>
                </td>
                <td class="center">
                    <?php echo $item->count_xml .' / '.$item->views_xml. ' / ' . $xmlDate; ?>
                </td>
                <td class="center">
                    <?php echo (int) $item->id; ?>
                </td>
            </tr>
        <?php endforeach; ?>
        </tbody>
    </table>

    <input type="hidden" name="task" value="" />
    <input type="hidden" name="boxchecked" value="0" />
    <input type="hidden" name="filter_order" value="<?php echo $this->state->get('list.ordering'); ?>" />
    <input type="hidden" name="filter_order_Dir" value="<?php echo $this->state->get('list.direction'); ?>" />
    <?php echo JHtml::_('form.token'); ?>
</form>
views/sitemaps/tmpl/modal.php000060400000016577152455704340012334 0ustar00<?php
/**
 * @version             $Id$
 * @copyright            Copyright (C) 2007 - 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;

JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('behavior.tooltip');

$function = JRequest::getVar('function', 'jSelectSitemap');
$n = count($this->items);
?>
<form action="<?php echo JRoute::_('index.php?option=com_xmap&view=sitemaps');?>" method="post" name="adminForm">
    <fieldset class="filter clearfix">
        <div class="left">
            <label for="search">
                <?php echo JText::_('JSearch_Filter_Label'); ?>
            </label>
            <input type="text" name="filter_search" id="filter_search" value="<?php echo $this->state->get('filter.search'); ?>" size="60" title="<?php echo JText::_('Xmap_Filter_Search_Desc'); ?>" />

            <button type="submit">
                <?php echo JText::_('JSearch_Filter_Submit'); ?></button>
            <button type="button" onclick="$('filter_search').value='';this.form.submit();">
                <?php echo JText::_('JSearch_Filter_Clear'); ?></button>
        </div>

        <div class="right">
            <select name="filter_access" class="inputbox" onchange="this.form.submit()">
                <option value=""><?php echo JText::_('JOption_Select_Access');?></option>
                <?php echo JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'));?>
            </select>

            <select name="filter_published" class="inputbox" onchange="this.form.submit()">
                <option value=""><?php echo JText::_('JOption_Select_Published');?></option>
                <?php echo JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true);?>
            </select>

        </div>
    </fieldset>

    <table class="adminlist">
        <thead>
            <tr>
                <th class="title">
                    <?php echo JHtml::_('grid.sort', 'Xmap_Heading_Sitemap', 'a.title', $this->state->get('list.direction'), $this->state->get('list.ordering')); ?>
                </th>
                <th width="5%">
                    <?php echo JHtml::_('grid.sort', 'Xmap_Heading_Published', 'a.state', $this->state->get('list.direction'), $this->state->get('list.ordering')); ?>
                </th>
                <th width="10%">
                    <?php echo JHtml::_('grid.sort',  'JGrid_Heading_Access', 'access_level', $this->state->get('list.direction'), $this->state->get('list.ordering')); ?>
                </th>
                <th width="10%" nowrap="nowrap">
                    <?php echo JText::_('Xmap_Heading_Html_Stats'); ?><br />
                    (<?php echo JText::_('Xmap_Heading_Num_Links') . ' / '. JText::_('Xmap_Heading_Num_Hits') . ' / ' . JText::_('Xmap_Heading_Last_Visit'); ?>)
                </th>
                <th width="10%" nowrap="nowrap">
                    <?php echo JText::_('Xmap_Heading_Xml_Stats'); ?><br />
                    <?php echo JText::_('Xmap_Heading_Num_Links') . '/'. JText::_('Xmap_Heading_Num_Hits') . '/' . JText::_('Xmap_Heading_Last_Visit'); ?>
                </th>
                <th width="1%" nowrap="nowrap">
                    <?php echo JHtml::_('grid.sort', 'JGrid_Heading_ID', 'a.id', $this->state->get('list.direction'), $this->state->get('list.ordering')); ?>
                </th>
            </tr>
        </thead>
        <tfoot>
            <tr>
                <td colspan="15">
                    <?php echo $this->pagination->getListFooter(); ?>
                </td>
            </tr>
        </tfoot>
        <tbody>
        <?php
        foreach ($this->items as $i => $item) :

            $now = JFactory::getDate()->toUnix();
            if ( !$item->lastvisit_html ) {
                $htmlDate = JText::_('Date_Never');
            }elseif ( $item->lastvisit_html > ($now-3600)) { // Less than one hour
                $htmlDate = JText::sprintf('Date_Minutes_Ago',intval(($now-$item->lastvisit_html)/60));
            } elseif ( $item->lastvisit_html > ($now-86400)) { // Less than one day
                $hours = intval (($now-$item->lastvisit_html)/3600 );
                $htmlDate = JText::sprintf('Date_Hours_Minutes_Ago',$hours,($now-($hours*3600)-$item->lastvisit_html)/60);
            } elseif ( $item->lastvisit_html > ($now-259200)) { // Less than three days
                $days = intval(($now-$item->lastvisit_html)/86400);
                $htmlDate = JText::sprintf('Date_Days_Hours_Ago',$days,intval(($now-($days*86400)-$item->lastvisit_html)/3600));
            } else {
                $date = new JDate($item->lastvisit_html);
                $htmlDate = $date->toFormat('%Y-%m-%d %H:%M');
            }

            if ( !$item->lastvisit_xml ) {
                $xmlDate = JText::_('Date_Never');
            } elseif ( $item->lastvisit_xml > ($now-3600)) { // Less than one hour
                $xmlDate = JText::sprintf('Date_Minutes_Ago',intval(($now-$item->lastvisit_xml)/60));
            } elseif ( $item->lastvisit_xml > ($now-86400)) { // Less than one day
                $hours = intval (($now-$item->lastvisit_xml)/3600 );
                $xmlDate = JText::sprintf('Date_Hours_Minutes_Ago',$hours,($now-($hours*3600)-$item->lastvisit_xml)/60);
            } elseif ( $item->lastvisit_xml > ($now-259200)) { // Less than three days
                $days = intval(($now-$item->lastvisit_xml)/86400);
                $xmlDate = JText::sprintf('Date_Days_Hours_Ago',$days,intval(($now-($days*86400)-$item->lastvisit_xml)/3600));
            } else {
                $date = new JDate($item->lastvisit_xml);
                $xmlDate = $date->toFormat('%Y-%m-%d %H:%M');
            }

        ?>
            <tr class="row<?php echo $i % 2; ?>">
                <td>
                    <a style="cursor: pointer;" onclick="if (window.parent) window.parent.<?php echo $function;?>('<?php echo $item->id; ?>', '<?php echo $this->escape($item->title); ?>');">
                        <?php echo $this->escape($item->title); ?></a>
                </td>
                <td align="center">
                    <?php echo JHtml::_('jgrid.published', $item->state, $i, 'sitemaps.'); ?>
                </td>
                <td align="center">
                    <?php echo $this->escape($item->access_level); ?>
                </td>
                <td class="center">
                    <?php echo $item->count_html .' / '.$item->views_html. ' / ' . $htmlDate; ?>
                </td>
                <td class="center">
                    <?php echo $item->count_xml .' / '.$item->views_xml. ' / ' . $xmlDate; ?>
                </td>
                <td align="center">
                    <?php echo (int) $item->id; ?>
                </td>
            </tr>
        <?php endforeach; ?>
        </tbody>
    </table>
    <input type="hidden" name="tmpl" value="component" />
    <input type="hidden" name="task" value="" />
    <input type="hidden" name="boxchecked" value="0" />
    <input type="hidden" name="filter_order" value="<?php echo $this->state->get('list.ordering'); ?>" />
    <input type="hidden" name="filter_order_Dir" value="<?php echo $this->state->get('list.direction'); ?>" />
    <?php echo JHtml::_('form.token'); ?>
</form>
views/sitemaps/tmpl/form.php000060400000000000152455704340012151 0ustar00views/sitemaps/tmpl/default.php000060400000022465152455704340012655 0ustar00<?php
/**
 * @version     $Id$
 * @copyright   Copyright (C) 2007 - 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;

JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');
JHtml::_('bootstrap.tooltip');
if(version_compare(JVERSION,'3.0.0','ge')) {
    JHtml::_('formbehavior.chosen', 'select');
}

$n = count($this->items);

$baseUrl = JUri::root();

$version = new JVersion;

?>
<form action="<?php echo JRoute::_('index.php?option=com_xmap&view=sitemaps');?>" method="post" name="adminForm" id="adminForm">
<?php if (!empty( $this->sidebar)): ?>
    <div id="j-sidebar-container" class="span2">
        <?php echo $this->sidebar; ?>
    </div>
    <div id="j-main-container" class="span10">
<?php else : ?>
    <div id="j-main-container">
<?php endif;?>
        <div id="filter-bar" class="btn-toolbar">
            <div class="filter-search btn-group pull-left">
                <input type="text" name="filter_search" id="filter_search" value="<?php echo $this->state->get('filter.search'); ?>" size="60" title="<?php echo JText::_('Xmap_Filter_Search_Desc'); ?>" />
            </div>

            <div class="btn-group pull-left hidden-phone">
                <button class="btn tip hasTooltip" type="submit" title="<?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?>"><i class="icon-search"></i></button>
                <button class="btn tip hasTooltip" type="button" onclick="document.id('filter_search').value='';this.form.submit();" title="<?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?>"><i class="icon-remove"></i></button>
            </div>
        </div>

        <table class="adminlist table table-striped">
            <thead>
                <tr>
                    <th width="20">
                        <input type="checkbox" name="checkall-toggle" value="" title="<?php echo JText::_('JGLOBAL_CHECK_ALL'); ?>" onclick="if (typeof Joomla != 'undefined'){Joomla.checkAll(this)} else {checkAll(this)}" />
                    </th>
                    <th class="title">
                        <?php echo JHtml::_('grid.sort', 'Xmap_Heading_Sitemap', 'a.title', $this->state->get('list.direction'), $this->state->get('list.ordering')); ?>
                    </th>
                    <th width="5%">
                        <?php echo JHtml::_('grid.sort', 'Xmap_Heading_Published', 'a.state', $this->state->get('list.direction'), $this->state->get('list.ordering')); ?>
                    </th>
                    <th width="10%">
                        <?php echo JHtml::_('grid.sort',  'Xmap_Heading_Access', 'access_level', $this->state->get('list.direction'), $this->state->get('list.ordering')); ?>
                    </th>
                    <th width="10%" class="nowrap">
                        <?php echo JText::_('Xmap_Heading_Html_Stats'); ?><br />
                        (<?php echo JText::_('Xmap_Heading_Num_Links') . ' / '. JText::_('Xmap_Heading_Num_Hits') . ' / ' . JText::_('Xmap_Heading_Last_Visit'); ?>)
                    </th>
                    <th width="10%" class="nowrap">
                        <?php echo JText::_('Xmap_Heading_Xml_Stats'); ?><br />
                        <?php echo JText::_('Xmap_Heading_Num_Links') . '/'. JText::_('Xmap_Heading_Num_Hits') . '/' . JText::_('Xmap_Heading_Last_Visit'); ?>
                    </th>
                    <th width="1%" class="nowrap">
                        <?php echo JHtml::_('grid.sort', 'Xmap_Heading_ID', 'a.id', $this->state->get('list.direction'), $this->state->get('list.ordering')); ?>
                    </th>
                </tr>
            </thead>
            <tfoot>
                <tr>
                    <td colspan="15">
                        <?php echo $this->pagination->getListFooter(); ?>
                    </td>
                </tr>
            </tfoot>
            <tbody>
            <?php foreach ($this->items as $i => $item) :

                $now = JFactory::getDate()->toUnix();
                if ( !$item->lastvisit_html ) {
                    $htmlDate = JText::_('Date_Never');
                }elseif ( $item->lastvisit_html > ($now-3600)) { // Less than one hour
                    $htmlDate = JText::sprintf('Date_Minutes_Ago',intval(($now-$item->lastvisit_html)/60));
                } elseif ( $item->lastvisit_html > ($now-86400)) { // Less than one day
                    $hours = intval (($now-$item->lastvisit_html)/3600 );
                    $htmlDate = JText::sprintf('Date_Hours_Minutes_Ago',$hours,($now-($hours*3600)-$item->lastvisit_html)/60);
                } elseif ( $item->lastvisit_html > ($now-259200)) { // Less than three days
                    $days = intval(($now-$item->lastvisit_html)/86400);
                    $htmlDate = JText::sprintf('Date_Days_Hours_Ago',$days,intval(($now-($days*86400)-$item->lastvisit_html)/3600));
                } else {
                    $date = new JDate($item->lastvisit_html);
                    $htmlDate = $date->format('Y-m-d H:i');
                }

                if ( !$item->lastvisit_xml ) {
                    $xmlDate = JText::_('Date_Never');
                } elseif ( $item->lastvisit_xml > ($now-3600)) { // Less than one hour
                    $xmlDate = JText::sprintf('Date_Minutes_Ago',intval(($now-$item->lastvisit_xml)/60));
                } elseif ( $item->lastvisit_xml > ($now-86400)) { // Less than one day
                    $hours = intval (($now-$item->lastvisit_xml)/3600 );
                    $xmlDate = JText::sprintf('Date_Hours_Minutes_Ago',$hours,($now-($hours*3600)-$item->lastvisit_xml)/60);
                } elseif ( $item->lastvisit_xml > ($now-259200)) { // Less than three days
                    $days = intval(($now-$item->lastvisit_xml)/86400);
                    $xmlDate = JText::sprintf('Date_Days_Hours_Ago',$days,intval(($now-($days*86400)-$item->lastvisit_xml)/3600));
                } else {
                    $date = new JDate($item->lastvisit_xml);
                    $xmlDate = $date->format('Y-m-d H:i');
                }

            ?>
                <tr class="row<?php echo $i % 2; ?>">
                    <td class="center">
                        <?php echo JHtml::_('grid.id', $i, $item->id); ?>
                    </td>
                    <td>
                        <a href="<?php echo JRoute::_('index.php?option=com_xmap&task=sitemap.edit&id='.$item->id);?>">
                            <?php echo $this->escape($item->title); ?></a>
                            <?php if ($item->is_default == 1) : ?>
                                <?php if (version_compare($version->getShortVersion(), '3.0.0', '>=')): ?>
                                    <span class="icon-featured"></span>
                                <?php else: ?>
                                    <img src="templates/bluestork/images/menu/icon-16-default.png" alt="<?php echo JText::_('Default'); ?>" />
                                <?php endif; ?>
                            <?php endif; ?>
                                <?php if ($item->state): ?>
                                    <small>[<a href="<?php echo $baseUrl. 'index.php?option=com_xmap&amp;view=xml&tmpl=component&id='.$item->id; ?>" target="_blank" title="<?php echo JText::_('XMAP_XML_LINK_TOOLTIP',true); ?>"><?php echo JText::_('XMAP_XML_LINK'); ?></a>]</small>
                                    <small>[<a href="<?php echo $baseUrl. 'index.php?option=com_xmap&amp;view=xml&tmpl=component&news=1&id='.$item->id; ?>" target="_blank" title="<?php echo JText::_('XMAP_NEWS_LINK_TOOLTIP',true); ?>"><?php echo JText::_('XMAP_NEWS_LINK'); ?></a>]</small>
                                    <small>[<a href="<?php echo $baseUrl. 'index.php?option=com_xmap&amp;view=xml&tmpl=component&images=1&id='.$item->id; ?>" target="_blank" title="<?php echo JText::_('XMAP_IMAGES_LINK_TOOLTIP',true); ?>"><?php echo JText::_('XMAP_IMAGES_LINK'); ?></a>]</small>
                                <?php endif; ?>
                                     <br />
									 <small>(<?php echo $this->escape($item->alias); ?>)</small>
                    </td>
                    <td class="center">
                        <?php echo JHtml::_('jgrid.published', $item->state, $i, 'sitemaps.'); ?>
                    </td>
                    <td class="center">
                        <?php echo $this->escape($item->access_level); ?>
                    </td>
                    <td class="center">
                        <?php echo $item->count_html .' / '.$item->views_html. ' / ' . $htmlDate; ?>
                    </td>
                    <td class="center">
                        <?php echo $item->count_xml .' / '.$item->views_xml. ' / ' . $xmlDate; ?>
                    </td>
                    <td class="center">
                        <?php echo (int) $item->id; ?>
                    </td>
                </tr>
            <?php endforeach; ?>
            </tbody>
        </table>

        <input type="hidden" name="task" value="" />
        <input type="hidden" name="boxchecked" value="0" />
        <input type="hidden" name="filter_order" value="<?php echo $this->state->get('list.ordering'); ?>" />
        <input type="hidden" name="filter_order_Dir" value="<?php echo $this->state->get('list.direction'); ?>" />
        <?php echo JHtml::_('form.token'); ?>
    </div>
</form>
views/sitemaps/view.html.php000060400000007327152455704340012172 0ustar00<?php
/**
 * @version     $Id$
 * @copyright   Copyright (C) 2007 - 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;

jimport('joomla.application.component.view');

# For compatibility with older versions of Joola 2.5
if (!class_exists('JViewLegacy')){
    class JViewLegacy extends JView {

    }
}

/**
 * @package     Xmap
 * @subpackage  com_xmap
 * @since       2.0
 */
class XmapViewSitemaps extends JViewLegacy
{
    protected $state;
    protected $items;
    protected $pagination;

    /**
     * Display the view
     */
    public function display($tpl = null)
    {
        if ($this->getLayout() !== 'modal') {
            XmapHelper::addSubmenu('sitemaps');
        }

        $this->state      = $this->get('State');
        $this->items      = $this->get('Items');
        $this->pagination = $this->get('Pagination');

        $version = new JVersion;

        $message = $this->get('ExtensionsMessage');
        if ( $message ) {
            JFactory::getApplication()->enqueueMessage($message);
        }

        // Check for errors.
        if (count($errors = $this->get('Errors'))) {
            JError::raiseError(500, implode("\n", $errors));
            return false;
        }

        // We don't need toolbar in the modal window.
        if ($this->getLayout() !== 'modal') {
            if (version_compare($version->getShortVersion(), '3.0.0', '<')) {
                $tpl = 'legacy';
            }
            $this->addToolbar();
        }

        parent::display($tpl);
    }

    /**
     * Display the toolbar
     *
     * @access      private
     */
    protected function addToolbar()
    {
        $state = $this->get('State');
        $doc = JFactory::getDocument();
        $version = new JVersion;

        JToolBarHelper::addNew('sitemap.add');
        JToolBarHelper::custom('sitemap.edit', 'edit.png', 'edit_f2.png', 'JTOOLBAR_EDIT', true);

        $doc->addStyleDeclaration('.icon-48-sitemap {background-image: url(components/com_xmap/images/sitemap-icon.png);}');
        JToolBarHelper::title(JText::_('XMAP_SITEMAPS_TITLE'), 'sitemap.png');
        JToolBarHelper::custom('sitemaps.publish', 'publish.png', 'publish_f2.png', 'JTOOLBAR_Publish', true);
        JToolBarHelper::custom('sitemaps.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true);

        if (version_compare($version->getShortVersion(), '3.0.0', '>=')) {
            JToolBarHelper::custom('sitemaps.setdefault', 'featured.png', 'featured_f2.png', 'XMAP_TOOLBAR_SET_DEFAULT', true);
        } else {
            JToolBarHelper::custom('sitemaps.setdefault', 'default.png', 'default_f2.png', 'XMAP_TOOLBAR_SET_DEFAULT', true);
        }
        if ($state->get('filter.published') == -2) {
            JToolBarHelper::deleteList('', 'sitemaps.delete','JTOOLBAR_DELETE');
        }
        else {
            JToolBarHelper::trash('sitemaps.trash','JTOOLBAR_TRASH');
        }
        JToolBarHelper::divider();


        if (class_exists('JHtmlSidebar')){
            JHtmlSidebar::addFilter(
                JText::_('JOPTION_SELECT_PUBLISHED'),
                'filter_published',
                JHtml::_('select.options', JHtml::_('jgrid.publishedOptions'), 'value', 'text', $this->state->get('filter.published'), true)
            );

            JHtmlSidebar::addFilter(
                JText::_('JOPTION_SELECT_ACCESS'),
                'filter_access',
                JHtml::_('select.options', JHtml::_('access.assetgroups'), 'value', 'text', $this->state->get('filter.access'))
            );

            $this->sidebar = JHtmlSidebar::render();
        }
    }
}
views/sitemaps/index.html000060400000000036152455704340011527 0ustar00<!DOCTYPE html><title></title>css/index.html000060400000000036152455704340007335 0ustar00<!DOCTYPE html><title></title>css/xmap.css000060400000001055152455704340007021 0ustar00.xmap-menu-options {
    border-bottom: 1px solid #CCC;
    padding:10px;
}
.xmap-menu-options label {
    cursor:move;
}
.xmap-menu-options input, .xmap-menu-options select {
    margin: 5px 5px 2px 0px;
}
ul.ul_sortable {
    list-style:none;
    margin:0;
    padding:0;
}
ul.ul_sortable li {
    cursor:move;
    background-color: #eee;
    margin:5px;
    padding: 5px;
}
ul.ul_sortable li label.menu_label {
    font-weight: bold;
    display: inline-block;
    margin-bottom: 0px;
}
ul.ul_sortable input[type="checkbox"] {
    margin: 0 3px 0 3px;
}
images/xmap-favicon.png000060400000001450152455704340011114 0ustar00�PNG


IHDR�atEXtSoftwareAdobe ImageReadyq�e<�IDATxڤS_HSQ�νww��]��ڒ�E5S�2�R�(����@�����z�=,��-�!,�/F�6����Z]��N�{w�m�}g��=z�9���~��;�0���f��a`v!Q�o��6gqI&���B@�4�AG�-1�~e�^�t�m��F�’تh:�3+
h���b6�p}��	i#*����/�ƃU�@8:
݁A ���Q m�5�Y��q��x��H)�Q2� ?�Dz�9��x��Q���!|���t2��V��c:��$���1��2��tvk�X��QX�_:��{\��dJ�������`hj*}���*l�hHM�{np��z[����œ��?$E�$�dE^����Yx�y�����Խ��_6U�У�1\r�n���A �f�
�%���eI��v��rj�88�~dYWC�_K)��ClI��<U�J�f�5�}����Ŕr%���o�!*G&�j'��<�t��s���95������*r"��UO��!��r`*w�k���f�;{�#-#�3^���=�s;����>z<�Z���;8i1��ND��:k�)�w?!)��{��L�>�뾡}߆�E�-)�-v�r_���<	Q~��+X�=��:ʗ>Yu��g�ˢz:��CV5�(�k>�G���{z�t9�@A�����
�"W�~�lO�4E}>��~��5Jȿ�-�IEND�B`�images/sitemap-icon.png000060400000000753152455704340011121 0ustar00�PNG


IHDR00W��tEXtSoftwareAdobe ImageReadyq�e<�IDATx�b���?�PLC�z`��<~�����/��� ���Hw|����QD=��u-dy���RH#����9��ģ�Rl�ZAP�_v�h�,���Ih4	����
�,���Cέh$K#�]ʛϾRܨS��&�9�H�>��/�_��̶3Rc�U��Л��G3��.�~���oYt��-��*1y��<�@Z�"��쬚8�<rtX��A�L�B|�������o��g����sj!���0#Q�6��RRzr�T?����LLf����f'QC7����h�P�5TM[�����S��Yk���J[�D���Ę�����V�T����5.ȱ�b�0�X�#�%+Sڰ�����F=0R=��&K���0��5�h���G��/��FIEND�B`�images/index.html000060400000000036152455704340010012 0ustar00<!DOCTYPE html><title></title>elements/index.html000060400000000036152455704340010361 0ustar00<!DOCTYPE html><title></title>elements/sitemap.php000060400000001576152455704340010551 0ustar00<?php
/**
 * @version     $Id$
 * @copyright   Copyright (C) 2007 - 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;

class JElementSitemap extends JElement
{
    /**
     * Element name
     *
     * @var    string
     */
    var $_name = 'Sitemap';

    public function fetchElement($name, $value, &$node, $control_name)
    {
        global $mainframe;

        $db        = JFactory::getDBO();
        $fieldName = $control_name.'['.$name.']';
        
        $sql = "SELECT id, name from #__xmap_sitemap order by name";
        $db->setQuery($sql);
        $rows = $db->loadObjectList();

        $html = JHTML::_('select.genericlist',$rows,$fieldName,'','id','name',$value);

        return $html;
    }

}
xmap.xml000060400000007651152455704340006251 0ustar00<?xml version="1.0" encoding="utf-8"?>
<extension method="upgrade" version="1.5" type="component">
    <name>com_xmap</name>
    <creationDate>2013-11-10</creationDate>
    <author>Guillermo Vargas</author>
    <copyright>This component is released under the GNU/GPL License</copyright>
    <authorEmail>guille@vargas.co.cr</authorEmail>
    <authorUrl>http://www.jooxmap.com</authorUrl>
    <version>2.3.4</version>
    <license>GNU/GPL</license>
    <description>COM_XMAP_XML_DESC</description>
    <install folder="admin">
        <sql>
            <file driver="mysql" charset="utf8">install/install.utf8.sql</file>
            <file driver="postgresql" charset="utf8">install/install.postgresql.sql</file>
        </sql>
    </install>
    <uninstall>
        <sql>
            <file driver="mysql" charset="utf8">install/uninstall.utf8.sql</file>
            <file driver="postgresql" charset="utf8">install/uninstall.postgresql.sql</file>
        </sql>
    </uninstall>
    <files folder="front">
        <filename>controller.php</filename>
        <filename>displayer.php</filename>
        <filename>index.html</filename>
        <filename>metadata.xml</filename>
        <filename>router.php</filename>
        <filename>xmap.php</filename>
        <folder>assets</folder>
        <folder>controllers</folder>
        <folder>helpers</folder>
        <folder>models</folder>
        <folder>views</folder>
    </files>
    <languages folder="front/language">
        <language tag="en-GB">en-GB.com_xmap.ini</language>
        <language tag="es-ES">es-ES.com_xmap.ini</language>
        <language tag="fa-IR">fa-IR.com_xmap.ini</language>
        <language tag="fr-FR">fr-FR.com_xmap.ini</language>
        <language tag="cs-CZ">cs-CZ.com_xmap.ini</language>
        <language tag="nl-NL">nl-NL.com_xmap.ini</language>
        <language tag="ru-RU">ru-RU.com_xmap.ini</language>
    </languages>
    <images folder="admin">
        <folder>images</folder>
    </images>
    <administration>
        <menu img="components/com_xmap/images/xmap-favicon.png">COM_XMAP_TITLE</menu>
        <files folder="admin">
            <filename>xmap.php</filename>
            <filename>controller.php</filename>
            <filename>index.html</filename>
            <filename>LICENSE.txt</filename>
            <folder>css</folder>
            <folder>elements</folder>
            <folder>images</folder>
            <folder>install</folder>
            <folder>helpers</folder>
            <folder>controllers</folder>
            <folder>tables</folder>
            <folder>views</folder>
            <folder>models</folder>
        </files>
        <languages folder="admin/language">
            <language tag="en-GB">en-GB/en-GB.com_xmap.ini</language>
            <language tag="en-GB">en-GB/en-GB.com_xmap.sys.ini</language>
            <language tag="es-ES">es-ES/es-ES.com_xmap.ini</language>
            <language tag="es-ES">es-ES/es-ES.com_xmap.sys.ini</language>
            <language tag="fa-IR">fa-IR/fa-IR.com_xmap.ini</language>
            <language tag="fa-IR">fa-IR/fa-IR.com_xmap.sys.ini</language>
            <language tag="fr-FR">fr-FR/fr-FR.com_xmap.ini</language>
            <language tag="fr-FR">fr-FR/fr-FR.com_xmap.sys.ini</language>
			<language tag="cs-CZ">cs-CZ/cs-CZ.com_xmap.ini</language>
            <language tag="cs-CZ">cs-CZ/cs-CZ.com_xmap.sys.ini</language>
            <language tag="nl-NL">nl-NL/nl-NL.com_xmap.ini</language>
            <language tag="nl-NL">nl-NL/nl-NL.com_xmap.sys.ini</language>
            <language tag="ru-RU">ru-RU/ru-RU.com_xmap.ini</language>
            <language tag="ru-RU">ru-RU/ru-RU.com_xmap.sys.ini</language>
        </languages>
        <images folder="admin">
            <folder>images</folder>
        </images>
    </administration>
    <updateservers>
        <server type="extension" priority="1" name="Xmap Update Site">https://raw.github.com/guilleva/Xmap/master/xmap-update.xml</server>
    </updateservers>
</extension>