コード例 #1
0
ファイル: MapController.php プロジェクト: guaykuru/pawtucket
 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'));
 }
コード例 #2
0
ファイル: ShowController.php プロジェクト: guaykuru/pawtucket
 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/MetabolicChronology/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/MetabolicChronology/themes/' . $this->ops_theme . '/views'));
     $this->opo_plugin_config = Configuration::load($this->request->getAppConfig()->get('application_plugins') . '/MetabolicChronology/conf/Chronology.conf');
     if (!(bool) $this->opo_plugin_config->get('enabled')) {
         die(_t('Metabolic Chronology plugin is not enabled'));
     }
     $this->_initView($pa_options);
     $this->opo_result_context = new ResultContext($po_request, 'ca_objects', 'MetabolicChronology');
     MetaTagManager::addLink('stylesheet', $po_request->getBaseUrlPath() . "/app/plugins/MetabolicChronology/themes/" . $this->ops_theme . "/css/chronology.css", 'text/css');
     JavascriptLoadManager::register('jcarousel');
     JavascriptLoadManager::register('maps');
     $t_list = new ca_lists();
     $this->opn_silo_type_id = $t_list->getItemIDFromList('collection_types', 'silo');
     $this->opn_action_type_id = $t_list->getItemIDFromList('occurrence_types', 'action');
     $this->opn_context_type_id = $t_list->getItemIDFromList('occurrence_types', 'context');
     $this->opn_yes_list_id = $t_list->getItemIDFromList('yes_no', 'yes');
     $t_relationship_types = new ca_relationship_types();
     $this->opn_rel_type_action_display_image = $t_relationship_types->getRelationshipTypeID("ca_objects_x_occurrences", "display");
     $this->opn_rel_type_action_secondary_images = $t_relationship_types->getRelationshipTypeID("ca_objects_x_occurrences", "secondary");
     $va_access_values = caGetUserAccessValues($this->request);
     $this->opa_access_values = $va_access_values;
     $this->view->setVar('access_values', $va_access_values);
 }
コード例 #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/NovaMuse/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/NovaMuse/themes/' . $this->ops_theme . '/views'));
     $this->opo_plugin_config = Configuration::load($this->request->getAppConfig()->get('application_plugins') . '/NovaMuse/conf/NovaMuse.conf');
     if (!(bool) $this->opo_plugin_config->get('enabled')) {
         die(_t('NovaMuse plugin is not enabled'));
     }
     MetaTagManager::addLink('stylesheet', $po_request->getBaseUrlPath() . "/app/plugins/NovaMuse/themes/" . $this->ops_theme . "/css/dashboard.css", 'text/css');
     $this->opo_result_context = new ResultContext($po_request, 'ca_objects', 'dashboard');
     $t_list = new ca_lists();
     $this->opn_member_institution_id = $t_list->getItemIDFromList('entity_types', 'member_institution');
     $this->opn_individual_id = $t_list->getItemIDFromList('entity_types', 'ind');
     $this->opn_family_id = $t_list->getItemIDFromList('entity_types', 'fam');
     $this->opn_organization_id = $t_list->getItemIDFromList('entity_types', 'org');
     $t_object = new ca_objects();
     $this->opn_objectTableNum = $t_object->tableNum();
     $va_access_values = caGetUserAccessValues($this->request);
     $this->opa_access_values = $va_access_values;
     $this->view->setVar('access_values', $va_access_values);
 }
コード例 #4
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));
 }
コード例 #5
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"));
 }
コード例 #6
0
ファイル: FormController.php プロジェクト: guaykuru/pawtucket
 /**
  *
  */
 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/Cataloging/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/Cataloging/themes/' . $this->ops_theme . '/views'));
     $this->opo_plugin_config = Configuration::load($po_request->getAppConfig()->get('application_plugins') . '/Cataloging/conf/cataloging.conf');
     if (!(bool) $this->opo_plugin_config->get('enabled')) {
         die(_t('Cataloging plugin is not enabled'));
     }
     $vs_default_ui = $this->opo_plugin_config->get('default_ui');
     $vs_requested_ui = $this->request->getParameter('ui', pString);
     $va_ui_list = $this->opo_plugin_config->getAssoc('uis');
     $o_dm = Datamodel::load();
     if (isset($va_ui_list[$vs_requested_ui]) && is_array($va_ui_list[$vs_requested_ui])) {
         $this->opa_ui_info = $va_ui_list[$vs_requested_ui];
         $this->ops_ui_code = $vs_requested_ui;
     } else {
         if (isset($va_ui_list[$vs_default_ui]) && is_array($va_ui_list[$vs_default_ui])) {
             $this->opa_ui_info = $va_ui_list[$vs_default_ui];
         } else {
             $vs_default_ui = array_shift(array_keys($va_ui_list));
             $this->opa_ui_info = $va_ui_list[$vs_default_ui];
         }
         $this->ops_ui_code = $vs_default_ui;
     }
     $this->ops_table_name = $this->opa_ui_info['table'];
     if (!($this->opo_instance = $o_dm->getInstanceByTableName($this->ops_table_name, true))) {
         die(_t('Invalid table "%1" specified in Cataloging plugin for form "%2"', $this->ops_table_name, $vs_default_ui));
     }
     # --- load the current record
     if (!($pn_id = $this->request->getParameter($this->opo_instance->primaryKey(), pInteger))) {
         die(_t("Primary key of record must be passed to form"));
     }
     if (!$this->opo_instance->load($pn_id)) {
         die(_t("Invalid id"));
     }
     $t_list = new ca_lists();
     if (isset($this->opa_ui_info['representation_type']) && $this->opa_ui_info['representation_type']) {
         $this->opa_ui_info['representation_type_id'] = $t_list->getItemIDFromList('object_representation_types', $this->opa_ui_info['representation_type']);
     }
     CatalogingPlugin::setUIInfo($this->ops_ui_code, $this->opa_ui_info);
     JavascriptLoadManager::register('panel');
     MetaTagManager::addLink('stylesheet', $po_request->getBaseUrlPath() . "/app/plugins/Cataloging/themes/" . $this->ops_theme . "/css/cataloging.css", 'text/css');
     $this->request->setParameter('dont_set_pawtucket2_last_page', '1');
     // Setting this parameter ensures that the "last page" we (may) redirect to after submission isn't the Cataloging form itself
     if ($this->opa_ui_info['require_login'] && !$po_request->isLoggedIn()) {
         $this->notification->addNotification(_t("You must be logged in to use user cataloging features."), __NOTIFICATION_TYPE_ERROR__);
         $this->response->setRedirect(caNavUrl($this->request, '', 'LoginReg', 'form'));
         return;
     }
 }
コード例 #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"));
     }
     $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"));
 }
コード例 #8
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"));
     }
 }
コード例 #9
0
 /**
  *
  */
 public function __construct(&$po_request, &$po_response, $pa_view_paths = null)
 {
     // Set view path for plugin views directory
     if (!is_array($pa_view_paths)) {
         $pa_view_paths = array();
     }
     $pa_view_paths[] = __CA_APP_DIR__ . "/plugins/WorldCat/themes/" . __CA_THEME__ . "/views";
     // Load plugin configuration file
     $this->opo_config = Configuration::load(__CA_APP_DIR__ . '/plugins/WorldCat/conf/worldcat.conf');
     parent::__construct($po_request, $po_response, $pa_view_paths);
     if (!$this->request->user->canDoAction('can_import_worldcat')) {
         $this->response->setRedirect($this->request->config->get('error_display_url') . '/n/3000?r=' . urlencode($this->request->getFullUrlPath()));
         return;
     }
     // Load plugin stylesheet
     MetaTagManager::addLink('stylesheet', __CA_URL_ROOT__ . "/app/plugins/WorldCat/themes/" . __CA_THEME__ . "/css/WorldCat.css", 'text/css');
 }
コード例 #10
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'));
 }
コード例 #11
0
ファイル: About.php プロジェクト: kai-iak/pawtucket2
<?php

MetaTagManager::setWindowTitle($this->request->config->get("app_display_name") . ": Body of Knowledge");
# --- do a occurrece search to get all the competences
$o_search = caGetSearchInstance("ca_occurrences");
$t_lists = new ca_lists();
$vn_category_type_id = $t_lists->getItemIDFromList("occurrence_types", "category");
$qr_res = $o_search->search('type_id:' . $vn_category_type_id, $va_options['sort'] = "ca_occurrences.preferred_labels.name");
$va_all_competences = array();
$va_competences_by_area = array();
if ($qr_res->numHits()) {
    while ($qr_res->nextHit()) {
        $va_all_competences[$qr_res->get("ca_occurrences.occurrence_id")] = array("idno" => $qr_res->get("ca_occurrences.idno"), "label" => strtolower($qr_res->get("ca_occurrences.preferred_labels.name")));
        $va_competences_by_area[str_replace(" Pa ", " PA ", ucwords(strtolower($qr_res->get("ca_occurrences.area", array("convertCodesToDisplayText" => true)))))][$qr_res->get("ca_occurrences.occurrence_id")] = array("idno" => $qr_res->get("ca_occurrences.idno"), "label" => strtolower($qr_res->get("ca_occurrences.preferred_labels.name")));
    }
}
if (sizeof($va_competences_by_area)) {
    ?>
	<div class="container containerTextPadding" id="comp_nav">
		<div class="row">
			<div class="col-sm-12">
				<H2>Choose a competence category to explore:</H2>
<?php 
    if ($this->request->config->get("onlyLinkTrpCategory")) {
        ?>
				<H5 class="indent red"><i>* Content currently under development.  Please use the competence category TRP (Tourism, Recreation, and Public Use) to explore how the Body of Knowledge works.</i></H5>
<?php 
    }
    ?>
			
			</div>
コード例 #12
0
 /**
  *
  */
 public function __call($ps_function, $pa_args)
 {
     $ps_function = strtolower($ps_function);
     # --- which type of set is configured for display in gallery section
     $t_list = new ca_lists();
     $vn_gallery_set_type_id = $t_list->getItemIDFromList('set_types', $this->config->get('gallery_set_type'));
     $t_set = new ca_sets();
     if ($ps_function == "index") {
         if ($vn_gallery_set_type_id) {
             $va_sets = caExtractValuesByUserLocale($t_set->getSets(array('table' => 'ca_objects', 'checkAccess' => $this->opa_access_values, 'setType' => $vn_gallery_set_type_id)));
             $va_set_first_items = $t_set->getFirstItemsFromSets(array_keys($va_sets), array("version" => "icon", "checkAccess" => $this->opa_access_values));
             $o_front_config = caGetFrontConfig();
             $vs_front_page_set = $o_front_config->get('front_page_set_code');
             $vb_omit_front_page_set = (bool) $this->config->get('omit_front_page_set_from_gallery');
             foreach ($va_sets as $vn_set_id => $va_set) {
                 if ($vb_omit_front_page_set && $va_set['set_code'] == $vs_front_page_set) {
                     unset($va_sets[$vn_set_id]);
                 }
             }
             $this->view->setVar('sets', $va_sets);
             $this->view->setVar('first_items_from_sets', $va_set_first_items);
         }
         MetaTagManager::setWindowTitle($this->request->config->get("app_display_name") . ": " . ($this->config->get('gallery_section_name') ? $this->config->get('gallery_section_name') : _t("Gallery")));
         $this->render("Gallery/index_html.php");
     } else {
         $ps_set_id = $ps_function;
         $this->view->setVar("set_id", $ps_set_id);
         $t_set->load($ps_set_id);
         $this->view->setVar("set", $t_set);
         $this->view->setVar("label", $t_set->getLabelForDisplay());
         $this->view->setVar("description", $t_set->get($this->config->get('gallery_set_description_element_code')));
         $this->view->setVar("set_items", caExtractValuesByUserLocale($t_set->getItems(array("thumbnailVersions" => array("icon"), "checkAccess" => $this->opa_access_values))));
         MetaTagManager::setWindowTitle($this->request->config->get("app_display_name") . ": " . ($this->config->get('gallery_section_name') ? $this->config->get('gallery_section_name') : _t("Gallery")) . ": " . $t_set->getLabelForDisplay());
         $this->render("Gallery/detail_html.php");
     }
 }
コード例 #13
0
 public function Index($pa_options = null)
 {
     $po_search = isset($pa_options['search']) && $pa_options['search'] ? $pa_options['search'] : null;
     parent::Index($pa_options);
     AssetLoadManager::register('browsable');
     // need this to support browse panel when filtering/refining search results
     $t_model = $this->opo_datamodel->getTableInstance($this->ops_tablename, true);
     // Get elements of result context
     $vn_page_num = $this->opo_result_context->getCurrentResultsPageNumber();
     $vs_search = $this->opo_result_context->getSearchExpression();
     if (!($vn_items_per_page = $this->opo_result_context->getItemsPerPage())) {
         $vn_items_per_page = $this->opa_items_per_page[0];
     }
     if (!($vs_view = $this->opo_result_context->getCurrentView())) {
         $va_tmp = array_keys($this->opa_views);
         $vs_view = array_shift($va_tmp);
     }
     if (!($vs_sort = $this->opo_result_context->getCurrentSort())) {
         $va_tmp = array_keys($this->opa_sorts);
         $vs_sort = array_shift($va_tmp);
     }
     $vs_sort_direction = $this->opo_result_context->getCurrentSortDirection();
     $vn_display_id = $this->opo_result_context->getCurrentBundleDisplay();
     if (!$this->opn_type_restriction_id) {
         $this->opn_type_restriction_id = '';
     }
     $this->view->setVar('type_id', $this->opn_type_restriction_id);
     MetaTagManager::setWindowTitle(_t('%1 advanced search', $this->searchName('plural')));
     $t_form = new ca_search_forms();
     if (!($vn_form_id = isset($pa_options['form_id']) ? $pa_options['form_id'] : null)) {
         if (!($vn_form_id = $this->opo_result_context->getParameter('form_id'))) {
             if (sizeof($va_forms = $t_form->getForms(array('table' => $this->ops_tablename, 'user_id' => $this->request->getUserID(), 'access' => __CA_SEARCH_FORM_READ_ACCESS__)))) {
                 $va_tmp = array_keys($va_forms);
                 $vn_form_id = array_shift($va_tmp);
             }
         }
     }
     $t_form->load($vn_form_id);
     $this->view->setVar('t_form', $t_form);
     $this->view->setVar('form_id', $vn_form_id);
     if ($pa_options['appendToSearch']) {
         $vs_append_to_search .= " AND (" . $pa_options['appendToSearch'] . ")";
     }
     //
     // Execute the search
     //
     if (isset($pa_options['saved_search']) && $pa_options['saved_search']) {
         // Is this a saved search? If so, reused the canned params
         $va_form_data = $pa_options['saved_search'];
         foreach ($pa_options['saved_search'] as $vs_fld => $vs_val) {
             $vs_proc_fld = str_replace(".", "_", $vs_fld);
             $va_proc_form_data[$vs_proc_fld] = $vs_val;
         }
         $vs_search = $t_form->getLuceneQueryStringForHTMLFormInput($va_proc_form_data);
         $vb_is_new_search = true;
     } else {
         if (!($vs_search = $t_form->getLuceneQueryStringForHTMLFormInput($_REQUEST))) {
             // try to get search off of request
             $vs_search = $this->opo_result_context->getSearchExpression();
             // get the search out of the result context
             $va_form_data = $this->opo_result_context->getParameter('form_data');
             $vb_is_new_search = !$this->opo_result_context->cacheIsValid();
         } else {
             $va_form_data = $t_form->extractFormValuesFromArray($_REQUEST);
             // ah ok, its an incoming request, so get the form values out for interpretation/processing/whatever
             $vb_is_new_search = true;
         }
     }
     if ($this->request->getParameter('reset', pString) == 'clear') {
         $vs_search = '';
         $vb_is_new_search = true;
     }
     if ($vs_search && $vs_search != "") {
         /* any request? */
         $va_search_opts = array('sort' => $vs_sort, 'sort_direction' => $vs_sort_direction, 'appendToSearch' => $vs_append_to_search, 'getCountsByField' => 'type_id', 'checkAccess' => $va_access_values, 'no_cache' => $vb_is_new_search);
         if ($vb_is_new_search || isset($pa_options['saved_search']) || is_subclass_of($po_search, "BrowseEngine") && !$po_search->numCriteria()) {
             $vs_browse_classname = get_class($po_search);
             $this->opo_browse = $po_search = new $vs_browse_classname();
             $po_search->addCriteria('_search', $vs_search);
         }
         if ($this->opn_type_restriction_id) {
             $po_search->setTypeRestrictions(array($this->opn_type_restriction_id));
         }
         $vb_criteria_have_changed = false;
         if (is_subclass_of($po_search, "BrowseEngine")) {
             $vb_criteria_have_changed = $po_search->criteriaHaveChanged();
             $po_search->execute($va_search_opts);
             $this->opo_result_context->setParameter('browse_id', $po_search->getBrowseID());
             $vo_result = $po_search->getResults($va_search_opts);
         } else {
             $vo_result = $po_search->search($vs_search, $va_search_opts);
         }
         $this->opo_result_context->validateCache();
         // Only prefetch what we need
         $vo_result->setOption('prefetch', $vn_items_per_page);
         $this->opo_result_context->setParameter('form_data', $va_form_data);
         $this->opo_result_context->setSearchExpression($vs_search);
         if ($vb_is_new_search || $vb_criteria_have_changed) {
             $this->opo_result_context->setResultList($vo_result->getPrimaryKeyValues());
             $vn_page_num = 1;
         }
         $vo_result->seek(($vn_page_num - 1) * $vn_items_per_page);
         $this->view->setVar('num_hits', $vo_result->numHits());
         $this->view->setVar('num_pages', $vn_num_pages = ceil($vo_result->numHits() / $vn_items_per_page));
         if ($vn_page_num > $vn_num_pages) {
             $vn_page_num = 1;
         }
         $this->view->setVar('page', $vn_page_num);
         $this->view->setVar('search', $vs_search);
         $this->view->setVar('result', $vo_result);
     }
     //
     // Set up view for display of results
     //
     $t_model = $this->opo_datamodel->getTableInstance($this->ops_tablename);
     $this->view->setVar('views', $this->opa_views);
     // pass view list to view for rendering
     $this->view->setVar('current_view', $vs_view);
     $this->view->setVar('sorts', $this->opa_sorts);
     // pass sort list to view for rendering
     $this->view->setVar('current_sort', $vs_sort);
     $this->view->setVar('current_sort_direction', $vs_sort_direction);
     $this->view->setVar('current_items_per_page', $vn_items_per_page);
     $this->view->setVar('items_per_page', $this->opa_items_per_page);
     $this->view->setVar('t_subject', $t_model);
     $this->view->setVar('mode_name', _t('search'));
     $this->view->setVar('mode', 'search');
     $this->view->setVar('mode_type_singular', $this->searchName('singular'));
     $this->view->setVar('mode_type_plural', $this->searchName('plural'));
     $this->view->setVar('search_history', $this->opo_result_context->getSearchHistory());
     $this->view->setVar('result_context', $this->opo_result_context);
     $this->view->setVar('browse', $po_search);
     switch ($pa_options['output_format']) {
         # ------------------------------------
         case 'PDF':
             $this->_genPDF($vo_result, $this->request->getParameter("label_form", pString), $vs_search);
             break;
             # ------------------------------------
         # ------------------------------------
         case 'EXPORT':
             $this->_genExport($vo_result, $this->request->getParameter("export_format", pString), $vs_search, $vs_search);
             break;
             # ------------------------------------
         # ------------------------------------
         case 'HTML':
         default:
             // generate type menu and type value list
             if (method_exists($t_model, "getTypeList")) {
                 $this->view->setVar('type_list', $t_model->getTypeList());
             }
             // Call advanced search form generator directly to set view vars in the current view
             // This lets our view in this action render Search/search_advanced_form_html.php directly
             // to avoid the annoying flicker that occurs if we load the initial search form via AJAX
             $this->getAdvancedSearchForm(false);
             $this->opo_result_context->setAsLastFind();
             $this->opo_result_context->saveContext();
             $this->render('Search/' . $this->ops_tablename . '_search_advanced_html.php');
             break;
             # ------------------------------------
     }
 }
コード例 #14
0
 /**
  *
  */
 public function __call($ps_function, $pa_args)
 {
     AssetLoadManager::register("panel");
     AssetLoadManager::register("mediaViewer");
     AssetLoadManager::register("carousel");
     AssetLoadManager::register("readmore");
     AssetLoadManager::register("maps");
     $ps_function = strtolower($ps_function);
     $ps_id = urldecode($this->request->getActionExtra());
     if (!isset($this->opa_detail_types[$ps_function]) || !isset($this->opa_detail_types[$ps_function]['table']) || !($vs_table = $this->opa_detail_types[$ps_function]['table'])) {
         // invalid detail type – throw error
         die("Invalid detail type");
     }
     $t_table = $this->opo_datamodel->getInstanceByTableName($vs_table, true);
     if (($vb_use_identifiers_in_urls = caUseIdentifiersInUrls()) && substr($ps_id, 0, 3) == "id:") {
         $va_tmp = explode(":", $ps_id);
         $ps_id = (int) $va_tmp[1];
         $vb_use_identifiers_in_urls = false;
     }
     if (!$t_table->load($vb_use_identifiers_in_urls && $t_table->getProperty('ID_NUMBERING_ID_FIELD') ? $t_table->hasField('deleted') ? array($t_table->getProperty('ID_NUMBERING_ID_FIELD') => $ps_id, 'deleted' => 0) : array($t_table->getProperty('ID_NUMBERING_ID_FIELD') => $ps_id) : ($t_table->hasField('deleted') ? array($t_table->primaryKey() => (int) $ps_id, 'deleted' => 0) : array($t_table->primaryKey() => (int) $ps_id)))) {
         // invalid id - throw error
         die("Invalid id");
     }
     // Printables
     // 	merge displays with drop-in print templates
     //
     $va_export_options = caGetAvailablePrintTemplates('summary', array('table' => $t_table->tableName()));
     $this->view->setVar('export_formats', $va_export_options);
     $va_options = array();
     foreach ($va_export_options as $vn_i => $va_format_info) {
         $va_options[$va_format_info['name']] = $va_format_info['code'];
     }
     // Get current display list
     $t_display = new ca_bundle_displays();
     foreach (caExtractValuesByUserLocale($t_display->getBundleDisplays(array('table' => $this->ops_tablename, 'user_id' => $this->request->getUserID(), 'access' => __CA_BUNDLE_DISPLAY_READ_ACCESS__, 'checkAccess' => caGetUserAccessValues($this->request)))) as $va_display) {
         $va_options[$va_display['name']] = "_display_" . $va_display['display_id'];
     }
     ksort($va_options);
     $this->view->setVar('export_format_select', caHTMLSelect('export_format', $va_options, array('class' => 'searchToolsSelect'), array('value' => $this->view->getVar('current_export_format'), 'width' => '150px')));
     #
     # Enforce access control
     #
     if (sizeof($this->opa_access_values) && $t_table->hasField('access') && !in_array($t_table->get("access"), $this->opa_access_values)) {
         $this->notification->addNotification(_t("This item is not available for view"), "message");
         $this->response->setRedirect(caNavUrl($this->request, "", "", "", ""));
         return;
     }
     MetaTagManager::setWindowTitle($this->request->config->get("app_display_name") . ": " . $t_table->getTypeName() . ": " . $t_table->get('preferred_labels') . (($vs_idno = $t_table->get($t_table->getProperty('ID_NUMBERING_ID_FIELD'))) ? " [{$vs_idno}]" : ""));
     $vs_type = $t_table->getTypeCode();
     $this->view->setVar('detailType', $vs_table);
     $this->view->setVar('item', $t_table);
     $this->view->setVar('itemType', $vs_type);
     caAddPageCSSClasses(array($vs_table, $ps_function, $vs_type));
     // Do we need to pull in the multisearch result set?
     if (ResultContext::getLastFind($this->request, $vs_table, array('noSubtype' => true)) === 'multisearch') {
         $o_context = new ResultContext($this->request, $vs_table, 'multisearch', $ps_function);
         $o_context->setAsLastFind();
         $o_context->saveContext();
     } else {
         $o_context = ResultContext::getResultContextForLastFind($this->request, $vs_table);
     }
     $this->view->setVar('previousID', $vn_previous_id = $o_context->getPreviousID($t_table->getPrimaryKey()));
     $this->view->setVar('nextID', $vn_next_id = $o_context->getNextID($t_table->getPrimaryKey()));
     $this->view->setVar('previousURL', caDetailUrl($this->request, $vs_table, $vn_previous_id));
     $this->view->setVar('nextURL', caDetailUrl($this->request, $vs_table, $vn_next_id));
     $this->view->setVar('resultsURL', ResultContext::getResultsUrlForLastFind($this->request, $vs_table));
     $va_options = isset($this->opa_detail_types[$ps_function]['options']) && is_array($this->opa_detail_types[$ps_function]['options']) ? $this->opa_detail_types[$ps_function]['options'] : array();
     $this->view->setVar('previousLink', $vn_previous_id > 0 ? caDetailLink($this->request, caGetOption('previousLink', $va_options, _t('Previous')), '', $vs_table, $vn_previous_id) : '');
     $this->view->setVar('nextLink', $vn_next_id > 0 ? caDetailLink($this->request, caGetOption('nextLink', $va_options, _t('Next')), '', $vs_table, $vn_next_id) : '');
     $this->view->setVar('resultsLink', ResultContext::getResultsLinkForLastFind($this->request, $vs_table, caGetOption('resultsLink', $va_options, _t('Back'))));
     $this->view->setVar('commentsEnabled', (bool) $va_options['enableComments']);
     //
     //
     //
     if (method_exists($t_table, 'getPrimaryRepresentationInstance')) {
         if ($pn_representation_id = $this->request->getParameter('representation_id', pInteger)) {
             $t_representation = $this->opo_datamodel->getInstanceByTableName("ca_object_representations", true);
             $t_representation->load($pn_representation_id);
         } else {
             $t_representation = $t_table->getPrimaryRepresentationInstance(array("checkAccess" => $this->opa_access_values));
         }
         if ($t_representation) {
             $this->view->setVar("t_representation", $t_representation);
             $this->view->setVar("representation_id", $t_representation->get("representation_id"));
         } else {
             $t_representation = $this->opo_datamodel->getInstanceByTableName("ca_object_representations", true);
         }
         $this->view->setVar("representationViewer", caObjectDetailMedia($this->request, $t_table->getPrimaryKey(), $t_representation, $t_table, array("primaryOnly" => caGetOption('representationViewerPrimaryOnly', $va_options, false), "dontShowPlaceholder" => caGetOption('representationViewerDontShowPlaceholder', $va_options, false))));
     }
     //
     // map
     //
     if (!is_array($va_map_attributes = caGetOption('map_attributes', $va_options, array())) || !sizeof($va_map_attributes)) {
         if ($vs_map_attribute = caGetOption('map_attribute', $va_options, false)) {
             $va_map_attributes = array($vs_map_attribute);
         }
     }
     $this->view->setVar("map", "");
     if (is_array($va_map_attributes) && sizeof($va_map_attributes)) {
         $o_map = new GeographicMap(($vn_width = caGetOption('map_width', $va_options, false)) ? $vn_width : 285, ($vn_height = caGetOption('map_height', $va_options, false)) ? $vn_height : 200, 'map');
         $vn_mapped_count = 0;
         foreach ($va_map_attributes as $vs_map_attribute) {
             if ($t_table->get($vs_map_attribute)) {
                 $o_map->mapFrom($t_table, $vs_map_attribute);
                 $vn_mapped_count++;
             }
         }
         if ($vn_mapped_count > 0) {
             $this->view->setVar("map", $o_map->render('HTML'));
         }
     }
     //
     // comments, tags, rank
     //
     $this->view->setVar('averageRank', $t_table->getAverageRating(true));
     $this->view->setVar('numRank', $t_table->getNumRatings(true));
     #
     # User-generated comments, tags and ratings
     #
     $va_user_comments = $t_table->getComments(null, true);
     $va_comments = array();
     if (is_array($va_user_comments)) {
         foreach ($va_user_comments as $va_user_comment) {
             if ($va_user_comment["comment"] || $va_user_comment["media1"] || $va_user_comment["media2"] || $va_user_comment["media3"] || $va_user_comment["media4"]) {
                 # TODO: format date based on locale
                 $va_user_comment["date"] = date("n/j/Y", $va_user_comment["created_on"]);
                 # -- get name of commenter
                 if ($va_user_comment["user_id"]) {
                     $t_user = new ca_users($va_user_comment["user_id"]);
                     $va_user_comment["author"] = $t_user->getName();
                 } elseif ($va_user_comment["name"]) {
                     $va_user_comment["author"] = $va_user_comment["name"];
                 }
                 $va_comments[] = $va_user_comment;
             }
         }
     }
     $this->view->setVar('comments', $va_comments);
     $va_user_tags = $t_table->getTags(null, true);
     $va_tags = array();
     if (is_array($va_user_tags)) {
         foreach ($va_user_tags as $va_user_tag) {
             if (!in_array($va_user_tag["tag"], $va_tags)) {
                 $va_tags[] = $va_user_tag["tag"];
             }
         }
     }
     $this->view->setVar('tags_array', $va_tags);
     $this->view->setVar('tags', implode(", ", $va_tags));
     $this->view->setVar("itemComments", caDetailItemComments($this->request, $t_table->getPrimaryKey(), $t_table, $va_comments, $va_tags));
     //
     // share link
     //
     $this->view->setVar("shareLink", "<a href='#' onclick='caMediaPanel.showPanel(\"" . caNavUrl($this->request, '', 'Detail', 'ShareForm', array("tablename" => $t_table->tableName(), "item_id" => $t_table->getPrimaryKey())) . "\"); return false;'>Share</a>");
     // find view
     //		first look for type-specific view
     if (!$this->viewExists($vs_path = "Details/{$vs_table}_{$vs_type}_html.php")) {
         // If no type specific view use the default
         $vs_path = "Details/{$vs_table}_default_html.php";
     }
     switch ($ps_view = $this->request->getParameter('view', pString)) {
         case 'pdf':
             $this->_genExport($t_table, $this->request->getParameter("export_format", pString), 'Detail', 'Detail');
             break;
         default:
             //
             // Tag substitution
             //
             // Views can contain tags in the form {{{tagname}}}. Some tags, such as "itemType" and "detailType" are defined by
             // the detail controller. More usefully, you can pull data from the item being detailed by using a valid "get" expression
             // as a tag (Eg. {{{ca_objects.idno}}}. Even more usefully for some, you can also use a valid bundle display template
             // (see http://docs.collectiveaccess.org/wiki/Bundle_Display_Templates) as a tag. The template will be evaluated in the
             // context of the item being detailed.
             //
             $va_defined_vars = array_keys($this->view->getAllVars());
             // get list defined vars (we don't want to copy over them)
             $va_tag_list = $this->getTagListForView($vs_path);
             // get list of tags in view
             foreach ($va_tag_list as $vs_tag) {
                 if (in_array($vs_tag, $va_defined_vars)) {
                     continue;
                 }
                 if (strpos($vs_tag, "^") !== false || strpos($vs_tag, "<") !== false) {
                     $this->view->setVar($vs_tag, $t_table->getWithTemplate($vs_tag, array('checkAccess' => $this->opa_access_values)));
                 } elseif (strpos($vs_tag, ".") !== false) {
                     $this->view->setVar($vs_tag, $t_table->get($vs_tag, array('checkAccess' => $this->opa_access_values)));
                 } else {
                     $this->view->setVar($vs_tag, "?{$vs_tag}");
                 }
             }
             $this->render($vs_path);
             break;
     }
 }
コード例 #15
0
 /**
  *
  */
 public function Index($pa_options = null)
 {
     $po_search = isset($pa_options['search']) ? $pa_options['search'] : null;
     $pb_dont_render_view = isset($pa_options['dontRenderView']) && (bool) $pa_options['dontRenderView'] ? true : false;
     parent::Index($pa_options);
     AssetLoadManager::register('browsable');
     AssetLoadManager::register('hierBrowser');
     $va_access_values = caGetUserAccessValues($this->request);
     //
     // Restrict facets to specific group for main browse landing page (if set in app.conf config)
     //
     if ($vs_facet_group = $this->request->config->get($this->ops_tablename . '_browse_facet_group')) {
         $this->opo_browse->setFacetGroup($vs_facet_group);
     }
     //
     // Set useful values we'll need later
     //
     $t_model = $this->opo_datamodel->getInstanceByTableName($this->ops_tablename, true);
     $vb_criteria_have_changed = $this->opo_browse->criteriaHaveChanged();
     // Get elements of result context
     $vn_page_num = $this->opo_result_context->getCurrentResultsPageNumber();
     if ($this->opb_type_restriction_has_changed || $this->request->getParameter('reset', pString) == 'clear') {
         $this->opo_browse->removeAllCriteria();
         $this->opo_result_context->setSearchExpression($this->opo_browse->getBrowseID());
     }
     if (!($vn_items_per_page = $this->opo_result_context->getItemsPerPage())) {
         $vn_items_per_page = $this->opn_items_per_page_default;
         $this->opo_result_context->setItemsPerPage($vn_items_per_page);
     }
     if (!($vs_view = $this->opo_result_context->getCurrentView())) {
         $va_tmp = array_keys($this->opa_views);
         $vs_view = $this->ops_view_default ? $this->ops_view_default : array_shift($va_tmp);
         $this->opo_result_context->setCurrentView($vs_view);
     }
     if (!isset($this->opa_views[$vs_view])) {
         $va_tmp = array_keys($this->opa_views);
         $vs_view = array_shift($va_tmp);
     }
     if (!($vs_sort = $this->opo_result_context->getCurrentSort())) {
         $va_tmp = array_keys($this->opa_sorts);
         $vs_sort = array_shift($va_tmp);
     }
     $vs_sort_direction = $this->opo_result_context->getCurrentSortDirection();
     $vb_sort_has_changed = $this->opo_result_context->sortHasChanged();
     if (!$vn_page_num || $vb_criteria_have_changed) {
         $vn_page_num = 1;
     }
     // Do redirect directly to detail if configured to do so
     if ($this->opo_browse->criteriaHaveChanged() && sizeof($va_criteria = $this->opo_browse->getCriteria()) == 1) {
         $va_tmp = array_keys($va_criteria);
         $va_tmp1 = array_keys($va_criteria[$va_tmp[0]]);
         $va_facet_info = $this->opo_browse->getInfoForFacet($va_tmp[0]);
         if ($this->request->config->get('redirect_to_' . $va_facet_info['table'] . '_detail_if_is_first_facet')) {
             $t_table = $this->opo_datamodel->getInstanceByTableName($va_facet_info['table'], true);
             $va_newmuseum_hack_occurrence_type_ids = $this->request->config->getList('newmuseum_hack_browse_should_redirect_occurrence_types_to_object_details');
             if (is_array($va_newmuseum_hack_occurrence_type_ids) && sizeof($va_newmuseum_hack_occurrence_type_ids) && $va_facet_info['table'] == 'ca_occurrences') {
                 if ($t_table->load($va_tmp1[0])) {
                     if (in_array($t_table->getTypeID(), $va_newmuseum_hack_occurrence_type_ids)) {
                         if (sizeof($va_objects = $t_table->getRelatedItems('ca_objects'))) {
                             $va_object = array_shift($va_objects);
                             $vn_object_id = $va_object['object_id'];
                             $this->response->setRedirect(caNavUrl($this->request, 'Detail', 'Object', 'Show', array('object_id' => $vn_object_id)));
                             return;
                         }
                     }
                 }
             }
             $this->response->setRedirect(caNavUrl($this->request, 'Detail', ucfirst($t_table->getProperty('NAME_SINGULAR')), 'Show', array($t_table->primaryKey() => $va_tmp1[0])));
             return;
         }
     }
     //
     // Enforce type restriction, if defined
     //
     $this->opo_browse->setTypeRestrictions(array($this->opn_type_restriction_id));
     MetaTagManager::setWindowTitle(_t('%1 browse', $this->browseName('plural')));
     //
     // Actually execute the browse - do the queries
     //
     //if ($vs_group_name = $this->request->config->get('browse_facet_group_for_'.$this->ops_tablename)) {
     //	$this->opo_browse->setFacetGroup($vs_group_name);
     //}
     //
     // Restrict facets to specific group (if set in app.conf config)
     //
     if ($vs_facet_group = $this->request->config->get($this->ops_tablename . ($this->opo_browse->numCriteria() < 1 ? '_browse_facet_group' : '_browse_refine_facet_group'))) {
         $this->opo_browse->setFacetGroup($vs_facet_group);
     }
     $this->opo_browse->execute(array('checkAccess' => $va_access_values, 'no_cache' => !$this->opo_result_context->cacheIsValid()));
     $this->opo_result_context->validateCache();
     $this->opo_result_context->setSearchExpression($this->opo_browse->getBrowseID());
     //
     // Pass browse info (context + facets + criteria) to view
     //
     $this->view->setVar('browse', $this->opo_browse);
     $this->view->setVar('target', $this->ops_tablename);
     $this->view->setVar('result_context', $this->opo_result_context);
     $this->view->setVar('criteria', $va_criteria = $this->opo_browse->getCriteriaWithLabels());
     $this->view->setVar('available_facets', $this->opo_browse->getInfoForAvailableFacets());
     $this->view->setVar('facets_with_content', $this->opo_browse->getInfoForFacetsWithContent());
     $this->view->setVar('facet_info', $va_facet_info = $this->opo_browse->getInfoForFacets());
     $va_single_facet_values = array();
     foreach ($va_facet_info as $vs_facet => $va_facet_settings) {
         $va_single_facet_values[$vs_facet] = isset($va_facet_settings['single_value']) ? $va_facet_settings['single_value'] : null;
     }
     $this->view->setVar('single_facet_values', $va_single_facet_values);
     // browse criteria in an easy-to-display format
     $va_browse_criteria = array();
     foreach ($this->opo_browse->getCriteriaWithLabels() as $vs_facet_code => $va_criteria) {
         $va_facet_info = $this->opo_browse->getInfoForFacet($vs_facet_code);
         $va_criteria_list = array();
         foreach ($va_criteria as $vn_criteria_id => $vs_criteria_label) {
             $va_criteria_list[] = $vs_criteria_label;
         }
         $va_browse_criteria[$va_facet_info['label_singular']] = join('; ', $va_criteria_list);
     }
     $this->view->setVar('browse_criteria', $va_browse_criteria);
     //
     // Get the browse results
     //
     $this->view->setVar('num_hits', $vn_num_hits = $this->opo_browse->numResults());
     $this->view->setVar('num_pages', $vn_num_pages = ceil($vn_num_hits / $vn_items_per_page));
     if ($vn_page_num > $vn_num_pages) {
         $vn_page_num = 1;
     }
     if ($pa_options['output_format']) {
         $vo_result = $this->opo_browse->getResults(array('sort' => $vs_sort, 'sort_direction' => $vs_sort_direction));
     } else {
         $vo_result = $this->opo_browse->getResults(array('sort' => $vs_sort, 'sort_direction' => $vs_sort_direction, 'start' => ($vn_page_num - 1) * $vn_items_per_page, 'limit' => $vn_items_per_page));
     }
     // Only prefetch what we need
     $vo_result->setOption('prefetch', $vn_items_per_page);
     if ($vo_result) {
         if ($vb_criteria_have_changed || $vb_sort_has_changed) {
             // Put the results id list into the results context - we used this for previous/next navigation
             $this->opo_result_context->setResultList($vo_result->getPrimaryKeyValues());
             $this->opo_result_context->setParameter('availableVisualizationChecked', 0);
         }
         $vo_result->seek(0);
     }
     //
     // Set up view for display of results
     //
     $this->view->setVar('page', $vn_page_num);
     $this->view->setVar('result', $vo_result);
     $this->view->setVar('views', $this->opa_views);
     // pass view list to view for rendering
     $this->view->setVar('current_view', $vs_view);
     $this->view->setVar('sorts', $this->opa_sorts);
     // pass sort list to view for rendering
     $this->view->setVar('current_sort', $vs_sort);
     $this->view->setVar('current_sort_direction', $vs_sort_direction);
     $this->view->setVar('items_per_page', $this->opa_items_per_page);
     $this->view->setVar('current_items_per_page', $vn_items_per_page);
     $this->view->setVar('t_subject', $t_model);
     $this->view->setVar('mode_name', _t('browse'));
     $this->view->setVar('mode', 'browse');
     $this->view->setVar('mode_type_singular', $this->browseName('singular'));
     $this->view->setVar('mode_type_plural', $this->browseName('plural'));
     $this->view->setVar('access_values', $va_access_values);
     $t_display = $this->view->getVar('t_display');
     $va_display_list = $this->view->getVar('display_list');
     if ($vs_view == 'editable') {
         $va_initial_data = array();
         $va_row_headers = array();
         $vn_item_count = 0;
         if ($vo_result) {
             $vs_pk = $vo_result->primaryKey();
             while ($vn_item_count < 100 && $vo_result->nextHit()) {
                 $va_result = array('item_id' => $vn_id = $vo_result->get($vs_pk));
                 foreach ($va_display_list as $vn_placement_id => $va_bundle_info) {
                     $va_result[str_replace(".", "-", $va_bundle_info['bundle_name'])] = $t_display->getDisplayValue($vo_result, $vn_placement_id, array('request' => $this->request));
                 }
                 $va_initial_data[] = $va_result;
                 $vn_item_count++;
                 $va_row_headers[] = $vn_item_count . " " . caEditorLink($this->request, caNavIcon($this->request, __CA_NAV_BUTTON_EDIT__), 'caResultsEditorEditLink', $this->ops_tablename, $vn_id);
             }
         }
         $this->view->setVar('initialData', $va_initial_data);
         $this->view->setVar('rowHeaders', $va_row_headers);
     }
     //
     // Bottom line
     //
     $va_bottom_line = array();
     $vb_bottom_line_is_set = false;
     foreach ($va_display_list as $vn_placement_id => $va_placement) {
         if (isset($va_placement['settings']['bottom_line']) && $va_placement['settings']['bottom_line']) {
             $va_bottom_line[$vn_placement_id] = caProcessBottomLineTemplate($this->request, $va_placement, $vo_result, array('pageStart' => ($vn_page_num - 1) * $vn_items_per_page, 'pageEnd' => ($vn_page_num - 1) * $vn_items_per_page + $vn_items_per_page));
             $vb_bottom_line_is_set = true;
         } else {
             $va_bottom_line[$vn_placement_id] = '';
         }
     }
     $this->view->setVar('bottom_line', $vb_bottom_line_is_set ? $va_bottom_line : null);
     switch ($pa_options['output_format']) {
         # ------------------------------------
         case 'LABELS':
             $this->_genLabels($vo_result, $this->request->getParameter("label_form", pString), _t('Browse'), _t('Browse'));
             break;
             # ------------------------------------
         # ------------------------------------
         case 'EXPORT':
             $this->_genExport($vo_result, $this->request->getParameter("export_format", pString), _t('Browse'), _t('Browse'));
             break;
             # ------------------------------------
         # ------------------------------------
         case 'HTML':
         default:
             // generate type menu and type value list
             if (method_exists($t_model, "getTypeList")) {
                 $this->view->setVar('type_list', $t_model->getTypeList());
             }
             $this->opo_result_context->setAsLastFind();
             $this->opo_result_context->saveContext();
             if (!$pb_dont_render_view) {
                 $this->render('Browse/browse_controls_html.php');
             }
             break;
     }
 }
コード例 #16
0
ファイル: pageHeader.php プロジェクト: ffarago/pawtucket2
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0"/>

	<script type="text/javascript">window.caBasePath = '<?php 
print $this->request->getBaseUrlPath();
?>
';</script>
		
	<?php 
print MetaTagManager::getHTML();
?>
	<?php 
print AssetLoadManager::getLoadHTML($this->request);
?>

	<title><?php 
print ($vs_page_title = MetaTagManager::getWindowTitle()) ? $vs_page_title : "New School Archives : Digital Collections";
?>
</title>
	
	<!--NS design-->
	<script type="text/javascript" src="//use.typekit.net/cvi0qyc.js"></script>
	<script type="text/javascript">try{Typekit.load();}catch(e){}</script>
	<!--end NS design-->

	<script type="text/javascript">
		jQuery(document).ready(function() {
    		jQuery('#browse-menu').on('click mouseover mouseout mousemove mouseenter hide.bs.dropdown',function(e) { e.stopPropagation(); });
    	});
	</script>
	<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
コード例 #17
0
 /** 
  * 
  */
 public function advanced()
 {
     $o_config = caGetSearchConfig();
     $ps_function = strtolower($this->request->getActionExtra());
     if (!($va_search_info = caGetInfoForAdvancedSearchType($ps_function))) {
         // invalid advanced search type – throw error
         die("Invalid advanced search type");
     }
     $vs_class = $va_search_info['table'];
     $va_types = caGetOption('restrictToTypes', $va_search_info, array(), array('castTo' => 'array'));
     $this->opo_result_context = new ResultContext($this->request, $va_search_info['table'], $this->ops_find_type . '_advanced');
     $this->opo_result_context->setAsLastFind();
     MetaTagManager::setWindowTitle($this->request->config->get("app_display_name") . ": " . _t("Search %1", $va_search_info["displayName"]));
     $this->view->setVar('searchInfo', $va_search_info);
     $this->view->setVar('options', caGetOption('options', $va_search_info, array(), array('castTo' => 'array')));
     $va_default_form_values = $this->opo_result_context->getParameter("pawtucketAdvancedSearchFormContent_{$ps_function}");
     $va_default_form_booleans = $this->opo_result_context->getParameter("pawtucketAdvancedSearchFormBooleans_{$ps_function}");
     $va_tags = $this->view->getTagList($va_search_info['view']);
     $t_subject = $this->request->datamodel->getInstanceByTableName($va_search_info['table'], true);
     $va_form_elements = array();
     $vs_script = null;
     foreach ($va_tags as $vs_tag) {
         $va_parse = caParseTagOptions($vs_tag);
         $vs_tag_proc = $va_parse['tag'];
         $va_opts = $va_parse['options'];
         if (($vs_default_value = caGetOption('default', $va_opts, null)) || ($vs_default_value = caGetOption($vs_tag_proc, $va_default_form_values, null))) {
             $va_default_form_values[$vs_tag_proc] = $vs_default_value;
             unset($va_opts['default']);
         }
         $vs_tag_val = null;
         switch (strtolower($vs_tag_proc)) {
             case 'submit':
                 $this->view->setVar($vs_tag, "<a href='#' class='caAdvancedSearchFormSubmit'>" . (isset($va_opts['label']) && $va_opts['label'] ? $va_opts['label'] : _t('Submit')) . "</a>");
                 break;
             case 'reset':
                 $this->view->setVar($vs_tag, "<a href='#' class='caAdvancedSearchFormReset'>" . (isset($va_opts['label']) && $va_opts['label'] ? $va_opts['label'] : _t('Reset')) . "</a>");
                 $vs_script = "<script type='text/javascript'>\n\tjQuery('.caAdvancedSearchFormSubmit').bind('click', function() {\n\t\tjQuery('#caAdvancedSearch').submit();\n\t\treturn false;\n\t});\n\tjQuery('.caAdvancedSearchFormReset').bind('click', function() {\n\t\tjQuery('#caAdvancedSearch').find('input[type!=\"hidden\"],textarea').val('');\n\t\tjQuery('#caAdvancedSearch').find('select.caAdvancedSearchBoolean').val('AND');\n\t\tjQuery('#caAdvancedSearch').find('select').prop('selectedIndex', 0);\n\t\treturn false;\n\t});\n\tjQuery(document).ready(function() {\n\t\tvar f, defaultValues = " . json_encode($va_default_form_values) . ", defaultBooleans = " . json_encode($va_default_form_booleans) . ";\n\t\tfor (f in defaultValues) {\n\t\t\tvar f_proc = f + '[]';\n\t\t\tjQuery('input[name=\"' + f_proc+ '\"], textarea[name=\"' + f_proc+ '\"], select[name=\"' + f_proc+ '\"]').each(function(k, v) {\n\t\t\t\tif (defaultValues[f][k]) { jQuery(v).val(defaultValues[f][k]); } \n\t\t\t});\n\t\t}\n\t\tfor (f in defaultBooleans) {\n\t\t\tvar f_proc = f + '[]';\n\t\t\tjQuery('select[name=\"' + f_proc+ '\"].caAdvancedSearchBoolean').each(function(k, v) {\n\t\t\t\tif (defaultBooleans[f][k]) { jQuery(v).val(defaultBooleans[f][k]); }\n\t\t\t});\n\t\t}\n\t});\n</script>\n";
                 break;
             default:
                 if (preg_match("!^(.*):label\$!", $vs_tag_proc, $va_matches)) {
                     $this->view->setVar($vs_tag, $vs_tag_val = $t_subject->getDisplayLabel($va_matches[1]));
                 } elseif (preg_match("!^(.*):boolean\$!", $vs_tag_proc, $va_matches)) {
                     $this->view->setVar($vs_tag, caHTMLSelect($vs_tag_proc . '[]', array(_t('AND') => 'AND', _t('OR') => 'OR', 'AND NOT' => 'AND NOT'), array('class' => 'caAdvancedSearchBoolean')));
                 } else {
                     $va_opts['asArrayElement'] = true;
                     if (isset($va_opts['restrictToTypes']) && $va_opts['restrictToTypes'] && !is_array($va_opts['restrictToTypes'])) {
                         $va_opts['restrictToTypes'] = explode(";", $va_opts['restrictToTypes']);
                     }
                     if ($vs_tag_val = $t_subject->htmlFormElementForSearch($this->request, $vs_tag_proc, $va_opts)) {
                         $this->view->setVar($vs_tag, $vs_tag_val);
                     }
                     $va_tmp = explode('.', $vs_tag_proc);
                     if (($t_element = ca_metadata_elements::getInstance($va_tmp[1])) && $t_element->get('datatype') == 0) {
                         if (is_array($va_elements = $t_element->getElementsInSet())) {
                             foreach ($va_elements as $va_element) {
                                 if ($va_element['datatype'] > 0) {
                                     $va_form_elements[] = $va_tmp[0] . '.' . $va_tmp[1] . '.' . $va_element['element_code'];
                                 }
                             }
                         }
                         break;
                     }
                 }
                 if ($vs_tag_val) {
                     $va_form_elements[] = $vs_tag_proc;
                 }
                 break;
         }
     }
     $this->view->setVar("form", caFormTag($this->request, "{$ps_function}", 'caAdvancedSearch', null, 'post', 'multipart/form-data', '_top', array('disableUnsavedChangesWarning' => true, 'submitOnReturn' => true)));
     $this->view->setVar("/form", $vs_script . caHTMLHiddenInput("_advancedFormName", array("value" => $ps_function)) . caHTMLHiddenInput("_formElements", array("value" => join(';', $va_form_elements))) . caHTMLHiddenInput("_advanced", array("value" => 1)) . "</form>");
     $this->render($va_search_info['view']);
 }
コード例 #18
0
 /**
  * Initializes editor view with core set of values, loads model with record to be edited and selects user interface to use.
  *
  * @param $pa_options Array of options. Supported options are:
  *		ui = The ui_id or editor_code value for the user interface to use. If omitted the default user interface is used.
  */
 protected function _initView($pa_options = null)
 {
     // load required javascript
     AssetLoadManager::register('bundleableEditor');
     AssetLoadManager::register('imageScroller');
     AssetLoadManager::register('datePickerUI');
     $vn_set_id = $this->request->getParameter('set_id', pInteger);
     $t_set = new ca_sets();
     if (!$vn_set_id || !$t_set->load($vn_set_id)) {
         // Bad set id
         return array(null, null, null, null);
     }
     // Does user have access to set?
     if (!$t_set->haveAccessToSet($this->request->getUserID(), __CA_SET_READ_ACCESS__)) {
         return array(null, null, null, null);
     }
     $t_subject = $this->opo_datamodel->getInstanceByTableNum($t_set->get('table_num'));
     $t_ui = new ca_editor_uis();
     if (!isset($pa_options['ui']) && !$pa_options['ui']) {
         $t_ui->load($this->request->user->getPreference("batch_" . $t_subject->tableName() . "_editor_ui"));
     }
     if (!$t_ui->getPrimaryKey() && isset($pa_options['ui']['__all__']) && $pa_options['ui']['__all__']) {
         if (is_numeric($pa_options['ui']['__all__'])) {
             $t_ui->load((int) $pa_options['ui']['__all__']);
         }
         if (!$t_ui->getPrimaryKey()) {
             $t_ui->load(array('editor_code' => $pa_options['ui']['__all__']));
         }
     }
     if (!$t_ui->getPrimaryKey()) {
         $t_ui = ca_editor_uis::loadDefaultUI($t_subject->tableName(), $this->request, $t_subject->getTypeID());
     }
     $this->view->setVar('set_id', $vn_set_id);
     $this->view->setVar('t_set', $t_set);
     $this->view->setVar('t_subject', $t_subject);
     $vn_item_count = $t_set->getItemCount(array('user_id' => $this->request->getUserID()));
     $vs_item_name = $vn_item_count == 1 ? $t_subject->getProperty("NAME_SINGULAR") : $t_subject->getProperty("NAME_PLURAL");
     MetaTagManager::setWindowTitle(_t("Batch editing %1 %2 with set %3", $vn_item_count, $vs_item_name, $t_set->getLabelForDisplay(true)));
     return array($vn_set_id, $t_set, $t_subject, $t_ui);
 }
コード例 #19
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_entities");
     //
     // Minimal view list (all targets have a "full" results view)
     //
     $this->opa_views = array('full' => _t('List'));
     $this->opa_views_options = array('full' => array("description" => _t("View results in a list"), "icon" => "icon_list.gif"));
     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 EntityBrowse();
     // get configured result views, if specified
     if ($va_result_views_for_ca_entities = $po_request->config->getAssoc('result_views_for_ca_entities')) {
         $this->opa_views = $va_result_views_for_ca_entities;
     }
     // get configured result views options, if specified
     if ($va_result_views_options_for_ca_entities = $po_request->config->getAssoc('result_views_options_for_ca_entities')) {
         $this->opa_views_options = $va_result_views_options_for_ca_entities;
     }
     // get configured result sort options, if specified
     if ($va_sort_options_for_ca_entities = $po_request->config->getAssoc('result_sort_options_for_ca_entities')) {
         $this->opa_sorts = $va_sort_options_for_ca_entities;
     } else {
         $this->opa_sorts = array('ca_entity_labels.displayname' => _t('Name'), 'ca_entities.type_id' => _t('Type'), 'ca_entities.idno_sort' => _t('Idno'));
     }
     $va_sources = array();
     $t_list_item = new ca_lists();
     $vn_aoee_source = $t_list_item->getItemIDFromList("entity_sources", "aoee");
     $va_sources[] = $vn_aoee_source;
     $this->aoee_source = $vn_aoee_source;
     $this->view->setVar('aoee_source', $vn_aoee_source);
     $vn_aoee_featured_source = $t_list_item->getItemIDFromList("entity_sources", "featured");
     $va_sources[] = $vn_aoee_featured_source;
     $this->aoee_featured_source = $vn_aoee_featured_source;
     $this->view->setVar('aoee_featured_source', $vn_aoee_featured_source);
     $vn_aoee_priority_source = $t_list_item->getItemIDFromList("entity_sources", "priority");
     $va_sources[] = $vn_aoee_priority_source;
     $this->aoee_priority_source = $vn_aoee_priority_source;
     $this->view->setVar('aoee_priority_source', $vn_aoee_priority_source);
     $this->aoee_sourcea = $va_sources;
     $this->view->setVar('aoee_sources', $va_sources);
     $this->opo_browse->addResultFilter("ca_entities.source_id", "IN", join(',', $va_sources));
     $vn_on_view_yes_id = $t_list_item->getItemIDFromList("yes_no", "yes");
     $this->view->setVar('on_view_yes_id', $vn_on_view_yes_id);
     $this->view->setvar("browse_place_ids", $this->opo_plugin_config->get('artist_browser_place_ids'));
 }
コード例 #20
0
<?php

MetaTagManager::setWindowTitle($this->request->config->get("app_display_name") . ": Partners and Support");
?>
<div class="container containerTextPadding">
	<div class="row">
		<div class="col-sm-12">
			<H1><?php 
print _t("Partners and Support");
?>
</H1>
		</div>
	</div>
	<div class="row partnersSupportLogoRow">
		<div class="col-sm-12 text-left">
			<H2>Support Provided By</H2>
			<div style="float:left;">
				<a href="http://www.iucn.org/" target="_blank"><?php 
print caGetThemeGraphic($this->request, 'logo_IUCN_WCPA.jpg');
?>
</a>
			</div>
			<div style="text-align:right;">
				<a href="http://www.biopama.org/" target="_blank"><?php 
print caGetThemeGraphic($this->request, 'logo_BIOPAMA.jpg', array("style" => "margin:15px 0px 25px 0px;"));
?>
</a>
				<div>
					BIOPAMA is implemented by:<br/>
					<?php 
print caGetThemeGraphic($this->request, 'logo_biopama_initiative.jpg', array("style" => "margin:0px 0px 5px 0px;"));
コード例 #21
0
ファイル: pageHeader.php プロジェクト: guaykuru/pawtucket
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title><?php 
print $this->request->config->get('html_page_title');
?>
</title>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
	<?php 
print MetaTagManager::getHTML();
?>
	
	<link href="<?php 
print $this->request->getThemeUrlPath(true);
?>
/css/global.css" rel="stylesheet" type="text/css" />
	<link href="<?php 
print $this->request->getThemeUrlPath(true);
?>
/css/sets.css" rel="stylesheet" type="text/css" />
	<link href="<?php 
print $this->request->getThemeUrlPath(true);
?>
/css/bookmarks.css" rel="stylesheet" type="text/css" />
	<link rel="stylesheet" href="<?php 
print $this->request->getBaseUrlPath();
?>
/js/videojs/video-js.css" type="text/css" media="screen" />
	<link rel="stylesheet" href="<?php 
print $this->request->getBaseUrlPath();
?>
コード例 #22
0
 /**
  * Options:
  *		appendToSearch = optional text to be AND'ed wuth current search expression
  *		output_format = determines format out search result output. "PDF" and "HTML" are currently supported; "HTML" is the default
  *		view = view with path relative to controller to use overriding default ("search/<table_name>_search_basic_html.php")
  *		vars = associative array with key value pairs to assign to the view
  *
  * Callbacks:
  * 		hookBeforeNewSearch() is called just before executing a new search. The first parameter is the BrowseEngine object containing the search.
  */
 public function Index($pa_options = null)
 {
     $po_search = isset($pa_options['search']) ? $pa_options['search'] : null;
     if (isset($pa_options['saved_search']) && $pa_options['saved_search']) {
         $this->opo_result_context->setSearchExpression($pa_options['saved_search']['search']);
         $this->opo_result_context->isNewSearch(true);
     }
     parent::Index($pa_options);
     AssetLoadManager::register('hierBrowser');
     AssetLoadManager::register('browsable');
     // need this to support browse panel when filtering/refining search results
     $t_model = $this->opo_datamodel->getInstanceByTableName($this->ops_tablename, true);
     $va_access_values = caGetUserAccessValues($this->request);
     // Get elements of result context
     $vn_page_num = $this->opo_result_context->getCurrentResultsPageNumber();
     $vs_search = $this->opo_result_context->getSearchExpression();
     $vb_is_new_search = $this->opo_result_context->isNewSearch();
     if ((bool) $this->request->getParameter('reset', pString) && $this->request->getParameter('reset', pString) != 'save') {
         $vs_search = '';
         $vb_is_new_search = true;
     }
     if (!($vn_items_per_page = $this->opo_result_context->getItemsPerPage())) {
         $vn_items_per_page = $this->opn_items_per_page_default;
         $this->opo_result_context->setItemsPerPage($vn_items_per_page);
     }
     if (!($vs_view = $this->opo_result_context->getCurrentView())) {
         $va_tmp = array_keys($this->opa_views);
         $vs_view = $this->ops_view_default ? $this->ops_view_default : array_shift($va_tmp);
         $this->opo_result_context->setCurrentView($vs_view);
     }
     if (!isset($this->opa_views[$vs_view])) {
         $va_tmp = array_keys($this->opa_views);
         $vs_view = array_shift($va_tmp);
     }
     if (!($vs_sort = $this->opo_result_context->getCurrentSort())) {
         $va_tmp = array_keys($this->opa_sorts);
         $vs_sort = array_shift($va_tmp);
     }
     $vs_sort_direction = $this->opo_result_context->getCurrentSortDirection();
     $vb_sort_has_changed = $this->opo_result_context->sortHasChanged();
     if (!$this->opn_type_restriction_id) {
         $this->opn_type_restriction_id = '';
     }
     $this->view->setVar('type_id', $this->opn_type_restriction_id);
     MetaTagManager::setWindowTitle(_t('%1 search', $this->searchName('plural')));
     // Get attribute sorts
     $va_sortable_elements = ca_metadata_elements::getSortableElements($this->ops_tablename, $this->opn_type_restriction_id);
     if (!is_array($this->opa_sorts)) {
         $this->opa_sorts = array();
     }
     foreach ($va_sortable_elements as $va_sortable_element) {
         $this->opa_sorts[$this->ops_tablename . '.' . $va_sortable_element['element_code']] = $va_sortable_element['display_label'];
     }
     if ($pa_options['appendToSearch']) {
         $vs_append_to_search .= " AND (" . $pa_options['appendToSearch'] . ")";
     }
     //
     // Execute the search
     //
     if ($vs_search && $vs_search != "") {
         /* any request? */
         $va_search_opts = array('sort' => $vs_sort, 'sort_direction' => $vs_sort_direction, 'appendToSearch' => $vs_append_to_search, 'checkAccess' => $va_access_values, 'no_cache' => $vb_is_new_search, 'dontCheckFacetAvailability' => true, 'filterNonPrimaryRepresentations' => true);
         if ($vb_is_new_search || isset($pa_options['saved_search']) || is_subclass_of($po_search, "BrowseEngine") && !$po_search->numCriteria()) {
             $vs_browse_classname = get_class($po_search);
             $po_search = new $vs_browse_classname();
             if (is_subclass_of($po_search, "BrowseEngine")) {
                 $po_search->addCriteria('_search', $vs_search);
                 if (method_exists($this, "hookBeforeNewSearch")) {
                     $this->hookBeforeNewSearch($po_search);
                 }
             }
             $this->opo_result_context->setParameter('show_type_id', null);
         }
         if ($this->opn_type_restriction_id) {
             $po_search->setTypeRestrictions(array($this->opn_type_restriction_id), array('includeSubtypes' => false));
         }
         $vb_criteria_have_changed = false;
         if (is_subclass_of($po_search, "BrowseEngine")) {
             //
             // Restrict facets to specific group for main browse landing page (if set in app.conf config)
             //
             if ($vs_facet_group = $this->request->config->get($this->ops_tablename . '_search_refine_facet_group')) {
                 $po_search->setFacetGroup($vs_facet_group);
             }
             $vb_criteria_have_changed = $po_search->criteriaHaveChanged();
             $po_search->execute($va_search_opts);
             $this->opo_result_context->setParameter('browse_id', $po_search->getBrowseID());
             if ($vs_group_name = $this->request->config->get('browse_facet_group_for_' . $this->ops_tablename)) {
                 $po_search->setFacetGroup($vs_group_name);
             }
             $vo_result = $po_search->getResults($va_search_opts);
         } else {
             $vo_result = $po_search->search($vs_search, $va_search_opts);
         }
         $vo_result = isset($pa_options['result']) ? $pa_options['result'] : $vo_result;
         $this->opo_result_context->validateCache();
         // Only prefetch what we need
         $vo_result->setOption('prefetch', $vn_items_per_page);
         //
         // Handle details of partitioning search results by type, if required
         //
         if ((bool) $this->request->config->get('search_results_partition_by_type')) {
             $va_type_counts = $vo_result->getResultCountForFieldValues(array('ca_objects.type_id'));
             $va_type_counts_obj_type = $va_type_counts['ca_objects.type_id'];
             ksort($va_type_counts_obj_type);
             $this->view->setVar('counts_by_type', $va_type_counts_obj_type);
             $vn_show_type_id = $this->opo_result_context->getParameter('show_type_id');
             if (!isset($va_type_counts_obj_type[$vn_show_type_id])) {
                 $va_tmp = array_keys($va_type_counts_obj_type);
                 $vn_show_type_id = array_shift($va_tmp);
             }
             $this->view->setVar('show_type_id', $vn_show_type_id);
             $vo_result->filterResult('ca_objects.type_id', $vn_show_type_id);
         }
         if ($vb_is_new_search || $vb_criteria_have_changed || $vb_sort_has_changed) {
             $this->opo_result_context->setResultList($vo_result->getPrimaryKeyValues());
             $this->opo_result_context->setParameter('availableVisualizationChecked', 0);
             if ($this->opo_result_context->searchExpressionHasChanged()) {
                 $vn_page_num = 1;
             }
         }
         $this->view->setVar('num_hits', $vo_result->numHits());
         $this->view->setVar('num_pages', $vn_num_pages = ceil($vo_result->numHits() / $vn_items_per_page));
         if ($vn_page_num > $vn_num_pages) {
             $vn_page_num = 1;
         }
         $vo_result->seek(($vn_page_num - 1) * $vn_items_per_page);
         $this->view->setVar('page', $vn_page_num);
         $this->view->setVar('search', $vs_search);
         $this->view->setVar('result', $vo_result);
     }
     //
     // Set up view for display of results
     //
     $t_model = $this->opo_datamodel->getInstanceByTableName($this->ops_tablename, true);
     $this->view->setVar('views', $this->opa_views);
     // pass view list to view for rendering
     $this->view->setVar('current_view', $vs_view);
     $this->view->setVar('sorts', $this->opa_sorts);
     // pass sort list to view for rendering
     $this->view->setVar('current_sort', $vs_sort);
     $this->view->setVar('current_sort_direction', $vs_sort_direction);
     $this->view->setVar('current_items_per_page', $vn_items_per_page);
     $this->view->setVar('items_per_page', $this->opa_items_per_page);
     $this->view->setVar('t_subject', $t_model);
     $this->view->setVar('mode_name', _t('search'));
     $this->view->setVar('mode', 'search');
     $this->view->setVar('mode_type_singular', $this->searchName('singular'));
     $this->view->setVar('mode_type_plural', $this->searchName('plural'));
     $this->view->setVar('search_history', $this->opo_result_context->getSearchHistory());
     $this->view->setVar('result_context', $this->opo_result_context);
     $this->view->setVar('uses_hierarchy_browser', $this->usesHierarchyBrowser());
     $this->view->setVar('access_values', $va_access_values);
     $this->view->setVar('browse', $po_search);
     $t_display = $this->view->getVar('t_display');
     if (!is_array($va_display_list = $this->view->getVar('display_list'))) {
         $va_display_list = array();
     }
     if ($vs_view == 'editable') {
         $va_initial_data = array();
         $va_row_headers = array();
         $vn_item_count = 0;
         if ($vo_result) {
             $vs_pk = $vo_result->primaryKey();
             while ($vn_item_count < 100 && $vo_result->nextHit()) {
                 $va_result = array('item_id' => $vn_id = $vo_result->get($vs_pk));
                 foreach ($va_display_list as $vn_placement_id => $va_bundle_info) {
                     $va_result[str_replace(".", "-", $va_bundle_info['bundle_name'])] = $t_display->getDisplayValue($vo_result, $vn_placement_id, array('request' => $this->request));
                 }
                 $va_initial_data[] = $va_result;
                 $vn_item_count++;
                 $va_row_headers[] = $vn_item_count . " " . caEditorLink($this->request, caNavIcon($this->request, __CA_NAV_BUTTON_EDIT__), 'caResultsEditorEditLink', $this->ops_tablename, $vn_id);
             }
         }
         $this->view->setVar('initialData', $va_initial_data);
         $this->view->setVar('rowHeaders', $va_row_headers);
     }
     //
     // Bottom line
     //
     $va_bottom_line = array();
     $vb_bottom_line_is_set = false;
     foreach ($va_display_list as $vn_placement_id => $va_placement) {
         if (isset($va_placement['settings']['bottom_line']) && $va_placement['settings']['bottom_line']) {
             $va_bottom_line[$vn_placement_id] = caProcessBottomLineTemplate($this->request, $va_placement, $vo_result, array('pageStart' => ($vn_page_num - 1) * $vn_items_per_page, 'pageEnd' => ($vn_page_num - 1) * $vn_items_per_page + $vn_items_per_page));
             $vb_bottom_line_is_set = true;
         } else {
             $va_bottom_line[$vn_placement_id] = '';
         }
     }
     $this->view->setVar('bottom_line', $vb_bottom_line_is_set ? $va_bottom_line : null);
     switch ($pa_options['output_format']) {
         # ------------------------------------
         case 'LABELS':
             $this->_genLabels($vo_result, $this->request->getParameter("label_form", pString), $vs_search, $vs_search);
             break;
             # ------------------------------------
         # ------------------------------------
         case 'EXPORT':
             $this->_genExport($vo_result, $this->request->getParameter("export_format", pString), $vs_search, $vs_search);
             break;
             # ------------------------------------
         # ------------------------------------
         case 'HTML':
         default:
             // generate type menu and type value list
             if (method_exists($t_model, "getTypeList")) {
                 $this->view->setVar('type_list', $t_model->getTypeList());
             }
             if ($this->opb_uses_hierarchy_browser) {
                 AssetLoadManager::register('hierBrowser');
                 // only for interfaces that use the hierarchy browser
                 $t_list = new ca_lists();
                 if ($vs_type_list_code = $t_model->getTypeListCode()) {
                     $this->view->setVar('num_types', $t_list->numItemsInList($vs_type_list_code));
                     $this->view->setVar('type_menu', $t_list->getListAsHTMLFormElement($vs_type_list_code, 'type_id', array('id' => 'hierTypeList')));
                 }
                 // set last browse id for hierarchy browser
                 $this->view->setVar('browse_last_id', intval($this->request->session->getVar($this->ops_tablename . '_browse_last_id')));
             }
             $this->opo_result_context->setAsLastFind();
             $this->opo_result_context->saveContext();
             if (isset($pa_options['vars']) && is_array($pa_options['vars'])) {
                 foreach ($pa_options['vars'] as $vs_key => $vs_val) {
                     $this->view->setVar($vs_key, $vs_val);
                 }
             }
             if (isset($pa_options['view']) && $pa_options['view']) {
                 $this->render($pa_options['view']);
             } else {
                 $this->render('Search/' . $this->ops_tablename . '_search_basic_html.php');
             }
             break;
             # ------------------------------------
     }
 }
コード例 #23
0
 /**
  * Initializes editor view with core set of values, loads model with record to be edited and selects user interface to use.
  *
  * @param $pa_options Array of options. Supported options are:
  *		ui = The ui_id or editor_code value for the user interface to use. If omitted the default user interface is used.
  */
 protected function _initView($pa_options = null)
 {
     // load required javascript
     AssetLoadManager::register('bundleableEditor');
     AssetLoadManager::register('imageScroller');
     AssetLoadManager::register('datePickerUI');
     $t_subject = $this->opo_datamodel->getInstanceByTableName($this->ops_table_name);
     $vn_subject_id = $this->request->getParameter($t_subject->primaryKey(), pInteger);
     if (!$vn_subject_id || !$t_subject->load($vn_subject_id)) {
         // empty (ie. new) rows don't have a type_id set, which means we'll have no idea which attributes to display
         // so we get the type_id off of the request
         if (!($vn_type_id = $this->request->getParameter($t_subject->getTypeFieldName(), pInteger))) {
             $vn_type_id = null;
         }
         // then set the empty row's type_id
         $t_subject->set($t_subject->getTypeFieldName(), $vn_type_id);
         // then reload the definitions (which includes bundle specs)
         $t_subject->reloadLabelDefinitions();
     } else {
         $vn_type_id = $t_subject->getTypeID();
     }
     $t_ui = $this->_getUI($vn_type_id, $pa_options);
     $this->view->setVar($t_subject->primaryKey(), $vn_subject_id);
     $this->view->setVar('subject_id', $vn_subject_id);
     $this->view->setVar('t_subject', $t_subject);
     MetaTagManager::setWindowTitle(_t("Editing %1 : %2", ($vs_type = $t_subject->getTypeName()) ? $vs_type : $t_subject->getProperty('NAME_SINGULAR'), $vn_subject_id ? $t_subject->getLabelForDisplay(true) : _t('new %1', $t_subject->getTypeName())));
     if ($vs_parent_id_fld = $t_subject->getProperty('HIERARCHY_PARENT_ID_FLD')) {
         $this->view->setVar('parent_id', $vn_parent_id = $this->request->getParameter($vs_parent_id_fld, pInteger));
         // The "above_id" is set when the new record we're creating is to be inserted *above* an existing record (eg. made
         // the parent of another record). It will be set to the record we're inserting above. We ignore it if set when editing
         // an existing record since it is only relevant for newly created records.
         if (!$vn_subject_id) {
             $this->view->setVar('above_id', $vn_above_id = $this->request->getParameter('above_id', pInteger));
             $t_subject->set($vs_parent_id_fld, $vn_parent_id);
             $t_parent = $this->opo_datamodel->getInstanceByTableName($this->ops_table_name);
             if ($t_parent->load($vn_parent_id) && ($t_parent->get('parent_id') || $t_parent->getHierarchyType() == __CA_HIER_TYPE_ADHOC_MONO__) && (!method_exists($t_parent, "getIDNoPlugInInstance") || !($o_numbering_plugin = $t_parent->getIDNoPlugInInstance()) || $o_numbering_plugin->formatHas('FREE', 0))) {
                 $t_subject->set('idno', $t_parent->get('idno'));
             }
         }
         return array($vn_subject_id, $t_subject, $t_ui, $vn_parent_id, $vn_above_id);
     }
     return array($vn_subject_id, $t_subject, $t_ui);
 }
コード例 #24
0
ファイル: SetsController.php プロジェクト: ffarago/pawtucket2
 function setDetail()
 {
     if (!$this->request->isLoggedIn()) {
         $this->response->setRedirect(caNavUrl($this->request, '', 'LoginReg', 'loginForm'));
         return;
     }
     AssetLoadManager::register("mediaViewer");
     $ps_view = $this->request->getParameter('view', pString);
     if (!in_array($ps_view, array('thumbnail', 'timeline', 'timelineData', 'pdf'))) {
         $ps_view = 'thumbnail';
     }
     $this->view->setVar('view', $ps_view);
     $this->view->setVar('views', $this->opo_config->getAssoc("views"));
     if (!($t_set = $this->_getSet(__CA_SET_READ_ACCESS__))) {
         $this->Index();
     }
     $va_set_items = caExtractValuesByUserLocale($t_set->getItems(array("user_id" => $this->request->getUserID(), "thumbnailVersions" => array("medium"), "checkAccess" => $this->opa_access_values)));
     $this->view->setVar("set", $t_set);
     $this->view->setVar("set_items", $va_set_items);
     $va_comments = $t_set->getComments();
     $this->view->setVar("comments", $va_comments);
     $o_context = new ResultContext($this->request, 'ca_objects', 'sets');
     $o_context->setResultList($va_set_ids = $t_set->getItems(array('idsOnly' => true)));
     $o_context->saveContext();
     $o_context->setAsLastFind();
     MetaTagManager::setWindowTitle($this->request->config->get("app_display_name") . ": " . _t("Lightbox") . ": " . $t_set->getLabelForDisplay());
     switch ($ps_view) {
         case 'pdf':
             $qr_res = caMakeSearchResult('ca_objects', $va_set_ids);
             $this->view->setVar('result', $qr_res);
             $this->_genExport($qr_res, '_pdf_checklist', $vs_label = $t_set->get('ca_sets.preferred_labels'), $vs_label);
         case 'timelineData':
             $this->view->setVar('view', 'timeline');
             $this->render("Sets/set_detail_timelineData_json.php");
             break;
         default:
             $this->render("Sets/set_detail_html.php");
             break;
     }
 }
コード例 #25
0
ファイル: pageHeader.php プロジェクト: kai-iak/pawtucket2
	</script>
	
	<script type="text/javascript">window.caBasePath = '<?php 
print $this->request->getBaseUrlPath();
?>
';</script>

	<?php 
print MetaTagManager::getHTML();
?>
	<?php 
print AssetLoadManager::getLoadHTML($this->request);
?>

	<title><?php 
print MetaTagManager::getWindowTitle() ? MetaTagManager::getWindowTitle() : $this->request->config->get("app_display_name");
?>
</title>
	
	<script type="text/javascript">
		jQuery(document).ready(function() {
    		jQuery('#browse-menu').on('click mouseover mouseout mousemove mouseenter',function(e) { e.stopPropagation(); });
    	});
	</script>
<?php 
//
// Pull in JS and CSS for debug bar
//
if (Debug::isEnabled()) {
    $o_debugbar_renderer = Debug::$bar->getJavascriptRenderer();
    $o_debugbar_renderer->setBaseUrl(__CA_URL_ROOT__ . $o_debugbar_renderer->getBaseUrl());
コード例 #26
0
    }
}
print caNavLink($this->request, "<img src='" . $this->request->getThemeUrlPath() . "/graphics/icons/email.png' border='0' title='Email this record'>", "", "Share", "Share", "objectForm", array('object_id' => $vn_object_id));
print "<a href='http://www.facebook.com/sharer.php?u=" . urlencode($this->request->config->get("site_host") . caNavUrl($this->request, "Detail", "Object", "Show", array("object_id" => $vn_object_id))) . "&t=" . urlencode($vs_title) . "'><img src='" . $this->request->getThemeUrlPath() . "/graphics/icons/facebook.png' border='0' title='Share on Facebook'></a>";
?>
			</div><!-- end bottomBar -->
		</div><!-- end leftCol -->

	</div><!-- end detailBody -->
<?php 
require_once __CA_LIB_DIR__ . '/core/Parsers/COinS.php';
print COinS::getTags($t_object);
# -- metatags for facebook sharing
MetaTagManager::addMeta('og:title', $vs_title);
if ($t_rep && $t_rep->getPrimaryKey() && ($vs_media_url = $t_rep->getMediaUrl('media', 'thumbnail'))) {
    MetaTagManager::addMeta('og:image', $vs_media_url);
    MetaTagManager::addLink('image_src', $vs_media_url);
}
if ($vs_description_text) {
    MetaTagManager::addMeta('og:description', $vs_description_text);
}
?>
	<script type="text/javascript">
		jQuery(document).ready(function() {
			jQuery('.scrollPane').jScrollPane({
				
				animateScroll: true,
			});
		});
	</script>
コード例 #27
0
ファイル: Index.php プロジェクト: kai-iak/pawtucket2
<?php

MetaTagManager::setWindowTitle($this->request->config->get("app_display_name") . ": About");
?>
<H1><?php 
print _t("About");
?>
</H1>
<div class="row">
	<div class="col-sm-6 col-md-6">
		<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris dolor purus, facilisis vitae orci at, egestas iaculis turpis. Aliquam ut vestibulum tellus. Nam nec nisi tellus. Phasellus imperdiet risus pulvinar, varius justo sed, egestas turpis. Integer porta tempus lobortis. Ut luctus ac est nec sagittis. Nam aliquam vel ante at blandit. Phasellus neque massa, vulputate a mattis eu, blandit convallis tellus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Ut dignissim dui quam. Duis interdum mauris eget augue scelerisque elementum. Etiam condimentum nibh eget mi rutrum condimentum. Maecenas et cursus urna, quis sollicitudin libero. Donec sit amet augue suscipit, ultricies dolor quis, aliquam magna. Nunc ut hendrerit odio, vitae rutrum sapien.</p>
		<p>Maecenas nec erat cursus, egestas velit pulvinar, ultrices libero. Vivamus viverra sapien risus, et tincidunt ipsum ultrices et. In malesuada, tellus sit amet interdum tincidunt, massa sem laoreet nulla, ac mollis lorem lacus sit amet ipsum. Nullam vel quam leo. Ut et tincidunt nunc. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Interdum et malesuada fames ac ante ipsum primis in faucibus. Nam vel rutrum tortor, sit amet bibendum augue. Nullam nisi leo, imperdiet et feugiat vitae, malesuada nec risus. Cras adipiscing molestie ultrices. Sed quis purus sollicitudin, accumsan nisi in, eleifend mauris. Aliquam erat volutpat.</p>
	</div>
	<div class="col-sm-6 col-md-6">
		<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Mauris dolor purus, facilisis vitae orci at, egestas iaculis turpis. Aliquam ut vestibulum tellus. Nam nec nisi tellus. Phasellus imperdiet risus pulvinar, varius justo sed, egestas turpis. Integer porta tempus lobortis. Ut luctus ac est nec sagittis. Nam aliquam vel ante at blandit. Phasellus neque massa, vulputate a mattis eu, blandit convallis tellus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Ut dignissim dui quam. Duis interdum mauris eget augue scelerisque elementum. Etiam condimentum nibh eget mi rutrum condimentum. Maecenas et cursus urna, quis sollicitudin libero. Donec sit amet augue suscipit, ultricies dolor quis, aliquam magna. Nunc ut hendrerit odio, vitae rutrum sapien.</p>
		<p>Maecenas nec erat cursus, egestas velit pulvinar, ultrices libero. Vivamus viverra sapien risus, et tincidunt ipsum ultrices et. In malesuada, tellus sit amet interdum tincidunt, massa sem laoreet nulla, ac mollis lorem lacus sit amet ipsum. Nullam vel quam leo. Ut et tincidunt nunc. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Interdum et malesuada fames ac ante ipsum primis in faucibus. Nam vel rutrum tortor, sit amet bibendum augue. Nullam nisi leo, imperdiet et feugiat vitae, malesuada nec risus. Cras adipiscing molestie ultrices. Sed quis purus sollicitudin, accumsan nisi in, eleifend mauris. Aliquam erat volutpat.</p>
	</div>
</div>
コード例 #28
0
 function resetSave()
 {
     MetaTagManager::setWindowTitle($this->request->config->get("app_display_name") . ": " . _t("Reset Password"));
     $ps_action = $this->request->getParameter('action', pString);
     if (!$ps_action) {
         $ps_action = "reset";
     }
     $ps_key = $this->request->getParameter('key', pString);
     $ps_key = preg_replace("/[^A-Za-z0-9]+/", "", $ps_key);
     $this->view->setVar("key", $ps_key);
     $this->view->setVar("email", $this->request->config->get("ca_admin_email"));
     $o_check_key = new Db();
     $qr_check_key = $o_check_key->query("\n\t\t\t\tSELECT user_id \n\t\t\t\tFROM ca_users \n\t\t\t\tWHERE\n\t\t\t\t\tmd5(concat(concat(user_id, '/'), password)) = ?\n\t\t\t", $ps_key);
     #
     # Check reset key
     #
     if (!$qr_check_key->nextRow() || !($vs_user_id = $qr_check_key->get("user_id"))) {
         $this->view->setVar("action", "reset_failure");
         $this->view->setVar("message", _t("Your password could not be reset"));
         $this->render('LoginReg/form_reset_html.php');
     } else {
         $ps_password = $this->request->getParameter('password', pString);
         $ps_password_confirm = $this->request->getParameter('password_confirm', pString);
         switch ($ps_action) {
             case 'reset_save':
                 if (!$ps_password || !$ps_password_confirm) {
                     $this->view->setVar("message", _t("Please enter and re-type your password."));
                     $ps_action = "reset";
                     break;
                 }
                 if ($ps_password != $ps_password_confirm) {
                     $this->view->setVar("message", _t("Passwords do not match. Please try again."));
                     $ps_action = "reset";
                     break;
                 }
                 $t_user = new ca_users();
                 $t_user->purify(true);
                 $t_user->load($vs_user_id);
                 # verify user exists with this e-mail address
                 if ($t_user->getPrimaryKey()) {
                     # user with e-mail already exists...
                     $t_user->setMode(ACCESS_WRITE);
                     $t_user->set("password", $ps_password);
                     $t_user->update();
                     if ($t_user->numErrors()) {
                         $this->notification->addNotification(join("; ", $t_user->getErrors()), __NOTIFICATION_TYPE_INFO__);
                         $ps_action = "reset_failure";
                     } else {
                         $ps_action = "reset_success";
                         $o_view = new View($this->request, array($this->request->getViewsDirectoryPath()));
                         # -- generate email subject
                         $vs_subject_line = $o_view->render("mailTemplates/notification_subject.tpl");
                         # -- generate mail text from template - get both the html and text versions
                         $vs_mail_message_text = $o_view->render("mailTemplates/notification.tpl");
                         $vs_mail_message_html = $o_view->render("mailTemplates/notification_html.tpl");
                         caSendmail($t_user->get('email'), $this->request->config->get("ca_admin_email"), $vs_subject_line, $vs_mail_message_text, $vs_mail_message_html);
                     }
                     break;
                 } else {
                     $this->notification->addNotification(_t("Invalid user"), __NOTIFICATION_TYPE_INFO__);
                     $ps_action = "reset_failure";
                 }
         }
         $this->view->setVar("action", $ps_action);
         $this->render('LoginReg/form_reset_html.php');
     }
 }
コード例 #29
0
        $htmlChart = str_ireplace("^type", $va_parameters['selectedChartingType'], $htmlChart);
    } else {
        // Missing parameters, printing an error message
        print _t("<p>Charting class defined in the conf file requires other parameters : " . $charting_class . " - " . implode(", ", $chart->returnRequiredParameters()) . "</p>\n");
    }
} else {
    // No chart
    $htmlChart = "";
}
// Content creation : TABLE
if ($va_table_width) {
    $htmlTable .= renderStatisticsTable($va_sql['result'], $va_informations->columns, $va_informations->charting_columns, $va_informations->total_columns);
}
//If chart goes first
if ($va_firstElement == "chart") {
    $first = $htmlChart;
    $second = $htmlTable;
} else {
    $first = $htmlTable;
    $second = $htmlChart;
}
// Final print
// Printing statistics title & comment
print "<h2>" . $va_informations->title . "</h2>";
print "<p>" . $va_informations->comment . "</p>";
// Include the CSS for the options drop-down form, then add the options drop-down form
MetaTagManager::addLink('stylesheet', __CA_URL_ROOT__ . "/app/plugins/statisticsViewer/css/statisticsViewer.css", 'text/css');
print renderOptions($va_views_images_path, $va_informations->id, $va_parameters['positions'], $va_parameters['selectedPosition'], $va_parameters['ChartTypes'], $va_parameters['selectedChartingType']);
print "<div class=\"divide\"><!-- empty --></div>\n";
print ($va_sidebyside == "yes" ? "<div style=\"float:left;width:" . $va_table_width . "px;\">" : "<div>\n") . $first . "</div>\n" . ($va_sidebyside == "yes" ? "<div style=\"float:left;width:" . $va_table_width . "px;\">" : "<div>\n") . $second . "</div>";
print "\t<div class=\"editorBottomPadding\"><!-- empty --></div>\n" . "<div class=\"clear\"><!--empty--></div>";
コード例 #30
0
ファイル: About.php プロジェクト: kai-iak/pawtucket2
<?php

MetaTagManager::setWindowTitle($this->request->config->get("app_display_name") . ": Competence Standards");
?>
<div class="container blueBox">
	<div class="row">
		<div class="col-sm-12">
			<p>
				All of the materials provided via this Body of Knowledge portal are keyed to the global competence standards defined in the IUCN WCPA Capacity Development Tools. Thus, understanding the competence framework is critical to effectively using the portal.
			</p><br/>
		</div><!-- end col -->
		<div class="col-sm-6 text-right">
			<a href="<?php 
print caGetThemeGraphicUrl($this->request, 'CompetenceUserGuide_V2_WPC_Nov2014.pdf');
?>
"><button type="button" class="btn btn-blue"><span class="glyphicon glyphicon-download-alt"></span> Competence Standards Handbook</button></a>
		</div>
		<div class="col-sm-6 text-left">
			<a href="<?php 
print caGetThemeGraphicUrl($this->request, 'DraftPACompetenceRegisterNov2014forWPC_LOCKED.xlsx');
?>
"><button type="button" class="btn btn-blue"><span class="glyphicon glyphicon-download-alt"></span> Competence Standards Registry</button></a>
		</div>
	</div><!-- end row -->
</div><!-- end bluebox -->
<div class="container containerTextPadding">
	<div class="row">
		<div class="col-sm-6">
			<p>
				<strong>Competence</strong> is the proven ability to do a job; it is often defined in terms of the required combination of skills, knowledge and attitude. <strong>Skills</strong> ensure the ability to perform a task reliably and consistently, <strong>knowledge</strong> provides an understanding of the technical and theoretical background to the task and an appreciation of its purpose; and having the right <strong>attitude</strong> helps ensure than an individual works professionally, ethically and conscientiously. <strong>Competence</strong> focuses primarily on the actual ability of individuals to perform in their jobs effectively, rather than on delivery of training and acquisition of qualifications.
			</p>