Fix page title when using search filter (#1490023)

pull/216/head
Aleksander Machniak 10 years ago
parent 334bc97927
commit 02f7628314

@ -47,6 +47,7 @@ CHANGELOG Roundcube Webmail
- Optimize some framed pages content for better performance (#1489792)
- Improve text messages display and conversion to HTML (#1488937)
- Don't remove links when html signature is converted to text (#1489621)
- Fix page title when using search filter (#1490023)
- Fix mbox files import
- Fix some mime-type to extension mapping checks in Installer (#1489983)
- Fix errors when using localStorage in Safari's private browsing mode (#1489996)

@ -338,7 +338,7 @@ $labels['assistant'] = 'Assistant';
$labels['spouse'] = 'Spouse';
$labels['allfields'] = 'All fields';
$labels['search'] = 'Search';
$labels['searchfor'] = 'Search for "$q"';
$labels['searchresult'] = 'Search result';
$labels['advsearch'] = 'Advanced Search';
$labels['advanced'] = 'Advanced';
$labels['other'] = 'Other';

@ -79,6 +79,8 @@ if (empty($RCMAIL->action) || $RCMAIL->action == 'list') {
if (!empty($_SESSION['search_scope']))
$OUTPUT->set_env('search_scope', $_SESSION['search_scope']);
rcmail_list_pagetitle();
}
$threading = (bool) $RCMAIL->storage->get_threading();
@ -119,11 +121,6 @@ if (empty($RCMAIL->action) || $RCMAIL->action == 'list') {
'flagged', 'unflagged', 'unread', 'deleted', 'replied', 'forwarded',
'priority', 'withattachment', 'fileuploaderror');
}
$pagetitle = $RCMAIL->localize_foldername($mbox_name, true);
$pagetitle = str_replace($delimiter, " \xC2\xBB ", $pagetitle);
$OUTPUT->set_pagetitle($pagetitle);
}
// register UI objects
@ -217,6 +214,26 @@ function rcmail_init_env()
$RCMAIL->storage->set_threading($threading);
}
/**
* Sets page title
*/
function rcmail_list_pagetitle()
{
global $RCMAIL;
if ($RCMAIL->output->get_env('search_request')) {
$pagetitle = $RCMAIL->gettext('searchresult');
}
else {
$mbox_name = $RCMAIL->storage->get_folder();
$delimiter = $RCMAIL->storage->get_hierarchy_delimiter();
$pagetitle = $RCMAIL->localize_foldername($mbox_name, true);
$pagetitle = str_replace($delimiter, " \xC2\xBB ", $pagetitle);
}
$RCMAIL->output->set_pagetitle($pagetitle);
}
/**
* Returns default search mods
*/

@ -81,6 +81,7 @@ if ($count = $RCMAIL->storage->count($mbox_name, $threading ? 'THREADS' : 'ALL',
if (!empty($_REQUEST['_search']) && isset($_SESSION['search'])
&& $_SESSION['search_request'] == $_REQUEST['_search']
) {
$search_request = $_REQUEST['_search'];
$_SESSION['search'] = $RCMAIL->storage->get_search_set();
}
// remove old search data
@ -88,13 +89,12 @@ else if (empty($_REQUEST['_search']) && isset($_SESSION['search'])) {
$RCMAIL->session->remove('search');
}
// empty result? we'll skip UNSEEN counting in rcmail_send_unread_count()
if (empty($search_request) && empty($a_headers)) {
$unseen = 0;
}
rcmail_list_pagetitle();
// update mailboxlist
rcmail_send_unread_count($mbox_name, !empty($_REQUEST['_refresh']), $unseen);
if (empty($search_request)) {
rcmail_send_unread_count($mbox_name, !empty($_REQUEST['_refresh']), empty($a_headers) ? 0 : null);
}
// update message count display
$pages = ceil($count/$RCMAIL->storage->get_pagesize());

@ -187,8 +187,6 @@ else {
}
}
$OUTPUT->set_pagetitle($RCMAIL->gettext(array('name' => 'searchfor', 'vars' => array('q' => $str))));
// update message count display
$OUTPUT->set_env('search_request', $search_str ? $search_request : '');
$OUTPUT->set_env('search_filter', $_SESSION['search_filter']);
@ -198,6 +196,13 @@ $OUTPUT->set_env('pagecount', ceil($count/$RCMAIL->storage->get_pagesize()));
$OUTPUT->set_env('exists', $mbox === null ? 0 : $RCMAIL->storage->count($mbox, 'EXISTS'));
$OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($count, 1), $mbox);
rcmail_list_pagetitle();
// update unseen messages count
if (empty($search_str)) {
rcmail_send_unread_count($mbox, false, empty($result_h) ? 0 : null);
}
if (!$result->incomplete) {
$OUTPUT->command('set_quota', $RCMAIL->quota_content(null, $result->multi ? 'INBOX' : $mbox));
}

Loading…
Cancel
Save