* Add new address *
**************************************************/
if (isset($addaddr)) {
- foreach( $addaddr as $k => $adr ) {
- $addaddr[$k] = strip_tags( $adr );
+ if (isset($backend)) {
+ $r = $abook->add($addaddr, $backend);
+ } else {
+ $r = $abook->add($addaddr, $abook->localbackend);
}
- if (isset($backend)) {
- $r = $abook->add($addaddr, $backend);
- } else {
- $r = $abook->add($addaddr, $abook->localbackend);
- }
/* Handle error messages */
if (!$r) {
/* Check if this user is selected */
$selected = in_array($row['backend'] . ':' . $row['nickname'], $defselected);
- /* Print one row */
- $tr_bgcolor = '';
- if ($line % 2) { $tr_bgcolor = $color[0]; }
+ /* Print one row, with alternating color */
+ if ($line % 2) {
+ $tr_bgcolor = $color[12];
+ } else {
+ $tr_bgcolor = $color[4];
+ }
if ($squirrelmail_language == 'ja_JP')
{
- echo html_tag( 'tr', '', '', $tr_bgcolor) .
- html_tag( 'td',
+ echo html_tag( 'tr', '', '', $tr_bgcolor);
+ if ($abook->backends[$row['backend']]->writeable) {
+ echo html_tag( 'td',
'<small>' .
addCheckBox('sel[]', $selected, $row['backend'].':'.$row['nickname']).
'</small>' ,
- 'center', '', 'valign="top" width="1%"' ) .
- html_tag( 'td', ' ' . $row['nickname'] . ' ', 'left', '', 'valign="top" width="1%" nowrap' ) .
+ 'center', '', 'valign="top" width="1%"' );
+ } else {
+ echo html_tag( 'td',
+ ' ' ,
+ 'center', '', 'valign="top" width="1%"' );
+ }
+ echo html_tag( 'td', ' ' . $row['nickname'] . ' ', 'left', '', 'valign="top" width="1%" nowrap' ) .
html_tag( 'td', ' ' . $row['lastname'] . ' ' . $row['firstname'] . ' ', 'left', '', 'valign="top" width="1%" nowrap' ) .
html_tag( 'td', '', 'left', '', 'valign="top" width="1%" nowrap' ) . ' ';
} else {
- echo html_tag( 'tr', '', '', $tr_bgcolor) .
- html_tag( 'td',
+ echo html_tag( 'tr', '', '', $tr_bgcolor);
+ if ($abook->backends[$row['backend']]->writeable) {
+ echo html_tag( 'td',
'<small>' .
'<input type=checkbox ' . $selected . ' name="sel[]" value="' .
$row['backend'] . ':' . $row['nickname'] . '" /></small>' ,
- 'center', '', 'valign="top" width="1%"' ) .
- html_tag( 'td', ' ' . $row['nickname'] . ' ', 'left', '', 'valign="top" width="1%" nowrap' ) .
+ 'center', '', 'valign="top" width="1%"' );
+ } else {
+ echo html_tag( 'td',
+ ' ' ,
+ 'center', '', 'valign="top" width="1%"' );
+ }
+ echo html_tag( 'td', ' ' . $row['nickname'] . ' ', 'left', '', 'valign="top" width="1%" nowrap' ) .
html_tag( 'td', ' ' . $row['name'] . ' ', 'left', '', 'valign="top" width="1%" nowrap' ) .
html_tag( 'td', '', 'left', '', 'valign="top" width="1%" nowrap' ) . ' ';
}
do_hook('addressbook_bottom');
?>
-</body></html>
\ No newline at end of file
+</body></html>