public function __construct($ps_widget_path, $pa_settings)
 {
     global $g_ui_locale_id;
     $this->opo_config = Configuration::load($ps_widget_path . '/conf/advancedSearchForm.conf');
     $this->title = _t('Advanced search form');
     $this->description = _t('Use advanced search forms in your dashboard');
     parent::__construct($ps_widget_path, $pa_settings);
     if (!$this->request || !$this->request->isLoggedIn()) {
         return null;
     }
     // can be invoked by command line process when instantiating ca_user_roles
     $t_form = new ca_search_forms();
     $o_dm = Datamodel::load();
     $va_forms = caExtractValuesByUserLocale($t_form->getForms(array('user_id' => $this->request->getUserID(), 'access' => __CA_SEARCH_FORM_READ_ACCESS__)));
     $va_form_list = array();
     foreach ($va_forms as $va_form) {
         $va_form_list[unicode_ucfirst($o_dm->getTableProperty($va_form['table_num'], 'NAME_PLURAL')) . ": " . $va_form["name"]] = $va_form["form_id"];
     }
     BaseWidget::$s_widget_settings['advancedSearchFormWidget']["form_code"] = array('formatType' => FT_TEXT, 'displayType' => DT_SELECT, 'width' => 40, 'height' => 1, 'takesLocale' => false, 'default' => '', 'options' => $va_form_list, 'label' => _t('Search form'), 'description' => _t('Search form to display'));
 }
    $va_entities = $t_entity->get("ca_entities", array("returnAsArray" => 1, 'checkAccess' => $va_access_values));
    if (sizeof($va_entities)) {
        ?>
				<div class="relatedinfo"><div class="unit">
<?php 
        $va_entities_by_rel_type = array();
        foreach ($va_entities as $va_entity) {
            if (!is_array($va_entities_by_rel_type[$va_entity['relationship_typename']])) {
                $va_entities_by_rel_type[$va_entity['relationship_typename']] = array();
            }
            array_push($va_entities_by_rel_type[$va_entity['relationship_typename']], $va_entity);
        }
        // Loop through types
        foreach ($va_entities_by_rel_type as $vs_type => $va_entities) {
            // Print type name
            print "<div class=\"unit\"><h2>" . unicode_ucfirst($vs_type) . "</h2>\n";
            // Print entities for current type
            foreach ($va_entities as $vn_index => $va_entity) {
                ?>
					<div><?php 
                print $this->request->config->get('allow_detail_for_ca_entities') ? caNavLink($this->request, $va_entity['label'], '', 'Detail', 'Entity', 'Show', array('entity_id' => $va_entity["entity_id"])) : caNavLink($this->request, $va_entity['label'], '', '', 'Search', 'Index', array('search' => '"' . $va_entity['label'] . '"'));
                ?>
</div>
<?php 
            }
            print "</div>";
        }
        ?>
				</div></div><!-- end unit -->
<?php 
    }
        $va_entity_by_type = array();
        foreach ($va_entities as $va_entity) {
            if (!in_array($va_entity["entity_id"], $va_entities_output)) {
                $va_entity_by_type[$va_entity["relationship_typename"]][] = array("entity_id" => $va_entity["entity_id"], "relationship_typename" => $va_entity["relationship_typename"], "label" => $va_entity["label"]);
            }
        }
        foreach ($va_entity_by_type as $vs_relationship_typename => $va_entities_by_type) {
            ?>
					<div class="unit"><div class='infoButton' id='<?php 
            print $vs_relationship_typename;
            ?>
'><img src='<?php 
            print $this->request->getThemeUrlPath();
            ?>
/graphics/nhf/b_info.gif' width='14' height='14' border='0' style='vertical-align:sub;'></div><div class='heading'><?php 
            print unicode_ucfirst($vs_relationship_typename);
            ?>
</div>
<?php 
            $vn_i = 1;
            foreach ($va_entities_by_type as $va_entity) {
                print caNavLink($this->request, $va_entity["label"], '', '', 'Browse', 'clearAndAddCriteria', array('target' => 'ca_collections', 'facet' => 'entity_facet', 'id' => $va_entity['entity_id']));
                if (sizeof($va_entities_by_type) > $vn_i) {
                    print ", ";
                }
                $vn_i++;
            }
            TooltipManager::add("#" . $vs_relationship_typename, "<div class='infoTooltip'>Entity descriptions</div>");
            ?>
					</div><!-- end unit --->
<?php 
                     default:
                         if (isset($va_item['ca_attribute_' . $vn_grouping_attribute_id]) && is_array($va_item['ca_attribute_' . $vn_grouping_attribute_id])) {
                             foreach ($va_item['ca_attribute_' . $vn_grouping_attribute_id] as $vn_i => $va_v) {
                                 $va_groups[] = $va_v['value_longtext1'];
                             }
                         }
                         break;
                 }
             } else {
                 $va_groups[] = mb_substr($va_item[$va_label_order_by_fields[0]], 0, 1);
                 $vn_show_jump_bar = 1;
             }
             break;
     }
     foreach ($va_groups as $vs_group) {
         $vs_group = unicode_ucfirst($vs_group);
         $vs_alpha_key = '';
         foreach ($va_label_order_by_fields as $vs_f) {
             $vs_alpha_key .= $va_item[$vs_f];
         }
         $vs_alpha_key = trim($vs_alpha_key);
         if (preg_match('!^[A-Z0-9]{1}!', $vs_group)) {
             $va_grouped_items[$vs_group][$vs_alpha_key] = $va_item;
         } else {
             $va_grouped_items['~'][$vs_alpha_key] = $va_item;
         }
     }
 }
 // sort lists alphabetically
 foreach ($va_grouped_items as $vs_key => $va_list) {
     ksort($va_list);
        if ($this->getVar('previous_id')) {
            print caNavLink($this->request, "&lsaquo; " . _t("Previous"), '', 'Detail', 'Collection', 'Show', array('collection_id' => $this->getVar('previous_id')), array('id' => 'previous'));
        } else {
            print "&lsaquo; " . _t("Previous");
        }
        print "&nbsp;&nbsp;&nbsp;{$vs_back_link}&nbsp;&nbsp;&nbsp;";
        if ($this->getVar('next_id') > 0) {
            print caNavLink($this->request, _t("Next") . " &rsaquo;", '', 'Detail', 'Collection', 'Show', array('collection_id' => $this->getVar('next_id')), array('id' => 'next'));
        } else {
            print _t("Next") . " &rsaquo;";
        }
    }
    ?>
		</div><!-- end nav -->
		<h1><?php 
    print unicode_ucfirst($t_collection->getTypeName()) . ': ' . $vs_title;
    ?>
</h1>
		<div id="leftCol">	
<?php 
    # --- identifier
    if ($t_collection->get('idno')) {
        print "<div class='unit'><b>" . _t("Identifier") . "</b>: " . $t_collection->get('idno') . "</div><!-- end unit -->";
    }
    # --- attributes
    $va_attributes = $this->request->config->get('ca_collections_detail_display_attributes');
    if (is_array($va_attributes) && sizeof($va_attributes) > 0) {
        foreach ($va_attributes as $vs_attribute_code) {
            if ($vs_value = $t_collection->get("ca_collections.{$vs_attribute_code}")) {
                print "<div class='unit'><b>" . $t_collection->getDisplayLabel("ca_collections.{$vs_attribute_code}") . ":</b> {$vs_value}</div><!-- end unit -->";
            }
 /**
  * Returns display label for element specified by standard "get" bundle code (eg. <table_name>.<bundle_name> format)
  */
 public function getDisplayLabel($ps_field)
 {
     $va_tmp = explode('.', $ps_field);
     if (sizeof($va_tmp) == 2 && $va_tmp[0] == $this->getLabelTableName() && $va_tmp[1] == $this->getLabelDisplayField()) {
         $va_tmp[0] = $this->tableName();
         $va_tmp[1] = 'preferred_labels';
         $ps_field = join('.', $va_tmp);
     }
     switch (sizeof($va_tmp)) {
         # -------------------------------------
         case 1:
             // table_name
             if ($t_instance = $this->_DATAMODEL->getInstanceByTableName($va_tmp[0], true)) {
                 return _t("Related %1", $t_instance->getProperty('NAME_PLURAL'));
             }
             break;
             # -------------------------------------
         # -------------------------------------
         case 2:
             // table_name.field_name
         // table_name.field_name
         case 3:
             // table_name.field_name.sub_element
             if (!($t_instance = $this->_DATAMODEL->getInstanceByTableName($va_tmp[0], true))) {
                 break;
             }
             $vs_prefix = $vs_suffix = '';
             $vs_suffix_string = ' (' . _t('from related %1', $t_instance->getProperty('NAME_PLURAL')) . ')';
             if ($va_tmp[0] !== $this->tableName()) {
                 $vs_suffix = $vs_suffix_string;
             }
             switch ($va_tmp[1]) {
                 # --------------------
                 case 'related':
                     unset($va_tmp[1]);
                     $vs_label = $this->getDisplayLabel(join('.', $va_tmp));
                     if ($va_tmp[0] != $this->tableName()) {
                         return $vs_label . $vs_suffix_string;
                     }
                     return $vs_label;
                     break;
                     # --------------------
                 # --------------------
                 case 'preferred_labels':
                     if (method_exists($t_instance, 'getLabelTableInstance') && ($t_label_instance = $t_instance->getLabelTableInstance())) {
                         if (!isset($va_tmp[2])) {
                             return unicode_ucfirst($t_label_instance->getProperty('NAME_PLURAL')) . $vs_suffix;
                         } else {
                             return unicode_ucfirst($t_label_instance->getDisplayLabel($t_label_instance->tableName() . '.' . $va_tmp[2])) . $vs_suffix;
                         }
                     }
                     break;
                     # --------------------
                 # --------------------
                 case 'nonpreferred_labels':
                     if (method_exists($t_instance, 'getLabelTableInstance') && ($t_label_instance = $t_instance->getLabelTableInstance())) {
                         if ($va_tmp[0] !== $this->tableName()) {
                             $vs_suffix = ' (' . _t('alternates from related %1', $t_instance->getProperty('NAME_PLURAL')) . ')';
                         } else {
                             $vs_suffix = ' (' . _t('alternates') . ')';
                         }
                         if (!isset($va_tmp[2])) {
                             return unicode_ucfirst($t_label_instance->getProperty('NAME_PLURAL')) . $vs_suffix;
                         } else {
                             return unicode_ucfirst($t_label_instance->getDisplayLabel($t_label_instance->tableName() . '.' . $va_tmp[2])) . $vs_suffix;
                         }
                     }
                     break;
                     # --------------------
                 # --------------------
                 case 'media':
                     if ($va_tmp[0] === 'ca_object_representations') {
                         if ($va_tmp[2]) {
                             return _t('Object media representation (%1)', $va_tmp[2]);
                         } else {
                             return _t('Object media representation (default)');
                         }
                     }
                     break;
                     # --------------------
                 # --------------------
                 default:
                     if ($va_tmp[0] !== $this->tableName()) {
                         return unicode_ucfirst($t_instance->getDisplayLabel($ps_field)) . $vs_suffix;
                     }
                     break;
                     # --------------------
             }
             break;
             # -------------------------------------
     }
     // maybe it's a special bundle name?
     if ($va_tmp[0] === $this->tableName() && isset($this->BUNDLES[$va_tmp[1]]) && $this->BUNDLES[$va_tmp[1]]['label']) {
         return $this->BUNDLES[$va_tmp[1]]['label'];
     }
     return parent::getDisplayLabel($ps_field);
 }
            print caNavLink($this->request, _t("Add to Collection +"), '', '', 'Sets', 'addItem', array('object_id' => $vn_object_id), array('style' => 'margin-right:20px;'));
        } else {
            print caNavLink($this->request, _t("Add to Collection +"), '', '', 'LoginReg', 'form', array('site_last_page' => 'Sets', 'object_id' => $vn_object_id), array('style' => 'margin-right:20px;'));
        }
    }
    print "<a href='#' onclick='caMediaPanel.showPanel(\"" . caNavUrl($this->request, 'Detail', 'Object', 'GetRepresentationInfo', array('object_id' => $t_object->get("object_id"), 'representation_id' => $t_rep->getPrimaryKey())) . "\"); return false;' >" . _t("Zoom/more media") . " +</a>";
    ?>
				</div>			
			</div><!-- end objDetailImageNav -->
<?php 
} else {
    print "<div id='objDetailImage'><img src='" . $this->request->getThemeUrlPath() . "/graphics/city/absent.jpg' border='0'></div>";
}
?>
			<h3 style="clear:right;"><?php 
print unicode_ucfirst($this->getVar('typename')) . ': <a href="' . caNavUrl($this->request, '', '', '') . '#fragment-2">' . $vs_title . '</a>';
?>
</h3>
			<div class="searchboxitemtext">
<?php 
# --- identifier
if ($t_object->get('idno')) {
    print "<div class='unit'><b>" . _t("Reference Code") . ":</b> " . $t_object->get('idno') . "</div><!-- end unit -->";
}
# --- hirearchy breadcrumb trail
$va_ancestors = array();
$va_ancestors = $t_object->getHierarchyAncestors();
if (sizeof($va_ancestors) > 0) {
    $va_hier_path = array();
    $t_hier_object = new ca_objects();
    foreach ($va_ancestors as $va_ancestor) {
Esempio n. 8
0
 /**
  * Return grouped list of items from the specified table that are related to the current browse set.
  * Grouping of items is based on browse configuration.
  * 
  * Options:
  *		checkAccess = array of access values to filter facets that have an 'access' field by
  */
 public function getFacetWithGroups($ps_facet_name, $ps_group_mode, $ps_grouping_field = null, $pa_options = null)
 {
     $va_facet_info = $this->getInfoForFacet($ps_facet_name);
     $va_facet = $this->getFacet($ps_facet_name, $pa_options);
     $t_rel_types = new ca_relationship_types();
     $va_relationship_types = $t_rel_types->getRelationshipInfo($va_facet_info['relationship_table']);
     $t_model = $this->opo_datamodel->getTableInstance($va_facet_info['table']);
     if (method_exists($t_model, "getTypeList")) {
         $va_types = $t_model->getTypeList();
     }
     $vn_element_datatype = null;
     if ($vs_grouping_attribute_element_code = preg_match('!^ca_attribute_([\\w]+)!', $ps_grouping_field, $va_matches) ? $va_matches[1] : null) {
         $t_element = new ca_metadata_elements();
         $t_element->load(array('element_code' => $vs_grouping_attribute_element_code));
         $vn_grouping_attribute_id = $t_element->getPrimaryKey();
         $vn_element_datatype = $t_element->get('datatype');
     }
     if ((!isset($va_facet_info['groupings'][$ps_grouping_field]) || !$va_facet_info['groupings'][$ps_grouping_field]) && is_array($va_facet_info['groupings'])) {
         $va_tmp = array_keys($va_facet_info['groupings']);
         $ps_grouping_field = $va_tmp[0];
     }
     $va_grouped_items = array();
     switch ($ps_group_mode) {
         case 'none':
             // nothing to do here
             return $va_facet;
         case 'alphabetical':
         default:
             $o_tep = new TimeExpressionParser();
             // TODO: how do we handle non-latin characters?
             $va_label_order_by_fields = isset($va_facet_info['order_by_label_fields']) ? $va_facet_info['order_by_label_fields'] : array('label');
             foreach ($va_facet as $vn_i => $va_item) {
                 $va_groups = array();
                 switch ($ps_grouping_field) {
                     case 'label':
                         $va_groups[] = mb_substr($va_item[$va_label_order_by_fields[0]], 0, 1);
                         break;
                     case 'relationship_types':
                         foreach ($va_item['rel_type_id'] as $vs_g) {
                             if (isset($va_relationship_types[$vs_g]['typename'])) {
                                 $va_groups[] = $va_relationship_types[$vs_g]['typename'];
                             } else {
                                 $va_groups[] = $vs_g;
                             }
                         }
                         break;
                     case 'type':
                         foreach ($va_item['type_id'] as $vs_g) {
                             if (isset($va_types[$vs_g]['name_plural'])) {
                                 $va_groups[] = $va_types[$vs_g]['name_plural'];
                             } else {
                                 $va_groups[] = _t('Type ') . $vs_g;
                             }
                         }
                         break;
                     default:
                         if ($vn_grouping_attribute_id) {
                             switch ($vn_element_datatype) {
                                 case 2:
                                     //date
                                     $va_tmp = explode(':', $ps_grouping_field);
                                     if (isset($va_item['ca_attribute_' . $vn_grouping_attribute_id]) && is_array($va_item['ca_attribute_' . $vn_grouping_attribute_id])) {
                                         foreach ($va_item['ca_attribute_' . $vn_grouping_attribute_id] as $vn_i => $va_v) {
                                             $va_v = $o_tep->normalizeDateRange($va_v['value_decimal1'], $va_v['value_decimal2'], isset($va_tmp[1]) && in_array($va_tmp[1], array('years', 'decades', 'centuries')) ? $va_tmp[1] : 'decades');
                                             foreach ($va_v as $vn_i => $vn_v) {
                                                 $va_groups[] = $vn_v;
                                             }
                                         }
                                     }
                                     break;
                                 default:
                                     if (isset($va_item['ca_attribute_' . $vn_grouping_attribute_id]) && is_array($va_item['ca_attribute_' . $vn_grouping_attribute_id])) {
                                         foreach ($va_item['ca_attribute_' . $vn_grouping_attribute_id] as $vn_i => $va_v) {
                                             $va_groups[] = $va_v['value_longtext1'];
                                         }
                                     }
                                     break;
                             }
                         } else {
                             if (is_array($va_item)) {
                                 $va_groups[] = mb_substr($va_item[$va_label_order_by_fields[0]], 0, 1);
                             }
                         }
                         break;
                 }
                 foreach ($va_groups as $vs_group) {
                     $vs_group = unicode_ucfirst($vs_group);
                     $vs_alpha_key = '';
                     foreach ($va_label_order_by_fields as $vs_f) {
                         $vs_alpha_key .= $va_item[$vs_f];
                     }
                     $vs_alpha_key = trim($vs_alpha_key);
                     if (preg_match('!^[A-Z0-9]{1}!', $vs_group)) {
                         $va_grouped_items[$vs_group][$vs_alpha_key] = $va_item;
                     } else {
                         $va_grouped_items['~'][$vs_alpha_key] = $va_item;
                     }
                 }
             }
             // sort lists alphabetically
             foreach ($va_grouped_items as $vs_key => $va_list) {
                 ksort($va_list);
                 $va_grouped_items[$vs_key] = $va_list;
             }
             ksort($va_grouped_items);
             break;
     }
     return $va_grouped_items;
 }
        if ($this->getVar('previous_id')) {
            print caNavLink($this->request, "&lsaquo; " . _t("Previous"), '', 'Detail', 'Entity', 'Show', array('entity_id' => $this->getVar('previous_id')), array('id' => 'previous'));
        } else {
            print "&lsaquo; " . _t("Previous");
        }
        print "&nbsp;&nbsp;&nbsp;{$vs_back_link}&nbsp;&nbsp;&nbsp;";
        if ($this->getVar('next_id') > 0) {
            print caNavLink($this->request, _t("Next") . " &rsaquo;", '', 'Detail', 'Entity', 'Show', array('entity_id' => $this->getVar('next_id')), array('id' => 'next'));
        } else {
            print _t("Next") . " &rsaquo;";
        }
    }
    ?>
		</div><!-- end nav -->
		<div id="entityType"><?php 
    print unicode_ucfirst($this->getVar('typename'));
    ?>
</div>
		<h1><?php 
    print $vs_title;
    ?>
</h1>
		
		<div id="rightCol" class='rightColWide'>		
<?php 
    if (!$this->request->config->get('dont_allow_registration_and_login') && $this->request->config->get('enable_bookmarks')) {
        ?>
				<!-- bookmark link BEGIN -->
				<div class="unit">
<?php 
        if ($this->request->isLoggedIn()) {
    $va_occurrences_by_type = array();
    foreach ($va_occurrences as $va_occurrence) {
        $t_occ->load($va_occurrence['occurrence_id']);
        $va_occurrences_by_type[$va_occurrence['item_type_id']][$va_occurrence['occurrence_id']] = array("label" => $va_occurrence['label'], "date" => $t_occ->getAttributesForDisplay("dates", '^dates_value'), "relationship_typename" => $va_occurrence['relationship_typename']);
    }
    foreach ($va_occurrences_by_type as $vn_occurrence_type_id => $va_occurrence_list) {
        ?>
						<div class="unit"><H2><?php 
        print _t("Related") . " " . $va_item_types[$vn_occurrence_type_id]['name_singular'] . (sizeof($va_occurrence_list) > 1 ? "s" : "");
        ?>
</H2>
<?php 
        foreach ($va_occurrence_list as $vn_rel_occurrence_id => $va_info) {
            ?>
						<div><?php 
            print ($this->request->config->get('allow_detail_for_ca_occurrences') ? caNavLink($this->request, $va_info["label"], '', 'Detail', 'Occurrence', 'Show', array('occurrence_id' => $vn_rel_occurrence_id)) : $va_info["label"]) . " (" . unicode_ucfirst($va_info['relationship_typename']) . ")";
            ?>
<br /></div>
<?php 
        }
        print "</div><!-- end unit -->";
    }
}
# --- vocabulary terms
$va_terms = $t_object->get("ca_list_items", array("returnAsArray" => 1, 'checkAccess' => $va_access_values));
if (sizeof($va_terms) > 0) {
    print "<div class='unit'><h2>" . _t("Subject") . (sizeof($va_terms) > 1 ? "s" : "") . "</h2>";
    foreach ($va_terms as $va_term_info) {
        print "<div>" . caNavLink($this->request, $va_term_info['label'], '', '', 'Search', 'Index', array('search' => $va_term_info['label'])) . "</div>";
    }
    print "</div><!-- end unit -->";
        }
        ?>
				</div><!-- end unit -->
				<!-- bookmark link END -->
<?php 
    }
    if ($ps_mode == "print") {
        print '<form method="post" action="' . caNavUrl($this->request, 'nysa', 'Download', 'Custom', array('occurrence_id' => $vn_occurrence_id)) . '" name="lessonPlan" id="lessonPlan" enctype="multipart/form-data">';
        print "<H4>Use the form below to make modifications to this lesson before downloading.  Select the information you would like to included in your PDF by using the checkboxes.  When you've finished your customizations, use the button at the bottom of the page to download your PDF.</H4>";
    } else {
        print "<div class='unit'>" . caNavLink($this->request, _t("Download PDF"), 'cabutton cabuttonSmall', 'nysa', 'Download', 'Full', array('occurrence_id' => $vn_occurrence_id)) . "&nbsp;&nbsp;&nbsp;" . caNavLink($this->request, _t("Customize and Download PDF"), 'cabutton cabuttonSmall', 'Detail', 'Occurrence', 'Show', array('occurrence_id' => $vn_occurrence_id, 'mode' => 'print')) . "</div><!-- end unit -->";
    }
    if ($ps_mode == "print") {
        print "<div class='unit'><input type='checkbox' checked name='print_fields[]' value='type'> <b>" . _t("Lesson type") . "</b>: " . unicode_ucfirst($t_occurrence->getTypeName()) . "</div><!-- end unit -->";
    } else {
        print "<div class='unit'><b>" . _t("Lesson type") . "</b>: " . unicode_ucfirst($t_occurrence->getTypeName()) . "</div><!-- end unit -->";
    }
    # --- attributes in label: value format
    $va_attributes = array("gradelevel", "lessonTopic", "learning_standard", "commonCore", "skills", "EdProject", "funder");
    # --- which of these attributes can be edited when customizing?
    $va_edit_attributes = array("lessonTopic", "learning_standard", "commonCore", "skills");
    if (is_array($va_attributes) && sizeof($va_attributes) > 0) {
        foreach ($va_attributes as $vs_attribute_code) {
            if ($va_values = $t_occurrence->get("ca_occurrences.{$vs_attribute_code}", array("convertCodesToDisplayText" => false, "returnAsArray" => true))) {
                $va_output_parts = array();
                foreach ($va_values as $k => $va_value) {
                    if ($va_value[$vs_attribute_code]) {
                        # --- display hierarchy path for "lessonTopic", "learning_standard", "commonCore"
                        if (in_array($vs_attribute_code, array("lessonTopic", "learning_standard", "commonCore"))) {
                            $vs_tmp = "";
                            $va_hierarchy_ancestors = $t_list_items->getHierarchyAncestors($va_value[$vs_attribute_code], array("idsOnly" => true, "includeSelf" => true));
						jQuery(document).ready(function() {
							jQuery('#description').expander({
								slicePoint: 300,
								expandText: '<?php 
        print _t('[more]');
        ?>
',
								userCollapse: false
							});
						});
					</script>
<?php 
    }
}
if ($va_contents = $t_collection->get('ca_collections.children.preferred_labels.name', array('delimiter' => '<br/>', "sort" => "preferred_labels.name"))) {
    print "<div class='header'><h2>" . unicode_ucfirst($t_collection->getTypeName()) . " " . _t('Contents') . "</h2></div>";
    print "<div class='unit'>" . $o_purifier->purify($va_contents) . "</div>";
}
# --- collections
$va_collections = $t_collection->get("ca_collections", array("returnAsArray" => 1, 'checkAccess' => $va_access_values, "sort" => "preferred_labels.name"));
if (sizeof($va_collections) > 0) {
    print "<div class='header'><h2>" . _t("Related Collection") . (sizeof($va_collections) > 1 ? "s" : "") . "</h2></div><div class='unit'>";
    foreach ($va_collections as $va_collection_info) {
        print "<div class='col'>" . $o_purifier->purify($va_collection_info['label']);
        print "</div>";
        #$va_collection_id = $va_collection_info['collection_id'];
        #$t_collection = new ca_collections($va_collection_id);
        #print "<div class='subCol'>".$t_collection->get('ca_collections.children.preferred_labels.name', array('delimiter' => '<br/>', 'returnAsLink' => true, "sort" => "preferred_labels.name"))."</div>";
        #print "<div style='height:15px;width:100%;'></div>";
    }
    print "</div><!-- end unit -->";
Esempio n. 13
0
 private function _genDynamicTopLevelMenuItems($pa_menu_nav, $ps_cur_selection, $pa_additional_params, $ps_base_path, $pa_defaults)
 {
     if (!is_array($pa_menu_nav)) {
         return '';
     }
     $vs_buf = '';
     foreach ($pa_menu_nav as $va_submenu_item) {
         $vs_buf .= "<li>";
         $vb_disabled = isset($va_submenu_item['is_enabled']) && $va_submenu_item['is_enabled'] ? false : true;
         if ($vb_disabled) {
             $vs_buf .= caHTMLLink(unicode_ucfirst(isset($va_submenu_item['displayName']) ? $va_submenu_item['displayName'] : ''), array('href' => '#', 'class' => $ps_cur_selection == $ps_base_path ? 'sf-menu-disabled-selected' : ''));
         } else {
             $vs_buf .= caNavLink($this->opo_request, unicode_ucfirst(isset($va_submenu_item['displayName']) ? $va_submenu_item['displayName'] : ''), $ps_cur_selection == $ps_base_path ? 'sf-menu-selected' : '', $pa_defaults['module'], $pa_defaults['controller'], $pa_defaults['action'], array_merge($pa_additional_params, $va_submenu_item['parameters']));
         }
         if (isset($va_submenu_item['navigation']) && $va_submenu_item['navigation']) {
             $vs_buf .= $this->_genSubMenu($va_submenu_item['navigation'], $ps_cur_selection, $pa_additional_params, $ps_base_path, $pa_defaults);
         }
         $vs_buf .= "</li>\n";
     }
     return $vs_buf . "\n";
 }
    if ($this->getVar('previous_id')) {
        print caNavLink($this->request, "&lsaquo; " . _t("Previous"), '', 'Detail', 'Object', 'Show', array('object_id' => $this->getVar('previous_id')), array('id' => 'previous'));
    } else {
        print "&lsaquo; " . _t("Previous");
    }
    print "&nbsp;&nbsp;&nbsp;{$vs_back_link}&nbsp;&nbsp;&nbsp;";
    if ($this->getVar('next_id') > 0) {
        print caNavLink($this->request, _t("Next") . " &rsaquo;", '', 'Detail', 'Object', 'Show', array('object_id' => $this->getVar('next_id')), array('id' => 'next'));
    } else {
        print _t("Next") . " &rsaquo;";
    }
}
?>
		</div><!-- end nav -->
		<h2><?php 
print unicode_ucfirst($this->getVar('')) . '' . $vs_title;
?>
</h2>
		<div id="leftCol">
<?php 
if ($t_rep && $t_rep->getPrimaryKey()) {
    ?>
			<div id="objDetailImage">
<?php 
    if ($va_display_options['no_overlay']) {
        print $t_rep->getMediaTag('media', $vs_display_version, $this->getVar('primary_rep_display_options'));
    } else {
        $va_opts = array('display' => 'detail', 'object_id' => $vn_object_id, 'containerID' => 'cont');
        print "<div id='cont'>" . $t_rep->getRepresentationViewerHTMLBundle($this->request, $va_opts) . "</div>";
    }
    ?>
Esempio n. 15
0
    }
} else {
    if (!$this->request->isAjax()) {
        print $this->render('Browse/browse_start_html.php');
    }
    ?>
		<div id="resultBox"> 
		<div id="browseLeftColWide"><div id="browseFacetCol">
<?php 
    if (sizeof($va_criteria) > 0) {
        print "<div class='criteriaList'>";
        print _t("Showing:") . "<br/><br/>";
        foreach ($va_criteria as $vs_facet_name => $va_row_ids) {
            foreach ($va_row_ids as $vn_row_id => $vs_label) {
                print "<div>";
                $vs_facet_label = isset($va_facet_info[$vs_facet_name]['label_singular']) ? unicode_ucfirst($va_facet_info[$vs_facet_name]['label_singular']) : '???';
                print $vs_facet_label . ": " . $vs_label . caNavLink($this->request, '<img src="' . $this->request->getThemeUrlPath() . '/graphics/nhf/close.gif" width="17" height="17" border="0" style="margin: 0px 0px 0px 5px; vertical-align:middle;">', '', '', 'Browse', 'removeCriteria', array('facet' => $vs_facet_name, 'id' => $vn_row_id));
                print "</div>";
            }
        }
        print "<div>" . caNavLink($this->request, _t('start new search'), '', '', 'Browse', 'clearCriteria', array()) . "</div>";
        print "</div><!-- end criteriaList -->";
    }
    $o_browse = $this->getVar('browse');
    $va_available_facets = $this->getVar('available_facets');
    if (is_array($va_available_facets) && sizeof($va_available_facets) > 0) {
        print "<div class='mainHeading'>" . _t("Browse the Collections") . "</div>";
        foreach ($va_available_facets as $vs_facet_code => $va_facet_info) {
            print "<div class='facetHeading'>" . $va_facet_info['label_plural'] . "</div>\n";
            $va_facet = $o_browse->getFacet($vs_facet_code, array('checkAccess' => array(1)));
            print "<div class='facets'>";
    ?>
		</div><!-- end nav -->
		<div class='titleBar'>
			<div class='recordTitle'><h1><?php 
    print $vs_title;
    ?>
</h1></div>

		</div>
		<div style='clear:both;height:1px;'></div>
		<div id="rightCol">	
<?php 
    print "<h3>" . _t("Identifier") . "</h3><p>";
    print $t_collection->get('idno');
    print "</p>";
    print "<h3>Type</h3><p>" . unicode_ucfirst($this->getVar('typename')) . "</p>";
    if ($va_alt_name = $t_collection->get('ca_collections.nonpreferred_labels')) {
        print "<h3>" . _t("Alternate title") . "</h3><p> " . $va_alt_name . "</p><!-- end unit -->";
    }
    if ($va_date = $t_collection->get('ca_collections.spanDates')) {
        print "<h3>" . _t("Date") . "</h3><p> " . $va_date . "</p><!-- end unit -->";
    }
    # --- attributes
    $va_attributes = $this->request->config->get('ca_collections_detail_display_attributes');
    if (is_array($va_attributes) && sizeof($va_attributes) > 0) {
        foreach ($va_attributes as $vs_attribute_code) {
            if ($vs_value = $t_collection->get("ca_collections.{$vs_attribute_code}")) {
                print "<h3>" . $t_collection->getDisplayLabel("ca_collections.{$vs_attribute_code}") . "</h3><p> {$vs_value}</p><!-- end unit -->";
            }
        }
    }
        }
        ?>
		</table>
	</div>
<?php 
        break;
        # ------------------------------------------------------------
    # ------------------------------------------------------------
    case 'alphabetical':
    default:
        $va_groups = array_keys($va_facet);
        ?>

	<div class="browseSelectPanelHeader">
	<h2 class='browse'><?php 
        print unicode_ucfirst($va_facet_info['label_plural']);
        ?>
</h2>

<?php 
        $vs_g = null;
        if ($vb_individual_group_display) {
            if (!($vs_g = $this->getVar('only_show_group'))) {
                $va_tmp = array_keys($va_grouped_items);
                $vs_g = array_shift($va_tmp);
            }
        }
        print "<div class='jumpToGroup'>";
        foreach ($va_groups as $vs_group) {
            if ($vb_individual_group_display) {
                print " <a href='#' onclick='loadFacetGroup(\"" . ($vs_group === '~' ? '~' : $vs_group) . "\"); return false;' " . ($vs_g == $vs_group ? "class='browseSelectPanelFacetGroupSelected'" : "class='browseSelectPanelFacetGroup'") . ">{$vs_group}</a> ";
        if ($this->getVar('previous_id')) {
            print caNavLink($this->request, "&lsaquo; " . _t("Previous"), '', 'Detail', 'ObjectLots', 'Show', array('lot_id' => $this->getVar('previous_id')), array('id' => 'previous'));
        } else {
            print "&lsaquo; " . _t("Previous");
        }
        print "&nbsp;&nbsp;&nbsp;{$vs_back_link}&nbsp;&nbsp;&nbsp;";
        if ($this->getVar('next_id') > 0) {
            print caNavLink($this->request, _t("Next") . " &rsaquo;", '', 'Detail', 'ObjectLots', 'Show', array('lot_id' => $this->getVar('next_id')), array('id' => 'next'));
        } else {
            print _t("Next") . " &rsaquo;";
        }
    }
    ?>
		</div><!-- end nav -->
		<h1><?php 
    print unicode_ucfirst($t_object_lot->getTypeName()) . ': ' . $vs_title;
    ?>
</h1>
		<div id="rightCol">	
<?php 
    if ($this->request->config->get('enable_bookmarks')) {
        ?>
				<!-- bookmark link BEGIN -->
				<div class="unit">
<?php 
        if ($this->request->isLoggedIn()) {
            print caNavLink($this->request, _t("Bookmark item +"), 'button', '', 'Bookmarks', 'addBookmark', array('row_id' => $vn_lot_id, 'tablename' => 'ca_object_lots'));
        } else {
            print caNavLink($this->request, _t("Bookmark item +"), 'button', '', 'LoginReg', 'form', array('site_last_page' => 'Bookmarks', 'row_id' => $vn_lot_id, 'tablename' => 'ca_object_lots'));
        }
        ?>
    } else {
        print _t("Next") . " &rsaquo;";
    }
    ?>
		</div><!-- end nav -->
		<h1><?php 
    print $vs_title;
    ?>
</h1>	
<?php 
    # --- identifier
    if ($t_collection->get('idno')) {
        print "<div class='unit'><b>" . _t("Identifier") . "</b>: " . $t_collection->get('idno') . "</div><!-- end unit -->";
    }
    if ($this->getVar('typename')) {
        print "<div class='unit'><b>" . _t("Type") . ":</b> " . unicode_ucfirst($this->getVar('typename')) . "</div><!-- end unit -->";
    }
    # --- attributes
    $va_attributes = $this->request->config->get('ca_collections_detail_display_attributes');
    if (is_array($va_attributes) && sizeof($va_attributes) > 0) {
        foreach ($va_attributes as $vs_attribute_code) {
            if ($t_collection->get("ca_collections." . $vs_attribute_code)) {
                print "<div class='unit'><b>" . $t_collection->getAttributeLabel($vs_attribute_code) . ":</b> " . $t_collection->get("ca_collections." . $vs_attribute_code) . "</div><!-- end unit -->";
            }
        }
    }
    # --- description
    if ($this->request->config->get('ca_collections_description_attribute')) {
        if ($vs_description_text = $t_collection->get("ca_collections." . $this->request->config->get('ca_collections_description_attribute'))) {
            print "<div class='unit'><div id='description'><b>" . $t_collection->getAttributeLabel($this->request->config->get('ca_collections_description_attribute')) . ":</b> " . $vs_description_text . "</div></div><!-- end unit -->";
            ?>
if (($va_dates = $t_object->get('ca_objects.date', array('returnAsArray' => true, 'convertCodesToDisplayText' => true))) && $this->getVar('typename') != 'Audio/Film/Video') {
    if (sizeof($va_dates)) {
        $va_dates_for_display = array();
        foreach ($va_dates as $va_date) {
            #print_r($va_date);
            if ($va_date["dates_value"]) {
                $va_dates_for_display[] = "<p>" . $va_date["dates_value"] . " <span class='details'>(" . strtolower($va_date["dc_dates_types"]) . ")</span></p><!-- end unit -->";
            }
        }
        if (sizeof($va_dates_for_display)) {
            print "<h3>" . _t("Date%1", sizeof($va_dates) > 1 ? "s" : "") . "</h3>";
            print implode("\n", $va_dates_for_display);
        }
    }
}
print "<h3>Type</h3><p>" . caNavLink($this->request, unicode_ucfirst($this->getVar('typename')), "", "", "Browse", "clearAndAddCriteria", array("facet" => "type_facet", "id" => $t_object->get('ca_objects.type_id'))) . "</p>";
if ($vs_artType = $t_object->get('ca_objects.artType', array('convertCodesToDisplayText' => true, 'delimiter' => ', '))) {
    if ($vs_artType != "-") {
        print "<h3>" . _t("Subtype") . "</h3><p>" . caNavLink($this->request, $vs_artType, "", "", "Browse", "clearAndAddCriteria", array("facet" => "subtypeart_facet", "id" => $t_object->get('ca_objects.artType'))) . "</p><!-- end unit -->";
    }
}
if ($vs_audioType = $t_object->get('ca_objects.audioFilmType', array('convertCodesToDisplayText' => true, 'delimiter' => ', '))) {
    if ($vs_audioType != "-NONE-") {
        print "<h3>" . _t("Subtype") . "</h3><p>" . caNavLink($this->request, $vs_audioType, "", "", "Browse", "clearAndAddCriteria", array("facet" => "subtypeaudio_facet", "id" => $t_object->get('ca_objects.audioFilmType'))) . "</p><!-- end unit -->";
    }
}
if ($vs_miscellaneous = $t_object->get('ca_objects.miscellaneousType', array('convertCodesToDisplayText' => true, 'delimiter' => ', '))) {
    if ($vs_miscellaneous != "-") {
        print "<h3>" . _t("Subtype") . "</h3><p>" . caNavLink($this->request, $vs_miscellaneous, "", "", "Browse", "clearAndAddCriteria", array("facet" => "subtypemisc_facet", "id" => $t_object->get('ca_objects.miscellaneousType'))) . "</p><!-- end unit -->";
    }
}
                         break;
                     default:
                         if (isset($va_item['ca_attribute_' . $vn_grouping_attribute_id]) && is_array($va_item['ca_attribute_' . $vn_grouping_attribute_id])) {
                             foreach ($va_item['ca_attribute_' . $vn_grouping_attribute_id] as $vn_i => $va_v) {
                                 $va_groups[] = trim($va_v['value_longtext1']);
                             }
                         }
                         break;
                 }
             } else {
                 $va_groups[] = mb_substr(trim($va_item[$va_label_order_by_fields[0]]), 0, 1, 'UTF-8');
             }
             break;
     }
     foreach ($va_groups as $vs_group) {
         if (!($vs_group = trim(unicode_ucfirst($vs_group)))) {
             $vs_group = "~";
         }
         $vs_alpha_key = '';
         foreach ($va_label_order_by_fields as $vs_f) {
             $vs_alpha_key .= $va_item[$vs_f];
         }
         $vs_alpha_key = trim($vs_alpha_key);
         $va_grouped_items[$vs_group][$vs_alpha_key] = $va_item;
     }
 }
 // sort lists alphabetically
 foreach ($va_grouped_items as $vs_key => $va_list) {
     ksort($va_list);
     $va_grouped_items[$vs_key] = $va_list;
 }
    }
    if ($this->getVar('resultsLink')) {
        print "&nbsp;&nbsp;&nbsp;" . $this->getVar('resultsLink') . "&nbsp;&nbsp;&nbsp;";
    } else {
        print "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
    }
    if ($this->getVar('nextLink')) {
        print $this->getVar('nextLink');
    } else {
        print _t("Next") . " &rsaquo;";
    }
}
?>
		</div><!-- end nav -->
		<h1><?php 
print unicode_ucfirst($t_object->get('ca_objects.type_id', array('convertCodesToDisplayText' => true))) . ': ' . caReturnDefaultIfBlank($t_object->get('idno'));
?>
</h1>
		<div id="leftCol">
<?php 
if (in_array($t_object->get('ca_objects.type_id'), $va_eggshell_type_ids)) {
    # --- Eggshells
    ?>
			<br><div class="unit"><h2>Taxonomy</h2></div>
<?php 
    # --- attributes
    $va_taxonomy = array("group", "order", "family", "genus", "species");
    foreach ($va_taxonomy as $vs_attribute_code) {
        if ($vs_value = $t_object->get("ca_objects.{$vs_attribute_code}")) {
            print "<div class='unit'><b>" . $t_object->getDisplayLabel("ca_objects.{$vs_attribute_code}") . ":</b> " . caReturnDefaultIfBlank($vs_value) . "</div><!-- end unit -->";
        }
 public function lookup()
 {
     $vs_search = $this->request->getParameter('q', pString);
     $t_list = new ca_lists();
     $va_data = array();
     $va_access_values = caGetUserAccessValues($this->request);
     #
     # Do "quicksearches" on so-configured tables
     #
     if ($this->request->config->get('quicksearch_return_ca_objects')) {
         $va_results = caExtractValuesByUserLocale(SearchEngine::quickSearch($vs_search, 'ca_objects', 57, array('limit' => 3, 'checkAccess' => $va_access_values)));
         // break found objects out by type
         foreach ($va_results as $vn_id => $va_match_info) {
             $vs_type = unicode_ucfirst($t_list->getItemFromListForDisplayByItemID('object_types', $va_match_info['type_id'], true));
             $va_data['ca_objects'][$vs_type][$vn_id] = $va_match_info;
         }
     }
     if ($this->request->config->get('quicksearch_return_ca_entities')) {
         $va_data['ca_entities'][_t('Entities')] = caExtractValuesByUserLocale(SearchEngine::quickSearch($vs_search, 'ca_entities', 20, array('limit' => 10, 'checkAccess' => $va_access_values)));
     }
     if ($this->request->config->get('quicksearch_return_ca_places')) {
         $va_data['ca_places'][_t('Places')] = caExtractValuesByUserLocale(SearchEngine::quickSearch($vs_search, 'ca_places', 72, array('limit' => 10, 'checkAccess' => $va_access_values)));
     }
     if ($this->request->config->get('quicksearch_return_ca_occurrences')) {
         $va_results = caExtractValuesByUserLocale(SearchEngine::quickSearch($vs_search, 'ca_occurrences', 67, array('limit' => 10, 'checkAccess' => $va_access_values)));
         // break found occurrences out by type
         foreach ($va_results as $vn_id => $va_match_info) {
             $vs_type = unicode_ucfirst($t_list->getItemFromListForDisplayByItemID('occurrence_types', $va_match_info['type_id'], true));
             $va_data['ca_occurrences'][$vs_type][$vn_id] = $va_match_info;
         }
     }
     if ($this->request->config->get('quicksearch_return_ca_collections')) {
         $va_data['ca_collections'][_t('Collections')] = caExtractValuesByUserLocale(SearchEngine::quickSearch($vs_search, 'ca_collections', 13, array('limit' => 10, 'checkAccess' => $va_access_values)));
     }
     $this->view->setVar('matches', $va_data);
     $this->render('Search/ajax_search_lookup_json.php');
 }
Esempio n. 24
0
        print "<div class='unit'><H2>" . _t("Related Place") . (sizeof($this->getVar('places')) > 1 ? "s" : "") . "</H2>";
        $va_place_rel_types = $t_rel_types->getRelationshipInfo('ca_places_x_places');
        foreach ($this->getVar('places') as $va_place_info) {
            print "<div>";
            print ($this->request->config->get('allow_detail_for_ca_places') ? caNavLink($this->request, $va_place_info['label'], '', 'Detail', 'Place', 'Show', array('place_id' => $va_place_info['place_id'])) : $va_place_info['label']) . " (" . unicode_ucfirst($va_place_rel_types[$va_place_info['relationship_type_id']]['typename']) . ")";
            print "</div>";
        }
        print "</div><!-- end unit -->";
    }
    # --- collections
    if ($this->getVar('collections')) {
        print "<div class='unit'><H2>" . _t("Related Collection") . (sizeof($this->getVar('collections')) > 1 ? "s" : "") . "</H2>";
        $va_collection_rel_types = $t_rel_types->getRelationshipInfo('ca_places_x_collections');
        foreach ($this->getVar('collections') as $va_collection_info) {
            print "<div>";
            print ($this->request->config->get('allow_detail_for_ca_collections') ? caNavLink($this->request, $va_collection_info['label'], '', 'Detail', 'Collection', 'Show', array('collection_id' => $va_collection_info['collection_id'])) : $va_collection_info['label']) . " (" . unicode_ucfirst($va_collection_rel_types[$va_collection_info['relationship_type_id']]['typename']) . ")";
            print "</div>";
        }
        print "</div><!-- end unit -->";
    }
    ?>
	</div><!-- end leftCol -->
			
	<div id="rightCol">
		<div id="resultBox">
<?php 
}
// set parameters for paging controls view
$this->setVar('other_paging_parameters', array('place_id' => $vn_place_id));
print $this->render('related_objects_grid.php');
if (!$this->request->isAjax()) {
					</script>
<?php 
    }
}
# --- places
$va_places = $t_collection->get("ca_places", array("returnAsArray" => 1, 'checkAccess' => $va_access_values));
if (sizeof($va_places) > 0) {
    print "<div class='unit'><h2>" . _t("Related Place") . (sizeof($va_places) > 1 ? "s" : "") . "</h2>";
    foreach ($va_places as $va_place_info) {
        print "<div>" . ($this->request->config->get('allow_detail_for_ca_places') ? caNavLink($this->request, $va_place_info['label'], '', 'Detail', 'Place', 'Show', array('place_id' => $va_place_info['place_id'])) : $va_place_info['label']) . " (" . $va_place_info['relationship_typename'] . ")</div>";
    }
    print "</div><!-- end unit -->";
}
if ($va_contents = $t_collection->get('ca_collections.children.preferred_labels.name', array('delimiter' => '<br/>', 'returnAsLink' => true, "sort" => "preferred_labels.name"))) {
    print "<div class='header'><a name='contents'>" . unicode_ucfirst($t_collection->getTypeName()) . " " . _t('Contents') . "</a></div>";
    $va_anchors[] = '<p><a href="#contents">' . unicode_ucfirst($t_collection->getTypeName()) . " " . _t('Contents') . '</a></p>';
    print "<div class='unit'>" . $va_contents . "</div>";
}
# --- collections
$va_collections = $t_collection->get("ca_collections", array("returnAsArray" => 1, 'checkAccess' => $va_access_values, "sort" => "preferred_labels.name"));
if (sizeof($va_collections) > 0) {
    print "<div class='header'><a name='relcollection'>" . _t("Related Collection") . (sizeof($va_collections) > 1 ? "s" : "") . "</a></div><div class='unit'>";
    $va_anchors[] = '<p><a href="#relcollection">' . _t('Related Collection') . '</a></p>';
    foreach ($va_collections as $va_collection_info) {
        print "<div class='col'>" . ($this->request->config->get('allow_detail_for_ca_collections') ? caNavLink($this->request, $va_collection_info['label'], '', 'FindingAids', 'Collection', 'Show', array('collection_id' => $va_collection_info['collection_id'])) : $va_collection_info['label']);
        print "</div>";
        #$va_collection_id = $va_collection_info['collection_id'];
        #$t_collection = new ca_collections($va_collection_id);
        #print "<div class='subCol'>".$t_collection->get('ca_collections.children.preferred_labels.name', array('delimiter' => '<br/>', 'returnAsLink' => true, "sort" => "preferred_labels.name"))."</div>";
        #print "<div style='height:15px;width:100%;'></div>";
    }
if ($t_object->get('ca_objects.page_number')) {
    print "<div class='unit'><b>" . $t_object->getAttributeLabel("page_number") . ":</b> " . $t_object->get('ca_objects.page_number') . "</div><!-- end unit -->";
}
if ($t_object->get('ca_objects.reproduction_restrictions')) {
    print "<div class='unit'><b>" . $t_object->getAttributeLabel("reproduction_restrictions") . ":</b> " . $t_object->get('ca_objects.reproduction_restrictions') . "</div><!-- end unit -->";
}
# --- entities
$va_entities = $t_object->get("ca_entities", array("returnAsArray" => 1, 'checkAccess' => $va_access_values));
if (sizeof($va_entities) > 0) {
    $va_entities_by_type = array();
    foreach ($va_entities as $va_entity) {
        $va_entities_by_type[$va_entity['relationship_typename']][] = $this->request->config->get('allow_detail_for_ca_entities') ? caNavLink($this->request, $va_entity["label"], '', 'Detail', 'Entity', 'Show', array('entity_id' => $va_entity["entity_id"])) : $va_entity["label"];
    }
    ksort($va_entities_by_type);
    foreach ($va_entities_by_type as $vs_type => $va_ent_links) {
        print "<div class='unit'><b>" . unicode_ucfirst($vs_type) . ": </b>" . join($va_ent_links, ", ") . "</div><!-- end unit -->";
    }
}
if ($t_object->get('ca_objects.address.address1') || $t_object->get('ca_objects.address.address2') || $t_object->get('ca_objects.address.city') || $t_object->get('ca_objects.address.stateprovince') || $t_object->get('ca_objects.address.postalcode') || $t_object->get('ca_objects.address.country')) {
    print "<div class='unit'><b>" . $t_object->getAttributeLabel("address") . ":</b> ";
    if ($t_object->get('ca_objects.address.address1')) {
        print $t_object->get('ca_objects.address.address1') . "<br/>";
    }
    if ($t_object->get('ca_objects.address.address2')) {
        print $t_object->get('ca_objects.address.address2') . "<br/>";
    }
    if ($t_object->get('ca_objects.address.city')) {
        print $t_object->get('ca_objects.address.city') . ", ";
    }
    if ($t_object->get('ca_objects.address.stateprovince')) {
        print $t_object->get('ca_objects.address.stateprovince') . " ";
        if ($this->getVar('previous_id')) {
            print caNavLink($this->request, "&lsaquo; " . _t("Previous"), '', 'Detail', 'Occurrence', 'Show', array('occurrence_id' => $this->getVar('previous_id')), array('id' => 'previous'));
        } else {
            print "&lsaquo; " . _t("Previous");
        }
        print "&nbsp;&nbsp;&nbsp;{$vs_back_link}&nbsp;&nbsp;&nbsp;";
        if ($this->getVar('next_id') > 0) {
            print caNavLink($this->request, _t("Next") . " &rsaquo;", '', 'Detail', 'Occurrence', 'Show', array('occurrence_id' => $this->getVar('next_id')), array('id' => 'next'));
        } else {
            print _t("Next") . " &rsaquo;";
        }
    }
    ?>
		</div><!-- end nav -->
		<h1><?php 
    print unicode_ucfirst($t_occurrence->getTypeName()) . ': ' . $vs_title;
    ?>
</h1>
		<div id="leftCol">	
<?php 
    if ($this->request->config->get('enable_bookmarks')) {
        ?>
				<!-- bookmark link BEGIN -->
				<div class="unit">
<?php 
        if ($this->request->isLoggedIn()) {
            print caNavLink($this->request, _t("Bookmark +"), 'button', '', 'Bookmarks', 'addBookmark', array('row_id' => $vn_occurrence_id, 'tablename' => 'ca_occurrences'));
        } else {
            print caNavLink($this->request, _t("Bookmark +"), 'button', '', 'LoginReg', 'form', array('site_last_page' => 'Bookmarks', 'row_id' => $vn_occurrence_id, 'tablename' => 'ca_occurrences'));
        }
        ?>
        if ($this->getVar('previous_id')) {
            print caNavLink($this->request, "&lsaquo; " . _t("Previous"), '', 'Detail', 'Entity', 'Show', array('entity_id' => $this->getVar('previous_id')), array('id' => 'previous'));
        } else {
            print "&lsaquo; " . _t("Previous");
        }
        print "&nbsp;&nbsp;&nbsp;{$vs_back_link}&nbsp;&nbsp;&nbsp;";
        if ($this->getVar('next_id') > 0) {
            print caNavLink($this->request, _t("Next") . " &rsaquo;", '', 'Detail', 'Entity', 'Show', array('entity_id' => $this->getVar('next_id')), array('id' => 'next'));
        } else {
            print _t("Next") . " &rsaquo;";
        }
    }
    ?>
		</div><!-- end nav -->
		<h1><?php 
    print unicode_ucfirst($this->getVar('typename')) . ': ' . $vs_title;
    ?>
</h1>
		<div id="leftCol">		
<?php 
    if (!$this->request->config->get('dont_allow_registration_and_login') && $this->request->config->get('enable_bookmarks')) {
        ?>
				<!-- bookmark link BEGIN -->
				<div class="unit">
<?php 
        if ($this->request->isLoggedIn()) {
            print caNavLink($this->request, _t("Bookmark item +"), 'button', '', 'Bookmarks', 'addBookmark', array('row_id' => $vn_entity_id, 'tablename' => 'ca_entities'));
        } else {
            print caNavLink($this->request, _t("Bookmark item +"), 'button', '', 'LoginReg', 'form', array('site_last_page' => 'Bookmarks', 'row_id' => $vn_entity_id, 'tablename' => 'ca_entities'));
        }
        ?>
Esempio n. 29
0
        if ($this->getVar('previous_id')) {
            print caNavLink($this->request, "&lsaquo; " . _t("Previous"), '', 'Detail', 'Place', 'Show', array('place_id' => $this->getVar('previous_id')), array('id' => 'previous'));
        } else {
            print "&lsaquo; " . _t("Previous");
        }
        print "&nbsp;&nbsp;&nbsp;{$vs_back_link}&nbsp;&nbsp;&nbsp;";
        if ($this->getVar('next_id') > 0) {
            print caNavLink($this->request, _t("Next") . " &rsaquo;", '', 'Detail', 'Place', 'Show', array('place_id' => $this->getVar('next_id')), array('id' => 'next'));
        } else {
            print _t("Next") . " &rsaquo;";
        }
    }
    ?>
		</div><!-- end nav -->
		<h2><?php 
    print unicode_ucfirst($t_place->getTypeName()) . ': ' . $vs_title;
    ?>
</h2>	

		<div id="resultBox">
<?php 
}
// set parameters for paging controls view
$this->setVar('other_paging_parameters', array('place_id' => $vn_place_id));
print $this->render('related_objects_grid.php');
if (!$this->request->isAjax()) {
    ?>
		</div><!-- end resultBox -->
		<?php 
    if (!$this->request->config->get('dont_allow_registration_and_login') && $this->request->config->get('enable_bookmarks')) {
        ?>
    if ($this->getVar('previous_id')) {
        print caNavLink($this->request, "&lsaquo; " . _t("Previous"), '', 'Detail', 'Object', 'Show', array('object_id' => $this->getVar('previous_id')), array('id' => 'previous'));
    } else {
        print "&lsaquo; " . _t("Previous");
    }
    print "&nbsp;&nbsp;&nbsp;{$vs_back_link}&nbsp;&nbsp;&nbsp;";
    if ($this->getVar('next_id') > 0) {
        print caNavLink($this->request, _t("Next") . " &rsaquo;", '', 'Detail', 'Object', 'Show', array('object_id' => $this->getVar('next_id')), array('id' => 'next'));
    } else {
        print _t("Next") . " &rsaquo;";
    }
}
?>
		</div><!-- end nav -->
		<h1><?php 
print unicode_ucfirst($this->getVar('typename')) . ': ' . caReturnDefaultIfBlank($t_object->get('idno'));
?>
</h1>
		
		<div id="leftCol">
<?php 
if ($this->request->config->get('show_add_this')) {
    ?>
				<!-- AddThis Button BEGIN -->
				<div class="unit"><a class="addthis_button" href="http://www.addthis.com/bookmark.php?v=250&amp;username=xa-4baa59d57fc36521"><img src="http://s7.addthis.com/static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0;"/></a><script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#username=xa-4baa59d57fc36521"></script></div><!-- end unit -->
				<!-- AddThis Button END -->
<?php 
}
?>
			<br><div class="unit"><h2>Taxonomy</h2></div>
<?php