Пример #1
0
}
if ($this->getvar("message")) {
    print "<div class='message'>" . $this->getvar("message") . "</div>";
}
if (sizeof($va_errors) > 0) {
    print "<div class='message'>" . implode(", ", $va_errors) . "</div>";
}
?>
	<div id="setItems">
		<ul id="setItemList">
<?php 
if (is_array($va_items) && sizeof($va_items) > 0) {
    foreach ($va_items as $vn_item_id => $va_item) {
        $set_keys[] = $va_item['row_id'];
    }
    $qr_results = ca_objects::createResultSet($set_keys);
    $va_set_item_metadata = array();
    while ($qr_results->nextHit()) {
        $va_set_item_metadata[$qr_results->get("object_id")] = array("title" => $qr_results->get("ca_objects.references.title"), "author" => $qr_results->get("ca_objects.references.author"), "publication" => $qr_results->get("ca_objects.references.publication"), "type" => $qr_results->get('ca_objects.type_id'), "filename" => $qr_results->get('ca_objects.preferred_labels'), "altid" => $qr_results->get('ca_objects.altID'));
    }
    foreach ($va_items as $vn_item_id => $va_item) {
        $vs_title = "";
        $va_title = array();
        ?>
				<li class='setItem' id='setItem<?php 
        print $vn_item_id;
        ?>
'>
					<div id='setItemContainer<?php 
        print $vn_item_id;
        ?>
 *
 * ----------------------------------------------------------------------
 */
AssetLoadManager::register('timeline');
$va_set_items = $this->getVar("set_items");
$t_set = $this->getVar("set");
$va_views = $this->getVar('views');
$vs_current_view = $this->getVar('view');
$va_view_info = $va_views[$vs_current_view];
$vn_hits_per_block = 40;
$va_data = array("headline" => "", "type" => "default", "text" => "", "asset" => array("media" => "", "credit" => "", "caption" => ""));
$va_set_object_ids;
foreach ($va_set_items as $va_set_item) {
    $va_set_object_ids[] = $va_set_item["row_id"];
}
$qr_res = ca_objects::createResultSet($va_set_object_ids);
$vn_c = 0;
$qr_res->seek($vn_start);
while ($qr_res->nextHit() && $vn_c < $vn_hits_per_block) {
    $vs_dates = $qr_res->get($va_view_info['data'], array('sortable' => true, 'returnAsArray' => false, 'delimiter' => ';'));
    $va_dates = explode(";", $vs_dates);
    $va_date_list = explode("/", $va_dates[0]);
    if (!$va_date_list[0] || !$va_date_list[1]) {
        continue;
    }
    $va_timeline_dates = caGetDateRangeForTimelineJS($va_date_list);
    $va_data['date'][] = array("startDate" => $va_timeline_dates['start'], "endDate" => $va_timeline_dates['end'], "headline" => $qr_res->getWithTemplate(caGetOption('title_template', $va_view_info['display'], null)), "text" => $qr_res->getWithTemplate(caGetOption('description_template', $va_view_info['display'], null)), "tag" => '', "classname" => '', "asset" => array("media" => $qr_res->getWithTemplate(caGetOption('image', $va_view_info['display'], null), array('returnURL' => true)), "thumbnail" => $qr_res->getWithTemplate(caGetOption('icon', $va_view_info['display'], null), array('returnURL' => true)), "credit" => $qr_res->getWithTemplate(caGetOption('credit_template', $va_view_info['display'], null)), "caption" => $qr_res->getWithTemplate(caGetOption('caption_template', $va_view_info['display'], null))));
    $vn_c++;
    if ($vn_c > 2000) {
        break;
    }
Пример #3
0
$va_facets_with_content = $this->getVar('facets_with_content');
$va_facet_info = $this->getVar('facet_info');
$va_criteria = is_array($this->getVar('criteria')) ? $this->getVar('criteria') : array();
$va_results = $this->getVar('result');
$vs_browse_target = $this->getVar('target');
$t_object = new ca_objects();
$t_featured = new ca_sets();
$featured_set = $t_featured->load(array('set_code' => 'carousel'));
$set_item = $t_featured->getItems();
foreach ($set_item as $id => $item) {
    foreach ($item as $i_d => $the_item) {
        $carousel_ids[] = $the_item['object_id'];
    }
}
shuffle($carousel_ids);
$qr_set = ca_objects::createResultSet($carousel_ids);
$va_random_items = $t_object->getRandomItems(10, array('checkAccess' => $this->getVar('access_values'), 'hasRepresentations' => 1));
$va_labels = $t_object->getPreferredDisplayLabelsForIDs(array_keys($va_random_items));
$va_media = $t_object->getPrimaryMediaForIDs(array_keys($va_random_items), array('small', 'thumbnail', 'preview', 'medium', 'widepreview'), array('checkAccess' => $this->getVar('access_values')));
JavascriptLoadManager::register('cycle');
if (!$this->request->isAjax()) {
    ?>
	<h1><?php 
    print _t('Browse the Archive');
    ?>
</h1>
	<div id="browse"><div id="resultBox"> 
<?php 
}
?>
		<div style="position: relative;">
Пример #4
0
 * 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
 *
 * ----------------------------------------------------------------------
 */
JavascriptLoadManager::register("cycle");
$t_object = new ca_objects();
$t_featured = new ca_sets();
$featured_set = $t_featured->load(array('set_code' => 'splash'));
$carousel_ids = $t_featured->getItemRowIDs(array('shuffle' => true));
$qr_set = ca_objects::createResultSet(array_keys($carousel_ids));
$va_item_ids = $this->getVar('featured_content_slideshow_id_list');
$va_item_media = $t_object->getPrimaryMediaForIDs($va_item_ids, array("mediumlarge"));
$va_item_labels = $t_object->getPreferredDisplayLabelsForIDs($va_item_ids);
$va_access_values = caGetUserAccessValues($this->request);
?>
	<div id="splashBrowsePanel" class="browseSelectPanel" style="z-index:1000;">
		<a href="#" onclick="caUIBrowsePanel.hideBrowsePanel()" class="browseSelectPanelButton"></a>
		<div id="splashBrowsePanelContent">
		
		</div>
	</div>
	<script type="text/javascript">
		var caUIBrowsePanel = caUI.initBrowsePanel({ facetUrl: '<?php 
print caNavUrl($this->request, '', 'Browse', 'getFacet');
?>
Пример #5
0
 * 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
 *
 * ----------------------------------------------------------------------
 */
$t_object = new ca_objects();
$va_item_ids = $this->getVar('featured_content_slideshow_id_list');
$va_item_media = $t_object->getPrimaryMediaForIDs($va_item_ids, array("hpFeatured"));
$va_item_labels = $t_object->getPreferredDisplayLabelsForIDs($va_item_ids);
$qr_hits = ca_objects::createResultSet($va_item_ids);
$va_item_captions = array();
$va_item_vaga = array();
$va_item_do_not_show = array();
if ($qr_hits->numHits()) {
    while ($qr_hits->nextHit()) {
        # --- vaga/ARS no image - remove from slideshow
        if ($qr_hits->get("ca_objects.object_status") == 348) {
            $va_item_do_not_show[$qr_hits->get("ca_objects.object_id")] = 1;
        }
        $vs_caption = "";
        if ($qr_hits->get("ca_objects.object_status") == 349) {
            $vs_caption = "<a href='http://www.vagarights.com' target='_blank'>" . $qr_hits->get("ca_objects.caption") . "</a>";
            $va_item_vaga[$qr_hits->get("ca_objects.object_id")] = 1;
        } else {
            $vs_caption = $qr_hits->get("ca_objects.caption");
 public function getLotMedia()
 {
     //if ((bool)$this->request->config->get('allow_download_of_all_object_media_in_a_lot')) {	// DO WE NEED TO REINSTATE THIS OPTIN?
     set_time_limit(600);
     // allow a lot of time for this because the sets can be potentially large
     $t_lot = new ca_object_lots($this->request->getParameter('lot_id', pInteger));
     $o_media_metadata_conf = Configuration::load($t_lot->getAppConfig()->get('media_metadata'));
     if ($t_lot->getPrimaryKey()) {
         $va_object_ids = $t_lot->get('ca_objects.object_id', array('returnAsArray' => true, 'limit' => 100000));
         if (!is_array($va_object_ids) || !sizeof($va_object_ids)) {
             $this->notification->addNotification(_t('No media is available for download'), __NOTIFICATION_TYPE_ERROR__);
             $this->opo_response->setRedirect(caEditorUrl($this->opo_request, 'ca_object_lots', $t_lot->getPrimaryKey()));
             return;
         }
         $qr_res = ca_objects::createResultSet($va_object_ids);
         $qr_res->filterNonPrimaryRepresentations(false);
         $va_paths = array();
         while ($qr_res->nextHit()) {
             $va_original_paths = $qr_res->getMediaPaths('ca_object_representations.media', 'original');
             if (sizeof($va_original_paths) > 0) {
                 $va_paths[$qr_res->get('object_id')] = array('idno' => $qr_res->get('idno'), 'type_code' => caGetListItemIdno($qr_res->get('type_id')), 'paths' => $va_original_paths, 'representation_ids' => $qr_res->get('ca_object_representations.representation_id', array('returnAsArray' => true)), 'representation_types' => $qr_res->get('ca_object_representations.type_id', array('returnAsArray' => true)));
             }
         }
         if (sizeof($va_paths) > 0) {
             $o_zip = new ZipStream();
             foreach ($va_paths as $vn_object_id => $va_path_info) {
                 // make sure we don't download representations the user isn't allowed to read
                 if (!caCanRead($this->request->user->getPrimaryKey(), 'ca_objects', $vn_object_id)) {
                     continue;
                 }
                 $vn_c = 1;
                 foreach ($va_path_info['paths'] as $vn_i => $vs_media_path) {
                     if (!file_exists($vs_media_path)) {
                         continue;
                     }
                     if ($o_media_metadata_conf->get('do_metadata_embedding_for_lot_media_download')) {
                         if (!($vs_path = caEmbedMediaMetadataIntoFile($vs_media_path, 'ca_objects', $vn_object_id, $va_path_info['type_code'], $va_path_info['representation_ids'][$vn_i], $va_path_info['representation_types'][$vn_i]))) {
                             $vs_path = $vs_media_path;
                         }
                     } else {
                         $vs_path = $vs_media_path;
                     }
                     $vs_filename = $va_path_info['idno'] ? $va_path_info['idno'] : $vn_object_id;
                     $vs_filename .= "_{$vn_c}";
                     if ($vs_ext = pathinfo($vs_media_path, PATHINFO_EXTENSION)) {
                         $vs_filename .= ".{$vs_ext}";
                     }
                     $o_zip->addFile($vs_path, $vs_filename);
                     $vn_c++;
                 }
             }
             $o_view = new View($this->request, $this->request->getViewsDirectoryPath() . '/bundles/');
             // send files
             $o_view->setVar('zip_stream', $o_zip);
             $o_view->setVar('archive_name', 'media_for_' . mb_substr(preg_replace('![^A-Za-z0-9]+!u', '_', ($vs_idno = $t_lot->get('idno_stub')) ? $vs_idno : $t_lot->getPrimaryKey()), 0, 20) . '.zip');
             $this->response->addContent($o_view->render('download_file_binary.php'));
             return;
         } else {
             $this->notification->addNotification(_t('No files to download'), __NOTIFICATION_TYPE_ERROR__);
             $this->opo_response->setRedirect(caEditorUrl($this->opo_request, 'ca_object_lots', $t_lot->getPrimaryKey()));
             return;
         }
     }
     //}
     return $this->Edit();
 }
 public function getLotMedia()
 {
     //if ((bool)$this->request->config->get('allow_download_of_all_object_media_in_a_lot')) {
     set_time_limit(600);
     // allow a lot of time for this because the sets can be potentially large
     $t_lot = new ca_object_lots($this->request->getParameter('lot_id', pInteger));
     if ($t_lot->getPrimaryKey()) {
         $va_object_ids = $t_lot->get('ca_objects.object_id', array('returnAsArray' => true, 'limit' => 100000));
         if (!is_array($va_object_ids) || !sizeof($va_object_ids)) {
             $this->notification->addNotification(_t('No media is available for download'), __NOTIFICATION_TYPE_ERROR__);
             $this->opo_response->setRedirect(caEditorUrl($this->opo_request, 'ca_object_lots', $t_lot->getPrimaryKey()));
             return;
         }
         $qr_res = ca_objects::createResultSet($va_object_ids);
         $qr_res->filterNonPrimaryRepresentations(false);
         $va_paths = array();
         while ($qr_res->nextHit()) {
             $va_original_paths = $qr_res->getMediaPaths('ca_object_representations.media', 'original');
             if (sizeof($va_original_paths) > 0) {
                 $va_paths[$qr_res->get('object_id')] = array('idno' => $qr_res->get('idno'), 'paths' => $va_original_paths);
             }
         }
         if (sizeof($va_paths) > 0) {
             $vs_tmp_name = caGetTempFileName('DownloadLotMedia', 'zip');
             $o_phar = new PharData($vs_tmp_name, null, null, Phar::ZIP);
             foreach ($va_paths as $vn_object_id => $va_path_info) {
                 $vn_c = 1;
                 foreach ($va_path_info['paths'] as $vs_path) {
                     if (!file_exists($vs_path)) {
                         continue;
                     }
                     $vs_filename = $va_path_info['idno'] ? $va_path_info['idno'] : $vn_object_id;
                     $vs_filename .= "_{$vn_c}";
                     if ($vs_ext = pathinfo($vs_path, PATHINFO_EXTENSION)) {
                         $vs_filename .= ".{$vs_ext}";
                     }
                     $o_phar->addFile($vs_path, $vs_filename);
                     $vn_c++;
                 }
             }
             $o_view = new View($this->request, $this->request->getViewsDirectoryPath() . '/bundles/');
             // send download
             $vs_idno = $t_lot->get('idno_stub');
             $o_view->setVar('tmp_file', $vs_tmp_name);
             $o_view->setVar('download_name', 'media_for_' . mb_substr(preg_replace('![^A-Za-z0-9]+!u', '_', $vs_idno ? $vs_idno : $t_lot->getPrimaryKey()), 0, 20) . '.zip');
             $this->response->addContent($o_view->render('ca_object_lots_download_media.php'));
             return;
         } else {
             $this->notification->addNotification(_t('No media is available for download'), __NOTIFICATION_TYPE_ERROR__);
             $this->opo_response->setRedirect(caEditorUrl($this->opo_request, 'ca_object_lots', $t_lot->getPrimaryKey()));
             return;
         }
     }
     //}
     return $this->Edit();
 }