MDL-20700 coding style cleanup - cvs keywords removed, closign php tag removed, trailing whitespace cleanup
This commit is contained in:
@@ -84,7 +84,7 @@
|
||||
scrolling="yes" marginwidth="10" marginheight="10" frameborder="0" />
|
||||
<frame src="refresh.php?id=<?php p($user->id)?>&name=<?php echo urlencode(fullname($user)) ?>" name="refresh"
|
||||
scrolling="no" marginwidth="0" marginheight="0" frameborder="0" />
|
||||
|
||||
|
||||
<frame src="send.php?id=<?php p($user->id)?>" name="send"
|
||||
scrolling="no" marginwidth="2" marginheight="2" frameborder="0" />
|
||||
</frameset>
|
||||
@@ -233,7 +233,7 @@
|
||||
$options = new object();
|
||||
$options->para = false;
|
||||
$options->newlines = true;
|
||||
|
||||
|
||||
$params = array('uid1'=>$USER->id ,'userid1'=>$userid, 'start1'=>$start, 'uid2'=>$USER->id ,'userid2'=>$userid, 'start2'=>$start);
|
||||
if ($newonly) {
|
||||
$lastsql1 = " AND timecreated > :last1";
|
||||
@@ -249,7 +249,7 @@
|
||||
if ($messages = $DB->get_records_select('message_read', "(useridto = :uid1 AND useridfrom = :userid1 AND timeread > :start1 $lastsql1) OR (useridto = :userid2 AND useridfrom = :uid2 AND timeread > :start2 $lastsql2)", $params)) {
|
||||
foreach ($messages as $message) {
|
||||
$time = userdate($message->timecreated, get_string('strftimedatetimeshort'));
|
||||
|
||||
|
||||
if ($message->useridfrom == $USER->id) {
|
||||
$fullname = $mefullname;
|
||||
} else {
|
||||
@@ -277,7 +277,7 @@
|
||||
if ($messages = $DB->get_records_select('message', "useridto = :userid1 AND useridfrom = :uid1 $lastsql1", $params)) {
|
||||
foreach ($messages as $message) {
|
||||
$time = userdate($message->timecreated, get_string('strftimedatetimeshort'));
|
||||
|
||||
|
||||
if ($message->fullmessageformat == FORMAT_HTML){
|
||||
$printmessage = format_text($message->fullmessagehtml, $message->fullmessageformat, $options, 0);
|
||||
} else{
|
||||
@@ -296,11 +296,11 @@
|
||||
}
|
||||
}
|
||||
/*Get still to be read message, use message/lib.php funtion*/
|
||||
$messages = message_get_popup_messages($USER->id, $userid);
|
||||
$messages = message_get_popup_messages($USER->id, $userid);
|
||||
if ($messages) {
|
||||
foreach ($messages as $message) {
|
||||
$time = userdate($message->timecreated, get_string('strftimedatetimeshort'));
|
||||
|
||||
|
||||
if ($message->fullmessageformat == FORMAT_HTML){
|
||||
$printmessage = format_text($message->fullmessagehtml, $message->fullmessageformat, $options, 0);
|
||||
} else{
|
||||
@@ -316,7 +316,7 @@
|
||||
$sortkey = $message->timecreated."$i";
|
||||
}
|
||||
$allmessages[$sortkey] = $printmessage;
|
||||
|
||||
|
||||
if ($message->timecreated < $start) {
|
||||
$start = $message->timecreated; // move start back so that we see all current history
|
||||
}
|
||||
|
||||
+4
-5
@@ -45,7 +45,7 @@ if (!$course = $DB->get_record('course', array('id' => $course))) {
|
||||
if ($course->id != SITEID) {
|
||||
require_login($course);
|
||||
|
||||
} else {
|
||||
} else {
|
||||
if (!isloggedin()) {
|
||||
if (empty($SESSION->wantsurl)) {
|
||||
$SESSION->wantsurl = $CFG->httpswwwroot.'/message/edit.php';
|
||||
@@ -132,7 +132,7 @@ if (($form = data_submitted()) && confirm_sesskey()) {
|
||||
redirect("$CFG->wwwroot/message/edit.php?id=$user->id&course=$course->id");
|
||||
}
|
||||
|
||||
/// Load preferences
|
||||
/// Load preferences
|
||||
$preferences = new object();
|
||||
|
||||
/// Get providers preferences
|
||||
@@ -153,7 +153,7 @@ foreach ( $providers as $providerid => $provider){
|
||||
|
||||
/// For every processors put its options on the form (need to get function from processor's lib.php)
|
||||
$processors = $DB->get_records('message_processors');
|
||||
foreach ( $processors as $processorid => $processor){
|
||||
foreach ( $processors as $processorid => $processor){
|
||||
$processorfile = $CFG->dirroot. '/message/output/'.$processor->name.'/message_output_'.$processor->name.'.php';
|
||||
if ( is_readable($processorfile) ) {
|
||||
include_once( $processorfile );
|
||||
@@ -172,7 +172,7 @@ $streditmymessage = get_string('editmymessage', 'message');
|
||||
$strparticipants = get_string('participants');
|
||||
$userfullname = fullname($user, true);
|
||||
|
||||
if (has_capability('moodle/course:viewparticipants', $coursecontext) ||
|
||||
if (has_capability('moodle/course:viewparticipants', $coursecontext) ||
|
||||
has_capability('moodle/site:viewparticipants', $systemcontext)) {
|
||||
$PAGE->navbar->add($strparticipants, new moodle_url($CFG->wwwroot.'/message/index.php', array('id'=>$course->id)));
|
||||
}
|
||||
@@ -267,4 +267,3 @@ echo "</form>";
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
?>
|
||||
+1
-2
@@ -22,7 +22,7 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @package message
|
||||
*/
|
||||
|
||||
|
||||
require('../config.php');
|
||||
require('lib.php');
|
||||
|
||||
@@ -131,4 +131,3 @@ if ($messages = message_get_history($user1, $user2)) {
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
?>
|
||||
+5
-6
@@ -102,21 +102,21 @@ if ($tab == 'contacts') {
|
||||
$PAGE->set_generaltype('popup');
|
||||
$PAGE->set_title(get_string('messages', 'message').' - '.format_string($SITE->fullname));
|
||||
echo $OUTPUT->header();
|
||||
echo '<table cellspacing="2" cellpadding="2" border="0" width="95%" class="boxaligncenter">';
|
||||
echo '<table cellspacing="2" cellpadding="2" border="0" width="95%" class="boxaligncenter">';
|
||||
echo '<tr>';
|
||||
|
||||
/// Print out the tabs
|
||||
echo '<td>';
|
||||
$tabrow = array();
|
||||
$tabrow[] = new tabobject('contacts', $CFG->wwwroot.'/message/index.php?tab=contacts',
|
||||
$tabrow[] = new tabobject('contacts', $CFG->wwwroot.'/message/index.php?tab=contacts',
|
||||
get_string('contacts', 'message'));
|
||||
$tabrow[] = new tabobject('search', $CFG->wwwroot.'/message/index.php?tab=search',
|
||||
$tabrow[] = new tabobject('search', $CFG->wwwroot.'/message/index.php?tab=search',
|
||||
get_string('search', 'message'));
|
||||
$tabrow[] = new tabobject('settings', $CFG->wwwroot.'/message/index.php?tab=settings',
|
||||
$tabrow[] = new tabobject('settings', $CFG->wwwroot.'/message/index.php?tab=settings',
|
||||
get_string('settings', 'message'));
|
||||
$tabrows = array($tabrow);
|
||||
|
||||
print_tabs($tabrows, $tab);
|
||||
print_tabs($tabrows, $tab);
|
||||
|
||||
echo '</td>';
|
||||
|
||||
@@ -135,4 +135,3 @@ if (function_exists($tabprintfunction)) {
|
||||
echo '</td> </tr> </table>';
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
?>
|
||||
+14
-14
@@ -59,14 +59,14 @@ function message_print_contacts() {
|
||||
$strangers = array();
|
||||
|
||||
|
||||
// get all in our contactlist who are not blocked in our contact list
|
||||
// get all in our contactlist who are not blocked in our contact list
|
||||
// and count messages we have waiting from each of them
|
||||
$contactsql = "SELECT u.id, u.firstname, u.lastname, u.picture,
|
||||
$contactsql = "SELECT u.id, u.firstname, u.lastname, u.picture,
|
||||
u.imagealt, u.lastaccess, count(m.id) as messagecount
|
||||
FROM {message_contacts} mc
|
||||
JOIN {user} u ON u.id = mc.contactid
|
||||
LEFT OUTER JOIN {message} m ON m.useridfrom = mc.contactid AND m.useridto = ?
|
||||
WHERE mc.userid = ? AND mc.blocked = 0
|
||||
WHERE mc.userid = ? AND mc.blocked = 0
|
||||
GROUP BY u.id, u.firstname, u.lastname, u.picture,
|
||||
u.imagealt, u.lastaccess
|
||||
ORDER BY u.firstname ASC";
|
||||
@@ -88,12 +88,12 @@ function message_print_contacts() {
|
||||
|
||||
// get messages from anyone who isn't in our contact list and count the number
|
||||
// of messages we have from each of them
|
||||
$strangersql = "SELECT u.id, u.firstname, u.lastname, u.picture,
|
||||
$strangersql = "SELECT u.id, u.firstname, u.lastname, u.picture,
|
||||
u.imagealt, u.lastaccess, count(m.id) as messagecount
|
||||
FROM {message} m
|
||||
JOIN {user} u ON u.id = m.useridfrom
|
||||
LEFT OUTER JOIN {message_contacts} mc ON mc.contactid = m.useridfrom AND mc.userid = m.useridto
|
||||
WHERE mc.id IS NULL AND m.useridto = ?
|
||||
WHERE mc.id IS NULL AND m.useridto = ?
|
||||
GROUP BY u.id, u.firstname, u.lastname, u.picture,
|
||||
u.imagealt, u.lastaccess
|
||||
ORDER BY u.firstname ASC";
|
||||
@@ -532,7 +532,7 @@ function message_print_user ($user=false, $iscontact=false, $isblocked=false) {
|
||||
$userpic = moodle_user_picture::make($USER, SITEID);
|
||||
$userpic->size = 20;
|
||||
$userpic->link = true;
|
||||
|
||||
|
||||
if ($user === false) {
|
||||
echo $OUTPUT->user_picture($userpic);
|
||||
} else {
|
||||
@@ -584,7 +584,7 @@ function message_contact_link($userid, $linktype='add', $return=false, $script="
|
||||
|
||||
$command = $linktype.'contact';
|
||||
$string = $str->{$command};
|
||||
$alttext = $text ? '' : $string;
|
||||
$alttext = $text ? '' : $string;
|
||||
$text = $text ? ' '.$string : '';
|
||||
|
||||
switch ($linktype) {
|
||||
@@ -712,7 +712,7 @@ function message_search_users($courseid, $searchtext, $sort='', $exceptions='')
|
||||
return $DB->get_records_sql("SELECT $fields
|
||||
FROM {user} u
|
||||
LEFT JOIN {message_contacts} mc
|
||||
ON mc.contactid = u.id AND mc.userid = ?
|
||||
ON mc.contactid = u.id AND mc.userid = ?
|
||||
WHERE $select
|
||||
AND ($fullname $LIKE ?)
|
||||
$except
|
||||
@@ -728,7 +728,7 @@ function message_search_users($courseid, $searchtext, $sort='', $exceptions='')
|
||||
FROM {user} u
|
||||
JOIN {role_assignments} ra ON ra.userid = u.id
|
||||
LEFT JOIN {message_contacts} mc
|
||||
ON mc.contactid = u.id AND mc.userid = ?
|
||||
ON mc.contactid = u.id AND mc.userid = ?
|
||||
WHERE $select
|
||||
AND ra.contextid $contextlists
|
||||
AND ($fullname $LIKE ?)
|
||||
@@ -1011,7 +1011,7 @@ function message_format_message(&$message, &$user, $format='', $keywords='', $cl
|
||||
*/
|
||||
function message_post_message($userfrom, $userto, $message, $format, $messagetype) {
|
||||
global $CFG, $SITE, $USER, $DB;
|
||||
|
||||
|
||||
$eventdata = new object();
|
||||
$eventdata->component = 'message';
|
||||
$eventdata->name = 'instantmessage';
|
||||
@@ -1045,7 +1045,7 @@ function message_get_participants() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Print a row of contactlist displaying user picture, messages waiting and
|
||||
* Print a row of contactlist displaying user picture, messages waiting and
|
||||
* block links etc
|
||||
* @param $contact contact object containing all fields required for $OUTPUT->user_picture()
|
||||
* @param $incontactlist is the user a contact of ours?
|
||||
@@ -1078,7 +1078,7 @@ function message_print_contactlist_user($contact, $incontactlist = true){
|
||||
echo $OUTPUT->user_picture($userpic);
|
||||
echo '</td>';
|
||||
echo '<td class="contact">';
|
||||
|
||||
|
||||
$popupoptions = array(
|
||||
'height' => 500,
|
||||
'width' => 500,
|
||||
@@ -1126,7 +1126,7 @@ function message_move_userfrom_unread2read($userid) {
|
||||
|
||||
function message_get_popup_messages($destuserid, $fromuserid=NULL){
|
||||
global $DB;
|
||||
|
||||
|
||||
$processor = $DB->get_record('message_processors', array('name' => 'popup'));
|
||||
|
||||
$messagesproc = $DB->get_records('message_working', array('processorid'=>$processor->id), 'id ASC');
|
||||
@@ -1144,7 +1144,7 @@ function message_get_popup_messages($destuserid, $fromuserid=NULL){
|
||||
$message->timeread = time();
|
||||
$messageid = $message->id;
|
||||
unset($message->id);
|
||||
|
||||
|
||||
//delete what we've processed and check if can move message
|
||||
$DB->delete_records('message_working', array('id' => $msgp->id));
|
||||
if ( $DB->count_records('message_working', array('unreadmessageid'=>$messageid)) == 0){
|
||||
|
||||
@@ -31,5 +31,4 @@ $PAGE->set_title(get_string('messages', 'message').' - '.format_string($SITE->fu
|
||||
echo $OUTPUT->header();
|
||||
echo "<div id='messages'></div>";
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
?>
|
||||
|
||||
|
||||
@@ -27,9 +27,8 @@
|
||||
* Upgrade code for email message processor
|
||||
*
|
||||
* @author Luis Rodrigues
|
||||
* @version $Id$
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
|
||||
* @package
|
||||
* @package
|
||||
*/
|
||||
|
||||
function xmldb_message_email_upgrade($oldversion) {
|
||||
@@ -52,4 +51,4 @@ function xmldb_message_email_upgrade($oldversion) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
@@ -27,9 +27,8 @@
|
||||
* Email message processor - lib file
|
||||
*
|
||||
* @author Luis Rodrigues
|
||||
* @version $Id$
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
|
||||
* @package
|
||||
* @package
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,9 +27,8 @@
|
||||
* Email message processor - send a given message by email
|
||||
*
|
||||
* @author Luis Rodrigues
|
||||
* @version $Id$
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
|
||||
* @package
|
||||
* @package
|
||||
*/
|
||||
require_once($CFG->dirroot.'/message/output/lib.php');
|
||||
|
||||
@@ -57,7 +56,7 @@ class message_output_email extends message_output {
|
||||
$message->fullmessagehtml)
|
||||
){
|
||||
/// Move the entry to the other table
|
||||
$message->timeread = time();
|
||||
$message->timeread = time();
|
||||
$messageid = $message->id;
|
||||
unset($message->id);
|
||||
|
||||
@@ -78,11 +77,11 @@ class message_output_email extends message_output {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Creates necessary fields in the messaging config form.
|
||||
* @param object $mform preferences form class
|
||||
*/
|
||||
function config_form($preferences){
|
||||
function config_form($preferences){
|
||||
global $USER;
|
||||
$string = get_string('email').': <input size="30" name="email_email" value="'.$preferences->email_email.'" />';
|
||||
if (empty($preferences->email_email)) {
|
||||
@@ -94,15 +93,15 @@ class message_output_email extends message_output {
|
||||
/**
|
||||
* Parses the form submited data and saves it into preferences array.
|
||||
* @param object $mform preferences form class
|
||||
* @param array $preferences preferences array
|
||||
* @param array $preferences preferences array
|
||||
*/
|
||||
function process_form($form, &$preferences){
|
||||
$preferences['message_processor_email_email'] = $form->email_email;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the config data from database to put on the form (initial load)
|
||||
* @param array $preferences preferences array
|
||||
* Loads the config data from database to put on the form (initial load)
|
||||
* @param array $preferences preferences array
|
||||
* @param int $userid the user id
|
||||
*/
|
||||
function load_data(&$preferences, $userid){
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
* Email processor version information
|
||||
*
|
||||
* @author Luis Rodrigues
|
||||
* @version $Id$
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
|
||||
* @package
|
||||
*/
|
||||
@@ -36,4 +35,4 @@
|
||||
$plugin->version = 2008072401;
|
||||
$plugin->requires = 2008072401;
|
||||
|
||||
?>
|
||||
|
||||
|
||||
@@ -27,9 +27,8 @@
|
||||
* Upgrade code for jabber message processor
|
||||
*
|
||||
* @author Luis Rodrigues
|
||||
* @version $Id$
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
|
||||
* @package
|
||||
* @package
|
||||
*/
|
||||
|
||||
function xmldb_message_jabber_upgrade($oldversion) {
|
||||
@@ -52,4 +51,4 @@ function xmldb_message_jabber_upgrade($oldversion) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
@@ -27,9 +27,8 @@
|
||||
* Jabber message processor - lib file
|
||||
*
|
||||
* @author Luis Rodrigues
|
||||
* @version $Id$
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
|
||||
* @package
|
||||
* @package
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,9 +27,8 @@
|
||||
* Jabber message processor - send a given message by jabber
|
||||
*
|
||||
* @author Luis Rodrigues
|
||||
* @version $Id$
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
|
||||
* @package
|
||||
* @package
|
||||
*/
|
||||
|
||||
|
||||
@@ -43,7 +42,7 @@ require_once($CFG->dirroot.'/message/output/lib.php');
|
||||
require_once($CFG->libdir.'/jabber/XMPP/XMPP.php');
|
||||
|
||||
class message_output_jabber extends message_output {
|
||||
|
||||
|
||||
/**
|
||||
* Processes the message (sends using jabber).
|
||||
* @param object $message the message to be sent
|
||||
@@ -51,7 +50,7 @@ class message_output_jabber extends message_output {
|
||||
*/
|
||||
function send_message($message){
|
||||
global $DB;
|
||||
|
||||
|
||||
if (!$userfrom = $DB->get_record('user', array('id' => $message->useridfrom))) {
|
||||
return false;
|
||||
}
|
||||
@@ -74,11 +73,11 @@ class message_output_jabber extends message_output {
|
||||
} catch(XMPPHP_Exception $e) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Creates necessary fields in the messaging config form.
|
||||
* @param object $mform preferences form class
|
||||
*/
|
||||
@@ -89,15 +88,15 @@ class message_output_jabber extends message_output {
|
||||
/**
|
||||
* Parses the form submited data and saves it into preferences array.
|
||||
* @param object $mform preferences form class
|
||||
* @param array $preferences preferences array
|
||||
* @param array $preferences preferences array
|
||||
*/
|
||||
function process_form($form, &$preferences){
|
||||
$preferences['message_processor_jabber_jabberid'] = $form->jabber_jabberid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads the config data from database to put on the form (initial load)
|
||||
* @param array $preferences preferences array
|
||||
* Loads the config data from database to put on the form (initial load)
|
||||
* @param array $preferences preferences array
|
||||
* @param int $userid the user id
|
||||
*/
|
||||
function load_data(&$preferences, $userid){
|
||||
@@ -107,7 +106,7 @@ class message_output_jabber extends message_output {
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
* $f = fopen('/tmp/event_jabberx', 'a+');
|
||||
fwrite($f, date('l dS \of F Y h:i:s A')."\n");
|
||||
fwrite($f, "from: $message->userfromid\n");
|
||||
@@ -128,4 +127,4 @@ $a = new message_output_jabber();
|
||||
|
||||
$a->send_message($savemessage);
|
||||
* */
|
||||
?>
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
* Jabber processor version information
|
||||
*
|
||||
* @author Luis Rodrigues
|
||||
* @version $Id$
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
|
||||
* @package
|
||||
*/
|
||||
@@ -35,4 +34,4 @@
|
||||
$plugin->version = 2008090900;
|
||||
$plugin->requires = 2008091500;
|
||||
|
||||
?>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php // $Id$
|
||||
<?php
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// //
|
||||
@@ -27,15 +27,14 @@
|
||||
* Base message output class
|
||||
*
|
||||
* @author Luis Rodrigues
|
||||
* @version $Id$
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
|
||||
* @package
|
||||
* @package
|
||||
*/
|
||||
|
||||
/**
|
||||
* Base message output class
|
||||
*/
|
||||
abstract class message_output {
|
||||
abstract class message_output {
|
||||
public abstract function send_message($message);
|
||||
public abstract function process_form($form, &$preferences);
|
||||
public abstract function load_data(&$preferences, $userid);
|
||||
@@ -43,4 +42,4 @@ abstract class message_output {
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
@@ -27,9 +27,8 @@
|
||||
* Upgrade code for popup message processor
|
||||
*
|
||||
* @author Luis Rodrigues
|
||||
* @version $Id$
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
|
||||
* @package
|
||||
* @package
|
||||
*/
|
||||
|
||||
function xmldb_message_popup_upgrade($oldversion) {
|
||||
@@ -52,4 +51,4 @@ function xmldb_message_popup_upgrade($oldversion) {
|
||||
return $result;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
@@ -27,9 +27,8 @@
|
||||
* Popup message processor - lib file
|
||||
*
|
||||
* @author Luis Rodrigues
|
||||
* @version $Id$
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
|
||||
* @package
|
||||
* @package
|
||||
*/
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,17 +28,17 @@ require_once($CFG->dirroot.'/message/output/lib.php');
|
||||
|
||||
class message_output_popup extends message_output{
|
||||
|
||||
/**
|
||||
/**
|
||||
* Process the popup message.
|
||||
* The popup doesn't send data only saves in the database for later use,
|
||||
* the popup_interface.php takes the message from the message table into
|
||||
* The popup doesn't send data only saves in the database for later use,
|
||||
* the popup_interface.php takes the message from the message table into
|
||||
* the message_read.
|
||||
* @param object $message the message to be sent
|
||||
* @return true if ok, false if error
|
||||
*/
|
||||
public function send_message($message) {
|
||||
global $DB;
|
||||
|
||||
|
||||
//put the process record into db
|
||||
$processor = $DB->get_record('message_processors', array('name'=>'popup'));
|
||||
$procmessage = new object();
|
||||
@@ -50,7 +50,7 @@ class message_output_popup extends message_output{
|
||||
//should only save this message for later delivery
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
function config_form($preferences) {
|
||||
return '<table>'.
|
||||
'<tr><td align="right">'.get_string('showmessagewindow', 'message').':</td><td><input type="checkbox" name="showmessagewindow" '.($preferences->showmessagewindow==1?" checked=\"checked\"":"").' /></td></tr>'.
|
||||
@@ -59,7 +59,7 @@ class message_output_popup extends message_output{
|
||||
'<tr><td align="right">'.get_string('noframesjs', 'message').':</td><td><input type="checkbox" name="noframesjs" '.($preferences->noframesjs==1?" checked=\"checked\"":"").' /></td></tr>'.
|
||||
'</table>';
|
||||
}
|
||||
|
||||
|
||||
public function process_form($form, &$preferences) {
|
||||
$preferences['message_showmessagewindow'] = $form->showmessagewindow?1:0;
|
||||
$preferences['message_blocknoncontacts'] = $form->blocknoncontacts?1:0;
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
* Popup processor version information
|
||||
*
|
||||
* @author Luis Rodrigues
|
||||
* @version $Id$
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
|
||||
* @package
|
||||
*/
|
||||
@@ -35,4 +34,4 @@
|
||||
$plugin->version = 2008072401;
|
||||
$plugin->requires = 2008072401;
|
||||
|
||||
?>
|
||||
|
||||
|
||||
@@ -91,4 +91,3 @@ $PAGE->requires->js_function_call('refresh_page', Array(($wait*1000), "refresh.p
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
?>
|
||||
+6
-6
@@ -18,7 +18,7 @@
|
||||
<td colspan="2">
|
||||
<input type="checkbox" name="mycourses" id="mycourses" /><label for="mycourses"><?php print_string('onlymycourses', 'message') ?></label></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr><td colspan="3"></td></tr>
|
||||
|
||||
|
||||
@@ -30,29 +30,29 @@
|
||||
<td><input type="text" name="keywords" id="keywords" size="16" /></td>
|
||||
<td><input type="submit" name="keywordssubmit" value="<?php print_string('search') ?>" /></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td colspan="2">
|
||||
<input type="checkbox" name="includeblocked" id="includeblocked" /><label for="includeblocked"><?php print_string('includeblockedusers', 'message') ?></label></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr><td> </td><td colspan="2"><input type="radio" name="keywordsoption" id="keywordsoption1" value="tome" /><label for="keywordsoption1"><?php print_string('onlytome', 'message') ?></label></td></tr>
|
||||
<tr><td> </td><td colspan="2"><input type="radio" name="keywordsoption" id="keywordsoption2" value="fromme" /><label for="keywordsoption2"><?php print_string('onlyfromme', 'message') ?></label></td></tr>
|
||||
<tr><td> </td><td colspan="2"><input type="radio" checked="checked" name="keywordsoption" id="keywordsoption3" value="allmine" /><label for="keywordsoption3"><?php print_string('allmine', 'message') ?></label></td></tr>
|
||||
|
||||
|
||||
<?php if (has_capability('moodle/site:readallmessages', get_context_instance(CONTEXT_SYSTEM))) { ?>
|
||||
<tr><td> </td><td colspan="2"><input type="radio" name="keywordsoption" id="keywordsoption4" value="allusers" /><label for="keywordsoption4"><?php print_string('allusers', 'message') ?></label></td></tr>
|
||||
<?php } ?>
|
||||
|
||||
<?php
|
||||
/* Potential abuse problems - temporarily disabled
|
||||
/* Potential abuse problems - temporarily disabled
|
||||
echo '<tr><td colspan="3"><input type="radio" name="keywordsoption" alt="'.get_string('allstudents', 'message').'" value="courseusers" />'.get_string('allstudents', 'message').'<br /> '.$cs.'; </td></tr>';
|
||||
|
||||
*/
|
||||
|
||||
?>
|
||||
|
||||
|
||||
</table>
|
||||
|
||||
</form>
|
||||
|
||||
+1
-2
@@ -20,7 +20,7 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
* @package message
|
||||
*/
|
||||
|
||||
|
||||
require('../config.php');
|
||||
require('lib.php');
|
||||
|
||||
@@ -118,4 +118,3 @@ echo '</td></tr></table>';
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
?>
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php // $Id$
|
||||
<?php
|
||||
/**
|
||||
* Info about the local environment, wrt RPC
|
||||
*
|
||||
@@ -97,7 +97,7 @@ class mnet_environment {
|
||||
array_unshift($openssl_history, $this->keypair);
|
||||
}
|
||||
|
||||
// 2. How many old keys do we want to keep? Use array_slice to get
|
||||
// 2. How many old keys do we want to keep? Use array_slice to get
|
||||
// rid of any we don't want
|
||||
$openssl_generations = $DB->get_field('config_plugins', 'value', array('plugin'=>'mnet', 'name'=>'openssl_generations'));
|
||||
if(empty($openssl_generations)) {
|
||||
@@ -166,5 +166,3 @@ class mnet_environment {
|
||||
return $this->keypair['publickey'];
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
+2
-4
@@ -1,4 +1,4 @@
|
||||
<?php // $Id$
|
||||
<?php
|
||||
/**
|
||||
* Library functions for mnet
|
||||
*
|
||||
@@ -105,7 +105,7 @@ function mnet_get_public_key($uri, $application=null) {
|
||||
$curlerrno = curl_errno($ch);
|
||||
if ($curlerrno!=0) {
|
||||
debugging("Request for $uri failed with curl error $curlerrno");
|
||||
}
|
||||
}
|
||||
|
||||
// check HTTP error code
|
||||
$info = curl_getinfo($ch);
|
||||
@@ -653,5 +653,3 @@ function mnet_get_app_jumppath ($applicationid) {
|
||||
}
|
||||
return $appjumppaths[$applicationid];
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
+5
-7
@@ -1,4 +1,4 @@
|
||||
<?php // $Id$
|
||||
<?php
|
||||
/**
|
||||
* An object to represent lots of information about an RPC-peer machine
|
||||
*
|
||||
@@ -240,12 +240,12 @@ class mnet_peer {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Load information from db about an mnet peer into this object's properties
|
||||
*
|
||||
*
|
||||
* @param string $wwwroot - address of peer whose details we want to load
|
||||
* @return bool - indication of success or failure
|
||||
*/
|
||||
*/
|
||||
function set_wwwroot($wwwroot) {
|
||||
global $CFG, $DB;
|
||||
|
||||
@@ -285,7 +285,7 @@ class mnet_peer {
|
||||
/**
|
||||
* Several methods can be used to get an 'mnet_host' record. They all then
|
||||
* send it to this private method to populate this object's attributes.
|
||||
*
|
||||
*
|
||||
* @param object $hostinfo A database record from the mnet_host table
|
||||
* @return void
|
||||
*/
|
||||
@@ -312,5 +312,3 @@ class mnet_peer {
|
||||
return $this->public_key_ref;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
+1
-2
@@ -1,4 +1,4 @@
|
||||
<?php // $Id$
|
||||
<?php
|
||||
/**
|
||||
* Print this server's public key and exit
|
||||
*
|
||||
@@ -18,4 +18,3 @@ if ($CFG->mnet_dispatcher_mode === 'off') {
|
||||
header("Content-type: text/plain");
|
||||
$keypair = mnet_get_keypair();
|
||||
echo $keypair['certificate'];
|
||||
?>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<?php // $Id$
|
||||
<?php
|
||||
/**
|
||||
* An object to represent lots of information about an RPC-peer machine
|
||||
*
|
||||
@@ -91,4 +91,3 @@ class mnet_remote_client extends mnet_peer {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
+4
-6
@@ -1,4 +1,4 @@
|
||||
<?php // $Id$
|
||||
<?php
|
||||
/**
|
||||
* Some dummy functions to test XML-RPC with
|
||||
*/
|
||||
@@ -59,16 +59,16 @@ class testClass {
|
||||
$this->first = 'last';
|
||||
$this->last = 'first';
|
||||
}
|
||||
|
||||
|
||||
function augment_first($newval) {
|
||||
$this->first = $this->first.$newval;
|
||||
return $this->first;
|
||||
}
|
||||
|
||||
|
||||
function augment_first_RPC_OK() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
function mnet_concatenate_strings_RPC_OK() {
|
||||
return true;
|
||||
}
|
||||
@@ -76,5 +76,3 @@ class testClass {
|
||||
return $string1.$string2.$string3;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
<?php // $Id$
|
||||
<?php
|
||||
/**
|
||||
* A service browser for remote Moodles
|
||||
*
|
||||
@@ -102,7 +102,7 @@ if (!empty($_GET['hostid']) && array_key_exists($_GET['hostid'], $hosts)) {
|
||||
$mnet_request->set_method('system/listMethods');
|
||||
$mnet_request->send($mnet_peer);
|
||||
$methods = $mnet_request->response;
|
||||
|
||||
|
||||
echo '<hr /><br /><h3>Methods '.$host->wwwroot .'</h3><table><th>Method</th><th colspan="2">Options</th>';
|
||||
foreach ($methods as $id => $method) {
|
||||
echo '<tr><td>'.$method.'</td><td> <a href="testclient.php?hostid='.$host->id.'&method='.$id.'&show=sig">Inspect</a></td></tr>'."\n";
|
||||
|
||||
@@ -355,4 +355,3 @@ class mnet_xmlrpc_client {
|
||||
return $httprequest;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
+13
-15
@@ -299,7 +299,7 @@ function mnet_server_fault_xml($code, $text, $privatekey = null) {
|
||||
* Translate XML-RPC's strange function call syntax into a more straightforward
|
||||
* PHP-friendly alternative. This dummy function will be called by the
|
||||
* dispatcher, and can be used to call a method on an object, or just a function
|
||||
*
|
||||
*
|
||||
* The methodName argument (eg. mnet/testlib/mnet_concatenate_strings)
|
||||
* is ignored.
|
||||
*
|
||||
@@ -312,7 +312,7 @@ function mnet_server_fault_xml($code, $text, $privatekey = null) {
|
||||
*/
|
||||
function mnet_server_dummy_method($methodname, $argsarray, $functionname) {
|
||||
global $MNET_REMOTE_CLIENT;
|
||||
|
||||
|
||||
if (is_object($MNET_REMOTE_CLIENT->object_to_call)) {
|
||||
return @call_user_method_array($functionname, $MNET_REMOTE_CLIENT->object_to_call, $argsarray);
|
||||
} else if (!empty($MNET_REMOTE_CLIENT->static_location)) {
|
||||
@@ -535,7 +535,7 @@ function mnet_server_dispatch($payload) {
|
||||
// Filename doesn't end in 'php'; possible attack?
|
||||
// Generate error response - unable to locate function
|
||||
exit(mnet_server_fault(7012, 'nosuchfunction'));
|
||||
}
|
||||
}
|
||||
|
||||
// The call stack holds the path to any include file
|
||||
$includefile = $CFG->dirroot.'/'.$filename;
|
||||
@@ -588,7 +588,7 @@ function mnet_system($method, $params, $hostinfo) {
|
||||
{mnet_rpc} rpc
|
||||
WHERE
|
||||
s2r.rpcid = rpc.id AND
|
||||
h2s.serviceid = s2r.serviceid AND
|
||||
h2s.serviceid = s2r.serviceid AND
|
||||
h2s.hostid in ('.$id_list .') AND
|
||||
h2s.publish =\'1\'
|
||||
ORDER BY
|
||||
@@ -610,7 +610,7 @@ function mnet_system($method, $params, $hostinfo) {
|
||||
{mnet_rpc} rpc
|
||||
WHERE
|
||||
s2r.rpcid = rpc.id AND
|
||||
h2s.serviceid = s2r.serviceid AND
|
||||
h2s.serviceid = s2r.serviceid AND
|
||||
h2s.hostid in ('.$id_list .') AND
|
||||
h2s.publish =\'1\' AND
|
||||
svc.id = h2s.serviceid AND
|
||||
@@ -641,7 +641,7 @@ function mnet_system($method, $params, $hostinfo) {
|
||||
WHERE
|
||||
rpc.xmlrpc_path = ? AND
|
||||
s2r.rpcid = rpc.id AND
|
||||
h2s.serviceid = s2r.serviceid AND
|
||||
h2s.serviceid = s2r.serviceid AND
|
||||
h2s.publish =\'1\' AND
|
||||
h2s.hostid in ('.$id_list .')';
|
||||
$params = array($params[0]);
|
||||
@@ -672,7 +672,7 @@ function mnet_system($method, $params, $hostinfo) {
|
||||
rpc.xmlrpc_path = ? AND
|
||||
s2r.rpcid = rpc.id AND
|
||||
h2s.publish =\'1\' AND
|
||||
h2s.serviceid = s2r.serviceid AND
|
||||
h2s.serviceid = s2r.serviceid AND
|
||||
h2s.hostid in ('.$id_list .')';
|
||||
$params = array($params[0]);
|
||||
|
||||
@@ -705,20 +705,20 @@ function mnet_system($method, $params, $hostinfo) {
|
||||
|
||||
if (is_array($result)) {
|
||||
foreach($result as $service) {
|
||||
$services[] = array('name' => $service->name,
|
||||
'apiversion' => $service->apiversion,
|
||||
'publish' => $service->publish,
|
||||
$services[] = array('name' => $service->name,
|
||||
'apiversion' => $service->apiversion,
|
||||
'publish' => $service->publish,
|
||||
'subscribe' => $service->subscribe);
|
||||
}
|
||||
}
|
||||
|
||||
return $services;
|
||||
}
|
||||
}
|
||||
exit(mnet_server_fault(7019, 'nosuchfunction'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the object (if necessary), execute the method or function, and
|
||||
* Initialize the object (if necessary), execute the method or function, and
|
||||
* return the response
|
||||
*
|
||||
* @param string $includefile The file that contains the object definition
|
||||
@@ -785,7 +785,7 @@ function mnet_server_invoke_method($includefile, $methodname, $method, $payload,
|
||||
* Accepts a public key from a new remote host and returns the public key for
|
||||
* this host. If 'register all hosts' is turned on, it will bootstrap a record
|
||||
* for the remote host in the mnet_host table (if it's not already there)
|
||||
*
|
||||
*
|
||||
* @param string $function XML-RPC requires this but we don't... discard!
|
||||
* @param array $params Array of parameters
|
||||
* $params[0] is the remote wwwroot
|
||||
@@ -806,5 +806,3 @@ function mnet_keyswap($function, $params) {
|
||||
}
|
||||
return $MNET->public_key;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -308,4 +308,3 @@ class mnet_encxml_parser {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
+3
-4
@@ -1,4 +1,4 @@
|
||||
<?php // $Id$
|
||||
<?php
|
||||
|
||||
// this is the 'my moodle' page
|
||||
|
||||
@@ -69,12 +69,12 @@
|
||||
if (isset($CFG->mycoursesperpage)) {
|
||||
$courses_limit = $CFG->mycoursesperpage;
|
||||
}
|
||||
|
||||
|
||||
$morecourses = false;
|
||||
if ($courses_limit > 0) {
|
||||
$courses_limit = $courses_limit + 1;
|
||||
}
|
||||
|
||||
|
||||
$courses = get_my_courses($USER->id, 'visible DESC,sortorder ASC', '*', false, $courses_limit);
|
||||
$site = get_site();
|
||||
$course = $site; //just in case we need the old global $course hack
|
||||
@@ -111,4 +111,3 @@
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
?>
|
||||
|
||||
@@ -71,4 +71,3 @@ if (data_submitted() && confirm_sesskey()) {
|
||||
note_print($note, NOTES_SHOW_BODY | NOTES_SHOW_HEAD);
|
||||
echo $OUTPUT->footer();
|
||||
}
|
||||
?>
|
||||
|
||||
+1
-1
@@ -99,4 +99,4 @@ echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading(fullname($user));
|
||||
|
||||
$noteform->display();
|
||||
echo $OUTPUT->footer();
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
+1
-2
@@ -1,4 +1,4 @@
|
||||
<?php // $Id$
|
||||
<?php
|
||||
|
||||
require_once($CFG->libdir.'/formslib.php');
|
||||
|
||||
@@ -31,4 +31,3 @@ class note_edit_form extends moodleform {
|
||||
$mform->setType('id', PARAM_INT);
|
||||
}
|
||||
}
|
||||
?>
|
||||
+1
-1
@@ -139,4 +139,4 @@ if ($courseid != SITEID) {
|
||||
|
||||
echo $OUTPUT->box_end();
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
+1
-2
@@ -1,4 +1,4 @@
|
||||
<?php // $Id$
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Library of functions and constants for notes
|
||||
@@ -281,4 +281,3 @@ function note_delete_all($courseid) {
|
||||
|
||||
return $DB->delete_records('post', array('module'=>'notes', 'courseid'=>$courseid));
|
||||
}
|
||||
?>
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
<?php // $Id$
|
||||
<?php
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
/// Code fragment to define the version of the note module
|
||||
|
||||
Reference in New Issue
Block a user