Skip to content

Commit

Permalink
Change sidebar icons to Bootstrap Icon
Browse files Browse the repository at this point in the history
  • Loading branch information
alvinBM committed Dec 13, 2023
1 parent 99d6589 commit 0ed9f4f
Show file tree
Hide file tree
Showing 17 changed files with 58 additions and 77 deletions.
2 changes: 1 addition & 1 deletion modules/account/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ protected function output() {
if ($this->get('internal_users')) {
$res = '<li class="menu_change_password"><a class="unread_link" href="?page=change_password">';
if (!$this->get('hide_folder_icons')) {
$res .= '<img class="account_icon" src="'.$this->html_safe(Hm_Image_Sources::$key).'" alt="" width="16" height="16" /> ';
$res .= '<i class="bi bi-key-fill fs-5 me-2"></i>';
}
$res .= $this->trans('Password').'</a></li>';
$this->concat('formatted_folder_list', $res);
Expand Down
2 changes: 1 addition & 1 deletion modules/calendar/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class Hm_Output_calendar_page_link extends Hm_Output_Module {
protected function output() {
$res = '<li class="menu_calendar"><a class="unread_link" href="?page=calendar">';
if (!$this->get('hide_folder_icons')) {
$res .= '<img class="account_icon" src="'.$this->html_safe(Hm_Image_Sources::$calendar).'" alt="" width="16" height="16" /> ';
$res .= '<i class="bi bi-calendar-week-fill fs-5 me-2"></i>';
}
$res .= $this->trans('Calendar').'</a></li>';
if ($this->format == 'HTML5') {
Expand Down
29 changes: 13 additions & 16 deletions modules/contacts/modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class Hm_Output_contacts_page_link extends Hm_Output_Module {
protected function output() {
$res = '<li class="menu_contacts"><a class="unread_link" href="?page=contacts">';
if (!$this->get('hide_folder_icons')) {
$res .= '<img class="account_icon" src="'.$this->html_safe(Hm_Image_Sources::$people).'" alt="" width="16" height="16" /> ';
$res .= '<i class="bi bi-people-fill fs-5 me-2"></i>';
}
$res .= $this->trans('Contacts').'</a></li>';
if ($this->format == 'HTML5') {
Expand Down Expand Up @@ -128,19 +128,19 @@ protected function output() {
$headers = $this->get('msg_headers');
$backends = $this->get('contact_edit', array());
if (!empty($addresses) && count($backends) > 0) {
$res = '<div class="add_contact_row"><a href="#" onclick="$(\'.add_contact_controls\').toggle(); return false;">'.
'<img width="20" height="20" src="'.Hm_Image_Sources::$people.'" alt="'.$this->trans('Add').'" title="'.
$this->html_safe('Add Contact').'" /></a><span class="add_contact_controls"><select id="add_contact">';
$res = '<div class="add_contact_row position-absolute top-0 end-0 z-3 p-2 d-flex align-content-center gap-3"><a href="#" title="'.
$this->html_safe('Add Contact').'" onclick="$(\'.add_contact_controls\').toggle(); return false;">'.
'<i class="bi bi-person-fill-add fs-3" ></i></a><div class="add_contact_controls"><div class="row g-1 mt-1"><div class="col"><select id="add_contact" class="form-select form-select-sm">';
foreach ($addresses as $vals) {
$res .= '<option value="'.$this->html_safe($vals['name']).' '.$this->html_safe($vals['email']).
'">'.$this->html_safe($vals['name']).' &lt;'.$this->html_safe($vals['email']).'&gt;</option>';
}
$res .= '</select> <select id="contact_source">';
$res .= '</select></div> <div class="col"><select id="contact_source" class="form-select form-select-sm">';
foreach ($backends as $val) {
$res .= '<option value="'.$this->html_safe($val).'">'.$this->html_safe($val).'</option>';
}
$res .= '</select> <input onclick="return add_contact_from_message_view()" class="add_contact_button" '.
'type="button" value="'.$this->trans('Add').'"></span></div>';
$res .= '</select></div> <div class="col"><input onclick="return add_contact_from_message_view()" class="add_contact_button w-100 btn btn-success btn-sm" '.
'type="button" value="'.$this->trans('Add Contact').'"></div></div></div></div>';
$headers = $headers.$res;
}
$this->out('msg_headers', $headers, false);
Expand All @@ -158,7 +158,7 @@ protected function output() {
}
$per_page = 25;
$current_page = $this->get('contact_page', 1);
$res = '<div class="px-4"><table class="contact_list table">';
$res = '<div class="px-3 mt-3"><table class="contact_list table">';
$res .= '<tr><td colspan="7" class="contact_list_title"><div class="server_title">'.$this->trans('Contacts').'</div></td></tr>';
$contacts = $this->get('contact_store');
$editable = $this->get('contact_edit', array());
Expand All @@ -173,28 +173,25 @@ protected function output() {
$res .= '<tr class="contact_row_'.$this->html_safe($id).'">';
$res .= '<td><a data-id="contact_'.$this->html_safe($id).'_detail" '.
'" class="show_contact" title="'.$this->trans('Details').'">'.
'<img alt="'.$this->trans('Send To').'" width="16" height="16" src="'.Hm_Image_Sources::$person.'" /></a> '.
'<i class="bi bi-person-fill"></i> '.
'</d><td>'.$this->html_safe($contact->value('type')).'<td><span class="contact_src">'.
($contact->value('source') == 'local' ? '' : $this->html_safe($contact->value('source'))).'</span>'.
'</td><td>'.$this->html_safe($name).'</td>'.
'<td><div class="contact_fld">'.$this->html_safe($contact->value('email_address')).'</div></td>'.
'<td class="contact_fld"><a href="tel:'.$this->html_safe($contact->value('phone_number')).'">'.
$this->html_safe($contact->value('phone_number')).'</a></td>'.
'<td class="text-end">';
'<td class="text-end" style="width : 100px">';
if (in_array($contact->value('type').':'.$contact->value('source'), $editable, true)) {
$res .= '<a data-id="'.$this->html_safe($id).'" data-type="'.$this->html_safe($contact->value('type')).'" data-source="'.$this->html_safe($contact->value('source')).
'" class="delete_contact" title="'.$this->trans('Delete').'"><img alt="'.$this->trans('Delete').
'" width="16" height="16" src="'.Hm_Image_Sources::$circle_x.'" /></a>'.
'" class="delete_contact cursor-pointer" title="'.$this->trans('Delete').'"><i class="bi bi-trash3 text-danger ms-2"></i></a>'.
'<a href="?page=contacts&amp;contact_id='.$this->html_safe($id).'&amp;contact_source='.
$this->html_safe($contact->value('source')).'&amp;contact_type='.
$this->html_safe($contact->value('type')).'&amp;contact_page='.$current_page.
'" class="edit_contact" title="'.$this->trans('Edit').'"><img alt="'.$this->trans('Edit').
'" width="16" height="16" src="'.Hm_Image_Sources::$cog.'" /></a>';
'" class="edit_contact cursor-pointer" title="'.$this->trans('Edit').'"><i class="bi bi-gear ms-2"></i></a>';
}
$res .= '<a href="?page=compose&amp;contact_id='.$this->html_safe($id).
'" class="send_to_contact" title="'.$this->trans('Send To').'">'.
'<img alt="'.$this->trans('Send To').'" width="16" height="16" src="'.
Hm_Image_Sources::$doc.'" /></a>';
'<i class="bi bi-file-earmark-text ms-2"></i></a>';

$res .= '</td></tr>';
$res .= '<tr><td id="contact_'.$this->html_safe($id).'_detail" class="contact_detail_row" colspan="6">';
Expand Down
8 changes: 0 additions & 8 deletions modules/contacts/site.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
/* .add_contact_form input { margin: 5px; margin-left: 0px; background-color: aqua; } */
/* .add_contact_form { padding-top: 10px; display: block; } */
/* .contact_list { margin-left: 35px; margin-right: 10px; margin-top: 20px; width: 50%; } */
/* .contact_list td { white-space: nowrap; padding-right: 20px; padding-bottom: 5px; vertical-align: -5px; padding-top: 5px; border-bottom: solid 1px #ddd; } */
.gmail_contacts { margin-top: 50px; }
/* .contact_list_title { padding-top: 0px !important; padding-bottom: 10px; } */
.show_contact img, .edit_contact img, .send_to_contact img, .delete_contact img { opacity: .5; margin-left: 10px; cursor: pointer; }
/* .contact_controls { text-align: right; } */
.add_contact_row { position: absolute; top: 22px; right: 10px; font-size: 90%; z-index: 100}
.add_contact_row img { opacity: .4; margin-right: 10px; }
.add_contact_controls { display: none; }
.contact_suggestion { display: block; }
.close_autocomplete { float: right; }
Expand Down
10 changes: 5 additions & 5 deletions modules/core/message_list_functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -606,8 +606,8 @@ function build_page_links($page_size, $current_page, $total, $path, $filter=fals
if ($ceil > $max_pages) {
$floor -= ($ceil - $max_pages);
}
$prev = '<a class="disabled_link"><img src="'.Hm_Image_Sources::$caret_left.'" alt="&larr;" /></a>';
$next = '<a class="disabled_link"><img src="'.Hm_Image_Sources::$caret_right.'" alt="&rarr;" /></a>';
$prev = '<a class="disabled_link"><i class="bi bi-caret-left-fill"></i></a>';
$next = '<a class="disabled_link"><i class="bi bi-caret-right-fill"></i></a>';

if ($floor > 1 ) {
$first = '<a href="?page=message_list&amp;list_path='.urlencode($path).'&amp;list_page=1'.$keyword_str.$filter_str.$sort_str.'">1</a> ... ';
Expand All @@ -616,18 +616,18 @@ function build_page_links($page_size, $current_page, $total, $path, $filter=fals
$last = ' ... <a href="?page=message_list&amp;list_path='.urlencode($path).'&amp;list_page='.$max_pages.$keyword_str.$filter_str.$sort_str.'">'.$max_pages.'</a>';
}
if ($current_page > 1) {
$prev = '<a href="?page=message_list&amp;list_path='.urlencode($path).'&amp;list_page='.($current_page - 1).$keyword_str.$filter_str.$sort_str.'"><img src="'.Hm_Image_Sources::$caret_left.'" alt="&larr;" /></a>';
$prev = '<a href="?page=message_list&amp;list_path='.urlencode($path).'&amp;list_page='.($current_page - 1).$keyword_str.$filter_str.$sort_str.'"><i class="bi bi-caret-left-fill"></i></a>';
}
if ($max_pages > 1 && $current_page < $max_pages) {
$next = '<a href="?page=message_list&amp;list_path='.urlencode($path).'&amp;list_page='.($current_page + 1).$keyword_str.$filter_str.$sort_str.'"><img src="'.Hm_Image_Sources::$caret_right.'" alt="&rarr;" /></a>';
$next = '<a href="?page=message_list&amp;list_path='.urlencode($path).'&amp;list_page='.($current_page + 1).$keyword_str.$filter_str.$sort_str.'"><i class="bi bi-caret-right-fill"></i></a>';
}
for ($i=1;$i<=$max_pages;$i++) {
if ($i < $floor || $i > $ceil) {
continue;
}
$links .= ' <a ';
if ($i == $current_page) {
$links .= 'class="current_page" ';
$links .= 'class="current_page fw-bolder" ';
}
$links .= 'href="?page=message_list&amp;list_path='.urlencode($path).'&amp;list_page='.$i.$keyword_str.$filter_str.$sort_str.'">'.$i.'</a>';
}
Expand Down
34 changes: 17 additions & 17 deletions modules/core/output_modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -1251,33 +1251,33 @@ protected function output() {
if (!$single) {
$res .= '<li class="menu_combined_inbox"><a class="unread_link" href="?page=message_list&amp;list_path=combined_inbox">';
if (!$this->get('hide_folder_icons')) {
$res .= '<img class="account_icon" src="'.$this->html_safe(Hm_Image_Sources::$box).'" alt="" width="16" height="16" /> ';
$res .= '<i class="bi bi-box2-fill fs-5 me-2"></i>';
}
$res .= $this->trans('Everything').'</a><span class="combined_inbox_count"></span></li>';
}
$res .= '<li class="menu_unread"><a class="unread_link" href="?page=message_list&amp;list_path=unread">';
$res .= '<li class="menu_unread d-flex align-items-center"><a class="unread_link d-flex align-items-center" href="?page=message_list&amp;list_path=unread">';
if (!$this->get('hide_folder_icons')) {
$res .= '<img class="account_icon" src="'.$this->html_safe(Hm_Image_Sources::$env_closed).'" alt="" width="16" height="16" /> ';
$res .= '<i class="bi bi-envelope-fill fs-5 me-2"></i>';
}
$res .= $this->trans('Unread').'</a><span class="total_unread_count badge bg-secondary"></span></li>';
$res .= $this->trans('Unread').'</a><span class="total_unread_count badge bg-secondary ms-2 px-1"></span></li>';
$res .= '<li class="menu_flagged"><a class="unread_link" href="?page=message_list&amp;list_path=flagged">';
if (!$this->get('hide_folder_icons')) {
$res .= '<img class="account_icon" src="'.$this->html_safe(Hm_Image_Sources::$star).'" alt="" width="16" height="16" /> ';
$res .= '<i class="bi bi-flag-fill fs-5 me-2"></i>';
}
$res .= $this->trans('Flagged').'</a> <span class="flagged_count"></span></li>';
$res .= '<li class="menu_junk"><a class="unread_link" href="?page=message_list&amp;list_path=junk">';
if (!$this->get('hide_folder_icons')) {
$res .= '<img class="account_icon" src="'.$this->html_safe(Hm_Image_Sources::$junk).'" alt="" width="16" height="16" /> ';
$res .= '<i class="bi bi-envelope-x-fill fs-5 me-2"></i>';
}
$res .= $this->trans('Junk').'</a></li>';
$res .= '<li class="menu_trash"><a class="unread_link" href="?page=message_list&amp;list_path=trash">';
if (!$this->get('hide_folder_icons')) {
$res .= '<img class="account_icon" src="'.$this->html_safe(Hm_Image_Sources::$trash).'" alt="" width="16" height="16" /> ';
$res .= '<i class="bi bi-trash3-fill fs-5 me-2"></i>';
}
$res .= $this->trans('Trash').'</a></li>';
$res .= '<li class="menu_drafts"><a class="unread_link" href="?page=message_list&amp;list_path=drafts">';
if (!$this->get('hide_folder_icons')) {
$res .= '<img class="account_icon" src="'.$this->html_safe(Hm_Image_Sources::$draft).'" alt="" width="16" height="16" /> ';
$res .= '<i class="bi bi-pencil-square fs-5 me-2"></i>';
}
$res .= $this->trans('Drafts').'</a></li>';

Expand All @@ -1296,7 +1296,7 @@ class Hm_Output_logout_menu_item extends Hm_Output_Module {
protected function output() {
$res = '<li class="menu_logout"><a class="unread_link logout_link" href="#">';
if (!$this->get('hide_folder_icons')) {
$res .= '<img class="account_icon" src="'.$this->html_safe(Hm_Image_Sources::$power).'" alt="" width="16" height="16" /> ';
$res .= '<i class="bi bi-power fs-5 me-2"></i>';
}
$res .= $this->trans('Logout').'</a></li>';

Expand Down Expand Up @@ -1352,7 +1352,7 @@ protected function output() {
if ($name == 'Email' && !$single) {
$res .= '<li class="menu_email"><a class="unread_link" href="?page=message_list&amp;list_path=email">';
if (!$this->get('hide_folder_icons')) {
$res .= '<img class="account_icon" src="'.$this->html_safe(Hm_Image_Sources::$globe).'" alt="" width="16" height="16" /> ';
$res .= '<i class="bi bi-globe-americas fs-5 me-2"></i>';
}
$res .= $this->trans('All').'</a> <span class="unread_mail_count"></span></li>';
}
Expand All @@ -1379,7 +1379,7 @@ protected function output() {
'</div><ul style="display: none;" class="settings folders">';
$res .= '<li class="menu_home"><a class="unread_link" href="?page=home">';
if (!$this->get('hide_folder_icons')) {
$res .= '<img class="account_icon" src="'.$this->html_safe(Hm_Image_Sources::$home).'" alt="" width="16" height="16" /> ';
$res .= '<i class="bi bi-house-door-fill fs-5 me-2"></i>';
}
$res .= $this->trans('Home').'</a></li>';
if ($this->format == 'HTML5') {
Expand Down Expand Up @@ -1442,7 +1442,7 @@ class Hm_Output_settings_servers_link extends Hm_Output_Module {
protected function output() {
$res = '<li class="menu_servers"><a class="unread_link" href="?page=servers">';
if (!$this->get('hide_folder_icons')) {
$res .= '<img class="account_icon" src="'.$this->html_safe(Hm_Image_Sources::$monitor).'" alt="" width="16" height="16" /> ';
$res .= '<i class="bi bi-pc-display-horizontal fs-5 me-2"></i>';
}
$res .= $this->trans('Servers').'</a></li>';
$this->concat('formatted_folder_list', $res);
Expand All @@ -1460,7 +1460,7 @@ class Hm_Output_settings_site_link extends Hm_Output_Module {
protected function output() {
$res = '<li class="menu_settings"><a class="unread_link" href="?page=settings">';
if (!$this->get('hide_folder_icons')) {
$res .= '<img class="account_icon" src="'.$this->html_safe(Hm_Image_Sources::$cog).'" alt="" width="16" height="16" /> ';
$res .= '<i class="bi bi-gear-wide-connected fs-5 me-2"></i>';
}
$res .= $this->trans('Site').'</a></li>';
$this->concat('formatted_folder_list', $res);
Expand All @@ -1481,7 +1481,7 @@ protected function output() {
}
$res = '<li class="menu_save"><a class="unread_link" href="?page=save">';
if (!$this->get('hide_folder_icons')) {
$res .= '<img class="account_icon" src="'.$this->html_safe(Hm_Image_Sources::$save).'" alt="" width="16" height="16" /> ';
$res .= '<i class="bi bi-download fs-5 me-2"></i>';
}
$res .= $this->trans('Save').'</a></li>';
$this->concat('formatted_folder_list', $res);
Expand Down Expand Up @@ -1546,7 +1546,7 @@ class Hm_Output_content_section_start extends Hm_Output_Module {
* Opens a main tag for the primary content section
*/
protected function output() {
return '<main class="container-fluid content_cell"><div class="offline">'.$this->trans('Offline').'</div><div class="row m-0">';
return '<main class="container-fluid content_cell"><div class="offline">'.$this->trans('Offline').'</div><div class="row m-0 position-relative">';
}
}

Expand Down Expand Up @@ -1682,7 +1682,7 @@ protected function output() {
$header_flds[] = '<th></th>';
}
}
$res = '<table class="message_table">';
$res = '<div class="p-3"><table class="message_table table pt-5">';
if (!$this->get('no_message_list_headers')) {
if (!empty($col_flds)) {
$res .= '<colgroup>'.implode('', $col_flds).'</colgroup>';
Expand Down Expand Up @@ -1800,7 +1800,7 @@ class Hm_Output_message_list_end extends Hm_Output_Module {
* Close the table opened in Hm_Output_message_list_start
*/
protected function output() {
$res = '</tbody></table><div class="page_links"></div></div>';
$res = '</tbody></table></div><div class="mb-5 page_links d-flex justify-content-center gap-3 align-content-center"></div></div>';
return $res;
}
}
Expand Down
Loading

0 comments on commit 0ed9f4f

Please sign in to comment.