本文整理汇总了PHP中TooltipManager::add方法的典型用法代码示例。如果您正苦于以下问题:PHP TooltipManager::add方法的具体用法?PHP TooltipManager::add怎么用?PHP TooltipManager::add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TooltipManager
的用法示例。
在下文中一共展示了TooltipManager::add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: htmlFormElement
/**
* Return HTML form elements for all elements using the current format, type and value
*
* @param string $ps_name Name of form element. Is used as a prefix for each form element. The number element name will be used as a suffix for each.
* @param array $pa_errors Passed-by-reference array. Will contain any validation errors for the value, indexed by element.
* @param array $pa_options Options include:
* id_prefix = Prefix to add to element ID attributes. [Default is null]
* for_search_form = Generate a blank form for search. [Default is false]
* show_errors = Include error messages next to form elements. [Default is false]
* error_icon = Icon to display next to error messages; should be ready-to-display HTML. [Default is null]
* readonly = Make all form elements read-only. [Default is false]
* request = the current request (an instance of RequestHTTP) [Default is null]
* check_for_dupes = perform live checking for duplicate numbers. [Default is false]
* progress_indicator = URL for spinner graphic to use while running duplicate number check. [Default is null]
* table = Table to perform duplicate number check in. [Default is null]
* search_url = Search service URL to use when performing duplicate number check. [Default is null]
* row_id = ID of row to exclude from duplicate number check (typically the current record id). [Default is null]
* context_id = context ID of row to exclude from duplicate number check (typically the current record context). [Default is null]
* @return string HTML output
*/
public function htmlFormElement($ps_name, &$pa_errors = null, $pa_options = null)
{
if (!is_array($pa_options)) {
$pa_options = array();
}
$vs_id_prefix = isset($pa_options['id_prefix']) ? $pa_options['id_prefix'] : null;
$vb_generate_for_search_form = isset($pa_options['for_search_form']) ? true : false;
$pa_errors = $this->validateValue($this->getValue());
$vs_separator = $this->getSeparator();
$va_element_vals = $this->explodeValue($this->getValue());
if (!is_array($va_elements = $this->getElements())) {
$va_elements = array();
}
$va_element_controls = $va_element_control_names = array();
$vn_i = 0;
$vb_next_in_seq_is_present = false;
foreach ($va_elements as $vs_element_name => $va_element_info) {
if ($va_element_info['type'] == 'SERIAL' && $va_element_vals[$vn_i] == '') {
$vb_next_in_seq_is_present = true;
}
$vs_tmp = $this->genNumberElement($vs_element_name, $ps_name, $va_element_vals[$vn_i], $vs_id_prefix, $vb_generate_for_search_form, $pa_options);
$va_element_control_names[] = $ps_name . '_' . $vs_element_name;
if ($pa_options['show_errors'] && isset($pa_errors[$vs_element_name])) {
$vs_error_message = preg_replace("/[\"\\']+/", "", $pa_errors[$vs_element_name]);
if ($pa_options['error_icon']) {
$vs_tmp .= "<a href='#'\" id='caIdno_{$vs_id_prefix}_{$ps_name}'><img src='" . $pa_options['error_icon'] . "' border='0'/></a>";
} else {
$vs_tmp .= "<a href='#'\" id='caIdno_{$vs_id_prefix}_{$ps_name}'>[" . _t('Error') . "]</a>";
}
TooltipManager::add("#caIdno_{$vs_id_prefix}_{$ps_name}", "<h2>" . _t('Error') . "</h2>{$vs_error_message}");
}
$va_element_controls[] = $vs_tmp;
$vn_i++;
}
if (sizeof($va_elements) < sizeof($va_element_vals) && (bool) $this->getFormatPropery('allow_extra_elements', array('default' => 1))) {
$va_extra_vals = array_slice($va_element_vals, sizeof($va_elements));
if (($vn_extra_size = (int) $this->getFormatPropery('extra_element_width', array('default' => 10))) < 1) {
$vn_extra_size = 10;
}
foreach ($va_extra_vals as $vn_i => $vs_extra_val) {
$va_element_controls[] = "<input type='text' name='{$ps_name}_extra_{$vn_i}' id='{$ps_name}_extra_{$vn_i}' value='" . htmlspecialchars($vs_extra_val, ENT_QUOTES, 'UTF-8') . "' size='{$vn_extra_size}'" . ($pa_options['readonly'] ? ' disabled="1" ' : '') . ">";
$va_element_control_names[] = $ps_name . '_extra_' . $vn_i;
}
}
$vs_js = '';
if ($pa_options['check_for_dupes'] && !$vb_next_in_seq_is_present) {
$va_ids = array();
foreach ($va_element_control_names as $vs_element_control_name) {
$va_ids[] = "'#" . $vs_id_prefix . $vs_element_control_name . "'";
}
$vs_js = '<script type="text/javascript" language="javascript">' . "\n// <![CDATA[\n";
$va_lookup_url_info = caJSONLookupServiceUrl($pa_options['request'], $pa_options['table']);
$vs_js .= "\n\t\t\t\tcaUI.initIDNoChecker({\n\t\t\t\t\terrorIcon: '" . $pa_options['error_icon'] . "',\n\t\t\t\t\tprocessIndicator: '" . $pa_options['progress_indicator'] . "',\n\t\t\t\t\tidnoStatusID: 'idnoStatus',\n\t\t\t\t\tlookupUrl: '" . $va_lookup_url_info['idno'] . "',\n\t\t\t\t\tsearchUrl: '" . $pa_options['search_url'] . "',\n\t\t\t\t\tidnoFormElementIDs: [" . join(',', $va_ids) . "],\n\t\t\t\t\tseparator: '" . $this->getSeparator() . "',\n\t\t\t\t\trow_id: " . intval($pa_options['row_id']) . ",\n\t\t\t\t\tcontext_id: " . intval($pa_options['context_id']) . ",\n\n\t\t\t\t\tsingularAlreadyInUseMessage: '" . addslashes(_t('Identifier is already in use')) . "',\n\t\t\t\t\tpluralAlreadyInUseMessage: '" . addslashes(_t('Identifier is already in use %1 times')) . "'\n\t\t\t\t});\n\t\t\t";
$vs_js .= "// ]]>\n</script>\n";
}
return join($vs_separator, $va_element_controls) . $vs_js;
}
示例2: caBatchEditorInspector
/**
* 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> ›</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: settingHTMLFormElement
/**
* 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: caClientServicesFormatMessageSummaryPawtucket
/**
* 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") . " ›</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;
}
示例5: foreach
?>
<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 -->";
示例6: preferenceHtmlFormElement
/**
* 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();
//.........这里部分代码省略.........
示例7: foreach
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>
示例8: caNavLink
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>";
?>
示例9: join
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>";
示例10: foreach
</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
示例11: settingHTMLFormElement
//.........这里部分代码省略.........
$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;
}
示例12: _t
?>
<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');
示例13:
$vs_tooltip_text .= "<b>Alt ID: </b>" . $va_set_item_metadata[$va_item['row_id']]["altid"] . "<br/>";
}
if ($va_set_item_metadata[$va_item['row_id']]["filename"]) {
$vs_tooltip_text .= "<b>Title: </b>" . $va_set_item_metadata[$va_item['row_id']]["filename"] . "<br/>";
}
if ($va_set_item_metadata[$va_item['row_id']]["title"]) {
$vs_tooltip_text .= "<b>Publication Title: </b>" . $va_set_item_metadata[$va_item['row_id']]["title"] . "<br/>";
}
if ($va_set_item_metadata[$va_set_item_metadata[$va_item['row_id']]["author"]]) {
$vs_tooltip_text .= "<b>Author: </b>" . $va_set_item_metadata[$va_item['row_id']]["author"] . "<br/>";
}
if ($va_set_item_metadata[$va_item['row_id']]["publication"]) {
$vs_tooltip_text .= "<b>Publication Name: </b>" . $va_set_item_metadata[$va_item['row_id']]["publication"];
}
$vs_tooltip_text .= "</div>";
TooltipManager::add("#setItem" . $vn_item_id, $vs_tooltip_text);
# }
}
}
?>
</ul>
</div><!-- end setItems -->
</div><!-- leftCol -->
<?php
if ($vn_edit_access) {
?>
<script type="text/javascript">
jQuery(".setDeleteButton").click(
function() {
var id = this.id.replace('setItemDelete', '');
jQuery.getJSON('<?php
示例14: caEditorInspector
/**
* 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 caEditorInspector($po_view, $pa_options = null)
{
require_once __CA_MODELS_DIR__ . '/ca_sets.php';
require_once __CA_MODELS_DIR__ . '/ca_data_exporters.php';
$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';
}
$vn_item_id = $t_item->getPrimaryKey();
$o_result_context = $po_view->getVar('result_context');
$t_ui = $po_view->getVar('t_ui');
$t_type = method_exists($t_item, "getTypeInstance") ? $t_item->getTypeInstance() : null;
$vs_type_name = method_exists($t_item, "getTypeName") ? $t_item->getTypeName() : '';
if (!$vs_type_name) {
$vs_type_name = $t_item->getProperty('NAME_SINGULAR');
}
$va_reps = $po_view->getVar('representations');
$o_dm = Datamodel::load();
if ($t_item->isHierarchical()) {
$va_ancestors = $po_view->getVar('ancestors');
$vn_parent_id = $t_item->get($t_item->getProperty('HIERARCHY_PARENT_ID_FLD'));
} else {
$va_ancestors = array();
$vn_parent_id = null;
}
// 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">' . caEditorFindResultNavigation($po_view->request, $t_item, $o_result_context, $pa_options) . "</h3>\n";
$vs_color = null;
if ($t_type) {
$vs_color = trim($t_type->get('color'));
}
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";
$vs_icon = null;
if ($t_type) {
$vs_icon = $t_type->getMediaTag('icon', 'icon');
}
if (!$vs_icon && $t_ui) {
$vs_icon = $t_ui->getMediaTag('icon', 'icon');
}
if ($vs_icon) {
$vs_buf .= "<div id='inspectoricon' style='border-right: 6px solid #{$vs_color}; border-bottom: 6px solid #{$vs_color}; -moz-border-radius-bottomright: 8px; -webkit-border-bottom-right-radius: 8px;'>\n{$vs_icon}</div>\n";
}
if ($po_view->request->getAction() === 'Delete' && $po_view->request->getParameter('confirm', pInteger)) {
$vs_buf .= "<strong>" . _t("Deleted %1", $vs_type_name) . "</strong>\n";
$vs_buf .= "<br style='clear: both;'/></div></h4>\n";
} else {
if ($vn_item_id) {
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__, null, array('title' => _t('Change type'))) . "</a></div></div>\n";
$vo_change_type_view = new View($po_view->request, $po_view->request->getViewsDirectoryPath() . "/bundles/");
$vo_change_type_view->setVar('t_item', $t_item);
FooterManager::add($vo_change_type_view->render("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";
}
$vs_label = '';
if ($vs_get_spec = $po_view->request->config->get("{$vs_table_name}_inspector_display_title")) {
$vs_label = caProcessTemplateForIDs($vs_get_spec, $vs_table_name, array($t_item->getPrimaryKey()));
} else {
$va_object_collection_collection_ancestors = $po_view->getVar('object_collection_collection_ancestors');
if ($t_item->tableName() == 'ca_objects' && $t_item->getAppConfig()->get('ca_objects_x_collections_hierarchy_enabled') && is_array($va_object_collection_collection_ancestors) && sizeof($va_object_collection_collection_ancestors)) {
$va_collection_links = array();
foreach ($va_object_collection_collection_ancestors as $va_collection_ancestor) {
$va_collection_links[] = caEditorLink($po_view->request, $va_collection_ancestor['label'], '', 'ca_collections', $va_collection_ancestor['collection_id']);
}
$vs_label .= join(" / ", $va_collection_links) . ' > ';
}
if (method_exists($t_item, 'getLabelForDisplay')) {
$vn_parent_index = sizeof($va_ancestors) - 1;
if ($vn_parent_id && ($vs_table_name != 'ca_places' || $vn_parent_index > 0)) {
$va_parent = $va_ancestors[$vn_parent_index];
$vs_disp_fld = $t_item->getLabelDisplayField();
if ($va_parent['NODE'][$vs_disp_fld] && ($vs_editor_link = caEditorLink($po_view->request, $va_parent['NODE'][$vs_disp_fld], '', $vs_table_name, $va_parent['NODE'][$t_item->primaryKey()]))) {
$vs_label .= $vs_editor_link . ' > ' . $t_item->getLabelForDisplay();
} else {
$vs_label .= ($va_parent['NODE'][$vs_disp_fld] ? $va_parent['NODE'][$vs_disp_fld] . ' > ' : '') . $t_item->getLabelForDisplay();
}
} else {
$vs_label .= $t_item->getLabelForDisplay();
if ($vs_table_name === 'ca_editor_uis' && in_array($po_view->request->getAction(), array('EditScreen', 'DeleteScreen', 'SaveScreen'))) {
//.........这里部分代码省略.........
示例15: json_encode
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>");
}