From: moodler Date: Wed, 5 Jan 2005 15:31:43 +0000 (+0000) Subject: SOme code tidyups, and fixes for missing langauge strings as per bug 2340 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=e8481594132a42341118ac789276b5b5be43fdb0;p=moodle.git SOme code tidyups, and fixes for missing langauge strings as per bug 2340 --- diff --git a/lang/en/message.php b/lang/en/message.php index 0ffd165668..bfd7346994 100644 --- a/lang/en/message.php +++ b/lang/en/message.php @@ -9,6 +9,7 @@ $string['beepnewmessage'] = 'Beep when a new message comes in'; $string['blockcontact'] = 'Block contact'; $string['blockedmessages'] = '$a message(s) to/from blocked users'; $string['context'] = 'context'; +$string['contacts'] = 'Contacts'; $string['deletemessagesdays'] = 'Number of days before old messages are automatically deleted'; $string['discussion'] = 'Discussion'; $string['emailmessages'] = 'Email messages when I am offline'; @@ -39,10 +40,12 @@ $string['onlytome'] = 'Only messages to me'; $string['pagerefreshes'] = 'This page refreshes automatically every $a seconds'; $string['removecontact'] = 'Remove contact'; $string['savemysettings'] = 'Save my settings'; +$string['search'] = 'Search'; $string['searchforperson'] = 'Search for a person'; $string['searchmessages'] = 'Search messages'; $string['sendmessage'] = 'Send message'; $string['sendmessageto'] = 'Send message to $a'; +$string['settings'] = 'Settings'; $string['settingssaved'] = 'Your settings have been saved'; $string['showmessagewindow'] = 'Automatically show Message window when I get new messages (your browser needs to be set so that it doesn\'t block popups on this site)'; $string['strftimedaydatetime'] = '%%A, %%d %%B %%Y, %%I:%%M %%p'; diff --git a/message/index.php b/message/index.php index 824e5619df..f00b30f6b8 100644 --- a/message/index.php +++ b/message/index.php @@ -1,76 +1,75 @@ -'."\n openpopup('/message/index.php', 'message', 'menubar=0,location=0,scrollbars,status,resizable,width=400,height=500', 0);\n"; - redirect("$CFG->wwwroot/"); - exit; -} +/// Popup a window if required and quit (usually from external links). + if ($popup) { + print_header(); + echo '"; + redirect("$CFG->wwwroot/"); + exit; + } -if ($addcontact and confirm_sesskey()) { - add_to_log(SITEID, 'message', 'add contact', 'history.php?user1='.$addcontact.'&user2='.$USER->id, $addcontact); - message_add_contact($addcontact); -} -if ($removecontact and confirm_sesskey()) { - add_to_log(SITEID, 'message', 'remove contact', 'history.php?user1='.$removecontact.'&user2='.$USER->id, $removecontact); - message_remove_contact($removecontact); -} -if ($blockcontact and confirm_sesskey()) { - add_to_log(SITEID, 'message', 'block contact', 'history.php?user1='.$blockcontact.'&user2='.$USER->id, $blockcontact); - message_block_contact($blockcontact); -} -if ($unblockcontact and confirm_sesskey()) { - add_to_log(SITEID, 'message', 'unblock contact', 'history.php?user1='.$unblockcontact.'&user2='.$USER->id, $unblockcontact); - message_unblock_contact($unblockcontact); -} +/// Process any contact maintenance requests there may be + if ($addcontact and confirm_sesskey()) { + add_to_log(SITEID, 'message', 'add contact', 'history.php?user1='.$addcontact.'&user2='.$USER->id, $addcontact); + message_add_contact($addcontact); + } + if ($removecontact and confirm_sesskey()) { + add_to_log(SITEID, 'message', 'remove contact', 'history.php?user1='.$removecontact.'&user2='.$USER->id, $removecontact); + message_remove_contact($removecontact); + } + if ($blockcontact and confirm_sesskey()) { + add_to_log(SITEID, 'message', 'block contact', 'history.php?user1='.$blockcontact.'&user2='.$USER->id, $blockcontact); + message_block_contact($blockcontact); + } + if ($unblockcontact and confirm_sesskey()) { + add_to_log(SITEID, 'message', 'unblock contact', 'history.php?user1='.$unblockcontact.'&user2='.$USER->id, $unblockcontact); + message_unblock_contact($unblockcontact); + } -/// a print function is associated with each tab -$tabprintfunction = 'message_print_'.$tab; - +/// Header on this page + if ($tab == 'contacts') { + print_header(get_string('messages', 'message').' - '.$SITE->fullname, '', '', '', + ''); + } else { + print_header(get_string('messages', 'message').' - '.$SITE->fullname); + } -if ($tab == 'contacts') { - print_header(get_string('messages', 'message').' - '.$SITE->fullname, '', '', '', - ''); -} else { - print_header(get_string('messages', 'message').' - '.$SITE->fullname); -} + echo ''; + echo ''; -?> +/// Print out all tabs with labels and colours + $tabs = array('contacts','search','settings'); + foreach ($tabs as $thistab) { + $classname = ($tab == $thistab) ? 'generaltabselected' : 'generaltab'; + echo ''; + } + echo ''; -
'; + echo get_string($thistab,'message'); + echo '
- - - - - - - - -
- contacts - - search - - settings -
- -
+/// Print out contents of the tab + echo ''; +/// a print function is associated with each tab + $tabprintfunction = 'message_print_'.$tab; + if (function_exists($tabprintfunction)) { + $tabprintfunction(); + } - - + echo ' '; + echo ' ';