<?php
/*
 * Copyright (c) 2014-2015 Aimy Extensions, Lingua-Systems Software GmbH
 *
 * http://www.aimy-extensions.com/
 *
 * License: GNU GPLv2, see LICENSE.txt within distribution and/or
 *          http://www.aimy-extensions.com/software-license.html
 */
 defined( '_JEXEC' ) or die(); require_once( JPATH_ADMINISTRATOR . DIRECTORY_SEPARATOR . 'components' . DIRECTORY_SEPARATOR . 'com_aimysitemap' . DIRECTORY_SEPARATOR . 'Uri.php' ); class AimySitemapModelHtml extends JModelList { public function __construct( $config = array() ) { if ( empty( $config[ 'filter_fields' ] ) ) { $config[ 'filter_fields' ] = array( 'url', 'a.url', 'title', 'a.title', 'lang', 'a.lang' ); } parent::__construct( $config ); } protected function populateState( $order = null, $dir = null ) { } public function getItems() { $items = parent::getItems(); if ( ! empty( $items ) ) { foreach ( $items as $item ) { $u = new AimySitemapURI( $item->url ); $item->url = $u->getResourceHTML(); $item->href = $u->getResourceHref(); } } return $items; } protected function getListQuery() { $db = $this->getDbo(); $q = $db->getQuery( true ); return $q->select( $db->quoteName( array( 'a.url', 'a.title', 'a.lang' ) ) ) ->from( $db->quoteName( '#__aimysitemap' ) . ' AS a' ) ->where( $db->quoteName( 'a.state' ) . ' = ' . '1' . ' AND ' . $db->quoteName( 'a.title' ) . ' > ' . $db->quote( '""' ) ); } } 
