<?php
/**
 * This file is part of the {@link http://ontowiki.net OntoWiki} project.
 *
 * @copyright Copyright (c) 2012, {@link http://aksw.org AKSW}
 * @license http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)
 */

/**
 * OntoWiki showproperties module template
 */

?>
<?php if (!empty($this->properties)): ?>
<div class="has-contextmenu-area">
    <div class="contextmenu">
        <a class="item"
           href="<?php echo $this->propertiesListLink ?>">
                <span class="icon icon-list" title="Show as List">
                        <span>Show as List</span>
                </span>
        </a>
    </div>
    <ul class="inline separated">
        <?php $i = 0; 
        foreach ($this->properties as $id => $propertyInfo):
            if (++$i == count($this->properties)): ?>
                <li class="last-child"><a class="show-property Property hasMenu" about="<?php echo $propertyInfo['uri']; ?>" title="<?php echo $propertyInfo['title'] ?>"><?php echo $propertyInfo['title'] ?></a></li>
            <?php else: ?>
                <li><a class="show-property hasMenu" about="<?php echo $propertyInfo['uri']; ?>" title="<?php echo $propertyInfo['title'] ?>"><?php echo $propertyInfo['title'] ?></a></li>
            <?php endif; ?>
        <?php endforeach; ?>
    </ul>
</div>
<?php endif ?>
<?php if (!empty($this->reverseProperties)): ?>
<div class="has-contextmenu-area">
    <div class="contextmenu">
        <a class="item"
           href="<?php echo $this->inversePropertiesListLink ?>">
                <span class="icon icon-list" title="Show as List">
                        <span>Show as List</span>
                </span>
        </a>
    </div>
	<ul class="inline separated">
	    <?php $i = 0; 
            foreach ($this->reverseProperties as $id => $propertyInfo):
                    if (++$i == count($this->properties)): ?>
		        <li class="last-child"><a class="show-property InverseProperty hasMenu" about="<?php echo $propertyInfo['uri']; ?>" title="<?php echo $propertyInfo['title'] ?>"><?php echo $propertyInfo['title'] ?></a><sup>-1</sup></li>
		    <?php else: ?>
		        <li><a class="show-property InverseProperty hasMenu" about="<?php echo $propertyInfo['uri']; ?>" title="<?php echo $propertyInfo['title'] ?>"><?php echo $propertyInfo['title'] ?></a><sup>-1</sup></li>
		    <?php endif; ?>
		<?php endforeach; ?>
	</ul>
</div>
<?php endif ?>
<?php if ( ( !empty($this->Properties) ) && ( !empty($this->reverseProperties) ) ): ?>
	<p class="messagebox info"><?php echo $this->_($this->message) ?></p>
<?php endif; ?>

