本文整理汇总了PHP中generate_input函数的典型用法代码示例。如果您正苦于以下问题:PHP generate_input函数的具体用法?PHP generate_input怎么用?PHP generate_input使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了generate_input函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render_login
function render_login($username = '', $small = false)
{
if ($username) {
?>
<h2>Welcome <?php
echo ucwords($username);
?>
</h2>
<?php
echo anchor('user/logout', "Logout");
?>
<?php
} else {
?>
<h2>Account Login</h2>
<?php
echo form_open('user/login');
?>
<label>email</label>
<?php
echo generate_input('email', 'input', 'input', '');
?>
<label>password</label>
<?php
echo generate_input('password', 'password', 'input', '');
?>
<input type="image" src="/beex/images/buttons/signin.gif" style="width:auto;" />
</form>
<?php
echo anchor('', 'Forgot your password?');
?>
<?php
echo $small ? anchor("user/newuser", "Register with Beex") : anchor("user/newuser", "<img src='/beex/images/buttons/register.gif' style='display:block; margin:8px auto;'>");
?>
<?php
}
}
示例2: create_field_entry_custom_field
function create_field_entry_custom_field($field, $key, $disabled = FALSE)
{
global $custom_fields, $tbl_entry;
global $is_mandatory_field, $text_input_max, $maxlength;
echo "<div>\n";
$params = array('label' => get_loc_field_name($tbl_entry, $key) . ":", 'name' => VAR_PREFIX . $key, 'value' => isset($custom_fields[$key]) ? $custom_fields[$key] : NULL, 'disabled' => $disabled, 'attributes' => array(), 'maxlength' => isset($maxlength["entry.{$key}"]) ? $maxlength["entry.{$key}"] : NULL, 'mandatory' => isset($is_mandatory_field["entry.{$key}"]) && $is_mandatory_field["entry.{$key}"]);
// Output a checkbox if it's a boolean or integer <= 2 bytes (which we will
// assume are intended to be booleans)
if ($field['nature'] == 'boolean' || $field['nature'] == 'integer' && isset($field['length']) && $field['length'] <= 2) {
generate_checkbox($params);
} elseif ($field['nature'] == 'character' && isset($field['length']) && $field['length'] > $text_input_max) {
// HTML5 does not allow a pattern attribute for the textarea element
$params['attributes'][] = 'rows="8"';
$params['attributes'][] = 'cols="40"';
generate_textarea($params);
} else {
$is_integer_field = $field['nature'] == 'integer' && $field['length'] > 2;
if ($is_integer_field) {
$params['type'] = 'number';
$params['step'] = '1';
} else {
$params['type'] = 'text';
if ($params['mandatory']) {
// 'required' is not sufficient for strings, because we also want to make sure
// that the string contains at least one non-whitespace character
$params['pattern'] = REGEX_TEXT_POS;
}
}
$params['field'] = "entry.{$key}";
generate_input($params);
}
echo "</div>\n";
}
示例3: generate_input
break;
case 'email':
generate_input($label_text, $var_name, $data[$key], FALSE, isset($maxlength["users.{$key}"]) ? $maxlength["users.{$key}"] : NULL, 'type=email multiple');
break;
default:
// Output a checkbox if it's a boolean or integer <= 2 bytes (which we will
// assume are intended to be booleans)
if ($field['nature'] == 'boolean' || $field['nature'] == 'integer' && isset($field['length']) && $field['length'] <= 2) {
echo "<label for=\"{$var_name}\">{$label_text}</label>\n";
echo "<input type=\"checkbox\" class=\"checkbox\" " . "id=\"{$var_name}\" name=\"{$var_name}\" value=\"1\"" . (!empty($data[$key]) ? " checked=\"checked\"" : "") . ">\n";
} elseif (!empty($select_options["users.{$key}"])) {
generate_select($label_text, $var_name, $data[$key], $select_options["users.{$key}"]);
} elseif ($field['nature'] == 'character' && isset($field['length']) && $field['length'] > $text_input_max) {
generate_textarea($label_text, $var_name, $data[$key]);
} else {
generate_input($label_text, $var_name, $data[$key], FALSE, isset($maxlength["users.{$key}"]) ? $maxlength["users.{$key}"] : NULL);
}
break;
}
// end switch
echo "</div>\n";
}
// end switch
// Then output any error messages associated with the field
// except for the password field which is a special case
switch ($key) {
case 'email':
if (!empty($invalid_email)) {
echo "<p class=\"error\">" . get_vocab('invalid_email') . "</p>\n";
}
break;
示例4: generate_input
$mission_statement_cell = generate_input($name, 'text', $edit, $value);
$name = 'about_us';
$value = $new ? set_value($name) : @$item->{$name};
$about_us_cell = generate_input($name, 'text', $edit, $value);
$name = 'rss_feed';
$value = $new ? set_value($name) : @$item->{$name};
$rss_feed_cell = generate_input($name, 'input', $edit, $value);
$name = 'twitter_link';
$value = $new ? set_value($name) : @$item->{$name};
$twitter_link_cell = generate_input($name, 'input', $edit, $value);
$name = 'facebook_link';
$value = $new ? set_value($name) : @$item->{$name};
$facebook_link_cell = generate_input($name, 'input', $edit, $value);
$name = 'youtube_link';
$value = $new ? set_value($name) : @$item->{$name};
$youtube_link_cell = generate_input($name, 'input', $edit, $value);
}
$attributes = array('id' => 'npoform', 'class' => 'form');
$hidden_fields = array('user_id' => $this->session->userdata('user_id'));
?>
<div id="NPORegistration" class="registration_form">
<div id="LeftColumn">
<p class="small_help_title">THIS IS HOW YOUR PROFILE SIDEBAR WILL APPEAR.</p>
<div class="MiniProfile" id="MiniProfile">
<h2>NonProfit</h2>
<div class="info">
<div class='image'>
示例5: add_slashes
break;
case "phone":
$value = add_slashes($phone);
$edit_value = $phone;
break;
case "mobile":
$value = add_slashes($mobile);
$edit_value = $mobile;
break;
case "message":
$value = nl2br(ucfirst($message));
$edit_value = $message;
break;
}
echo display_contact($each_set->attribute, $value);
echo generate_input($each_set->form_element, $each_set->options, $each_set->attribute, $each_set->searchable, $each_set->placeholder, $each_set->class_name, $each_set->style_name, $i, $each_set->is_required, $each->title_placeholder, $edit_value, "edit", $salutation);
if ($i == 1) {
?>
<div class="row dispRow">
<div class="column small-2">
<strong class="radius" > E-mail</strong>
</div>
<div class="small-1 columns alignmyprofile"> <b> : </b></div>
<div class="columns small-9 displayEle alignmyprofile">
<?php
echo $email;
?>
<!--<a href="change-email.php" style="margin-left:10px">Change</a>-->
</div>
</div>
示例6: set_value
echo "<th colspan=2>5. How</td></tr>\r\n\t\t<tr>";
$name = 'challenge_blurb';
$value = $new ? set_value($name) : $item->{$name};
echo "<td>Blurb (120 characters or less)</td><td>" . generate_input($name, 'text', $edit, $value) . "</td>\r\n\t\t</tr>\r\n\t\t<tr>";
$name = 'challenge_description';
$value = $new ? set_value($name) : $item->{$name};
echo "<td>Describe the challenge (text)</td><td>" . generate_input($name, 'text', $edit, $value) . "</td>\r\n\t\t</tr>\r\n\t\t<tr>";
$name = 'challenge_video';
$value = $new ? set_value($name) : $item->{$name};
echo "<td>Upload a video explanation</td><td>" . generate_input($name, 'input', $edit, $value) . "</td>\r\n\t\t</tr>\r\n\t\t<tr>";
$name = 'challenge_whydo';
$value = $new ? set_value($name) : $item->{$name};
echo "<td colspan=2>Optional</td></tr><tr><td>Why are you doing this challenge?</td><td>" . generate_input($name, 'text', $edit, $value) . "</td>\r\n\t\t</tr>\r\n\t\t<tr>";
$name = 'challenge_whycare';
$value = $new ? set_value($name) : $item->{$name};
echo "<td>Why do you care about this nonprofit?</td><td>" . generate_input($name, 'text', $edit, $value) . "</td>\r\n\t\t</tr>\r\n\t\t<tr>";
if ($edit) {
$data = array('class' => 'submit');
echo "<td colspan=2>" . form_submit($data, 'Update challenge') . "</td>";
}
echo "</tr>\r\n \t</table>";
if ($edit) {
echo "</form>";
}
?>
<div id="challengeForm" class="form">
<div id="LeftColumn">
</div>
示例7: generate_input
$blurb_cell = generate_input($name, 'text', $edit, $value, '', array('maxlength' => '140'));
$name = 'advice';
$value = $new ? set_value($name) : @$item->{$name};
$advice_cell = generate_input($name, 'text', $edit, $value);
// Website Cell
$name = 'website';
$value = $new ? set_value($name) : @$item->{$name};
$website_cell = generate_input($name, 'input', $edit, $value);
// Website Cell
$name = 'upsets';
$value = $new ? set_value($name) : @$item->{$name};
$upsets_cell = generate_input($name, 'text', $edit, $value);
// Website Cell
$name = 'joy';
$value = $new ? set_value($name) : @$item->{$name};
$joy_cell = generate_input($name, 'text', $edit, $value);
if ($edit) {
$data = array('class' => 'submit');
$verb = $new ? 'Add' : 'Edit';
$submit_cell = form_submit($data, $verb . ' User');
}
?>
<div id="UserForm" class="registration_form">
<div id="LeftColumn">
<p class="small_help_title">THIS IS HOW YOUR PROFILE STUB WILL APPEAR.</p>
<div class="MiniProfile" id="MiniProfile">
<h2>Challenger</h2>
<div class="info">
示例8: day_name
for ($i = 0; $i < 7; $i++) {
$wday = ($i + $weekstarts) % 7;
echo " <label><input class=\"checkbox\" name=\"rep_day[{$wday}]\" type=\"checkbox\"";
if ($rep_day[$wday]) {
echo " checked=\"checked\"";
}
echo ">" . day_name($wday) . "</label>\n";
}
?>
</div>
</div>
<?php
echo "<div>\n";
$label_text = get_vocab("rep_num_weeks") . ":<br>" . get_vocab("rep_for_nweekly");
generate_input($label_text, 'rep_num_weeks', $rep_num_weeks);
echo "</div>\n";
echo "</fieldset>\n";
} elseif (isset($id)) {
// otherwise, if it's an existing booking, show the repeat information
// and pass it through to the handler but do not let the user edit it
// (because they're either not allowed to, or else they've chosen to edit
// an individual entry rather than a series).
// (NOTE: when repeat bookings are restricted to admins, an ordinary user
// would not normally be able to get to the stage of trying to edit a series.
// But we have to cater for the possibility because it could happen if (a) the
// series was created before the policy was introduced or (b) the user has
// been demoted since the series was created).
$key = "rep_type_" . (isset($rep_type) ? $rep_type : REP_NONE);
echo "<fieldset id=\"rep_info\">\n";
echo "<legend></legend>\n";
示例9: create_field_entry_max_duration
function create_field_entry_max_duration()
{
global $max_duration_enabled, $max_duration_secs, $max_duration_periods;
// The max duration policies
echo "<fieldset>\n";
echo "<legend>" . get_vocab("booking_durations") . "</legend>\n";
echo "<div>\n";
$params = array('label' => get_vocab("max_duration") . ":", 'name' => 'area_max_duration_enabled', 'value' => $max_duration_enabled, 'class' => 'enabler');
generate_checkbox($params);
echo "</div>\n";
echo "<div>\n";
$attributes = array('class="text"', 'type="number"', 'min="0"', 'step="1"');
$params = array('name' => 'area_max_duration_periods', 'label' => get_vocab("mode_periods") . ':', 'value' => $max_duration_periods, 'attributes' => $attributes);
generate_input($params);
echo "</div>\n";
echo "<div>\n";
$max_duration_value = $max_duration_secs;
toTimeString($max_duration_value, $max_duration_units);
$attributes = array('class="text"', 'type="number"', 'min="0"', 'step="1"');
$params = array('name' => 'area_max_duration_value', 'label' => get_vocab("mode_times") . ':', 'value' => $max_duration_value, 'attributes' => $attributes);
generate_input($params);
$units = array("seconds", "minutes", "hours", "days", "weeks");
$options = array();
foreach ($units as $unit) {
$options[$unit] = get_vocab($unit);
}
$params = array('name' => 'area_max_duration_units', 'value' => array_search($max_duration_units, $options), 'options' => $options);
generate_select($params);
echo "</div>\n";
echo "</fieldset>\n";
}
示例10: generate_input
table th {background-color:inherit; border:none; color:#999; vertical-align:top;}
.messagebig {width:auto;}
.messagetext {width:100%;height:200px;}
#buttontable {margin-left:228px; width:65%; margin-top:10px;}
#buttontable td {text-align:right; width:50%}
#buttontable th {text-align:left; width:50%}
#buttontable img {cursor:pointer;}
</style>
<form class="FormBG form" style="background-color:#fff;">
<h2 class="title">Messaging</h2>
<table style="margin-bottom:0px;">
<tr>
<th>Message Text</th>
<td class="messagebig"><?php
echo generate_input('message', 'text', true, '', '', 'messagetext');
?>
</td>
</tr>
</table>
<table id="buttontable">
<tr>
<th><a href="/beex/media/donor_emails.xls"><img src="/beex/images/buttons/export-donor.gif" /></a></th>
<td><img src="/beex/images/buttons/send-all-donors.gif" /></td>
</tr>
<tr>
<th><img src="/beex/images/buttons/export-challenger.gif" /></th>
<td><img src="/beex/images/buttons/send-all-challengers.gif" /></td>
</tr>
示例11: set_value
echo "</tr>\r\n\t\t<tr>";
$name = 'hometown';
$value = $new ? set_value($name) : $item->{$name};
echo "<td>Hometown</td><td>" . generate_input($name, 'input', $edit, $value) . "</td>\r\n\t\t</tr>\r\n\t\t<tr>";
$name = 'zip';
$value = $new ? set_value($name) : $item->{$name};
echo "<td>Zip</td><td>" . generate_input($name, 'input', $edit, $value, '', array('class' => 'zip', 'maxlength' => 5)) . "</td>\r\n\t\t</tr>\r\n\t\t<tr>";
$name = 'network';
$value = $new ? set_value($name) : $item->{$name};
echo "<td>Network</td><td>" . generate_input($name, 'input', $edit, $value) . "</td>\r\n\t\t</tr>\r\n\t\t<tr>";
$sexes = array('M' => 'M', 'F' => 'F');
$name = 'gender';
$value = $new ? set_value($name) : $item->{$name};
echo "<td>Gender</td><td>" . generate_input($name, 'dropdown', $edit, $value, $sexes) . "</td>\r\n\t\t</tr>\r\n\t\t<tr>";
$name = 'whycare';
$value = $new ? set_value($name) : $item->{$name};
echo "<td>Why do you care?</td><td>" . generate_input($name, 'text', $edit, $value) . "</td>\r\n\t\t</tr>\r\n\t\t<tr>";
$name = 'blurb';
$value = $new ? set_value($name) : $item->{$name};
echo "<td>Blurb (140 chars)</td><td>" . generate_input($name, 'text', $edit, $value) . "</td>\r\n\t\t</tr>\r\n\t\t<tr>";
$name = 'advice';
$value = $new ? set_value($name) : $item->{$name};
echo "<td>Advice for fundraisers</td><td>" . generate_input($name, 'text', $edit, $value) . "</td>\r\n\t\t</tr>\r\n\t\t<tr>";
if ($edit) {
$data = array('class' => 'submit');
echo "<td colspan=2>" . form_submit($data, 'Add User') . "</td>";
}
echo "</tr>\r\n \t</table>";
if ($edit) {
echo "</form>";
}
示例12: generate_input
//echo $cluster_code;
} else {
$joina = false;
}
if ($username = $this->session->userdata('username')) {
$name = 'user_id';
$email_cell = $username;
if ($new) {
$email_cell .= generate_input($name, 'hidden', $edit, $user_id);
}
} else {
$data = array('name' => 'email', 'id' => 'email', 'size' => 25, 'value' => $new ? set_value('email') : $item->user_id);
$email_cell = $edit ? form_input($data) : $item->user_id;
$name = 'password';
$value = $new ? set_value($name) : $item->{$name};
$password_cell = generate_input($name, 'password', $edit, $value);
}
if (isset($cluster_code)) {
$setup['npo_name'] = $this->beex->name_that_npo($cluster_code);
}
$setup['edit'] = $edit;
$setup['new'] = $new;
$setup['item'] = $item;
$setup['npos'] = $this->MItems->getDropdownArray('npos', 'name');
if (isset($cluster_code) && $cluster_code) {
$setup['npo_name'] = $this->beex->name_that_npo($cluster_code);
$setup['cluster'] = $this->MItems->getCluster($cluster_code)->row();
}
$this->load->helper('array');
$this->load->helper('beexform');
$cells = challenge_form_setup($setup);
示例13: base_url
<p><input type="file" name="filename" onchange="ajaxUpload(this.form,'<?php
echo base_url();
?>
index.php/ajax/image_upload/cluster','upload_area','File Uploading Please Wait...<br /><img src=\'images/loader_light_blue.gif\' width=\'128\' height=\'15\' border=\'0\' />','<img src=\'images/error.gif\' width=\'16\' height=\'16\' border=\'0\' /> Error in Upload.'); return false;" /></p>
</form>
</fieldset>
<div id="upload_area" name="upload_area">
</div>
<?php
//echo generate_input('cluster_image', 'file', $edit, '');
?>
</div>
<div class="input_wrapper">
<label>Video URL Link:</label>
<?php
echo generate_input('cluster_video', 'text', $edit, '');
?>
</div>
<div class="input_buttons">
<img src="<?php
echo base_url();
?>
images/buttons/prev.gif" alt="Prev Step" id="media_tab_prev_btn" class="prev_btn">
<img src="<?php
echo base_url();
?>
images/buttons/next.gif" alt="Next Step" id="media_tab_next_btn" class="next_btn">
<?php
if ($edit_id) {
?>
<img src="<?php
示例14: generate_input
generate_input($params);
$units = array("seconds", "minutes", "hours", "days", "weeks");
$options = array();
foreach ($units as $unit) {
$options[$unit] = get_vocab($unit);
}
$params = array('name' => 'area_min_ba_units', 'value' => array_search($min_ba_units, $options), 'options' => $options);
generate_select($params);
echo "</div>\n";
// Maximum book ahead
echo "<div>\n";
$params = array('label' => get_vocab("max_book_ahead") . ":", 'name' => 'area_max_ba_enabled', 'value' => $max_book_ahead_enabled, 'class' => 'enabler');
generate_checkbox($params);
$attributes = array('class="text"', 'type="number"', 'min="0"', 'step="1"');
$params = array('name' => 'area_max_ba_value', 'value' => $max_ba_value, 'attributes' => $attributes);
generate_input($params);
$params = array('name' => 'area_max_ba_units', 'value' => array_search($max_ba_units, $options), 'options' => $options);
// options same as before
generate_select($params);
echo "</div>\n";
// The max_per booking policies
echo "<table>\n";
echo "<thead>\n";
echo "<tr>\n";
echo "<th></th>\n";
echo "<th>" . get_vocab("this_area") . "</th>\n";
echo "<th title=\"" . get_vocab("whole_system_note") . "\">" . get_vocab("whole_system") . "</th>\n";
echo "</tr>\n";
echo "</thead>\n";
echo "<tbody>\n";
foreach ($interval_types as $interval_type) {
示例15: generate_input
<td><?php
echo generate_input('name', 'input', true, '');
?>
</td>
</tr>
<tr>
<td class="label"><label>E-mail:</label></td>
<td><?php
echo generate_input('email', 'input', true, '');
?>
</td>
</tr>
<!--<tr>
<td class="label"><label>E-mail Message:<br /><br /><span style="font-size:9px; font-style:italic;">**Invites contain a cluster access code. When this code is entered into a "Join a Cluster" field on the website, the user will be prompted to fill out the form below. You (cluster admin) can accept or reject anyone who fills out the form on the <a>admin dashboard page</a>.</span></label></td>
<td><?php
echo generate_input('personal_message', 'text', true, '', 'big_text');
?>
</td>
</tr>-->
<!--
<tr>
<td colspan=2><h5>Join Cluster Form</h5></td>
</tr>
<tr>
<td colspan="2"><a>+ Add questions</a><br />Max 3 questions</td>
</tr>
<tr>
<td class="label"><label>Question 1</label></td>
<td><input /></td>
</tr>