Index: view.php =================================================================== RCS file: /cvsroot/moodle/moodle/user/view.php,v retrieving revision 1.191 diff -c -r1.191 view.php *** view.php 23 Jun 2008 05:43:05 -0000 1.191 --- view.php 17 Aug 2008 07:59:36 -0000 *************** *** 5,15 **** --- 5,18 ---- require_once("../config.php"); require_once($CFG->dirroot.'/user/profile/lib.php'); require_once($CFG->dirroot.'/tag/lib.php'); + require('../message/lib.php'); $id = optional_param('id', 0, PARAM_INT); // user id $course = optional_param('course', SITEID, PARAM_INT); // course id (defaults to Site) $enable = optional_param('enable', ''); // enable email $disable = optional_param('disable', ''); // disable email + $addcontact = optional_param('addcontact', ''); + $removecontact = optional_param('removecontact', ''); if (empty($id)) { // See your own profile by default require_login(); *************** *** 489,494 **** --- 492,519 ---- echo "id', 'message_$user->id', 'menubar=0,location=0,scrollbars,status,resizable,width=400,height=500', 0);\" />"; echo ""; echo ""; + + if ($addcontact) + message_add_contact($user->id); + else if ($removecontact) + message_remove_contact($user->id); + + if ($contact = ($DB->get_record('message_contacts', array('userid'=>$USER->id, 'contactid'=>$user->id))) <> "") { + $button = get_string('removecontact', 'message'); + $action = "removecontact"; + } else { + $button = get_string('addcontact', 'message'); + $action = "addcontact"; + } + + echo "
"; + echo "
"; + echo "id. "\" />"; + echo "id. "\" />"; + echo ""; + echo ""; + echo "
"; + echo "
"; } } // Authorize.net: User Payments