当前位置: 首页>>代码示例>>PHP>>正文


PHP caGetOption函数代码示例

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


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

示例1: setSettingsFromHTMLForm

 /**
  * Sets and saves form element settings, taking parameters off of the request as needed. Does an update()
  * on the ca_search_forms instance to save settings to the database
  */
 public function setSettingsFromHTMLForm($po_request, $pa_options = null)
 {
     $va_locales = ca_locales::getLocaleList(array('sort_field' => '', 'sort_order' => 'asc', 'index_by_code' => true, 'available_for_cataloguing_only' => true));
     $va_available_settings = $this->getAvailableSettings();
     $this->o_instance->setMode(ACCESS_WRITE);
     $va_values = array();
     $vs_id_prefix = caGetOption('id', $pa_options, 'setting');
     $vs_placement_code = caGetOption('placement_code', $pa_options, '');
     foreach (array_keys($va_available_settings) as $vs_setting) {
         $va_properties = $va_available_settings[$vs_setting];
         if (isset($va_properties['takesLocale']) && $va_properties['takesLocale']) {
             foreach ($va_locales as $vs_locale => $va_locale_info) {
                 $va_values[$vs_setting][$va_locale_info['locale_id']] = $po_request->getParameter("{$vs_placement_code}{$vs_id_prefix}{$vs_setting}_{$vs_locale}", pString);
             }
         } else {
             if (isset($va_properties['useRelationshipTypeList']) && $va_properties['useRelationshipTypeList'] && $va_properties['height'] > 1 || isset($va_properties['useList']) && $va_properties['useList'] && $va_properties['height'] > 1 || isset($va_properties['showLists']) && $va_properties['showLists'] && $va_properties['height'] > 1 || isset($va_properties['showVocabularies']) && $va_properties['showVocabularies'] && $va_properties['height'] > 1) {
                 $va_values[$vs_setting] = $po_request->getParameter("{$vs_placement_code}{$vs_id_prefix}{$vs_setting}", pArray);
             } else {
                 $va_values = array($vs_setting => $po_request->getParameter("{$vs_placement_code}{$vs_id_prefix}{$vs_setting}", pString));
             }
         }
         foreach ($va_values as $vs_setting_key => $vs_value) {
             $this->setSetting($vs_setting, $vs_value);
         }
     }
     return true;
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:31,代码来源:ApplicationToolSettings.php

示例2: read

 /**
  * 
  * 
  * @param string $ps_source MySQL URL
  * @param array $pa_options
  * @return bool
  */
 public function read($ps_source, $pa_options = null)
 {
     parent::read($ps_source, $pa_options);
     # mysql://username:password@localhost/database?table=tablename
     # or limit the query using
     # mysql://username:password@localhost/database?table=tablename&limit=100&offset=10
     $va_url = parse_url($ps_source);
     try {
         $vs_db = substr($va_url['path'], 1);
         $this->opo_handle = new Db(null, array("username" => $va_url['user'], "password" => $va_url['pass'], "host" => $va_url['host'], "database" => $vs_db, "type" => 'mysql'));
         $this->opn_current_row = 0;
         parse_str($va_url['query'], $va_path);
         $this->ops_table = $va_path['table'];
         if (!$this->ops_table) {
             return false;
         }
         $vn_limit = caGetOption('limit', $va_path, 0, array('castTo' => 'int'));
         $vn_offset = caGetOption('offset', $va_path, 0, array('castTo' => 'int'));
         $vs_limit = $vn_limit ? " LIMIT " . ($vn_offset ? "{$vn_offset}, {$vn_limit}" : $vn_limit) : "";
         $this->opo_rows = $this->opo_handle->query("SELECT * FROM {$this->ops_table}{$vs_limit}");
     } catch (Exception $e) {
         return false;
     }
     return true;
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:32,代码来源:MySQLDataReader.php

示例3: processExport

 public function processExport($pa_data, $pa_options = array())
 {
     if (!caGetOption('singleRecord', $pa_options, true)) {
         throw new Exception("The ExifTool exporter does not support exporting multiple records");
     }
     $o_rdf = $this->getDom()->createElementNS('http://www.w3.org/1999/02/22-rdf-syntax-ns#', 'rdf:RDF');
     $this->getDom()->appendChild($o_rdf);
     $o_desc = $this->getDom()->createElement('rdf:Description');
     $o_rdf->appendChild($o_desc);
     // add full range of exiftool namespaces
     foreach ($this->opa_namespaces as $vs_ns_key => $vs_ns_url) {
         $o_desc->setAttributeNS('http://www.w3.org/2000/xmlns/', $vs_ns_key, $vs_ns_url);
     }
     $o_desc->setAttribute('et:toolkit', 'CollectiveAccess ExifTool Exporter');
     $this->log("ExifTool export formatter: Now processing export tree ...");
     foreach ($pa_data as $va_element) {
         if (!isset($va_element['element']) || !$va_element['element'] || !isset($va_element['text']) || !$va_element['text']) {
             $this->log("ExifTool export formatter: Skipped row because either element or text was empty. Element in tree was:");
             $this->log(print_r($va_element, true));
             continue;
         }
         $o_element = $this->getDom()->createElement($va_element['element'], $va_element['text']);
         $o_desc->appendChild($o_element);
     }
     $this->log("ExifTool export formatter: Done processing export tree ...");
     return $this->getDom()->saveXML();
 }
开发者ID:samrahman,项目名称:providence,代码行数:27,代码来源:ExportExifTool.php

示例4: load

 /**
  *
  *
  * @param string $ps_cache_key
  * @param array $pa_options Options include:
  *		removeDeletedItems = remove any items in the cache that are currently marked as deleted [Default=true]
  *
  * @return bool
  */
 public function load($ps_cache_key, $pa_options = null)
 {
     if (ExternalCache::contains($ps_cache_key, 'Browse')) {
         $this->opa_browse = ExternalCache::fetch($ps_cache_key, 'Browse');
         $this->ops_cache_key = $ps_cache_key;
         if (caGetOption('removeDeletedItems', $pa_options, true)) {
             $o_dm = Datamodel::load();
             if (($t_instance = $o_dm->getInstanceByTableNum($this->opa_browse['params']['table_num'], true)) && $t_instance->hasField('deleted')) {
                 // check if there are any deleted items in the cache
                 if (is_array($va_ids = $this->opa_browse['results']) && sizeof($va_ids)) {
                     $vs_pk = $t_instance->primaryKey();
                     $qr_deleted = $t_instance->getDb()->query($x = "\n\t\t\t\t\t\t\tSELECT {$vs_pk} FROM " . $t_instance->tableName() . " WHERE {$vs_pk} IN (?) AND deleted = 1\n\t\t\t\t\t\t", array($va_ids));
                     if ($qr_deleted->numRows() > 0) {
                         $va_deleted_ids = $qr_deleted->getAllFieldValues($vs_pk);
                         foreach ($va_deleted_ids as $vn_deleted_id) {
                             if (($vn_i = array_search($vn_deleted_id, $va_ids)) !== false) {
                                 unset($va_ids[$vn_i]);
                             }
                         }
                         $this->opa_browse['results'] = array_values($va_ids);
                     }
                 }
             }
         }
         return true;
     }
     return false;
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:37,代码来源:BrowseCache.php

示例5: getDisplayValue

 /**
  * Options:
  * 		rawDate - if true, returns date as an array of start and end historic timestames
  *		sortable - if true a language-independent sortable representation is returned.
  *		getDirectDate - get underlying historic timestamp (floatval)
  */
 public function getDisplayValue($pa_options = null)
 {
     if (!is_array($pa_options)) {
         $pa_options = array();
     }
     if (isset($pa_options['rawDate']) && $pa_options['rawDate']) {
         return array(0 => $this->opn_start_date, 1 => $this->opn_end_date, 'start' => $this->opn_start_date, 'end' => $this->opn_end_date);
     }
     if (caGetOption('GET_DIRECT_DATE', $pa_options, false) || caGetOption('getDirectDate', $pa_options, false)) {
         return $this->opn_start_date;
     }
     if (isset($pa_options['sortable']) && $pa_options['sortable']) {
         if (!$this->opn_start_date || !$this->opn_end_date) {
             return null;
         }
         return $this->opn_start_date . '/' . $this->opn_end_date;
     }
     $o_config = Configuration::load();
     $o_date_config = Configuration::load($o_config->get('datetime_config'));
     if ($o_date_config->get('dateFormat') == 'original') {
         return $this->ops_text_value;
     } else {
         $t_element = new ca_metadata_elements($this->getElementID());
         $va_settings = $this->getSettingValuesFromElementArray($t_element->getFieldValuesArray(), array('isLifespan'));
         $o_tep = new TimeExpressionParser();
         $o_tep->setHistoricTimestamps($this->opn_start_date, $this->opn_end_date);
         return $o_tep->getText(array_merge(array('isLifespan' => $va_settings['isLifespan']), $pa_options));
         //$this->ops_text_value;
     }
 }
开发者ID:kai-iak,项目名称:pawtucket2,代码行数:36,代码来源:DateRangeAttributeValue.php

示例6: dispatchLoopShutdown

 public function dispatchLoopShutdown()
 {
     //
     // Force output to be sent - we need the client to have the page before
     // we start flushing progress bar updates
     //
     $app = AppController::getInstance();
     $req = $app->getRequest();
     $resp = $app->getResponse();
     $resp->sendResponse();
     $resp->clearContent();
     //
     // Do batch processing
     //
     if ($req->isLoggedIn()) {
         set_time_limit(3600 * 24);
         // if it takes more than 24 hours we're in trouble
         if (isset($_FILES['sourceFile']['tmp_name']) && $_FILES['sourceFile']['tmp_name']) {
             $vs_input = $_FILES['sourceFile']['tmp_name'];
         } elseif (!($vs_input = $req->getParameter('sourceUrl', pString))) {
             $vs_input = $req->getParameter('sourceText', pString);
         }
         $vs_file_input = caGetOption('fileInput', $this->opa_options, null);
         $vs_base_import_dir = $req->config->get('batch_media_import_root_directory');
         $vs_file_import_directory = caGetOption('fileImportPath', $this->opa_options, null);
         if ($vs_file_input === 'import' && is_dir($vs_base_import_dir . '/' . $vs_file_import_directory)) {
             // grab files from import directory
             $vs_input = $vs_base_import_dir . '/' . $vs_file_import_directory;
         }
         $va_errors = BatchProcessor::importMetadata($req, $vs_input, $req->getParameter('importer_id', pInteger), $req->getParameter('inputFormat', pString), array_merge($this->opa_options, array('progressCallback' => 'caIncrementBatchMetadataImportProgress', 'reportCallback' => 'caUpdateBatchMetadataImportResultsReport')));
     }
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:32,代码来源:BatchMetadataImportProgress.php

示例7: render

 /**
  * Generate maps output in specified format
  *
  * @param array $pa_viz_settings Array of visualization settings taken from visualization.conf
  * @param string $ps_format Specifies format to generate output in. Currently only 'HTML' is supported.
  * @param array $pa_options Array of options to use when rendering output. Supported options are:
  *		width =
  *		height =
  *		mapType - type of map to render; valid values are 'ROADMAP', 'SATELLITE', 'HYBRID', 'TERRAIN'; if not specified 'google_maps_default_type' setting in app.conf is used; if that is not set default is 'SATELLITE'
  *		showNavigationControls - if true, navigation controls are displayed; default is to use 'google_maps_show_navigation_controls' setting in app.conf
  *		showScaleControls -  if true, scale controls are displayed; default is to use 'google_maps_show_scale_controls' setting in app.conf
  *		showMapTypeControls -  if true, map type controls are displayed; default is to use 'google_maps_show_map_type_controls' setting in app.conf
  *		minZoomLevel - Minimum zoom level to allow; leave null if you don't want to enforce a limit
  *		maxZoomLevel - Maximum zoom level to allow; leave null if you don't want to enforce a limit
  *		zoomLevel - Zoom map to specified level rather than fitting all markers into view; leave null if you don't want to specify a zoom level. IF this option is set minZoomLevel and maxZoomLevel will be ignored.
  *		pathColor - 
  *		pathWeight -
  *		pathOpacity - 
  *		request = current request; required for generation of editor links
  */
 public function render($pa_viz_settings, $ps_format = 'HTML', $pa_options = null)
 {
     if (!($vo_data = $this->getData())) {
         return null;
     }
     $po_request = isset($pa_options['request']) && $pa_options['request'] ? $pa_options['request'] : null;
     list($vs_width, $vs_height) = $this->_parseDimensions(caGetOption('width', $pa_options, 500), caGetOption('height', $pa_options, 500));
     $o_map = new GeographicMap($vs_width, $vs_height, $pa_options['id']);
     $this->opn_num_items_rendered = 0;
     foreach ($pa_viz_settings['sources'] as $vs_source_code => $va_source_info) {
         $vs_color = $va_source_info['color'];
         if (method_exists($vo_data, "seek")) {
             $vo_data->seek(0);
         }
         $va_opts = array('renderLabelAsLink' => false, 'request' => $po_request, 'color' => $vs_color);
         $va_opts['labelTemplate'] = $va_source_info['display']['title_template'];
         if (isset($va_source_info['display']['ajax_content_url']) && $va_source_info['display']['ajax_content_url']) {
             $va_opts['ajaxContentUrl'] = $va_source_info['display']['ajax_content_url'];
         } else {
             $va_opts['contentTemplate'] = $va_source_info['display']['description_template'];
         }
         $va_ret = $o_map->mapFrom($vo_data, $va_source_info['data'], $va_opts);
         if (is_array($va_ret) && isset($va_ret['items'])) {
             $this->opn_num_items_rendered += (int) $va_ret['items'];
         }
     }
     return $o_map->render($ps_format, $pa_options);
 }
开发者ID:kai-iak,项目名称:pawtucket2,代码行数:48,代码来源:Map.php

示例8: __call

 public function __call($ps_function, $pa_args)
 {
     $ps_function = strtolower($ps_function);
     if (!($va_form_info = $this->_checkForm($ps_function))) {
         return;
     }
     $this->view->setVar('t_subject', $t_subject = $this->pt_subject);
     $va_tags = $this->view->getTagList($va_form_info['view']);
     foreach ($va_tags as $vs_tag) {
         if (in_array($vs_tag, array('form', '/form', 'submit', 'reset'))) {
             continue;
         }
         $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='caContributeFormSubmit'>" . (isset($va_opts['label']) && $va_opts['label'] ? $va_opts['label'] : _t('Submit')) . "</a>");
                 break;
             case 'reset':
                 $this->view->setVar($vs_tag, "<a href='#' class='caContributeFormReset'>" . (isset($va_opts['label']) && $va_opts['label'] ? $va_opts['label'] : _t('Reset')) . "</a>");
                 $vs_script = "<script type='text/javascript'>\n\tjQuery('.caContributeFormSubmit').bind('click', function() {\n\t\tjQuery('#caContribute').submit();\n\t\treturn false;\n\t});\n\tjQuery('.caContributeFormReset').bind('click', function() {\n\t\tjQuery('#caContribute').find('input[type!=\"hidden\"],textarea').val('');\n\t\tjQuery('#caContribute').find('select.caContributeBoolean').val('AND');\n\t\tjQuery('#caContribute').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+ '\"].caContributeBoolean').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]));
                 } else {
                     $va_opts['asArrayElement'] = true;
                     if ($vs_tag_val = $t_subject->htmlFormElementForSimpleForm($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, "Send", 'caContribute', null, 'post', 'multipart/form-data', '_top', array('disableUnsavedChangesWarning' => true)));
     $this->view->setVar("/form", $vs_script . caHTMLHiddenInput("_contributeFormName", array("value" => $ps_function)) . caHTMLHiddenInput("_formElements", array("value" => join(';', $va_form_elements))) . caHTMLHiddenInput("_contribute", array("value" => 1)) . "</form>");
     $this->render($va_form_info['view']);
 }
开发者ID:ffarago,项目名称:pawtucket2,代码行数:58,代码来源:ContributeController.php

示例9: getRepresentationChooserHTMLFormBundle

 /**
  * Returns HTML bundle for picking representations to attach to an object-* relationship
  *
  * @param object $po_request The current request
  * @param $ps_form_name The name of the HTML form this bundle will be part of
  *
  * @return string HTML for bundle
  */
 public function getRepresentationChooserHTMLFormBundle($po_request, $ps_form_name, $ps_placement_code, $pa_bundle_settings, $pa_options = null)
 {
     $o_view = new View($po_request, $po_request->getViewsDirectoryPath() . '/bundles/');
     $o_view->setVar('lookup_urls', caJSONLookupServiceUrl($po_request, $this->getAppDatamodel()->getTableName($this->get('table_num'))));
     $o_view->setVar('t_subject', $this);
     $vn_object_id = $this->getLeftTableName() == 'ca_objects' ? $this->get($this->getLeftTableFieldName()) : $this->get($this->getRightTableFieldName());
     $o_view->setVar('t_object', $t_object = new ca_objects($vn_object_id));
     $o_view->setVar('id_prefix', $ps_form_name);
     $o_view->setVar('placement_code', $ps_placement_code);
     $o_view->setVar('element_code', caGetOption(array('elementCode', 'element_code'), $pa_bundle_settings, null));
     $o_view->setVar('settings', $pa_bundle_settings);
     return $o_view->render('ca_object_representation_chooser_html.php');
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:21,代码来源:ObjectRelationshipBaseModel.php

示例10: read

 /**
  * 
  * 
  * @param string $ps_source
  * @param array $pa_options Options include
  *		dataset = number of worksheet to read [Default=0]
  * @return bool
  */
 public function read($ps_source, $pa_options = null)
 {
     parent::read($ps_source, $pa_options);
     try {
         $this->opo_handle = PHPExcel_IOFactory::load($ps_source);
         $this->opo_handle->setActiveSheetIndex(caGetOption('dataset', $pa_options, 0));
         $o_sheet = $this->opo_handle->getActiveSheet();
         $this->opo_rows = $o_sheet->getRowIterator();
         $this->opn_current_row = 0;
     } catch (Exception $e) {
         return false;
     }
     return true;
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:22,代码来源:ExcelDataReader.php

示例11: getDisplayValue

 /**
  * Returns value suitable for display
  *
  * @param $pa_options array Options are:
  *		returnAsDecimal = return duration in seconds as decimal number
  *
  * @return mixed Values as string or decimal
  */
 public function getDisplayValue($pa_options = null)
 {
     if (caGetOption('returnAsDecimal', $pa_options, false)) {
         return (double) $this->opn_duration;
     }
     if (!strlen($this->opn_duration)) {
         return '';
     }
     $o_tcp = new TimecodeParser();
     $o_tcp->setParsedValueInSeconds($this->opn_duration);
     $o_config = Configuration::load();
     if (!($vs_format = $o_config->get('timecode_output_format'))) {
         $vs_format = 'HOURS_MINUTES_SECONDS';
     }
     return $o_tcp->getText($vs_format);
 }
开发者ID:guaykuru,项目名称:pawtucket,代码行数:24,代码来源:TimeCodeAttributeValue.php

示例12: __construct

 /**
  * @param $ps_plugin_code string Code of plugin to use for rendering. If omitted the first available plugin is used.
  */
 public function __construct($ps_plugin_code = null)
 {
     $this->renderer = null;
     $va_available_plugins = PDFRenderer::getAvailablePDFRendererPlugins();
     if ($ps_plugin_code && in_array($ps_plugin_code, $va_available_plugins)) {
         $this->renderer = $this->getPDFRendererPlugin($ps_plugin_code);
     }
     if (!$this->renderer) {
         foreach ($va_available_plugins as $vs_plugin_code) {
             if ($o_renderer = $this->getPDFRendererPlugin($vs_plugin_code)) {
                 $va_status = $o_renderer->checkStatus();
                 if (caGetOption('available', $va_status, false)) {
                     $this->renderer = $o_renderer;
                     break;
                 }
             }
         }
     }
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:22,代码来源:PDFRenderer.php

示例13: __construct

 /**
  *
  */
 public function __construct($po_request, $pm_path = null, $ps_character_encoding = 'UTF8', $pa_options = null)
 {
     parent::__construct();
     $this->opo_request = $po_request;
     $this->opa_view_paths = array();
     $this->opa_view_vars = array();
     $this->opo_appconfig = Configuration::load();
     $this->ops_character_encoding = $ps_character_encoding;
     if (!$pm_path) {
         $pm_path = array();
     }
     $vs_suffix = null;
     if (!is_array($pm_path)) {
         $pm_path = array($pm_path);
     }
     foreach ($pm_path as $ps_path) {
         // Preserve any path suffix after "views"
         // Eg. if path is /web/myinstall/themes/mytheme/views/bundles then we want to retain "/bundles" on the default path
         $va_suffix_bits = array();
         $va_tmp = array_reverse(explode("/", $ps_path));
         foreach ($va_tmp as $vs_path_element) {
             if ($vs_path_element == 'views') {
                 break;
             }
             array_push($va_suffix_bits, $vs_path_element);
         }
         if ($vs_suffix = join("/", $va_suffix_bits)) {
             $vs_suffix = '/' . $vs_suffix;
             break;
         }
     }
     if (caGetOption('includeDefaultThemePath', $pa_options, true)) {
         $vs_default_theme_path = $po_request->getDefaultThemeDirectoryPath() . '/views' . $vs_suffix;
         if (!in_array($vs_default_theme_path, $pm_path) && !in_array($vs_default_theme_path . '/', $pm_path)) {
             array_unshift($pm_path, $vs_default_theme_path);
         }
     }
     if (sizeof($pm_path) > 0) {
         $this->setViewPath($pm_path);
     }
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:44,代码来源:View.php

示例14: getDisplayValue

 /**
  * Options:
  * 		rawDate - if true, returns date as an array of start and end historic timestames
  *		sortable - if true a language-independent sortable representation is returned.
  *		getDirectDate - get underlying historic timestamp (floatval)
  */
 public function getDisplayValue($pa_options = null)
 {
     if (!is_array($pa_options)) {
         $pa_options = array();
     }
     if (isset($pa_options['rawDate']) && $pa_options['rawDate']) {
         return array(0 => $this->opn_start_date, 1 => $this->opn_end_date, 'start' => $this->opn_start_date, 'end' => $this->opn_end_date);
     }
     if (caGetOption('GET_DIRECT_DATE', $pa_options, false) || caGetOption('getDirectDate', $pa_options, false)) {
         return $this->opn_start_date;
     }
     if (isset($pa_options['sortable']) && $pa_options['sortable']) {
         if (!$this->opn_start_date || !$this->opn_end_date) {
             return null;
         }
         return $this->opn_start_date . '/' . $this->opn_end_date;
     }
     $o_date_config = Configuration::load(__CA_CONF_DIR__ . '/datetime.conf');
     $vs_date_format = $o_date_config->get('dateFormat');
     $vs_cache_key = md5($vs_date_format . $this->opn_start_date . $this->opn_end_date);
     // pull from cache
     if (isset(DateRangeAttributeValue::$s_date_cache[$vs_cache_key])) {
         return DateRangeAttributeValue::$s_date_cache[$vs_cache_key];
     }
     // if neither start nor end date are set, the setHistoricTimestamps() call below will
     // fail and the TEP will return the text for whatever happened to be parsed previously
     // so we have to init() before trying
     DateRangeAttributeValue::$o_tep->init();
     if ($vs_date_format == 'original') {
         return DateRangeAttributeValue::$s_date_cache[$vs_cache_key] = $this->ops_text_value;
     } else {
         if (!is_array($va_settings = MemoryCache::fetch($this->getElementID(), 'ElementSettings'))) {
             $t_element = new ca_metadata_elements($this->getElementID());
             $va_settings = MemoryCache::fetch($this->getElementID(), 'ElementSettings');
         }
         DateRangeAttributeValue::$o_tep->setHistoricTimestamps($this->opn_start_date, $this->opn_end_date);
         return DateRangeAttributeValue::$s_date_cache[$vs_cache_key] = DateRangeAttributeValue::$o_tep->getText(array_merge(array('isLifespan' => $va_settings['isLifespan']), $pa_options));
         //$this->ops_text_value;
     }
 }
开发者ID:samrahman,项目名称:providence,代码行数:46,代码来源:DateRangeAttributeValue.php

示例15: processExport

 public function processExport($pa_data, $pa_options = array())
 {
     $pb_single_record = caGetOption('singleRecord', $pa_options);
     //$pb_rdf_mode = caGetOption('rdfMode', $pa_options);
     $pb_strip_cdata = (bool) caGetOption('stripCDATA', $pa_options['settings'], false);
     //caDebug($pa_data,"Data to build XML from");
     $this->log("XML export formatter: Now processing export tree ...");
     // XML exports should usually have only one top-level element (i.e. one root).
     if (sizeof($pa_data) != 1) {
         return false;
     }
     $this->processItem(array_pop($pa_data), $this->opo_dom);
     $this->log(_t("XML export formatter: Done processing export tree ..."));
     // when dealing with a record set export, we don't want <?xml tags in front of each record
     // that way we can simply dump a sequence of records in a file and have well-formed XML as result
     $vs_return = $pb_single_record ? $this->opo_dom->saveXML() : $this->opo_dom->saveXML($this->opo_dom->firstChild);
     if ($pb_strip_cdata) {
         $vs_return = str_replace('<![CDATA[', '', $vs_return);
         $vs_return = str_replace(']]>', '', $vs_return);
     }
     return $vs_return;
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:22,代码来源:ExportXML.php


注:本文中的caGetOption函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。