Commit 11b749ca authored by Petr Skoda's avatar Petr Skoda
Browse files

MDL-20700 coding style cleanup - cvs keywords removed, closign php tag...

MDL-20700 coding style cleanup - cvs keywords removed, closign php tag removed, trailing whitespace cleanup
parent d628171f
<?php //$Id$
<?php
require_once $CFG->libdir.'/formslib.php';
......
<?php //$Id$
<?php
require_once $CFG->libdir.'/formslib.php';
......
<?php //$Id$
<?php
require('../../config.php');
require_once('lib.php');
......
<?php //$Id$
<?php
require('../../config.php');
require_once('lib.php');
......
......@@ -7,7 +7,7 @@
* @author Christophe Herreman
* @since 05/01/2005
* @version $id$
*
*
* Special contributions by Allessandro Crugnola and Ted Milker
*/
......@@ -18,7 +18,7 @@ if (!defined('T_ML_COMMENT')) {
}
/**
* Return string from start of haystack to first occurance of needle, or whole
* Return string from start of haystack to first occurance of needle, or whole
* haystack, if needle does not occur
*
* @access public
......@@ -72,10 +72,10 @@ class MethodTable
{
return false;
}
$source = file_get_contents($sourcePath);
$tokens = (array)token_get_all($source);
$waitingForOpenParenthesis = false;
$waitingForFunction = false;
$waitingForClassName = false;
......@@ -113,7 +113,7 @@ class MethodTable
{
$lastComment = '';
$openBraces--;
if($openBraces == 0)
{
break;
......@@ -139,26 +139,26 @@ class MethodTable
$classMethods[] = array("name" => $lastFunction,
"comment" => $lastFunctionComment,
"args" => $argBuffer);
$bufferingArgs = false;
$argBuffer = "";
$lastFunction = "";
$lastFunctionComment = "";
}
}
}
} else {
// token array
list($id, $text) = $token;
if($bufferingArgs)
{
$argBuffer .= $text;
$argBuffer .= $text;
}
switch ($id)
switch ($id)
{
case T_COMMENT:
case T_ML_COMMENT: // we've defined this
case T_DOC_COMMENT: // and this
......@@ -178,7 +178,7 @@ class MethodTable
$waitingForOpenParenthesis = true;
$lastFunction = $text;
$lastFunctionComment = $lastComment;
$lastComment = "";
$lastComment = "";
}
if($waitingForClassName)
{
......@@ -197,12 +197,12 @@ class MethodTable
}
}
}
foreach ($classMethods as $key => $value) {
$methodSignature = $value['args'];
$methodName = $value['name'];
$methodComment = $value['comment'];
$description = MethodTable::getMethodDescription($methodComment) . " " . MethodTable::getMethodCommentAttribute($methodComment, "desc");
$description = trim($description);
$access = MethodTable::getMethodCommentAttributeFirstWord($methodComment, "access");
......@@ -212,7 +212,7 @@ class MethodTable
$pagesize = MethodTable::getMethodCommentAttributeFirstWord($methodComment, "pagesize");
$params = MethodTable::getMethodCommentArguments($methodComment);
//description, arguments, access, [roles, [instance, [returns, [pagesize]]]]
$methodTable[$methodName] = array();
//$methodTable[$methodName]["signature"] = $methodSignature; //debug purposes
......@@ -225,14 +225,14 @@ class MethodTable
if($returns != "") $methodTable[$methodName]["returns"] = $returns;
if($pagesize != "") $methodTable[$methodName]["pagesize"] = $pagesize;
}
return $methodTable;
}
/**
*
*/
*
*/
function getMethodCommentServices($comment)
{
$pieces = explode('@service', $comment);
......@@ -248,10 +248,10 @@ class MethodTable
}
return $args;
}
/**
*
*
*/
function getMethodCommentArguments($comment)
{
......@@ -269,7 +269,7 @@ class MethodTable
return $args;
}
/**
* Returns the description from the comment.
* The description is(are) the first line(s) in the comment.
......@@ -282,8 +282,8 @@ class MethodTable
$comment = MethodTable::cleanComment(strrstr($comment, "@"));
return trim($comment);
}
/**
* Returns the value of a comment attribute.
*
......@@ -302,7 +302,7 @@ class MethodTable
}
return "";
}
/**
* Returns the value of a comment attribute.
*
......@@ -326,7 +326,7 @@ class MethodTable
}
return "";
}
/**
* Returns the value of a comment attribute.
*
......@@ -354,7 +354,7 @@ class MethodTable
}
return $result;
}
function getMethodCommentAttributeFirstWord($comment, $attribute){
$pieces = strstrafter($comment, '@' . $attribute);
if($pieces !== FALSE)
......@@ -364,7 +364,7 @@ class MethodTable
}
return "";
}
/**
* Returns an array with the arguments of a method.
*
......@@ -380,10 +380,10 @@ class MethodTable
//clean the arguments before returning them
$result = MethodTable::cleanArguments(explode(",", $methodSignature), $commentParams);
}
return $result;
}
/**
* Cleans the function or method's return value.
*
......@@ -394,7 +394,7 @@ class MethodTable
function cleanReturnValue($value){
$result = array();
$value = trim($value);
list($result['type'], $result['description']) = explode(' ', $value, 2);
$result['type'] = MethodTable::standardizeType($result['type']);
......@@ -415,12 +415,12 @@ class MethodTable
if('str' == $type || 'string' == $type) return 'string';
if('int' == $type || 'integer' == $type) return 'int';
if('bool' == $type || 'boolean' == $type) return 'boolean';
// Note that object is not a valid XMLRPC type
if('object' == $type || 'class' == $type) return 'object';
if('float' == $type || 'dbl' == $type || 'double' == $type || 'flt' == $type) return 'double';
// Note that null is not a valid XMLRPC type. The null type can have
// Note that null is not a valid XMLRPC type. The null type can have
// only one value - null.
if('null' == $type) return 'null';
......@@ -429,12 +429,12 @@ class MethodTable
if('array' == $type || 'arr' == $type) return 'array';
if('assoc' == $type || 'struct' == $type) return 'struct';
// Note that this is not a valid XMLRPC type. As references cannot be
// Note that this is not a valid XMLRPC type. As references cannot be
// serialized or exported, there is no way this could be XML-RPCed.
if('reference' == $type || 'ref' == $type) return 'reference';
return 'string';
}
/**
* Cleans the arguments array.
* This method removes all whitespaces and the leading "$" sign from each argument
......@@ -448,7 +448,7 @@ class MethodTable
$result = array();
if(!is_array($args)) return array();
foreach($args as $index => $arg){
$arg = strrstr(str_replace(array('$','&$'), array('','&'), $arg), '=');
if(!isset($commentParams[$index]))
......@@ -459,12 +459,12 @@ class MethodTable
{
$start = trim($arg);
$end = trim(str_replace('$', '', $commentParams[$index]));
// Suppress Notice of 'Undefined offset' with @
// Suppress Notice of 'Undefined offset' with @
@list($word0, $word1, $tail) = preg_split("/[\s]+/", $end, 3);
$word0 = strtolower($word0);
$word1 = strtolower($word1);
$wordBase0 = preg_replace('/^[&$]+/','',$word0);
$wordBase1 = preg_replace('/^[&$]+/','',$word1);
$startBase = strtolower(preg_replace('/^[&$]+/','',$start));
......@@ -496,7 +496,7 @@ class MethodTable
$type = 'double';
} elseif($type == 'null') {
// Note that this is not a valid XMLRPC type
// The null type can have only one value - null. Why would
// The null type can have only one value - null. Why would
// that be an argument to a function? Just in case:
$type = 'null';
} elseif($type == 'mixed') {
......@@ -521,8 +521,8 @@ class MethodTable
return $result;
}
/**
* Cleans the comment string by removing all comment start and end characters.
*
......@@ -549,7 +549,7 @@ class MethodTable
foreach($methodTable as $methodName=>$methodProps){
$result .= "\n\t\"" . $methodName . "\" => array(";
foreach($methodProps as $key=>$value){
$result .= "\n\t\t\"" . $key . "\" => ";
......@@ -568,16 +568,15 @@ class MethodTable
$result .= ",";
}
$result = substr($result, 0, -1);
$result .= "\n\t),";
}
$result = substr($result, 0, -1);
$result = "\$this->methodTable = array(" . $result;
$result .= "\n);";
return $result;
}
}
?>
<?php // $Id$
<?php
// Allows the admin to control user logins from remote moodles.
......@@ -236,5 +236,3 @@ foreach ($formerror as $error) {
echo $OUTPUT->box_end();
echo $OUTPUT->footer();
?>
......@@ -209,4 +209,4 @@ function upgrade_RPC_functions() {
}
}
}
?>
......@@ -11,7 +11,7 @@
require_login();
$context = get_context_instance(CONTEXT_SYSTEM);
require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions");
$site = get_site();
......@@ -53,4 +53,3 @@
$mnet_peer->delete();
redirect('peers.php', get_string('hostdeleted', 'mnet'), 5);
}
?>
<?PHP // $Id$
<?PHP
// enrol_config.php - allows admin to edit all enrollment variables
// Yes, enrol is correct English spelling.
......@@ -306,5 +306,3 @@ if (!empty($errors)) {
echo $OUTPUT->footer();
?>
<?PHP // $Id$
<?PHP
// enrol_config.php - allows admin to edit all enrollment variables
// Yes, enrol is correct English spelling.
......@@ -52,5 +52,3 @@
echo '</table></div>';
echo $OUTPUT->footer();
?>
<?PHP // $Id$
<?PHP
// enrol_config.php - allows admin to edit all enrollment variables
// Yes, enrol is correct English spelling.
......@@ -55,5 +55,3 @@
. '</div>';
echo $OUTPUT->footer();
?>
<?PHP // $Id$
<?PHP
// Allows the admin to configure mnet stuff
......@@ -51,8 +51,8 @@
exit;
} else {
// We're deleting
if (!isset($SESSION->mnet_confirm_delete_key)) {
// fail - you're being attacked?
}
......@@ -132,4 +132,3 @@
<?php
echo $OUTPUT->footer();
?>
......@@ -58,7 +58,7 @@ if (isset($mnet_peer->deleted) && $mnet_peer->deleted > 0) {
}
?>
<td valign="top">
<?php
<?php
if (empty($mnet_peer->public_key)) {
print_string('nopubkey', 'mnet');
}
......@@ -130,7 +130,7 @@ if (!empty($credentials)) {
?>
<tr>
<td align="right" valign="top"><?php print_string('certdetails', 'mnet'); ?>:</td>
<td valign="top"><pre style="margin: 0px; border: 0px;"><?php
<td valign="top"><pre style="margin: 0px; border: 0px;"><?php
foreach($credentials['subject'] as $key => $credential) {
if (is_scalar($credential)) {
echo str_pad($key, 16, " ", STR_PAD_LEFT).': '.$credential."\n";
......
......@@ -57,7 +57,7 @@
$host2service = new stdClass();
$host2service->hostid = $_POST['hostid'];
$host2service->serviceid = $key;
$host2service->publish = $publish;
$host2service->subscribe = $subscribe;
......@@ -178,4 +178,3 @@
}
include('./mnet_services.html');
?>
......@@ -72,4 +72,3 @@
}
$adminroot = admin_get_root();
require('./mnet_themes.html');
?>
<?PHP // $Id$
<?PHP
// Allows the admin to configure other Moodle hosts info
......@@ -69,7 +69,7 @@ if (($form = data_submitted()) && confirm_sesskey()) {
} else {
$mnet_peer = new mnet_peer();
if (!empty($form->id)) {
$form->id = clean_param($form->id, PARAM_INT);
$mnet_peer->set_id($form->id);
......@@ -90,11 +90,11 @@ if (($form = data_submitted()) && confirm_sesskey()) {
$form->name = clean_param($form->name, PARAM_NOTAGS);
$mnet_peer->set_name($form->name);
}
if (isset($form->deleted) && ($form->deleted == '0' || $form->deleted == '1')) {
$mnet_peer->deleted = $form->deleted;
}
if (isset($form->public_key)) {
$form->public_key = clean_param($form->public_key, PARAM_PEM);
if (empty($form->public_key)) {
......@@ -150,27 +150,27 @@ if (($form = data_submitted()) && confirm_sesskey()) {
include('./mnet_review_allhosts.html');
}
} else {
$hosts = $DB->get_records_sql(' SELECT
h.id,
h.wwwroot,
h.ip_address,
h.name,
h.public_key,
h.public_key_expires,
h.transport,
h.portno,
h.last_connect_time,
h.last_log_id,
h.applicationid,
a.name as app_name,
a.display_name as app_display_name,
$hosts = $DB->get_records_sql(' SELECT
h.id,
h.wwwroot,
h.ip_address,
h.name,
h.public_key,
h.public_key_expires,
h.transport,
h.portno,
h.last_connect_time,
h.last_log_id,
h.applicationid,
a.name as app_name,
a.display_name as app_display_name,
a.xmlrpc_server_url
FROM
{mnet_host} h,
{mnet_application} a
WHERE
h.id <> ? AND
h.deleted = 0 AND
FROM
{mnet_host} h,
{mnet_application} a
WHERE
h.id <> ? AND
h.deleted = 0 AND
h.applicationid=a.id',
array($CFG->mnet_localhost_id));;
......@@ -178,4 +178,4 @@ if (($form = data_submitted()) && confirm_sesskey()) {
$applications = $DB->get_records('mnet_application');
include('./peers.html');
}
?>
......@@ -16,7 +16,7 @@
admin_externalpage_print_header();
print_error('requiresopenssl', 'mnet', '', NULL, true);
}
$site = get_site();
$trusted_hosts = '';//array();
......@@ -61,4 +61,3 @@
}
include('./trustedhosts.html');
?>
<?php // $Id$
<?php
///////////////////////////////////////////////////////////////////////////
// //
......@@ -81,4 +81,3 @@
echo '</div></form>';
echo $OUTPUT->footer();
?>
......@@ -190,4 +190,4 @@
}
echo $OUTPUT->footer();
?>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment