<li class="<?php echo $this->odd ? 'odd' : 'even'; ?>">
<?php if ($this->instance['type'] == 'uri')
{
    $entry = $this->instanceData[$this->instanceUri];
    $numViews = isset($entry['numViews'][0]['value']) ? $entry['numViews'][0]['value'] : 0;
    $generator = isset($entry['generator'][0]['value']) ? $entry['generator'][0]['value'] : '';
?>
    <div class="has-contextmenu-area" >
        <h3>
            <span class="name">"<?php echo $entry['name'][0]['value']; ?>"</span>
            <span class="views">(<?php echo $numViews ?> views)</span>
        </h3>
        open with:
<?php
    //always show link to queryeditor
    $QEurl = new OntoWiki_Url(array('controller' => 'queries', 'action'=>'editor'), array());
    $QEurl->queryUri = $this->instanceUri;
?>
        <a class="minibutton" href="<?php echo $QEurl; ?>">Editor</a>
<?php
    //if possible show link to original editor
    if($generator == "qb") {
        $url = new OntoWiki_Url(array('controller' => 'querybuilder', 'action'=>'manage'), array());
        $url->patterns = $entry["json"][0]["value"];
        ?> <a class="minibutton" href="<?php echo $url; ?>"><?php echo $generator; ?></a> <?php
    } elseif ($generator == "gqb") {
        $url = new OntoWiki_Url(array('controller' => 'graphicalquerybuilder', 'action'=>'display'), array());
        $url->open = "true";
        $url->queryuri = $entry["query"][0]["value"];
        ?> <a class="minibutton" href="<?php echo $url; ?>"><?php echo $generator; ?></a> <?php
    }
}
?>
    </div>
</li>
