<?php

/**
 * aheadWorks Co.
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the EULA
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://ecommerce.aheadworks.com/LICENSE-M1.txt
 *
 * @category   AW
 * @package    AW_Kbase
 * @copyright  Copyright (c) 2008-2010 aheadWorks Co. (http://www.aheadworks.com)
 * @license    http://ecommerce.aheadworks.com/LICENSE-M1.txt
 */

/*
<?php echo htmlspecialchars($article->getArticle()); ?>
*/

$article = $this->getArticle();
if(($category = $this->getCategory()) && $category instanceof Varien_Object)
    $url = AW_Kbase_Helper_Url::getUrl(AW_Kbase_Helper_Url::URL_TYPE_ARTICLE, $article, $category->getData());
else
    $url = AW_Kbase_Helper_Url::getUrl(AW_Kbase_Helper_Url::URL_TYPE_ARTICLE, $article);

?>
<tr class="kbase-listing kbase-listing-full <?php echo $this->getEven() ? 'kbase-even' : 'kbase-odd'; ?>" title="<?php echo $url ?>" >
    <td class="kbase-listing-general">
        <p class="kbase-listing-title">
            <a href="<?php echo $url ?>"><?php echo htmlspecialchars($article->getArticleTitle()); ?></a>
        </p>
        <p class="kbase-listing-description">
            <?php echo $this->getProccessedText($article->getShortDescription()); ?>
        </p>
        <p class="kbase-listing-tag">
            <?php echo $this->__('Tags:') ?>
            <?php foreach($article->getArticleTags() as $tag): ?>
                <a href="<?php echo AW_Kbase_Helper_Url::getUrl(AW_Kbase_Helper_Url::URL_TYPE_TAG, array('tag_name' => $tag)) ?>"><?php echo $tag ?></a>
            <?php endforeach; ?>
        </p>

    </td>
    <?php if($this->getRatingEnabled()): ?>
        <td class="kbase-listing-rating">
            <div class="rating-box">
                <div style="width: <?php echo ($article->getArticleRating())/5*100; ?>%;" class="rating"></div>
            </div>
            <?php // echo number_format($article->getArticleRating(), AW_Kbase_Helper_Data::RATING_DECIMALS); ?>
        </td>
    <?php endif; ?>
    <td class="kbase-listing-date-updated"><span class="kbase-listing-date-updated"><?php echo $this->formatDate($article->getArticleDateUpdated()); ?></span></td>
</tr>
