function input($objectName, $method, $object, $options = array()) { $attr = $object->getAttribute($method); switch ($attr->type) { case 'string': $str = text_field($objectName, $method, $object, $options); break; case 'text': $str = text_area($objectName, $method, $object, $options); break; case 'date': $str = date_select($objectName, $method, $object); break; case 'datetime': $str = date_time_select($objectName, $method, $object); break; case 'integer': $str = text_field($objectName, $method, $object, $options); break; case 'float': $str = text_field($objectName, $method, $object, $options); break; case 'boolean': $str = check_box($objectName, $method, $object, $options); break; default: $str = hidden_field($objectName, $method, $object); break; } return error_wrapping($str, isset($object->errors[$method])); }
public function testTextfield() { $this->assertDomEqual(text_field('post', 'title', $this->post), '<input id="post_title" name="post[title]" size="30" type="text" value="PHP for ever" />'); $this->assertDomEqual(password_field('post', 'title', $this->post), '<input id="post_title" name="post[title]" size="30" type="password" value="PHP for ever" />'); $this->assertDomEqual(file_field('post', 'title', $this->post), '<input id="post_title" name="post[title]" type="file" />'); $this->assertDomEqual(text_field('post', 'title', $this->post, array('size' => 35, 'maxlength' => 35)), '<input id="post_title" name="post[title]" size="35" maxlength="35" type="text" value="PHP for ever" />'); $this->assertDomEqual(text_field('post', 'title', $this->post, array('index' => 2)), '<input id="post_2_title" name="post[2][title]" size="30" type="text" value="PHP for ever" />'); }
function content() { if (!user_logged_in()) { return must_log_in(); } $user = fetch_one_or_none('users', 'id', user_logged_in()); $errors = array(); if (array_key_exists('change', $_POST)) { if (!isset($_POST['email']) || !$_POST['email']) { $errors[] = "Please enter an email address"; } else { $email = $_POST['email']; if ($email && !validate_email_address($email)) { $errors[] = "Invalid email address"; } if (count($errors) == 0 && count(fetch_all('users', 'email_address', $email))) { $errors[] = "A user with this email address already exists"; } if (count($errors) == 0) { update_all('users', array('new_email_address' => $email), 'id', user_logged_in()); send_email_change_email($email, $user->name); ?> <p>We have sent an email to your new address requesting that you confirm that change of address.</p> <?php return; } } } $fields = array(); page_header('Change email address'); show_error_list($errors); ?> <form method="post" action="" accept-charset="UTF-8"> <div class="fieldrow"> <div class="field"> <label>Current address:</label> <div><tt><?php esc($user->email_address); ?> </tt></div> </div> </div> <div class="fieldrow"> <?php text_field($fields, 'email', 'New address'); ?> </div> <div class="fieldrow"> <input type="submit" name="change" value="Change"/> </div> </form> <?php }
function content() { global $errors; ?> <h2>Login</h2> <p>If you have not yet registered for an account, you will need to <a href="register">register</a> before you can log in. If you have have forgotten your password, you can <a href="request-reset">reset it</a>.</p> <?php show_error_list($errors); ?> <form method="post" action="" accept-charset="UTF-8"> <div class="fieldrow"> <?php text_field($_POST, 'email', 'Email address'); ?> </div> <div class="fieldrow"> <div> <label for="password">Password</label> <input type="password" id="password" name="password" /> </div> </div> <div class="fieldrow"> <input type="checkbox" id="forever" name="forever" value="1" checked="checked" /> <label for="forever">Stay logged in? <br/><span class="label-extra">If you are using a shared computer, you should not set this option.</span></label> </div> <div class="fieldrow"> <input type="submit" name="login" value="Login" /> <br/><span class="note">(This sets a cookie, which logging out clears.)</span> </div> <?php if (array_key_exists('return', $_GET)) { hidden_field('return', $_GET['return']); } elseif (array_key_exists('return', $_POST)) { hidden_field('return', $_POST['return']); } ?> </form> <?php }
function display_column($label, $row, $col_name, $editable = TRUE) { print "<tr>\n"; print "<td>" . htmlspecialchars($label) . "</td>\n"; print "<td>"; if ($editable) { # display as editable field text_field("row[{$col_name}]", $row[$col_name], 80); } else { # display as read-only text print htmlspecialchars($row[$col_name]); } print "</td>\n"; print "</tr>\n"; }
function field_html($args, $arrSlide = array()) { switch ($args['type']) { case 'textarea': return text_area($args, $arrSlide); case 'checkbox': return checkbox_field($args, $arrSlide); case 'select': return select_field($args, $arrSlide); case 'image': return image_field($args, $arrSlide); default: return text_field($args, $arrSlide); } }
function field_html($args) { switch ($args[2]) { case 'textarea': return text_area($args); case 'checkbox': case 'radio': case 'button': case 'text': return text_button($args); case 'submit': default: return text_field($args); } }
function field_html($args) { switch ($args[2]) { case 'textarea': return text_area($args); case 'checkbox': // To Do // To Do case 'radio': // To Do // To Do case 'text': default: return text_field($args); } }
function content() { $errors = array(); page_header('Request password reset'); if (array_key_exists('reset', $_POST)) { if (!isset($_POST['email']) || !$_POST['email']) { $errors[] = "Please enter an email address"; } else { $user = fetch_one_or_none('users', 'email_address', $_POST['email']); if (!$user) { $errors[] = "Incorrect email address supplied"; } if (count($errors) == 0) { $token = make_random_token(); update_all('users', array('activation_token' => $token), 'id', $user->id); send_reset_email($user->email_address, $user->name, $token); ?> <p>We have sent you an email containing a link allowing you to reset your password.</p> <?php return; } } } ?> <p>If you have forgotten your password and need it resetting, please enter your email address below and we will send you an email allowing you to reset your password.</p> <?php show_error_list($errors); ?> <form method="post" action="" accept-charset="UTF-8"> <div class="fieldrow"> <?php text_field($_POST, 'email', 'Email address'); ?> </div> <div class="fieldrow"> <input type="submit" name="reset" value="Reset" /> </div> </form> <?php }
function field_html($args) { switch ($args[2]) { case 'textarea': return text_area($args); case 'checkbox': // Checkbox return check_box($args); case 'background_variant': // Dropmenu return background_variant($args); case 'image_url': // Image URL return image_url($args); case 'text': default: return text_field($args); } }
/** * Renders attachment based on Object type * * @param void * @return string */ function render($element_name) { switch ($this->getRelObjectManager()) { case 'Companies': case 'Contacts': case 'ProjectFiles': case 'ProjectMessages': case 'ProjectMilestones': case 'ProjectTasks': case 'ProjectTaskLists': case 'ProjectTickets': return text_field($element_name, $this->getText()); break; default: return textarea_field($element_name, $this->getText(), array('class' => 'short')); break; } // switch }
project_tabbed_navigation(PROJECT_TAB_FORMS); project_crumbs(array( array(lang('forms'), get_url('form')), array($project_form->isNew() ? lang('add form') : lang('edit form')) )); //add_stylesheet_to_page('project/forms.css'); ?> <form class="internalForm" action="<?php echo $project_form->isNew() ? get_url('form', 'add') : $project_form->getEditUrl() ?>" method="post"> <?php tpl_display(get_template_path('form_errors')) ?> <div> <?php echo label_tag(lang('name'), 'projectFormName', true) ?> <?php echo text_field('project_form[name]', array_var($project_form_data, 'name'), array('id' => 'projectFormName', 'class' => 'long')) ?> </div> <div> <?php echo label_tag(lang('description'), 'projectFormDescription') ?> <?php echo textarea_field('project_form[description]', array_var($project_form_data, 'description'), array('id' => 'projectFormDescription', 'class' => 'short')) ?> </div> <div> <?php echo label_tag(lang('success message'), 'projectFormSuccessMessage',true) ?> <?php echo textarea_field('project_form[success_message]', array_var($project_form_data, 'success_message'), array('id' => 'projectFormSuccessMessage', 'class' => 'short')) ?> </div> <div class="formBlock" id="projectFormAction"> <fieldset> <legend><?php echo lang('project form action') ?></legend>
"></script> <div id="massMailer"> <form action="<?php echo $tool->getToolUrl(); ?> " method="post"> <?php tpl_display(get_template_path('form_errors')); ?> <div> <?php echo label_tag(lang('massmailer subject'), 'massmailerFormRecipient', true); ?> <?php echo text_field('massmailer[subject]', array_var($massmailer_data, 'subject'), array('id' => 'massmailerFormRecipient', 'class' => 'title')); ?> </div> <div> <?php echo label_tag(lang('massmailer message'), 'massmailerFormMessage', true); ?> <?php echo textarea_field('massmailer[message]', array_var($massmailer_data, 'message'), array('id' => 'massmailerFormMessage', 'class' => 'editor')); ?> </div> <h2><?php echo lang('massmailer recipients'); ?>
administration_crumbs(array(array(lang('administration tools'), get_url('administration', 'tools')), array($tool->getDisplayName()))); ?> <form action="<?php echo $tool->getToolUrl(); ?> " method="post"> <?php tpl_display(get_template_path('form_errors')); ?> <div> <?php echo label_tag(lang('test mail recipient'), 'testMailFormRecipient', true); ?> <?php echo text_field('test_mail[recipient]', array_var($test_mail_data, 'recipient'), array('id' => 'testMailFormRecipient', 'class' => 'long')); ?> </div> <div> <?php echo label_tag(lang('test mail message'), 'testMailFormMessage', true); ?> <?php echo textarea_field('test_mail[message]', array_var($test_mail_data, 'message'), array('id' => 'testMailFormMessage')); ?> </div> <?php echo submit_button(lang('submit')); ?>
echo $message->isNew() ? lang('new message') : lang('edit message'); ?> </td><td style="text-align:right"> <?php echo submit_button($message->isNew() ? lang('add message') : lang('save changes'), 's', array('style' => 'margin-top:0px;margin-left:10px', 'tabindex' => '5')); ?> </td></tr></table> </div> </div> <div> <?php echo label_tag(lang('title'), $genid . 'messageFormTitle', true); ?> <?php echo text_field('message[title]', array_var($message_data, 'title'), array('id' => $genid . 'messageFormTitle', 'class' => 'title', 'tabindex' => '1')); ?> </div> <?php $categories = array(); Hook::fire('object_edit_categories', $object, $categories); ?> <div style="padding-top:5px"> <?php if ($all) { ?> <a href="#" class="option" style="font-weight:bold" onclick="og.toggleAndBolden('<?php echo $genid; ?>
</h2></th> </tr> <tr> <td style="padding: 5px;"></td> <td style="padding: 5px;"> <?php echo select_workspaces("ws_ids", null, $selected, $genid); ?> </td> <td style="padding: 5px;"> <?php echo "<p>" . lang("assign contact to workspace desc") . "</p><br />"; foreach ($projects as $project) { echo '<div id="role_' . $project->getId() . '_' . $genid . '" style="display:none">'; echo label_tag(lang("role"), null, false, array("style" => "display:inline;padding-right:10px")); echo text_field("contact[role_pid_" . $project->getId() . "]", array_var($contact_data, 'role_pid_' . $project->getId()), array('tabindex' => '20')); echo '</div>'; } ?> </td> </table> <?php echo submit_button(lang('update contact')); ?> </div> </div> </form>
/** * Return project object tags widget * * @param string $name * @param Project $project * @param string $value * @Param array $attributes Array of control attributes * @return string */ function project_object_tags_widget($name, Project $project, $value, $attributes) { return text_field($name, $value, $attributes) . '<br /><span class="desc">' . lang('tags widget description') . '</span>'; }
<?php } } ?> </ul> </div> <?php } ?> <?php echo text_field($this->entity, "id"); ?> <?php echo datetime_field($this->entity, "created_at"); ?> <?php echo datetime_field($this->entity, "updated_at"); ?> <?php echo text_field($this->entity, "email"); ?> <input type ="submit" value="Save" /> <?php echo form_end_tag();
<?php set_page_title(lang('forgot password')) ?> <form action="<?php echo get_url('access', 'forgot_password') ?>" method="post"> <?php tpl_display(get_template_path('form_errors')) ?> <div style="padding-top: 4px;"> <?php echo label_tag(lang('email address'), 'forgotPasswordEmail') ?> <?php echo text_field('your_email', $your_email, array('style' => 'width: 348px;', 'id' => 'forgotPasswordEmail')) ?> </div> <input type="hidden" name="submitted" value="submitted" /> <div id="forgotPasswordSubmit"><?php echo submit_button(lang('email me my password')) ?></div> <div><a href="<?php echo get_url('access', 'login') ?>"><?php echo lang('login') ?></a></div> </form> <script>document.forms[0].forgotPasswordEmail.focus()</script>
<div> <?php echo label_tag(lang('email address'), 'profileFormEmail', true); ?> <?php echo text_field('user[email]', array_var($user_data, 'email'), array('id' => 'profileFormEmail', 'tabindex' => '2700', 'class' => 'long')); ?> </div> <div> <?php echo label_tag(lang('user title'), 'profileFormTitle'); ?> <?php echo text_field('user[title]', array_var($user_data, 'title'), array('id' => 'profileFormTitle', 'tabindex' => '2800')); ?> </div> <?php if ($cps > 0) { ?> <div id='<?php echo $genid; ?> add_custom_properties_div' style=""> <fieldset> <legend><?php echo lang('custom properties'); ?> </legend>
<h1>ห้องหรือสถานที่</h1> <?php form_head("admin/room_add/", "เพิ่มห้องหรือสถานที่ใหม่"); ?> <?php text_field("place_name", "ชื่อห้อง/สถานที่", null, 1); ?> <?php form_footer(); ?>
<div> <?php echo label_tag(lang('password again'), 'adminPasswordA', true); ?> <?php echo password_field('form[admin_password_a]', null, array('id' => 'adminPasswordA', 'class' => 'medium')); ?> </div> <h2><?php echo lang('company'); ?> </h2> <div> <?php echo label_tag(lang('name'), 'companyName', true); ?> <?php echo text_field('form[company_name]', array_var($form_data, 'company_name'), array('id' => 'companyName', 'class' => 'long')); ?> </div> <input type="hidden" name="form[submitted]" value="submitted" /> <?php echo submit_button('submit'); ?> </form>
} $default_name = lang($dimension->getCode()); Hook::fire("edit_dimension_name", array('dimension' => $dimension), $default_name); ?> <tr class="<?php echo $isAlt ? 'altRow ' : ''; ?> "> <td><?php echo $default_name; ?> </td> <td><?php echo text_field('custom_names[' . $dimension_id . ']', $custom_dimension_name, array('class' => 'long')); ?> </td> </tr> <?php } ?> </table> </div> <div class="section"> <h1><?php echo lang('enable or disable dimension types'); ?>
</td> <td style="text-align: right"><?php echo submit_button(isset($id) ? lang('save changes') : lang('add report'), 's', array('style' => 'margin-top:0px;margin-left:10px', 'tabindex' => '20')); ?> </td> </tr> </table> </div> </div> <div> <?php echo label_tag(lang('name'), $genid . 'reportFormName', true); echo text_field('report[name]', array_var($report_data, 'name'), array('id' => $genid . 'reportFormName', 'tabindex' => '1', 'class' => 'title')); echo label_tag(lang('description'), $genid . 'reportFormDescription', false); echo text_field('report[description]', array_var($report_data, 'description'), array('id' => $genid . 'reportFormDescription', 'tabindex' => '2', 'class' => 'title')); echo label_tag(lang('object type'), $genid . 'reportFormObjectType', true); $selected_option = null; $options = array(); foreach ($object_types as $type) { if ($selected_type == $type[0]) { $selected = 'selected="selected"'; $selected_option = $type[1]; } else { $selected = ''; } $options[] = '<option value="' . $type[0] . '" ' . $selected . '>' . $type[1] . '</option>'; } $strDisabled = count($options) > 1 ? '' : 'disabled'; echo select_box('objectTypeSel', $options, array('id' => 'objectTypeSel', 'onchange' => 'og.reportObjectTypeChanged("' . $genid . '", "", 1, "")', 'style' => 'width:200px;', $strDisabled => '', 'tabindex' => '10')); ?>
" method="post"> <?php } // if ?> <?php tpl_display(get_template_path('form_errors')); ?> <div> <?php echo label_tag(lang('name'), 'folderFormName'); ?> <?php echo text_field('folder[name]', array_var($folder_data, 'name'), array('id' => 'folderFormName')); ?> </div> <?php echo submit_button($folder->isNew() ? lang('add folder') : lang('edit folder')); ?> <a href="<?php echo get_url('files'); ?> "><?php echo lang('cancel'); ?> </a> </form>
echo label_tag(lang('report name'), $genid . 'billingFormReportName', false); ?> <?php echo text_field('billing[report_name]', array_var($billing_data, 'report_name'), array('id' => $genid . 'billingFormReportName', 'tabindex' => '2')); ?> </div> <?php } ?> <div class="dataBlock"> <?php echo label_tag(lang('default hourly rates'), $genid . 'billingFormValue', true); ?> <?php echo text_field('billing[default_value]', array_var($billing_data, 'default_value'), array('id' => $genid . 'billingFormValue', 'tabindex' => '3')); ?> </div> <div class="dataBlock"> <?php echo label_tag(lang('description'), $genid . 'billingFormDescription', false); ?> <?php echo textarea_field('billing[description]', array_var($billing_data, 'description'), array('id' => $genid . 'billingFormDescription', 'class' => 'comment', 'tabindex' => '4')); ?> </div> <?php if (!array_var($_REQUEST, 'modal')) { echo submit_button($billing->isNew() ? lang('add billing category') : lang('save changes'), 's', array('tabindex' => '5'));
<div> <?php echo label_tag(lang('replace'), 'loadFormReplace', false); ?> <?php echo yes_no_widget('load[replace]', 'loadFormReplace', array_var($load_data, 'replace'), lang('yes'), lang('no')); ?> </div> <div> <?php echo label_tag(lang('value prefix'), 'loadFormPrefix', false); ?> <?php echo text_field('load[prefix]', array_var($load_data, 'name'), array('id' => 'loadFormPrefix', 'class' => 'medium')); ?> </div> <fieldset> <legend><?php echo lang('load from'); ?> </legend> <div> <?php echo radio_field('load[what]', true, array('value' => 'locale', 'id' => 'loadFormWhatLocale')); ?> <?php echo label_tag(lang('locale'), 'loadFormLocale', false); ?>
?> <div class="pageAttachment <?php echo $counter % 2 ? 'odd' : 'even'; ?> "> <?php echo label_tag(lang($page_attachment->getObjectLangName()), 'project[page_attachments][' . $page_attachment->getId() . '][label]', false, array('class' => 'checkbox')); ?> <?php echo $page_attachment->render('project[page_attachments][' . $page_attachment->getId() . '][text]'); ?> <?php echo $page_attachment->renderControl('project[page_attachments][' . $page_attachment->getId() . '][rel_object_id]'); ?> <?php echo text_field('project[page_attachments][' . $page_attachment->getId() . '][order]', $page_attachment->getOrder(), array('class' => 'short pageAttachmentOrder')); ?> <span class="pageAttachmentDeleteBlock"> <?php echo label_tag(lang('delete'), 'project[page_attachments][' . $page_attachment->getId() . '][delete]', false, array('class' => 'checkbox')); ?> <?php echo checkbox_field('project[page_attachments][' . $page_attachment->getId() . '][delete]', false, array('class' => 'checkbox pageAttachmentDelete', 'id' => 'project[page_attachments][' . $page_attachment->getId() . '][delete]')); ?> <input type="hidden" name="<?php echo 'project[page_attachments][' . $page_attachment->getId() . '][rel_object_manager]'; ?> " value="<?php echo $page_attachment->getRelObjectManager(); ?> "/>
?> " method="post"> <?php tpl_display(get_template_path('form_errors')); ?> <div class="form-container"> <?php if (!isset($_GET['instructions_sent']) || !$_GET['instructions_sent']) { ?> <div class="input"> <?php echo label_tag(lang('email address'), 'forgotPasswordEmail'); ?> <?php echo text_field('your_email', $your_email, array('class' => 'long', 'id' => 'forgotPasswordEmail')); ?> </div> <input type="hidden" name="submited" value="submited" /> <?php } ?> <div id="forgotPasswordSubmit"> <?php if (!isset($_GET['instructions_sent']) || !$_GET['instructions_sent']) { echo submit_button(lang('change password')); } ?> <span>(<a class="internalLink" href="<?php echo get_url('access', 'login'); ?>
</tr> <tr> <td style="padding-right: 10px; width:140px;"> <?php echo pick_date_widget2('timeslot[date]', DateTimeValueLib::now(), $genid, 100, false) ?> </td> <td style="padding-right: 10px; width:140px;"> <?php $options = array(); foreach ($users as $user) { $options[] = option_tag($user->getObjectName(), $user->getId(), $selected_user == $user->getId() ? array("selected" => "selected") : null); } echo select_box("timeslot[contact_id]", $options, array('id' => $genid . 'tsUser', 'tabindex' => '150')); ?> </td> <td style="padding-right: 10px; width: 140px;"><?php echo text_field('timeslot[hours]', 0, array('style' => 'width:28px', 'tabindex' => '200', 'id' => $genid . 'tsHours','onkeypress'=>'og.checkEnterPress(event,\''.$genid.'\')')) ?> </td> <td style="padding-right: 10px; width: 140px;"> <select name="timeslot[minutes]" size="1" tabindex="220" id="<?php echo $genid . 'tsMinutes'?>"> <?php $minuteOptions = array(0,5,10,15,20,25,30,35,40,45,50,55); for($i = 0; $i < 12; $i++) { echo "<option value=\"" . $minuteOptions[$i] . "\""; echo ">" . $minuteOptions[$i] . "</option>\n"; } ?> </select> </td> <td style="padding-right: 10px; width:95%; margin-top: 0px;"> <?php echo textarea_field('timeslot[description]', '', array('class' => 'short', 'style' => 'height:30px;width:100%;min-width:200px', 'tabindex' => '250', 'id' => $genid . 'tsDesc')) ?> </td>