function Get() { $sReturn = ''; $OptionCount = count($this->aOptions); for ($i = 0; $i < $OptionCount; $i++) { $sReturn .= '<label>' . GetBasicCheckBox($this->Name, $this->aOptions[$i]['IdValue'], $this->aOptions[$i]['Checked'], $this->aOptions[$i]['Attributes']) . ' ' . $this->aOptions[$i]['DisplayValue'] . '</label>'; } return $sReturn; }
function Render_NoPostBack() { $this->Applicant->FormatPropertiesForDisplay(); $this->PostBackParams->Add("PostBackAction", "Apply"); $this->PostBackParams->Add("ReadTerms", $this->Applicant->ReadTerms); $this->Render_Warnings(); $this->Context->Writer->Add("<div class=\"About\">\r\n\t\t\t" . $this->Context->GetDefinition("AboutMembership") . "\r\n\t\t\t\t\t<p><a href=\"signin.php\">" . $this->Context->GetDefinition("BackToSignInForm") . "</a></p>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class=\"Form\">\r\n\t\t\t\t\t<h1>" . $this->Context->GetDefinition("MembershipApplicationForm") . "</h1>\r\n <p>" . $this->Context->GetDefinition("AllFieldsRequired") . "</p>"); $this->Render_PostBackForm($this->FormName); $this->Context->Writer->Write("<dl class=\"InputBlock ApplyInputs\">\r\n\t\t\t\t\t<dt>" . $this->Context->GetDefinition("FirstName") . "</dt>\r\n\t\t\t\t\t<dd><input type=\"text\" name=\"FirstName\" value=\"" . $this->Applicant->FirstName . "\" class=\"Input\" maxlength=\"40\" /></dd>\r\n\t\t\t\t\t<dt>" . $this->Context->GetDefinition("LastName") . "</dt>\r\n\t\t\t\t\t<dd><input type=\"text\" name=\"LastName\" value=\"" . $this->Applicant->LastName . "\" class=\"Input\" maxlength=\"40\" /></dd>\r\n\t\t\t\t\t<dt>" . $this->Context->GetDefinition("EmailAddress") . "</dt>\r\n\t\t\t\t\t<dd><input type=\"text\" name=\"Email\" value=\"" . $this->Applicant->Email . "\" class=\"Input\" maxlength=\"160\" /></dd>\r\n\t\t\t\t\t<dt>" . $this->Context->GetDefinition("Username") . "</dt>\r\n\t\t\t\t\t<dd><input type=\"text\" name=\"Name\" value=\"" . $this->Applicant->Name . "\" class=\"Input\" maxlength=\"20\" /></dd>\r\n\t\t\t\t\t<dt>" . $this->Context->GetDefinition("Password") . "</dt>\r\n\t\t\t\t\t<dd><input type=\"password\" name=\"NewPassword\" value=\"" . $this->Applicant->NewPassword . "\" class=\"Input\" /></dd>\r\n\t\t\t\t\t<dt>" . $this->Context->GetDefinition("PasswordAgain") . "</dt>\r\n\t\t\t\t\t<dd><input type=\"password\" name=\"ConfirmPassword\" value=\"" . $this->Applicant->ConfirmPassword . "\" class=\"Input\" /></dd>\r\n\t\t\t\t</dl>\r\n\t\t\t\t<div class=\"InputBlock DiscoveryInput\">\r\n\t\t\t\t\t<div class=\"InputLabel\">" . $this->Context->GetDefinition("HowDidYouFindUs") . "</div>\r\n\t\t\t\t\t<textarea name=\"Discovery\" class=\"ApplicationTextbox\">" . $this->Applicant->Discovery . "</textarea>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class=\"InputBlock TermsOfServiceCheckbox\">\r\n\t\t\t\t\t<div class=\"CheckboxLabel\">" . GetBasicCheckBox("AgreeToTerms", 1, $this->Applicant->AgreeToTerms, "") . " " . $this->Context->GetDefinition("IHaveReadAndAgreeTo") . " <a href=\"javascript:PopTermsOfService('../');\">" . $this->Context->GetDefinition("TermsOfService") . "</a>.</div>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div class=\"FormButtons\"><input type=\"submit\" name=\"btnApply\" value=\"" . $this->Context->GetDefinition("Proceed") . "\" class=\"Button\" /></div>\r\n\t\t\t\t</form>\r\n\t\t\t</div>"); }
function GetDynamicCheckBox($Name, $Value = 1, $Checked, $OnClick, $Text, $Attributes = '', $CheckBoxID = '') { if ($CheckBoxID == '') { $CheckBoxID = $Name . 'ID'; } $Attributes .= ' id="' . $CheckBoxID . '"'; if ($OnClick != '') { $Attributes .= ' onclick="' . $OnClick . '"'; } return '<label for="' . $CheckBoxID . '">' . GetBasicCheckBox($Name, $Value, $Checked, $Attributes) . ' ' . $Text . '</label>'; }
function FormatListItem($ID, $Name, $Size, $Date, &$Params, $Alternate = "0") { $Alternate = ForceBool($Alternate, 0); return "<tr class=\"ListItem " . ($Alternate ? "Alternate" : "") . "\">\r\n\t\t\t<td class=\"ItemOption\">" . GetBasicCheckBox("ImageID[]", $ID, 0) . "</td>\r\n\t\t\t<td class=\"ItemName\">" . $Name . "</td>\r\n\t\t\t<td class=\"ItemSize\">{$Size}</td>\r\n\t\t\t<td class=\"ItemDateModified\">" . date($this->DateFormat, $Date) . "</td>\r\n\t\t</tr>\r\n"; }
echo '<ul>'; $this->CallDelegate('PreInputsRender'); echo '<li> <label for="txtEmail">' . $this->Context->GetDefinition('EmailAddress') . '</label> <input id="txtEmail" type="text" name="Email" value="' . $this->Applicant->Email . '" class="Input" maxlength="160" /> </li> <li> <label for="txtUsername">' . $this->Context->GetDefinition('Username') . '</label> <input id="txtUsername" type="text" name="Name" value="' . $this->Applicant->Name . '" class="Input" maxlength="20" /> </li> <li> <label for="txtNewPassword">' . $this->Context->GetDefinition('Password') . '</label> <input id="txtNewPassword" type="password" name="NewPassword" value="' . $this->Applicant->NewPassword . '" class="Input" /> </li> <li> <label for="txtConfirmPassword">' . $this->Context->GetDefinition('PasswordAgain') . '</label> <input id="txtConfirmPassword" type="password" name="ConfirmPassword" value="' . $this->Applicant->ConfirmPassword . '" class="Input" /> </li>'; $this->CallDelegate('PostInputsRender'); $this->CallDelegate('PreTermsCheckRender'); $TermsOfServiceUrl = $this->Context->Configuration['WEB_ROOT'] . 'termsofservice.php'; echo '<li id="TermsOfServiceCheckBox"> ' . GetBasicCheckBox('AgreeToTerms', 1, $this->Applicant->AgreeToTerms, '') . ' ' . str_replace('//1', ' <a href="' . $TermsOfServiceUrl . '" onclick="PopTermsOfService(' . "'" . $TermsOfServiceUrl . "'" . '); return false;">' . $this->Context->GetDefinition('TermsOfService') . '</a>', $this->Context->GetDefinition('IHaveReadAndAgreeTo')) . ' </li> </ul> <div class="Submit"> <input type="submit" name="btnApply" value="' . $this->Context->GetDefinition('Proceed') . '" class="Button" /> </div> </form> </fieldset> </div>';
/** * Render an element to an html string. * * This does not include the label or description, only the html form * element itself. Checkbox labels are a special case. They are rendered * by this method because the label must appear after the checkbox on the * same line. * * @param string $element * @return string */ function renderElementHtml($element) { $html = ''; $value = FormatStringForDisplay($this->formData['elements'][$element]['value'], false, true); $label = $this->formData['elements'][$element]['label']; switch ($this->formData['elements'][$element]['type']) { // Special: Checkbox labels are rendered here, not in renderLabel(). case 'checkbox': $html = '<p><span><label for="' . $element . '">' . GetBasicCheckBox($element, 1, ForceBool($value, 0) ? 1 : 0, 'id="' . $element . '"') . ' ' . $label . '</label></span></p>'; break; case 'text': $html = '<input type="text" name="' . $element . '" value="' . $value . '" class="SmallInput" id="txt' . $element . '" />'; break; case 'textarea': $html = '<textarea name="' . $element . '" id="txt' . $element . '" rows="15" cols="40">' . $value . '</textarea>'; break; case 'select': $select = $this->Context->ObjectFactory->NewObject($this->Context, 'Select'); $select->Name = $element; $select->Attributes .= 'id="sel' . $element . '"'; foreach ($this->formData['elements'][$element]['options'] as $option) { $select->AddOption($option['value'], $option['label']); } $select->SelectedValue = $value; $html = $select->Get(); break; case 'file': $html = '<input type="file" name="' . $element . '" class="SmallInput" id="file' . $element . '" />'; break; default: break; } return $html; }
function GetDynamicCheckBox($Name, $Value = 1, $Checked, $OnClick, $Text, $Attributes = "") { $CheckBoxID = $Name . "ID"; $Attributes .= " id=\"" . $CheckBoxID . "\" onclick=\"" . $OnClick . "\""; // return GetBasicCheckBox($Name, $Value, $Checked, $Attributes) // ." <a href=\"javascript:CheckBox('".$CheckBoxID."');".$OnClick."\">".$Text."</a>"; return "<label>" . GetBasicCheckBox($Name, $Value, $Checked, $Attributes) . " " . $Text . "</label>"; }