コード例 #1
0
</h2>
<?php 
        foreach ($va_comments as $va_comment) {
            if ($va_comment["media1"]) {
                ?>
						<div class="commentImage" id="commentMedia<?php 
                print $va_comment["comment_id"];
                ?>
">
							<?php 
                print $va_comment["media1"]["tiny"]["TAG"];
                ?>
							
						</div><!-- end commentImage -->
<?php 
                TooltipManager::add("#commentMedia" . $va_comment["comment_id"], $va_comment["media1"]["large_preview"]["TAG"]);
            }
            if ($va_comment["comment"]) {
                ?>
					
					<div class="comment">
						<?php 
                print $va_comment["comment"];
                ?>
					</div>
<?php 
            }
            ?>
					
					<div class="byLine">
						<?php 
コード例 #2
0
ファイル: displayHelpers.php プロジェクト: kai-iak/providence
/**
 * Generates standard-format inspector panels for editors
 *
 * @param View $po_view Inspector view object
 * @param array $pa_options Optional array of options. Supported options are:
 *		backText = a string to use as the "back" button text; default is "Results"
 *
 * @return string HTML implementing the inspector
 */
function caBatchEditorInspector($po_view, $pa_options = null)
{
    require_once __CA_MODELS_DIR__ . '/ca_sets.php';
    $t_set = $po_view->getVar('t_set');
    $t_item = $po_view->getVar('t_item');
    $vs_table_name = $t_item->tableName();
    if (($vs_priv_table_name = $vs_table_name) == 'ca_list_items') {
        $vs_priv_table_name = 'ca_lists';
    }
    $o_result_context = $po_view->getVar('result_context');
    $t_ui = $po_view->getVar('t_ui');
    $o_dm = Datamodel::load();
    // action extra to preserve currently open screen across next/previous links
    //$vs_screen_extra 	= ($po_view->getVar('screen')) ? '/'.$po_view->getVar('screen') : '';
    $vs_buf = '<h3 class="nextPrevious">' . caNavLink($po_view->request, 'Back', '', 'manage', 'Set', 'ListSets') . "</h3>\n";
    $vs_color = $vs_type_name = null;
    $t_type = method_exists($t_item, "getTypeInstance") ? $t_item->getTypeInstance() : null;
    if ($t_type) {
        $vs_color = trim($t_type->get('color'));
        $vs_type_name = $t_type->getTypeName();
    }
    if (!$vs_color && $t_ui) {
        $vs_color = trim($t_ui->get('color'));
    }
    if (!$vs_color) {
        $vs_color = "444444";
    }
    $vs_buf .= "<h4><div id='caColorbox' style='border: 6px solid #{$vs_color}; padding-bottom:15px;'>\n";
    if ($po_view->request->user->canDoAction("can_edit_" . $vs_priv_table_name) && sizeof($t_item->getTypeList()) > 1) {
        if ($po_view->request->user->canDoAction("can_change_type_{$vs_table_name}")) {
            $vs_buf .= "<div id='inspectorChangeType'><div id='inspectorChangeTypeButton'><a href='#' onclick='caTypeChangePanel.showPanel(); return false;'>" . caNavIcon($po_view->request, __CA_NAV_BUTTON_CHANGE__, array('title' => _t('Change type'))) . "</a></div></div>\n";
            TooltipManager::add("#inspectorChangeType", _t('Change Record Type'));
            $vo_change_type_view = new View($po_view->request, $po_view->request->getViewsDirectoryPath() . "/bundles/");
            $vo_change_type_view->setVar('t_item', $t_item);
            $vo_change_type_view->setVar('t_set', $t_set);
            $vo_change_type_view->setVar('set_id', $t_set->getPrimaryKey());
            FooterManager::add($vo_change_type_view->render("batch_change_type_html.php"));
        }
        $vs_buf .= "<strong>" . _t("Editing %1", $vs_type_name) . ": </strong>\n";
    } else {
        $vs_buf .= "<strong>" . _t("Viewing %1", $vs_type_name) . ": </strong>\n";
    }
    $vn_item_count = $t_set->getItemCount(array('user_id' => $po_view->request->getUserID()));
    $vs_item_name = $vn_item_count == 1 ? $t_item->getProperty("NAME_SINGULAR") : $t_item->getProperty("NAME_PLURAL");
    $vs_buf .= "<strong>" . _t("Batch editing %1 %2 in set", $vn_item_count, $vs_item_name) . ": </strong>\n";
    if (!($vs_label = $t_set->getLabelForDisplay())) {
        if (!($vs_label = $t_set->get('set_code'))) {
            $vs_label = '[' . _t('BLANK') . ']';
        }
    }
    if ($t_set->haveAccessToSet($po_view->request->getUserID(), __CA_SET_EDIT_ACCESS__)) {
        $vs_label = caEditorLink($po_view->request, $vs_label, '', 'ca_sets', $t_set->getPrimaryKey());
    }
    $vs_buf .= " {$vs_label}" . "<a title='{$vs_idno}'>" . ($vs_idno ? " ({$vs_idno})" : '') . "</a>\n";
    // -------------------------------------------------------------------------------------
    $vs_buf .= "<div>" . _t('Set contains <em>%1</em>', join(", ", $t_set->getTypesForItems())) . "</div>\n";
    // -------------------------------------------------------------------------------------
    // Nav link for batch delete
    // -------------------------------------------------------------------------------------
    if ($vn_item_count > 0 && $po_view->request->user->canDoAction('can_batch_delete_' . $o_dm->getTableName($t_set->get('table_num')))) {
        $vs_buf .= "<div class='button' style='text-align:right;'><a href='#' id='inspectorMoreInfo'>" . _t("More options") . "</a> &rsaquo;</div>\n\t\t\t\t<div id='inspectorInfo' style='background-color:#f9f9f9; border: 1px solid #eee;'>";
        $vs_buf .= caNavLink($po_view->request, caNavIcon($po_view->request, __CA_NAV_BUTTON_DEL_BUNDLE__, array('style' => 'margin-top:7px; vertical-align: text-bottom;')) . " " . _t("Delete <strong><em>all</em></strong> records in set"), null, 'batch', 'Editor', 'Delete', array('set_id' => $t_set->getPrimaryKey()));
        $vs_buf .= "</div>\n";
        $vs_buf .= "<script type='text/javascript'>\n\t\t\t\tjQuery('#inspectorMoreInfo').click(function() {\n\t\t\t\t\tjQuery('#inspectorInfo').slideToggle(350, function() { \n\t\t\t\t\t\tjQuery('#inspectorMoreInfo').html((this.style.display == 'block') ? '" . addslashes(_t('Close options')) . "' : '" . addslashes(_t('More options')) . "');\n\t\t\t\t\t}); \n\t\t\t\t\treturn false;\n\t\t\t\t});\n\t\t\t</script>";
    }
    // -------------------------------------------------------------------------------------
    $vs_buf .= "</div></h4>\n";
    return $vs_buf;
}
コード例 #3
0
 /**
  * Returns HTML form element for editing of setting
  *
  * Options:
  *
  * 	'name' => sets the name of the HTML form element explicitly, otherwise 'setting_<name_of_setting>' is used
  *  'value' => sets the value of the HTML form element explicitly, otherwise the current value for the setting in the loaded row is used
  */
 public function settingHTMLFormElement($ps_widget_id, $ps_setting, $pa_options = null)
 {
     if (!$this->isValidSetting($ps_setting)) {
         return false;
     }
     $va_available_settings = $this->getAvailableSettings();
     $va_properties = $va_available_settings[$ps_setting];
     if (isset($pa_options['name'])) {
         $vs_input_name = $pa_options['name'];
     } else {
         $vs_input_name = "setting_{$ps_setting}";
     }
     if (isset($pa_options['value']) && !is_null($pa_options['value'])) {
         $vs_value = $pa_options['value'];
     } else {
         $vs_value = $this->getSetting(trim($ps_setting));
     }
     $vs_element = '';
     switch ($va_properties['displayType']) {
         # --------------------------------------------
         case DT_FIELD:
             $vb_takes_locale = false;
             if (isset($va_properties['takesLocale']) && $va_properties['takesLocale']) {
                 $vb_takes_locale = true;
                 $va_locales = ca_locales::getLocaleList(array('sort_field' => '', 'sort_order' => 'asc', 'index_by_code' => true));
             } else {
                 $va_locales = array('_generic' => array());
             }
             foreach ($va_locales as $vs_locale => $va_locale_info) {
                 if ($vb_takes_locale) {
                     $vs_locale_label = " (" . $va_locale_info['name'] . ")";
                     $vs_input_name_suffix = '_' . $vs_locale;
                 } else {
                     $vs_input_name_suffix = $vs_locale_label = '';
                 }
                 $vs_element .= caHTMLTextInput($vs_input_name . $vs_input_name_suffix, array('size' => $va_properties["width"], 'height' => $va_properties["height"], 'value' => $vs_value, 'id' => $vs_input_name . $vs_input_name_suffix)) . "{$vs_locale_label}";
                 // focus code is needed by Firefox for some reason
                 $vs_element .= "<script type='text/javascript'>jQuery('#" . $vs_input_name . $vs_input_name_suffix . "').click(function() { this.focus(); });</script>";
             }
             break;
             # --------------------------------------------
         # --------------------------------------------
         case DT_CHECKBOXES:
             $va_attributes = array('value' => '1');
             if ($vs_value) {
                 $va_attributes['checked'] = '1';
             }
             $vs_element .= caHTMLCheckboxInput($vs_input_name, $va_attributes);
             break;
             # --------------------------------------------
         # --------------------------------------------
         case DT_SELECT:
             if (!is_array($va_properties['options'])) {
                 $va_properties['options'] = array();
             }
             $vs_element .= caHTMLSelect($vs_input_name, $va_properties['options'], array(), array('value' => $vs_value));
             break;
             # --------------------------------------------
         # --------------------------------------------
         default:
             break;
             # --------------------------------------------
     }
     $vs_label = $va_properties['label'];
     $vb_element_is_part_of_label = false;
     if (strpos($vs_label, '^ELEMENT') !== false) {
         $vs_label = str_replace('^ELEMENT', $vs_element, $vs_label);
         $vb_element_is_part_of_label = true;
     }
     $vs_return = "\n" . '<div class="formLabel" id="_widget_setting_' . $ps_setting . '_' . $ps_widget_id . '"><span>' . $vs_label . '</span>';
     if (!$vb_element_is_part_of_label) {
         $vs_return .= '<br />' . $vs_element;
     }
     $vs_return .= '</div>' . "\n";
     TooltipManager::add('#_widget_setting_' . $ps_setting . '_' . $ps_widget_id, "<h3>" . str_replace('^ELEMENT', 'X', $va_properties["label"]) . "</h3>" . $va_properties["description"]);
     return $vs_return;
 }
コード例 #4
0
<?php

$t_object = $this->getVar("item");
$va_comments = $this->getVar("comments");
TooltipManager::add('#caDetailZoomLink', 'View Fullscreen');
TooltipManager::add('#caDetailDownloadLink', 'Download');
TooltipManager::add('#caEntity', 'Related person or organization');
//TooltipManager::add('#foo', 'This is a tooltip!');
?>
<div class="row">
	<div class='col-xs-1 col-sm-1 col-md-1 col-lg-1'>
		<div class="detailNavBgLeft">
			{{{previousLink}}}{{{resultsLink}}}
		</div><!-- end detailNavBgLeft -->
	</div><!-- end col -->
	<div class='col-xs-10 col-sm-10 col-md-10 col-lg-10'>
		<div class="container"><div class="row">
			<div class='col-sm-6 col-md-6 col-lg-6'>
				{{{representationViewer}}}
				
				<?php 
print caObjectRepresentationThumbnails($this->request, $this->getVar("representation_id"), $t_object, array("returnAs" => "bsCols", "linkTo" => "carousel", "bsColClasses" => "smallpadding col-sm-3 col-md-3 col-xs-4"));
?>
				<div id="detailTools">
					<div class="detailTool"><span class="glyphicon glyphicon-share-alt"></span>{{{shareLink}}}</div><!-- end detailTool -->
					<div style="clear:both;"><!-- empty --></div>
				</div><!-- end detailTools -->
			</div><!-- end col -->
			
			<div class='col-sm-6 col-md-6 col-lg-6'>
				<H1>{{{<unit delimiter=" ➔ " relativeTo="ca_collections"><l>^ca_collections.hierarchy.preferred_labels.name</l></unit><ifcount min="1" code="ca_collections"> ➔ </ifcount>}}}{{{ca_objects.preferred_labels.name}}}</H1>
コード例 #5
0
<?php 
// output headers
$vn_id_count = 0;
foreach ($va_display_list as $va_display_item) {
    if ($va_display_item['is_sortable']) {
        if ($vs_current_sort == $va_display_item['bundle_sort']) {
            print "<th class='list-header-sorted-asc'><span id='listHeader" . $vn_id_count . "'><nobr>" . (unicode_strlen($va_display_item['display']) > 17 ? strip_tags(mb_substr($va_display_item['display'], 0, 15)) . "..." : $va_display_item['display']) . "</nobr></span></th>";
            TooltipManager::add('#listHeader' . $vn_id_count, _t("Currently sorting by ") . $va_display_item['display']);
        } else {
            print "<th class='list-header-unsorted'><span id='listHeader1" . $vn_id_count . "'><nobr>" . caNavLink($this->request, unicode_strlen($va_display_item['display']) > 17 ? strip_tags(mb_substr($va_display_item['display'], 0, 15)) . "..." : $va_display_item['display'], '', $this->request->getModulePath(), $this->request->getController(), 'Index', array('sort' => $va_display_item['bundle_sort'])) . "</nobr></span></th>";
            TooltipManager::add('#listHeader1' . $vn_id_count, _t("Click to sort by ") . $va_display_item['display']);
        }
    } else {
        print "<th class='list-header-nosort'><span id='listHeader2" . $vn_id_count . "'><nobr>" . (unicode_strlen($va_display_item['display']) > 17 ? strip_tags(mb_substr($va_display_item['display'], 0, 15)) . "..." : $va_display_item['display']) . "</nobr></span></th>";
        TooltipManager::add('#listHeader2' . $vn_id_count, $va_display_item['display']);
    }
    $vn_id_count++;
}
?>
			</tr></thead><tbody>
<?php 
$i = 0;
$vn_item_count = 0;
while ($vn_item_count < $vn_items_per_page && $vo_result->nextHit()) {
    $vn_entity_id = $vo_result->get('entity_id');
    if ($vo_ar->userCanAccess($this->request->user->getUserID(), array("editor", "entities"), "EntityEditor", "Edit", array("entity_id" => $vn_entity_id))) {
        $vs_action = "Edit";
    } else {
        $vs_action = "Summary";
    }
コード例 #6
0
?>
	<div id="title">
		<?php 
print $t_item->getLabelForDisplay();
?>
	</div><!-- end title -->
	<table border="0" cellpadding="0" cellspacing="0" width="100%">
		<tr>
			<td valign="top" align="left" style="padding-right:10px;">
<?php 
foreach ($va_placements as $vn_placement_id => $va_info) {
    $vs_class = "";
    if (!strlen($vs_display_value = $t_display->getDisplayValue($t_item, $vn_placement_id, array_merge(array('request' => $this->request), is_array($va_info['settings']) ? $va_info['settings'] : array())))) {
        if (!(bool) $t_display->getSetting('show_empty_values')) {
            continue;
        }
        $vs_display_value = "&lt;" . _t('not defined') . "&gt;";
        $vs_class = " notDefined";
    }
    print "<div class=\"unit" . $vs_class . "\"><span class=\"heading" . $vs_class . "\">" . $va_info['display'] . ":</span> " . $vs_display_value . "</div>\n";
}
?>
			</td>
			</td>
		</tr>
	</table>
</div><!-- end summary -->
<?php 
TooltipManager::add('#printButton', _t("Download Summary as PDF"));
TooltipManager::add('a.downloadMediaContainer', _t("Download Media"));
コード例 #7
0
ファイル: BaseModel.php プロジェクト: samrahman/providence
 /**
  * HTML Form element generation
  * Optional name parameter allows you to generate a form element for a field but give it a
  * name different from the field name
  * 
  * @param string $ps_field field name
  * @param string $ps_format field format
  * @param array $pa_options additional options
  * TODO: document them.
  */
 public function htmlFormElement($ps_field, $ps_format = null, $pa_options = null)
 {
     $o_db = $this->getDb();
     // init options
     if (!is_array($pa_options)) {
         $pa_options = array();
     }
     foreach (array('display_form_field_tips', 'classname', 'maxOptionLength', 'textAreaTagName', 'display_use_count', 'display_omit_items__with_zero_count', 'display_use_count_filters', 'display_use_count_filters', 'selection', 'name', 'value', 'dont_show_null_value', 'size', 'multiple', 'show_text_field_for_vars', 'nullOption', 'empty_message', 'displayMessageForFieldValues', 'DISPLAY_FIELD', 'WHERE', 'select_item_text', 'hide_select_if_only_one_option', 'field_errors', 'display_form_field_tips', 'form_name', 'no_tooltips', 'tooltip_namespace', 'extraLabelText', 'width', 'height', 'label', 'list_code', 'hide_select_if_no_options', 'id', 'lookup_url', 'progress_indicator', 'error_icon', 'maxPixelWidth', 'displayMediaVersion', 'FIELD_TYPE', 'DISPLAY_TYPE', 'choiceList', 'readonly', 'description', 'hidden') as $vs_key) {
         if (!isset($pa_options[$vs_key])) {
             $pa_options[$vs_key] = null;
         }
     }
     $va_attr = $this->getFieldInfo($ps_field);
     foreach (array('DISPLAY_WIDTH', 'DISPLAY_USE_COUNT', 'DISPLAY_SHOW_COUNT', 'DISPLAY_OMIT_ITEMS_WITH_ZERO_COUNT', 'DISPLAY_TYPE', 'IS_NULL', 'DEFAULT_ON_NULL', 'DEFAULT', 'LIST_MULTIPLE_DELIMITER', 'FIELD_TYPE', 'LIST_CODE', 'DISPLAY_FIELD', 'WHERE', 'DISPLAY_WHERE', 'DISPLAY_ORDERBY', 'LIST', 'BOUNDS_CHOICE_LIST', 'BOUNDS_LENGTH', 'DISPLAY_DESCRIPTION', 'LABEL', 'DESCRIPTION', 'SUB_LABEL', 'SUB_DESCRIPTION', 'MAX_PIXEL_WIDTH') as $vs_key) {
         if (!isset($va_attr[$vs_key])) {
             $va_attr[$vs_key] = null;
         }
     }
     if (isset($pa_options['FIELD_TYPE'])) {
         $va_attr['FIELD_TYPE'] = $pa_options['FIELD_TYPE'];
     }
     if (isset($pa_options['DISPLAY_TYPE'])) {
         $va_attr['DISPLAY_TYPE'] = $pa_options['DISPLAY_TYPE'];
     }
     $vn_display_width = isset($pa_options['width']) && $pa_options['width'] > 0 ? $pa_options['width'] : $va_attr["DISPLAY_WIDTH"];
     $vn_display_height = isset($pa_options['height']) && $pa_options['height'] > 0 ? $pa_options['height'] : $va_attr["DISPLAY_HEIGHT"];
     $va_parsed_width = caParseFormElementDimension($vn_display_width);
     $va_parsed_height = caParseFormElementDimension($vn_display_height);
     $va_dim_styles = array();
     if ($va_parsed_width['type'] == 'pixels') {
         $va_dim_styles[] = "width: " . $va_parsed_width['dimension'] . "px;";
     }
     if ($va_parsed_height['type'] == 'pixels') {
         $va_dim_styles[] = "height: " . $va_parsed_height['dimension'] . "px;";
     }
     //if ($vn_max_pixel_width) {
     //	$va_dim_styles[] = "max-width: {$vn_max_pixel_width}px;";
     //}
     $vs_dim_style = trim(join(" ", $va_dim_styles));
     $vs_field_label = isset($pa_options['label']) && strlen($pa_options['label']) > 0 ? $pa_options['label'] : $va_attr["LABEL"];
     $vs_errors = '';
     // TODO: PULL THIS FROM A CONFIG FILE
     $pa_options["display_form_field_tips"] = true;
     if (isset($pa_options['classname'])) {
         $vs_css_class_attr = ' class="' . $pa_options['classname'] . '" ';
     } else {
         $vs_css_class_attr = '';
     }
     if (!isset($pa_options['id'])) {
         $pa_options['id'] = $pa_options['name'];
     }
     if (!isset($pa_options['id'])) {
         $pa_options['id'] = $ps_field;
     }
     if (!isset($pa_options['maxPixelWidth']) || (int) $pa_options['maxPixelWidth'] <= 0) {
         $vn_max_pixel_width = $va_attr['MAX_PIXEL_WIDTH'];
     } else {
         $vn_max_pixel_width = (int) $pa_options['maxPixelWidth'];
     }
     if ($vn_max_pixel_width <= 0) {
         $vn_max_pixel_width = null;
     }
     if (!isset($pa_options["maxOptionLength"]) && isset($vn_display_width)) {
         $pa_options["maxOptionLength"] = isset($vn_display_width) ? $vn_display_width : null;
     }
     $vs_text_area_tag_name = 'textarea';
     if (isset($pa_options["textAreaTagName"]) && $pa_options['textAreaTagName']) {
         $vs_text_area_tag_name = isset($pa_options['textAreaTagName']) ? $pa_options['textAreaTagName'] : null;
     }
     if (!isset($va_attr["DISPLAY_USE_COUNT"]) || !($vs_display_use_count = $va_attr["DISPLAY_USE_COUNT"])) {
         $vs_display_use_count = isset($pa_options["display_use_count"]) ? $pa_options["display_use_count"] : null;
     }
     if (!isset($va_attr["DISPLAY_SHOW_COUNT"]) || !($vb_display_show_count = (bool) $va_attr["DISPLAY_SHOW_COUNT"])) {
         $vb_display_show_count = isset($pa_options["display_show_count"]) ? (bool) $pa_options["display_show_count"] : null;
     }
     if (!isset($va_attr["DISPLAY_OMIT_ITEMS_WITH_ZERO_COUNT"]) || !($vb_display_omit_items__with_zero_count = (bool) $va_attr["DISPLAY_OMIT_ITEMS_WITH_ZERO_COUNT"])) {
         $vb_display_omit_items__with_zero_count = isset($pa_options["display_omit_items__with_zero_count"]) ? (bool) $pa_options["display_omit_items__with_zero_count"] : null;
     }
     if (!isset($va_attr["DISPLAY_OMIT_ITEMS_WITH_ZERO_COUNT"]) || !($va_display_use_count_filters = $va_attr["DISPLAY_USE_COUNT_FILTERS"])) {
         $va_display_use_count_filters = isset($pa_options["display_use_count_filters"]) ? $pa_options["display_use_count_filters"] : null;
     }
     if (!isset($va_display_use_count_filters) || !is_array($va_display_use_count_filters)) {
         $va_display_use_count_filters = null;
     }
     if (isset($pa_options["selection"]) && is_array($pa_options["selection"])) {
         $va_selection = isset($pa_options["selection"]) ? $pa_options["selection"] : null;
     } else {
         $va_selection = array();
     }
     if (isset($pa_options["choiceList"]) && is_array($pa_options["choiceList"])) {
         $va_attr["BOUNDS_CHOICE_LIST"] = $pa_options["choiceList"];
     }
     $vs_element = $vs_subelement = "";
     if ($va_attr) {
         # --- Skip omitted fields completely
         if ($va_attr["DISPLAY_TYPE"] == DT_OMIT) {
             return "";
         }
         if (!isset($pa_options["name"]) || !$pa_options["name"]) {
             $pa_options["name"] = htmlspecialchars($ps_field, ENT_QUOTES, 'UTF-8');
         }
         $va_js = array();
         $va_handlers = array("onclick", "onchange", "onkeypress", "onkeydown", "onkeyup");
         foreach ($va_handlers as $vs_handler) {
             if (isset($pa_options[$vs_handler]) && $pa_options[$vs_handler]) {
                 $va_js[] = "{$vs_handler}='" . $pa_options[$vs_handler] . "'";
             }
         }
         $vs_js = join(" ", $va_js);
         if (!isset($pa_options["value"])) {
             // allow field value to be overriden with value from options array
             $vm_field_value = $this->get($ps_field, $pa_options);
         } else {
             $vm_field_value = $pa_options["value"];
         }
         $vm_raw_field_value = $vm_field_value;
         $vb_is_null = isset($va_attr["IS_NULL"]) ? $va_attr["IS_NULL"] : false;
         if (isset($pa_options['dont_show_null_value']) && $pa_options['dont_show_null_value']) {
             $vb_is_null = false;
         }
         if (!is_array($vm_field_value) && strlen($vm_field_value) == 0 && (!isset($vb_is_null) || !$vb_is_null || (isset($va_attr["DEFAULT_ON_NULL"]) ? $va_attr["DEFAULT_ON_NULL"] : 0))) {
             $vm_field_value = isset($va_attr["DEFAULT"]) ? $va_attr["DEFAULT"] : "";
         }
         # --- Return hidden fields
         if ($va_attr["DISPLAY_TYPE"] == DT_HIDDEN || caGetOption('hidden', $pa_options, false)) {
             return '<input type="hidden" name="' . $pa_options["name"] . '" value="' . $this->escapeHTML($vm_field_value) . '"/>';
         }
         if (isset($pa_options["size"]) && $pa_options["size"] > 0) {
             $ps_size = " size='" . $pa_options["size"] . "'";
         } else {
             if (($va_attr["DISPLAY_TYPE"] == DT_LIST_MULTIPLE || $va_attr["DISPLAY_TYPE"] == DT_LIST) && $vn_display_height > 1) {
                 $ps_size = " size='" . $vn_display_height . "'";
             } else {
                 $ps_size = '';
             }
         }
         $vs_multiple_name_extension = '';
         if ($vs_is_multiple = isset($pa_options["multiple"]) && $pa_options["multiple"] || $va_attr["DISPLAY_TYPE"] == DT_LIST_MULTIPLE ? "multiple='1'" : "") {
             $vs_multiple_name_extension = '[]';
             if (!($vs_list_multiple_delimiter = $va_attr['LIST_MULTIPLE_DELIMITER'])) {
                 $vs_list_multiple_delimiter = ';';
             }
             $va_selection = array_merge($va_selection, explode($vs_list_multiple_delimiter, $vm_field_value));
         }
         # --- Return form element
         switch ($va_attr["FIELD_TYPE"]) {
             # ----------------------------
             case FT_NUMBER:
             case FT_TEXT:
             case FT_VARS:
                 if ($va_attr["FIELD_TYPE"] == FT_VARS) {
                     if (!$pa_options['show_text_field_for_vars']) {
                         break;
                     }
                     if (!is_string($vm_field_value) && !is_numeric($vm_field_value)) {
                         $vm_value = '';
                     }
                 }
                 if ($va_attr['DISPLAY_TYPE'] == DT_COUNTRY_LIST) {
                     $vs_element = caHTMLSelect($ps_field, caGetCountryList(), array('id' => $ps_field), array('value' => $vm_field_value));
                     if ($va_attr['STATEPROV_FIELD']) {
                         $vs_element .= "<script type='text/javascript'>\n";
                         $vs_element .= "var caStatesByCountryList = " . json_encode(caGetStateList()) . ";\n";
                         $vs_element .= "\n\t\t\t\t\t\t\t\tjQuery('#{$ps_field}').click({countryID: '{$ps_field}', stateProvID: '" . $va_attr['STATEPROV_FIELD'] . "', value: '" . addslashes($this->get($va_attr['STATEPROV_FIELD'])) . "', statesByCountryList: caStatesByCountryList}, caUI.utils.updateStateProvinceForCountry);\n\t\t\t\t\t\t\t\tjQuery(document).ready(function() {\n\t\t\t\t\t\t\t\t\tcaUI.utils.updateStateProvinceForCountry({data: {countryID: '{$ps_field}', stateProvID: '" . $va_attr['STATEPROV_FIELD'] . "', value: '" . addslashes($this->get($va_attr['STATEPROV_FIELD'])) . "', statesByCountryList: caStatesByCountryList}});\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t";
                         $vs_element .= "</script>\n";
                     }
                     break;
                 }
                 if ($va_attr['DISPLAY_TYPE'] == DT_STATEPROV_LIST) {
                     $vs_element = caHTMLSelect($ps_field . '_select', array(), array('id' => $ps_field . '_select'), array('value' => $vm_field_value));
                     $vs_element .= caHTMLTextInput($ps_field . '_name', array('id' => $ps_field . '_text', 'value' => $vm_field_value));
                     break;
                 }
                 if ($vn_display_width > 0 && in_array($va_attr["DISPLAY_TYPE"], array(DT_SELECT, DT_LIST, DT_LIST_MULTIPLE))) {
                     #
                     # Generate auto generated <select> (from foreign key, from ca_lists or from field-defined choice list)
                     #
                     # TODO: CLEAN UP THIS CODE, RUNNING VARIOUS STAGES THROUGH HELPER FUNCTIONS; ALSO FORMALIZE AND DOCUMENT VARIOUS OPTIONS
                     // -----
                     // from ca_lists
                     // -----
                     if (!($vs_list_code = $pa_options['list_code'])) {
                         if (isset($va_attr['LIST_CODE']) && $va_attr['LIST_CODE']) {
                             $vs_list_code = $va_attr['LIST_CODE'];
                         }
                     }
                     if ($vs_list_code) {
                         $va_many_to_one_relations = $this->_DATAMODEL->getManyToOneRelations($this->tableName());
                         if ($va_many_to_one_relations[$ps_field]) {
                             $vs_key = 'item_id';
                         } else {
                             $vs_key = 'item_value';
                         }
                         $vs_null_option = null;
                         if (!$pa_options["nullOption"] && $vb_is_null) {
                             $vs_null_option = _t("- NONE -");
                         } else {
                             if ($pa_options["nullOption"]) {
                                 $vs_null_option = $pa_options["nullOption"];
                             }
                         }
                         $t_list = new ca_lists();
                         $va_list_attrs = array('id' => $pa_options['id']);
                         //if ($vn_max_pixel_width) { $va_list_attrs['style'] = $vs_width_style; }
                         if (method_exists($this, 'getTypeFieldName') && $ps_field == $this->getTypeFieldName()) {
                             $va_limit_list = caGetTypeListForUser($this->tableName(), array('access' => __CA_BUNDLE_ACCESS_EDIT__));
                         }
                         // NOTE: "raw" field value (value passed into method, before the model default value is applied) is used so as to allow the list default to be used if needed
                         $vs_element = $t_list->getListAsHTMLFormElement($vs_list_code, $pa_options["name"] . $vs_multiple_name_extension, $va_list_attrs, array('value' => $vm_raw_field_value, 'key' => $vs_key, 'nullOption' => $vs_null_option, 'readonly' => $pa_options['readonly'], 'restrictTypeListForTable' => $this->tableName(), 'limitToItemsWithID' => $va_limit_list ? $va_limit_list : null));
                         if (isset($pa_options['hide_select_if_no_options']) && $pa_options['hide_select_if_no_options'] && !$vs_element) {
                             $vs_element = "";
                             $ps_format = '^ERRORS^ELEMENT';
                         }
                     } else {
                         // -----
                         // from related table
                         // -----
                         $va_many_to_one_relations = $this->_DATAMODEL->getManyToOneRelations($this->tableName());
                         if (isset($va_many_to_one_relations[$ps_field]) && $va_many_to_one_relations[$ps_field]) {
                             #
                             # Use foreign  key to populate <select>
                             #
                             $o_one_table = $this->_DATAMODEL->getTableInstance($va_many_to_one_relations[$ps_field]["one_table"]);
                             $vs_one_table_primary_key = $o_one_table->primaryKey();
                             if ($o_one_table->isHierarchical()) {
                                 #
                                 # Hierarchical <select>
                                 #
                                 $va_hier = $o_one_table->getHierarchyAsList(0, $vs_display_use_count, $va_display_use_count_filters, $vb_display_omit_items__with_zero_count);
                                 if (!is_array($va_hier)) {
                                     return '';
                                 }
                                 $va_display_fields = $va_attr["DISPLAY_FIELD"];
                                 if (!in_array($vs_one_table_primary_key, $va_display_fields)) {
                                     $va_display_fields[] = $o_one_table->tableName() . "." . $vs_one_table_primary_key;
                                 }
                                 if (!is_array($va_display_fields) || sizeof($va_display_fields) < 1) {
                                     $va_display_fields = array("*");
                                 }
                                 $vs_hier_parent_id_fld = $o_one_table->getProperty("HIER_PARENT_ID_FLD");
                                 $va_options = array();
                                 if ($pa_options["nullOption"]) {
                                     $va_options[""] = array($pa_options["nullOption"]);
                                 }
                                 $va_suboptions = array();
                                 $va_suboption_values = array();
                                 $vn_selected = 0;
                                 $vm_cur_top_level_val = null;
                                 $vm_selected_top_level_val = null;
                                 foreach ($va_hier as $va_option) {
                                     if (!$va_option["NODE"][$vs_hier_parent_id_fld]) {
                                         continue;
                                     }
                                     $vn_val = $va_option["NODE"][$o_one_table->primaryKey()];
                                     $vs_selected = $vn_val == $vm_field_value ? 'selected="1"' : "";
                                     $vn_indent = $va_option["LEVEL"] - 1;
                                     $va_display_data = array();
                                     foreach ($va_display_fields as $vs_fld) {
                                         $va_bits = explode(".", $vs_fld);
                                         if ($va_bits[1] != $vs_one_table_primary_key) {
                                             $va_display_data[] = $va_option["NODE"][$va_bits[1]];
                                         }
                                     }
                                     $vs_option_label = join(" ", $va_display_data);
                                     $va_options[$vn_val] = array($vs_option_label, $vn_indent, $va_option["HITS"], $va_option['NODE']);
                                 }
                                 if (sizeof($va_options) == 0) {
                                     $vs_element = isset($pa_options['empty_message']) ? $pa_options['empty_message'] : 'No options available';
                                 } else {
                                     $vs_element = "<select name='" . $pa_options["name"] . $vs_multiple_name_extension . "' " . $vs_js . " " . $vs_is_multiple . " " . $ps_size . " id='" . $pa_options["id"] . $vs_multiple_name_extension . "' {$vs_css_class_attr}  style='{$vs_dim_style}'" . ($pa_options['readonly'] ? ' disabled="disabled" ' : '') . ">\n";
                                     if (!$pa_options["nullOption"] && $vb_is_null) {
                                         $vs_element .= "<option value=''>" . _t('- NONE -') . "</option>\n";
                                     } else {
                                         if ($pa_options["nullOption"]) {
                                             $vs_element .= "<option value=''>" . $pa_options["nullOption"] . "</option>\n";
                                         }
                                     }
                                     foreach ($va_options as $vn_val => $va_option_info) {
                                         $vs_selected = $vn_val == $vm_field_value || in_array($vn_val, $va_selection) ? "selected='selected'" : "";
                                         $vs_element .= "<option value='" . $vn_val . "' {$vs_selected}>";
                                         $vn_indent = $va_option_info[1] * 2;
                                         $vs_indent = "";
                                         if ($vn_indent > 0) {
                                             $vs_indent = str_repeat("&nbsp;", ($vn_indent - 1) * 2) . " ";
                                             $vn_indent++;
                                         }
                                         $vs_option_text = $va_option_info[0];
                                         $vs_use_count = "";
                                         if ($vs_display_use_count && $vb_display_show_count && $vn_val != "") {
                                             $vs_use_count = " (" . intval($va_option_info[2]) . ")";
                                         }
                                         $vs_display_message = '';
                                         if (is_array($pa_options['displayMessageForFieldValues'])) {
                                             foreach ($pa_options['displayMessageForFieldValues'] as $vs_df => $va_df_vals) {
                                                 if (isset($va_option_info[3][$vs_df]) && is_array($va_df_vals)) {
                                                     $vs_tmp = $va_option_info[3][$vs_df];
                                                     if (isset($va_df_vals[$vs_tmp])) {
                                                         $vs_display_message = ' ' . $va_df_vals[$vs_tmp];
                                                     }
                                                 }
                                             }
                                         }
                                         if ($pa_options["maxOptionLength"] && strlen($vs_option_text) + strlen($vs_use_count) + $vn_indent > $pa_options["maxOptionLength"]) {
                                             if (($vn_strlen = $pa_options["maxOptionLength"] - strlen($vs_indent) - strlen($vs_use_count) - 3) < $pa_options["maxOptionLength"]) {
                                                 $vn_strlen = $pa_options["maxOptionLength"];
                                             }
                                             $vs_option_text = unicode_substr($vs_option_text, 0, $vn_strlen) . "...";
                                         }
                                         $vs_element .= $vs_indent . $vs_option_text . $vs_use_count . $vs_display_message . "</option>\n";
                                     }
                                     $vs_element .= "</select>\n";
                                 }
                             } else {
                                 #
                                 # "Flat" <select>
                                 #
                                 if (!is_array($va_display_fields = $pa_options["DISPLAY_FIELD"])) {
                                     $va_display_fields = $va_attr["DISPLAY_FIELD"];
                                 }
                                 if (!is_array($va_display_fields)) {
                                     return "Configuration error: DISPLAY_FIELD directive for field '{$ps_field}' must be an array of field names in the format tablename.fieldname";
                                 }
                                 if (!in_array($vs_one_table_primary_key, $va_display_fields)) {
                                     $va_display_fields[] = $o_one_table->tableName() . "." . $vs_one_table_primary_key;
                                 }
                                 if (!is_array($va_display_fields) || sizeof($va_display_fields) < 1) {
                                     $va_display_fields = array("*");
                                 }
                                 $vs_sql = "\n\t\t\t\t\t\t\t\t\t\t\tSELECT *\n\t\t\t\t\t\t\t\t\t\t\tFROM " . $va_many_to_one_relations[$ps_field]["one_table"] . "\n\t\t\t\t\t\t\t\t\t\t\t";
                                 if (isset($pa_options["WHERE"]) && (is_array($pa_options["WHERE"]) && ($vs_where = join(" AND ", $pa_options["WHERE"]))) || is_array($va_attr["DISPLAY_WHERE"]) && ($vs_where = join(" AND ", $va_attr["DISPLAY_WHERE"]))) {
                                     $vs_sql .= " WHERE {$vs_where} ";
                                 }
                                 if (isset($va_attr["DISPLAY_ORDERBY"]) && $va_attr["DISPLAY_ORDERBY"] && ($vs_orderby = join(",", $va_attr["DISPLAY_ORDERBY"]))) {
                                     $vs_sql .= " ORDER BY {$vs_orderby} ";
                                 }
                                 $qr_res = $o_db->query($vs_sql);
                                 if ($o_db->numErrors()) {
                                     $vs_element = "Error creating menu: " . join(';', $o_db->getErrors());
                                     break;
                                 }
                                 $va_opts = array();
                                 if (isset($pa_options["nullOption"]) && $pa_options["nullOption"]) {
                                     $va_opts[$pa_options["nullOption"]] = array($pa_options["nullOption"], null);
                                 } else {
                                     if ($vb_is_null) {
                                         $va_opts[_t("- NONE -")] = array(_t("- NONE -"), null);
                                     }
                                 }
                                 if ($pa_options["select_item_text"]) {
                                     $va_opts[$pa_options["select_item_text"]] = array($pa_options["select_item_text"], null);
                                 }
                                 $va_fields = array();
                                 foreach ($va_display_fields as $vs_field) {
                                     $va_tmp = explode(".", $vs_field);
                                     $va_fields[] = $va_tmp[1];
                                 }
                                 while ($qr_res->nextRow()) {
                                     $vs_display = "";
                                     foreach ($va_fields as $vs_field) {
                                         if ($vs_field != $vs_one_table_primary_key) {
                                             $vs_display .= $qr_res->get($vs_field) . " ";
                                         }
                                     }
                                     $va_opts[] = array($vs_display, $qr_res->get($vs_one_table_primary_key), $qr_res->getRow());
                                 }
                                 if (sizeof($va_opts) == 0) {
                                     $vs_element = isset($pa_options['empty_message']) ? $pa_options['empty_message'] : 'No options available';
                                 } else {
                                     if (isset($pa_options['hide_select_if_only_one_option']) && $pa_options['hide_select_if_only_one_option'] && sizeof($va_opts) == 1) {
                                         $vs_element = "<input type='hidden' name='" . $pa_options["name"] . "' " . $vs_js . " " . $ps_size . " id='" . $pa_options["id"] . "' value='" . ($vm_field_value ? $vm_field_value : $va_opts[0][1]) . "' {$vs_css_class_attr}/>";
                                         $ps_format = '^ERRORS^ELEMENT';
                                     } else {
                                         $vs_element = "<select name='" . $pa_options["name"] . $vs_multiple_name_extension . "' " . $vs_js . " " . $vs_is_multiple . " " . $ps_size . " id='" . $pa_options["id"] . $vs_multiple_name_extension . "' {$vs_css_class_attr} style='{$vs_dim_style}'" . ($pa_options['readonly'] ? ' disabled="disabled" ' : '') . ">\n";
                                         foreach ($va_opts as $va_opt) {
                                             $vs_option_text = $va_opt[0];
                                             $vs_value = $va_opt[1];
                                             $vs_selected = $vs_value == $vm_field_value || in_array($vs_value, $va_selection) ? "selected='selected'" : "";
                                             $vs_use_count = "";
                                             if ($vs_display_use_count && $vb_display_show_count && $vs_value != "") {
                                                 //$vs_use_count = "(".intval($va_option_info[2]).")";
                                             }
                                             if ($pa_options["maxOptionLength"] && strlen($vs_option_text) + strlen($vs_use_count) > $pa_options["maxOptionLength"]) {
                                                 $vs_option_text = unicode_substr($vs_option_text, 0, $pa_options["maxOptionLength"] - 3 - strlen($vs_use_count)) . "...";
                                             }
                                             $vs_display_message = '';
                                             if (is_array($pa_options['displayMessageForFieldValues'])) {
                                                 foreach ($pa_options['displayMessageForFieldValues'] as $vs_df => $va_df_vals) {
                                                     if (isset($va_opt[2][$vs_df]) && is_array($va_df_vals)) {
                                                         $vs_tmp = $va_opt[2][$vs_df];
                                                         if (isset($va_df_vals[$vs_tmp])) {
                                                             $vs_display_message = ' ' . $va_df_vals[$vs_tmp];
                                                         }
                                                     }
                                                 }
                                             }
                                             $vs_element .= "<option value='{$vs_value}' {$vs_selected}>";
                                             $vs_element .= $vs_option_text . $vs_use_count . $vs_display_message;
                                             $vs_element .= "</option>\n";
                                         }
                                         $vs_element .= "</select>\n";
                                     }
                                 }
                             }
                         } else {
                             #
                             # choice list
                             #
                             $vs_element = '';
                             // if 'LIST' is set try to stock over choice list with the contents of the list
                             if (isset($va_attr['LIST']) && $va_attr['LIST']) {
                                 // NOTE: "raw" field value (value passed into method, before the model default value is applied) is used so as to allow the list default to be used if needed
                                 $vs_element = ca_lists::getListAsHTMLFormElement($va_attr['LIST'], $pa_options["name"] . $vs_multiple_name_extension, array('class' => $pa_options['classname'], 'id' => $pa_options['id']), array('key' => 'item_value', 'value' => $vm_raw_field_value, 'nullOption' => $pa_options['nullOption'], 'readonly' => $pa_options['readonly']));
                             }
                             if (!$vs_element && (isset($va_attr["BOUNDS_CHOICE_LIST"]) && is_array($va_attr["BOUNDS_CHOICE_LIST"]))) {
                                 if (sizeof($va_attr["BOUNDS_CHOICE_LIST"]) == 0) {
                                     $vs_element = isset($pa_options['empty_message']) ? $pa_options['empty_message'] : 'No options available';
                                 } else {
                                     $vs_element = "<select name='" . $pa_options["name"] . $vs_multiple_name_extension . "' " . $vs_js . " " . $vs_is_multiple . " " . $ps_size . " id='" . $pa_options['id'] . $vs_multiple_name_extension . "' {$vs_css_class_attr} style='{$vs_dim_style}'" . ($pa_options['readonly'] ? ' disabled="disabled" ' : '') . ">\n";
                                     if ($pa_options["select_item_text"]) {
                                         $vs_element .= "<option value=''>" . $this->escapeHTML($pa_options["select_item_text"]) . "</option>\n";
                                     }
                                     if (!$pa_options["nullOption"] && $vb_is_null) {
                                         $vs_element .= "<option value=''>" . _t('- NONE -') . "</option>\n";
                                     } else {
                                         if ($pa_options["nullOption"]) {
                                             $vs_element .= "<option value=''>" . $pa_options["nullOption"] . "</option>\n";
                                         }
                                     }
                                     foreach ($va_attr["BOUNDS_CHOICE_LIST"] as $vs_option => $vs_value) {
                                         $vs_selected = strval($vs_value) === strval($vm_field_value) || in_array($vs_value, $va_selection) ? "selected='selected'" : "";
                                         if ($pa_options["maxOptionLength"] && strlen($vs_option) > $pa_options["maxOptionLength"]) {
                                             $vs_option = unicode_substr($vs_option, 0, $pa_options["maxOptionLength"] - 3) . "...";
                                         }
                                         $vs_element .= "<option value='{$vs_value}' {$vs_selected}>" . $this->escapeHTML($vs_option) . "</option>\n";
                                     }
                                     $vs_element .= "</select>\n";
                                 }
                             }
                         }
                     }
                 } else {
                     if ($va_attr["DISPLAY_TYPE"] === DT_COLORPICKER) {
                         // COLORPICKER
                         $vs_element = '<input name="' . $pa_options["name"] . '" type="hidden" size="' . ($pa_options['size'] ? $pa_options['size'] : $vn_display_width) . '" value="' . $this->escapeHTML($vm_field_value) . '" ' . $vs_js . ' id=\'' . $pa_options["id"] . "' style='{$vs_dim_style}'/>\n";
                         $vs_element .= '<div id="' . $pa_options["id"] . '_colorchip" class="colorpicker_chip" style="background-color: #' . $vm_field_value . '"><!-- empty --></div>';
                         $vs_element .= "<script type='text/javascript'>jQuery(document).ready(function() { jQuery('#" . $pa_options["name"] . "_colorchip').ColorPicker({\n\t\t\t\t\t\t\t\tonShow: function (colpkr) {\n\t\t\t\t\t\t\t\t\tjQuery(colpkr).fadeIn(500);\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tonHide: function (colpkr) {\n\t\t\t\t\t\t\t\t\tjQuery(colpkr).fadeOut(500);\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tonChange: function (hsb, hex, rgb) {\n\t\t\t\t\t\t\t\t\tjQuery('#" . $pa_options["name"] . "').val(hex);\n\t\t\t\t\t\t\t\t\tjQuery('#" . $pa_options["name"] . "_colorchip').css('backgroundColor', '#' + hex);\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tcolor: jQuery('#" . $pa_options["name"] . "').val()\n\t\t\t\t\t\t\t})}); </script>\n";
                         if (method_exists('AssetLoadManager', 'register')) {
                             AssetLoadManager::register('jquery', 'colorpicker');
                         }
                     } else {
                         # normal controls: all non-DT_SELECT display types are returned as DT_FIELD's. We could generate
                         # radio-button controls for foreign key and choice lists, but we don't bother because it's never
                         # really necessary.
                         if ($vn_display_height > 1) {
                             $vs_element = '<' . $vs_text_area_tag_name . ' name="' . $pa_options["name"] . '" rows="' . $vn_display_height . '" cols="' . $vn_display_width . '"' . ($pa_options['readonly'] ? ' readonly="readonly" disabled="disabled"' : '') . ' wrap="soft" ' . $vs_js . ' id=\'' . $pa_options["id"] . "' style='{$vs_dim_style}' " . $vs_css_class_attr . ">" . $this->escapeHTML($vm_field_value) . '</' . $vs_text_area_tag_name . '>' . "\n";
                         } else {
                             $vs_element = '<input name="' . $pa_options["name"] . '" type="text" size="' . ($pa_options['size'] ? $pa_options['size'] : $vn_display_width) . '"' . ($pa_options['readonly'] ? ' readonly="readonly" ' : '') . ' value="' . $this->escapeHTML($vm_field_value) . '" ' . $vs_js . ' id=\'' . $pa_options["id"] . "' {$vs_css_class_attr} style='{$vs_dim_style}'/>\n";
                         }
                         if (isset($va_attr['UNIQUE_WITHIN']) && is_array($va_attr['UNIQUE_WITHIN'])) {
                             $va_within_fields = array();
                             foreach ($va_attr['UNIQUE_WITHIN'] as $vs_within_field) {
                                 $va_within_fields[$vs_within_field] = $this->get($vs_within_field);
                             }
                             $vs_element .= "<span id='" . $pa_options["id"] . '_uniqueness_status' . "'></span>";
                             $vs_element .= "<script type='text/javascript'>\n\tcaUI.initUniquenessChecker({\n\t\terrorIcon: '" . $pa_options['error_icon'] . "',\n\t\tprocessIndicator: '" . $pa_options['progress_indicator'] . "',\n\t\tstatusID: '" . $pa_options["id"] . "_uniqueness_status',\n\t\tlookupUrl: '" . $pa_options['lookup_url'] . "',\n\t\tformElementID: '" . $pa_options["id"] . "',\n\t\trow_id: " . intval($this->getPrimaryKey()) . ",\n\t\ttable_num: " . $this->tableNum() . ",\n\t\tfield: '" . $ps_field . "',\n\t\twithinFields: " . json_encode($va_within_fields) . ",\n\t\t\n\t\talreadyInUseMessage: '" . addslashes(_t('Value must be unique. Please try another.')) . "'\n\t});\n</script>";
                         } else {
                             if (isset($va_attr['LOOKUP']) && $va_attr['LOOKUP']) {
                                 if (class_exists("AppController") && ($app = AppController::getInstance()) && ($req = $app->getRequest())) {
                                     AssetLoadManager::register('jquery', 'autocomplete');
                                     $vs_element .= "<script type='text/javascript'>\n\tjQuery('#" . $pa_options["id"] . "').autocomplete({ source: '" . caNavUrl($req, 'lookup', 'Intrinsic', 'Get', array('bundle' => $this->tableName() . ".{$ps_field}", "max" => 500)) . "', minLength: 3, delay: 800});\n</script>";
                                 }
                             }
                         }
                         if (isset($pa_options['usewysiwygeditor']) && $pa_options['usewysiwygeditor']) {
                             AssetLoadManager::register("ckeditor");
                             $vs_width = $vn_display_width;
                             $vs_height = $vn_display_height;
                             if (!preg_match("!^[\\d\\.]+px\$!i", $vs_width)) {
                                 $vs_width = (int) $vs_width * 6 . "px";
                             }
                             if (!preg_match("!^[\\d\\.]+px\$!i", $vs_height)) {
                                 $vs_height = (int) $vs_height * 16 . "px";
                             }
                             if (!is_array($va_toolbar_config = $this->getAppConfig()->getAssoc('wysiwyg_editor_toolbar'))) {
                                 $va_toolbar_config = array();
                             }
                             $vs_element .= "<script type='text/javascript'>jQuery(document).ready(function() {\n\t\t\t\t\t\t\t\tvar ckEditor = CKEDITOR.replace( '" . $pa_options['id'] . "',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttoolbar : " . json_encode(array_values($va_toolbar_config)) . ",\n\t\t\t\t\t\t\t\t\twidth: '{$vs_width}',\n\t\t\t\t\t\t\t\t\theight: '{$vs_height}',\n\t\t\t\t\t\t\t\t\ttoolbarLocation: 'top',\n\t\t\t\t\t\t\t\t\tenterMode: CKEDITOR.ENTER_BR\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tckEditor.on('instanceReady', function(){ \n\t\t\t\t\t\t\t\t\t ckEditor.document.on( 'keydown', function(e) {if (caUI && caUI.utils) { caUI.utils.showUnsavedChangesWarning(true); } });\n\t\t\t\t\t\t\t\t});\n \t});\t\t\t\t\t\t\t\t\t\n</script>";
                         }
                     }
                 }
                 break;
                 # ----------------------------
             # ----------------------------
             case FT_TIMESTAMP:
                 if ($this->get($ps_field)) {
                     # is timestamp set?
                     $vs_element = $this->escapeHTML($vm_field_value);
                     # return printed date
                 } else {
                     $vs_element = "[Not set]";
                     # return text instead of 1969 date
                 }
                 break;
                 # ----------------------------
             # ----------------------------
             case FT_DATETIME:
             case FT_HISTORIC_DATETIME:
             case FT_DATE:
             case FT_HISTORIC_DATE:
                 if (!$vm_field_value) {
                     $vm_field_value = $pa_options['value'];
                 }
                 switch ($va_attr["DISPLAY_TYPE"]) {
                     case DT_TEXT:
                         $vs_element = $vm_field_value ? $vm_field_value : "[Not set]";
                         break;
                     default:
                         $vn_max_length = $va_attr["BOUNDS_LENGTH"][1];
                         $vs_max_length = '';
                         if ($vn_max_length > 0) {
                             $vs_max_length = 'maxlength="' . $vn_max_length . '"';
                         }
                         if ($vn_display_height > 1) {
                             $vs_element = '<' . $vs_text_area_tag_name . ' name="' . $pa_options["name"] . '" rows="' . $vn_display_height . '" cols="' . $vn_display_width . '" wrap="soft" ' . $vs_js . ' ' . $vs_css_class_attr . " style='{$vs_dim_style}'" . ($pa_options['readonly'] ? ' readonly="readonly" ' : '') . ">" . $this->escapeHTML($vm_field_value) . '</' . $vs_text_area_tag_name . '>';
                         } else {
                             $vs_element = '<input type="text" name="' . $pa_options["name"] . '" value="' . $this->escapeHTML($vm_field_value) . "\" size='{$vn_display_width}' {$vs_max_length} {$vs_js} {$vs_css_class_attr} style='{$vs_dim_style}'" . ($pa_options['readonly'] ? ' readonly="readonly" ' : '') . "/>";
                         }
                         break;
                 }
                 break;
                 # ----------------------------
             # ----------------------------
             case FT_TIME:
                 if (!$this->get($ps_field)) {
                     $vm_field_value = "";
                 }
                 switch ($va_attr["DISPLAY_TYPE"]) {
                     case DT_TEXT:
                         $vs_element = $vm_field_value ? $vm_field_value : "[Not set]";
                         break;
                     default:
                         $vn_max_length = $va_attr["BOUNDS_LENGTH"][1];
                         $vs_max_length = '';
                         if ($vn_max_length > 0) {
                             $vs_max_length = 'maxlength="' . $vn_max_length . '"';
                         }
                         if ($vn_display_height > 1) {
                             $vs_element = '<' . $vs_text_area_tag_name . ' name="' . $pa_options["name"] . '" id="' . $pa_options["id"] . '" rows="' . $vn_display_height . '" cols="' . $vn_display_width . '" wrap="soft" ' . $vs_js . ' ' . $vs_css_class_attr . " style='{$vs_dim_style}'" . ($pa_options['readonly'] ? ' readonly="readonly" ' : '') . ">" . $this->escapeHTML($vm_field_value) . '</' . $vs_text_area_tag_name . '>';
                         } else {
                             $vs_element = '<input type="text" name="' . $pa_options["name"] . '" id="' . $pa_options["id"] . '" value="' . $this->escapeHTML($vm_field_value) . "\" size='{$vn_display_width}' {$vs_max_length} {$vs_js} {$vs_css_class_attr}' style='{$vs_dim_style}'" . ($pa_options['readonly'] ? ' readonly="readonly" ' : '') . "/>";
                         }
                         break;
                 }
                 break;
                 # ----------------------------
             # ----------------------------
             case FT_DATERANGE:
             case FT_HISTORIC_DATERANGE:
                 switch ($va_attr["DISPLAY_TYPE"]) {
                     case DT_TEXT:
                         $vs_element = $vm_field_value ? $vm_field_value : "[Not set]";
                         break;
                     default:
                         $vn_max_length = $va_attr["BOUNDS_LENGTH"][1];
                         $vs_max_length = '';
                         if ($vn_max_length > 0) {
                             $vs_max_length = 'maxlength="' . $vn_max_length . '"';
                         }
                         if ($vn_display_height > 1) {
                             $vs_element = '<' . $vs_text_area_tag_name . ' name="' . $pa_options["name"] . '" id="' . $pa_options["id"] . '" rows="' . $vn_display_height . '" cols="' . $vn_display_width . '" wrap="soft" ' . $vs_js . ' ' . $vs_css_class_attr . " style='{$vs_dim_style}'" . ($pa_options['readonly'] ? ' readonly="readonly" ' : '') . ">" . $this->escapeHTML($vm_field_value) . '</' . $vs_text_area_tag_name . '>';
                         } else {
                             $vs_element = '<input type="text" name="' . $pa_options["name"] . '" id="' . $pa_options["id"] . '" value="' . $this->escapeHTML($vm_field_value) . "\" size='{$vn_display_width}' {$vn_max_length} {$vs_js} {$vs_css_class_attr} style='{$vs_dim_style}'" . ($pa_options['readonly'] ? ' readonly="readonly" ' : '') . "/>";
                         }
                         break;
                 }
                 break;
                 # ----------------------------
             # ----------------------------
             case FT_TIMERANGE:
                 switch ($va_attr["DISPLAY_TYPE"]) {
                     case DT_TEXT:
                         $vs_element = $vm_field_value ? $vm_field_value : "[Not set]";
                         break;
                     default:
                         $vn_max_length = $va_attr["BOUNDS_LENGTH"][1];
                         $vs_max_length = '';
                         if ($vn_max_length > 0) {
                             $vs_max_length = 'maxlength="' . $vn_max_length . '"';
                         }
                         if ($vn_display_height > 1) {
                             $vs_element = '<' . $vs_text_area_tag_name . ' name="' . $pa_options["name"] . '" id="' . $pa_options["id"] . '" rows="' . $vn_display_height . '" cols="' . $vn_display_width . '" wrap="soft" ' . $vs_js . ' ' . $vs_css_class_attr . " style='{$vs_dim_style}'" . ($pa_options['readonly'] ? ' readonly="readonly" ' : '') . ">" . $this->escapeHTML($vm_field_value) . '</' . $vs_text_area_tag_name . '>';
                         } else {
                             $vs_element = '<input type="text" name="' . $pa_options["name"] . '" id="' . $pa_options["id"] . '" value="' . $this->escapeHTML($vm_field_value) . "\" size='{$vn_display_width}' {$vs_max_length} {$vs_js} {$vs_css_class_attr}  style='{$vs_dim_style}'" . ($pa_options['readonly'] ? ' readonly="readonly" ' : '') . "/>";
                         }
                         break;
                 }
                 break;
                 # ----------------------------
             # ----------------------------
             case FT_TIMECODE:
                 $o_tp = new TimecodeParser();
                 $o_tp->setParsedValueInSeconds($vm_field_value);
                 $vs_timecode = $o_tp->getText("COLON_DELIMITED", array("BLANK_ON_ZERO" => true));
                 $vn_max_length = $va_attr["BOUNDS_LENGTH"][1];
                 $vs_max_length = '';
                 if ($vn_max_length > 0) {
                     $vs_max_length = 'maxlength="' . $vn_max_length . '"';
                 }
                 if ($vn_display_height > 1) {
                     $vs_element = '<' . $vs_text_area_tag_name . ' name="' . $pa_options["name"] . '" id="' . $pa_options["id"] . '" rows="' . $vn_display_height . '" cols="' . $vn_display_width . '" wrap="soft" ' . $vs_js . ' ' . $vs_css_class_attr . " style='{$vs_dim_style}'" . ($pa_options['readonly'] ? ' readonly="readonly" ' : '') . ">" . $this->escapeHTML($vs_timecode) . '</' . $vs_text_area_tag_name . '>';
                 } else {
                     $vs_element = '<input type="text" NAME="' . $pa_options["name"] . '" id="' . $pa_options["id"] . '" value="' . $this->escapeHTML($vs_timecode) . "\" size='{$vn_display_width}' {$vs_max_length} {$vs_js} {$vs_css_class_attr} style='{$vs_dim_style}'" . ($pa_options['readonly'] ? ' readonly="readonly" ' : '') . "/>";
                 }
                 break;
                 # ----------------------------
             # ----------------------------
             case FT_MEDIA:
             case FT_FILE:
                 $vs_element = '<input type="file" name="' . $pa_options["name"] . '" id="' . $pa_options["id"] . '" ' . $vs_js . '/>';
                 // show current media icon
                 if ($vs_version = array_key_exists('displayMediaVersion', $pa_options) ? $pa_options['displayMediaVersion'] : 'icon') {
                     $va_valid_versions = $this->getMediaVersions($ps_field);
                     if (!in_array($vs_version, $va_valid_versions)) {
                         $vs_version = $va_valid_versions[0];
                     }
                     if ($vs_tag = $this->getMediaTag($ps_field, $vs_version)) {
                         $vs_element .= $vs_tag;
                     }
                 }
                 break;
                 # ----------------------------
             # ----------------------------
             case FT_PASSWORD:
                 $vn_max_length = $va_attr["BOUNDS_LENGTH"][1];
                 $vs_max_length = '';
                 if ($vn_max_length > 0) {
                     $vs_max_length = 'maxlength="' . $vn_max_length . '"';
                 }
                 $vs_element = '<input type="password" name="' . $pa_options["name"] . '" id="' . $pa_options["id"] . '" value="' . $this->escapeHTML($vm_field_value) . '" size="' . $vn_display_width . '" ' . $vs_max_length . ' ' . $vs_js . ' autocomplete="off" ' . $vs_css_class_attr . " style='{$vs_dim_style}'" . ($pa_options['readonly'] ? ' readonly="readonly" ' : '') . "/>";
                 break;
                 # ----------------------------
             # ----------------------------
             case FT_BIT:
                 switch ($va_attr["DISPLAY_TYPE"]) {
                     case DT_FIELD:
                         $vs_element = '<input type="text" name="' . $pa_options["name"] . "\" value='{$vm_field_value}' maxlength='1' size='2' {$vs_js} style='{$vs_dim_style}'" . ($pa_options['readonly'] ? ' readonly="readonly" ' : '') . "/>";
                         break;
                     case DT_SELECT:
                         $vs_element = "<select name='" . $pa_options["name"] . "' " . $vs_js . " id='" . $pa_options["id"] . "' {$vs_css_class_attr} style='{$vs_dim_style}'" . ($pa_options['readonly'] ? ' disabled="disabled" ' : '') . ">\n";
                         foreach (array("Yes" => 1, "No" => 0) as $vs_option => $vs_value) {
                             $vs_selected = $vs_value == $vm_field_value ? "selected='selected'" : "";
                             $vs_element .= "<option value='{$vs_value}' {$vs_selected}" . ($pa_options['readonly'] ? ' disabled="disabled" ' : '') . ">" . _t($vs_option) . "</option>\n";
                         }
                         $vs_element .= "</select>\n";
                         break;
                     case DT_CHECKBOXES:
                         $vs_element = '<input type="checkbox" name="' . $pa_options["name"] . '" value="1" ' . ($vm_field_value ? 'checked="1"' : '') . ' ' . $vs_js . ($pa_options['readonly'] ? ' disabled="disabled" ' : '') . ' id="' . $pa_options["id"] . '"/>';
                         break;
                     case DT_RADIO_BUTTONS:
                         $vs_element = 'Radio buttons not supported for bit-type fields';
                         break;
                 }
                 break;
                 # ----------------------------
         }
         # Apply format
         $vs_formatting = "";
         if (isset($pa_options['field_errors']) && is_array($pa_options['field_errors']) && sizeof($pa_options['field_errors'])) {
             $va_field_errors = array();
             foreach ($pa_options['field_errors'] as $o_e) {
                 $va_field_errors[] = $o_e->getErrorDescription();
             }
             $vs_errors = join('; ', $va_field_errors);
         } else {
             $vs_errors = '';
         }
         if (is_null($ps_format)) {
             if (isset($pa_options['field_errors']) && is_array($pa_options['field_errors']) && sizeof($pa_options['field_errors'])) {
                 $ps_format = $this->_CONFIG->get('form_element_error_display_format');
             } else {
                 $ps_format = $this->_CONFIG->get('form_element_display_format');
             }
         }
         if ($ps_format != '') {
             $ps_formatted_element = $ps_format;
             $ps_formatted_element = str_replace("^ELEMENT", $vs_element, $ps_formatted_element);
             if ($vs_subelement) {
                 $ps_formatted_element = str_replace("^SUB_ELEMENT", $vs_subelement, $ps_formatted_element);
             }
             $vb_fl_display_form_field_tips = false;
             if ($pa_options["display_form_field_tips"] || !isset($pa_options["display_form_field_tips"]) && $va_attr["DISPLAY_DESCRIPTION"] || !isset($pa_options["display_form_field_tips"]) && !isset($va_attr["DISPLAY_DESCRIPTION"]) && $vb_fl_display_form_field_tips) {
                 if (preg_match("/\\^DESCRIPTION/", $ps_formatted_element)) {
                     $ps_formatted_element = str_replace("^LABEL", $vs_field_label, $ps_formatted_element);
                     $ps_formatted_element = str_replace("^DESCRIPTION", isset($pa_options["description"]) && $pa_options["description"] ? $pa_options["description"] : $va_attr["DESCRIPTION"], $ps_formatted_element);
                 } else {
                     // no explicit placement of description text, so...
                     $vs_field_id = '_' . $this->tableName() . '_' . $this->getPrimaryKey() . '_' . $pa_options["name"] . '_' . $pa_options['form_name'];
                     $ps_formatted_element = str_replace("^LABEL", '<span id="' . $vs_field_id . '">' . $vs_field_label . '</span>', $ps_formatted_element);
                     if (!isset($pa_options['no_tooltips']) || !$pa_options['no_tooltips']) {
                         TooltipManager::add('#' . $vs_field_id, "<h3>{$vs_field_label}</h3>" . (isset($pa_options["description"]) && $pa_options["description"] ? $pa_options["description"] : $va_attr["DESCRIPTION"]), $pa_options['tooltip_namespace']);
                     }
                 }
                 if (!isset($va_attr["SUB_LABEL"])) {
                     $va_attr["SUB_LABEL"] = '';
                 }
                 if (!isset($va_attr["SUB_DESCRIPTION"])) {
                     $va_attr["SUB_DESCRIPTION"] = '';
                 }
                 if (preg_match("/\\^SUB_DESCRIPTION/", $ps_formatted_element)) {
                     $ps_formatted_element = str_replace("^SUB_LABEL", $va_attr["SUB_LABEL"], $ps_formatted_element);
                     $ps_formatted_element = str_replace("^SUB_DESCRIPTION", $va_attr["SUB_DESCRIPTION"], $ps_formatted_element);
                 } else {
                     // no explicit placement of description text, so...
                     // ... make label text itself rollover for description text because no icon was specified
                     $ps_formatted_element = str_replace("^SUB_LABEL", $va_attr["SUB_LABEL"], $ps_formatted_element);
                 }
             } else {
                 $ps_formatted_element = str_replace("^LABEL", $vs_field_label, $ps_formatted_element);
                 $ps_formatted_element = str_replace("^DESCRIPTION", "", $ps_formatted_element);
                 if ($vs_subelement) {
                     $ps_formatted_element = str_replace("^SUB_LABEL", $va_attr["SUB_LABEL"], $ps_formatted_element);
                     $ps_formatted_element = str_replace("^SUB_DESCRIPTION", "", $ps_formatted_element);
                 }
             }
             $ps_formatted_element = str_replace("^ERRORS", $vs_errors, $ps_formatted_element);
             $ps_formatted_element = str_replace("^EXTRA", isset($pa_options['extraLabelText']) ? $pa_options['extraLabelText'] : '', $ps_formatted_element);
             $vs_element = $ps_formatted_element;
         } else {
             $vs_element .= "<br/>" . $vs_subelement;
         }
         return $vs_element;
     } else {
         $this->postError(716, _t("'%1' does not exist in this object", $ps_field), "BaseModel->formElement()");
         return "";
     }
     return "";
 }
コード例 #8
0
						<div style="float:right;">
							<span id="{fieldNamePrefix}edit_{n}"><?php 
print urldecode(caNavLink($this->request, caNavIcon($this->request, __CA_NAV_BUTTON_EDIT__, null, null, array('graphicsPath' => $this->getVar('graphicsPath'))), '', 'editor/tour_stops', 'TourStopEditor', 'Edit', array('stop_id' => '{stop_id}')));
?>
</span>
							<a href="#" class="caDeleteItemButton"><?php 
print caNavIcon($this->request, __CA_NAV_BUTTON_DEL_BUNDLE__, null, null, array('graphicsPath' => $this->getVar('graphicsPath')));
?>
</a>
						</div>
					</td>
				</tr>
			</table>
		</div>
<?php 
print TooltipManager::getLoadHTML('bundle_ca_tour_stops_list');
?>
	</textarea>
	
	<div class="bundleContainer">
		<div class="caItemList">
		
		</div>
		<div class='button labelInfo caAddItemButton'><a href='#'><?php 
print caNavIcon($this->request, __CA_NAV_BUTTON_ADD__, null, null, array('graphicsPath' => $this->getVar('graphicsPath')));
?>
 <?php 
print _t("Add stop");
?>
 &rsaquo;</a></div>
	</div>
コード例 #9
0
 /**
  * Returns list of placements in the currently loaded display
  *
  * @param array $pa_options Optional array of options. Supported options are:
  *		noCache = if set to true, no caching of placement values is performed. 
  *		no_tooltips = if set no tooltips for available bundles will be emitted. Default is false - tooltips will be emitted.
  *		format = specifies label format for bundles. Valid values are "simple" (just the name of the element) or "full" (name of element, name of type of item element pertains to and alternate label, if defined). Default is "full"
  *		user_id = if specified then placements are only returned if the user has at least read access to the display
  * @return array List of placements. Each element in the list is an array with the following keys:
  *		display = A display label for the bundle
  *		bundle = The bundle name
  */
 public function getPlacementsInDisplay($pa_options = null)
 {
     if (!is_array($pa_options)) {
         $pa_options = array();
     }
     $pb_no_cache = caGetOption('noCache', $pa_options, false);
     $pn_user_id = caGetOption('user_id', $pa_options, null);
     if ($pn_user_id && !$this->haveAccessToDisplay($pn_user_id, __CA_BUNDLE_DISPLAY_READ_ACCESS__)) {
         return array();
     }
     $vb_show_tooltips = !caGetOption('no_tooltips', $pa_options, false);
     $vs_format = caGetOption('format', $pa_options, 'full', array('validValues' => array('simple', 'full')));
     if (!($pn_table_num = $this->getAppDatamodel()->getTableNum($this->get('table_num')))) {
         return null;
     }
     if (!($t_instance = $this->getAppDatamodel()->getInstanceByTableNum($pn_table_num, true))) {
         return null;
     }
     if (!is_array($va_placements = $this->getPlacements($pa_options))) {
         $va_placements = array();
     }
     $va_placements_in_display = array();
     foreach ($va_placements as $vn_placement_id => $va_placement) {
         $vs_label = ($vs_label = $t_instance->getDisplayLabel($va_placement['bundle_name'])) ? $vs_label : $va_placement['bundle_name'];
         if (is_array($va_placement['settings']) && is_array($va_placement['settings']['label'])) {
             $va_tmp = caExtractValuesByUserLocale(array($va_placement['settings']['label']));
             if ($vs_user_set_label = array_shift($va_tmp)) {
                 $vs_label = "{$vs_label} (<em>{$vs_user_set_label}</em>)";
             }
         }
         $vs_display = "<div id='bundleDisplayEditor_{$vn_placement_id}'><span class='bundleDisplayEditorPlacementListItemTitle'>" . caUcFirstUTF8Safe($t_instance->getProperty('NAME_SINGULAR')) . "</span> {$vs_label}</div>";
         $va_placement['display'] = $vs_format == 'simple' ? $vs_label : $vs_display;
         $va_placement['bundle'] = $va_placement['bundle_name'];
         // we used 'bundle' in the arrays, but the database field is called 'bundle_name' and getPlacements() returns data directly from the database
         unset($va_placement['bundle_name']);
         $va_placements_in_display[$vn_placement_id] = $va_placement;
         $vs_description = $t_instance->getDisplayDescription($va_placement['bundle']);
         if ($vb_show_tooltips) {
             TooltipManager::add("#bundleDisplayEditor_{$vn_placement_id}", $this->_formatBundleTooltip($vs_label, $va_placement['bundle'], $vs_description));
         }
     }
     return $va_placements_in_display;
 }
コード例 #10
0
 if ($va_author = $qr_rels->getWithTemplate('<unit relativeTo="ca_objects" ><unit relativeTo="ca_entities" restrictToRelationshipTypes="author">^ca_entities.preferred_labels</unit></unit>')) {
     $va_book_info[] = $va_author;
 } else {
     $va_author = null;
 }
 if ($va_publication_date = $qr_rels->get("ca_objects.publication_date")) {
     $va_book_info[] = $va_publication_date;
 } else {
     $va_publication_date = null;
 }
 if ($va_publisher = $qr_rels->get("ca_objects.publisher")) {
     $va_book_info[] = $va_publisher;
 } else {
     $va_publisher = null;
 }
 TooltipManager::add('#book' . $vn_i, $qr_rels->get('ca_objects.parent.preferred_labels.name') . " " . $qr_rels->get('ca_objects.preferred_labels.name') . "<br/>" . join('<br/>', $va_book_info));
 print "</div>";
 print "<div class='col-xs-2 col-sm-2 col-md-2 col-lg-2'>";
 if ($qr_rels->get("ca_objects.parent.preferred_labels")) {
     print $qr_rels->get("ca_objects.preferred_labels.displayname", array('returnAsLink' => true));
 }
 print "</div>";
 print "<div class='col-xs-2 col-sm-2 col-md-2 col-lg-2'>";
 print $qr_rels->get("ca_objects_x_entities.date_out");
 print "</div>";
 print "<div class='col-xs-2 col-sm-2 col-md-2 col-lg-2'>";
 print $qr_rels->get("ca_objects_x_entities.date_in");
 print "</div>";
 print "<div class='col-xs-1 col-sm-1 col-md-1 col-lg-1'>";
 print $qr_rels->get("ca_objects_x_entities.fine");
 print "</div>";
コード例 #11
0
<?php 
}
?>
	</div>
</div>

<input type="hidden" id="<?php 
print $vs_id_prefix;
?>
_ObjectRepresentationBundleList" name="<?php 
print $vs_id_prefix;
?>
_ObjectRepresentationBundleList" value=""/>
<?php 
// order element
TooltipManager::add('.updateIcon', _t("Update Media"));
?>
		
<script type="text/javascript">
	function caToggleDisplayObjectRepresentationMetadata(media_metadata_id, media_metadata_button_id) {
		var m = jQuery('#' + media_metadata_id).is(':hidden');
		jQuery('#' + media_metadata_id).slideToggle(300);
		jQuery('#' + media_metadata_button_id + ' img').rotate({ duration:500, angle: m ? 0 : 180, animateTo: m ? 180 : 0 });
	}
	
	function caToggleDisplayMediaReplication(media_replication_id, media_replication_button_id, n) {
		var m = jQuery('#' + media_replication_id).is(':hidden');
		jQuery('#' + media_replication_button_id + ' img').rotate({ duration:500, angle: m ? 0 : 180, animateTo: m ? 180 : 0 });
		
		jQuery('#' + media_replication_id).slideToggle(300, function() { 
			if(jQuery('#' + media_replication_id).css('display') == 'block') {
コード例 #12
0
            print $va_info["title"];
            if ($va_info["title"] && $va_info["caption"]) {
                print "<br/>";
            }
            print $va_info["caption"];
            if ($va_info["vaga_class"]) {
                print "</a>";
            }
            print "</span>";
        }
        print "</div>";
    }
    print "</div><!-- participateSlideShow --></div><!-- end participateSlideShow -->";
}
if ($vn_vaga_disclaimer_output) {
    TooltipManager::add(".vagaDisclaimer", "<div style='width:250px;'>Reproduction of this image, including downloading, is prohibited without written authorization from VAGA, 350 Fifth Avenue, Suite 2820, New York, NY 10118. Tel: 212-736-6666; Fax: 212-736-6767; e-mail:info@vagarights.com; web: <a href='www.vagarights.com' target='_blank'>www.vagarights.com</a></div>");
}
?>

<h1>Participate</h1>
<div class="textContent">
	<div>
		East End Stories illustrates the dynamic history of artists who have lived and worked on the East End of Long Island since the 1820s. The site includes biographical information, art historical narratives, photographs, maps, and much more.
	</div>
	<div>
		YOU can become a part of the story! The Parrish is currently soliciting contributions of oral histories, photographs, audio, video, home movies, and print ephemera related to artists who have lived or worked in the region.
	</div>
	<div>
<?php 
print "<b>" . caNavLink($this->request, _t("Click here to see user contributed content"), "", "", "Search", "Index", array("search" => "ca_objects.source_id:" . $this->getVar("user_contributed_source_id") . " or ca_objects.source_id:" . $this->getVar("user_contributed_other_source_id"))) . "</b>";
?>
コード例 #13
0
ファイル: ModelSettings.php プロジェクト: guaykuru/pawtucket
 /**
  * Returns HTML form element for editing of setting
  *
  * Options:
  *
  * 	'name' => sets the name of the HTML form element explicitly, otherwise 'setting_<name_of_setting>' is used
  * 	'id' => sets the id of the HTML form element explicitly, otherwise 'setting_<name_of_setting>' is used
  *  'value' => sets the value of the HTML form element explicitly, otherwise the current value for the setting in the loaded row is used
  *  'label_id' => sets the id of the label for the setting form element (used to link tools tips to the label); if not set then the default is to set it to  'setting_<name_of_setting>_label'
  */
 public function settingHTMLFormElement($ps_setting, $pa_options = null)
 {
     if (!$this->isValidSetting($ps_setting)) {
         return false;
     }
     $va_available_settings = $this->getAvailableSettings();
     $va_properties = $va_available_settings[$ps_setting];
     if (isset($pa_options['name'])) {
         $vs_input_name = $pa_options['name'];
     } else {
         $vs_input_name = "setting_{$ps_setting}";
     }
     if (isset($pa_options['id'])) {
         $vs_input_id = $pa_options['id'];
     } else {
         $vs_input_id = "setting_{$ps_setting}";
     }
     if (isset($pa_options['value'])) {
         $vs_value = $pa_options['value'];
     } else {
         $vs_value = $this->getSetting(trim($ps_setting));
     }
     if (isset($pa_options['label_id'])) {
         $vs_label_id = $pa_options['label_id'];
     } else {
         $vs_label_id = "setting_{$ps_setting}_label";
     }
     $vs_return = "\n" . '<div class="formLabel" id="' . $vs_input_id . '_container">' . "\n";
     $vs_return .= '<span id="' . $vs_label_id . '"  class="' . $vs_label_id . '">' . $va_properties['label'] . '</span>';
     if ($vs_help_text = $pa_options['helpText']) {
         $vs_return .= "<a href='#' onclick='jQuery(\"#" . str_replace(".", "_", $vs_label_id) . "_help_text\").slideToggle(250); return false;' class='settingsKeyButton'>" . _t('Key') . "</a>";
     }
     $vs_return .= '<br />' . "\n";
     if ($vs_help_text) {
         $vs_return .= "\n<div id='" . str_replace(".", "_", $vs_label_id) . "_help_text' class='settingsKey'>{$vs_help_text}</div>\n";
     }
     switch ($va_properties['displayType']) {
         # --------------------------------------------
         case DT_FIELD:
             $vb_takes_locale = false;
             if (isset($va_properties['takesLocale']) && $va_properties['takesLocale']) {
                 $vb_takes_locale = true;
                 $va_locales = ca_locales::getLocaleList(array('sort_field' => '', 'sort_order' => 'asc', 'index_by_code' => true, 'available_for_cataloguing_only' => true));
             } else {
                 $va_locales = array('_generic' => array());
             }
             foreach ($va_locales as $vs_locale => $va_locale_info) {
                 if ($vb_takes_locale && sizeof($va_locales) > 1) {
                     $vs_locale_label = " (" . $va_locale_info['name'] . ")";
                     $vs_input_name_suffix = '_' . $vs_locale;
                 } else {
                     if ($vb_takes_locale) {
                         $vs_input_name_suffix = '_' . $vs_locale;
                     } else {
                         $vs_input_name_suffix = $vs_locale_label = '';
                     }
                 }
                 if ($vs_locale != '_generic' && is_array($vs_value)) {
                     // _generic means this setting doesn't take a locale
                     if (!($vs_text_value = $vs_value[$va_locale_info['locale_id']])) {
                         $vs_text_value = is_array($vs_value) && isset($vs_value[$va_locale_info['code']]) ? $vs_value[$va_locale_info['code']] : '';
                     }
                 } else {
                     $vs_text_value = $vs_value;
                 }
                 $vs_return .= caHTMLTextInput($vs_input_name . $vs_input_name_suffix, array('size' => $va_properties["width"], 'height' => $va_properties["height"], 'value' => $vs_text_value, 'id' => $vs_input_id)) . "{$vs_locale_label}<br/>\n";
             }
             break;
             # --------------------------------------------
         # --------------------------------------------
         case DT_CHECKBOXES:
             $va_attributes = array('value' => '1', 'id' => $vs_input_id);
             if ((int) $vs_value === 1) {
                 $va_attributes['checked'] = '1';
             }
             if (isset($va_properties['hideOnSelect'])) {
                 if (!is_array($va_properties['hideOnSelect'])) {
                     $va_properties['hideOnSelect'] = array($va_properties['hideOnSelect']);
                 }
                 $va_ids = array();
                 foreach ($va_properties['hideOnSelect'] as $vs_n) {
                     $va_ids[] = "#" . $pa_options['id_prefix'] . "_{$vs_n}_container";
                 }
                 $va_attributes['onchange'] = 'jQuery(this).prop("checked") ? jQuery("' . join(",", $va_ids) . '").slideUp(250).find("input, textarea").val("") : jQuery("' . join(",", $va_ids) . '").slideDown(250);';
             }
             $vs_return .= caHTMLCheckboxInput($vs_input_name, $va_attributes, array());
             break;
             # --------------------------------------------
         # --------------------------------------------
         case DT_COLORPICKER:
             $va_attributes = array('value' => $vs_value, 'id' => $vs_input_id);
             $vs_return .= caHTMLHiddenInput($vs_input_name, $va_attributes, array());
             $vs_return .= "<div id='{$vs_input_id}_colorchip' class='colorpicker_chip' style='background-color: #{$vs_value}'><!-- empty --></div>";
             $vs_return .= "<script type='text/javascript'>jQuery(document).ready(function() { jQuery('#{$vs_input_name}_colorchip').ColorPicker({\n\t\t\t\t\t\t\t\tonShow: function (colpkr) {\n\t\t\t\t\t\t\t\t\tjQuery(colpkr).fadeIn(500);\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tonHide: function (colpkr) {\n\t\t\t\t\t\t\t\t\tjQuery(colpkr).fadeOut(500);\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tonChange: function (hsb, hex, rgb) {\n\t\t\t\t\t\t\t\t\tjQuery('#{$vs_input_name}').val(hex);\n\t\t\t\t\t\t\t\t\tjQuery('#{$vs_input_name}_colorchip').css('backgroundColor', '#' + hex);\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tcolor: jQuery('#" . $pa_options["name"] . "').val()\n\t\t\t\t\t\t\t})}); </script>\n";
             JavascriptLoadManager::register('jquery', 'colorpicker');
             break;
             # --------------------------------------------
         # --------------------------------------------
         case DT_SELECT:
             include_once __CA_MODELS_DIR__ . '/ca_relationship_types.php';
             $vn_width = isset($va_properties['width']) && strlen($va_properties['width']) > 0 ? $va_properties['width'] : "100px";
             $vn_height = isset($va_properties['height']) && strlen($va_properties['height']) > 0 ? $va_properties['height'] : "50px";
             $vs_select_element = '';
             if (($vs_rel_table = $va_properties['useRelationshipTypeList']) || ($vb_locale_list = (bool) $va_properties['useLocaleList']) || ($vs_list_code = $va_properties['useList']) || ($vb_show_lists = (bool) $va_properties['showLists'] || (bool) $va_properties['showVocabularies'])) {
                 if ($vs_rel_table) {
                     $t_rel = new ca_relationship_types();
                     $va_rels = $t_rel->getRelationshipInfo($vs_rel_table);
                     $va_rel_opts = array();
                     if (isset($va_properties['allowNull']) && $va_properties['allowNull']) {
                         $va_rel_opts['-'] = null;
                     }
                     foreach ($va_rels as $vn_type_id => $va_rel_type_info) {
                         if (!$va_rel_type_info['parent_id']) {
                             continue;
                         }
                         $va_rel_opts[$va_rel_type_info['typename'] . '/' . $va_rel_type_info['typename_reverse']] = $va_rel_type_info['type_id'];
                     }
                 } else {
                     if ($vb_locale_list) {
                         include_once __CA_MODELS_DIR__ . '/ca_locales.php';
                         $va_rel_opts = array_flip(ca_locales::getLocaleList(array('return_display_values' => true)));
                     } else {
                         if ($vb_show_lists) {
                             include_once __CA_MODELS_DIR__ . '/ca_lists.php';
                             $t_list = new ca_lists();
                             $va_lists = caExtractValuesByUserLocale($t_list->getListOfLists());
                             $va_rel_opts = array();
                             foreach ($va_lists as $vn_list_id => $va_list_info) {
                                 if ($va_properties['showVocabularies'] && !$va_list_info['use_as_vocabulary']) {
                                     continue;
                                 }
                                 $va_rel_opts[$va_list_info['name'] . ' (' . $va_list_info['list_code'] . ')'] = $vn_list_id;
                             }
                         }
                     }
                 }
                 $va_attr = array();
                 if ($vn_height > 1) {
                     $va_attr['multiple'] = 1;
                     $vs_input_name .= '[]';
                 }
                 $va_opts = array('id' => $vs_input_id, 'width' => $vn_width, 'height' => $vn_height);
                 if ($vn_height > 1) {
                     if ($vs_value && !is_array($vs_value)) {
                         $vs_value = array($vs_value);
                     }
                     $va_opts['values'] = $vs_value;
                 } else {
                     if (is_array($vs_value)) {
                         $va_opts['value'] = array_pop($vs_value);
                     } else {
                         if ($vs_value) {
                             $va_opts['value'] = $vs_value;
                         } else {
                             $va_opts['value'] = null;
                         }
                     }
                 }
                 if ($vs_list_code) {
                     $t_list = new ca_lists();
                     if (!isset($va_opts['value'])) {
                         $va_opts['value'] = -1;
                     }
                     // make sure default list item is never selected
                     $vs_select_element = $t_list->getListAsHTMLFormElement($vs_list_code, $vs_input_name, $va_attr, $va_opts);
                 } else {
                     if (!isset($va_opts['value'])) {
                         $va_opts['value'] = -1;
                     }
                     // make sure default list item is never selected
                     $vs_select_element = caHTMLSelect($vs_input_name, $va_rel_opts, $va_attr, $va_opts);
                 }
             } else {
                 if (strlen($va_properties['showSortableBundlesFor']) > 0) {
                     require_once __CA_MODELS_DIR__ . '/ca_metadata_elements.php';
                     $o_dm = Datamodel::load();
                     if (!($t_rel = $o_dm->getInstanceByTableName($va_properties['showSortableBundlesFor'], true))) {
                         break;
                     }
                     $va_elements = ca_metadata_elements::getSortableElements($va_properties['showSortableBundlesFor']);
                     $va_select_opts = array(_t('User defined sort order') => '', _t('Order created') => 'relation_id', _t('Preferred label') => $va_properties['showSortableBundlesFor'] . ".preferred_labels." . $t_rel->getLabelDisplayField());
                     foreach ($va_elements as $vn_element_id => $va_element) {
                         if (!$va_element['display_label']) {
                             continue;
                         }
                         $va_select_opts[_t('Element: %1', $va_element['display_label'])] = $va_properties['showSortableBundlesFor'] . "." . $va_element['element_code'];
                     }
                     $va_opts = array('id' => $vs_input_id, 'width' => $vn_width, 'height' => $vn_height, 'value' => is_array($vs_value) ? $vs_value[0] : $vs_value, 'values' => is_array($vs_value) ? $vs_value : array($vs_value));
                     $vs_select_element = caHTMLSelect($vs_input_name, $va_select_opts, array(), $va_opts);
                 } elseif ((int) $va_properties['showSortableElementsFor'] > 0) {
                     require_once __CA_MODELS_DIR__ . '/ca_metadata_elements.php';
                     $t_element = new ca_metadata_elements($va_properties['showSortableElementsFor']);
                     if (!$t_element->getPrimaryKey()) {
                         return '';
                     }
                     $va_elements = $t_element->getElementsInSet();
                     $va_select_opts = array(_t('Order created') => '');
                     foreach ($va_elements as $vn_i => $va_element) {
                         if ((int) $va_element['element_id'] == (int) $va_properties['showSortableElementsFor']) {
                             continue;
                         }
                         if (!$va_element['display_label']) {
                             continue;
                         }
                         $va_select_opts[_t('Element: %1', $va_element['display_label'])] = $va_element['element_code'];
                     }
                     $va_opts = array('id' => $vs_input_id, 'width' => $vn_width, 'height' => $vn_height, 'value' => is_array($vs_value) ? $vs_value[0] : $vs_value, 'values' => is_array($vs_value) ? $vs_value : array($vs_value));
                     $vs_select_element = caHTMLSelect($vs_input_name, $va_select_opts, array(), $va_opts);
                 } elseif ((int) $va_properties['showMetadataElementsWithDataType'] > 0) {
                     require_once __CA_MODELS_DIR__ . '/ca_metadata_elements.php';
                     $va_rep_elements = ca_metadata_elements::getElementsAsList(true, $va_properties['table'], null, true, false, true, array($va_properties['showMetadataElementsWithDataType']));
                     if (is_array($va_rep_elements)) {
                         $va_select_opts = array();
                         foreach ($va_rep_elements as $vs_element_code => $va_element_info) {
                             $va_select_opts[$va_element_info['display_label']] = $vs_element_code;
                         }
                         $va_opts = array('id' => $vs_input_id, 'width' => $vn_width, 'height' => $vn_height, 'value' => is_array($vs_value) ? $vs_value[0] : $vs_value, 'values' => is_array($vs_value) ? $vs_value : array($vs_value));
                         $vs_select_element = caHTMLSelect($vs_input_name, $va_select_opts, array(), $va_opts);
                     }
                 } else {
                     // Regular drop-down with configured options
                     if ($vn_height > 1) {
                         $va_attr['multiple'] = 1;
                         $vs_input_name .= '[]';
                     }
                     $va_opts = array('id' => $vs_input_id, 'width' => $vn_width, 'height' => $vn_height, 'value' => is_array($vs_value) ? $vs_value[0] : $vs_value, 'values' => is_array($vs_value) ? $vs_value : array($vs_value));
                     if (!isset($va_opts['value'])) {
                         $va_opts['value'] = -1;
                     }
                     // make sure default list item is never selected
                     $vs_select_element = caHTMLSelect($vs_input_name, $va_properties['options'], array(), $va_opts);
                 }
             }
             if ($vs_select_element) {
                 $vs_return .= $vs_select_element;
             } else {
                 return '';
             }
             break;
             # --------------------------------------------
         # --------------------------------------------
         default:
             break;
             # --------------------------------------------
     }
     $vs_return .= '</div>' . "\n";
     TooltipManager::add('.' . $vs_label_id, "<h3>" . $va_properties["label"] . "</h3>" . $va_properties["description"]);
     return $vs_return;
 }
コード例 #14
0
									<?php 
print $t_label->htmlFormElement('other_forenames', null, array('name' => "{fieldNamePrefix}other_forenames_{n}", 'id' => "{fieldNamePrefix}other_forenames_{n}", "value" => "{{other_forenames}}", 'no_tooltips' => false, 'tooltip_namespace' => 'bundle_ca_entity_labels_nonpreferred'));
?>
								</td>
								<td colspan="3"><?php 
print $t_label->htmlFormElement('displayname', null, array('name' => "{fieldNamePrefix}displayname_{n}", 'id' => "{fieldNamePrefix}displayname_{n}", "value" => "{{displayname}}", 'no_tooltips' => false, 'tooltip_namespace' => 'bundle_ca_entity_labels_nonpreferred', 'textAreaTagName' => 'textentry', 'readonly' => $vb_read_only));
?>
<td>
							<tr>
						</table>
					</td>
				</tr>
			</table>
		</div>
<?php 
print TooltipManager::getLoadHTML('bundle_ca_entity_labels_preferred');
?>
	</textarea>
	
	<div class="bundleContainer">
		<div class="caLabelList">
		
		</div>
		<div class='button labelInfo caAddLabelButton'><a href='#'><?php 
print caNavIcon($this->request, __CA_NAV_BUTTON_ADD__);
?>
 <?php 
print $vs_add_label ? $vs_add_label : _t("Add label");
?>
</a></div>
	</div>
コード例 #15
0
 print "<table border='0' cellspacing='0' cellpadding='0' width='100%' id='objDetailRelObjects'>";
 $col = 0;
 $vn_numCols = 4;
 foreach ($va_related_objects as $vn_rel_id => $va_info) {
     $t_rel_object = new ca_objects($va_info["object_id"]);
     $va_reps = $t_rel_object->getPrimaryRepresentation(array('icon', 'small'), null, array('return_with_access' => $va_access_values));
     if ($col == 0) {
         print "<tr>";
     }
     print "<td align='center' valign='middle' class='imageIcon icon" . $va_info["object_id"] . "'>";
     print caNavLink($this->request, $va_reps['tags']['icon'], '', 'Detail', 'Object', 'Show', array('object_id' => $va_info["object_id"]));
     // set view vars for tooltip
     $this->setVar('tooltip_representation', $va_reps['tags']['small']);
     $this->setVar('tooltip_title', $va_info['label']);
     $this->setVar('tooltip_idno', $va_info["idno"]);
     TooltipManager::add(".icon" . $va_info["object_id"], $this->render('../Results/ca_objects_result_tooltip_html.php'));
     print "</td>";
     $col++;
     if ($col < $vn_numCols) {
         print "<td align='center'><!-- empty --></td>";
     }
     if ($col == $vn_numCols) {
         print "</tr>";
         $col = 0;
     }
 }
 if ($col != 0 && $col < $vn_numCols) {
     while ($col <= $vn_numCols) {
         if ($col < $vn_numCols) {
             print "<td><!-- empty --></td>";
         }
コード例 #16
0
    # --- get the height of the image so can calculate padding needed to center vertically
    $va_media_info = $qr_hits->getMediaInfo('ca_object_representations.media', 'thumbnail', array('checkAccess' => $va_access_values));
    $vn_padding_top = 0;
    $vn_padding_top_bottom = (130 - $va_media_info["HEIGHT"]) / 2;
    print "<td align='center' valign='top' class='searchResultTd'><div class='searchThumbBg searchThumbnail" . $vn_object_id . "' style='padding: " . $vn_padding_top_bottom . "px 0px " . $vn_padding_top_bottom . "px 0px;'>";
    print caNavLink($this->request, $qr_hits->getMediaTag('ca_object_representations.media', 'thumbnail', array('checkAccess' => $va_access_values)), '', 'Detail', 'Object', 'Show', array('object_id' => $qr_hits->get('ca_objects.object_id')));
    // Get thumbnail caption
    $this->setVar('object_id', $vn_object_id);
    $this->setVar('caption_title', $vs_caption);
    $this->setVar('caption_idno', $qr_hits->get('idno'));
    print "</div><div class='searchThumbCaption searchThumbnail" . $vn_object_id . "'>" . $this->render('../Results/ca_objects_result_caption_html.php') . "</div>\n</td>\n";
    // set view vars for tooltip
    $this->setVar('tooltip_representation', $qr_hits->getMediaTag('ca_object_representations.media', 'small', array('checkAccess' => $va_access_values)));
    $this->setVar('tooltip_title', $vs_caption);
    $this->setVar('tooltip_idno', $qr_hits->get('idno'));
    TooltipManager::add(".searchThumbnail{$vn_object_id}", $this->render('../Results/ca_objects_result_tooltip_html.php'));
    $vn_c++;
    $vn_itemc++;
    if ($vn_c == $vn_numCols) {
        print "</tr>\n";
        $vn_c = 0;
    } else {
        print "<td><!-- empty for spacing --></td>";
    }
}
if ($vn_c > 0 && $vn_c < $vn_numCols) {
    while ($vn_c < $vn_numCols) {
        print "<td class='searchResultTd'><!-- empty --></td>\n";
        $vn_c++;
        if ($vn_c < $vn_numCols) {
            print "<td><!-- empty for spacing --></td>";
コード例 #17
0
ファイル: ca_users.php プロジェクト: kai-iak/providence
 /**
  * Generates HTML form element widget for preference based upon settings in preference definition file.
  * By calling this method for a series of preference names, one can quickly create an HTML-based configuration form.
  *
  * @access public
  * @param string $ps_pref Name of user preference
  * @param string $ps_format Format string containing simple tags to be replaced with preference information. Tags supported are:
  *		^LABEL = name of preference
  *		^ELEMENT = HTML code to generate form widget
  * 		If you omit $ps_format, the element code alone (content of ^ELEMENT) is returned.
  * @param array $pa_options Array of options. Support options are:
  *		field_errors = array of error messages to display on preference element
  *		useTable = if true and displayType for element in DT_CHECKBOXES checkboxes will be formatted in a table with numTableColumns columns
  *		numTableColumns = Number of columns to use when formatting checkboxes as a table. Default, if omitted, is 3
  *		genericUIList = forces FT_*_EDITOR_UI to return single UI list for table rather than by type
  *		classname = class to assign to form element
  * @return string HTML code to generate form widget
  */
 public function preferenceHtmlFormElement($ps_pref, $ps_format = null, $pa_options = null)
 {
     if ($this->isValidPreference($ps_pref)) {
         if (!is_array($pa_options)) {
             $pa_options = array();
         }
         $o_db = $this->getDb();
         $va_pref_info = $this->getPreferenceInfo($ps_pref);
         if (is_null($vs_current_value = $this->getPreference($ps_pref))) {
             $vs_current_value = $this->getPreferenceDefault($ps_pref);
         }
         $vs_output = "";
         $vs_class = "";
         $vs_classname = "";
         if (isset($pa_options['classname']) && $pa_options['classname']) {
             $vs_classname = $pa_options['classname'];
             $vs_class = " class='" . $pa_options['classname'] . "'";
         }
         foreach (array('displayType', 'displayWidth', 'displayHeight', 'length', 'formatType', 'choiceList', 'label', 'description') as $vs_k) {
             if (!isset($va_pref_info[$vs_k])) {
                 $va_pref_info[$vs_k] = null;
             }
         }
         switch ($va_pref_info["displayType"]) {
             # ---------------------------------
             case 'DT_FIELD':
                 if (($vn_display_width = $va_pref_info["displayWidth"]) < 1) {
                     $vn_display_width = 20;
                 }
                 if (($vn_display_height = $va_pref_info["displayHeight"]) < 1) {
                     $vn_display_height = 1;
                 }
                 if (isset($va_pref_info["length"]["maximum"])) {
                     $vn_max_input_length = $va_pref_info["length"]["maximum"];
                 } else {
                     $vn_max_input_length = $vn_display_width;
                 }
                 if ($vn_display_height > 1) {
                     $vs_output = "<textarea name='pref_{$ps_pref}' rows='" . $vn_display_height . "' cols='" . $vn_display_width . "'>" . htmlspecialchars($vs_current_value, ENT_QUOTES, 'UTF-8') . "</textarea>\n";
                 } else {
                     $vs_output = "<input type='text' name='pref_{$ps_pref}' size='{$vn_display_width}' maxlength='{$vn_max_input_length}'" . $vs_class . " value='" . htmlspecialchars($vs_current_value, ENT_QUOTES, 'UTF-8') . "'/>\n";
                 }
                 break;
                 # ---------------------------------
             # ---------------------------------
             case 'DT_SELECT':
                 switch ($va_pref_info['formatType']) {
                     case 'FT_UI_LOCALE':
                         $va_locales = array();
                         if ($r_dir = opendir(__CA_APP_DIR__ . '/locale/')) {
                             while (($vs_locale_dir = readdir($r_dir)) !== false) {
                                 if ($vs_locale_dir[0] == '.') {
                                     continue;
                                 }
                                 if (sizeof($va_tmp = explode('_', $vs_locale_dir)) == 2) {
                                     $va_locales[$vs_locale_dir] = $va_tmp;
                                 }
                             }
                         }
                         $va_opts = array();
                         $t_locale = new ca_locales();
                         foreach ($va_locales as $vs_code => $va_parts) {
                             try {
                                 $vs_lang_name = Zend_Locale::getTranslation(strtolower($va_parts[0]), 'language', strtolower($va_parts[0]));
                                 $vs_country_name = Zend_Locale::getTranslation($va_parts[1], 'Country', $vs_code);
                             } catch (Exception $e) {
                                 $vs_lang_name = strtolower($va_parts[0]);
                                 $vs_country_name = $vs_code;
                             }
                             $va_opts[($vs_lang_name ? $vs_lang_name : $vs_code) . ($vs_country_name ? ' (' . $vs_country_name . ')' : '')] = $vs_code;
                         }
                         break;
                     case 'FT_LOCALE':
                         $qr_locales = $o_db->query("\n\t\t\t\t\t\t\t\tSELECT *\n\t\t\t\t\t\t\t\tFROM ca_locales\n\t\t\t\t\t\t\t\tORDER BY \n\t\t\t\t\t\t\t\t\tname\n\t\t\t\t\t\t\t");
                         $va_opts = array();
                         while ($qr_locales->nextRow()) {
                             $va_opts[$qr_locales->get('name')] = $qr_locales->get('language') . '_' . $qr_locales->get('country');
                         }
                         break;
                     case 'FT_THEME':
                         if ($r_dir = opendir($this->_CONFIG->get('themes_directory'))) {
                             $va_opts = array();
                             while (($vs_theme_dir = readdir($r_dir)) !== false) {
                                 if ($vs_theme_dir[0] == '.') {
                                     continue;
                                 }
                                 $o_theme_info = Configuration::load($this->_CONFIG->get('themes_directory') . '/' . $vs_theme_dir . '/themeInfo.conf');
                                 $va_opts[$o_theme_info->get('name')] = $vs_theme_dir;
                             }
                         }
                         break;
                     case 'FT_OBJECT_EDITOR_UI':
                     case 'FT_OBJECT_LOT_EDITOR_UI':
                     case 'FT_ENTITY_EDITOR_UI':
                     case 'FT_PLACE_EDITOR_UI':
                     case 'FT_OCCURRENCE_EDITOR_UI':
                     case 'FT_COLLECTION_EDITOR_UI':
                     case 'FT_STORAGE_LOCATION_EDITOR_UI':
                     case 'FT_OBJECT_REPRESENTATION_EDITOR_UI':
                     case 'FT_REPRESENTATION_ANNOTATION_EDITOR_UI':
                     case 'FT_SET_EDITOR_UI':
                     case 'FT_SET_ITEM_EDITOR_UI':
                     case 'FT_LIST_EDITOR_UI':
                     case 'FT_LIST_ITEM_EDITOR_UI':
                     case 'FT_LOAN_EDITOR_UI':
                     case 'FT_MOVEMENT_EDITOR_UI':
                     case 'FT_TOUR_EDITOR_UI':
                     case 'FT_TOUR_STOP_EDITOR_UI':
                     case 'FT_SEARCH_FORM_EDITOR_UI':
                     case 'FT_BUNDLE_DISPLAY_EDITOR_UI':
                     case 'FT_RELATIONSHIP_TYPE_EDITOR_UI':
                     case 'FT_USER_INTERFACE_EDITOR_UI':
                     case 'FT_USER_INTERFACE_SCREEN_EDITOR_UI':
                     case 'FT_IMPORT_EXPORT_MAPPING_EDITOR_UI':
                     case 'FT_IMPORT_EXPORT_MAPPING_GROUP_EDITOR_UI':
                         $vn_table_num = $this->_editorPrefFormatTypeToTableNum($va_pref_info['formatType']);
                         $t_instance = $this->getAppDatamodel()->getInstanceByTableNum($vn_table_num, true);
                         $va_values = $this->getPreference($ps_pref);
                         if (!is_array($va_values)) {
                             $va_values = array();
                         }
                         if (method_exists($t_instance, 'getTypeFieldName') && $t_instance->getTypeFieldName() && (!isset($pa_options['genericUIList']) || !$pa_options['genericUIList'])) {
                             $vs_output = '';
                             $va_ui_list_by_type = $this->_getUIListByType($vn_table_num);
                             $va_types = array();
                             if ((bool) $t_instance->getFieldInfo($t_instance->getTypeFieldName(), 'IS_NULL')) {
                                 $va_types['_NONE_'] = array('LEVEL' => 0, 'name_singular' => _t('NONE'), 'name_plural' => _t('NONE'));
                             }
                             $va_types += $t_instance->getTypeList(array('returnHierarchyLevels' => true));
                             if (!is_array($va_types) || !sizeof($va_types)) {
                                 $va_types = array(1 => array());
                             }
                             // force ones with no types to get processed for __all__
                             foreach ($va_types as $vn_type_id => $va_type) {
                                 $va_opts = array();
                                 // print out type-specific
                                 if (is_array($va_ui_list_by_type[$vn_type_id])) {
                                     foreach (caExtractValuesByUserLocale($va_ui_list_by_type[$vn_type_id]) as $vn_ui_id => $vs_label) {
                                         $va_opts[$vn_ui_id] = $vs_label;
                                     }
                                 }
                                 // print out generic
                                 if (is_array($va_ui_list_by_type['__all__'])) {
                                     foreach (caExtractValuesByUserLocale($va_ui_list_by_type['__all__']) as $vn_ui_id => $vs_label) {
                                         $va_opts[$vn_ui_id] = $vs_label;
                                     }
                                 }
                                 if (!is_array($va_opts) || sizeof($va_opts) == 0) {
                                     continue;
                                 }
                                 $vs_output .= "<tr><td>" . str_repeat("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", (int) $va_type['LEVEL']) . $va_type['name_singular'] . "</td><td><select name='pref_{$ps_pref}_{$vn_type_id}'>\n";
                                 foreach ($va_opts as $vs_val => $vs_opt) {
                                     $vs_selected = $vs_val == $va_values[$vn_type_id] ? "SELECTED" : "";
                                     $vs_output .= "<option value='" . htmlspecialchars($vs_val, ENT_QUOTES, 'UTF-8') . "' {$vs_selected}>{$vs_opt}</option>\n";
                                 }
                                 $vs_output .= "</select></td></tr>\n";
                             }
                         } else {
                             $va_opts = $this->_getUIList($vn_table_num);
                             if (!is_array($va_opts) || sizeof($va_opts) == 0) {
                                 $vs_output = '';
                                 break 2;
                             }
                             $vs_output = "<tr><td> </td><td><select name='pref_{$ps_pref}'>\n";
                             foreach ($va_opts as $vs_val => $vs_opt) {
                                 $vs_selected = $vs_val == $vs_current_value ? "SELECTED" : "";
                                 $vs_output .= "<option value='" . htmlspecialchars($vs_val, ENT_QUOTES, 'UTF-8') . "' {$vs_selected}>" . $vs_opt . "</option>\n";
                             }
                             $vs_output .= "</select></td></tr>\n";
                         }
                         break 2;
                     default:
                         $va_opts = $va_pref_info["choiceList"];
                         break;
                 }
                 if (!is_array($va_opts) || sizeof($va_opts) == 0) {
                     $vs_output = '';
                     break;
                 }
                 $vs_output = "<select name='pref_{$ps_pref}'" . $vs_class . ">\n";
                 foreach ($va_opts as $vs_opt => $vs_val) {
                     $vs_selected = $vs_val == $vs_current_value ? "selected='1'" : "";
                     $vs_output .= "<option value='" . htmlspecialchars($vs_val, ENT_QUOTES, 'UTF-8') . "' {$vs_selected}>" . $vs_opt . "</option>\n";
                 }
                 $vs_output .= "</select>\n";
                 break;
                 # ---------------------------------
             # ---------------------------------
             case 'DT_CHECKBOXES':
                 if ($va_pref_info["formatType"] == 'FT_BIT') {
                     $vs_selected = $vs_current_value ? "CHECKED" : "";
                     $vs_output .= "<input type='checkbox' name='pref_{$ps_pref}' value='1'" . $vs_class . " {$vs_selected}>\n";
                 } else {
                     if ($vb_use_table = isset($pa_options['useTable']) && (bool) $pa_options['useTable']) {
                         $vs_output .= "<table width='100%'>";
                     }
                     $vn_num_table_columns = isset($pa_options['numTableColumns']) && (int) $pa_options['numTableColumns'] > 0 ? (int) $pa_options['numTableColumns'] : 3;
                     $vn_c = 0;
                     foreach ($va_pref_info["choiceList"] as $vs_opt => $vs_val) {
                         if (is_array($vs_current_value)) {
                             $vs_selected = in_array($vs_val, $vs_current_value) ? "CHECKED" : "";
                         } else {
                             $vs_selected = '';
                         }
                         if ($vb_use_table && $vn_c == 0) {
                             $vs_output .= "<tr>";
                         }
                         if ($vb_use_table) {
                             $vs_output .= "<td width='" . floor(100 / $vn_num_table_columns) . "%'>";
                         }
                         $vs_output .= "<input type='checkbox' name='pref_" . $ps_pref . "[]' value='" . htmlspecialchars($vs_val, ENT_QUOTES, 'UTF-8') . "'" . $vs_class . " {$vs_selected}> " . $vs_opt . " \n";
                         if ($vb_use_table) {
                             $vs_output .= "</td>";
                         }
                         $vn_c++;
                         if ($vb_use_table && !($vn_c % $vn_num_table_columns)) {
                             $vs_output .= "</tr>\n";
                             $vn_c = 0;
                         }
                     }
                     if ($vb_use_table) {
                         $vs_output .= "</table>";
                     }
                 }
                 break;
                 # ---------------------------------
             # ---------------------------------
             case 'DT_STATEPROV_LIST':
                 $vs_output .= caHTMLSelect("pref_{$ps_pref}_select", array(), array('id' => "pref_{$ps_pref}_select", 'class' => $vs_classname), array('value' => $vs_current_value));
                 $vs_output .= caHTMLTextInput("pref_{$ps_pref}_name", array('id' => "pref_{$ps_pref}_text", 'value' => $vs_current_value, 'class' => $vs_classname));
                 break;
                 # ---------------------------------
             # ---------------------------------
             case 'DT_COUNTRY_LIST':
                 $vs_output .= caHTMLSelect("pref_{$ps_pref}", caGetCountryList(), array('id' => "pref_{$ps_pref}", 'class' => $vs_classname), array('value' => $vs_current_value));
                 if ($va_pref_info['stateProvPref']) {
                     $vs_output .= "<script type='text/javascript'>\n";
                     $vs_output .= "var caStatesByCountryList = " . json_encode(caGetStateList()) . ";\n";
                     $vs_output .= "\n\t\t\t\t\t\t\tjQuery('#pref_{$ps_pref}').click({countryID: 'pref_{$ps_pref}', stateProvID: 'pref_" . $va_pref_info['stateProvPref'] . "', value: '" . addslashes($this->getPreference($va_pref_info['stateProvPref'])) . "', statesByCountryList: caStatesByCountryList}, caUI.utils.updateStateProvinceForCountry);\n\t\t\t\t\t\t\tjQuery(document).ready(function() {\n\t\t\t\t\t\t\t\tcaUI.utils.updateStateProvinceForCountry({data: {countryID: 'pref_{$ps_pref}', stateProvID: 'pref_" . $va_pref_info['stateProvPref'] . "', value: '" . addslashes($this->getPreference($va_pref_info['stateProvPref'])) . "', statesByCountryList: caStatesByCountryList}});\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t";
                     $vs_output .= "</script>\n";
                 }
                 break;
                 # ---------------------------------
             # ---------------------------------
             case 'DT_CURRENCIES':
                 $vs_output .= caHTMLSelect("pref_{$ps_pref}", caAvailableCurrenciesForConversion(), array('id' => "pref_{$ps_pref}", 'class' => $vs_classname), array('value' => $vs_current_value));
                 break;
                 # ---------------------------------
             # ---------------------------------
             case 'DT_RADIO_BUTTONS':
                 foreach ($va_pref_info["choiceList"] as $vs_opt => $vs_val) {
                     $vs_selected = $vs_val == $vs_current_value ? "CHECKED" : "";
                     $vs_output .= "<input type='radio' name='pref_{$ps_pref}'" . $vs_class . " value='" . htmlspecialchars($vs_val, ENT_QUOTES, 'UTF-8') . "' {$vs_selected}> " . $vs_opt . " \n";
                 }
                 break;
                 # ---------------------------------
             # ---------------------------------
             case 'DT_PASSWORD':
                 if (($vn_display_width = $va_pref_info["displayWidth"]) < 1) {
                     $vn_display_width = 20;
                 }
                 if (isset($va_pref_info["length"]["maximum"])) {
                     $vn_max_input_length = $va_pref_info["length"]["maximum"];
                 } else {
                     $vn_max_input_length = $vn_display_width;
                 }
                 $vs_output = "<input type='password' name='pref_{$ps_pref}' size='{$vn_display_width}' maxlength='{$vn_max_input_length}'" . $vs_class . " value='" . htmlspecialchars($vs_current_value, ENT_QUOTES, 'UTF-8') . "'/>\n";
                 break;
                 # ---------------------------------
             # ---------------------------------
             default:
                 return "Configuration error: Invalid display type for {$ps_pref}";
                 # ---------------------------------
         }
         if (is_null($ps_format)) {
             if (isset($pa_options['field_errors']) && is_array($pa_options['field_errors']) && sizeof($pa_options['field_errors'])) {
                 $ps_format = $this->_CONFIG->get('form_element_error_display_format');
                 $va_field_errors = array();
                 foreach ($pa_options['field_errors'] as $o_e) {
                     $va_field_errors[] = $o_e->getErrorDescription();
                 }
                 $vs_errors = join('; ', $va_field_errors);
             } else {
                 $ps_format = $this->_CONFIG->get('form_element_display_format');
                 $vs_errors = '';
             }
         }
         if ($ps_format && $vs_output) {
             $vs_format = $ps_format;
             $vs_format = str_replace("^ELEMENT", $vs_output, $vs_format);
         } else {
             $vs_format = $vs_output;
         }
         $vs_format = str_replace("^EXTRA", '', $vs_format);
         if (preg_match("/\\^DESCRIPTION/", $vs_format)) {
             $vs_format = str_replace("^LABEL", _t($va_pref_info["label"]), $vs_format);
             $vs_format = str_replace("^DESCRIPTION", _t($va_pref_info["description"]), $vs_format);
         } else {
             // no explicit placement of description text, so...
             $vs_field_id = "pref_{$ps_pref}_container";
             $vs_format = str_replace("^LABEL", '<span id="' . $vs_field_id . '">' . _t($va_pref_info["label"]) . '</span>', $vs_format);
             TooltipManager::add('#' . $vs_field_id, "<h3>" . $va_pref_info["label"] . "</h3>" . $va_pref_info["description"]);
         }
         return $vs_format;
     } else {
         return "";
     }
 }
コード例 #18
0
						<div style="float:right;">
							<span id="{fieldNamePrefix}edit_{n}"><?php 
print urldecode(caNavLink($this->request, caNavIcon($this->request, __CA_NAV_BUTTON_EDIT__, null, array('alt' => _t('Edit unit'), 'title' => _t('Edit unit')), array('graphicsPath' => $this->getVar('graphicsPath'))), '', 'administrate/setup/bundle_mapping_group_editor', 'BundleMappingGroupEditor', 'Edit', array('group_id' => '{group_id}')));
?>
</span>
							<a href="#" class="caDeleteItemButton"><?php 
print caNavIcon($this->request, __CA_NAV_BUTTON_DEL_BUNDLE__, null, null, array('graphicsPath' => $this->getVar('graphicsPath')));
?>
</a>
						</div>
					</td>
				</tr>
			</table>
		</div>
<?php 
print TooltipManager::getLoadHTML('bundle_ca_bundle_mapping_groups');
?>
	</textarea>
	
	<div class="bundleContainer">
		<div class="caItemList">
		
		</div>
		<div class='button labelInfo caAddItemButton'><a href='#'><?php 
print caNavIcon($this->request, __CA_NAV_BUTTON_ADD__, null, null, array('graphicsPath' => $this->getVar('graphicsPath')));
?>
 <?php 
print _t("Add unit");
?>
 &rsaquo;</a></div>
	</div>
コード例 #19
0
        print "<div class='collectionMap'>" . $o_map->render('HTML') . "</div>";
        print "<div class='collectionMapLabel'>";
        foreach ($va_geoferences as $o_georeference) {
            foreach ($o_georeference->getValues() as $o_value) {
                $va_coord = $o_value->getDisplayValue(array('coordinates' => true));
                print caNavLink($this->request, trim($va_coord['label']), '', '', 'Browse', 'clearAndAddCriteria', array('target' => 'ca_collections', 'facet' => 'geoloc_facet', 'id' => trim($va_coord['label'])));
            }
            print "<br/>";
        }
        print "</div>";
        print "</div><!-- end unit -->";
    }
    # --- rights
    if ($vs_tmp = $t_occurrence->get("ca_occurrences.RightsSummaryNHF.NHFRightsSummaryPub", array('convertCodesToDisplayText' => true))) {
        print "\n<div class='unit'><div class='infoButton' id='rights'><img src='" . $this->request->getThemeUrlPath() . "/graphics/nhf/b_info.gif' width='14' height='14' border='0' style='vertical-align:sub;'></div><div class='heading'>" . _t("Rights") . "</div><div>{$vs_tmp}</div></div><!-- end unit -->";
        TooltipManager::add("#rights", "<div class='infoTooltip'>Rights description.</div>");
    }
    # --- dislay list of items associated to this occ - film
    ?>
		<div id="resultBox">
<?php 
}
$qr_hits = $this->getVar('browse_results');
$vn_num_results = $qr_hits->numHits();
$vn_current_page = $this->getVar('page');
$vn_items_per_page = $this->getVar('items_per_page');
$vn_total_pages = $this->getVar('num_pages');
if ($vn_num_results > 0) {
    $vn_itemc = 0;
    ?>
				<div class="divide" style="margin: 0px 0px 25px 0px;"><!-- empty --></div>
コード例 #20
0
 /**
  * Return attribute display value. 
  *
  * @param array $pa_options
  * @return string
  *
  * Options:
  *	showMediaInfo - if true media info (dimensions, filesize, bit depth) is returns as part of display; default is false
  *	version - name of media version to return; default is 'thumbnail'
  *  return - valid settings are url, tag, path; if set to a valid value then the url, tag or path for the media is returned rather than display HTML
  *
  * You can also pass other options to be passed-through to the underlying media plugin. Useful ones for video include:
  *		viewer_width		(also used for audio and tilepic image versions)
  *		viewer_height		(also used for audio and tilepic image versions)
  *		poster_frame_version (which will be transformed into the correct poster_frame_url)
  */
 public function getDisplayValue($pa_options = null)
 {
     if (!is_array($pa_options)) {
         $pa_options = array();
     }
     if (isset($pa_options['forDuplication']) && $pa_options['forDuplication']) {
         $pa_options['return'] = 'path';
         $pa_options['version'] = 'original';
     }
     if (!isset($pa_options['showMediaInfo'])) {
         $pa_options['showMediaInfo'] = false;
     }
     if (!isset($pa_options['version'])) {
         $pa_options['version'] = 'thumbnail';
     }
     $vs_version = $pa_options['version'];
     $vs_class = trim(isset($pa_options['class']) && $pa_options['class'] ? $pa_options['class'] : '');
     if (!isset($pa_options['return'])) {
         $pa_options['return'] = null;
     } else {
         $pa_options['return'] = strtolower($pa_options['return']);
     }
     switch ($pa_options['return']) {
         case 'url':
             return $this->opo_media_info_coder->getMediaUrl($this->opa_media_data, $vs_version);
             break;
         case 'tag':
             return $this->opo_media_info_coder->getMediaTag($this->opa_media_data, $vs_version);
             break;
         case 'path':
             return $this->opo_media_info_coder->getMediaPath($this->opa_media_data, $vs_version);
             break;
     }
     if ($vs_url = $this->opo_media_info_coder->getMediaUrl($this->opa_media_data, 'original')) {
         AssetLoadManager::register('panel');
         $va_info = $this->opo_media_info_coder->getMediaInfo($this->opa_media_data);
         $vs_dimensions = '';
         if ($pa_options['showMediaInfo']) {
             $va_dimensions = array($va_info['INPUT']['MIMETYPE']);
             if ($va_info['ORIGINAL_FILENAME']) {
                 $vs_filename = $va_info['ORIGINAL_FILENAME'];
             } else {
                 $vs_filename = _t('Uploaded file');
             }
             if (isset($va_info['original']['WIDTH']) && isset($va_info['original']['HEIGHT'])) {
                 if (($vn_w = $va_info['original']['WIDTH']) && ($vn_h = $va_info['original']['WIDTH'])) {
                     $va_dimensions[] = $va_info['original']['WIDTH'] . 'p x ' . $va_info['original']['HEIGHT'] . 'p';
                 }
             }
             if (isset($va_info['original']['PROPERTIES']['bitdepth']) && ($vn_depth = $va_info['original']['PROPERTIES']['bitdepth'])) {
                 $va_dimensions[] = intval($vn_depth) . ' bpp';
             }
             if (isset($va_info['original']['PROPERTIES']['colorspace']) && ($vs_colorspace = $va_info['original']['PROPERTIES']['colorspace'])) {
                 $va_dimensions[] = $vs_colorspace;
             }
             if (isset($va_info['original']['PROPERTIES']['resolution']) && is_array($va_resolution = $va_info['original']['PROPERTIES']['resolution'])) {
                 if (isset($va_resolution['x']) && isset($va_resolution['y']) && $va_resolution['x'] && $va_resolution['y']) {
                     // TODO: units for resolution? right now assume pixels per inch
                     if ($va_resolution['x'] == $va_resolution['y']) {
                         $va_dimensions[] = $va_resolution['x'] . 'ppi';
                     } else {
                         $va_dimensions[] = $va_resolution['x'] . 'x' . $va_resolution['y'] . 'ppi';
                     }
                 }
             }
             if (isset($va_info['original']['PROPERTIES']['duration']) && ($vn_duration = $va_info['original']['PROPERTIES']['duration'])) {
                 $va_dimensions[] = sprintf("%4.1f", $vn_duration) . 's';
             }
             if (isset($va_info['original']['PROPERTIES']['pages']) && ($vn_pages = $va_info['original']['PROPERTIES']['pages'])) {
                 $va_dimensions[] = $vn_pages . ' ' . ($vn_pages == 1 ? _t('page') : _t('pages'));
             }
             if (!isset($va_info['original']['PROPERTIES']['filesize']) || !($vn_filesize = $va_info['original']['PROPERTIES']['filesize'])) {
                 $vn_filesize = 0;
             }
             if ($vn_filesize) {
                 $va_dimensions[] = sprintf("%4.1f", $vn_filesize / (1024 * 1024)) . 'mb';
             }
             if (!isset($va_info['PROPERTIES']['filesize']) || !($vn_filesize = $va_info['PROPERTIES']['filesize'])) {
                 $vn_filesize = @filesize($this->opo_media_info_coder->getMediaPath($this->opa_media_data, 'original'));
             }
             if ($vn_filesize) {
                 $va_dimensions[] = sprintf("%4.2f", $vn_filesize / (1024 * 1024)) . 'mb';
             }
             $vs_dimensions = join('; ', $va_dimensions);
         }
         if (isset($pa_options['poster_frame_version']) && $pa_options['poster_frame_version']) {
             $pa_options['poster_frame_url'] = $this->opo_media_info_coder->getMediaUrl($this->opa_media_data, $pa_options['poster_frame_version']);
         }
         $vs_tag = $this->opo_media_info_coder->getMediaTag($this->opa_media_data, $vs_version, $pa_options);
         if (is_object($pa_options['request'])) {
             $vs_view_url = urldecode(caNavUrl($pa_options['request'], $pa_options['request']->getModulePath(), $pa_options['request']->getController(), 'GetMediaOverlay', array('value_id' => $this->opn_value_id)));
             $vs_val = "<div id='caMediaAttribute" . $this->opn_value_id . "' class='attributeMediaInfoContainer'>";
             $vs_val .= "<div class='attributeMediaThumbnail'>";
             $vs_val .= "<div style='float: left;'>" . urlDecode(caNavLink($pa_options['request'], caNavIcon($pa_options['request'], __CA_NAV_BUTTON_DOWNLOAD__, array('align' => 'middle')), '', $pa_options['request']->getModulePath(), $pa_options['request']->getController(), 'DownloadAttributeMedia', array('download' => 1, 'value_id' => $this->opn_value_id), array('class' => 'attributeDownloadButton'))) . "</div>";
             $vs_val .= "<a href='#' onclick='caMediaPanel.showPanel(\"{$vs_view_url}\"); return false;'>{$vs_tag}</a>";
             $vs_val .= "</div>";
             if ($pa_options['showMediaInfo']) {
                 $vs_val .= "<div class='attributeMediaInfo'><p>{$vs_filename}</p><p>{$vs_dimensions}</p></div>";
             }
             $vs_val .= "</div>";
         } else {
             $vs_val = "<div id='caMediaAttribute" . $this->opn_value_id . "' class='attributeMediaInfoContainer'><div class='attributeMediaThumbnail'>{$vs_tag}</div></div>";
         }
         if ($pa_options['showMediaInfo']) {
             TooltipManager::add('#caMediaAttribute' . $this->opn_value_id, "<h2>" . _t('Media details') . "</h2> <p>{$vs_filename}</p><p>{$vs_dimensions}</p>");
         }
     }
     return $vs_val;
 }
コード例 #21
0
/**
 * Formats communication for display in messages list in Pawtucket
 *
 * @param RequestHTTP $po_request
 * @param array $pa_data
 * @param array $pa_options
 *		viewContentDivID = 
 *		additionalMessages =
 *		isAdditionalMessage =
 *
 * @return string 
 */
function caClientServicesFormatMessageSummaryPawtucket($po_request, $pa_data, $pa_options = null)
{
    $vb_is_additional_message = (bool) (isset($pa_options['isAdditionalMessage']) && $pa_options['isAdditionalMessage']);
    $vb_is_unread = !(bool) $pa_data['read_on'];
    $vs_unread_class = $vb_is_unread ? "caClientCommunicationsMessageSummaryUnread" : "";
    if ($po_request->getUserID() == $pa_data['from_user_id']) {
        $vb_is_unread = false;
        $vs_unread_class = '';
    }
    // if the message was created by the user it's already show as "read"
    if ($vb_is_additional_message) {
        $vs_class = $vb_is_unread ? "caClientCommunicationsAdditionalMessageSummary caClientCommunicationsMessageSummaryUnread" : "caClientCommunicationsAdditionalMessageSummary";
        $vs_buf = "<div class='{$vs_class}' id='caClientCommunicationsMessage_" . $pa_data['communication_id'] . "'>";
    } else {
        $vs_class = $vb_is_unread ? "caClientCommunicationsMessageSummary caClientCommunicationsMessageSummaryUnread" : "caClientCommunicationsMessageSummary";
        $vs_buf = "<div class='{$vs_class}'>";
    }
    $vs_buf .= "<div class='caClientCommunicationsMessageSummaryContainer' id='caClientCommunicationsMessage_" . $pa_data['communication_id'] . "'>";
    $vs_buf .= "<div class='caClientCommunicationsViewMessageIcon'>+</div>";
    TooltipManager::add(".caClientCommunicationsViewMessageIcon", _t("View entire message and associated media"));
    $vs_buf .= "<div class='caClientCommunicationsMessageSummaryFrom {$vs_unread_class}'><span class='caClientCommunicationsMessageSummaryHeading'>" . _t("From") . ":</span> " . caClientServicesGetSenderName($pa_data) . "</div>";
    $vs_buf .= "<div class='caClientCommunicationsMessageSummaryDate {$vs_unread_class}'><span class='caClientCommunicationsMessageSummaryHeading'>" . _t("Date") . ":</span> " . caGetLocalizedDate($pa_data['created_on'], array('dateFormat' => 'delimited')) . "</div>";
    $vs_buf .= "<div class='caClientCommunicationsMessageSummarySubject {$vs_unread_class}'><span class='caClientCommunicationsMessageSummaryHeading'>" . _t("Subject") . ":</span> " . $pa_data['subject'] . "</div>";
    $vs_buf .= "<div class='caClientCommunicationsMessageSummaryText'>" . (mb_strlen($pa_data['message']) > 300 ? mb_substr($pa_data['message'], 0, 300) . "..." : $pa_data['message']) . "</div>";
    $vs_buf .= "</div>";
    $vs_buf .= "</div>\n";
    $vn_num_additional_messages = is_array($pa_options['additionalMessages']) ? sizeof($pa_options['additionalMessages']) : 0;
    if ($vn_num_additional_messages) {
        $vs_buf .= "<div class='caClientCommunicationsMessageSummaryViewButton' id='caClientCommunicationsMessageAdditionalCount" . $pa_data['communication_id'] . "'><a href='#' onclick='jQuery(\"#caClientCommunicationsMessageAdditional" . $pa_data['communication_id'] . "\").slideToggle(250); jQuery(\".caClientCommunicationsMessageSummaryViewButton\").hide(); return false;' >" . _t("View thread") . " &rsaquo;</a></div>";
    }
    if ($vn_num_additional_messages) {
        $vs_buf .= "<div class='caClientCommunicationsMessageAdditional' id='caClientCommunicationsMessageAdditional" . $pa_data['communication_id'] . "'>";
        $pa_additional_options = $pa_options;
        unset($pa_additional_options['additionalMessages']);
        $pa_additional_options['isAdditionalMessage'] = true;
        foreach ($pa_options['additionalMessages'] as $va_additional_message) {
            $vs_buf .= caClientServicesFormatMessageSummaryPawtucket($po_request, $va_additional_message, $pa_additional_options);
        }
        $vs_buf .= "</div>";
    }
    return $vs_buf;
}
コード例 #22
0
        print "</td>";
        TooltipManager::add("#{$vs_id_prefix}_media_{$vs_version}_label", $t_subject->getMediaTag('media', $vs_version), "{$vs_id_prefix}_media_tooltips");
        $vn_i++;
        if ($vn_i > 2) {
            print "</tr>\n";
            $vn_i = 0;
        }
    }
    if ($vn_i > 0) {
        print "</tr>\n";
    }
    ?>
			</table>
			<div class="objectRepresentationMediaDisplayDerivativeHelpText" id="<?php 
    print "{$vs_id_prefix}_derivative_options_help_text";
    ?>
">
				<?php 
    print _t("Use the controls above to replace existing preview images for this representation. If <em>Update with uploaded media</em> is checked then the media you have selected for upload will be used to generate the replacement previews. For PDF and video representations you may alternatively elect to generate new previews from a specific page or frame using the <em>Update using page</em> and <em>Update using frame at timecode</em> options. You can control which preview versions are generated by checking or unchecking options in the <em>Update preview versions</em> section. Note that replacement of preview images will be performed only if the master <em>Modify preview images</em> checkbox is checked. If unchecked the uploaded media will completely replace <strong>all</strong> media and previews associated with this representation.");
    ?>
			</div>
		</div>
	</div>
<?php 
}
?>
	</div>
</div>
<?php 
print TooltipManager::getLoadHTML("{$vs_id_prefix}_media_tooltips");
コード例 #23
0
ファイル: set_info_html.php プロジェクト: guaykuru/pawtucket
    ?>
		<div class="textContent"><?php 
    print $vs_set_description;
    ?>
</div>
<?php 
}
foreach ($va_items as $va_item) {
    ?>
		<div class="setItem" id="item<?php 
    print $va_item['item_id'];
    ?>
">
			<a href="#" onclick="caMediaPanel.showPanel('<?php 
    print caNavUrl($this->request, 'simpleGallery', 'Show', 'setItemInfo', array('set_item_id' => $va_item['item_id'], 'set_id' => $t_set->get("set_id")));
    ?>
'); return false;"><?php 
    print $va_item['representation_tag_widepreview'];
    ?>
</a>
		</div>
<?php 
    if ($va_item['caption'] || $va_item['representation_tag_medium']) {
        // set view vars for tooltip
        $this->setVar('tooltip_image_name', $va_item['name']);
        $this->setVar('tooltip_text', preg_replace('![\\n\\r]+!', '<br/><br/>', addslashes($va_item['caption'])));
        $this->setVar('tooltip_image', $va_item['representation_tag_medium']);
        TooltipManager::add("#item{$va_item['item_id']}", $this->render('default/tooltip_html.php'));
    }
}
print "</div><!-- end setItemsGrid -->";
 /**
  * Override's BaseModel method to intercept calls for field 'idno'; uses the specified IDNumbering
  * plugin to generate HTML for idno. If no plugin is specified then the call is passed on to BaseModel::htmlFormElement()
  * Calls for fields other than idno are passed to BaseModel::htmlFormElement()
  */
 public function htmlFormElement($ps_field, $ps_format = null, $pa_options = null)
 {
     if (!is_array($pa_options)) {
         $pa_options = array();
     }
     foreach (array('name', 'form_name', 'request', 'field_errors', 'display_form_field_tips', 'no_tooltips', 'label', 'readonly') as $vs_key) {
         if (!isset($pa_options[$vs_key])) {
             $pa_options[$vs_key] = null;
         }
     }
     if (!$this->opo_idno_plugin_instance) {
         $this->loadIDNoPlugInInstance($pa_options);
     }
     if ($ps_field == $this->getProperty('ID_NUMBERING_ID_FIELD') && $this->opo_idno_plugin_instance && $pa_options['request']) {
         $vs_idno_fld = $this->getProperty('ID_NUMBERING_ID_FIELD');
         if ($vn_parent_id = $this->get($this->getProperty('HIERARCHY_PARENT_ID_FLD'))) {
             $this->opo_idno_plugin_instance->isChild(true);
         }
         // if it has a parent_id then set the id numbering plugin using "child_only" numbering schemes (if defined)
         if (!$this->getPrimaryKey() && $vn_parent_id && $this->opo_idno_plugin_instance->isChild()) {
             $t_parent = $this->getAppDatamodel()->getInstanceByTableName($this->tableName(), false);
             if ($this->inTransaction()) {
                 $t_parent->setTransaction($this->getTransaction());
             }
             if ($t_parent->load($vn_parent_id)) {
                 $this->set($vs_idno_fld, $x = $this->opo_idno_plugin_instance->makeTemplateFromValue($t_parent->get($vs_idno_fld), 1, true));
                 // chop off last serial element
             }
         }
         $this->opo_idno_plugin_instance->setValue($this->get($ps_field));
         if (method_exists($this, "getTypeCode")) {
             $this->opo_idno_plugin_instance->setType($this->getTypeCode());
         }
         $vs_element = $this->opo_idno_plugin_instance->htmlFormElement($ps_field, $va_errors, array_merge($pa_options, array('error_icon' => $pa_options['request']->getThemeUrlPath() . "/graphics/icons/warning_small.gif", 'progress_indicator' => $pa_options['request']->getThemeUrlPath() . "/graphics/icons/indicator.gif", 'show_errors' => $this->getPrimaryKey() ? true : false, 'context_id' => isset($pa_options['context_id']) ? $pa_options['context_id'] : null, 'table' => $this->tableName(), 'row_id' => $this->getPrimaryKey(), 'check_for_dupes' => true, 'search_url' => caSearchUrl($pa_options['request'], $this->tableName(), ''))));
         if (is_null($ps_format)) {
             if (isset($pa_options['field_errors']) && is_array($pa_options['field_errors']) && sizeof($pa_options['field_errors'])) {
                 $ps_format = $this->_CONFIG->get('bundle_element_error_display_format');
                 $va_field_errors = array();
                 foreach ($pa_options['field_errors'] as $o_e) {
                     $va_field_errors[] = $o_e->getErrorDescription();
                 }
                 $vs_errors = join('; ', $va_field_errors);
             } else {
                 $ps_format = $this->_CONFIG->get('bundle_element_display_format');
                 $vs_errors = '';
             }
         }
         if ($ps_format != '') {
             $ps_formatted_element = $ps_format;
             $ps_formatted_element = str_replace("^ELEMENT", $vs_element, $ps_formatted_element);
             $va_attr = $this->getFieldInfo($ps_field);
             foreach (array('DISPLAY_DESCRIPTION', 'DESCRIPTION', 'LABEL', 'DESCRIPTION') as $vs_key) {
                 if (!isset($va_attr[$vs_key])) {
                     $va_attr[$vs_key] = null;
                 }
             }
             // TODO: should be in config file
             $pa_options["display_form_field_tips"] = true;
             if ($pa_options["display_form_field_tips"] || !isset($pa_options["display_form_field_tips"]) && $va_attr["DISPLAY_DESCRIPTION"] || !isset($pa_options["display_form_field_tips"]) && !isset($va_attr["DISPLAY_DESCRIPTION"]) && $vb_fl_display_form_field_tips) {
                 if (preg_match("/\\^DESCRIPTION/", $ps_formatted_element)) {
                     $ps_formatted_element = str_replace("^LABEL", isset($pa_options['label']) ? $pa_options['label'] : $va_attr["LABEL"], $ps_formatted_element);
                     $ps_formatted_element = str_replace("^DESCRIPTION", $va_attr["DESCRIPTION"], $ps_formatted_element);
                 } else {
                     // no explicit placement of description text, so...
                     $vs_field_id = '_' . $this->tableName() . '_' . $this->getPrimaryKey() . '_' . $pa_options["name"] . '_' . $pa_options['form_name'];
                     $ps_formatted_element = str_replace("^LABEL", '<span id="' . $vs_field_id . '">' . (isset($pa_options['label']) ? $pa_options['label'] : $va_attr["LABEL"]) . '</span>', $ps_formatted_element);
                     if (!$pa_options['no_tooltips']) {
                         TooltipManager::add('#' . $vs_field_id, "<h3>" . (isset($pa_options['label']) ? $pa_options['label'] : $va_attr["LABEL"]) . "</h3>" . $va_attr["DESCRIPTION"]);
                     }
                 }
             } else {
                 $ps_formatted_element = str_replace("^LABEL", isset($pa_options['label']) ? $pa_options['label'] : $va_attr["LABEL"], $ps_formatted_element);
                 $ps_formatted_element = str_replace("^DESCRIPTION", "", $ps_formatted_element);
             }
             $ps_formatted_element = str_replace("^ERRORS", $vs_errors, $ps_formatted_element);
             $vs_element = $ps_formatted_element;
         }
         return $vs_element;
     } else {
         return parent::htmlFormElement($ps_field, $ps_format, $pa_options);
     }
 }
コード例 #25
0
ファイル: pageFooter.php プロジェクト: guaykuru/pawtucket
		<li><a href="http://limerick.ie/learning/">Learning</a></li>
		<li><a href="http://limerick.ie/kids/">Kids</a></li>
		<li><a href="http://limerick.ie/homeitems/about/">About</a></li>
		<li><a href="http://limerick.ie/contact/">Contact</a></li>
		<li><a href="http://limerick.ie/homeitems/about/disclaimer/">Disclaimer</a></li>
		<li><a href="http://limerick.ie/homeitems/about/accessibility/">Accessibility</a></li>
		<li><a href="http://limerick.ie/homeitems/about/privacy/">Privacy</a></li>
	</ul>
	
	<address>Phone: 00353 (0)61 400010 &nbsp; <span>&#124;</span> &nbsp; Fax: 00353 (0)61 400355 &nbsp; <span>&#124;</span> &nbsp; Email: <a href="mailto:webservices@limerickcity.ie">webservices@limerickcity.ie</a></address>
	
	<p>&copy; 2009-2011 Limerick City Council</p>
	
</div>
<?php 
print TooltipManager::getLoadHTML();
?>
	<div id="caMediaPanel"> 
		<div id="close"><a href="#" onclick="caMediaPanel.hidePanel(); return false;">&nbsp;&nbsp;&nbsp;</a></div>
		<div id="caMediaPanelContentArea">
		
		</div>
	</div>
	<script type="text/javascript">
	/*
		Set up the "caMediaPanel" panel that will be triggered by links in object detail
		Note that the actual <div>'s implementing the panel are located here in views/pageFormat/pageFooter.php
	*/
	var caMediaPanel;
	jQuery(document).ready(function() {
		if (caUI.initPanel) {
コード例 #26
0
                    $va_bundle_settings[$vs_key] = str_ireplace("<l>", "", str_ireplace("</l>", "", $vm_val));
                }
            }
            if (is_array($va_history = $t_object->getObjectHistory($va_bundle_settings, array('displayLabelOnly' => false, 'limit' => 1, 'currentOnly' => true))) && sizeof($va_history) > 0) {
                $va_current_location = array_shift(array_shift($va_history));
                if ($va_current_location['display']) {
                    print "<div class='inspectorCurrentLocation'><strong>" . _t('Current') . '</strong><br/>' . $va_current_location['display'] . "</div>";
                }
            }
        } elseif (method_exists($t_object, "getLastLocationForDisplay")) {
            // If no ca_objects_history bundle is configured then display the last storage location
            if ($vs_current_location = $t_object->getLastLocationForDisplay("<ifdef code='ca_storage_locations.parent.preferred_labels'>^ca_storage_locations.parent.preferred_labels ➜ </ifdef>^ca_storage_locations.preferred_labels.name")) {
                print "<br/><div class='inspectorCurrentLocation'>" . _t('Location: %1', $vs_current_location) . "</div>\n";
                $vs_full_location_hierarchy = $t_object->getLastLocationForDisplay("^ca_storage_locations.hierarchy.preferred_labels.name%delimiter=_➜_");
                if ($vs_full_location_hierarchy !== $vs_current_location) {
                    TooltipManager::add(".inspectorCurrentLocation", $vs_full_location_hierarchy);
                }
            }
        }
    }
} else {
    print "access restricted";
}
?>
					<!--{{{<ifcount min="1" code="ca_objects.legacy_locations.legacy_location"><div class='unit wide'><span class='metaHeader'>Legacy Locations</span><unit delimiter="<br/>">^ca_objects.legacy_locations.legacy_location <ifdef code="ca_objects.legacy_locations.sublocation">- ^ca_objects.legacy_locations.sublocation</ifdef> <ifdef code="ca_objects.legacy_locations.via">(via ^ca_objects.legacy_locations.via)</ifdef><ifdef code="ca_objects.legacy_locations.legacy_location_date"> as of ^ca_objects.legacy_locations.legacy_location_date</ifdef></unit></div></ifcount>}}}-->
				</div>
				
				<div id="Financial" class="infoBlock">
<?php 
if ($this->request->user->hasUserRole("founders_new") || $this->request->user->hasUserRole("admin") || $this->request->user->hasUserRole("curatorial_all_new")) {
    if ($va_source = $t_object->get('ca_entities.preferred_labels', array('restrictToRelationshipTypes' => array('source', 'advisor'), 'returnAsLink' => true))) {
コード例 #27
0
ファイル: splash_html.php プロジェクト: guaykuru/pawtucket
		<div class="item detail">
<?php 
#		print $this->render('Splash/splash_intro_text_html.php');
?>
 

		</div>			


			
		<div class="item detail"><div class="description" style="margin-top:20px;"><?php 
print caNavLink($this->request, '<img src="' . $this->request->getThemeUrlPath(true) . '/graphics/feed.gif" border="0" title="' . _t('Get alerted to newly added items by RSS') . '" width="14" height="14"/> ' . _t('Get alerted to newly added items by RSS'), '', '', 'Feed', 'recentlyAdded');
?>
</div></div>
	</div>
	

<?php 
TooltipManager::add('#splashRandomObject', $this->getVar("random_object_medium") . "<br/><div class='tooltipCaption'>" . $this->getVar('random_object_title') . "</div>");
TooltipManager::add('#splashRecentlyViewed', $this->getVar("recently_viewed_medium") . "<br/><div class='tooltipCaption'>" . $this->getVar('recently_viewed_title') . "</div>");
TooltipManager::add('#splashRecentlyAdded', $this->getVar("recently_added_medium") . "<br/><div class='tooltipCaption'>" . $this->getVar('recently_added_title') . "</div>");
?>
<!--<script type="text/javascript">
$(document).ready(function() {
   $('#hpFeatured').cycle({
               fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
               speed:  1000,
               timeout: 4000
       });
});
</script>-->
コード例 #28
0
ファイル: ca_list_items.php プロジェクト: guaykuru/pawtucket
			showEmptyFormsOnLoad: 1,
			relationshipTypes: <?php 
print json_encode($this->getVar('relationship_types_by_sub_type'));
?>
,
			autocompleteUrl: '<?php 
print caNavUrl($this->request, 'lookup', 'Vocabulary', 'Get', array());
?>
',
			lists: <?php 
print json_encode($va_settings['restrict_to_lists']);
?>
,
			types: <?php 
print json_encode($va_settings['restrict_to_types']);
?>
,
			isSortable: true,
			listSortOrderID: '<?php 
print $vs_id_prefix;
?>
BundleList',
			listSortItems: 'div.roundedRel'
		});
	});
</script>

<?php 
foreach ($va_initial_values as $vn_id => $va_info) {
    TooltipManager::add("#{$vs_id_prefix}_edit_related_{$vn_id}", "<h2>" . $va_info['_display'] . "</h2>");
}
コード例 #29
0
        print "<div class='unit'><div class='infoButton' id='collection_access_repos'><img src='" . $this->request->getThemeUrlPath() . "/graphics/nhf/b_info.gif' width='14' height='14' border='0' style='vertical-align:sub;'></div><div class='heading'>" . _t("Repository") . "</div><div>{$vs_tmp}</div></div><!-- end unit -->";
        TooltipManager::add("#collection_access_repos", "<div class='infoTooltip'>Location where the collection is stored.</div>");
    }
    # --- access
    if ($vs_tmp = $t_collection->get('ca_collections.collection_access', array('convertCodesToDisplayText' => true))) {
        print "<div class='unit'><div class='infoButton' id='access'><img src='" . $this->request->getThemeUrlPath() . "/graphics/nhf/b_info.gif' width='14' height='14' border='0' style='vertical-align:sub;'></div><div class='heading'>" . _t("Availability") . "</div><div>{$vs_tmp}</div></div><!-- end unit -->";
        TooltipManager::add("#access", "<div class='infoTooltip'>Whether or not the collection is open for research.</div>");
    }
    # --- repro_use
    if ($t_collection->get('ca_collections.collection_repro_cond')) {
        print "<div class='unit'><div class='infoButton' id='repro_use'><img src='" . $this->request->getThemeUrlPath() . "/graphics/nhf/b_info.gif' width='14' height='14' border='0' style='vertical-align:sub;'></div><div class='heading'>" . _t("Condition Governing Reproduction and Use") . "</div><div>" . $t_collection->get('ca_collections.collection_repro_cond') . "</div></div><!-- end unit -->";
        TooltipManager::add("#repro_use", "<div class='infoTooltip'>Information regarding the use of the collection.</div>");
    }
    # --- download
    print "<div class='unit'><div class='infoButton' id='download'><img src='" . $this->request->getThemeUrlPath() . "/graphics/nhf/b_info.gif' width='14' height='14' border='0' style='vertical-align:sub;'></div><div class='heading'>" . _t("Encoded archival description") . "</div><div style='padding-top:5px;'>" . caNavLink($this->request, "<img src='" . $this->request->getThemeUrlPath() . "/graphics/nhf/b_download.jpg' width='90' height='33' border='0' style='vertical-align:middle;'> " . _t("(EAD XML file)"), '', 'Detail', 'Collection', 'exportItem', array('collection_id' => $vn_collection_id, 'mapping' => 'nhf_standard_ead', 'download' => 1)) . "</div></div><!-- end unit -->";
    TooltipManager::add("#download", "<div class='infoTooltip'>Encoded Archival Description is an XML standard for encoding archival finding aids.</div>");
    # --- dislay list of items in this collection
    ?>
		<div id="resultBox">
<?php 
}
$qr_hits = $this->getVar('browse_results');
$vn_num_results = $qr_hits->numHits();
$vn_current_page = $this->getVar('page');
$vn_items_per_page = $this->getVar('items_per_page');
$vn_total_pages = $this->getVar('num_pages');
if ($vn_num_results > 0) {
    $vn_itemc = 0;
    ?>
				<div class="divide" style="margin: 0px 0px 25px 0px;"><!-- empty --></div>
<?php 
コード例 #30
0
    ?>

		<h1><?php 
    print _t("Search results for %1", caUcFirstUTF8Safe($this->getVar('search')));
    ?>
</h1>
<?php 
    //
    // Print out block content (results for each type of search)
    //
    foreach ($this->getVar('blockNames') as $vs_block) {
        ?>
			<a name='<?php 
        print $vs_block;
        ?>
'></a>
			<div id="<?php 
        print $vs_block;
        ?>
Block" class='resultBlock'>
				<?php 
        print $va_results[$vs_block]['html'];
        ?>
			</div>
<?php 
    }
} else {
    print "<H1>" . _t("Your search for %1 returned no results", caUcFirstUTF8Safe($this->getVar('search'))) . "</H1>";
}
TooltipManager::add('#Block', 'Type of record');