From 17ea360eb05bd5b527f46ad1e92e3513740d4098 Mon Sep 17 00:00:00 2001 From: Alvin Bauma Date: Wed, 15 Nov 2023 14:36:14 +0200 Subject: [PATCH 01/13] Move to Bootstrap 5 --- composer.json | 4 +- modules/calendar/hm-calendar.php | 22 +- modules/calendar/modules.php | 81 +- modules/calendar/site.css | 26 +- modules/contacts/modules.php | 8 +- modules/contacts/site.css | 16 +- modules/core/output_modules.php | 56 +- modules/core/site.css | 26 +- modules/core/site.js | 4 +- modules/feeds/modules.php | 6 +- modules/feeds/site.css | 6 +- modules/imap/output_modules.php | 16 +- modules/imap/site.css | 2 +- modules/local_contacts/modules.php | 26 +- modules/nux/modules.php | 28 +- modules/nux/site.css | 22 +- modules/pop3/modules.php | 1129 ++++++++++++++++++++++++++++ modules/smtp/modules.php | 8 +- 18 files changed, 1338 insertions(+), 148 deletions(-) create mode 100644 modules/pop3/modules.php diff --git a/composer.json b/composer.json index ca5443371e..296e7e0646 100644 --- a/composer.json +++ b/composer.json @@ -39,7 +39,9 @@ "composer" : "^2.0.0", "zbateson/mail-mime-parser": "^2.4", "league/commonmark": "^2.4", - "symfony/dotenv": "^4.3 || 5.4" + "symfony/dotenv": "^4.3 || 5.4", + "twbs/bootstrap": "5.0.2", + "twbs/bootstrap-icons": "^1.11" }, "require-dev": { "phpunit/phpunit": "^9.3.0" diff --git a/modules/calendar/hm-calendar.php b/modules/calendar/hm-calendar.php index 22e9288062..ec273263fc 100644 --- a/modules/calendar/hm-calendar.php +++ b/modules/calendar/hm-calendar.php @@ -45,7 +45,7 @@ public function output($data, $date, $format) { private function output_day($day) { $res = ''. + $res .= '
'. $this->output_event_details($event). $this->output_mod->html_safe(date('H:i', $event['ts'])). ' '.$this->output_mod->html_safe($event['title']). @@ -79,18 +79,18 @@ private function output_event($day) { private function output_event_details($event) { $res = ''; return $res; } @@ -115,12 +115,12 @@ private function output_week($week) { private function output_month($month) { $res = $this->title(); - $res .= ''; + $res .= '
'; $res .= $this->output_heading(); foreach ($month as $week) { $res .= $this->output_week($week); } - $res .= '
'; + $res .= '
'; return $res; } @@ -162,13 +162,13 @@ private function title() { $month = date('F', strtotime($this->year.'-'.$this->month)); $title = sprintf('%s, %%s', $month); $title = sprintf($this->output_mod->trans($title), $this->output_mod->translate_number($year)); - return '
'.$prev.' '.$title.' '.$next.'
'; + return '
'.$prev.' '.$title.' '.$next.'
'; } private function output_heading() { $days = array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'); return ''.implode('', array_map(function($v) { - return sprintf('%s', $this->output_mod->trans($v)); }, $days)).''; + return sprintf('%s', $this->output_mod->trans($v)); }, $days)).''; } } diff --git a/modules/calendar/modules.php b/modules/calendar/modules.php index 4ef108c300..66b69899ec 100644 --- a/modules/calendar/modules.php +++ b/modules/calendar/modules.php @@ -155,28 +155,63 @@ protected function output() { 'year' => $this->trans('Yearly') ); if ($this->get('cal_action') == 'add') { - $res = '
'.$this->trans('Add an Event').'
'. - '
'. - ''. - ''. - ''. - ''. - ''. - ''. - ''. - ''. - ''. - ''. - ''. - ''. - '
'.$this->trans('Title').'
'.$this->trans('Detail').'
'.$this->trans('Date').'
'.$this->trans('Time').'
'.$this->trans('Repeat').'
'; + $res = '
+
'.$this->trans('Add an Event').'
+
+
+ + +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+ +
+
+
+
+
'; return $res; + } } } @@ -196,9 +231,9 @@ protected function output() { $events = $cal_events->in_date_range($bounds[0], $bounds[1]); $out = new Hm_Cal_Output($this, $events); $out = $out->output($data, $date, $view); - return '
'.$this->trans('Calendar').'
'. - ''. + return '
'.$this->trans('Calendar'). + ''. + ' '.$this->trans('Add Event').'
'. $out.'
'; } } diff --git a/modules/calendar/site.css b/modules/calendar/site.css index 70a3524def..d9d595c176 100644 --- a/modules/calendar/site.css +++ b/modules/calendar/site.css @@ -1,24 +1,22 @@ -.calendar { width: 100%; } -.event_form { margin-left: 40px; } -.calendar_week th, .calendar_month th { font-weight: normal; padding-top: 10px; border-bottom: solid 1px #eee; padding-bottom: 10px; border-right: solid 1px #eee; } +/* .calendar { width: 100%; } */ +/* .event_form { margin-left: 40px; } */ +/* .calendar_week th, .calendar_month th { font-weight: normal; padding-top: 10px; border-bottom: solid 1px #eee; padding-bottom: 10px; border-right: solid 1px #eee; } */ .mobile .calendar_month th { max-width: 30px; overflow: hidden; } .calendar_month td { width: 14%; height: 120px; text-align: left; padding: 10px; border-bottom: solid 1px #eee; vertical-align: top; border-right: solid 1px #eee; } -.calendar_week, .calendar_month { padding-bottom: 50px; width: 100%; } -.calendar_week .today, .calendar_month .today { background-color: #f5f5f5; } +/* .calendar_week, .calendar_month { padding-bottom: 50px; width: 100%; } */ +/* .calendar_week .today, .calendar_month .today { background-color: #f5f5f5; } */ .calendar_week .offmonth, .calendar_month .offmonth { color: #ccc; } -.month_label { font-size: 120%; padding: 20px; margin-left: 10px; color: #999; } +/* .month_label { font-size: 120%; padding: 20px; margin-left: 10px; color: #999; } */ .calendar_week td { width: 14%; height: 600px; text-align: left; padding: 10px; border-bottom: solid 1px #eee; vertical-align: top; border-right: solid 1px #eee; } .calendar .event_form { margin-top: 20px; width: 20%; } .calendar .event_form td { padding-top: 5px; } -.cal_label { text-align: left; padding-right: 20px; } -.event_submit { padding-top: 15px !important; } -.cal_event { position: relative; margin-top: 5px; color: #666; } +/* .cal_label { text-align: left; padding-right: 20px; } */ +/* .event_submit { padding-top: 15px !important; } */ +/* .cal_event { position: relative; margin-top: 5px; color: #666; } */ .event_details { cursor: pointer; z-index: 100; display: none; position: absolute; width: 300px; border: solid 1px #ddd; background-color: #fff; padding: 10px; } .event_details td { padding: 5px; border: none; height: auto; } .cal_title { cursor: pointer; } -.event_title { border-bottom: solid 1px #eee; font-size: 120%; margin-bottom: 10px; } -.event_detail { padding: 10px; padding-bottom: 15px; } -.event_repeat { font-size: 90%; font-style: italic; text-align: right; } -.event_date { float: right; } -.event_delete { float: left; font-size: 90%; } +/* .event_title { border-bottom: solid 1px #eee; font-size: 120%; margin-bottom: 10px; } */ +/* .event_detail { padding: 10px; padding-bottom: 15px; } */ +/* .event_repeat { font-size: 90%; font-style: italic; text-align: right; } */ .add_vcal { padding-right: 35px; float: right; margin-top: 10px; } diff --git a/modules/contacts/modules.php b/modules/contacts/modules.php index d85fefadc7..ab0d6db1ae 100644 --- a/modules/contacts/modules.php +++ b/modules/contacts/modules.php @@ -158,7 +158,7 @@ protected function output() { } $per_page = 25; $current_page = $this->get('contact_page', 1); - $res = ''; + $res = '
'; $res .= ''; $contacts = $this->get('contact_store'); $editable = $this->get('contact_edit', array()); @@ -180,7 +180,7 @@ protected function output() { ''. ''. - ''; - $res .= ''; $res .= ''; } @@ -210,7 +210,7 @@ protected function output() { } $res .= ''; } - $res .= '
'.$this->trans('Contacts').'
'.$this->html_safe($contact->value('email_address')).'
'. $this->html_safe($contact->value('phone_number')).''; + ''; if (in_array($contact->value('type').':'.$contact->value('source'), $editable, true)) { $res .= ''.$this->trans('Delete').
@@ -197,7 +197,7 @@ protected function output() {
                     Hm_Image_Sources::$doc.''; $res .= '
'; + $res .= '
'; $res .= build_contact_detail($this, $contact, $id).'
'; + $res .= '
'; return $res; } } diff --git a/modules/contacts/site.css b/modules/contacts/site.css index 40165adbc4..a8aedbea25 100644 --- a/modules/contacts/site.css +++ b/modules/contacts/site.css @@ -1,11 +1,11 @@ -.add_contact_form input { margin: 5px; margin-left: 0px; } -.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; } +/* .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; } +/* .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; } +/* .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; } @@ -15,8 +15,8 @@ .contact_pages { text-align: center; border-bottom: none !important; } .no_contact_sources { text-align: center; color: #999; font-size: 110%; margin-top: 60px; } .add_contact { margin-bottom: 30px; margin-top: 10px; color: #666; margin-right: 25px; float: left; clear: left; margin-left: 25px; width: 300px; } -.add_contact input, .add_contact select { margin-bottom: 10px; padding: 5px; margin-right: 5px; } -.add_contact .server_title { cursor: pointer; } +/* .add_contact input, .add_contact select { margin-bottom: 10px; padding: 5px; margin-right: 5px; } */ +/* .add_contact .server_title { cursor: pointer; } */ .contact_form { margin-top: 10px; display: none; } .add_contact .menu_caret { opacity: .7; } .contact_update_form { margin-top: 10px; } diff --git a/modules/core/output_modules.php b/modules/core/output_modules.php index 5a7612e2f2..9c79ba9cd4 100644 --- a/modules/core/output_modules.php +++ b/modules/core/output_modules.php @@ -249,8 +249,10 @@ class Hm_Output_login extends Hm_Output_Module { protected function output() { $stay_logged_in = ''; if ($this->get('allow_long_session')) { - $stay_logged_in = '
'. - '
'; + $stay_logged_in = '
+ + +
'; } if (!$this->get('router_login_state')) { $fancy_login = $this->get('fancy_login_allowed'); @@ -281,18 +283,30 @@ protected function output() { if (!$single && count($settings) > 0) { $changed = 1; } - return ''. - ''. - '
'. - $this->trans('Unsaved changes will be lost! Re-enter your password to save and exit.').'  '. - ''.$this->trans('More info').'
'. - ''. - ''. - ''. - ''. - ''. - ''. - '
'; + + return ''; } } } @@ -392,7 +406,10 @@ protected function output() { ''. ''. ''. - ''; + ''. + ''; + ''; + ''; if ($this->get('router_login_state')) { $res .= ''; @@ -494,6 +511,8 @@ class Hm_Output_header_css extends Hm_Output_Module { */ protected function output() { $res = ''; + $res .= ''; + $res .= ''; $mods = $this->get('router_module_list'); if (DEBUG_MODE) { foreach (glob(APP_PATH.'modules/**', GLOB_ONLYDIR | GLOB_MARK) as $name) { @@ -530,7 +549,8 @@ class Hm_Output_page_js extends Hm_Output_Module { protected function output() { if (DEBUG_MODE) { $res = ''; - $js_lib = ''; + $js_lib = ''; + $js_lib .= ''; $js_lib .= ''; $js_lib .= ''; $js_lib .= ''; @@ -1588,7 +1608,7 @@ class Hm_Output_content_section_start extends Hm_Output_Module { * Opens a main tag for the primary content section */ protected function output() { - return '
'.$this->trans('Offline').'
'; + return '
'.$this->trans('Offline').'
'; } } @@ -1601,7 +1621,7 @@ class Hm_Output_content_section_end extends Hm_Output_Module { * Closes the main tag opened in Hm_Output_content_section_start */ protected function output() { - return '
'; + return '
'; } } diff --git a/modules/core/site.css b/modules/core/site.css index 7796aafbfe..f5b6940b8e 100644 --- a/modules/core/site.css +++ b/modules/core/site.css @@ -1,3 +1,8 @@ +.folder_cell { vertical-align: top; height: 100%; max-width: 15%; display: table-cell; padding: 0px; margin: 0px; } +.content_cell { vertical-align: top; height: 100%; width: 100%; padding: 0px; margin: 0px; display: table-cell; background-color: #fff; padding-top: 0px; } + + + a { text-decoration: none; color: teal; } form { display: inline; padding: 0px; margin: 0px; } a:hover { color: #000 !important; } @@ -31,7 +36,7 @@ td { vertical-align: top; } .title { font-weight: normal; padding: 0px; margin: 0px; margin-left: 20px; margin-bottom: 20px; letter-spacing: -1px; color: #999; } .date { display: none; position: absolute; top: 15px; right: 20px; color: #888; padding-right: 0px; padding-top: 6px;} .mailbox_list_title { display: inline; } -.sys_messages { position: fixed; right: 20px; top: 15px; min-height: 30px; cursor: pointer; display: none; background-color: #fff; color: teal; margin-top: 0px; padding: 15px; padding-bottom: 5px; white-space: nowrap; border: solid 1px #999; border-radius: 5px; filter: drop-shadow(4px 4px 4px #ccc); z-index: 101; } +.sys_messages { position: fixed; right: 20px; top: 15px; min-height: 30px; min-width: 300px; cursor: pointer; display: none; margin-top: 0px; padding: 15px; padding-bottom: 5px; white-space: nowrap; border: solid 1px #999; border-radius: 5px; filter: drop-shadow(4px 4px 4px #ccc); z-index: 101; } .logged_out { display: block !important; } #theme_setting, #timezone_setting { max-width: 200px; } .s_pre { color: #666} @@ -50,10 +55,10 @@ td { vertical-align: top; } .server_content, .profile_content, .user_settings { display: table; table-layout: fixed; width: 100%; min-height: 500px; background: #fff; height: 100%; margin-right: 20px; padding-bottom: 40px; } .user_settings table { table-layout: fixed; width: 100%; } .user_settings table td { height: 34px; vertical-align: middle; padding: 5px; padding-left: 37px; padding-top: 10px; color: #666; } -.settings_table .save_settings { cursor: pointer; color: #666; font-size: 125%; padding: 10px !important; float: left !important; } +/* .settings_table .save_settings { cursor: pointer; color: #666; font-size: 125%; padding: 10px !important; float: left !important; } */ .reset_factory_button { cursor: pointer; color: #666; font-size: 100%; padding: 10px !important; float: right !important; margin-right: 20px;} .disabled_link { color: #bbb; } -.save_settings_password { float: left; margin-left: 0px; padding: 4px; } +/* .save_settings_password { float: left; margin-left: 0px; padding: 4px; } */ .disabled_input, input:disabled { color: #aaa !important; background-color: #ddd; } input, option, select, button { font-size: 100%; padding: 3px; } textarea, select, input, button { border: solid 1px #ddd; background-color: #fff; color: #333; border-radius: 3px; } @@ -68,8 +73,7 @@ textarea, select, input, button { border: solid 1px #ddd; background-color: #fff .inner_list { margin-bottom: 10px; } .folders a, .unread_link { color: #555; text-decoration: none; line-height: 1.25em; } .folder_list { background-color: #fff; margin-right: 20px; padding-right: 15px; padding-bottom: 40px; min-width: 200px; padding-top: 0px; } -.folder_cell { vertical-align: top; height: 100%; max-width: 15%; display: table-cell; padding: 0px; margin: 0px; } -.content_cell { vertical-align: top; height: 100%; width: 100%; padding: 0px; margin: 0px; display: table-cell; background-color: #fff; padding-top: 0px; } + .folders, .inner_list { list-style-type: none; padding: 0px; margin-left: 10px; padding-right: 0px; } .folders li, .inner_list li { padding: 4px; padding-left: 10px; color: #555; padding-bottom: 0px; margin: 2px; white-space: nowrap; } .loading_folders { text-align: center; margin: 10px; margin-top: 20px; color: #666; } @@ -81,9 +85,9 @@ textarea, select, input, button { border: solid 1px #ddd; background-color: #fff .no_servers { text-align: center; padding: 50px; margin: auto; padding-bottom: 100px; } .selected_menu, .selected_menu a { color: teal !important; line-height: 1.25em;} .folder_list .update_message_list{ font-size: 80%; padding-top: 10px; float: right; } -.src_name { white-space: nowrap; overflow: hidden; max-height: 25px; cursor: pointer; border-left: solid 1px #eee; padding-left: 25px; margin-top: 0px; margin-right: -15px; background: linear-gradient(180deg, #fff, #fff, #f7f2ef); border-bottom: solid 1px #ede8e6; color: #777; padding-top: 10px; font-size: 125%; letter-spacing: -1px; padding-bottom: 10px; } +.src_name { white-space: nowrap; overflow: hidden; cursor: pointer; border-left: solid 1px #eee; padding-left: 25px; margin-top: 0px; margin-right: -15px; background: linear-gradient(180deg, #fff, #fff, #f7f2ef); border-bottom: solid 1px #ede8e6; color: #777; padding-top: 10px; font-size: 125%; letter-spacing: -1px; padding-bottom: 10px; } .main_menu { padding-top: 20px; } -.content_title { max-height: 25px; margin-top: 0px; color: #777; background: linear-gradient(180deg, #fff, #fff, #f7f2ef); border-bottom: solid 1px #ede8e6; padding-bottom: 10px; padding-top: 20px; letter-spacing: -1px; font-size: 125%; padding-left: 27px;} +.content_title { margin-top: 0px; color: #777; background: linear-gradient(180deg, #fff, #fff, #f7f2ef); border-bottom: solid 1px #ede8e6; padding-bottom: 10px; padding-top: 20px; letter-spacing: -1px; font-size: 125%; padding-left: 27px;} .header_subject .content_title { color: #555; } .header_subject th { white-space: normal !important; } .end_float { clear: both; } @@ -94,7 +98,7 @@ textarea, select, input, button { border: solid 1px #ddd; background-color: #fff .checkbox_cell input[type="checkbox"] { display: none; } .checkbox_cell input[type="checkbox"]:checked + label { background-color: #aaa; } .confirm_logout { display: none; background-color: #eee; padding: 20px; position: absolute; left: 0px; top: 0px; border: solid 1px #ede8e6; z-index: 100; } -.confirm_text { padding-left: 10px; padding-bottom: 10px; } +/* .confirm_text { padding-left: 10px; padding-bottom: 10px; } */ .folder_list .update_unread { float: right; margin-top: 20px; } .page_links a { text-decoration: none; color: #111; } .page_links a img { opacity: .6; width: 16px; height: 16px; vertical-align: -2px; } @@ -133,7 +137,7 @@ textarea, select, input, button { border: solid 1px #ddd; background-color: #fff .limit { width: 50px; margin-left: 20px; } .settings_subtitle { font-size: 115%; color: #777 !important; letter-spacing: -1px; padding-bottom: 6px !important; padding-left: 30px !important; height: 25px !important; padding-top: 15px !important; } .server_section img, .settings_subtitle img { opacity: .4; padding-right: 10px; vertical-align: -1px; } -.settings_subtitle, .server_section { cursor: pointer; max-height: 25px; margin-top: 0px; color: #777; padding-bottom: 10px; padding-top: 15px; letter-spacing: -1px; font-size: 115%; padding-left: 30px; border-bottom: solid 1px #ede8e6; } +.settings_subtitle, .server_section { cursor: pointer; max-height: 50px; margin-top: 0px; color: #777; padding-bottom: 10px; padding-top: 15px; letter-spacing: -1px; font-size: 115%; padding-left: 30px; border-bottom: solid 1px #ede8e6; } .list_meta { float: right; margin-right: 20px; letter-spacing: 0px; display: inline; color: #666 !important; font-size: 70% !important; margin-top: 2px; font-style: normal; margin-left: 20px; } .list_meta b { color: #333 !important; font-weight: normal; padding-left: 5px; padding-right: 5px; vertical-align: 1px; } .noscript { position: absolute; z-index: 100; right: 0px; left: 0px; top: 0px; bottom: 0px; background-color: #ede8e6; opacity: 1; padding-top: 100px; text-align: center; } @@ -209,8 +213,8 @@ div.unseen, .unseen .subject { font-weight: 700; } .mobile { font-size: 90%; min-width: 100%; background: none; } .mobile .sys_messages { z-index: 1002; } .mobile .account_icon { width: 24px; height: 24px; padding-bottom: 4px; } -.mobile .save_settings { margin-left: 0px !important; } -.mobile .save_settings_password { margin-right: 10px; } +/* .mobile .save_settings { margin-left: 0px !important; } */ +/* .mobile .save_settings_password { margin-right: 10px; } */ .mobile .list_meta { display: block; } .mobile .checkbox_cell { padding-right: 0px !important; padding-left: 3px !important; } .mobile .mailbox_list_title { font-size: 95%; } diff --git a/modules/core/site.js b/modules/core/site.js index 49a667a459..7734ee0b4d 100644 --- a/modules/core/site.js +++ b/modules/core/site.js @@ -1265,7 +1265,7 @@ var Hm_Folders = { return false; }); $('.hide_folders').on("click", function() { return Hm_Folders.hide_folder_list(); }); - $('.logout_link').on("click", function() { return Hm_Utils.confirm_logout(); }); + $('.logout_link').on("click", function(e) { return Hm_Utils.confirm_logout(); }); if (hm_search_terms()) { $('.search_terms').val(hm_search_terms()); } @@ -1387,6 +1387,8 @@ var Hm_Utils = { document.getElementById('logout_without_saving').click(); } else { + var confirmLogoutModal = new bootstrap.Modal(document.getElementById('confirmLogoutModal'), {keyboard: true}) + confirmLogoutModal.show(); $('.confirm_logout').show(); } return false; diff --git a/modules/feeds/modules.php b/modules/feeds/modules.php index 7b8cc675b9..4d9aafe0a5 100644 --- a/modules/feeds/modules.php +++ b/modules/feeds/modules.php @@ -539,10 +539,10 @@ protected function output() { ''. '
'.$this->trans('Add an RSS/ATOM Feed').'
'. ''. + ''. ''. - ''. + ''. + ''. '
'. - '
'. - '
'; } } diff --git a/modules/feeds/site.css b/modules/feeds/site.css index f245229b33..7f62a02333 100644 --- a/modules/feeds/site.css +++ b/modules/feeds/site.css @@ -1,6 +1,6 @@ -.feeds_section { display: none; } -.feed_server_setup .content_title { cursor: pointer; } -.feeds_setting { display: none; } +/* .feeds_section { display: none; } */ +/* .feed_server_setup .content_title { cursor: pointer; } */ +/* .feeds_setting { display: none; } */ .feeds_section .configured_server, .feeds_section .add_server { height: 140px; } .feeds_section .add_server { margin-right: 0px; } .feeds .source a { color: #666; } diff --git a/modules/imap/output_modules.php b/modules/imap/output_modules.php index 476bb83e8b..5d69d1453a 100644 --- a/modules/imap/output_modules.php +++ b/modules/imap/output_modules.php @@ -543,18 +543,18 @@ protected function output() { ''. '
'.$this->trans('Add an IMAP Server').'
'. ''. + ''. ''. + ''. ''. + ''. $sieve_extra. - ''. + ''. $sieve_extra2. - ''. - ''. + ''. + ''. '
'. - '
'. - '
'. - '
'. - '
'. + '
'. - '
'. + '
'; } } diff --git a/modules/imap/site.css b/modules/imap/site.css index 3d7b8dedcf..f06ff509f0 100644 --- a/modules/imap/site.css +++ b/modules/imap/site.css @@ -2,7 +2,7 @@ .imap_connect { display: inline; } .allow_image_link { margin-right: 20px; float: right; margin-top: -10px; margin-bottom: 10px; } .imap_debug { border: solid 1px #aaa; float: left; padding: 10px; height: 300px; width: 300px; overflow: scroll; white-space: pre; margin-top: 50px; font-size: 75%; } -.save_settings, .server_link { line-height: 10pt; margin: 2px; margin-left: 5px; display: block; padding: 5px; border: solid 1px #ddd; background-color: #fff; float: right; clear: none; color: #333; text-decoration: none; border-radius: 3px; } +.server_link { line-height: 10pt; margin: 2px; margin-left: 5px; display: block; padding: 5px; border: solid 1px #ddd; background-color: #fff; float: right; clear: none; color: #333; text-decoration: none; border-radius: 3px; } .hl { padding-right: 5px; color: #666; } .dl { color: #888; } .empty_list { text-align: center; color: #ccc; font-size: 2em; font-style: italic; padding: 30px; padding-bottom: 100px; } diff --git a/modules/local_contacts/modules.php b/modules/local_contacts/modules.php index 807d22f9c7..00c0b1e3c0 100644 --- a/modules/local_contacts/modules.php +++ b/modules/local_contacts/modules.php @@ -137,7 +137,7 @@ protected function output() { $name = ''; $phone = ''; $form_class = 'contact_form'; - $button = ''; + $button = ''; $title = $this->trans('Add Local'); $current = $this->get('current_contact', array()); if (!empty($current)) { @@ -153,23 +153,23 @@ protected function output() { $form_class = 'contact_update_form'; $title = $this->trans('Update Local'); $button = ''. - ''; + ''; } - return '
'. - '
'.$title. + return '
'. + '
'.$title. '
'. '
'. ''. ''. - ''. - ' *
'. - ''. - ' *
'. - ''. - '
'.$button.' '.$this->trans('E-mail Address').' *'. + '
'. + ''. + '
'. + ''. + '
'.$button.'
'; } } diff --git a/modules/nux/modules.php b/modules/nux/modules.php index 5a0cd81325..8d720d3f7d 100644 --- a/modules/nux/modules.php +++ b/modules/nux/modules.php @@ -280,11 +280,11 @@ protected function output() { '

'. ' '. ''. - '
'. + ''. ''. - '
'. - '
'. - '
'; + ''. + ''. + '
'; } } @@ -310,7 +310,7 @@ protected function output() { */ class Hm_Output_nux_dev_news extends Hm_Output_Module { protected function output() { - $res = '
'.$this->trans('Development Updates').'
'; + $res = '
'.$this->trans('Development Updates').'
'; foreach ($this->get('nux_dev_news', array()) as $vals) { $res .= sprintf('', @@ -321,7 +321,7 @@ protected function output() { $this->html_safe($vals['note']) ); } - $res .= '
%s'. '%s%s%s
'; + $res .= ''; return $res; } } @@ -331,9 +331,9 @@ protected function output() { */ class Hm_Output_nux_help extends Hm_Output_Module { protected function output() { - return '
'.$this->trans('Help').'
'. + return '
'.$this->trans('Help').'
'. $this->trans('Cypht is a webmail program. You can use it to access your E-mail accounts from any service that offers IMAP, or SMTP access - which most do.').' '. - '
'; + '
'; } } @@ -349,17 +349,17 @@ protected function output() { $tz = $this->get('tzone'); $protos = array('imap', 'smtp', 'feeds', 'profiles'); - $res = '
'.$this->trans('Welcome to Cypht').'
'; - $res .= '
'.$this->trans('Add a popular E-mail source quickly and easily'); - $res .= ' '.$this->trans('Add an E-mail Account').''; - $res .= '
'; return $res; } } diff --git a/modules/nux/site.css b/modules/nux/site.css index 728ee9fde6..b2e3384d33 100644 --- a/modules/nux/site.css +++ b/modules/nux/site.css @@ -1,23 +1,23 @@ -.nux_add_account { table-layout: fixed; width: 100%; display: table; background-color: #fff; } -.nux_subtitle { font-size: 80%; margin-left: 40px; display: inline; } -.quick_add_section { padding: 20px; padding-bottom: 40px; display: none; padding-left: 40px; } -.nux_step_two_title { padding-top: 20px; font-size: 110%; padding-bottom: 10px; } -.nux_step_one, .nux_step_two { padding-left: 40px; max-width: 600px; } -.enable_auth2 { float: left; padding: 20px; padding-left: 0px; padding-bottom: 40px; font-size: 110%; } +/* .nux_add_account { table-layout: fixed; width: 100%; display: table; background-color: #fff; } */ +/* .nux_subtitle { font-size: 80%; margin-left: 40px; display: inline; } */ +/* .quick_add_section { padding: 20px; padding-bottom: 40px; display: none; padding-left: 40px; } */ +/* .nux_step_two_title { padding-top: 20px; font-size: 110%; padding-bottom: 10px; } */ +/* .nux_step_one, .nux_step_two { padding-left: 40px; max-width: 600px; } */ +/* .enable_auth2 { float: left; padding: 20px; padding-left: 0px; padding-bottom: 40px; font-size: 110%; } */ .nux_password, .app_password { margin: 10px; margin-left: 0px; margin-top: 0px; width: 280px; } .reset_nux_form { float: right; padding: 20px; padding-bottom: 40px; font-size: 110%; } .nux_submit { margin-bottom: 20px; } -.nux_account_name, .nux_username, #service_select, .nux_extra_fields { margin-bottom: 10px; width: 280px; padding: 3px; } +/* .nux_account_name, .nux_username, #service_select, .nux_extra_fields { margin-bottom: 10px; width: 280px; padding: 3px; } */ #nux_email { margin-bottom: 10px; } .nux_help, .nux_dev_news, .nux_welcome { padding: 20px; margin: 20px; margin-right: 0px; float: left; border: solid 1px #eee; } .nux_welcome, .nux_help { min-width: 320px; max-width: 480px; min-height: 400px; } .nux_qa, .nux_imap, .nux_smtp, .nux_profiles, .nux_feeds { margin-bottom: 10px; } .nux_dev_news table td { padding-right: 10px; white-space: nowrap; } .nux_welcome ul li a { float: right; padding-left: 10px; padding-right: 10px; } -.nux_help ul li { margin-bottom: 30px; } -.nux_help ul { margin-top: 30px; } -.nux_welcome ul { margin-top: 30px; } -.nux_try_out { display: block; text-align: center; margin: auto; margin-top: 10px; } +/* .nux_help ul li { margin-bottom: 30px; } */ +/* .nux_help ul { margin-top: 30px; } */ +/* .nux_welcome ul { margin-top: 30px; } */ +/* .nux_try_out { display: block; text-align: center; margin: auto; margin-top: 10px; } */ .nux_tz { margin-top: 30px; } .nux_empty_combined_view { display: none; text-align: center; padding-top: 100px; color: #666; } diff --git a/modules/pop3/modules.php b/modules/pop3/modules.php new file mode 100644 index 0000000000..0969605f84 --- /dev/null +++ b/modules/pop3/modules.php @@ -0,0 +1,1129 @@ +request->get)) { + $path = $this->request->get['list_path']; + if (preg_match("/^pop3_(\d+)$/", $path, $matches)) { + $this->out('list_path', $path, false); + $details = Hm_POP3_List::dump($matches[1]); + $title = array('POP3', $details['name'], 'INBOX'); + if ($this->get('list_page', 0)) { + $title[] = sprintf('Page %d', $this->get('list_page', 0)); + } + if (!empty($details)) { + $this->out('list_meta', false); + $this->out('mailbox_list_title', $title); + $this->out('custom_list_controls', ' '); + } + } + } + if (array_key_exists('page', $this->request->get) && $this->request->get['page'] == 'search') { + $this->out('list_path', 'search', false); + } + } +} + +/** + * Check the status of a POP3 connection + * @subpackage pop3/handler + */ +class Hm_Handler_pop3_status extends Hm_Handler_Module { + /** + * Used in an ajax request on the home page to determine a POP3 server status + */ + public function process() { + list($success, $form) = $this->process_form(array('pop3_server_ids')); + if ($success) { + $ids = explode(',', $form['pop3_server_ids']); + foreach ($ids as $id) { + $start_time = microtime(true); + $pop3 = Hm_POP3_List::connect($id, false); + if (pop3_authed($pop3)) { + $this->out('pop3_connect_time', microtime(true) - $start_time); + $this->out('pop3_connect_status', 'Authenticated'); + $this->out('pop3_status_server_id', $id); + } + } + } + } +} + +/** + * Perform a message action on a POP3 message + * @subpackage pop3/handler + */ +class Hm_Handler_pop3_message_action extends Hm_Handler_Module { + /** + * read or unread a POP3 message + * @todo add support for more message actions + */ + public function process() { + list($success, $form) = $this->process_form(array('action_type', 'message_ids')); + if ($success) { + $id_list = explode(',', $form['message_ids']); + $server_ids = array(); + foreach ($id_list as $msg_id) { + if (preg_match("/^pop3_(\d)+_(\d)+$/", $msg_id)) { + $parts = explode('_', $msg_id); + $server_ids[] = $parts[1]; + switch($form['action_type']) { + case 'unread': + Hm_POP3_Uid_Cache::unread($msg_id); + break; + case 'read': + Hm_POP3_Uid_Cache::read($msg_id); + break; + } + } + } + if (count($server_ids) > 0) { + foreach ($server_ids as $id) { + bust_pop3_cache($this->cache, $id); + } + } + } + } +} + +/** + * Build the data for a POP3 folder page + * @subpackage pop3/handler + */ +class Hm_Handler_pop3_folder_page extends Hm_Handler_Module { + /** + * Connect to a POP3 server and fetch message headers + * @todo see if this can be broken up into smaller functions + */ + public function process() { + + $msgs = array(); + list($success, $form) = $this->process_form(array('pop3_server_id')); + if ($success) { + $unread_only = false; + $login_time = $this->session->get('login_time', false); + if ($login_time) { + $this->out('login_time', $login_time); + } + $page = 1; + $terms = false; + if (array_key_exists('list_page', $this->request->get)) { + $page = $this->request->get['list_page']; + } + if (array_key_exists('pop3_search', $this->request->post)) { + $limit = DEFAULT_PER_SOURCE; + $terms = $this->session->get('search_terms', false); + if (!$terms) { + return; + } + $since = $this->session->get('search_since', DEFAULT_SINCE); + $fld = $this->session->get('search_fld', 'TEXT'); + $date = process_since_argument($since); + $cutoff_timestamp = strtotime($date); + } + elseif ($this->get('list_path') == 'unread' || (array_key_exists('pop3_unread_only', $this->request->post) && $this->request->post['pop3_unread_only'])) { + $limit = $this->user_config->get('unread_per_source_setting', DEFAULT_PER_SOURCE); + $date = process_since_argument($this->user_config->get('unread_since_setting', DEFAULT_SINCE)); + $unread_only = true; + $cutoff_timestamp = strtotime($date); + if ($login_time && $login_time > $cutoff_timestamp) { + $cutoff_timestamp = $login_time; + } + } + elseif ($this->get('list_path') == 'email') { + $limit = $this->user_config->get('all_email_per_source_setting', DEFAULT_PER_SOURCE); + $date = process_since_argument($this->user_config->get('all_email_since_setting', DEFAULT_SINCE)); + $cutoff_timestamp = strtotime($date); + } + elseif ($this->get('list_path') == 'combined_inbox') { + $limit = $this->user_config->get('all_per_source_setting', DEFAULT_PER_SOURCE); + $date = process_since_argument($this->user_config->get('all_since_setting', DEFAULT_SINCE)); + $cutoff_timestamp = strtotime($date); + } + else { + $limit = DEFAULT_PER_SOURCE; + $date = false; + $cutoff_timestamp = strtotime($date); + } + $cache = false; + if (!$unread_only) { + $cache = Hm_POP3_List::get_cache($this->cache, $form['pop3_server_id']); + } + if ($cache) { + $this->out('pop3_cache_used', true); + } + $pop3 = Hm_POP3_List::connect($form['pop3_server_id'], $cache); + $details = Hm_POP3_List::dump($form['pop3_server_id']); + $path = sprintf("pop3_%d", $form['pop3_server_id']); + if (pop3_authed($pop3)) { + $this->out('pop3_mailbox_page_path', $path); + $list = array_reverse(array_unique(array_keys($pop3->mlist()))); + $total = count($list); + $list = array_slice($list, (($page - 1) * $limit), $limit); + foreach ($list as $id) { + $msg_headers = $pop3->msg_headers($id); + if (!empty($msg_headers)) { + if ($date && isset($msg_headers['date'])) { + if (!Hm_POP3_Uid_Cache::is_unread(sprintf('pop3_%d_%d', $form['pop3_server_id'], $id)) && strtotime($msg_headers['date']) < $cutoff_timestamp) { + continue; + } + } + if ($unread_only && Hm_POP3_Uid_Cache::is_read(sprintf('pop3_%d_%d', $form['pop3_server_id'], $id))) { + continue; + } + if ($terms) { + $body = implode('', $pop3->retr_full($id)); + if (!search_pop3_msg($body, $msg_headers, $terms, $fld)) { + continue; + } + } + $msg_headers['server_name'] = $details['name']; + $msg_headers['server_id'] = $form['pop3_server_id']; + $msgs[$id] = $msg_headers; + } + } + $this->out('pop3_mailbox_page', $msgs); + $this->out('pop3_server_id', $form['pop3_server_id']); + $this->out('list_page', $page); + if (!$date) { + $this->out('page_links', build_page_links($limit, $page, $total, $path)); + } + } + } + } +} + +/** + * Fetch a message from a POP3 server + * @subpackage pop3/handler + */ +class Hm_Handler_pop3_message_content extends Hm_Handler_Module { + /** + * Connect to a POP3 server and download a message + */ + public function process() { + + list($success, $form) = $this->process_form(array('pop3_uid', 'pop3_list_path')); + if ($success) { + $id = (int) substr($form['pop3_list_path'], 5); + $cache = Hm_POP3_List::get_cache($this->cache, $id); + $pop3 = Hm_POP3_List::connect($id, $cache); + $details = Hm_POP3_List::dump($id); + if (pop3_authed($pop3)) { + $msg_lines = $pop3->retr_full($form['pop3_uid']); + $header_list = array(); + $body = array(); + $headers = true; + $last_header = false; + + $bodies = array(); + $has_multipart = false; + $boundary = ''; + $boundaries = array(); + $multipart_headers = false; + $multipart_header_list = array(); + + foreach ($msg_lines as $line) { + if ($headers) { + if (substr($line, 0, 1) == "\t" + || substr($line, 0, 1) == " ") { + $header_list[$last_header] .= decode_fld($line); + } + elseif (strstr($line, ':')) { + $parts = explode(':', $line, 2); + if (count($parts) == 2) { + $header_list[$parts[0]] = decode_fld($parts[1]); + $last_header = $parts[0]; + } + } + if (array_key_exists('Content-Type', $header_list) + && strstr($header_list['Content-Type'], 'multipart') + && $boundary = strstr($header_list['Content-Type'], 'boundary=')) { + $has_multipart = true; + $boundary = str_replace('boundary=', '', $boundary); + $boundary = str_replace('"', '', $boundary); + if (array_search($boundary, $boundaries) === false) { + $boundaries[] = $boundary; + } + } + } + elseif ($multipart_headers) { + if (substr($line, 0, 1) == "\t" + || substr($line, 0, 1) == " ") { + $multipart_header_list[$last_header] .= decode_fld($line); + } + elseif (strstr($line, ':')) { + $parts = explode(':', $line, 2); + if (count($parts) == 2) { + $multipart_header_list[$parts[0]] = decode_fld($parts[1]); + $last_header = $parts[0]; + } + } + if (array_key_exists('Content-Type', $multipart_header_list) + && strstr($multipart_header_list['Content-Type'], 'multipart') + && $boundary = strstr($multipart_header_list['Content-Type'], 'boundary=')) { + $has_multipart = true; + $boundary = str_replace('boundary=', '', $boundary); + $boundary = str_replace('"', '', $boundary); + if (array_search($boundary, $boundaries) === false) { + $boundaries[] = $boundary; + } + } + } + else { + $boundary = '####unmatch-boundary'; + foreach ($boundaries as $_boundary) { + if (strstr($line, $_boundary)) { + $boundary = $_boundary; + break; + } + } + if ($has_multipart === true && strstr($line, $boundary)) { + if (array_key_exists('Content-Type', $multipart_header_list) + && strstr($multipart_header_list['Content-Type'], 'html')) { + $body['content-type'] = 'html'; + } + else { + $body['content-type'] = 'text'; + } + if (array_key_exists('Content-Transfer-Encoding', $multipart_header_list) + && strstr($multipart_header_list['Content-Transfer-Encoding'], 'base64')) { + $body['text'] = base64_decode(str_replace(array("\r", "\n"), '', $body['text'])); + } + if (array_key_exists('Content-Type', $multipart_header_list) + && $charset = strstr($multipart_header_list['Content-Type'], 'charset=')) { + $charset = str_replace('charset=', '', $charset); + $body['text'] = mb_convert_encoding($body['text'], 'UTF-8', $charset); + } + if (array_key_exists('text', $body)) { + $bodies[] = $body; + } + $body = array('text' => ''); + + $multipart_headers = true; + $multipart_header_list = array(); + } + else { + if (array_key_exists('text', $body)) { + $body['text'] .= $line; + } + else { + $body['text'] = $line; + } + } + } + + if (!trim($line)) { + $headers = false; + if ($multipart_headers === true) { + $multipart_headers = false; + } + } + } + $this->out('pop3_message_headers', $header_list); + + if ($has_multipart === false) { + if (array_key_exists('Content-Type', $header_list) + && strstr($header_list['Content-Type'], 'html')) { + $body['content-type'] = 'html'; + } + if (array_key_exists('Content-Transfer-Encoding', $header_list) + && strstr($header_list['Content-Transfer-Encoding'], 'base64')) { + $body['text'] = base64_decode(str_replace(array("\r", "\n"), '', $body['text'])); + } + if (array_key_exists('Content-Type', $header_list) + && $charset = strstr($header_list['Content-Type'], 'charset=')) { + $charset = trim(str_replace('charset=', '', $charset)); + if (strtolower($charset) != 'utf-8') { + $body['text'] = mb_convert_encoding($body['text'], 'UTF-8', $charset); + } + } + $bodies[] = $body; + } + + $this->out('pop3_message_body', $bodies); + $this->out('pop3_mailbox_page_path', $form['pop3_list_path']); + $this->out('pop3_server_id', $id); + bust_pop3_cache($this->cache, $id); + Hm_POP3_Uid_Cache::read(sprintf("pop3_%s_%s", $id, $form['pop3_uid'])); + } + } + } +} + +/** + * Save a POP3 server on the servers page + * @subpackage pop3/handler + */ +class Hm_Handler_pop3_save extends Hm_Handler_Module { + /** + * Authenticate and save a POP3 server on the settings page + */ + public function process() { + $just_saved_credentials = false; + if (isset($this->request->post['pop3_save'])) { + list($success, $form) = $this->process_form(array('pop3_user', 'pop3_pass', 'pop3_server_id')); + if (!$success) { + Hm_Msgs::add('ERRUsername and Password are required to save a connection'); + return; + } + if (in_server_list('Hm_POP3_List', $form['pop3_server_id'], $form['pop3_user'])) { + Hm_Msgs::add('ERRThis server and username are already configured'); + return; + } + $pop3 = Hm_POP3_List::connect($form['pop3_server_id'], false, $form['pop3_user'], $form['pop3_pass'], true); + if (pop3_authed($pop3)) { + $just_saved_credentials = true; + Hm_Msgs::add("Server saved"); + $this->session->record_unsaved('POP3 server saved'); + } + else { + Hm_POP3_List::forget_credentials($form['pop3_server_id']); + Hm_Msgs::add("ERRUnable to save this server, are the username and password correct?"); + } + } + $this->out('just_saved_credentials', $just_saved_credentials); + } +} + +/** + * Forget the username and password for a POP3 server + * @subpackage pop3/handler + */ +class Hm_Handler_pop3_forget extends Hm_Handler_Module { + /** + * Used on the settings page to forget the username/password of a POP3 server + */ + public function process() { + $just_forgot_credentials = false; + if (isset($this->request->post['pop3_forget'])) { + list($success, $form) = $this->process_form(array('pop3_server_id')); + if ($success) { + Hm_POP3_List::forget_credentials($form['pop3_server_id']); + $just_forgot_credentials = true; + Hm_Msgs::add('Server credentials forgotten'); + $this->session->record_unsaved('POP3 server credentials forgotten'); + } + else { + $this->out('old_form', $form); + } + } + $this->out('just_forgot_credentials', $just_forgot_credentials); + } +} + +/** + * Delete a POP3 server from the settings page + * @subpackage pop3/handler + */ +class Hm_Handler_pop3_delete extends Hm_Handler_Module { + /** + * Delete a POP3 server + */ + public function process() { + if (isset($this->request->post['pop3_delete'])) { + list($success, $form) = $this->process_form(array('pop3_server_id')); + if ($success) { + $res = Hm_POP3_List::del($form['pop3_server_id']); + if ($res) { + $this->out('deleted_server_id', $form['pop3_server_id']); + Hm_Msgs::add('Server deleted'); + $this->session->record_unsaved('POP3 server deleted'); + } + } + else { + $this->out('old_form', $form); + } + } + } +} + +/** + * Test a connection to a POP3 server + * @subpackage pop3/handler + */ +class Hm_Handler_pop3_connect extends Hm_Handler_Module { + /** + * Used on the servers page to test a POP3 connection + */ + public function process() { + $pop3 = false; + if (isset($this->request->post['pop3_connect'])) { + list($success, $form) = $this->process_form(array('pop3_user', 'pop3_pass', 'pop3_server_id')); + if ($success) { + $pop3 = Hm_POP3_List::connect($form['pop3_server_id'], false, $form['pop3_user'], $form['pop3_pass']); + } + elseif (isset($form['pop3_server_id'])) { + $pop3 = Hm_POP3_List::connect($form['pop3_server_id'], false); + } + if ($pop3 && $pop3->state == 'authed') { + Hm_Msgs::add("Successfully authenticated to the POP3 server : " . $form['pop3_user']); + } + else { + Hm_Msgs::add("ERRFailed to authenticate to the POP3 server : " . $form['pop3_user']); + } + } + } +} + +/** + * Save a POP3 server cache + * @subpackage pop3/handler + */ +class Hm_Handler_save_pop3_cache extends Hm_Handler_Module { + /** + * Save a POP3 server cache in the session + * + */ + public function process() { + $cache = array(); + if ($this->get('pop3_cache_used')) { + return; + } + $servers = Hm_POP3_List::dump(false, true); + foreach ($servers as $id => $server) { + if (isset($server['object']) && is_object($server['object'])) { + $cache[$id] = $server['object']->dump_cache(); + } + } + if (count($cache) > 0) { + foreach ($cache as $id => $data) { + $this->cache->set('pop3'.$id, $cache[$id]); + } + } + } +} + +/** + * Load POP3 servers up for the search page + * @subpackage pop3/handler + */ +class Hm_Handler_load_pop3_servers_for_search extends Hm_Handler_Module { + /** + * Add POP3 servers to the data sources list for the search page + */ + public function process() { + foreach (Hm_POP3_List::dump() as $index => $vals) { + $this->append('data_sources', array('callback' => 'pop3_search_page_content', 'type' => 'pop3', 'name' => $vals['name'], 'id' => $index)); + } + } +} + +/** + * Load POP3 server for combined message views + * @subpackage pop3/handler + */ +class Hm_Handler_load_pop3_servers_for_message_list extends Hm_Handler_Module { + /** + * Load POP3 servers for a combined message list + */ + public function process() { + $server_id = false; + $callback = false; + if (array_key_exists('list_path', $this->request->get)) { + $path = $this->request->get['list_path']; + } + else { + $path = ''; + } + switch ($path) { + case 'unread': + $callback = 'pop3_combined_unread_content'; + break; + case 'combined_inbox': + $callback = 'pop3_combined_inbox_content'; + break; + case 'email': + $callback = 'pop3_all_mail_content'; + break; + default: + if (preg_match("/^pop3_(\d+)$/", $path, $matches)) { + $server_id = $matches[1]; + $callback = 'load_pop3_list'; + } + else { + $callback = 'pop3_unread_background'; + } + break; + } + if ($callback) { + foreach (Hm_POP3_List::dump() as $index => $vals) { + if ($server_id !== false && $server_id != $index) { + continue; + } + if ($callback == 'pop3_unread_background') { + $this->append('data_sources', array('callback' => $callback, 'group' => 'background', 'type' => 'pop3', 'name' => $vals['name'], 'id' => $index)); + } + else { + $this->append('data_sources', array('callback' => $callback, 'type' => 'pop3', 'name' => $vals['name'], 'id' => $index)); + } + } + } + } +} + +/** + * Load POP3 servers from the user config + * @subpackage pop3/handler + */ +class Hm_Handler_load_pop3_servers_from_config extends Hm_Handler_Module { + /** + * Setup the POP3 server list + */ + public function process() { + $servers = $this->user_config->get('pop3_servers', array()); + $added = false; + $max = 0; + $index = 0; + foreach ($servers as $server) { + Hm_POP3_List::add( $server, $index ); + if (array_key_exists('default', $server) && $server['default']) { + $added = true; + } + $max = $index; + $index++; + } + $max++; + if (!$added) { + $auth_server = $this->session->get('pop3_auth_server_settings', array()); + if (array_key_exists('name', $auth_server)) { + $name = $auth_server['name']; + } + else { + $name = $this->config->get('pop3_auth_name', 'Default'); + } + if (!empty($auth_server)) { + Hm_POP3_List::add(array( + 'name' => $name, + 'default' => true, + 'server' => $auth_server['server'], + 'port' => $auth_server['port'], + 'tls' => $auth_server['tls'], + 'user' => $auth_server['username'], + 'pass' => $auth_server['password']), + $max); + } + } + Hm_POP3_Uid_Cache::load($this->session->get('pop3_read_uids', array())); + } +} + +/** + * Add a new POP3 server + * @subpackage pop3/handler + */ +class Hm_Handler_process_add_pop3_server extends Hm_Handler_Module { + /** + * Used on the servers page to process adding a new POP3 server + */ + public function process() { + if (isset($this->request->post['submit_pop3_server'])) { + list($success, $form) = $this->process_form(array('new_pop3_name', 'new_pop3_address', 'new_pop3_port')); + if (!$success) { + $this->out('old_form', $form); + Hm_Msgs::add('ERRYou must supply a name, a server and a port ' . $form['pop3_user']); + } + else { + $tls = false; + if (array_key_exists('tls', $this->request->post) && $this->request->post['tls']) { + $tls = true; + } + if ($con = fsockopen($form['new_pop3_address'], $form['new_pop3_port'], $errno, $errstr, 2)) { + Hm_POP3_List::add( array( + 'name' => $form['new_pop3_name'], + 'server' => $form['new_pop3_address'], + 'port' => $form['new_pop3_port'], + 'tls' => $tls)); + Hm_Msgs::add('Added server!'); + $this->session->record_unsaved('POP3 server added'); + } + else { + Hm_Msgs::add(sprintf('ERRCound not add server: %s, %s', $errstr, $form['pop3_user'])); + } + } + } + } +} + +/** + * Add a list of POP3 servers for the output modules + * @subpackage pop3/handler + */ +class Hm_Handler_add_pop3_servers_to_page_data extends Hm_Handler_Module { + /** + * Used to add POP3 server ids to an output page + */ + public function process() { + $servers = Hm_POP3_List::dump(); + $this->out('pop3_servers', $servers); + } +} + +/** + * Load POP3 folder data used by the folder list + * @subpackage pop3/handler + */ +class Hm_Handler_load_pop3_folders extends Hm_Handler_Module { + /** + * Add POP3 folders to the folder list E-mail section + */ + public function process() { + $servers = Hm_POP3_List::dump(); + $folders = array(); + if (!empty($servers)) { + foreach ($servers as $id => $server) { + if ($server['name'] == 'Default-Auth-Server') { + $server['name'] = 'Default'; + } + $folders[$id] = $server['name']; + } + } + $this->out('pop3_folders', $folders); + } +} + +/** + * Save POP3 server list + * @subpackage pop3/handler + */ +class Hm_Handler_save_pop3_servers extends Hm_Handler_Module { + /** + * Save POP3 servers in the session + */ + public function process() { + $servers = Hm_POP3_List::dump(false, true); + foreach ($servers as $index => $vals) { + if (array_key_exists('object', $vals) && $vals['object']) { + unset($servers[$index]['object']); + } + } + $this->user_config->set('pop3_servers', $servers); + $this->session->set('pop3_read_uids', Hm_POP3_Uid_Cache::dump()); + Hm_POP3_List::clean_up(); + } +} + +/** + * Format the add POP3 server dialog + * @subpackage pop3/output + */ +class Hm_Output_add_pop3_server_dialog extends Hm_Output_Module { + /** + * Build the HTML for the add server dialog + */ + protected function output() { + if ($this->get('single_server_mode')) { + return ''; + } + $count = count($this->get('pop3_servers', array())); + $count = sprintf($this->trans('%d configured'), $count); + return '
'. + ''. + ' '.$this->trans('POP3 Servers').'
'.$count.'
'. + ''. + '
'.$this->trans('Add a POP3 Server').'
'. + ''. + ''. + ''. + ''. + ''. + '
'. + '
'. + '
'. + '
'. + '
'.$this->trans('STARTTLS or unencrypted').'
'; + } +} + +/** + * Format a list of configured POP3 servers + * @subpackage pop3/output + */ +class Hm_Output_display_configured_pop3_servers extends Hm_Output_Module { + /** + * Build HTML for configured POP3 servers on the servers page + */ + protected function output() { + if ($this->get('single_server_mode')) { + return ''; + } + $res = ''; + foreach ($this->get('pop3_servers', array()) as $index => $vals) { + + $no_edit = false; + + if (array_key_exists('user', $vals) && !array_key_exists('nopass', $vals)) { + $disabled = 'disabled="disabled"'; + $user_pc = $vals['user']; + $pass_pc = $this->trans('[saved]'); + } + elseif (array_key_exists('user', $vals) && array_key_exists('nopass', $vals)) { + $user_pc = $vals['user']; + $pass_pc = $this->trans('Password'); + $disabled = ''; + } + else { + $user_pc = ''; + $pass_pc = $this->trans('Password'); + $disabled = ''; + } + if ($vals['name'] == 'Default-Auth-Server') { + $vals['name'] = $this->trans('Default'); + $no_edit = true; + } + $res .= '
'; + $res .= sprintf('
%s
%s/%d %s
', + $this->html_safe($vals['name']), $this->html_safe($vals['server']), $this->html_safe($vals['port']), $vals['tls'] ? 'TLS' : '' ); + $res .= + '
'. + ''. + ' '. + ''. + ''. + ' '. + ''; + if (!$no_edit) { + if (!isset($vals['user']) || !$vals['user']) { + $res .= ''; + $res .= ''; + } + else { + $res .= ''; + $res .= ''; + $res .= ''; + } + $res .= ''; + } + $res .= '
'; + } + $res .= '
'; + return $res; + } +} + +/** + * Format POP3 folders for the folder list + * @subpackage pop3/output + */ +class Hm_Output_filter_pop3_folders extends Hm_Output_Module { + /** + * Build the HTML for POP3 accounts in the folder list + */ + protected function output() { + $res = ''; + foreach ($this->get('pop3_folders', array()) as $id => $folder) { + $res .= '
  • '. + ''; + if (!$this->get('hide_folder_icons')) { + $res .= ' '; + } + $res .= $this->html_safe($folder).'
  • '; + } + if ($res) { + $this->append('folder_sources', array('email_folders', $res)); + } + return ''; + } +} + +/** + * Format a POP3 message for display + * @subpackage pop3/output + */ +class Hm_Output_filter_pop3_message_content extends Hm_Output_Module { + /** + * Build the HTML for a POP3 message view + */ + protected function output() { + if ($this->get('pop3_message_headers')) { + $txt = ''; + $from = ''; + $small_headers = array('subject', 'date', 'from'); + $headers = $this->get('pop3_message_headers'); + $txt .= ''. + ''; + foreach ($small_headers as $fld) { + foreach ($headers as $name => $value) { + if ($fld == strtolower($name)) { + if ($fld == 'from') { + $from = $value; + } + if ($fld == 'subject') { + $txt .= ''; + } + else { + $txt .= ''; + } + break; + } + } + } + foreach ($headers as $name => $value) { + if (!in_array(strtolower($name), $small_headers)) { + $txt .= ''; + } + } + $txt .= '
    '; + if (isset($headers['Flags']) && stristr($headers['Flags'], 'flagged')) { + $txt .= ' '; + } + $txt .= $this->html_safe($value).'
    '.$this->trans($name).''.$this->html_safe($value).'
    '. + ''.$this->trans('All').''. + ''. + ' | '.$this->trans('Reply').''. + ' | '.$this->trans('Forward').''. + ' | '.$this->trans('Attach').''. + ' | '.$this->trans('raw').''. + ' | '.$this->trans('Flag').''. + '
    '; + + $this->out('msg_headers', $txt); + } + $txt = '
    '; + if ($this->get('pop3_message_body')) { + foreach ($this->get('pop3_message_body') as $body) { + if (array_key_exists('content-type', $body) && $body['content-type'] === 'html') { + $txt .= format_msg_html($body['text']); + } + else { + $txt .= format_msg_text($body['text'], $this); + } + } + } + $txt .= '
    '; + $this->out('msg_text', $txt); + } +} + +/** + * Format a list of POP3 messages + * @subpackage pop3/output + */ +class Hm_Output_filter_pop3_message_list extends Hm_Output_Module { + /** + * Build the HTML for a set of POP3 messages + */ + protected function output() { + $res = array(); + if ($this->get('pop3_mailbox_page')) { + $style = $this->get('news_list_style') ? 'news' : 'email'; + if ($this->get('is_mobile')) { + $style = 'news'; + } + if ($this->get('login_time')) { + $login_time = $this->get('login_time'); + } + else { + $login_time = false; + } + $res = format_pop3_message_list($this->get('pop3_mailbox_page'), $this, $style, $login_time, $this->get('list_path')); + } + $this->out('formatted_message_list', $res); + } +} + +/** + * Output POP3 server ids + * @subpackage pop3/output + */ +class Hm_Output_pop3_server_ids extends Hm_Output_Module { + /** + * Put a list of POP3 server ids in a hidden page element + */ + protected function output() { + return ''; + } +} + +/** + * Format a POP3 status response row + * @subpackage pop3/output + */ +class Hm_Output_display_pop3_status extends Hm_Output_Module { + /** + * Build the HTML for a POP3 status row on the home page + */ + protected function output() { + $res = ''; + foreach ($this->get('pop3_servers', array()) as $index => $vals) { + if ($vals['name'] == 'Default-Auth-Server') { + $vals['name'] = $this->trans('Default'); + } + $res .= 'POP3'.$vals['name'].''. + ''; + } + return $res; + } +} + +/** + * Format POP3 status response data + * @subpackage pop3/output + */ +class Hm_Output_filter_pop3_status_data extends Hm_Output_Module { + /** + * Build ajax response for a status row on the home page + */ + protected function output() { + if ($this->get('pop3_connect_status') == 'Authenticated') { + $this->out('pop3_status_display', ''. + $this->trans(ucwords($this->get('pop3_connect_status'))).' in '.round($this->get('pop3_connect_time'), 3)); + } + else { + $this->out('pop3_status_display', ''.$this->trans('Down').''); + } + } +} + +/** + * Format a list of POP3 messages + * @subpackage pop3/functions + * @param array $msg_list list of message data + * @param object $mod Hm_Output_Module + * @param string $style list style + * @param string $login_time timestamp of last login + * @param string $list_parent list type + * @return array + */ +if (!hm_exists('format_pop3_message_list')) { +function format_pop3_message_list($msg_list, $output_module, $style, $login_time, $list_parent) { + $res = array(); + $show_icons = $output_module->get('msg_list_icons'); + foreach($msg_list as $msg_id => $msg) { + $icon = 'env_open'; + $row_class = 'email'; + if ($msg['server_name'] == 'Default-Auth-Server') { + $msg['server_name'] = 'Default'; + } + $id = sprintf("pop3_%s_%s", $msg['server_id'], $msg_id); + $subject = display_value('subject', $msg, false, $output_module->trans('[No Subject]')); + $from = display_value('from', $msg); + $nofrom = ''; + if ($style == 'email' && !$from) { + $nofrom = ' nofrom'; + $from = '[No From]'; + } + $date = display_value('date', $msg, false, $output_module->trans('[No Date]')); + if ($date) { + $date = translate_time_str($date, $output_module); + } + $timestamp = display_value('date', $msg, 'time'); + $url = '?page=message&uid='.$msg_id.'&list_path='.sprintf('pop3_%d', $msg['server_id']).'&list_parent='.$list_parent; + if ($output_module->get('list_page', 0)) { + $url .= '&list_page='.$output_module->html_safe($output_module->get('list_page', 1)); + } + if (Hm_POP3_Uid_Cache::is_read($id)) { + $flags = array(); + } + elseif (Hm_POP3_Uid_Cache::is_unread($id)) { + $flags = array('unseen'); + $icon = 'env_closed'; + $row_class .= ' unseen'; + } + elseif (isset($msg['date']) && $login_time && strtotime($msg['date']) <= $login_time) { + $flags = array(); + } + else { + $icon = 'env_closed'; + $flags = array('unseen'); + } + $row_class .= ' '.str_replace(' ', '_', $msg['server_name']); + if (!$show_icons) { + $icon = false; + } + if ($style == 'news') { + $res[$id] = message_list_row(array( + array('checkbox_callback', $id), + array('icon_callback', $flags), + array('subject_callback', $subject, $url, $flags, $icon), + array('safe_output_callback', 'source', $msg['server_name']), + array('safe_output_callback', 'from'.$nofrom, $from), + array('date_callback', $date, $timestamp), + ), + $id, + $style, + $output_module, + $row_class + ); + } + else { + $res[$id] = message_list_row(array( + array('checkbox_callback', $id), + array('safe_output_callback', 'source', $msg['server_name'], $icon), + array('safe_output_callback', 'from'.$nofrom, $from), + array('subject_callback', $subject, $url, $flags), + array('date_callback', $date, $timestamp), + array('icon_callback', $flags) + ), + $id, + $style, + $output_module, + $row_class + ); + } + } + return $res; +}} + +/** + * Search a POP3 message + * @subpackage pop3/functions + * @param string $body message body + * @param array $headers message headers + * @param string $terms search terms + * @param string $fld field to search + * @return bool + */ +if (!hm_exists('search_pop3_msg')) { +function search_pop3_msg($body, $headers, $terms, $fld) { + if ($fld == 'TEXT') { + if (stristr($body, $terms)) { + return true; + } + } + if ($fld == 'SUBJECT') { + if (array_key_exists('subject', $headers) && stristr($headers['subject'], $terms)) { + return true; + } + } + if ($fld == 'FROM') { + if (array_key_exists('from', $headers) && stristr($headers['from'], $terms)) { + return true; + } + } +}} + +/** + * @subpackage pop3/functions + */ +if (!hm_exists('bust_pop3_cache')) { +function bust_pop3_cache($hm_cache, $id) { + $hm_cache->del('pop3'.$id); + Hm_Debug::add('Busted POP3 cache for id '.$id); +}} + +/** + * @subpackage pop3/functions + */ +if (!hm_exists('pop3_authed')) { +function pop3_authed($pop3) { + return is_object($pop3) && $pop3->state == 'authed'; +}} + diff --git a/modules/smtp/modules.php b/modules/smtp/modules.php index 3f51f18a90..2520f8e726 100644 --- a/modules/smtp/modules.php +++ b/modules/smtp/modules.php @@ -1220,14 +1220,14 @@ protected function output() { ''. '
    '.$this->trans('Add an SMTP Server').'
    '. ''. + ''. ''. + ''. ''. + ''. ''. - ''. + ''. '
    '. - '
    '. - '
    '. - '
    '. '
    '; } } From f258c0cea1caf135051b92344e2ffec4672a248c Mon Sep 17 00:00:00 2001 From: Alvin Bauma Date: Wed, 15 Nov 2023 17:13:03 +0200 Subject: [PATCH 02/13] Style migration of the Compose page in bootstrap 5 --- modules/core/output_modules.php | 2 +- modules/core/site.css | 2 +- modules/imap/site.css | 2 +- modules/nux/modules.php | 34 ++++++++------ modules/nux/site.css | 4 +- modules/profiles/modules.php | 2 +- modules/profiles/site.css | 2 +- modules/smtp/modules.php | 79 ++++++++++++++++++++------------- modules/smtp/site.css | 22 ++++----- modules/smtp/site.js | 10 ++--- 10 files changed, 93 insertions(+), 66 deletions(-) diff --git a/modules/core/output_modules.php b/modules/core/output_modules.php index 9c79ba9cd4..a8189d9258 100644 --- a/modules/core/output_modules.php +++ b/modules/core/output_modules.php @@ -1321,7 +1321,7 @@ protected function output() { if (!$this->get('hide_folder_icons')) { $res .= ' '; } - $res .= $this->trans('Unread').''; + $res .= $this->trans('Unread').' kokok'; $res .= ''; + $res .= $this->trans('Unread').''; $res .= ''; $this->concat('formatted_folder_list', $res); diff --git a/modules/calendar/hm-calendar.php b/modules/calendar/hm-calendar.php index ec273263fc..9d51681bdd 100644 --- a/modules/calendar/hm-calendar.php +++ b/modules/calendar/hm-calendar.php @@ -69,7 +69,7 @@ private function output_event($day) { $res .= '
    '. $this->output_event_details($event). $this->output_mod->html_safe(date('H:i', $event['ts'])). - ' '.$this->output_mod->html_safe($event['title']). + ' '.$this->output_mod->html_safe($event['title']). '
    '; } return $res; diff --git a/modules/calendar/modules.php b/modules/calendar/modules.php index 2b07e924ae..7d7f2d659e 100644 --- a/modules/calendar/modules.php +++ b/modules/calendar/modules.php @@ -119,7 +119,7 @@ public function process() { class Hm_Output_vcalendar_add_output extends Hm_Output_Module { protected function output() { if ($this->get('imap_calendar_struct')) { - $link = 'Add to calendar'; + $link = 'Add to calendar'; $this->concat('msg_headers', $link); } } @@ -132,7 +132,7 @@ class Hm_Output_calendar_page_link extends Hm_Output_Module { protected function output() { $res = ''; if ($this->format == 'HTML5') { @@ -156,7 +156,7 @@ protected function output() { ); if ($this->get('cal_action') == 'add') { $res = '
    -
    '.$this->trans('Add an Event').'
    +
    '.$this->trans('Add an Event').'
    @@ -231,8 +231,8 @@ protected function output() { $events = $cal_events->in_date_range($bounds[0], $bounds[1]); $out = new Hm_Cal_Output($this, $events); $out = $out->output($data, $date, $view); - return '
    '.$this->trans('Calendar'). - ''. + return ''; } diff --git a/modules/calendar/site.css b/modules/calendar/site.css index d9d595c176..ddf9820da3 100644 --- a/modules/calendar/site.css +++ b/modules/calendar/site.css @@ -1,22 +1,6 @@ -/* .calendar { width: 100%; } */ -/* .event_form { margin-left: 40px; } */ -/* .calendar_week th, .calendar_month th { font-weight: normal; padding-top: 10px; border-bottom: solid 1px #eee; padding-bottom: 10px; border-right: solid 1px #eee; } */ .mobile .calendar_month th { max-width: 30px; overflow: hidden; } .calendar_month td { width: 14%; height: 120px; text-align: left; padding: 10px; border-bottom: solid 1px #eee; vertical-align: top; border-right: solid 1px #eee; } -/* .calendar_week, .calendar_month { padding-bottom: 50px; width: 100%; } */ -/* .calendar_week .today, .calendar_month .today { background-color: #f5f5f5; } */ .calendar_week .offmonth, .calendar_month .offmonth { color: #ccc; } -/* .month_label { font-size: 120%; padding: 20px; margin-left: 10px; color: #999; } */ .calendar_week td { width: 14%; height: 600px; text-align: left; padding: 10px; border-bottom: solid 1px #eee; vertical-align: top; border-right: solid 1px #eee; } -.calendar .event_form { margin-top: 20px; width: 20%; } -.calendar .event_form td { padding-top: 5px; } -/* .cal_label { text-align: left; padding-right: 20px; } */ -/* .event_submit { padding-top: 15px !important; } */ -/* .cal_event { position: relative; margin-top: 5px; color: #666; } */ .event_details { cursor: pointer; z-index: 100; display: none; position: absolute; width: 300px; border: solid 1px #ddd; background-color: #fff; padding: 10px; } .event_details td { padding: 5px; border: none; height: auto; } -.cal_title { cursor: pointer; } -/* .event_title { border-bottom: solid 1px #eee; font-size: 120%; margin-bottom: 10px; } */ -/* .event_detail { padding: 10px; padding-bottom: 15px; } */ -/* .event_repeat { font-size: 90%; font-style: italic; text-align: right; } */ -.add_vcal { padding-right: 35px; float: right; margin-top: 10px; } diff --git a/modules/carddav_contacts/modules.php b/modules/carddav_contacts/modules.php index 9cb232cf60..f79d059b17 100644 --- a/modules/carddav_contacts/modules.php +++ b/modules/carddav_contacts/modules.php @@ -313,7 +313,7 @@ protected function output() { if (array_key_exists('phone_number', $current)) { $phone = $current['phone_number']; } - $form_class = 'contact_update_form'; + $form_class = 'contact_update_form mt-3'; $title = sprintf($this->trans('Update Carddav - %s'), $this->html_safe($current['source'])); $button = ''. ''; diff --git a/modules/contacts/modules.php b/modules/contacts/modules.php index ab0d6db1ae..30f98cb3d1 100644 --- a/modules/contacts/modules.php +++ b/modules/contacts/modules.php @@ -91,7 +91,7 @@ class Hm_Output_contacts_page_link extends Hm_Output_Module { protected function output() { $res = ''; if ($this->format == 'HTML5') { @@ -106,7 +106,7 @@ protected function output() { */ class Hm_Output_contacts_content_start extends Hm_Output_Module { protected function output() { - return '
    '.$this->trans('Contacts').'
    '; + return '
    '.$this->trans('Contacts').'
    '; } } @@ -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 = '
    '. - ''.$this->trans('Add').''; foreach ($addresses as $vals) { $res .= ''; } - $res .= '
    '; + $res .= '
    '; $headers = $headers.$res; } $this->out('msg_headers', $headers, false); @@ -158,7 +158,7 @@ protected function output() { } $per_page = 25; $current_page = $this->get('contact_page', 1); - $res = '
    '; + $res = '
    '; $res .= ''; $contacts = $this->get('contact_store'); $editable = $this->get('contact_edit', array()); @@ -173,28 +173,25 @@ protected function output() { $res .= ''; $res .= ''. ''. ''. - ''; $res .= '
    '.$this->trans('Contacts').'
    '. - ''.$this->trans('Send To').' '. + ' '. ''.$this->html_safe($contact->value('type')).''. ($contact->value('source') == 'local' ? '' : $this->html_safe($contact->value('source'))).''. ''.$this->html_safe($name).'
    '.$this->html_safe($contact->value('email_address')).'
    '. $this->html_safe($contact->value('phone_number')).''; + ''; if (in_array($contact->value('type').':'.$contact->value('source'), $editable, true)) { $res .= ''.$this->trans('Delete').
-                        ''. + '" class="delete_contact cursor-pointer" title="'.$this->trans('Delete').'">'. ''.$this->trans('Edit').
-                        ''; + '" class="edit_contact cursor-pointer" title="'.$this->trans('Edit').'">'; } $res .= ''. - ''.$this->trans('Send To').''; + '" class="send_to_contact cursor-pointer" title="'.$this->trans('Send To').'">'. + ''; $res .= '
    '; @@ -247,7 +244,7 @@ protected function output() { */ if (!hm_exists('build_contact_detail')) { function build_contact_detail($output_mod, $contact, $id) { - $res = '
    '; + $res = '
    '; $all_fields = false; $contacts = $contact->export(); ksort($contacts); diff --git a/modules/contacts/site.css b/modules/contacts/site.css index a8aedbea25..beb241826b 100644 --- a/modules/contacts/site.css +++ b/modules/contacts/site.css @@ -1,13 +1,3 @@ -/* .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; } @@ -15,15 +5,7 @@ .contact_pages { text-align: center; border-bottom: none !important; } .no_contact_sources { text-align: center; color: #999; font-size: 110%; margin-top: 60px; } .add_contact { margin-bottom: 30px; margin-top: 10px; color: #666; margin-right: 25px; float: left; clear: left; margin-left: 25px; width: 300px; } -/* .add_contact input, .add_contact select { margin-bottom: 10px; padding: 5px; margin-right: 5px; } */ -/* .add_contact .server_title { cursor: pointer; } */ .contact_form { margin-top: 10px; display: none; } -.add_contact .menu_caret { opacity: .7; } -.contact_update_form { margin-top: 10px; } -.contact_update_form, .contact_form { white-space: nowrap; } -.contact_detail { margin: 20px; margin-bottom: 30px; } -.contact_detail_row table { width: auto; } -.contact_detail td { border: none; } .contact_detail_row { border: none; display: none;} .display_name, .email_address, .phone_number { font-weight: bold; } .show_contact { margin-right: 15px; } diff --git a/modules/core/message_list_functions.php b/modules/core/message_list_functions.php index 0338452c52..f1cda526ec 100644 --- a/modules/core/message_list_functions.php +++ b/modules/core/message_list_functions.php @@ -386,7 +386,7 @@ function message_since_dropdown($since, $name, $output_mod) { '-1 year' => 'Last year', '-5 years' => 'Last 5 years' ); - $res = ''; $reset = ''; foreach ($times as $val => $label) { $res .= ' $max_pages) { $floor -= ($ceil - $max_pages); } - $prev = '←'; - $next = '→'; + $prev = ''; + $next = ''; if ($floor > 1 ) { $first = '1 ... '; @@ -616,10 +616,10 @@ function build_page_links($page_size, $current_page, $total, $path, $filter=fals $last = ' ... '.$max_pages.''; } if ($current_page > 1) { - $prev = '←'; + $prev = ''; } if ($max_pages > 1 && $current_page < $max_pages) { - $next = '→'; + $next = ''; } for ($i=1;$i<=$max_pages;$i++) { if ($i < $floor || $i > $ceil) { @@ -627,7 +627,7 @@ function build_page_links($page_size, $current_page, $total, $path, $filter=fals } $links .= ' '.$i.''; } diff --git a/modules/core/output_modules.php b/modules/core/output_modules.php index 5144065bbc..0c11c5c454 100644 --- a/modules/core/output_modules.php +++ b/modules/core/output_modules.php @@ -672,9 +672,9 @@ class Hm_Output_start_settings_form extends Hm_Output_Module { * Opens a div, form and table */ protected function output() { - return '
    '. + '
    '. ''; } } @@ -701,7 +701,7 @@ protected function output() { } $res = ''. - ''. - ''. - ''. - ''; + return ''. + ''; } } @@ -824,8 +824,8 @@ protected function output() { $checked = ''; $reset = ''; } - return ''. - ''; + return ''. + ''; } } @@ -843,8 +843,8 @@ protected function output() { $checked = ''; $reset = ''; } - return ''. - ''; + return ''. + ''; } } @@ -862,8 +862,8 @@ protected function output() { $checked = ''; $reset = ''; } - return ''. - ''; + return ''. + ''; } } @@ -876,8 +876,8 @@ class Hm_Output_start_flagged_settings extends Hm_Output_Module { * Settings in this section control the flagged messages view */ protected function output() { - return ''; } } @@ -894,8 +894,8 @@ protected function output() { if ($this->get('single_server_mode')) { return ''; } - return ''; } } @@ -909,8 +909,8 @@ class Hm_Output_start_unread_settings extends Hm_Output_Module { * Settings in this section control the Unread view */ protected function output() { - return ''; } } @@ -931,8 +931,8 @@ protected function output() { if ($this->get('single_server_mode')) { return ''; } - return ''; } } @@ -946,8 +946,8 @@ class Hm_Output_start_general_settings extends Hm_Output_Module { * General settings like langauge and timezone will go here */ protected function output() { - return ''; } } @@ -972,7 +972,7 @@ protected function output() { } return ''. - ''; + ''; } } @@ -1016,7 +1016,7 @@ protected function output() { } return ''. - ''; + ''; } } @@ -1063,7 +1063,7 @@ protected function output() { } return ''. - ''; + ''; } } @@ -1087,7 +1087,7 @@ protected function output() { } return ''. - ''; + ''; } } @@ -1153,7 +1153,7 @@ protected function output() { $mylang = $this->get('language', ''); $res = ''. - ''. - ''; + ''; } } @@ -1233,10 +1233,10 @@ class Hm_Output_end_settings_form extends Hm_Output_Module { */ protected function output() { return '
    '.$reset.'
    '.$reset.'
    '.$reset.'
    '.$reset.'
    '.$reset.'
    '.$reset.'
    '.$reset.'
    '.$reset.'
    '. - ''. + return '
    '. + ''. $this->trans('Flagged').'
    '. - ''. + return '
    '. + ''. $this->trans('Everything').'
    '. - ''. + return '
    '. + ''. $this->trans('Unread').'
    '. - ''. + return '
    '. + ''. $this->trans('All Email').'
    '. - ''. + return '
    '. + ''. $this->trans('General').'
    '.$reset.'
    '.$reset.'
    '.$reset.'
    '.$reset.'
    '.$reset.'
    '.$reset.'
    '.$reset.'
    '.$reset.'
    '.$reset.'
    '. - ''. - '
    '. - '
    '. - '
    '. + ''. + '
    '. + '
    '. + '
    '. '
    '; } } @@ -1315,33 +1315,33 @@ protected function output() { if (!$single) { $res .= ''; } - $res .= ''; + $res .= $this->trans('Unread').''; $res .= ''; $res .= ''; $res .= ''; $res .= ''; @@ -1360,7 +1360,7 @@ class Hm_Output_logout_menu_item extends Hm_Output_Module { protected function output() { $res = ''; @@ -1416,7 +1416,7 @@ protected function output() { if ($name == 'Email' && !$single) { $res .= ''; } @@ -1443,7 +1443,7 @@ protected function output() { '