Skip to content

Commit

Permalink
Merge pull request cypht-org#891 from josaphatim/carddav-ldap-contact…
Browse files Browse the repository at this point in the history
…s-bs

Added bootstrap to carddav and ldap contacts modules
  • Loading branch information
alvinBM authored Feb 12, 2024
2 parents 5655d80 + 8133fd9 commit 77930b4
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 67 deletions.
31 changes: 15 additions & 16 deletions modules/carddav_contacts/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,11 +269,11 @@ protected function output() {
}
$res .= '<tr class="carddav_settings"><td>'.$this->html_safe($name).'</td><td>';
$res .= '<input autocomplete="username" type="text" value="'.$user.'" name="carddav_usernames['.$this->html_safe($name).']" ';
$res .= 'placeholder="'.$this->trans('Username').'" /> <input type="password" ';
$res .= 'placeholder="'.$this->trans('Username').'" class="form-control" /> <input type="password" class="form-control"';
if ($pass) {
$res .= 'disabled="disabled" placeholder="'.$this->trans('Password saved').'" ';
$res .= 'name="carddav_passwords['.$this->html_safe($name).']" /> <input type="button" ';
$res .= 'value="'.$this->trans('Unlock').'" class="carddav_password_change" /></td></tr>';
$res .= 'value="'.$this->trans('Unlock').'" class="carddav_password_change btn btn-success" /></td></tr>';
}
else {
$res .= 'autocomplete="new-password" placeholder="'.$this->trans('Password').'" ';
Expand All @@ -298,7 +298,7 @@ protected function output() {
return '';
}
$form_class = 'contact_form';
$button = '<input class="add_contact_submit" type="submit" name="add_contact" value="'.$this->trans('Add').'" />';
$button = '<input class="add_contact_submit btn btn-success" type="submit" name="add_contact" value="'.$this->trans('Add').'" />';
$title = $this->trans('Add Carddav');
$current = $this->get('current_carddav_contact', array());
$current_source = false;
Expand All @@ -316,7 +316,7 @@ protected function output() {
$form_class = 'contact_update_form mt-3';
$title = sprintf($this->trans('Update Carddav - %s'), $this->html_safe($current['source']));
$button = '<input type="hidden" name="contact_id" value="'.$this->html_safe($current['id']).'" />'.
'<input class="edit_contact_submit" type="submit" name="edit_contact" value="'.$this->trans('Update').'" />';
'<input class="edit_contact_submit btn btn-success" type="submit" name="edit_contact" value="'.$this->trans('Update').'" />';
}
if ($current_source) {
$target = '<input type="hidden" name="carddav_email_id" value="'.$this->html_safe($current['carddav_email_id']).'" />'.
Expand All @@ -325,27 +325,26 @@ protected function output() {
'<input type="hidden" name="contact_source" value="'.$this->html_safe($current_source).'" />';
}
else {
$target = '<label class="screen_reader" for="contact_source">'.$this->trans('Account').'</label><select id="contact_source" '.
'name="contact_source">';
$target = '<label class="form-label" for="contact_source">'.$this->trans('Account').'</label><select id="contact_source" '.
'name="contact_source" class="form-control">';
foreach ($sources as $src => $details) {
$target .= '<option value="'.$this->html_safe($src).'">'.$this->html_safe($src).'</option>';
}
$target .= '</select>';
$target .= '</select><br />';
}
return '<div class="add_contact"><form class="add_contact_form" method="POST">'.
'<div class="server_title">'.$title.
'<img alt="" class="menu_caret" src="'.Hm_Image_Sources::$chevron.'" width="8" height="8" /></div>'.
'<div class="'.$form_class.'">'.$target.'<br />'.
'<button class="server_title mt-2 btn btn-light"><i class="bi bi-person-add me-2"></i>'.$title.'</button>'.
'<div class="'.$form_class.'">'.$target.''.
'<input type="hidden" name="hm_page_key" value="'.$this->html_safe(Hm_Request_Key::generate()).'" />'.
'<label class="screen_reader" for="carddav_email">'.$this->trans('E-mail Address').'</label>'.
'<label class="form-label" for="carddav_email">'.$this->trans('E-mail Address').' *</label>'.
'<input required placeholder="'.$this->trans('E-mail Address').'" id="carddav_email" type="email" name="carddav_email" '.
'value="'.$this->html_safe($email).'" /> *<br />'.
'<label class="screen_reader" for="carddav_fn">'.$this->trans('Full Name').'</label>'.
'value="'.$this->html_safe($email).'" class="form-control" /><br />'.
'<label class="form-label" for="carddav_fn">'.$this->trans('Full Name').' *</label>'.
'<input required placeholder="'.$this->trans('Full Name').'" id="carddav_fn" type="text" name="carddav_fn" '.
'value="'.$this->html_safe($name).'" /> *<br />'.
'<label class="screen_reader" for="carddav_phone">'.$this->trans('Telephone Number').'</label>'.
'value="'.$this->html_safe($name).'" class="form-control" /><br />'.
'<label class="form-label" for="carddav_phone">'.$this->trans('Telephone Number').'</label>'.
'<input placeholder="'.$this->trans('Telephone Number').'" id="carddav_phone" type="text" name="carddav_phone" '.
'value="'.$this->html_safe($phone).'"><br />'.$button.' <input type="button" class="reset_contact" value="'.
'value="'.$this->html_safe($phone).'" class="form-control"><br />'.$button.' <input type="button" class="reset_contact btn btn-secondary" value="'.
$this->trans('Cancel').'" /></div></form></div>';
}
}
Loading

0 comments on commit 77930b4

Please sign in to comment.