+Sat, 19 Aug 2006 Florent Bruneau <florent.bruneau@m4x.org>
+
+ * Add shortkey browsing
+
Sat, 05 Aug 2006 Florent Bruneau <florent.bruneau@m4x.org>
* Allow browsing through unread messages
/** Format a link to be use in a link
* @ref makeLink
*/
-function makeHREF($params, $text = null, $popup = null, $class = null)
+function makeHREF($params, $text = null, $popup = null, $class = null, $accesskey = null)
{
$link = makeLink($params);
if (is_null($text)) {
$text = $link;
}
+ if (!is_null($accesskey)) {
+ $popup .= ' (raccourci : ' . $accesskey . ')';
+ }
if (!is_null($popup)) {
$popup = ' title="' . $popup . '"';
}
if (isset($params['action']) && $params['action'] == 'view') {
$target = ' target="_blank"';
}
- return '<a href="' . htmlentities($link) .'"' . $target . $popup . $class . '>' . $text . '</a>';
+ if (!is_null($accesskey)) {
+ $accesskey = ' accesskey="' . $accesskey . '"';
+ }
+
+ return '<a href="' . htmlentities($link) . '"'
+ . $target . $popup . $class . $accesskey
+ . '>' . $text . '</a>';
}
/** Format tree images links
/** Make a link using an image
*/
-function makeImgLink($params, $img, $alt, $height = null, $width = null, $class = null)
+function makeImgLink($params, $img, $alt, $height = null, $width = null, $class = null, $accesskey = null)
{
return makeHREF($params,
makeImg($img, ' [' . $alt . ']', $height, $width),
$alt,
- $class);
+ $class,
+ $accesskey);
}
/********************************************************************************
{
global $banana;
$ret = '<div class="banana_menu">';
- $actions = Array('nextUnread' => Array('next_unread', _b_('Message non-lu suivant')),
- 'prevPost' => Array('prev', _b_('Article précédent')),
- 'nextPost' => Array('next', _b_('Article suivant')),
- 'prevThread' => Array('prev_thread', _b_('Discussion précédente')),
- 'nextThread' => Array('next_thread', _b_('Discussion suivante')));
+ $actions = Array('nextUnread' => Array('next_unread', _b_('Message non-lu suivant'), 'u'),
+ 'prevPost' => Array('prev', _b_('Article précédent'), 'a'),
+ 'nextPost' => Array('next', _b_('Article suivant'), 'z'),
+ 'prevThread' => Array('prev_thread', _b_('Discussion précédente'), 'q'),
+ 'nextThread' => Array('next_thread', _b_('Discussion suivante'), 's'));
foreach ($actions as $method=>$params) {
$id = $banana->spool->$method($this->id);
if (!is_null($id)) {
$ret .= makeImgLink(Array('group' => $banana->state['group'],
'artid' => $id),
$params[0] . '.gif',
- $params[1]);
+ $params[1],
+ null, null, null,
+ $params[2]);
}
}
return $ret . '</div>';
. makeImgLink(Array('group' => $banana->state['group'],
'action' => 'new'),
'post.gif',
- _b_('Nouveau message')) . ' '
+ _b_('Nouveau message'), null, null, null, 'p') . ' '
. makeImgLink(Array('group' => $banana->state['group'],
'artid' => $this->id,
'action' => 'new'),
'reply.gif',
- _b_('Répondre'));
+ _b_('Répondre'), null, null, null, 'r');
if ($this->checkCancel()) {
$res .= ' '
. makeImgLink(Array('group' => $banana->state['group'],
'artid' => $this->id,
'action' => 'cancel'),
'cancel.gif',
- _b_('Annuler'));
+ _b_('Annuler'), null, null, null, 'c');
}
$res .= '</div>'
. formatDisplayHeader('subject', $this->headers['subject'])
{
$res = '<table class="bicol banana_thread" cellpadding="0" cellspacing="0">';
- $new = '<div class="banana_action">'
- . makeImgLink(Array('group' => $this->group,
- 'action' => 'new'),
- 'post.gif',
- _b_('Nouveau message'));
- $new .= '</div>';
-
if (is_null($_ref)) {
$next = $this->nextUnread();
if (!is_null($next)) {
. makeImgLink(Array('group' => $this->group,
'artid' => $next),
'next_unread.gif',
- _b_('Message non-lu suivant'))
+ _b_('Message non-lu suivant'), null, null, null, 'u')
. '</div>';
}
$new = '<div class="banana_action">'
. makeImgLink(Array('group' => $this->group,
'action' => 'new'),
'post.gif',
- _b_('Nouveau message'))
+ _b_('Nouveau message'), null, null, null, 'p')
. '</div>';
$res .= '<tr><th>' . $next . _b_('Date') . '</th>';