public function Delete()
 {
     $ps_mode = $this->request->getParameter('mode', pString);
     $va_errors = array();
     $pa_watch_ids = $this->request->getParameter('watch_id', pArray);
     $va_errors = array();
     if (is_array($pa_watch_ids) && sizeof($pa_watch_ids) > 0) {
         $t_watch_list = new ca_watch_list();
         foreach ($pa_watch_ids as $vn_watch_id) {
             if ($t_watch_list->load(array('watch_id' => $vn_watch_id))) {
                 $t_watch_list->setMode(ACCESS_WRITE);
                 $t_watch_list->delete();
                 if ($t_watch_list->numErrors()) {
                     $va_errors = $t_item->errors;
                 }
             }
         }
         if (sizeof($va_errors) > 0) {
             $this->notification->addNotification(implode("; ", $va_errors), __NOTIFICATION_TYPE_ERROR__);
         } else {
             $this->notification->addNotification(_t("Your watched items have been deleted"), __NOTIFICATION_TYPE_INFO__);
         }
     } else {
         $this->notification->addNotification(_t("Please use the checkboxes to select items to remove from your watch list"), __NOTIFICATION_TYPE_WARNING__);
     }
     if ($ps_mode == "dashboard") {
         $this->response->setRedirect(caNavUrl($this->request, "", "Dashboard", "Index"));
     } else {
         $this->ListItems();
     }
 }
Пример #2
0
 function recentlyAdded()
 {
     // redirect user if not logged in
     if ($this->request->config->get('pawtucket_requires_login') && !$this->request->isLoggedIn() || $this->request->config->get('show_bristol_only') && !$this->request->isLoggedIn()) {
         $this->response->setRedirect(caNavUrl($this->request, "", "LoginReg", "form"));
     } elseif ($this->request->config->get('show_bristol_only') && $this->request->isLoggedIn()) {
         $this->response->setRedirect(caNavUrl($this->request, "bristol", "Show", "Index"));
     }
     $t_object = new ca_objects();
     $va_recently_added_objects = $t_object->getRecentlyAddedItems(25, array('checkAccess' => caGetUserAccessValues($this->request)));
     $va_entries = array();
     $va_object_ids = array();
     foreach ($va_recently_added_objects as $va_object) {
         $va_object_ids[] = $va_object['object_id'];
     }
     $va_labels = $t_object->getPreferredDisplayLabelsForIDs($va_object_ids);
     // TODO: Need to get object descriptions and last update times properly
     foreach ($va_labels as $vn_object_id => $vs_label) {
         $va_entries[] = array('title' => $vs_label, 'link' => $vs_link = $this->request->config->get('site_host') . caNavUrl($this->request, '', 'Detail/Object', 'Index', array('object_id' => $vn_object_id)), 'guid' => $vs_link, 'lastUpdate' => time(), 'description' => '', 'pubDate' => time());
     }
     $va_feed_data = array('title' => _t('Recently added'), 'link' => $this->request->getRequestUrl(true), 'charset' => 'UTF-8', 'entries' => $va_entries);
     $o_feed = Zend_Feed::importArray($va_feed_data, 'rss');
     $this->view->setVar('feed', $o_feed);
     $this->render('Feed/feed_recently_added_xml.php');
 }
Пример #3
0
 public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
 {
     $this->ops_theme = __CA_THEME__;
     // get current theme
     if (!is_dir(__CA_APP_DIR__ . '/plugins/eastend/themes/' . $this->ops_theme . '/views')) {
         // if theme is not defined for this plugin, try to use "default" theme
         $this->ops_theme = 'default';
     }
     parent::__construct($po_request, $po_response, array(__CA_APP_DIR__ . '/plugins/eastend/themes/' . $this->ops_theme . '/views'));
     MetaTagManager::addLink('stylesheet', $po_request->getBaseUrlPath() . "/app/plugins/eastend/themes/" . $this->ops_theme . "/css/eastend.css", 'text/css');
     $this->opo_plugin_config = Configuration::load($this->request->getAppConfig()->get('application_plugins') . '/eastend/conf/eastend.conf');
     if (!(bool) $this->opo_plugin_config->get('enabled')) {
         die(_t('eastend plugin is not enabled'));
     }
     // redirect user if not logged in
     if ($this->request->config->get('pawtucket_requires_login') && !$this->request->isLoggedIn()) {
         $this->response->setRedirect(caNavUrl($this->request, "", "LoginReg", "form"));
     }
     $po_request->session->setVar('pawtucket2_browse_target', "ca_objects");
     if ($this->request->config->get("dont_enforce_access_settings")) {
         $this->opa_access_values = array();
     } else {
         $this->opa_access_values = caGetUserAccessValues($this->request);
     }
     $this->view->setVar('access_values', $va_access_values);
     $this->opo_result_context = new ResultContext($po_request, $this->ops_tablename, $this->ops_find_type);
     $this->opo_result_context->setAsLastFind();
     $this->opo_browse = new ObjectBrowse($x = $this->opo_result_context->getSearchExpression());
     $this->view->setvar("browse_place_ids", $this->opo_plugin_config->get('artist_browser_place_ids'));
 }
Пример #4
0
 /**
  * Generate timeline output in specified format
  *
  * @param array $pa_viz_settings Array of visualization settings taken from visualization.conf
  * @param string $ps_format Specifies format to generate output in. Currently only 'HTML' is supported.
  * @param array $pa_options Array of options to use when rendering output. Supported options are:
  *		width =
  *		height =
  *		request = current request; required for generation of editor links
  */
 public function render($pa_viz_settings, $ps_format = 'HTML', $pa_options = null)
 {
     if (!($vo_data = $this->getData())) {
         return null;
     }
     $this->opn_num_items_rendered = 0;
     $po_request = isset($pa_options['request']) && $pa_options['request'] ? $pa_options['request'] : null;
     if (!$po_request) {
         return '';
     }
     list($vs_width, $vs_height) = $this->_parseDimensions(caGetOption('width', $pa_options, 500), caGetOption('height', $pa_options, 500));
     // Calculate how many items will be rendered on the timeline
     // from the entire data set
     $qr_res = $this->getData();
     while ($qr_res->nextHit()) {
         foreach ($pa_viz_settings['sources'] as $vs_source_name => $va_source) {
             if ($qr_res->get($va_source['data'])) {
                 $this->opn_num_items_rendered++;
             }
         }
         if ($this->opn_num_items_rendered >= 100) {
             break;
         }
     }
     $vs_buf = $this->getLocaleJSSrc($po_request) . "\n\t<div id='timeline-embed' style='width: {$vs_width}; height: {$vs_height};'></div>\n    <script type='text/javascript'>\n\t\tjQuery(document).ready(function() {\n\t\t\tcreateStoryJS({\n\t\t\t\ttype:       'timeline',\n\t\t\t\twidth:      '{$vs_width}',\n\t\t\t\theight:     '{$vs_height}',\n\t\t\t\tsource:     '" . caNavUrl($po_request, '*', '*', '*', array('renderData' => '1', 'viz' => $pa_viz_settings['code'])) . "',\n\t\t\t\tembed_id:   'timeline-embed'\n\t\t\t});\n\t\t});\n\t</script>\n";
     return $vs_buf;
 }
Пример #5
0
 public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
 {
     parent::__construct($po_request, $po_response, $pa_view_paths);
     if ($this->request->config->get('pawtucket_requires_login') && !$this->request->isLoggedIn() || $this->request->config->get('show_bristol_only') && !$this->request->isLoggedIn()) {
         $this->response->setRedirect(caNavUrl($this->request, "", "LoginReg", "form"));
     }
 }
Пример #6
0
 function recentlyAdded()
 {
     // redirect user if not logged in
     if ($this->request->config->get('pawtucket_requires_login') && !$this->request->isLoggedIn() || $this->request->config->get('show_bristol_only') && !$this->request->isLoggedIn()) {
         $this->response->setRedirect(caNavUrl($this->request, "", "LoginReg", "form"));
     } elseif ($this->request->config->get('show_bristol_only') && $this->request->isLoggedIn()) {
         $this->response->setRedirect(caNavUrl($this->request, "bristol", "Show", "Index"));
     }
     $t_object = new ca_objects();
     if (($vn_num_items = (int) $this->request->config->get('rss_number_of_items')) <= 0) {
         $vn_num_items = 10;
     }
     $va_recently_added_objects = $t_object->getRecentlyAddedItems($vn_num_items, array('checkAccess' => caGetUserAccessValues($this->request)));
     $va_entries = array();
     $va_object_ids = array();
     foreach ($va_recently_added_objects as $va_object) {
         $va_object_ids[] = $va_object['object_id'];
     }
     $qr_res = $t_object->makeSearchResult('ca_objects', $va_object_ids);
     $vs_description_bundle = $this->request->config->get('rss_description');
     while ($qr_res->nextHit()) {
         $vn_object_id = $qr_res->get('ca_objects.object_id');
         if (!($vn_creation_time = $t_object->getCreationTimestamp($vn_object_id, array('timestampOnly' => true)))) {
             $vn_creation_time = time();
         }
         if (!($vn_update_time = $t_object->getLastChangeTimestamp($vn_object_id, array('timestampOnly' => true)))) {
             $vn_update_time = time();
         }
         $va_entries[] = array('title' => $qr_res->get('ca_objects.preferred_labels.name'), 'link' => $vs_link = $this->request->config->get('site_host') . caNavUrl($this->request, '', 'Detail/Object', 'Index', array('object_id' => $vn_object_id)), 'guid' => $vs_link, 'lastUpdate' => $vn_update_time, 'description' => $vs_description_bundle ? $qr_res->getMediaTag("ca_object_representations.media", "preview") . "\n" . $qr_res->get($vs_description_bundle) : '', 'pubDate' => $vn_creation_time);
     }
     $va_feed_data = array('title' => _t('Recently added'), 'link' => $this->request->getRequestUrl(true), 'charset' => 'UTF-8', 'entries' => $va_entries);
     $o_feed = Zend_Feed::importArray($va_feed_data, 'rss');
     $this->view->setVar('feed', $o_feed);
     $this->render('Feed/feed_recently_added_xml.php');
 }
Пример #7
0
 public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
 {
     parent::__construct($po_request, $po_response, $pa_view_paths);
     if ($this->request->config->get('pawtucket_requires_login') && !$this->request->isLoggedIn()) {
         $this->response->setRedirect(caNavUrl($this->request, "", "LoginReg", "LoginForm"));
     }
     caSetPageCSSClasses(array("rolodex"));
 }
Пример #8
0
 public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
 {
     parent::__construct($po_request, $po_response, $pa_view_paths);
     if ($this->request->config->get('pawtucket_requires_login') && !$this->request->isLoggedIn()) {
         $this->response->setRedirect(caNavUrl($this->request, "", "LoginReg", "LoginForm"));
     }
     $this->opa_access_values = caGetUserAccessValues($po_request);
     caSetPageCSSClasses(array("listing"));
 }
Пример #9
0
 /**
  *
  */
 public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
 {
     parent::__construct($po_request, $po_response, $pa_view_paths);
     if ($this->request->config->get('pawtucket_requires_login') && !$this->request->isLoggedIn()) {
         $this->response->setRedirect(caNavUrl($this->request, "", "LoginReg", "LoginForm"));
     }
     caSetPageCSSClasses(array("multisearch"));
     MetaTagManager::setWindowTitle($this->request->config->get("app_display_name") . ": " . _t("Search") . ": " . $this->request->getParameter('search', pString));
 }
Пример #10
0
 public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
 {
     parent::__construct($po_request, $po_response, $pa_view_paths);
     $this->config = caGetFrontConfig();
     caSetPageCSSClasses(array("front"));
     if ($this->request->config->get('pawtucket_requires_login') && !$this->request->isLoggedIn()) {
         $this->response->setRedirect(caNavUrl($this->request, "", "LoginReg", "LoginForm"));
     }
     MetaTagManager::setWindowTitle($this->request->config->get("app_display_name"));
 }
Пример #11
0
 public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
 {
     parent::__construct($po_request, $po_response, $pa_view_paths);
     // redirect user if not logged in
     if ($this->request->config->get('pawtucket_requires_login') && !$this->request->isLoggedIn()) {
         $this->response->setRedirect(caNavUrl($this->request, "", "LoginReg", "form"));
     }
     $this->opa_views = array('thumbnail' => _t('Thumbnails'), 'full' => _t('List'));
     $this->opa_sorts = array('ca_object_labels.name' => _t('title'), 'ca_objects.type_id' => _t('type'), 'ca_objects.idno' => _t('idno'));
 }
Пример #12
0
 /**
  *
  */
 public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
 {
     parent::__construct($po_request, $po_response, $pa_view_paths);
     if (!$this->request->isAjax() && $this->request->config->get('pawtucket_requires_login') && !$this->request->isLoggedIn()) {
         $this->response->setRedirect(caNavUrl($this->request, "", "LoginReg", "LoginForm"));
     }
     $this->opa_access_values = caGetUserAccessValues($po_request);
     $this->view->setVar("access_values", $this->opa_access_values);
     $this->view->setVar("find_type", $this->ops_find_type);
     caSetPageCSSClasses(array("browse", "results"));
 }
Пример #13
0
 /**
  * Displays the basic info for an object
  */
 public function Show($pa_options = null)
 {
     JavascriptLoadManager::register('panel');
     parent::Show($pa_options);
     // redirect user if not logged in
     if ($this->request->config->get('pawtucket_requires_login') && !$this->request->isLoggedIn() || $this->request->config->get('show_bristol_only') && !$this->request->isLoggedIn()) {
         $this->response->setRedirect(caNavUrl($this->request, "", "LoginReg", "form"));
     } elseif ($this->request->config->get('show_bristol_only') && $this->request->isLoggedIn()) {
         $this->response->setRedirect(caNavUrl($this->request, "bristol", "Show", "Index"));
     }
 }
Пример #14
0
 /**
  * Displays map of all member inst
  */
 public function Index()
 {
     $o_search = new EntitySearch();
     #$o_search->setTypeRestrictions(array($this->opn_member_institution_id));
     $o_search->addResultFilter("ca_entities.access", "IN", join(',', $this->opa_access_values));
     //$qr_res = $o_search->search("*", array('sort' => 'ca_entity_labels.name', 'sort_direction' => 'asc'));
     $qr_res = $o_search->search("ca_entities.type_id:" . $this->opn_member_institution_id);
     // This is fastest
     $o_map = new GeographicMap(900, 500, 'map');
     $va_map_stats = $o_map->mapFrom($qr_res, "georeference", array("ajaxContentUrl" => caNavUrl($this->request, "NovaMuse", "MemberMap", "getMapItemInfo"), "request" => $this->request, "checkAccess" => $this->opa_access_values));
     $this->view->setVar("map", $o_map->render('HTML', array('delimiter' => "<br/>")));
     $this->render('member_map_html.php');
 }
Пример #15
0
 public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
 {
     parent::__construct($po_request, $po_response, $pa_view_paths);
     // redirect user if not logged in
     if ($this->request->config->get('pawtucket_requires_login') && !$this->request->isLoggedIn()) {
         $this->response->setRedirect(caNavUrl($this->request, "", "LoginReg", "form"));
     }
     $t_list = new ca_lists();
     $pn_type_restriction_id = $t_list->getItemIDFromList('occurrence_types', 'chronology');
     // set type restrictions for searches
     $o_search_result_context = new ResultContext($this->request, "ca_occurrences", 'basic_search');
     $o_search_result_context->setTypeRestriction($pn_type_restriction_id);
     $o_search_result_context->saveContext();
 }
Пример #16
0
 public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
 {
     parent::__construct($po_request, $po_response, $pa_view_paths);
     if ($this->request->config->get('pawtucket_requires_login') && !$this->request->isLoggedIn()) {
         $this->response->setRedirect(caNavUrl($this->request, "", "LoginReg", "LoginForm"));
     }
     $this->config = caGetContactConfig();
     if (!$this->config->get("contact_email") && !$this->config->get("contact_form_elements")) {
         $this->notification->addNotification(_t("Contact form is not configured properly"), __NOTIFICATION_TYPE_ERROR__);
         $this->response->setRedirect(caNavUrl($this->request, '', '', ''));
     }
     MetaTagManager::setWindowTitle($this->request->config->get("app_display_name") . ": " . _t("Contact"));
     caSetPageCSSClasses(array("contact"));
 }
Пример #17
0
 public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
 {
     parent::__construct($po_request, $po_response, $pa_view_paths);
     // redirect user if not logged in
     if ($this->request->config->get('pawtucket_requires_login') && !$this->request->isLoggedIn() || $this->request->config->get('show_bristol_only') && !$this->request->isLoggedIn()) {
         $this->response->setRedirect(caNavUrl($this->request, "", "LoginReg", "form"));
     } elseif ($this->request->config->get('show_bristol_only') && $this->request->isLoggedIn()) {
         $this->response->setRedirect(caNavUrl($this->request, "bristol", "Show", "Index"));
     }
     $this->opo_browse = new ObjectBrowse($this->opo_result_context->getSearchExpression(), 'pawtucket2');
     $this->opa_views = array('full' => _t('List'), 'thumbnail' => _t('Thumbnails'));
     $this->opa_sorts = array('ca_object_labels.name' => _t('title'), 'ca_objects.type_id' => _t('type'), 'ca_objects.idno' => _t('idno'));
     parent::__construct($po_request, $po_response, $pa_view_paths);
     $this->opo_browse = new ObjectBrowse($this->opo_result_context->getSearchExpression(), 'pawtucket2');
 }
Пример #18
0
 public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
 {
     $this->ops_theme = __CA_THEME__;
     // get current theme
     if (!is_dir(__CA_APP_DIR__ . '/plugins/FindingAids/themes/' . $this->ops_theme . '/views')) {
         // if theme is not defined for this plugin, try to use "default" theme
         $this->ops_theme = 'default';
     }
     parent::__construct($po_request, $po_response, array(__CA_APP_DIR__ . '/plugins/FindingAids/themes/' . $this->ops_theme . '/views'));
     MetaTagManager::addLink("stylesheet", $this->request->getBaseUrlPath() . "/app/plugins/FindingAids/themes/" . $this->ops_theme . "/css/findingaids.css", "text/css");
     // redirect user if not logged in
     if ($this->request->config->get('pawtucket_requires_login') && !$this->request->isLoggedIn() || $this->request->config->get('show_bristol_only') && !$this->request->isLoggedIn()) {
         $this->response->setRedirect(caNavUrl($this->request, "", "LoginReg", "form"));
     } elseif ($this->request->config->get('show_bristol_only') && $this->request->isLoggedIn()) {
         $this->response->setRedirect(caNavUrl($this->request, "bristol", "Show", "Index"));
     }
 }
 protected function _isDisplayEditable()
 {
     $pn_display_id = $this->request->getParameter('display_id', pInteger);
     if ($pn_display_id == 0) {
         return true;
     }
     // allow creation of new displays
     $t_display = new ca_bundle_displays();
     if (!$t_display->haveAccessToDisplay($this->request->getUserID(), __CA_BUNDLE_DISPLAY_EDIT_ACCESS__, $pn_display_id)) {
         // is user allowed to edit display?
         $this->notification->addNotification(_t("You cannot edit that display"), __NOTIFICATION_TYPE_ERROR__);
         $this->response->setRedirect(caNavUrl($this->request, 'manage', 'BundleDisplays', 'ListDisplays'));
         return false;
     } else {
         return true;
     }
 }
 protected function _isFormEditable()
 {
     $pn_form_id = $this->request->getParameter('form_id', pInteger);
     if ($pn_form_id == 0) {
         return true;
     }
     // allow creation of new forms
     $t_form = new ca_search_forms();
     if (!$t_form->haveAccessToForm($this->request->getUserID(), __CA_BUNDLE_DISPLAY_EDIT_ACCESS__, $pn_form_id)) {
         // is user allowed to edit form?
         $this->notification->addNotification(_t("You cannot edit that form"), __NOTIFICATION_TYPE_ERROR__);
         $this->response->setRedirect(caNavUrl($this->request, 'manage', 'SearchForm', 'ListForms'));
         return false;
     } else {
         return true;
     }
 }
Пример #21
0
 public function DoLogin()
 {
     global $g_ui_locale;
     $vs_redirect_url = $this->request->getParameter('redirect', pString) ?: caNavUrl($this->request, null, null, null);
     if (!$this->request->doAuthentication(array('dont_redirect_to_login' => true, 'redirect' => $vs_redirect_url, 'noPublicUsers' => true, 'user_name' => $this->request->getParameter('username', pString), 'password' => $this->request->getParameter('password', pString)))) {
         $this->notification->addNotification(_t("Login was invalid"), __NOTIFICATION_TYPE_ERROR__);
         $this->view->setVar('notifications', $this->notification->getNotifications());
         if (isset($_COOKIE['CA_' . __CA_APP_NAME__ . '_ui_locale'])) {
             if (!initializeLocale($_COOKIE['CA_' . __CA_APP_NAME__ . '_ui_locale'])) {
                 die("Error loading locale " . $g_ui_locale);
             }
         }
         $this->render('login_html.php');
     } else {
         //
         // Reset locale globals
         //
         global $g_ui_locale_id, $g_ui_locale, $g_ui_units_pref, $_, $_locale;
         $g_ui_locale_id = $this->request->user->getPreferredUILocaleID();
         // get current UI locale as locale_id	 			(available as global)
         $g_ui_locale = $this->request->user->getPreferredUILocale();
         // get current UI locale as locale string 			(available as global)
         $g_ui_units_pref = $this->request->user->getPreference('units');
         // user's selected display units for measurements 	(available as global)
         if (!initializeLocale($g_ui_locale)) {
             die("Error loading locale " . $g_ui_locale);
         }
         MemoryCache::flush('translation');
         AppNavigation::clearMenuBarCache($this->request);
         // want to clear menu bar on login
         // Notify the user of the good news
         $this->notification->addNotification(_t("You are now logged in"), __NOTIFICATION_TYPE_INFO__);
         // Jump to redirect if set
         if ($vs_redirect_url) {
             $this->redirect($vs_redirect_url);
         }
         $this->render('welcome_html.php');
     }
 }
Пример #22
0
 public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
 {
     $this->ops_theme = __CA_THEME__;
     // get current theme
     if (!is_dir(__CA_APP_DIR__ . '/plugins/eastend/themes/' . $this->ops_theme . '/views')) {
         // if theme is not defined for this plugin, try to use "default" theme
         $this->ops_theme = 'default';
     }
     parent::__construct($po_request, $po_response, array(__CA_APP_DIR__ . '/plugins/eastend/themes/' . $this->ops_theme . '/views'));
     MetaTagManager::addLink('stylesheet', $po_request->getBaseUrlPath() . "/app/plugins/eastend/themes/" . $this->ops_theme . "/css/eastend.css", 'text/css');
     $this->opo_plugin_config = Configuration::load($this->request->getAppConfig()->get('application_plugins') . '/eastend/conf/eastend.conf');
     if (!(bool) $this->opo_plugin_config->get('enabled')) {
         die(_t('eastend plugin is not enabled'));
     }
     // redirect user if not logged in
     if ($this->request->config->get('pawtucket_requires_login') && !$this->request->isLoggedIn()) {
         $this->response->setRedirect(caNavUrl($this->request, "", "LoginReg", "form"));
     }
     JavascriptLoadManager::register('cycle');
     $t_list = new ca_lists();
     $this->view->setVar("user_contributed_source_id", $t_list->getItemIDFromList('object_sources', 'user_contributed'));
     $this->view->setVar("user_contributed_other_source_id", $t_list->getItemIDFromList('object_sources', 'user_contributed_other'));
 }
Пример #23
0
 /**
  * Generate calendar output in specified format
  *
  * @param array $pa_viz_settings Array of visualization settings taken from visualization.conf
  * @param string $ps_format Specifies format to generate output in. Currently only 'HTML' is supported.
  * @param array $pa_options Array of options to use when rendering output. Supported options are:
  *		width =
  *		height =
  *		request = current request; required for generation of editor links
  */
 public function render($pa_viz_settings, $ps_format = 'HTML', $pa_options = null)
 {
     if (!($vo_data = $this->getData())) {
         return null;
     }
     $this->opn_num_items_rendered = 0;
     $po_request = isset($pa_options['request']) && $pa_options['request'] ? $pa_options['request'] : null;
     if (!$po_request) {
         return '';
     }
     list($vs_width, $vs_height) = $this->_parseDimensions(caGetOption('width', $pa_options, 500), caGetOption('height', $pa_options, 500));
     // Calculate how many items will be rendered on the timeline
     // from the entire data set
     $qr_res = $this->getData();
     while ($qr_res->nextHit()) {
         foreach ($pa_viz_settings['sources'] as $vs_source_name => $va_source) {
             if ($qr_res->get($va_source['data'])) {
                 $this->opn_num_items_rendered++;
             }
         }
     }
     $vs_buf = "\n\t\t\t<div id='calendar-embed' style='width: {$vs_width}; background:white;'></div><!-- {$vs_height} -->\n\t\t\t<div id='eventContent' title='Event Details'>\n\t\t\t    <span id='eventDate'></span>\n\t\t\t    <div id='eventInfo'></div>\n\t\t\t    <p><strong><a id='eventLink' href='#' target='_blank'>" . _t("Open") . "</a></strong></p>\n\t\t\t</div>\n\t\t    <script type='text/javascript'>\n\t\t\t\tfunction openModalA(title, info, url, start, end) {\n\t\t\t\t    alert('modal');\n\t\t\t\t}\n\t\t\t\tfunction openModal(title, info, url, date) {\n\t\t\t\t    jQuery('#eventDate').html('Date: ' + date + '<br />')\n\t\t\t\t\tjQuery('#eventInfo').html(info);\n\t\t\t\t\tjQuery('#eventLink').attr('href', url);\n\t\t\t\t\tjQuery('#eventContent').dialog({ modal:true, title: title, width:350, stack:false });\n\t\t\t\t\tjQuery('#eventContent').parent('.ui-dialog').css('z-index', '50000' ); // sending modal to front as caMediaPanel has 30k for z-index\n\n\t\t\t\t}\n\t\t\t\tjQuery(document).ready(function() {\n\t\t\t\t\tjQuery('#calendar-embed').fullCalendar({\n\t\t\t\t\t\theader: {\n\t\t\t\t\t\t\tleft: 'prev,next today',\n\t\t\t\t\t\t\tcenter: 'title',\n\t\t\t\t\t\t\tright: 'month,agendaWeek,agendaDay'\n\t\t\t\t\t\t},\n\t\t\t\t\t\tdefaultDate: '2014-06-12',\n\t\t\t\t\t\teditable: true,\n\t\t\t\t\t\tlang: 'fr',\n\t\t\t\t\t\tevents: '" . caNavUrl($po_request, '*', '*', '*', array('renderData' => '1', 'viz' => $pa_viz_settings['code'])) . "',\n\t\t\t\t\t\teventRender: function (event, element) {\n\t\t\t\t            element.attr('href', 'javascript:void(0);');\n\t\t\t\t            element.attr('onclick', 'openModal(\"' + event.title + '\",\"' + event.description + '\",\"' + event.url + '\",\"' + event.display_date + '\",\"' + event.end + '\");');\n\t\t\t\t            // element.attr('onclick', 'alert(\\'' + event.title + '\\');');\n\t\t\t\t        },\n\t\t\t\t\t\twindowResize: function(view) { // refresh height on windowResize\n\t\t\t\t\t\t\tjQuery('#calendar-embed').fullCalendar('option', 'height', jQuery(window).height() - \$('.caMediaOverlayControls').outerHeight(true));\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tjQuery('#calendar-embed').fullCalendar('option', 'height', jQuery(window).height() - \$('.caMediaOverlayControls').outerHeight(true)); // refresh start height\n\t\t\t\t\t\n\t\t\t\t  });\n\t\t\t</script>";
     return $vs_buf;
 }
Пример #24
0
 public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
 {
     parent::__construct($po_request, $po_response, $pa_view_paths);
     if ($this->request->config->get('pawtucket_requires_login') && !$this->request->isLoggedIn()) {
         $this->response->setRedirect(caNavUrl($this->request, "", "LoginReg", "LoginForm"));
     }
     $this->config = caGetGalleryConfig();
     $this->opo_datamodel = Datamodel::load();
     $va_access_values = caGetUserAccessValues($this->request);
     $this->opa_access_values = $va_access_values;
     # --- what is the section called - title of page
     if (!($vs_section_name = $this->config->get('gallery_section_name'))) {
         $vs_section_name = _t("Featured Galleries");
     }
     $this->view->setVar("section_name", $vs_section_name);
     if (!($vs_section_item_name = $this->config->get('gallery_section_item_name'))) {
         $vs_section_item_name = _t("gallery");
     }
     $this->view->setVar("section_item_name", $vs_section_item_name);
     caSetPageCSSClasses(array("gallery"));
     AssetLoadManager::register("panel");
     AssetLoadManager::register("mediaViewer");
     AssetLoadManager::register("carousel");
 }
Пример #25
0
			itemID: '<?php 
print $vs_id_prefix;
?>
Item_',
			templateClassName: 'caNewItemTemplate',
			initialValueTemplateClassName: 'caItemTemplate',
			itemListClassName: 'caItemList',
			addButtonClassName: 'caAddItemButton',
			deleteButtonClassName: 'caDeleteItemButton',
			hideOnNewIDList: ['<?php 
print $vs_id_prefix;
?>
_edit_related_'],
			showEmptyFormsOnLoad: 1,
			autocompleteUrl: '<?php 
print caNavUrl($this->request, 'Contribute/lookup', 'Object', 'Get', array());
?>
',
			types: <?php 
print json_encode($va_settings['restrict_to_types']);
?>
,
			isSortable: true,
			listSortOrderID: '<?php 
print $vs_id_prefix;
?>
BundleList',
			listSortItems: 'div.roundedRel',
<?php 
if ($t_subject->tableName() == 'ca_object_representations') {
    ?>
if ($this->request->isLoggedIn()) {
    print caNavLink($this->request, _t("Add to Lightbox +"), '', '', 'Sets', 'addItem', array('object_id' => $pn_object_id));
} else {
    print caNavLink($this->request, _t("Add to Lightbox +"), '', '', 'LoginReg', 'form', array('site_last_page' => 'Sets', 'object_id' => $pn_object_id));
}
?>
			</div>
			<div class='repNav'>
<?php 
if ($this->getVar('previous_representation_id')) {
    print "<a href='#' onClick='jQuery(\"#caMediaPanelContentArea\").load(\"" . caNavUrl($this->request, '', 'Chronology', 'GetChronologyMediaOverlay', array('representation_id' => (int) $this->getVar('previous_representation_id'), 'object_id' => (int) $this->getVar('previous_object_id'), 'year' => (int) $pn_year)) . "\");'>←</a>";
}
if (sizeof($va_reps) > 1) {
    print ' ' . _t("%1 of %2", $this->getVar('representation_index'), sizeof($va_reps)) . ' ';
}
if ($this->getVar('next_representation_id')) {
    print "<a href='#' onClick='jQuery(\"#caMediaPanelContentArea\").load(\"" . caNavUrl($this->request, '', 'Chronology', 'GetChronologyMediaOverlay', array('representation_id' => (int) $this->getVar('next_representation_id'), 'object_id' => (int) $this->getVar('next_object_id'), 'year' => (int) $pn_year)) . "\");'>→</a>";
}
?>
			</div>
	</div><!-- end caMediaOverlayControls -->
	<div id="caMediaOverlayContent">
		<div class='closeUpperLeft'><a href="#" onclick="caMediaPanel.hidePanel(); return false;" title="close">&nbsp;&nbsp;&nbsp;</a></div>
<?php 
// return standard tag
if (!is_array($va_display_options)) {
    $va_display_options = array();
}
print $t_rep->getMediaTag('media', $vs_display_version, array_merge($va_display_options, array('id' => 'caMediaOverlayContentMedia', 'viewer_base_url' => $this->request->getBaseUrlPath())));
?>
</div><!-- end caMediaOverlayContent -->
                        $vn_c++;
                        if ($vn_c == $vn_facet_display_length_initial && $vn_facet_size > $vn_facet_display_length_initial && $vn_facet_size <= $vn_facet_display_length_maximum) {
                            print "<div id='{$vs_facet_name}_more' style='display: none;'>";
                        } else {
                            if ($vn_c == $vn_facet_display_length_initial && $vn_facet_size > $vn_facet_display_length_maximum) {
                                break;
                            }
                        }
                    }
                    if ($vn_facet_size > $vn_facet_display_length_initial && $vn_facet_size <= $vn_facet_display_length_maximum) {
                        print "</div>\n";
                        $vs_link_open_text = _t("and %1 more", $vn_facet_size - $vn_facet_display_length_initial);
                        $vs_link_close_text = _t("close", $vn_facet_size - $vn_facet_display_length_initial);
                        print "<div><a href='#' class='more' id='{$vs_facet_name}_more_link' onclick='jQuery(\"#{$vs_facet_name}_more\").slideToggle(250, function() { jQuery(this).is(\":visible\") ? jQuery(\"#{$vs_facet_name}_more_link\").text(\"" . addslashes($vs_link_close_text) . "\") : jQuery(\"#{$vs_facet_name}_more_link\").text(\"" . addslashes($vs_link_open_text) . "\")}); return false;'><em>{$vs_link_open_text}</em></a></div>";
                    } elseif ($vn_facet_size > $vn_facet_display_length_initial && $vn_facet_size > $vn_facet_display_length_maximum) {
                        print "<div><a href='#' class='more' onclick='jQuery(\"#bMorePanel\").load(\"" . caNavUrl($this->request, '*', '*', '*', array('getFacet' => 1, 'facet' => $vs_facet_name, 'view' => $vs_view, 'key' => $vs_key)) . "\", function(){jQuery(\"#bMorePanel\").show(); jQuery(\"#bMorePanel\").mouseleave(function(){jQuery(\"#bMorePanel\").hide();});}); return false;'><em>" . _t("and %1 more", $vn_facet_size - $vn_facet_display_length_initial) . "</em></a></div>";
                    }
                    break;
                    # ---------------------------------------------
            }
        }
    }
    print "</div><!-- end bRefine -->\n";
    ?>
	<script type="text/javascript">
		jQuery(document).ready(function() {
			var offsetBrowseResultsContainer = $("H5:first").offset();
			var lastOffset = $("#bRefine").offset();
			$("body").data("lastOffsetTop", lastOffset.top);
			$(window).scroll(function() {
				if(($(document).scrollTop() < $(document).height() - ($("#bRefine").height() + 250)) && (($(document).scrollTop() < $("body").data("lastOffsetTop")) || ($(document).scrollTop() > ($("body").data("lastOffsetTop") + ($("#bRefine").height() - ($(window).height()/3)))))){
					</div>
<?php 
        }
    }
    #else{
    #$vs_login_message = _t("Login/register to be the first to rank, tag and comment on this object!");
    #}
    #if($this->request->isLoggedIn()){
    ?>
			<div id="objUserDataFormTitle"><?php 
    print _t("Post new comment");
    ?>
</div><!-- end title -->
			<div id="objUserDataForm">
				<form method="post" action="<?php 
    print caNavUrl($this->request, 'Detail', 'Collection', 'saveCommentRanking', array('collection_id' => $vn_collection_id));
    ?>
" name="comment">
					<div class="formLabel"><?php 
    print _t("Your name");
    ?>
</div>
					<input type="text" name="name">
					<div class="formLabel"><?php 
    print _t("E-mail");
    ?>
</div>
					<input type="text" name="email"><div class="formCaption"><?php 
    print _t("Your email address will be kept private");
    ?>
</div>
		});
 	});
 	
 	function caSearchWorldCat(term, start, c, msg) {
 		if (!msg) { msg = "<?php 
print addslashes(_t('Searching WorldCat...'));
?>
"; }
 		if (start <= 0) { start = 0; }
 		if (c <= 0) { c = 10; }
 		jQuery("#caWorldCatResults").html("<div class='caWorldCatResultsMessage'><?php 
print caBusyIndicatorIcon($this->request) . ' ';
?>
" + msg + "</div>");
		jQuery.getJSON('<?php 
print caNavUrl($this->request, '*', '*', 'Lookup');
?>
', {term: term, start: start, count: c }, function(data) {
			if (data['count'] >= 25) {
				jQuery('#caWorldCatResultsNextLink').show();
			} else {
				jQuery('#caWorldCatResultsNextLink').hide();
			}
			if (start > 0) {
				jQuery('#caWorldCatResultsPreviousLink').show();
			} else {
				jQuery('#caWorldCatResultsPreviousLink').hide();
			}
			
			var html = '';
			if (jQuery.isArray(data['results']) && (data['results'].length > 0)) {
Пример #30
0
			firstItemColor: '<?php 
    print $vs_first_color;
    ?>
',
			lastItemColor: '<?php 
    print $vs_last_color;
    ?>
',
			
			interstitialButtonClassName: 'caInterstitialEditButton',
			interstitialPanel: caRelationEditorPanel<?php 
    print $vs_id_prefix;
    ?>
,
			interstitialUrl: '<?php 
    print caNavUrl($this->request, 'editor', 'Interstitial', 'Form', array('t' => $t_item_rel->tableName()));
    ?>
',
			interstitialPrimaryTable: '<?php 
    print $t_instance->tableName();
    ?>
',
			interstitialPrimaryID: <?php 
    print (int) $t_instance->getPrimaryKey();
    ?>
,
			
			minRepeats: <?php 
    print caGetOption('minRelationshipsPerRow', $va_settings, 0);
    ?>
,