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


PHP caHTMLTextInput函数代码示例

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


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

示例1: htmlFormElement

 public function htmlFormElement($ps_property, $pa_attributes = null)
 {
     $vs_element = $vs_label = '';
     $pa_attributes['class'] = 'timecodeBg';
     if (!($vs_format = $pa_attributes['format'])) {
         $vs_format = $this->opo_config->get('form_element_display_format');
     }
     if ($va_property_info = $this->getPropertyInfo($ps_property)) {
         switch ($va_property_info['fieldType']) {
             case 'FT_TIMECODE':
                 $vs_label = $va_property_info['label'];
                 if (!isset($pa_attributes['value'])) {
                     $pa_attributes['value'] = $this->getProperty($ps_property);
                 }
                 if (!isset($pa_attributes['size'])) {
                     $pa_attributes['size'] = $va_property_info['fieldWidth'];
                 }
                 $vs_element = caHTMLMakeLabeledFormElement(caHTMLTextInput($pa_attributes['name'] ? $pa_attributes['name'] : $ps_property, $pa_attributes), $vs_label, $pa_attributes['name'] ? $pa_attributes['name'] : $ps_property, $va_property_info['description'], $vs_format, false);
                 break;
             default:
                 return 'Invalid field type for \'' . $ps_property . '\'';
                 break;
         }
     }
     return $vs_element;
 }
开发者ID:guaykuru,项目名称:pawtucket,代码行数:26,代码来源:TimeBasedRepresentationAnnotationCoder.php

示例2: htmlFormElement

 /**
  * Return HTML form element for specified property 
  *
  */
 public function htmlFormElement($ps_property, $pa_attributes = null)
 {
     $vs_element = $vs_label = '';
     if (!($vs_format = $pa_attributes['format'])) {
         $vs_format = $this->opo_config->get('form_element_display_format');
     }
     if ($va_property_info = $this->getPropertyInfo($ps_property)) {
         switch ($va_property_info['fieldType']) {
             case 'FT_TEXT':
             case 'FT_NUMBER':
                 $vs_label = $va_property_info['label'];
                 if (!isset($pa_attributes['value'])) {
                     $pa_attributes['value'] = $this->getProperty($ps_property);
                 }
                 if (!isset($pa_attributes['size'])) {
                     $pa_attributes['size'] = $va_property_info['fieldWidth'];
                 }
                 switch ($va_property_info['displayType']) {
                     case 'DT_SELECT':
                         $vs_element = caHTMLMakeLabeledFormElement(caHTMLSelect($pa_attributes['name'] ? $pa_attributes['name'] : $ps_property, $va_property_info['options'], $pa_attributes, array('height' => 1)), $vs_label, $pa_attributes['name'] ? $pa_attributes['name'] : $ps_property, $va_property_info['description'], $vs_format, false);
                         break;
                     default:
                         $vs_element = caHTMLMakeLabeledFormElement(caHTMLTextInput($pa_attributes['name'] ? $pa_attributes['name'] : $ps_property, $pa_attributes), $vs_label, $pa_attributes['name'] ? $pa_attributes['name'] : $ps_property, $va_property_info['description'], $vs_format, false);
                         break;
                 }
                 break;
             case 'FT_VARS':
                 $vs_element = '';
                 // skip
                 break;
             default:
                 return 'Invalid field type for \'' . $ps_property . '\'';
                 break;
         }
     }
     return $vs_element;
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:41,代码来源:ImageRepresentationAnnotationCoder.php

示例3: _t

        ?>
			<div id='caPaymentFields'>
				<H1><?php 
        print _t("Payment Details");
        ?>
</H1>
				<div class="bgWhite">
<?php 
        print "<div>" . $t_order->htmlFormElement('payment_method', $vs_form_element_format, array('width' => $vn_width, 'field_errors' => $va_errors[$vs_f], 'choiceList' => $va_payment_types, 'id' => 'caPaymentMethod')) . "</div>\n";
        ?>
					<div id="caClientOrderCustomerCreditSubForm">
<?php 
        print "<div style='float:left;'><b>" . _t("Credit card") . "</b><br/>" . caHTMLSelect('credit_card_type', $va_credit_card_types) . "</div>\n";
        print "<div style='margin-left:15px; float:left;'><b>" . _t("Expiration date") . "</b><br/>" . caHTMLSelect('credit_card_exp_mon', $this->getVar('credit_card_exp_month_list')) . " " . caHTMLSelect('credit_card_exp_yr', $this->getVar('credit_card_exp_year_list')) . "</div>\n";
        print "<div style='clear:left; float:left;'><b>" . _t("Credit card number") . "</b><br/>" . caHTMLTextInput('credit_card_number', array('size' => 30)) . "</div>\n";
        print "<div style='margin-left:15px; float:left;'><b>" . _t("CCV") . "</b><br/>" . caHTMLTextInput('credit_card_ccv', array('size' => 4)) . "</div>\n";
        print "<div id='caClientOrderProcessingIndicator'><img src='" . $this->request->getThemeUrlPath() . "/graphics/icons/indicator.gif'/> " . _t('Please wait while order is processed (this may take up to 60 seconds to complete)') . "</div>\n";
        ?>
						<div style="clear:both; height:1px; margin:0px;"><!-- empty --></div>
					</div>
					<div id="caClientOrderCustomerPOSubForm">
						Email your Purchase order to rnr@hsp.org or FAX it to 215-732-6200
					</div>
					<div id="caClientOrderCustomerCheckSubForm">
						Send your check for <?php 
        print $vs_currency_symbol . $t_order->getTotal();
        ?>
 to Rights and Reproductions, Historical Society of Pennsylvania, 1300 Locust Street, Philadelphia, PA 19107
					</div>
				</div>
			</div><!-- end caPaymentFields -->
开发者ID:guaykuru,项目名称:pawtucket,代码行数:31,代码来源:view_order_html.php

示例4: 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;
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:85,代码来源:BaseWidget.php

示例5: htmlFormElement


//.........这里部分代码省略.........
         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']);
开发者ID:samrahman,项目名称:providence,代码行数:67,代码来源:BaseModel.php

示例6: preferenceHtmlFormElement


//.........这里部分代码省略.........
                     $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"])) {
开发者ID:kai-iak,项目名称:providence,代码行数:67,代码来源:ca_users.php

示例7: 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:
  *			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]
  *
  * @return string
  */
 public function htmlFormElement($pa_element_info, $pa_options = null)
 {
     $o_config = Configuration::load();
     $va_settings = $this->getSettingValuesFromElementArray($pa_element_info, array('fieldWidth'));
     $vs_class = trim(isset($pa_options['class']) && $pa_options['class'] ? $pa_options['class'] : 'lookupBg');
     $vs_element = "<div id='{fieldNamePrefix}{$pa_element_info['element_id']}_display{n}' style='float: right;'> </div>" . 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'] : 1, 'value' => '{{' . $pa_element_info['element_id'] . '}}', 'maxlength' => 512, 'id' => "{fieldNamePrefix}{$pa_element_info['element_id']}_autocomplete{n}", 'class' => $vs_class)) . caHTMLHiddenInput("{fieldNamePrefix}{$pa_element_info['element_id']}_{n}", array('value' => '{{' . $pa_element_info['element_id'] . '}}', 'id' => "{fieldNamePrefix}{$pa_element_info['element_id']}_{n}"));
     $va_params = array('max' => 50);
     if ($pa_options['request']) {
         if ($vs_restrict_to_type = caGetOption('restrictTo' . $this->ops_name_singular . 'TypeIdno', $pa_element_info['settings'], null)) {
             $va_params = array("type" => $vs_restrict_to_type);
         } else {
             $va_params = null;
         }
         $vs_url = caNavUrl($pa_options['request'], 'lookup', $this->ops_name_singular, 'Get', $va_params);
     } else {
         // no lookup is possible
         return $this->getDisplayValue();
     }
     $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\tvar v = jQuery('#{fieldNamePrefix}{$pa_element_info['element_id']}_autocomplete{n}').val();\t\n\t\t\t\t\t\tv=v.replace(/(<\\/?[^>]+>)/gi, function(m, p1, offset, val) {\n\t\t\t\t\t\t\tjQuery('#{fieldNamePrefix}{$pa_element_info['element_id']}_display{n}').html(p1);\n\t\t\t\t\t\t\treturn '';\n\t\t\t\t\t\t});\n\t\t\t\t\t\tv=v.replace(/\\[([\\d]+)\\]\$/gi, function(m, p1, offset, val) {\n\t\t\t\t\t\t\tjQuery('#{fieldNamePrefix}{$pa_element_info['element_id']}_{n}').val(parseInt(p1));\n\t\t\t\t\t\t\treturn '';\n\t\t\t\t\t\t});\n\t\t\t\t\t\tjQuery('#{fieldNamePrefix}{$pa_element_info['element_id']}_autocomplete{n}').val(v.trim());\n\t\t\t\t\t\t\n\t\t\t\t\t\tjQuery('#{fieldNamePrefix}{$pa_element_info['element_id']}_autocomplete{n}').autocomplete( \n\t\t\t\t\t\t\t{ minLength: 3, delay: 800, html: true,\n\t\t\t\t\t\t\t\tsource: function( request, response ) {\n\t\t\t\t\t\t\t\t\t\$.ajax({\n\t\t\t\t\t\t\t\t\t\turl: '{$vs_url}',\n\t\t\t\t\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\t\t\t\t\tdata: { term: request.term, quickadd: 0, noInline: 1 },\n\t\t\t\t\t\t\t\t\t\tsuccess: function( data ) {\n\t\t\t\t\t\t\t\t\t\t\tresponse(data);\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\tselect: function( event, ui ) {\n\t\t\t\t\t\t\t\t\tif(!parseInt(ui.item.id) || (ui.item.id <= 0)) {\n\t\t\t\t\t\t\t\t\t\tjQuery('#{fieldNamePrefix}{$pa_element_info['element_id']}_autocomplete{n}').val('');  // no matches so clear text input\n\t\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tjQuery('#{fieldNamePrefix}{$pa_element_info['element_id']}_{n}').val(ui.item.id);\n\t\t\t\t\t\t\t\t\tjQuery('#{fieldNamePrefix}{$pa_element_info['element_id']}_autocomplete{n}').val(jQuery.trim(ui.item.label.replace(/<\\/?[^>]+>/gi, '')));\n\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tchange: function( event, ui ) {\n\t\t\t\t\t\t\t\t\t//If nothing has been selected remove all content from  text input\n\t\t\t\t\t\t\t\t\tif(!jQuery('#{fieldNamePrefix}{$pa_element_info['element_id']}_{n}').val()) {\n\t\t\t\t\t\t\t\t\t\tjQuery('#{fieldNamePrefix}{$pa_element_info['element_id']}_autocomplete{n}').val('');\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});\n\t\t\t\t</script>\n\t\t\t";
     return $vs_element;
 }
开发者ID:ffarago,项目名称:pawtucket2,代码行数:33,代码来源:AuthorityAttributeValue.php

示例8: htmlFormElementForSimpleForm

 /**
  * Returns HTML form input widget for bundle specified by standard "get" bundle code (eg. <table_name>.<bundle_name> format) suitable
  * for use in a simple data entry form, such as the front-end "contribute" user-provided content submission form
  *
  * This method handles generation of search form widgets for (1) related tables (eg. ca_places),  preferred and non-preferred labels for both the 
  * primary and related tables, and all other types of elements for related tables. If this method can't handle the bundle it will pass the request to the 
  * superclass implementation of htmlFormElementForSearch()
  *
  * @param $po_request HTTPRequest
  * @param $ps_field string
  * @param $pa_options array
  * @return string HTML text of form element. Will return null (from superclass) if it is not possible to generate an HTML form widget for the bundle.
  * 
  */
 public function htmlFormElementForSimpleForm($po_request, $ps_field, $pa_options = null)
 {
     $vb_as_array_element = (bool) caGetOption('asArrayElement', $pa_options, false);
     $va_tmp = explode('.', $ps_field);
     $vs_buf = '';
     if ($vs_rel_type = caGetOption('relationshipType', $pa_options, null)) {
         $vs_buf .= caHTMLHiddenInput($ps_field . '_relationship_type' . ($vb_as_array_element ? "[]" : ""), array('value' => $vs_rel_type));
     }
     if ($vs_type = caGetOption('type', $pa_options, null)) {
         $vs_buf .= caHTMLHiddenInput($ps_field . '_type' . ($vb_as_array_element ? "[]" : ""), array('value' => $vs_type));
     }
     switch (sizeof($va_tmp)) {
         # -------------------------------------
         case 1:
             // table_name
             if ($va_tmp[0] != $this->tableName()) {
                 if (!is_array($pa_options)) {
                     $pa_options = array();
                 }
                 if (!isset($pa_options['width'])) {
                     $pa_options['width'] = 30;
                 }
                 if (!isset($pa_options['values'])) {
                     $pa_options['values'] = array();
                 }
                 if (!isset($pa_options['values'][$ps_field])) {
                     $pa_options['values'][$ps_field] = '';
                 }
                 return $vs_buf . caHTMLTextInput($ps_field . ($vb_as_array_element ? "[]" : ""), array('value' => $pa_options['values'][$ps_field], 'size' => $pa_options['width'], 'class' => $pa_options['class'], 'id' => str_replace('.', '_', $ps_field)));
             }
             break;
             # -------------------------------------
         # -------------------------------------
         case 2:
             // table_name.field_name
         // table_name.field_name
         case 3:
             // table_name.field_name.sub_element
             if (!($t_instance = $this->_DATAMODEL->getInstanceByTableName($va_tmp[0], true))) {
                 return null;
             }
             switch ($va_tmp[1]) {
                 # --------------------
                 case 'preferred_labels':
                 case 'nonpreferred_labels':
                     return $vs_buf . caHTMLTextInput($ps_field . ($vb_as_array_element ? "[]" : ""), array('value' => $pa_options['values'][$ps_field], 'size' => $pa_options['width'], 'class' => $pa_options['class'], 'id' => str_replace('.', '_', $ps_field)));
                     break;
                     # --------------------
                 # --------------------
                 default:
                     if ($va_tmp[0] != $this->tableName()) {
                         switch (sizeof($va_tmp)) {
                             case 1:
                                 return $vs_buf . caHTMLTextInput($ps_field . ($vb_as_array_element ? "[]" : ""), array('value' => $pa_options['values'][$ps_field], 'size' => $pa_options['width'], 'class' => $pa_options['class'], 'id' => str_replace('.', '_', $ps_field)));
                             case 2:
                             case 3:
                                 return $vs_buf . $t_instance->htmlFormElementForSearch($po_request, $ps_field, $pa_options);
                                 break;
                         }
                     }
                     break;
                     # --------------------
             }
             break;
             # -------------------------------------
     }
     return parent::htmlFormElementForSimpleForm($po_request, $ps_field, $pa_options);
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:82,代码来源:BundlableLabelableBaseModelWithAttributes.php

示例9: 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;
 }
开发者ID:ffarago,项目名称:pawtucket2,代码行数:39,代码来源:GeoNamesAttributeValue.php

示例10: 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:
  *			usewysiwygeditor = overrides element level setting for visual text editor [Default=false]
  *			forSearch = settings and options regarding visual text editor are ignored [Default=false]
  *			class = the CSS class to apply to all visible form elements [Default=null]
  *			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]
  *			t_subject = an instance of the model to which the attribute belongs; required if suggestExistingValues lookups are enabled [Default is null]
  *			request = the RequestHTTP object for the current request; required if suggestExistingValues lookups are enabled [Default is null]
  *			suggestExistingValues = suggest values based on existing input for this element as user types [Default is false]		
  *
  * @return string
  */
 public function htmlFormElement($pa_element_info, $pa_options = null)
 {
     $va_settings = $this->getSettingValuesFromElementArray($pa_element_info, array('fieldWidth', 'fieldHeight', 'minChars', 'maxChars', 'suggestExistingValues', 'usewysiwygeditor', 'isDependentValue', 'dependentValueTemplate'));
     if (isset($pa_options['usewysiwygeditor'])) {
         $va_settings['usewysiwygeditor'] = $pa_options['usewysiwygeditor'];
     }
     if (isset($pa_options['forSearch']) && $pa_options['forSearch']) {
         unset($va_settings['usewysiwygeditor']);
     }
     $vs_width = trim(isset($pa_options['width']) && $pa_options['width'] > 0 ? $pa_options['width'] : $va_settings['fieldWidth']);
     $vs_height = trim(isset($pa_options['height']) && $pa_options['height'] > 0 ? $pa_options['height'] : $va_settings['fieldHeight']);
     $vs_class = trim(isset($pa_options['class']) && $pa_options['class'] ? $pa_options['class'] : '');
     $vs_element = '';
     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 ($va_settings['usewysiwygeditor']) {
         $o_config = Configuration::load();
         if (!is_array($va_toolbar_config = $o_config->getAssoc('wysiwyg_editor_toolbar'))) {
             $va_toolbar_config = array();
         }
         AssetLoadManager::register("ckeditor");
         $vs_element = "<script type='text/javascript'>jQuery(document).ready(function() {\n\t\t\t\t\t\tvar ckEditor = CKEDITOR.replace( '{fieldNamePrefix}" . $pa_element_info['element_id'] . "_{n}',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttoolbar : " . json_encode(array_values($va_toolbar_config)) . ", /* this does the magic */\n\t\t\t\t\t\t\twidth: '{$vs_width}',\n\t\t\t\t\t\t\theight: '{$vs_height}',\n\t\t\t\t\t\t\ttoolbarLocation: 'top',\n\t\t\t\t\t\t\tenterMode: CKEDITOR.ENTER_BR\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\tckEditor.on('instanceReady', function(){ \n\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});\n \t});\t\t\t\t\t\t\t\t\t\n</script>";
     }
     $va_opts = array('size' => $vs_width, 'height' => $vs_height, 'value' => '{{' . $pa_element_info['element_id'] . '}}', 'maxlength' => $va_settings['maxChars'], 'class' => $vs_class, 'id' => '{fieldNamePrefix}' . $pa_element_info['element_id'] . '_{n}', 'class' => "{$vs_class}" . ($va_settings['usewysiwygeditor'] ? " ckeditor" : ''));
     if (caGetOption('readonly', $pa_options, false)) {
         $va_opts['disabled'] = 1;
     }
     $vs_element .= caHTMLTextInput('{fieldNamePrefix}' . $pa_element_info['element_id'] . '_{n}', $va_opts);
     if ($va_settings['isDependentValue']) {
         AssetLoadManager::register('displayTemplateParser');
         $t_element = new ca_metadata_elements($pa_element_info['element_id']);
         $va_elements = $t_element->getElementsInSet($t_element->getHierarchyRootID());
         $va_element_dom_ids = array();
         foreach ($va_elements as $vn_i => $va_element) {
             if ($va_element['datatype'] == __CA_ATTRIBUTE_VALUE_CONTAINER__) {
                 continue;
             }
             $va_element_dom_ids[$va_element['element_code']] = "#{fieldNamePrefix}" . $va_element['element_id'] . "_{n}";
         }
         $vs_element .= "<script type='text/javascript'>jQuery(document).ready(function() {\n \t\t\t\t\tjQuery('#{fieldNamePrefix}" . $pa_element_info['element_id'] . "_{n}').html(caDisplayTemplateParser.processDependentTemplate('" . addslashes($va_settings['dependentValueTemplate']) . "', " . json_encode($va_element_dom_ids, JSON_FORCE_OBJECT) . "));\n \t\t\t\t";
         $vs_element .= "jQuery('" . join(", ", $va_element_dom_ids) . "').bind('keyup', function(e) { \n \t\t\t\t\tjQuery('#{fieldNamePrefix}" . $pa_element_info['element_id'] . "_{n}').html(caDisplayTemplateParser.processDependentTemplate('" . addslashes($va_settings['dependentValueTemplate']) . "', " . json_encode($va_element_dom_ids, JSON_FORCE_OBJECT) . "));\n \t\t\t\t});";
         $vs_element .= "});</script>";
     }
     $vs_bundle_name = $vs_lookup_url = null;
     if (isset($pa_options['t_subject']) && is_object($pa_options['t_subject'])) {
         $vs_bundle_name = $pa_options['t_subject']->tableName() . '.' . $pa_element_info['element_code'];
         if ($pa_options['request']) {
             if (isset($pa_options['lookupUrl']) && $pa_options['lookupUrl']) {
                 $vs_lookup_url = $pa_options['lookupUrl'];
             } else {
                 $vs_lookup_url = caNavUrl($pa_options['request'], 'lookup', 'AttributeValue', 'Get', array('max' => 500, 'bundle' => $vs_bundle_name));
             }
         }
     }
     if ($va_settings['suggestExistingValues'] && $vs_lookup_url && $vs_bundle_name) {
         $vs_element .= "<script type='text/javascript'>\n \t\t\t\t\tjQuery('#{fieldNamePrefix}" . $pa_element_info['element_id'] . "_{n}').autocomplete( \n\t\t\t\t\t\t{ \n\t\t\t\t\t\t\tsource: '{$vs_lookup_url}',\n\t\t\t\t\t\t\tminLength: 3, delay: 800\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n \t\t\t\t</script>\n";
     }
     return $vs_element;
 }
开发者ID:kai-iak,项目名称:providence,代码行数:79,代码来源:TextAttributeValue.php

示例11: 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
  * 	'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:
//.........这里部分代码省略.........
开发者ID:guaykuru,项目名称:pawtucket,代码行数:101,代码来源:ModelSettings.php

示例12: caHTMLTextInput

print caHTMLTextInput('sourceUrl', array('id' => 'caSourceUrl', 'class' => 'urlBg'), array('width' => '300px'));
?>
					</p>
				</div>
			</div>
		</div>
		<div class='bundleLabel' id="caSourceTextContainer">
			<span class="formLabelText"><?php 
print _t('Data as text');
?>
</span> 
			<div class="bundleContainer">
				<div class="caLabelList" >
					<p>
<?php 
print caHTMLTextInput('sourceText', array('id' => 'caSourceText'), array('width' => '600px', 'height' => 3));
?>
					</p>
				</div>
			</div>
		</div>
		<div class='bundleLabel'>
			<span class="formLabelText"><?php 
print _t('Log level');
?>
</span> 
			<div class="bundleContainer">
				<div class="caLabelList">
					<p>
<?php 
print caHTMLSelect('logLevel', caGetLogLevels(), array('id' => 'caLogLevel'), array('value' => $va_last_settings['logLevel']));
开发者ID:idiscussforum,项目名称:providence,代码行数:31,代码来源:importer_run_html.php

示例13: 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 = settings and options regarding visual text editor are ignored [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]
  *
  * @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'], 'class' => $vs_class), $pa_options);
     }
     $o_config = Configuration::load();
     $va_settings = $this->getSettingValuesFromElementArray($pa_element_info, array('fieldWidth', 'fieldHeight'));
     $vs_element = '<div id="lcsh_' . $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' => "lcsh_" . $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}'));
     if ($pa_options['request']) {
         $vs_url = caNavUrl($pa_options['request'], 'lookup', 'LCSH', 'Get', array('max' => 100, 'element_id' => (int) $pa_element_info['element_id']));
     } else {
         // hardcoded default for testing.
         $vs_url = '/index.php/lookup/LCSH/Get';
     }
     $vs_element .= " <a href='#' class='caLCSHServiceMoreLink' id='{fieldNamePrefix}" . $pa_element_info['element_id'] . "_link{n}' target='_lcsh_details'>" . _t("More &rsaquo;") . "</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('#lcsh_" . $pa_element_info['element_id'] . "_autocomplete{n}').autocomplete(\n\t\t\t\t\t\t\t{ source: '{$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\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}\n     \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 = /\\[info:lc([^\\]]+)\\]/; \n\t\t\t\t\t\t\tvar r = re.exec('{{" . $pa_element_info['element_id'] . "}}');\n\t\t\t\t\t\t\tvar lcsh_id = (r) ? r[1] : null;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (!lcsh_id) {\n\t\t\t\t\t\t\t\tre = /\\[sh([^\\]]+)\\]/; \n\t\t\t\t\t\t\t\tvar r = re.exec('{{" . $pa_element_info['element_id'] . "}}');\n\t\t\t\t\t\t\t\tvar lcsh_id = (r) ? '/authorities/subjects/sh' + r[1] : null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (lcsh_id) {\n\t\t\t\t\t\t\t\tjQuery('#{fieldNamePrefix}" . $pa_element_info['element_id'] . "_link{n}').css('display', 'inline').attr('href', 'http://id.loc.gov' + lcsh_id);\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;
 }
开发者ID:ffarago,项目名称:pawtucket2,代码行数:33,代码来源:LCSHAttributeValue.php

示例14: htmlFormElement

 public function htmlFormElement($pa_element_info, $pa_options = null)
 {
     $vn_width = isset($pa_options['width']) && $pa_options['width'] > 0 ? $pa_options['width'] : 30;
     $vn_max_length = 255;
     return caHTMLTextInput('{fieldNamePrefix}' . $pa_element_info['element_id'] . '_{n}', array('id' => '{fieldNamePrefix}' . $pa_element_info['element_id'] . '_{n}', 'size' => $vn_width, 'value' => '{{' . $pa_element_info['element_id'] . '}}', 'maxlength' => $vn_max_length, 'class' => 'timecodeBg'));
 }
开发者ID:guaykuru,项目名称:pawtucket,代码行数:6,代码来源:TimeCodeAttributeValue.php

示例15: _t

    print _t("Toggle checked");
    ?>
</a></div>
		</form>
	</div>
	<br class="clear"/>
<?php 
}
?>
	<div class="col">
<?php 
print "<span class='header'>" . _t("Create set") . ":</span><br/>";
?>
		<form id="caCreateSetFromResults">
<?php 
print caHTMLTextInput('set_name', array('id' => 'caCreateSetFromResultsInput', 'class' => 'searchSetsTextInput', 'value' => $o_result_context->getSearchExpression()), array('width' => '150px'));
print " ";
print caHTMLSelect('set_create_mode', array(_t('from results') => 'from_results', _t('from checked') => 'from_checked'), array('id' => 'caCreateSetFromResultsMode', 'class' => 'searchSetsSelect'), array('value' => null, 'width' => '140px'));
if ($t_list->getAppConfig()->get('enable_set_type_controls')) {
    print $t_list->getListAsHTMLFormElement('set_types', 'set_type', array('id' => 'caCreateSetTypeID', 'class' => 'searchSetsSelect'), array('value' => null, 'width' => '140px'));
}
print caBusyIndicatorIcon($this->request, array('id' => 'caCreateSetFromResultsIndicator')) . "\n";
?>
			<a href='#' onclick="caCreateSetFromResults(); return false;" class="button"><?php 
print _t('Create');
?>
 &rsaquo;</a>
<?php 
if ($this->request->user->canDoAction('can_batch_edit_' . $t_subject->tableName())) {
    print '<div class="searchSetsBatchEdit">' . caHTMLCheckboxInput('batch_edit', array('id' => 'caCreateSetBatchEdit', 'value' => 1)) . " " . _t('Open set for batch editing') . "</div>\n";
}
开发者ID:samrahman,项目名称:providence,代码行数:31,代码来源:search_sets_html.php


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