本文整理汇总了PHP中caHTMLHiddenInput函数的典型用法代码示例。如果您正苦于以下问题:PHP caHTMLHiddenInput函数的具体用法?PHP caHTMLHiddenInput怎么用?PHP caHTMLHiddenInput使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了caHTMLHiddenInput函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: caNavUrl
print "<a href='#' onClick='jQuery(\"#{$vs_container_id}\").load(\"" . caNavUrl($this->request, 'Detail', 'Object', 'GetRepresentationInfo', array('representation_id' => (int) $vn_id, 'object_id' => (int) $t_object->getPrimaryKey())) . "\");'>→</a>";
}
?>
</div>
</td>
<?php
if (caObjectsDisplayDownloadLink($this->request)) {
?>
<td align="right" text-align="right">
<?php
print caFormTag($this->request, 'DownloadRepresentation', 'downloadRepresentationForm', 'Detail/Object', 'get', 'multipart/form-data', null, array('disableUnsavedChangesWarning' => true));
print caHTMLSelect('version', $va_versions, array('id' => $vs_display_type == 'media_overlay' ? 'caMediaOverlayVersionControl' : 'caMediaDisplayVersionControl', 'class' => 'caMediaOverlayControls'), array('value' => 'original'));
print ' ' . caFormSubmitLink($this->request, caNavIcon($this->request, __CA_NAV_BUTTON_DOWNLOAD__, null, array('align' => 'middle')), '', 'downloadRepresentationForm');
print caHTMLHiddenInput('representation_id', array('value' => $t_rep->getPrimaryKey()));
print caHTMLHiddenInput('object_id', array('value' => $t_object->getPrimaryKey()));
print caHTMLHiddenInput('download', array('value' => 1));
?>
</form>
</td>
<?php
}
?>
</tr>
</table>
</div><!-- end caMediaOverlayControls -->
<div id="<?php
print $vs_display_type == 'media_overlay' ? 'caMediaOverlayContent' : 'caMediaDisplayContent';
?>
">
<?php
示例2: ucwords
print "<div><span class='accessName'>" . ucwords($va_group_access_item['name']) . "</span> <b>(group)</b>: " . $va_group_access_item['access_display'] . "</div>";
}
$va_user_access = $t_instance->getACLUsers(array('returnAsInitialValuesForBundle' => true));
foreach ($va_user_access as $va_user_access_item) {
print "<div><span class='accessName'>" . $va_user_access_item['lname'] . ", " . $va_user_access_item['fname'] . "</span>: " . $va_user_access_item['access_display'] . "</div>";
}
?>
<div id='editUserAccess'>
<h2><?php
print _t('Group access');
?>
</h2>
<?php
print $t_instance->getACLGroupHTMLFormBundle($this->request, 'caAccessControlList');
print caHTMLHiddenInput($t_instance->primaryKey(), array('value' => $t_instance->getPrimaryKey()));
?>
<h2><?php
print _t('User access');
?>
</h2>
<?php
print $t_instance->getACLUserHTMLFormBundle($this->request, 'caAccessControlList');
?>
</div>
<?php
if ($t_instance->getACLUserGroups() || $t_instance->getACLUsers()) {
?>
<div id='editUserAccessLink' class='editLink'><a href='#' onclick='jQuery("#editUserAccess").show(250); jQuery("#editUserAccessLink").hide()'><img src='<?php
示例3: caHTMLHiddenInput
jQuery('#caShippingFields select[name=shipping_country]').val(d['country']);
jQuery('#shipping_country').click();
jQuery('#caShippingFields #shipping_zone_select').val(d['state']);
jQuery('#caShippingFields #shipping_zone_text').val(d['state']);
});
}
}
}
);
</script>
<?php
} else {
if (!$vn_order_id) {
print caHTMLHiddenInput('transaction_id', array('value' => $vn_transaction_id));
}
}
?>
<h2><?php
print _t('Customer information');
?>
</h2>
<div class="formContainerBg" style="padding-top:0px;">
<table width="100%">
<tr>
<td>
<h2><?php
print _t('Billing');
?>
</h2>
示例4: _t
<td class="caConfirmBatchExecutionPanelAlertControl">
<?php
print _t('Send SMS to <strong>%1</strong> when done', $vs_sms);
?>
</td>
<?php
}
?>
<div id="caTypeChangePanelControlButtons">
<table>
<tr>
<td align="right"><?php
print caFormSubmitButton($this->request, __CA_NAV_BUTTON_SAVE__, _t('Save'), 'caChangeTypeForm');
?>
</td>
<td align="left"><?php
print caJSButton($this->request, __CA_NAV_BUTTON_CANCEL__, _t('Cancel'), 'caChangeTypeFormCancelButton', array('onclick' => 'caTypeChangePanel.hidePanel(); return false;'), array());
?>
</td>
</tr>
</table>
</div>
<?php
print caHTMLHiddenInput('set_id', array('value' => $this->getVar('set_id')));
?>
</form>
</div>
</div>
示例5: htmlFormElement
/**
*
*
*/
public function htmlFormElement($pa_element_info, $pa_options = null)
{
$o_config = Configuration::load();
$va_settings = $this->getSettingValuesFromElementArray($pa_element_info, array('fieldWidth', 'fieldHeight'));
$vs_element = '<div id="infoservice_' . $pa_element_info['element_id'] . '_input{n}">' . caHTMLTextInput('{fieldNamePrefix}' . $pa_element_info['element_id'] . '_autocomplete{n}', array('size' => isset($pa_options['width']) && $pa_options['width'] > 0 ? $pa_options['width'] : $va_settings['fieldWidth'], 'height' => isset($pa_options['height']) && $pa_options['height'] > 0 ? $pa_options['height'] : $va_settings['fieldHeight'], 'value' => '{{' . $pa_element_info['element_id'] . '}}', 'maxlength' => 512, 'id' => "infoservice_" . $pa_element_info['element_id'] . "_autocomplete{n}", 'class' => 'lookupBg')) . caHTMLHiddenInput('{fieldNamePrefix}' . $pa_element_info['element_id'] . '_{n}', array('value' => '{{' . $pa_element_info['element_id'] . '}}', 'id' => '{fieldNamePrefix}' . $pa_element_info['element_id'] . '_{n}'));
if ($pa_options['request']) {
$vs_url = caNavUrl($pa_options['request'], 'lookup', 'InformationService', 'Get', array('max' => 100, 'element_id' => $pa_element_info['element_id']));
$vs_detail_url = caNavUrl($pa_options['request'], 'lookup', 'InformationService', 'GetDetail', array('element_id' => $pa_element_info['element_id']));
} else {
// hardcoded default for testing.
$vs_url = '/index.php/lookup/InformationService/Get';
$vs_detail_url = '/index.php/lookup/InformationService/GetDetail';
}
$vs_element .= " <a href='#' class='caInformationServiceMoreLink' id='{fieldNamePrefix}" . $pa_element_info['element_id'] . "_link{n}'>" . _t("More ›") . "</a>";
$vs_element .= "<div id='{fieldNamePrefix}" . $pa_element_info['element_id'] . "_detail{n}' class='caInformationServiceDetail'>" . ($pa_options['request'] ? caBusyIndicatorIcon($pa_options['request']) : '') . "</div></div>";
$vs_element .= "\n\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\tjQuery(document).ready(function() {\n\t\t\t\t\t\tjQuery('#infoservice_" . $pa_element_info['element_id'] . "_autocomplete{n}').autocomplete(\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tminLength: 3,delay: 800,\n\t\t\t\t\t\t\t\tsource: '{$vs_url}',\n\t\t\t\t\t\t\t\tselect: function(event, ui) {\n\t\t\t\t\t\t\t\t\tjQuery('#{fieldNamePrefix}" . $pa_element_info['element_id'] . "_{n}').val(ui.item.label + '|' + ui.item.idno + '|' + ui.item.url);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t).click(function() { this.select(); });\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ('{{" . $pa_element_info['element_id'] . "}}') {\n\t\t\t\t\t\t\tvar re = /\\[([A-Za-z]+:\\/\\/[^\\]]+)\\]/; \n\t\t\t\t\t\t\tvar infoservice = re.exec('{{" . $pa_element_info['element_id'] . "}}');\n\t\t\t\t\t\t\tif (infoservice && infoservice.length > 1) { \n\t\t\t\t\t\t\t\tjQuery('#{fieldNamePrefix}" . $pa_element_info['element_id'] . "_link{n}').css('display', 'inline').on('click', function(e) {\n\t\t\t\t\t\t\t\t\tif (jQuery('#{fieldNamePrefix}" . $pa_element_info['element_id'] . "_detail{n}').css('display') == 'none') {\n\t\t\t\t\t\t\t\t\t\tjQuery('#{fieldNamePrefix}" . $pa_element_info['element_id'] . "_detail{n}').slideToggle(250, function() { \n\t\t\t\t\t\t\t\t\t\t\tjQuery('#{fieldNamePrefix}" . $pa_element_info['element_id'] . "_detail{n}').load('{$vs_detail_url}/id/{n}');\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\tjQuery('#{fieldNamePrefix}" . $pa_element_info['element_id'] . "_link{n}').html('" . addslashes(_t("Less ›")) . "');\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tjQuery('#{fieldNamePrefix}" . $pa_element_info['element_id'] . "_detail{n}').slideToggle(250);\n\t\t\t\t\t\t\t\t\t\tjQuery('#{fieldNamePrefix}" . $pa_element_info['element_id'] . "_link{n}').html('" . addslashes(_t("More ›")) . "');\n\t\t\t\t\t\t\t\t\t}\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}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t</script>\n\t\t\t";
return $vs_element;
}
示例6: foreach
// !ajax
?>
<div id="bViewButtons">
<?php
foreach ($va_views as $vs_view => $va_view_info) {
if ($vs_current_view === $vs_view) {
print '<a href="#" class="active"><span class="glyphicon ' . $va_view_icons[$vs_view]['icon'] . '"></span></a> ';
} else {
print caNavLink($this->request, '<span class="glyphicon ' . $va_view_icons[$vs_view]['icon'] . '"></span>', 'disabled', '*', '*', '*', array('view' => $vs_view, 'key' => $vs_browse_key)) . ' ';
}
}
if ($this->request->user->hasUserRole("founders_new") || $this->request->user->hasUserRole("admin") || $this->request->user->hasUserRole("curatorial_all_new") || $this->request->user->hasUserRole("curatorial_basic_new") || $this->request->user->hasUserRole("archives_new") || $this->request->user->hasUserRole("library_new")) {
// Export as PDF
print "<div class='reportTools'>";
print caFormTag($this->request, 'view/pdf', 'caExportForm', ($this->request->getModulePath() ? $this->request->getModulePath() . '/' : '') . $this->request->getController() . '/' . $this->request->getAction(), 'post', 'multipart/form-data', '_top', array('disableUnsavedChangesWarning' => true));
print caHTMLHiddenInput('key', array('value' => $vs_browse_key));
print "{$vs_export_format_select}" . caFormSubmitLink($this->request, _t('Download'), 'button', 'caExportForm') . "</form>\n";
print "</div>";
}
?>
</div>
<H1>
<?php
if ($t_instance->getProperty('NAME_SINGULAR') == "object") {
print _t('%1 %2 %3', $qr_res->numHits(), ucwords($va_browse_info['displayName']), $qr_res->numHits() == 1 ? _t("Result") : _t("Results"));
} else {
print _t('%1 %2 %3', $qr_res->numHits(), ucwords($t_instance->getProperty('NAME_SINGULAR')), $qr_res->numHits() == 1 ? _t("Result") : _t("Results"));
}
?>
<div class="btn-group">
示例7: caHTMLHiddenInput
$vn_cnt++;
if ($vn_cnt >= $vn_max_cols) {
$vn_cnt = 0;
print "</tr>\n";
}
}
if ($vn_cnt > 0) {
print "</tr>\n";
}
?>
</table>
<?php
print caHTMLHiddenInput("target", array('value' => $t_subject->tableName()));
?>
<?php
print caHTMLHiddenInput("_fields", array('value' => join(';', array_keys($va_form_field_with_subelements))));
?>
</form>
<div style="height:1px; clear:both;"></div>
<div id="buttons">
<input type="submit" style="position: absolute; left: -9999px"/>
<div style="text-align:left">
<a href="#" onclick="jQuery('#caAdvancedSearch input[type!=hidden]').val(''); jQuery('#caAdvancedSearch select').val('');"><?php
print _t('Reset');
?>
</a>
<a href="#" onclick="jQuery('#caAdvancedSearch').submit(); return false;"><?php
print _t('Search');
?>
</a>
示例8: caHTMLHiddenInput
<?php
AssetLoadManager::register("directoryBrowser");
$vs_id = $this->getVar('id');
$vs_default = $this->getVar('defaultPath');
?>
<div id="<?php
print $vs_id;
?>
directoryBrowser" class='directoryBrowserSmall'>
<!-- Content for directory browser is dynamically inserted here by ca.hierbrowser -->
</div><!-- end directoryBrowser -->
<?php
print caHTMLHiddenInput($vs_id, array('value' => '', 'id' => $vs_id));
?>
<script type="text/javascript">
var oDirBrowser;
jQuery(document).ready(function() {
oDirBrowser = caUI.initDirectoryBrowser('<?php
print $vs_id;
?>
directoryBrowser', {
levelDataUrl: '<?php
print caNavUrl($this->request, 'batch', 'MediaImport', 'GetDirectoryLevel');
?>
',
initDataUrl: '<?php
print caNavUrl($this->request, 'batch', 'MediaImport', 'GetDirectoryAncestorList');
?>
',
示例9: htmlFormElement
public function htmlFormElement($pa_element_info, $pa_options = null)
{
$va_settings = $this->getSettingValuesFromElementArray($pa_element_info, array('fieldWidth', 'fieldHeight'));
$vs_element = '<div id="taxonomy_' . $pa_element_info['element_id'] . '_input{n}">' . caHTMLTextInput('{fieldNamePrefix}' . $pa_element_info['element_id'] . '_autocomplete{n}', array('size' => isset($pa_options['width']) && $pa_options['width'] > 0 ? $pa_options['width'] : $va_settings['fieldWidth'], 'height' => 1, 'value' => '{{' . $pa_element_info['element_id'] . '}}', 'maxlength' => 512, 'id' => "taxonomy_" . $pa_element_info['element_id'] . "_autocomplete{n}", 'class' => 'lookupBg')) . caHTMLHiddenInput('{fieldNamePrefix}' . $pa_element_info['element_id'] . '_{n}', array('value' => '{{' . $pa_element_info['element_id'] . '}}', 'id' => '{fieldNamePrefix}' . $pa_element_info['element_id'] . '_{n}'));
if ($pa_options['request']) {
$vs_url = caNavUrl($pa_options['request'], 'lookup', 'Taxonomy', 'Get', array('max' => 100));
} else {
// hardcoded default for testing.
$vs_url = '/index.php/lookup/Taxonomy/Get';
}
$vs_element .= " <a href='#' style='display: none;' id='{fieldNamePrefix}" . $pa_element_info['element_id'] . "_link{n}' target='_taxonomy_details'>" . _t("More") . "</a>";
$vs_element .= '</div>';
$vs_element .= "\n\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\tjQuery(document).ready(function() {\n\t\t\t\t\t\tjQuery('#taxonomy_" . $pa_element_info['element_id'] . "_autocomplete{n}').autocomplete(\n\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\tsource: '{$vs_url}', minLength: 3, delay: 800,\n\t\t\t\t\t\t\t\tselect: function(event, ui) {\n\t\t\t\t\t\t\t\t\tif (ui.item.id) {\n\t\t\t\t\t\t\t\t\t\tjQuery('#{fieldNamePrefix}" . $pa_element_info['element_id'] . "_{n}').val(ui.item.label);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t).click(function() { this.select(); });\n\t\t\t\t\t});\n\t\t\t\t</script>\n\t\t\t";
return $vs_element;
}
示例10: getListAsHTMLFormElement
//.........这里部分代码省略.........
$vn_c = 0;
$vs_buf = "<table>\n";
foreach ($va_options as $vm_value => $vs_label) {
if ($vn_c == 0) {
$vs_buf .= "<tr>";
}
$va_attributes = array('value' => $vm_value);
if (isset($va_disabled_options[$vm_value]) && $va_disabled_options[$vm_value]) {
$va_attributes['disabled'] = 1;
}
if (isset($pa_options['readonly']) && $pa_options['readonly']) {
$va_attributes['disabled'] = 1;
}
if (is_array($pa_options['value']) && in_array($vm_value, $pa_options['value'])) {
$va_attributes['checked'] = '1';
}
$vs_buf .= "<td>" . caHTMLCheckboxInput($ps_name . '_' . $vm_value, $va_attributes, $pa_options) . " {$vs_label}</td>";
$vn_c++;
if ($vn_c >= $pa_options['maxColumns']) {
$vn_c = 0;
$vs_buf .= "</tr>\n";
}
}
if ($vn_c != 0) {
$vs_buf .= "</tr>\n";
}
$vs_buf .= "</table>";
return $vs_buf;
break;
case 'lookup':
$vs_value = $vs_hidden_value = "";
if (caGetOption('forSearch', $pa_options)) {
if ($vs_val_id = caGetOption('value', $pa_options)) {
$vs_value = $t_list->getItemFromListForDisplayByItemID($pm_list_name_or_id, $vs_val_id);
$vs_hidden_value = $vs_val_id;
}
} else {
$vs_value = "{" . $pa_options['element_id'] . "_label}";
$vs_hidden_value = "{" . $pa_options['element_id'] . "}";
}
$vs_buf = caHTMLTextInput($ps_name . '_autocomplete', array('width' => isset($pa_options['width']) && $pa_options['width'] > 0 ? $pa_options['width'] : 300, 'height' => isset($pa_options['height']) && $pa_options['height'] > 0 ? $pa_options['height'] : 1, 'value' => $vs_value, 'maxlength' => 512, 'id' => $ps_name . "_autocomplete", 'class' => 'lookupBg')) . caHTMLHiddenInput($ps_name, array('value' => $vs_hidden_value, 'id' => $ps_name));
if ($pa_options['request']) {
$vs_url = caNavUrl($pa_options['request'], 'lookup', 'ListItem', 'Get', array('list' => ca_lists::getListCode($vn_list_id), 'noInline' => 1, 'noSymbols' => 1, 'max' => 100));
} else {
// hardcoded default for testing.
$vs_url = '/index.php/lookup/ListItem/Get';
}
$vs_buf .= '</div>';
$vs_buf .= "\n\t\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\t\tjQuery(document).ready(function() {\n\t\t\t\t\t\t\tjQuery('#{$ps_name}_autocomplete').autocomplete({\n\t\t\t\t\t\t\t\t\tsource: '{$vs_url}', minLength: 3, delay: 800, html: true,\n\t\t\t\t\t\t\t\t\tselect: function(event, ui) {\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tif (parseInt(ui.item.id) > 0) {\n\t\t\t\t\t\t\t\t\t\t\tjQuery('#{$ps_name}').val(ui.item.id);\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tjQuery('#{$ps_name}_autocomplete').val('');\n\t\t\t\t\t\t\t\t\t\t\tjQuery('#{$ps_name}').val('');\n\t\t\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t});\n\t\t\t\t\t</script>\n\t\t\t\t";
return $vs_buf;
break;
case 'horiz_hierbrowser':
case 'horiz_hierbrowser_with_search':
case 'vert_hierbrowser':
$va_width = caParseFormElementDimension($pa_options['width'] ? $pa_options['width'] : $pa_options['width']);
if ($va_width['type'] != 'pixels' && $va_width['dimension'] < 250) {
$va_width['dimension'] = 500;
}
$vn_width = $va_width['dimension'] . 'px';
$va_height = caParseFormElementDimension($pa_options['height']);
if ($va_height['type'] != 'pixels' && $va_height['dimension'] < 100) {
$va_height['dimension'] = 200;
}
$vn_height = $va_height['dimension'] . 'px';
$t_root_item = new ca_list_items();
$t_root_item->load(array('list_id' => $vn_list_id, 'parent_id' => null));
JavascriptLoadManager::register("hierBrowser");
$vs_buf = "<div style='width: {$vn_width}; height: {$vn_height};'><div id='{$ps_name}_hierarchyBrowser{n}' style='width: 100%; height: 100%;' class='" . ($vs_render_as == 'vert_hierbrowser' ? 'hierarchyBrowserVertical' : 'hierarchyBrowser') . "'>\n\t\t\t\t\t<!-- Content for hierarchy browser is dynamically inserted here by ca.hierbrowser -->\n\t\t\t\t</div><!-- end hierarchyBrowser -->\t</div>";
$vs_buf .= "\t<script type='text/javascript'>\n\t\tjQuery(document).ready(function() { \n\t\t\tvar oHierBrowser = caUI.initHierBrowser('{$ps_name}_hierarchyBrowser{n}', {\n\t\t\t\tuiStyle: '" . ($vs_render_as == 'vert_hierbrowser' ? 'vertical' : 'horizontal') . "',\n\t\t\t\tlevelDataUrl: '" . caNavUrl($pa_options['request'], 'lookup', 'ListItem', 'GetHierarchyLevel', array('noSymbols' => 1)) . "',\n\t\t\t\tinitDataUrl: '" . caNavUrl($pa_options['request'], 'lookup', 'ListItem', 'GetHierarchyAncestorList') . "',\n\t\t\t\t\n\t\t\t\tselectOnLoad : true,\n\t\t\t\tbrowserWidth: " . (int) $va_width['dimension'] . ",\n\t\t\t\t\n\t\t\t\tclassName: '" . ($vs_render_as == 'vert_hierbrowser' ? 'hierarchyBrowserLevelVertical' : 'hierarchyBrowserLevel') . "',\n\t\t\t\tclassNameContainer: '" . ($vs_render_as == 'vert_hierbrowser' ? 'hierarchyBrowserContainerVertical' : 'hierarchyBrowserContainer') . "',\n\t\t\t\t\n\t\t\t\teditButtonIcon: \"" . caNavIcon($pa_options['request'], __CA_NAV_BUTTON_RIGHT_ARROW__) . "\",\n\t\t\t\tdisabledButtonIcon: \"" . caNavIcon($pa_options['request'], __CA_NAV_BUTTON_DOT__) . "\",\n\t\t\t\tinitItemID: '{" . $pa_options['element_id'] . "}',\n\t\t\t\tdefaultItemID: '" . $t_list->getDefaultItemID() . "',\n\t\t\t\tuseAsRootID: '" . $t_root_item->getPrimaryKey() . "',\n\t\t\t\tindicatorUrl: '" . $pa_options['request']->getThemeUrlPath() . "/graphics/icons/indicator.gif',\n\t\t\t\t\n\t\t\t\tcurrentSelectionDisplayID: '{$ps_name}_browseCurrentSelectionText{n}',\n\t\t\t\tonSelection: function(item_id, parent_id, name, display) {\n\t\t\t\t\tjQuery('#{$ps_name}').val(item_id);\n\t\t\t\t}\n\t\t\t});";
if ($vs_render_as == 'horiz_hierbrowser_with_search') {
$vs_buf .= "jQuery('#{$ps_name}_hierarchyBrowserSearch{n}').autocomplete(\n\t\t\t\t\t{\n\t\t\t\t\t\tsource: '" . caNavUrl($pa_options['request'], 'lookup', 'ListItem', 'Get', array('list' => ca_lists::getListCode($vn_list_id), 'noSymbols' => 1)) . "', \n\t\t\t\t\t\tminLength: 3, delay: 800,\n\t\t\t\t\t\tselect: function(event, ui) {\n\t\t\t\t\t\t\toHierBrowser.setUpHierarchy(ui.item.id);\t// jump browser to selected item\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);";
}
$vs_buf .= "});\n\t</script>";
if ($vs_render_as == 'horiz_hierbrowser_with_search') {
$vs_buf .= "<div class='hierarchyBrowserSearchBar'>" . _t('Search') . ": <input type='text' id='{$ps_name}_hierarchyBrowserSearch{n}' class='hierarchyBrowserSearchBar' name='search' value='' size='20'/></div>";
}
if ($vs_render_as != 'vert_hierbrowser') {
$vs_buf .= "<div id='{$ps_name}_browseCurrentSelection{n}' class='hierarchyBrowserCurrentSelection'>" . _t("Current selection") . ": <span id='{$ps_name}_browseCurrentSelectionText{n}' class='hierarchyBrowserCurrentSelectionText'>?</span></div>";
}
$vs_buf .= caHTMLHiddenInput($ps_name, array('value' => "{" . $pa_options['element_id'] . "}", 'id' => $ps_name));
return $vs_buf;
break;
case 'text':
return caHTMLTextInput($ps_name, $pa_attributes, $pa_options);
break;
case 'options':
return $va_options;
break;
default:
if (!sizeof($va_options)) {
return '';
}
// return empty string if list has no values
if (isset($pa_options['readonly']) && $pa_options['readonly']) {
$pa_attributes['disabled'] = 1;
}
return caHTMLSelect($ps_name, $va_options, $pa_attributes, array_merge($pa_options, array('contentArrayUsesKeysForValues' => true, 'colors' => $va_colors, 'height' => null)));
break;
}
}
示例11: caFormTag
?>
<!-- Controls -->
<div class="caMediaOverlayControls">
<div class='close'><a href="#" onclick="caMediaPanel.hidePanel(); return false;" title="close"> </a></div>
<?php
if ($this->request->user->canDoAction('can_download_media')) {
?>
<div class='download'>
<?php
if (is_array($va_versions = $this->request->config->getList('ca_object_representation_download_versions'))) {
// -- provide user with a choice of versions to download
print caFormTag($this->request, 'DownloadAttributeMedia', 'caMediaDownloadForm', $this->request->getModulePath() . '/' . $this->request->getController(), 'post', 'multipart/form-data', '_top', array('disableUnsavedChangesWarning' => true, 'noTimestamp' => true));
print caHTMLSelect('version', $va_versions, array('style' => 'font-size: 9px;'));
print caFormSubmitLink($this->request, "<img src='" . $this->request->getThemeUrlPath() . "/graphics/buttons/downloadWhite.png' border='0' title='" . _t("Download media") . "' valign='bottom'/>", '', 'caMediaDownloadForm', 'caMediaDownloadFormButton');
print caHTMLHiddenInput('value_id', array('value' => $t_value->getPrimaryKey()));
print caHTMLHiddenInput("download", array('value' => 1));
print "</form>\n";
}
?>
</div>
<?php
}
?>
<div class='objectInfo'>
<?php
//$vs_label = $t_object->getLabelForDisplay();
//print (mb_strlen($vs_label) > 80) ? mb_substr($vs_label, 0, 80)."..." : $vs_label;
//if($t_object->get("idno")){
// print " [".$t_object->get("idno")."]";
//}
示例12: htmlFormElementForAttributeSearch
/**
*
*/
public function htmlFormElementForAttributeSearch($po_request, $pm_element_code_or_id, $pa_options = null)
{
if (!is_array($pa_options)) {
$pa_options = array();
}
if (!($t_element = $this->_getElementInstance($pm_element_code_or_id))) {
return false;
}
$vb_is_sub_element = (bool) $t_element->get('parent_id');
$t_parent = $vb_is_sub_element ? $this->_getElementInstance($t_element->get('parent_id')) : null;
while ($vb_is_sub_element && $t_parent->get('datatype') == 0 && $t_parent->get('parent_id') > 0) {
$t_parent = $this->_getElementInstance($t_parent->get('parent_id'));
}
$vs_element_code = $t_element->get('element_code');
// get all elements of this element set
$va_element_set = $vb_is_sub_element ? $t_parent->getElementsInSet() : $t_element->getElementsInSet();
if ($vb_is_sub_element) {
foreach ($va_element_set as $vn_i => $va_element) {
if ($va_element['element_code'] !== $vs_element_code) {
unset($va_element_set[$vn_i]);
}
}
}
$t_attr = new ca_attributes();
$t_attr->purify($this->purify());
$va_element_codes = array();
$va_elements_by_container = array();
if (sizeof($va_element_set) > 1) {
$vs_format = isset($pa_options['multivalueFormat']) ? $pa_options['multivalueFormat'] : null;
} else {
$vs_format = isset($pa_options['format']) ? $pa_options['format'] : null;
}
$pa_options['format'] = $vs_format;
foreach ($va_element_set as $va_element) {
$va_override_options = array();
if ($va_element['datatype'] == 0) {
// containers are not active form elements
continue;
}
$va_label = $this->getAttributeLabelAndDescription($va_element['element_id']);
$vs_subelement_code = $this->tableName() . '.' . ($vb_is_sub_element ? $t_parent->get('element_code') . '.' : '') . ($vs_element_code !== $va_element['element_code'] ? "{$vs_element_code}." : "") . $va_element['element_code'];
$vs_value = isset($pa_options['values']) && isset($pa_options['values'][$vs_subelement_code]) ? $pa_options['values'][$vs_subelement_code] : '';
$va_element_opts = array_merge(array('label' => $va_label['name'], 'description' => $va_label['description'], 't_subject' => $this, 'request' => $po_request, 'class' => $pa_options['class'], 'nullOption' => '-', 'value' => $vs_value, 'forSearch' => true, 'render' => isset($va_element['settings']['render']) && $va_element['settings']['render'] == 'lookup' ? $va_element['settings']['render'] : isset($pa_options['render']) ? $pa_options['render'] : 'select'), array_merge($pa_options, $va_override_options));
if (caGetOption('forSimpleForm', $pa_options, false)) {
unset($va_element_opts['nullOption']);
}
// We don't want to pass the entire set of values to ca_attributes::attributeHtmlFormElement() since it'll treat it as a simple list
// of values for an individual element and the 'values' array is actually set to values for *all* elements in the form
unset($va_element_opts['values']);
$va_element_opts['values'] = '';
// ... replace name of form element
$vs_fld_name = $vs_subelement_code;
//str_replace('.', '_', $vs_subelement_code);
if (caGetOption('asArrayElement', $pa_options, false)) {
$vs_fld_name .= "[]";
}
if ($vs_force_value = caGetOption('force', $pa_options, false)) {
$vs_form_element = caHTMLHiddenInput($vs_fld_name, array('value' => $vs_force_value));
} else {
$vs_form_element = ca_attributes::attributeHtmlFormElement($va_element, $va_element_opts);
//
// prep element for use as search element
//
// ... replace value
$vs_form_element = str_replace('{{' . $va_element['element_id'] . '}}', $vs_value, $vs_form_element);
// escape any special characters in jQuery selectors
$vs_form_element = str_replace("jQuery('#{fieldNamePrefix}" . $va_element['element_id'] . "_{n}')", "jQuery('#" . str_replace(array("[", "]", "."), array("\\\\[", "\\\\]", "\\\\."), $vs_fld_name) . "')", $vs_form_element);
$vs_form_element = str_replace('{fieldNamePrefix}' . $va_element['element_id'] . '_{n}', $vs_fld_name, $vs_form_element);
$vs_form_element = str_replace('{n}', '', $vs_form_element);
$vs_form_element = str_replace('{' . $va_element['element_id'] . '}', '', $vs_form_element);
}
$va_elements_by_container[$va_element['parent_id'] ? $va_element['parent_id'] : $va_element['element_id']][] = $vs_form_element;
// If the elements datatype returns true from renderDataType, then force render the element
if (Attribute::renderDataType($va_element)) {
return array_pop($va_elements_by_container[$va_element['element_id']]);
}
$va_element_ids[] = $va_element['element_id'];
}
$vs_view_path = isset($pa_options['viewPath']) && $pa_options['viewPath'] ? $pa_options['viewPath'] : $po_request->getViewsDirectoryPath();
$o_view = new View($po_request, "{$vs_view_path}/bundles/");
$o_view->setVar('request', $po_request);
$o_view->setVar('elements', $va_elements_by_container);
$o_view->setVar('element_ids', $va_element_ids);
$o_view->setVar('element_set_label', $this->getAttributeLabel($t_element->get('element_id')));
return $o_view->render(caGetOption('view', $pa_options, 'ca_search_form_attributes.php'));
}
示例13: function
print $this->request->getThemeUrlPath();
?>
/graphics/icons/indicator.gif',
currentSelectionDisplayID: 'browseCurrentSelection',
onSelection: function(item_id, path, name, type) {
if (type == 'DIR') { jQuery('#caDirectoryValue').val(path); }
}
});
jQuery('#progressbar').progressbar({ value: 0 });
});
</script>
<?php
print caHTMLHiddenInput('directory', array('value' => '', 'id' => 'caDirectoryValue'));
?>
</div>
<div style="margin: 8px 0px 0px 0px; padding-bottom:5px;">
<?php
$va_opts = array('id' => 'caIncludeSubDirectories', 'value' => 1);
if (isset($va_last_settings['includeSubDirectories']) && $va_last_settings['includeSubDirectories']) {
$va_opts['checked'] = 1;
}
print caHTMLCheckboxInput('include_subdirectories', $va_opts) . ' ' . _t('Include all sub-directories');
$va_opts['style'] = 'margin-left: 10px';
print caHTMLCheckboxInput('delete_media_on_import', $va_opts) . ' ' . _t('Delete media after import');
?>
</div>
</div>
</div>
示例14: caFormTag
$vs_buf .= caFormTag($this->request, 'Edit', 'NewChildForm', null, 'post', 'multipart/form-data', '_top', array('disableUnsavedChangesWarning' => true));
$vs_buf .= _t('Add a %1 under this', $vs_type_list) . caHTMLHiddenInput($t_item->primaryKey(), array('value' => '0')) . caHTMLHiddenInput('parent_id', array('value' => $t_item->getPrimaryKey()));
$vs_buf .= '<div id="caTypeChangePanelControlButtons">';
$vs_buf .= '<div class="saveButton">' . caFormSubmitLink($this->request, caNavIcon($this->request, __CA_NAV_BUTTON_SAVE__), '', 'NewChildForm') . " " . _t('Save') . "</div>";
$vs_buf .= caJSButton($this->request, __CA_NAV_BUTTON_CANCEL__, _t('Cancel'), 'caChangeTypeFormCancelButton', array('onclick' => 'caCreateChildPanel.hidePanel(); return false;'), array());
$vs_buf .= "</div>";
$vs_buf .= "</form></div>\n";
}
if ($t_item->tableName() == 'ca_collections' && $this->request->config->get('ca_objects_x_collections_hierarchy_enabled')) {
$t_object = new ca_objects();
if ((bool) $this->request->config->get('ca_objects_enforce_strict_type_hierarchy')) {
// strict menu
$vs_type_list = $t_object->getTypeListAsHTMLFormElement('type_id', array('style' => 'width: 90px; font-size: 9px;'), array('childrenOfCurrentTypeOnly' => true, 'directChildrenOnly' => $this->request->config->get($vs_table_name . '_enforce_strict_type_hierarchy') == '~' ? false : true, 'returnHierarchyLevels' => true, 'access' => __CA_BUNDLE_ACCESS_EDIT__));
} else {
// all types
$vs_type_list = $t_object->getTypeListAsHTMLFormElement('type_id', array('style' => 'width: 90px; font-size: 9px;'), array('access' => __CA_BUNDLE_ACCESS_EDIT__));
}
$vs_buf .= '<div style="border-top: 1px solid #aaaaaa; margin-top: 5px; font-size: 10px; padding-top:10px" class="addChild">';
$vs_buf .= caFormTag($this->request, 'Edit', 'NewChildObjectForm', 'editor/objects/ObjectEditor', 'post', 'multipart/form-data', '_top', array('disableUnsavedChangesWarning' => true));
$vs_buf .= _t('Add a %1 under this', $vs_type_list) . caHTMLHiddenInput('object_id', array('value' => '0')) . caHTMLHiddenInput('collection_id', array('value' => $t_item->getPrimaryKey()));
$vs_buf .= '<div id="caTypeChangePanelControlButtons">';
$vs_buf .= '<div class="saveButton">' . caFormSubmitLink($this->request, caNavIcon($this->request, __CA_NAV_BUTTON_SAVE__), '', 'NewChildObjectForm') . " " . _t('Save') . "</div>";
$vs_buf .= caJSButton($this->request, __CA_NAV_BUTTON_CANCEL__, _t('Cancel'), 'caChangeTypeFormCancelButton', array('onclick' => 'caCreateChildPanel.hidePanel(); return false;'), array());
$vs_buf .= "</div>";
$vs_buf .= "</form></div>\n";
}
print $vs_buf;
?>
</div>
</div>
示例15: htmlFormElement
/**
* Return HTML form element for editing.
*
* @param array $pa_element_info An array of information about the metadata element being edited
* @param array $pa_options array Options include:
* forSearch = simple text entry is returned for use with search forms [Default=false]
* class = the CSS class to apply to all visible form elements [Default=lookupBg]
* width = the width of the form element [Default=field width defined in metadata element definition]
* height = the height of the form element [Default=field height defined in metadata element definition]
* request = the RequestHTTP object for the current request; required for lookups to work [Default is null]
* disableMap = don't show map with Geonames data [Default=false]
*
* @return string
*/
public function htmlFormElement($pa_element_info, $pa_options = null)
{
$vs_class = trim(isset($pa_options['class']) && $pa_options['class'] ? $pa_options['class'] : '');
if (isset($pa_options['forSearch']) && $pa_options['forSearch']) {
return caHTMLTextInput("{fieldNamePrefix}" . $pa_element_info['element_id'] . "_{n}", array('id' => "{fieldNamePrefix}" . $pa_element_info['element_id'] . "_{n}", 'value' => $pa_options['value']), $pa_options);
}
$o_config = Configuration::load();
$va_settings = $this->getSettingValuesFromElementArray($pa_element_info, array('fieldWidth', 'fieldHeight', 'disableMap', 'maxResults', 'gnElements', 'gnDelimiter'));
$vn_max_results = isset($va_settings['maxResults']) ? intval($va_settings['maxResults']) : 20;
$vs_gn_elements = $va_settings['gnElements'];
$vs_gn_delimiter = $va_settings['gnDelimiter'];
if ($pa_options['request']) {
$vs_url = caNavUrl($pa_options['request'], 'lookup', 'GeoNames', 'Get', array('maxRows' => $vn_max_results, 'gnElements' => urlencode($vs_gn_elements), 'gnDelimiter' => urlencode($vs_gn_delimiter)));
}
$vs_element = '<div id="geonames_' . $pa_element_info['element_id'] . '_input{n}">' . caHTMLTextInput('{fieldNamePrefix}' . $pa_element_info['element_id'] . '_autocomplete{n}', array('size' => isset($pa_options['width']) && $pa_options['width'] > 0 ? $pa_options['width'] : $va_settings['fieldWidth'], 'height' => isset($pa_options['height']) && $pa_options['height'] > 0 ? $pa_options['height'] : $va_settings['fieldHeight'], 'value' => '{{' . $pa_element_info['element_id'] . '}}', 'maxlength' => 512, 'id' => "geonames_" . $pa_element_info['element_id'] . "_autocomplete{n}", 'class' => $vs_class ? $vs_class : 'lookupBg')) . caHTMLHiddenInput('{fieldNamePrefix}' . $pa_element_info['element_id'] . '_{n}', array('value' => '{{' . $pa_element_info['element_id'] . '}}', 'id' => '{fieldNamePrefix}' . $pa_element_info['element_id'] . '_{n}'));
$vs_element .= '</div>';
$vs_element .= "\n\t\t\t<script type='text/javascript'>\n\t\t\t\tjQuery(document).ready(function() {\n\t\t\t\t\tjQuery('#geonames_" . $pa_element_info['element_id'] . "_autocomplete{n}').autocomplete(\n\t\t\t\t\t\t{ \n\t\t\t\t\t\t\tsource: '{$vs_url}',\n\t\t\t\t\t\t\tminLength: 3, delay: 800,\n\t\t\t\t\t\t\tselect: function(event, ui) {\n\t\t\t\t\t\t\t\tjQuery('#{fieldNamePrefix}" . $pa_element_info['element_id'] . "_{n}').val(ui.item.label + ' [id:' + ui.item.id + ']');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t).click(function() { this.select(); });\n\t\t\t\t});\n\t\t\t</script>\n\t\t";
if (!caGetOption("disableMap", $va_settings, false) && !caGetOption("disableMap", $pa_options, false)) {
JavascriptLoadManager::register('maps');
$vs_element .= "\n\t\t\t\t<div id='map_" . $pa_element_info['element_id'] . "{n}' style='width:700px; height:160px;'>\n\n\t\t\t\t</div>\n\t\t\t\t<script type='text/javascript'>\n\t\t\t\t\tif ('{n}'.substring(0,3) == 'new') {\n\t\t\t\t\t\tjQuery('#map_" . $pa_element_info['element_id'] . "{n}').hide();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tjQuery(document).ready(function() {\n\t\t\t";
$vs_element .= "\n\t\t\t\t\tvar re = /\\[([\\d\\.\\-,; ]+)\\]/;\n\t\t\t\t\tvar r = re.exec('{{" . $pa_element_info['element_id'] . "}}');\n\t\t\t\t\tvar latlong = (r) ? r[1] : null;\n\n\t\t\t\t\tif (latlong) {\n\t\t\t\t\t\t// map vars are global\n\t\t\t\t\t\tmap_" . $pa_element_info['element_id'] . "{n} = new google.maps.Map(document.getElementById('map_" . $pa_element_info['element_id'] . "{n}'), {\n\t\t\t\t\t\t\tdisableDefaultUI: false,\n\t\t\t\t\t\t\tmapTypeId: google.maps.MapTypeId.SATELLITE\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tvar tmp = latlong.split(',');\n\t\t\t\t\t\tvar pt = new google.maps.LatLng(tmp[0], tmp[1]);\n\t\t\t\t\t\tmap_" . $pa_element_info['element_id'] . "{n}.setCenter(pt);\n\t\t\t\t\t\tmap_" . $pa_element_info['element_id'] . "{n}.setZoom(15);\t\t// todo: make this a user preference of some sort\n\t\t\t\t\t\tvar marker = new google.maps.Marker({\n\t\t\t\t\t\t\tposition: pt,\n\t\t\t\t\t\t\tmap: map_" . $pa_element_info['element_id'] . "{n}\n\t\t\t\t\t\t});\n\t\t\t\t\t}";
$vs_element .= "\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t</script>";
}
return $vs_element;
}