• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP ca_occurrences类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中ca_occurrences的典型用法代码示例。如果您正苦于以下问题:PHP ca_occurrences类的具体用法?PHP ca_occurrences怎么用?PHP ca_occurrences使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了ca_occurrences类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: loadTypeSpecificValueFromRow

 public function loadTypeSpecificValueFromRow($pa_value_array)
 {
     $this->opn_occurrence_id = $pa_value_array['value_integer1'];
     require_once __CA_MODELS_DIR__ . '/ca_occurrences.php';
     $t_occ = new ca_occurrences($this->opn_occurrence_id);
     $this->ops_text = $t_occ->getLabelForDisplay() . ($t_occ->get("idno") ? " [" . $t_occ->get("idno") . "]" : "");
 }
开发者ID:guaykuru,项目名称:pawtucket,代码行数:7,代码来源:OccurrenceAttributeValue.php


示例2: Index

 public function Index()
 {
     $t_occurrence = new ca_occurrences();
     if ($this->request->config->get("dont_enforce_access_settings")) {
         $va_access_values = array();
     } else {
         $va_access_values = caGetUserAccessValues($this->request);
     }
     # --- get the most viewed occ records
     $va_occ_info = array();
     $va_most_viewed_occs = $t_occurrence->getMostViewedItems(3, array('checkAccess' => $va_access_values));
     foreach ($va_most_viewed_occs as $vn_occurrence_id => $va_occ_info) {
         $t_occurrence->load($vn_occurrence_id);
         $va_occ_info['title'] = $t_occurrence->getLabelForDisplay();
         $va_preview_stills = $t_occurrence->get('ca_occurrences.ic_stills.ic_stills_media', array('version' => "widepreview", "showMediaInfo" => false, "returnAsArray" => true));
         if (sizeof($va_preview_stills) > 0) {
             $va_occ_info["mediaPreview"] = array_shift($va_preview_stills);
         }
         $va_medium_stills = $t_occurrence->get('ca_occurrences.ic_stills.ic_stills_media', array('version' => "medium", "showMediaInfo" => false, "returnAsArray" => true));
         if (sizeof($va_medium_stills) > 0) {
             $va_occ_info["mediaMedium"] = array_shift($va_medium_stills);
         }
         $va_occ_info["repository"] = $t_occurrence->get("CLIR2_institution", array('convertCodesToDisplayText' => true));
         $va_most_viewed_occs[$vn_occurrence_id] = $va_occ_info;
     }
     $this->view->setVar('most_viewed_occs', $va_most_viewed_occs);
     $this->render('Engage/engage_index_html.php');
 }
开发者ID:guaykuru,项目名称:pawtucket,代码行数:28,代码来源:EngageController.php


示例3: caDownloadAttributeMedia

 function caDownloadAttributeMedia($po_request, $po_response, $pn_occurrence_id, $ps_version, $pa_options = null)
 {
     $o_view = new View($po_request, $po_request->getViewsDirectoryPath() . '/bundles/');
     $t_occurrence = new ca_occurrences($pn_occurrence_id);
     if (!$t_occurrence->getPrimaryKey()) {
         return null;
     }
     $vs_path = $t_occurrence->get('ca_occurrences.report_file', array('version' => $ps_version, 'return' => 'path'));
     $vs_path_ext = pathinfo($vs_path, PATHINFO_EXTENSION);
     if (!($vs_title = trim($t_occurrence->get('ca_occurrences.preferred_labels.name')))) {
         $vs_title = "report";
     }
     $vs_name = _t(preg_replace('![^A-Za-z0-9\\,\\/\\?\\"\']+!', '_', $vs_title) . ".{$vs_path_ext}");
     $o_view->setVar('file_path', $vs_path);
     $o_view->setVar('file_name', $vs_name);
     // send download
     return $o_view->render('ca_attributes_download_media.php');
 }
开发者ID:ffarago,项目名称:pawtucket2,代码行数:18,代码来源:reports.php


示例4: ca_occurrences

 *
 * CollectiveAccess is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTIES whatsoever, including any implied warranty of 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
 *
 * This source code is free and modifiable under the terms of 
 * GNU General Public License. (http://www.gnu.org/copyleft/gpl.html). See
 * the "license.txt" file for details, or visit the CollectiveAccess web site at
 * http://www.CollectiveAccess.org
 *
 * ----------------------------------------------------------------------
 */
$vn_set_id = $this->getVar('set_id');
$t_set = $this->getVar('t_set');
$va_items = $this->getVar('items');
$t_occurrence = new ca_occurrences();
print '<?xml version="1.0" encoding="UTF-8"?>';
?>
<imageSet>
	<setInfo set_id="<?php 
print $vn_set_id;
?>
">
		<name><![CDATA[<?php 
print $t_set->getLabelForDisplay();
?>
]]></name>
		<description><![CDATA[<?php 
print $t_set->getAttributesForDisplay("description");
?>
]]></description>
开发者ID:guaykuru,项目名称:pawtucket,代码行数:31,代码来源:xml_set_items.php


示例5: getOccurrenceMediaOverlay

 /**
  * Returns content for overlay containing details for object representation linked to occurrence
  */
 public function getOccurrenceMediaOverlay()
 {
     $pn_occurrence_id = $this->request->getParameter('occurrence_id', pInteger);
     $pn_object_id = $this->request->getParameter('object_id', pInteger);
     $this->view->setVar('object_id', $pn_object_id);
     $pn_representation_id = $this->request->getParameter('representation_id', pInteger);
     $this->view->setVar('occurrence_id', $pn_occurrence_id);
     $t_occurrence = new ca_occurrences($pn_occurrence_id);
     $this->view->setVar('object_id', $pn_object_id);
     $t_object = new ca_objects($pn_object_id);
     $this->view->setVar('t_object', $t_object);
     $t_rep = new ca_object_representations($pn_representation_id);
     $this->view->setVar('representation_id', $pn_representation_id);
     $this->view->setVar('t_object_representation', $t_rep);
     if ($this->request->config->get("dont_enforce_access_settings")) {
         $va_access_values = array();
     } else {
         $va_access_values = caGetUserAccessValues($this->request);
     }
     if (!$t_occurrence->getPrimaryKey()) {
         die("Invalid occurrence_id");
     }
     if (!$t_object->getPrimaryKey()) {
         die("Invalid object_id");
     }
     if (!$t_rep->getPrimaryKey()) {
         die("Invalid representation_id");
     }
     if (sizeof($va_access_values) && !in_array($t_occurrence->get('access'), $va_access_values)) {
         die("Invalid occurrence_id");
     }
     if (sizeof($va_access_values) && !in_array($t_object->get('access'), $va_access_values)) {
         die("Invalid object_id");
     }
     if (sizeof($va_access_values) && !in_array($t_rep->get('access'), $va_access_values)) {
         die("Invalid rep_id");
     }
     // Get media for display using configured rules
     $va_rep_display_info = caGetMediaDisplayInfo("media_overlay", $t_rep->getMediaInfo('media', 'INPUT', 'MIMETYPE'));
     // set version
     $this->view->setVar('version', $va_rep_display_info['display_version']);
     unset($va_display_info['display_version']);
     // set poster frame URL
     //$va_rep_display_info['poster_frame_url'] = $t_rep->getMediaUrl('media', $va_rep_display_info['poster_frame_version']);
     //unset($va_display_info['poster_frame_version']);
     //$va_rep_display_info['viewer_base_url'] = $t_rep->getAppConfig()->get('ca_url_root');
     // set other options
     $this->view->setVar('display_options', $va_rep_display_info);
     if (!($ps_display_type = trim($this->request->getParameter('display_type', pString)))) {
         $ps_display_type = 'media_overlay';
     }
     if (!($ps_containerID = trim($this->request->getParameter('containerID', pString)))) {
         $ps_containerID = 'caMediaPanelContentArea';
     }
     $this->view->setVar("display_type", $ps_display_type);
     $this->view->setVar("containerID", $ps_containerID);
     // Get all objects asscoiated with this occurrence and show primary reps as icons for navigation
     $va_exhibition_images = $t_occurrence->get("ca_objects", array('restrict_to_relationship_types' => array('describes'), "returnAsArray" => 1, 'checkAccess' => $va_access_values));
     if (sizeof($va_exhibition_images) > 0) {
         $t_image_objects = new ca_objects();
         $i = 1;
         foreach ($va_exhibition_images as $vn_rel_id => $va_info) {
             $t_image_objects->load($va_info["object_id"]);
             if ($t_primary_rep = $t_image_objects->getPrimaryRepresentationInstance()) {
                 $va_temp = array();
                 if (!sizeof($va_access_values) || in_array($t_primary_rep->get('access'), $va_access_values)) {
                     $va_temp["representation_id"] = $t_primary_rep->get("representation_id");
                     $va_temp["rep_icon"] = $t_primary_rep->getMediaTag('media', 'icon');
                     $va_temp["rep_tinyicon"] = $t_primary_rep->getMediaTag('media', 'tinyicon');
                     $va_temp["object_id"] = $va_info["object_id"];
                     $va_thumbnails[$va_info["object_id"]] = $va_temp;
                     if ($vn_getNext == 1) {
                         $this->view->setVar("next_object_id", $va_info["object_id"]);
                         $this->view->setVar("next_representation_id", $t_primary_rep->get("representation_id"));
                         $vn_getNext = 0;
                     }
                     if ($va_info["object_id"] == $pn_object_id) {
                         $this->view->setVar("representation_index", $i);
                         $this->view->setVar("previous_object_id", $vn_prev_obj_id);
                         $this->view->setVar("previous_representation_id", $vn_prev_rep_id);
                         $vn_getNext = 1;
                     }
                     $vn_prev_obj_id = $va_info["object_id"];
                     $vn_prev_rep_id = $t_primary_rep->get("representation_id");
                     $i++;
                 }
             }
         }
     }
     $this->view->setVar('reps', $va_thumbnails);
     return $this->render("Detail/ajax_ca_occurrences_media_overlay_html.php");
 }
开发者ID:guaykuru,项目名称:pawtucket,代码行数:95,代码来源:OccurrenceMediaOverlayController.php


示例6: ca_occurrences

 * the terms of the provided license as published by Whirl-i-Gig
 *
 * CollectiveAccess is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTIES whatsoever, including any implied warranty of 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
 *
 * This source code is free and modifiable under the terms of 
 * GNU General Public License. (http://www.gnu.org/copyleft/gpl.html). See
 * the "license.txt" file for details, or visit the CollectiveAccess web site at
 * http://www.CollectiveAccess.org
 *
 * ----------------------------------------------------------------------
 */
$vo_result = $this->getVar('result');
$vn_items_per_page = $this->getVar('current_items_per_page');
$t_occurrence = new ca_occurrences();
if ($vo_result) {
    print '<div id="occurrenceResults">';
    $vn_item_count = 0;
    $va_tooltips = array();
    $t_list = new ca_lists();
    $vn_i = 0;
    while ($vn_i < $vn_items_per_page && $vo_result->nextHit()) {
        $vs_idno = $vo_result->get('ca_occurrences.idno');
        $vs_class = "";
        $vn_item_count++;
        if ($vn_item_count == 2) {
            $vs_class = "resultBg";
            $vn_item_count = 0;
        }
        $vn_occurrence_id = $vo_result->get('ca_occurrences.occurrence_id');
开发者ID:guaykuru,项目名称:pawtucket,代码行数:31,代码来源:ca_occurrences_results_full_html.php


示例7: _t

         print "</div>";
     }
     print "</div></div>";
     print "</div><!-- blockResults-->";
     print "</div><!-- blockTitle-->";
     print "</div><!-- occurrencesBlock-->";
 }
 # Related Events Block
 if (sizeof($va_events) > 0) {
     print "<div id='eventsBlock'>";
     print "<div class='blockTitle related'>" . _t('Related Events') . "</div>";
     print "<div class='blockResults scrollBlock'>";
     print "<div class='scrollingDiv'><div class='scrollingDivContent'>";
     foreach ($va_events as $occurrence_id => $va_event) {
         $vn_occurrence_id = $va_event['occurrence_id'];
         $t_occurrence = new ca_occurrences($vn_occurrence_id);
         $va_objects = $t_occurrence->get('ca_objects.object_id', array('returnAsArray' => true));
         $va_object_reps = caGetPrimaryRepresentationsForIDs($va_objects, array('versions' => array('resultthumb'), 'return' => array('tags')));
         print "<div class='occurrencesResult'>";
         print "<div class='exImage' {$vs_style}>" . $va_object_reps[0] . "</div>";
         print "<div class='exTitle'>" . caNavLink($this->request, $va_event['name'], '', '', 'Detail', 'Occurrences/' . $va_event['occurrence_id']) . "</div>";
         print "<div class='exDate'>" . $t_occurrence->get('ca_occurrences.event_dates') . "</div>";
         print "</div><!-- end occurrenceResult -->";
     }
     print "</div></div>";
     print "</div><!-- end blockResults -->";
     print "</div><!-- end entitiesBlock -->";
 }
 # Related Entities Block
 if (sizeof($va_entities) > 0) {
     print "<div id='entitiesBlock'>";
开发者ID:kai-iak,项目名称:pawtucket2,代码行数:31,代码来源:ca_entities_default_html.php


示例8: array

        print $t_rel_place->getWithTemplate("<b><l>^ca_places.preferred_labels.name</l></b>");
        if ($vs_brief_description = $t_rel_place->get("ca_places.brief_description")) {
            print "<br/>" . $vs_brief_description;
        }
        if ($vs_thumb) {
            print "</div></div><!-- end row -->";
        } else {
            print "<br/>";
        }
        print "<br/>";
    }
}
$va_occurrences = $t_item->get("ca_occurrences", array("returnAsArray" => true, "checkAccess" => $va_access_values));
if (sizeof($va_occurrences)) {
    print "<H6>Related event" . (sizeof($va_occurrences) > 1 ? "s" : "") . "</H6>";
    $t_rel_occurrence = new ca_occurrences();
    foreach ($va_occurrences as $va_occurrence) {
        $t_rel_occurrence->load($va_occurrence["occurrence_id"]);
        $t_object_thumb->load($t_rel_occurrence->get("ca_objects.object_id", array("restrictToRelationshipTypes" => array("cover"), "checkAccess" => $va_access_values)));
        $vs_thumb = $t_object_thumb->get("ca_object_representations.media.icon", array("checkAccess" => $va_access_values));
        if ($vs_thumb) {
            print "<div class='row'><div class='col-sm-3 col-md-3 col-lg-3'>" . $vs_thumb . "</div>\n";
            print "<div class='col-sm-9 col-md-9 col-lg-9'>\n";
        }
        print $t_rel_occurrence->getWithTemplate("<b><l>^ca_occurrences.preferred_labels.name</l></b>");
        if ($vs_brief_description = $t_rel_occurrence->get("ca_occurrences.brief_description")) {
            print "<br/>" . $vs_brief_description;
        }
        if ($vs_thumb) {
            print "</div></div><!-- end row -->";
        } else {
开发者ID:ffarago,项目名称:pawtucket2,代码行数:31,代码来源:ca_places_default_html.php


示例9: _t

     }
     print "</div>";
     print "</div><!-- end blockResults -->";
     print "</div><!-- end entitiesBlock -->";
 }
 # Related Events Block
 if (sizeof($va_events) > 0) {
     print "<div id='occurrencesBlock'>";
     print "<div class='blockTitle related'>" . _t('Related Events') . "</div>";
     print "<div class='blockResults scrollBlock'>";
     print "<div class='scrollingDiv'><div class='scrollingDivContent'>";
     $vn_i = 0;
     foreach ($va_events as $event_id => $va_event) {
         $vn_event_idno = $va_event['idno'];
         $vn_event_id = $va_event['occurrence_id'];
         $t_occurrence = new ca_occurrences($vn_event_id);
         if ($vn_i == 0) {
             print "<div class='eventSet'>";
         }
         print "<div class='eventsResult'>";
         print "<div>" . caNavLink($this->request, $va_event['label'], '', '', 'Detail', 'Occurrences/' . $vn_event_id) . "</div>";
         print "<div class='exDate'>" . $t_occurrence->get('ca_occurrences.event_dates') . "</div>";
         print "</div>";
         $vn_i++;
         if ($vn_i == 5) {
             print "</div>";
             $vn_i = 0;
         }
     }
     if (end($va_events) == $va_event && $vn_i < 5 && $vn_i != 0) {
         print "</div>";
开发者ID:kai-iak,项目名称:pawtucket2,代码行数:31,代码来源:ca_occurrences_default_html.php


示例10: _t

        print "<div class='unit'><b>" . _t('Collection Date') . ":</b> {$vs_collectionDate}</div><!-- end unit -->";
    }
    if ($va_track_type_status = $t_object->get('ca_objects.track_type_status', array('convertCodesToDisplayText' => true))) {
        print "<div class='unit'><b>" . _t('Type Status') . ":</b> " . $va_track_type_status . "</div>";
    }
    if ($vs_description = $t_object->get("ca_objects.description")) {
        print "<div class='unit'><b>" . _t('Description') . ":</b> {$vs_description}</div><!-- end unit -->";
    }
    if ($va_photographs = $t_object->get('ca_objects.photographs', array('convertCodesToDisplayText' => true))) {
        print "<div class='unit'><b>" . _t('Photographs') . ":</b> " . $va_photographs . "</div>";
    }
}
#end if statement
if ($va_citations = $t_object->get('ca_occurrences', array('returnAsArray' => true, 'checkAccess' => $va_access_values))) {
    if (sizeof($va_citations)) {
        $t_occurrence = new ca_occurrences();
        print "<br><div class='unit'><h2>" . (sizeof($va_citations) > 1 ? "Citations" : "Citation") . "</h2>";
        foreach ($va_citations as $va_citation) {
            $t_occurrence->load($va_citation["occurrence_id"]);
            $vs_citation = "";
            $vs_citation .= $t_occurrence->get("ca_entities.preferred_labels.displayname", array("restrict_to_relationship_types" => array("author"), "convertCodesToDisplayText" => true, "delimiter" => "; ")) . ". ";
            $vs_citation .= "\"" . $va_citation["name"] . ".\" ";
            if ($t_occurrence->get("ca_occurrences.journal")) {
                $vs_citation .= "<i>" . $t_occurrence->get("ca_occurrences.journal") . "</i> ";
            }
            if ($t_occurrence->get("ca_occurrences.month_volume")) {
                $vs_citation .= $t_occurrence->get("ca_occurrences.month_volume") . " ";
            }
            if ($t_occurrence->get("year")) {
                $vs_citation .= "(" . $t_occurrence->get("year") . ") ";
            }
开发者ID:ffarago,项目名称:pawtucket2,代码行数:31,代码来源:ca_objects_default_html.php


示例11: jQuery

        }
        print "</div><!-- END chronologyText -->";
        $vn_item_count++;
        $i++;
    }
    if ($i > $vn_num_more_link) {
        print "</div>";
        print "<div class='moreLink'><a href='#' id='eventsMoreLink' onclick='jQuery(\"#eventsMore\").slideDown(250); jQuery(\"#eventsMoreLink\").hide(); return false;'>" . ($q_events->numHits() - $vn_num_more_link) . _t(" More like this") . " &rsaquo;</a></div>";
    }
    print "</div><!-- end unit -->";
}
# --- output exhibitions from the year
$qr_exhibitions = $va_years_info["exhibitions"];
if ($qr_exhibitions->numHits() > 0) {
    print "<div class='unit'><div class='chronologyHeading'>" . _t("Exhibitions in %1", $vs_year_label) . "</div>";
    $t_occ = new ca_occurrences();
    $i = 0;
    while ($qr_exhibitions->nextHit()) {
        if ($i == $vn_num_more_link) {
            print "<div id='exhibitionsMore' class='relatedMoreItems'>";
        }
        $vn_occurrence_id = $qr_exhibitions->get("ca_occurrences.occurrence_id");
        $t_occ->load($vn_occurrence_id);
        $va_labels = $qr_exhibitions->getDisplayLabels($this->request);
        $vs_label = "\"" . join("; ", $va_labels) . ",\" ";
        $vs_venue = "";
        $va_venues = array();
        $va_venues = $t_occ->get('ca_entities', array('returnAsArray' => 1, 'checkAccess' => $va_access_values, 'restrict_to_relationship_types' => array('primary_venue')));
        if (sizeof($va_venues) > 0) {
            $va_venue_name = array();
            foreach ($va_venues as $va_venue_info) {
开发者ID:guaykuru,项目名称:pawtucket,代码行数:31,代码来源:year_detail_html.php


示例12: _t

    print _t("Your Sets");
}
?>
</H1>
<div id="galleryLanding">
	<div class="textContent">
<?php 
if ($this->request->getController() == "Exhibits") {
    print $this->render('Exhibits/intro_text_html.php');
} else {
    print $this->render('Exhibits/your_sets_intro_text_html.php');
}
?>
	</div>
<?php 
$t_occurrence = new ca_occurrences();
foreach ($va_set_list as $vn_set_id => $va_set_info) {
    $va_item = $va_first_items_from_sets[$vn_set_id][array_shift(array_keys($va_first_items_from_sets[$vn_set_id]))];
    $t_occurrence->load($va_item['row_id']);
    $va_preview_stills = array();
    $vs_preview_still = "";
    $va_medium_stills = array();
    $vs_medium_still = "";
    $va_preview_stills = $t_occurrence->get('ca_occurrences.ic_stills.ic_stills_media', array('version' => "widepreview", "showMediaInfo" => false, "returnAsArray" => true));
    if (sizeof($va_preview_stills) > 0) {
        $vs_preview_still = array_shift($va_preview_stills);
    }
    $va_medium_stills = $t_occurrence->get('ca_occurrences.ic_stills.ic_stills_media', array('version' => "medium", "showMediaInfo" => false, "returnAsArray" => true));
    if (sizeof($va_medium_stills) > 0) {
        $vs_medium_still = array_shift($va_medium_stills);
    }
开发者ID:guaykuru,项目名称:pawtucket,代码行数:31,代码来源:landing_html.php


示例13: array

						</unit>
					</ifcount>}}}
				</div><!-- end col -->
			</div><!-- end row -->
<?php 
        break;
        # -------------------------------------------------------------------------------
    # -------------------------------------------------------------------------------
    case "exhibitions":
        ?>
		
			<div class="row">
				<div class="col-sm-7">
<?php 
        $va_exhibitions = $t_item->get("ca_occurrences", array("returnAsArray" => true, "checkAccess" => $va_access_values, "restrictToRelationshipTypes" => array("exhibited"), "sort" => array("ca_occurrences.opening_closing"), "sortDirection" => "desc"));
        $t_occurrence = new ca_occurrences();
        if (sizeof($va_exhibitions) > 0) {
            foreach ($va_exhibitions as $va_exhibition) {
                $t_occurrence->load($va_exhibition["occurrence_id"]);
                print "<h2>" . caDetailLink($this->request, $t_occurrence->get("ca_occurrences.preferred_labels.name"), '', 'ca_occurrences', $va_exhibition["occurrence_id"], null, null, array("type_id" => $t_occurrence->get("ca_occurrences.type_id"))) . "</h2>";
                print "<h2>" . $t_occurrence->get("ca_occurrences.exhibition_subtitle") . "</h2>";
                print "<h4>" . $t_occurrence->get("ca_occurrences.opening_closing") . "</h4>";
                print "<br/>";
            }
        } else {
            print "<h2>No exhibitions</h2>";
        }
        ?>
				</div><!-- end col -->
				<div class="col-sm-4 col-sm-offset-1">
					{{{<ifcount code="ca_objects" min="1">
开发者ID:ffarago,项目名称:pawtucket2,代码行数:31,代码来源:ca_entities_default_html.php


示例14: foreach

 *
 * @package CollectiveAccess
 * @subpackage Core
 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License version 3
 *
 * ----------------------------------------------------------------------
 */
$va_lists = $this->getVar('lists');
$va_type_info = $this->getVar('typeInfo');
$va_listing_info = $this->getVar('listingInfo');
foreach ($va_lists as $vn_type_id => $qr_list) {
    if (!$qr_list) {
        continue;
    }
    print "<h2>{$va_listing_info['displayName']}</h2>\n";
    print "<div class='row'>";
    while ($qr_list->nextHit()) {
        $t_occurrence = new ca_occurrences($qr_list->get('ca_occurrences.occurrence_id'));
        $va_related_objects = $t_occurrence->get('ca_objects.object_id', array('returnAsArray' => true));
        print "<div class='event col-sm-4 col-md-3 col-lg-2'>";
        $t_object = new ca_objects($va_related_objects[0]);
        if ($t_object->get('ca_object_representations.media.medium')) {
            print "<div class='eventImg'>" . $t_object->get('ca_object_representations.media.medium') . "</div>";
        } else {
            print "<div class='placeholder'></div>";
        }
        print $qr_list->get('ca_occurrences.preferred_labels.name');
        print "</div>";
    }
    print "</div>";
}
开发者ID:kai-iak,项目名称:pawtucket2,代码行数:31,代码来源:ca_occurrences_listing_subview_html.php


示例15: ca_occurrences

<?php

if ($pn_user_category = $this->request->getParameter('user_category', pInteger)) {
    require_once __CA_MODELS_DIR__ . "/ca_occurrences.php";
    $t_occurrence = new ca_occurrences();
    $t_occurrence->load($pn_user_category);
    $ps_user_category = strtolower($t_occurrence->get("ca_occurrences.preferred_labels.name"));
} else {
    $pn_user_category = $this->request->session->getVar("bokUserCategory");
    $ps_user_category = $this->request->session->getVar("bokUserCategoryLabel");
}
?>
<div class="container containerTextPadding" id="comp_content">
	<div class="row">
   		<div class="col-sm-12">
   			<H2>Choose content within the <span class='capital'><?php 
print $ps_user_category;
?>
</span> category below:</H2><br/>
   		</div>
   	</div>
   	<div class="row">
   		<div class="col-sm-5 col-sm-offset-1">
   			<table class="table">
   				<tr>
   					<td class="contentbox iconbox"><?php 
print caNavLink($this->request, caGetThemeGraphic($this->request, 'button_content.png') . "<br />content", "", "", "Browse", "Content", array("facet" => "category_facet", "id" => $pn_user_category));
?>
</td>
   					<td class="compsec_info"><?php 
print caNavLink($this->request, "Explore an e-learning platform for self-guided professional development based on competences.", "", "", "Browse", "Content", array("facet" => "category_facet", "id" => $pn_user_category));
开发者ID:kai-iak,项目名称:pawtucket2,代码行数:31,代码来源:Content.php


示例16: array

}
?>
		</div><!-- end infoArea-->
	</div><!-- end contentArea-->
	<div id='relatedInfo'>
<?php 
# Related Exhibitions Block
$va_occurrences = $t_item->get('ca_occurrences', array('restrictToTypes' => array('mf_exhibition'), 'returnAsArray' => true, 'checkAccess' => $va_access_values));
if (sizeof($va_occurrences) > 0) {
    print "<div id='occurrencesBlock'>";
    print "<div class='blockTitle related'>" . _t('Related Exhibitions') . "</div>";
    print "<div class='blockResults exhibitions'>";
    print "<div>";
    foreach ($va_occurrences as $occurrence_id => $va_occurrence) {
        $vn_occurrence_id = $va_occurrence['occurrence_id'];
        $t_occurrence = new ca_occurrences($vn_occurrence_id);
        $va_artworks = $t_occurrence->get('ca_collections.collection_id', array('returnAsArray' => true));
        print "<div class='occurrencesResult'>";
        $vn_ii = 0;
        if (sizeof($va_artworks) >= 4) {
            foreach ($va_artworks as $key => $vn_artwork_id) {
                $t_collection = new ca_collections($vn_artwork_id);
                $va_related_objects = $t_collection->get('ca_objects.object_id', array('returnAsArray' => true));
                $va_object_reps = caGetPrimaryRepresentationsForIDs($va_related_objects, array('versions' => array('resultthumb'), 'return' => array('tags')));
                if ($vn_ii % 2 == 0) {
                    $vs_style = "style='margin-right:10px;'";
                } else {
                    $vs_style = "";
                }
                if ($va_primary_rep = array_shift(array_values($va_object_reps))) {
                    print "<div class='exImage' {$vs_style}>" . caNavLink($this->request, $va_primary_rep, '', '', 'Detail', 'Occurrences/' . $va_occurrence['occurrence_id']) . "</div>";
开发者ID:ffarago,项目名称:pawtucket2,代码行数:31,代码来源:ca_collections_default_html.php


示例17: foreach

    foreach ($va_entities as $va_entity) {
        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"])) : $va_entity["label"]) . " <span class='details'>(" . $va_entity['relationship_typename'] . ")</span>";
        if ($vn_i < sizeof($va_entities)) {
            print ", ";
        }
    }
    $vn_i++;
    ?>
				</p>				
<?php 
}
# --- occurrences
$va_occurrences = $t_object->get("ca_occurrences", array("returnAsArray" => 1, 'checkAccess' => $va_access_values));
$va_sorted_occurrences = array();
if (sizeof($va_occurrences) > 0) {
    $t_occ = new ca_occurrences();
    $va_item_types = $t_occ->getTypeList();
    foreach ($va_occurrences as $va_occurrence) {
        $t_occ->load($va_occurrence['occurrence_id']);
        $va_rel_entities = array();
        $va_rel_entities = $t_occ->get("ca_entities", array('restrictToTypes' => array('organization'), "returnAsArray" => 1, 'checkAccess' => $va_access_values, 'sort' => 'surname'));
        $va_occurrence["related_entities"] = $va_rel_entities;
        $va_sorted_occurrences[$va_occurrence['item_type_id']][$va_occurrence['occurrence_id']] = $va_occurrence;
    }
    $t_list = new ca_lists();
    $vn_exhibition_type_id = $t_list->getItemIDFromList("occurrence_types", "exhibition");
    foreach ($va_sorted_occurrences as $vn_occurrence_type_id => $va_occurrence_list) {
        ?>
						<h3><?php 
        print _t("Related") . " " . $va_item_types[$vn_occurrence_type_id]['name_singular'] . (sizeof($va_occurrence_list) > 1 ? "s" : "");
        ?>
开发者ID:guaykuru,项目名称:pawtucket,代码行数:31,代码来源:ca_objects_detail_html.php


示例18: getOccurrenceID

 /**
  * Returns occurrence_id for the occurrence with the specified name(and type) or idno (regardless of specified type.) If the occurrence does not already
  * exist then it will be created with the specified name, type and locale, as well as with any specified values in the $pa_values array.
  * $pa_values keys should be either valid occurrence fields or attributes.
  *
  * @param string $ps_occ_name Occurrence label name
  * @param int $pn_parent_id The parent_id of the occurrence; must be set to a non-null value
  * @param int $pn_type_id The type_id of the occurrence type to use if the occurrence needs to be created
  * @param int $pn_locale_id The locale_id to use if the occurrence needs to be created (will be used for both the occurrence locale as well as the label locale)
  * @param array $pa_values An optional array of additional values to populate newly created occurrence records with. These values are *only* used for newly created occurrences; they will not be applied if the occurrence named already exists. The array keys should be names of ca_occurrences fields or valid entity attributes. Values should be either a scalar (for single-value attributes) or an array of values for (multi-valued attributes)
  * @param array $pa_options An optional array of options, which include:
  *                outputErrors - if true, errors will be printed to console [default=false]
  *                matchOn = optional list indicating sequence of checks for an existing record; values of array can be "label" and "idno". Ex. array("idno", "label") will first try to match on idno and then label if the first match fails.
  *                dontCreate - if true then new occurrences will not be created [default=false]
  *                transaction - if Transaction object is passed, use it for all Db-related tasks [default=null]
  *                returnInstance = return ca_occurrences instance rather than occurrence_id. Default is false.
  *                generateIdnoWithTemplate = A template to use when setting the idno. The template is a value with automatically-set SERIAL values replaced with % characters. Eg. 2012.% will set the created row's idno value to 2012.121 (assuming that 121 is the next number in the serial sequence.) The template is NOT used if idno is passed explicitly as a value in $pa_values.
  *                importEvent = if ca_data_import_events instance is passed then the insert/update of the occurrence will be logged as part of the import
  *                importEventSource = if importEvent is passed, then the value set for importEventSource is used in the import event log as the data source. If omitted a default value of "?" is used
  *                nonPreferredLabels = an optional array of nonpreferred labels to add to any newly created occurrences. Each label in the array is an array with required occurrence label values.
  *                log = if KLogger instance is passed then actions will be logged
  * @return bool|\ca_occurrences|mixed|null
  */
 static function getOccurrenceID($ps_occ_name, $pn_parent_id, $pn_type_id, $pn_locale_id, $pa_values = null, $pa_options = null)
 {
     if (!is_array($pa_options)) {
         $pa_options = array();
     }
     if (!isset($pa_options['outputErrors'])) {
         $pa_options['outputErrors'] = false;
     }
     $pa_match_on = caGetOption('matchOn', $pa_options, array('label', 'idno'), array('castTo' => "array"));
     /** @var ca_data_import_events $o_event */
     $o_event = isset($pa_options['importEvent']) && $pa_options['importEvent'] instanceof ca_data_import_events ? $pa_options['importEvent'] : null;
     $t_occurrence = new ca_occurrences();
     if (isset($pa_options['transaction']) && $pa_options['transaction'] instanceof Transaction) {
         $t_occurrence->setTransaction($pa_options['transaction']);
         if ($o_event) {
             $o_event->setTransaction($pa_options['transaction']);
         }
     }
     $vs_event_source = isset($pa_options['importEventSource']) && $pa_options['importEventSource'] ? $pa_options['importEventSource'] : "?";
     /** @var KLogger $o_log */
     $o_log = isset($pa_options['log']) && $pa_options['log'] instanceof KLogger ? $pa_options['log'] : null;
     $vs_idno = isset($pa_values['idno']) ? (string) $pa_values['idno'] : null;
     if (preg_match('!\\%!', $vs_idno)) {
         $pa_options['generateIdnoWithTemplate'] = $vs_idno;
         $vs_idno = null;
     }
     if (!$vs_idno) {
         if (isset($pa_options['generateIdnoWithTemplate']) && $pa_options['generateIdnoWithTemplate']) {
             $vs_idno = $t_occurrence->setIdnoWithTemplate($pa_options['generateIdnoWithTemplate'], array('dontSetValue' => true));
         }
     }
     $vn_id = null;
     foreach ($pa_match_on as $vs_match_on) {
         switch (strtolower($vs_match_on)) {
             case 'label':
             case 'labels':
                 if (trim($ps_occ_name)) {
                     if ($vn_id = ca_occurrences::find(array('preferred_labels' => array('name' => $ps_occ_name), 'parent_id' => $pn_parent_id, 'type_id' => $pn_type_id), array('returnAs' => 'firstId', 'transaction' => $pa_options['transaction']))) {
                         break 2;
                     }
                     break;
                 }
             case 'idno':
                 if ($vs_idno == '%') {
                     break;
                 }
                 // don't try to match on an unreplaced idno placeholder
                 // TODO: should we filter on type_id here?
                 if ($vn_id = ca_occurrences::find(array('idno' => $vs_idno ? $vs_idno : $ps_occ_name), array('returnAs' => 'firstId', 'transaction' => $pa_options['transaction']))) {
                     break 2;
                 }
                 break;
         }
     }
     if (!$vn_id) {
         if (isset($pa_options['dontCreate']) && $pa_options['dontCreate']) {
             return false;
         }
         if ($o_event) {
             $o_event->beginItem($vs_event_source, 'ca_occurrences', 'I');
         }
         $t_occurrence->setMode(ACCESS_WRITE);
         $t_occurrence->set('locale_id', $pn_locale_id);
         $t_occurrence->set('type_id', $pn_type_id);
         $t_occurrence->set('parent_id', $pn_parent_id);
         $t_occurrence->set('source_id', isset($pa_values['source_id']) ? $pa_values['source_id'] : null);
         $t_occurrence->set('access', isset($pa_values['access']) ? $pa_values['access'] : 0);
         $t_occurrence->set('status', isset($pa_values['status']) ? $pa_values['status'] : 0);
         $t_occurrence->set('idno', $vs_idno);
         $t_occurrence->set('hier_occurrence_id', isset($pa_values['hier_occurrence_id']) ? $pa_values['hier_occurrence_id'] : null);
         $t_occurrence->insert();
         if ($t_occurrence->numErrors()) {
             if (isset($pa_options['outputErrors']) && $pa_options['outputErrors']) {
                 print "[Error] " . _t 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP ca_sets类代码示例发布时间:2022-05-23
下一篇:
PHP ca_objects类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap