function editContactInterface(&$contact, $location) { global $CONFIG_ADMINRP_OPTIONS; if ($location != 'ownFieldset') { return ""; } if (!$_SESSION['user']->isAtLeast('manager')) { return ""; } $content = '<fieldset class="edit-names">'; $content .= '<legend>Administrative Requests</legend>'; foreach ($CONFIG_ADMINRP_OPTIONS as $k => $v) { $content .= HTMLHelper::createCheckbox($k, $v[0] . " (" . $v[1] . ")"); } return $content . '</fieldset>'; }
/** * create the fieldset that allows user to edit and eventually upload the mugshot of the contact * @global Options used to determine whether mugshot may be uploaded or not * @return string html-content */ function createMugshotFieldset() { global $options; $cont = '<fieldset class="edit-mugshot">'; $cont .= '<legend>Mugshot</legend>'; $cont .= '<div class="context-help" id="editHelp' . $this->htmlId . '"><a href="#" onclick="Element.hide(\'editHelp' . $this->htmlId . '\'); Effect.Appear(\'editHint' . $this->htmlId . '\',{duration:1.2}); return false;">?</a></div><div class="context-help" id="editHint' . $this->htmlId++ . '" style="display: none;">If an URL to the mugshot is set this overrides any uploaded picture! If you upload a picture to the DB make sure that the "URL to mugshot" field is empty and has no space in it. If the admin does not allow uploads the upload button will not show and you can only set an URL. In case of URLs you can omit the protocol and server name if the image is stored on the same server as this application runs. Then you could use /gallery/people/small/me.jpg to locate the image. PHP restrictions may prevent uploads.</div>'; $cont .= HTMLHelper::createTextField("contact[pictureURL]", 'URL to mugshot', isset($this->contact->contact['pictureURL']) ? $this->contact->contact['pictureURL'] : '', 'edit-mugshot-text'); if ($options->getOption('picAllowUpload')) { $cont .= '<div class="edit-input-file"> <label for="contact[pictureData][file]">Upload mugshot</label> <input type="file" name="contact[pictureData][file]" id="contact[pictureData][file]" /> </div>'; if (isset($this->contact->contact['pictureData']) && $this->contact->contact['pictureData']) { $cont .= HTMLHelper::createCheckbox('contact[pictureData][remove]', 'Remove current mugshot', false, 'edit-input-checkbox'); } } $cont .= '</fieldset>'; return $cont; }
function editContactInterface(&$contact, $location) { if ($location != 'ownFieldset') { return ""; } //if(!$_SESSION['user']->isAtLeast('manager')) // return ""; global $CONFIG_DB_PREFIX; $db = DB::getSingleton(); // fetch dropdown $dropdown = $this->getDropdown($db, $contact->contact['id']); $db->query("SELECT partnerId,ouder1,ouder2,thuiswonend FROM " . $CONFIG_DB_PREFIX . "contact WHERE id = '" . $contact->contact['id'] . "'"); $r = $db->next(); $thuiswonend = false; if ($r['thuiswonend'] == 1) { $thuiswonend = true; } $content = '<fieldset class="edit-names">'; $content .= '<legend>Relatives</legend>'; $content .= '<div class="edit-line">'; $content .= HTMLHelper::createDropdown("partner", 'Getrouwd met', $dropdown, $r['partnerId'], 'edit-input'); $content .= HTMLHelper::createCheckbox("delpartner", 'Verwijder relatie', false, 'edit-input-checkbox'); $content .= '</div>'; $content .= '<hr />'; $content .= '<div class="edit-line">'; $content .= HTMLHelper::createDropdown("ouder1", 'Ouder 1', $dropdown, $r['ouder1'], 'edit-input'); $content .= HTMLHelper::createCheckbox("thuiswonend", 'Thuiswonend', $thuiswonend, 'edit-input-checkbox'); $content .= '</div>'; $content .= '<div class="edit-line">'; $content .= HTMLHelper::createDropdown("ouder2", 'Ouder 2', $dropdown, $r['ouder2'], 'edit-input'); $content .= HTMLHelper::createCheckbox("delouders", 'Verwijder ouderrelaties', false, 'edit-input-checkbox'); $content .= '</div>'; return $content . '</fieldset>'; }
/** * create the fieldset that allows user to edit and eventually upload the mugshot of the contact * @global Options used to determine whether mugshot may be uploaded or not * @return string html-content */ function createMugshotFieldset() { global $options; $cont = '<fieldset class="edit-mugshot">'; $cont .= '<legend>Mugshot</legend>'; $cont .= $this->contextHelp('mugshot'); $cont .= HTMLHelper::createTextField("contact[pictureURL]", 'URL to mugshot', isset($this->contact->contact['pictureURL']) ? $this->contact->contact['pictureURL'] : '', 'edit-mugshot-text'); if ($options->getOption('picAllowUpload')) { $cont .= '<div class="edit-input-file"> <label for="contact[pictureData][file]">Upload mugshot</label> <input type="file" name="contact[pictureData][file]" id="contact[pictureData][file]" /> </div>'; if (isset($this->contact->contact['pictureData']) && $this->contact->contact['pictureData']) { $cont .= HTMLHelper::createCheckbox('contact[pictureData][remove]', 'Remove current mugshot', false, 'edit-input-checkbox'); } } $cont .= '</fieldset>'; return $cont; }
function editContactInterface(&$contact, $location) { global $CONFIG_ADMIN_REQUEST_INTERFACE; if ($location != 'ownFieldset') { return ""; } if (!$_SESSION['user']->isAtLeast('manager')) { return ""; } $content = '<fieldset class="edit-names">'; $content .= '<legend>Administrative Requests</legend>'; foreach ($CONFIG_ADMIN_REQUEST_INTERFACE as $k => $v) { switch ($v['interface']) { case 'textfield': $content .= HTMLHelper::createTextField('AdminRequest[' . $k . ']', $v['label'], $v['default'], 'edit-input'); break; case 'checkbox': $content .= HTMLHelper::createCheckbox('AdminRequest[' . $k . ']', $v['label'], $v['default'], 'edit-input-checkbox'); break; case 'html': $content .= $v['html']; break; } } return $content . '</fieldset>'; }
function editContactInterface(&$contact, $location) { global $CONFIG_CA_OU_CHOICES, $CONF_CERT_REQUEST_TEXT; if ($location != 'otherInfo' || false == $_SESSION['user']->isAtLeast('manager')) { return ""; } if (!isset($contact->contact['organizationalUnit'])) { // add new entry menu ... prepare default $contact->contact['organizationalUnit'] = $CONFIG_CA_OU_CHOICES[0]; } if (in_array($contact->contact['organizationalUnit'], $CONFIG_CA_OU_CHOICES)) { $cont = HTMLHelper::createDropdownValuesAreKeys('contact[organizationalUnit]', 'Organizational Unit', $CONFIG_CA_OU_CHOICES, $contact->contact['organizationalUnit'], 'edit-input'); } else { $cont = HTMLHelper::createDropdownValuesAreKeys('contact[organizationalUnit]', 'Organizational Unit', array_merge($CONFIG_CA_OU_CHOICES, array($contact->contact['organizationalUnit'])), $contact->contact['organizationalUnit'], 'edit-input'); } $cont .= HTMLHelper::createCheckbox('AdminCertificateAuthority_new_cert_request', empty($CONF_CERT_REQUEST_TEXT) ? "<span style='color: red;'>REQUEST SSL CERTIFICATE WHEN SAVING</span>" : $CONF_CERT_REQUEST_TEXT, false, 'edit-input-checkbox'); return $cont; }
/** * STATIC method that generates a standard checkbox. Unchecked checkboxes are not set in $_POST * * @static * @param string $name name used when submitting the form. * @param string $label Label text of the checkbox. default=null * @param boolean $isChecked Is the box selected? default=false (not selected) * @param string $cssClass default='' * @param boolean $insideDiv Is the box within its own div? default=true * @return string HTML */ function createStandardCheckbox($name, $label = null, $isChecked = false, $cssClass = null, $insideDiv = true) { return HTMLHelper::createCheckbox($name, $label, $isChecked, $cssClass, $insideDiv, FALSE); }