public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
 {
     parent::__construct($po_request, $po_response, $pa_view_paths);
     if ($this->request->config->get('pawtucket_requires_login') && !$this->request->isLoggedIn()) {
         $this->response->setRedirect(caNavUrl($this->request, "", "LoginReg", "LoginForm"));
     }
     $this->config = caGetDetailConfig();
     $this->opa_detail_types = $this->config->getAssoc('detailTypes');
     $this->opo_datamodel = Datamodel::load();
     $va_access_values = caGetUserAccessValues($this->request);
     $this->opa_access_values = $va_access_values;
     $this->view->setVar("access_values", $va_access_values);
     caSetPageCSSClasses(array("detail"));
 }
Beispiel #2
0
/**
 *
 */
function caObjectsDisplayDownloadLink($po_request)
{
    $o_config = caGetDetailConfig();
    $vn_can_download = false;
    if ($o_config->get('allow_ca_objects_representation_download')) {
        switch ($o_config->get('allow_ca_objects_representation_download')) {
            case "anyone":
                $vn_can_download = true;
                break;
                # ------------------------------------------
            # ------------------------------------------
            case "logged_in":
                if ($po_request->isLoggedIn()) {
                    $vn_can_download = true;
                }
                break;
                # ------------------------------------------
            # ------------------------------------------
            case "logged_in_privileged":
                if ($po_request->isLoggedIn() && $po_request->user->canDoAction('can_download_media')) {
                    $vn_can_download = true;
                }
                break;
                # ------------------------------------------
        }
    }
    return $vn_can_download;
}
Beispiel #3
0
function caGetDetailForType($pm_table, $pm_type = null, $pa_options = null)
{
    global $g_theme_detail_for_type_cache;
    $vs_current_action = ($po_request = caGetOption('request', $pa_options, null)) ? $po_request->getAction() : null;
    if (isset($g_theme_detail_for_type_cache[$pm_table . '/' . $pm_type])) {
        return $g_theme_detail_for_type_cache[$pm_table . '/' . $pm_type . '/' . $vs_current_action];
    }
    $o_config = caGetDetailConfig();
    $o_dm = Datamodel::load();
    $vs_preferred_detail = caGetOption('preferredDetail', $pa_options, null);
    if (!($vs_table = $o_dm->getTableName($pm_table))) {
        return null;
    }
    if ($pm_type) {
        $t_instance = $o_dm->getInstanceByTableName($vs_table, true);
        $vs_type = is_numeric($pm_type) ? $t_instance->getTypeCode($pm_type) : $pm_type;
    } else {
        $vs_type = null;
    }
    $va_detail_types = $o_config->getAssoc('detailTypes');
    $vs_detail_type = null;
    foreach ($va_detail_types as $vs_code => $va_info) {
        if ($va_info['table'] == $vs_table) {
            $va_detail_aliases = caGetOption('aliases', $va_info, array(), array('castTo' => 'array'));
            if (is_null($pm_type) || !is_array($va_info['restrictToTypes']) || sizeof($va_info['restrictToTypes']) == 0 || in_array($vs_type, $va_info['restrictToTypes'])) {
                // If the code matches the current url action use that in preference to anything else
                // does it have an alias?
                if ($vs_preferred_detail && $vs_code == $vs_preferred_detail) {
                    return $vs_preferred_detail;
                }
                if ($vs_preferred_detail && in_array($vs_preferred_detail, $va_detail_aliases)) {
                    return $vs_preferred_detail;
                }
                if ($vs_current_action && $vs_code == $vs_current_action) {
                    return $vs_code;
                }
                if ($vs_current_action && in_array($vs_current_action, $va_detail_aliases)) {
                    return $vs_current_action;
                }
                $vs_detail_type = $g_theme_detail_for_type_cache[$pm_table . '/' . $pm_type . '/' . $vs_current_action] = $g_theme_detail_for_type_cache[$vs_table . '/' . $vs_type . '/' . $vs_current_action] = $vs_code;
            }
        }
    }
    if (!$vs_detail_type) {
        $g_theme_detail_for_type_cache[$pm_table . '/' . $pm_type] = $g_theme_detail_for_type_cache[$vs_table . '/' . $vs_type . '/' . $vs_current_action] = null;
    }
    return $vs_detail_type;
}
    print _t("Other UCM Specimens From This Site");
    ?>
</h2>
<?php 
    foreach ($va_objects as $va_object) {
        print "<div>" . caDetailLink($this->request, $va_object["idno"], '', 'ca_objects', $va_object['object_id'], array("subsite" => $this->request->session->getVar("coloradoSubSite"))) . "</div>";
    }
    print "</div><!-- end unit -->";
}
?>
	</div><!-- end leftCol -->
	<div id="rightColMap">
<?php 
# --- map
# --- plot circle based on point for tracks and verts
$o_config = caGetDetailConfig();
$va_types = $o_config->getAssoc('detailTypes');
$va_options = $va_types["place"]["options"];
$vs_map_attribute = caGetOption('map_attribute', $va_options, false);
if ($vs_map_attribute && $t_place->get($vs_map_attribute)) {
    $o_map = new GeographicMap(($vn_width = caGetOption('map_width', $va_options, false)) ? $vn_width : 285, ($vn_height = caGetOption('map_height', $va_options, false)) ? $vn_height : 200, 'map');
    $o_map->mapFrom($t_place, $vs_map_attribute);
    print $o_map->render('HTML', array("obscure" => true, "circle" => true, "radius" => 20000, "fillColor" => "#000000", "pathColor" => "#000000", "zoomLevel" => 5));
} else {
    $qr_hits = ca_places::createResultSet($va_hierarchy_ids);
    if ($qr_hits->numHits()) {
        while ($qr_hits->nextHit()) {
            if ($qr_hits->get($vs_map_attribute)) {
                $t_place->load($qr_hits->get("place_id"));
                $o_map = new GeographicMap(($vn_width = caGetOption('map_width', $va_options, false)) ? $vn_width : 285, ($vn_height = caGetOption('map_height', $va_options, false)) ? $vn_height : 200, 'map');
                $o_map->mapFrom($t_place, $vs_map_attribute);