예제 #1
0
 /**
  * Generate search/browse results visualization
  */
 public function Viz()
 {
     $ps_viz = $this->request->getParameter('viz', pString);
     $pb_render_data = (bool) $this->request->getParameter('renderData', pInteger);
     $o_viz = new Visualizer($this->ops_tablename);
     $vo_result = caMakeSearchResult($this->ops_tablename, $this->opo_result_context->getResultList());
     if ($vo_result) {
         $o_viz->addData($vo_result);
         $this->view->setVar('num_items_total', (int) $vo_result->numHits());
     }
     $this->view->setVar("viz_html", $o_viz->render($ps_viz, "HTML", array('classname' => 'vizFullScreen', 'request' => $this->request)));
     $o_dm = Datamodel::load();
     $this->view->setVar('t_item', $o_dm->getInstanceByTableName($this->ops_tablename, true));
     $this->view->setVar('num_items_rendered', (int) $o_viz->numItemsRendered());
     if ($pb_render_data) {
         $this->response->addContent($o_viz->getDataForVisualization($ps_viz, array('request' => $this->request)));
         return;
     }
     $this->render('Results/viz_html.php');
 }
예제 #2
0
<?php

$vo_result = $this->getVar('result');
$va_facets = $this->getVar('facets');
$va_criteria = $this->getVar('criteria');
array_shift($va_criteria);
$va_criteria = array_shift($va_criteria);
?>
	<div>
<?php 
print "<strong><em>Showing " . (($vs_criteria = array_pop($va_criteria)) ? $vs_criteria : "everything") . "</em></strong>";
if (!is_array($va_facets) || !sizeof($va_facets)) {
    ?>
	<div style="float: right;"><a href="#" class="abFacetList selected" id="abFacetListAll" onclick='jQuery(".abFacetList").removeClass("selected"); jQuery("#abFacetListAll").addClass("selected"); jQuery("#facetBox").html(" "); jQuery("#contentBox").load("<?php 
    print caNavUrl($this->request, 'eastend', 'Map', 'clearAndAddCriteria');
    ?>
"); return false;'><?php 
    print _t("view all");
    ?>
</a></div>
<?php 
}
?>
	</div>
<?php 
$o_viz = new Visualizer('ca_objects');
$o_viz->addData($vo_result);
print $o_viz->render('map');