Skip to content

Commit

Permalink
MDL-20700 coding style cleanup - cvs keywords removed, closign php ta…
Browse files Browse the repository at this point in the history
…g removed, trailing whitespace cleanup
  • Loading branch information
skodak committed Nov 1, 2009
1 parent 24eb994 commit 117bd74
Show file tree
Hide file tree
Showing 70 changed files with 594 additions and 693 deletions.
60 changes: 29 additions & 31 deletions lib/accesslib.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

// This file is part of Moodle - http://moodle.org/
//
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
Expand All @@ -11,7 +11,7 @@
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

Expand Down Expand Up @@ -78,7 +78,7 @@
* $accessdata[ra][$contextpath]= array($roleid)
* [$contextpath]= array($roleid)
* [$contextpath]= array($roleid)
* </code>
* </code>
*
* Role definitions are stored like this
* (no cap merge is done - so it's compact)
Expand Down Expand Up @@ -170,15 +170,15 @@
define('ROLENAME_ALIAS_RAW', 4);

/** size limit for context cache */
if (!defined('MAX_CONTEXT_CACHE_SIZE')) {
if (!defined('MAX_CONTEXT_CACHE_SIZE')) {
define('MAX_CONTEXT_CACHE_SIZE', 5000);
}

/**
* Although this looks like a global variable, it isn't really.
* Although this looks like a global variable, it isn't really.
*
* It is just a private implementation detail to accesslib that MUST NOT be used elsewhere.
* It is used to cache various bits of data between function calls for performance reasons.
* It is just a private implementation detail to accesslib that MUST NOT be used elsewhere.
* It is used to cache various bits of data between function calls for performance reasons.
* Sadly, a PHP global variale is the only way to impleemnt this, withough rewriting everything
* as methods of a class, instead of functions.
*
Expand All @@ -198,7 +198,7 @@

/**
* Clears accesslib's private caches. ONLY BE USED BY UNIT TESTS
*
*
* This method should ONLY BE USED BY UNIT TESTS. It clears all of
* accesslib's private caches. You need to do this before setting up test data,
* and also at the end fo the tests.
Expand Down Expand Up @@ -405,7 +405,7 @@ function get_default_frontpage_role_access($roleid, $accessdata=NULL) {

/**
* Get the default guest role
*
*
* @global object
* @global object
* @return object role
Expand Down Expand Up @@ -443,7 +443,7 @@ function get_guest_role() {
* By default checks the capabilties of the current user, but you can pass a
* different userid. By default will return true for admin-like users who have the
* moodle/site:doanything capability, but you can override that with the fourth argument.
*
*
* @param string $capability the name of the capability to check. For example mod/forum:view
* @param object $context the context to check the capability in. You normally get this with {@link get_context_instance}.
* @param integer $userid A user id. By default (null) checks the permissions of the current user.
Expand Down Expand Up @@ -1284,7 +1284,7 @@ function get_user_courses_bycap($userid, $cap, $accessdata, $doanything, $sort='
if ($limit > 0 && $cc >= $limit) {
break;
}

$courses[] = $c;
$cc++;
}
Expand Down Expand Up @@ -1731,7 +1731,7 @@ function compact_rdefs(&$rdefs) {
* for example. Call it only _after_ you've setup $USER and called
* check_enrolment_plugins();
* @see check_enrolment_plugins()
*
*
* @global object
* @global object
* @global object
Expand Down Expand Up @@ -2808,7 +2808,7 @@ function assign_capability($capability, $permission, $roleid, $contextid, $overw

/**
* Unassign a capability from a role.
*
*
* @global object
* @param int $roleid the role id
* @param string $capability the name of the capability
Expand Down Expand Up @@ -2880,7 +2880,7 @@ function get_roles_with_capability($capability, $permission=NULL, $context='') {

/**
* This function makes a role-assignment (a role for a user or group in a particular context)
*
*
* @global object
* @global object
* @global object
Expand Down Expand Up @@ -3505,11 +3505,11 @@ function print_context_name($context, $withprefix = true, $short = false) {
}

/**
* Get a URL for a context, if there is a natural one. For example, for
* Get a URL for a context, if there is a natural one. For example, for
* CONTEXT_COURSE, this is the course page. For CONTEXT_USER it is the
* user profile page.
*
* First three parameters as for
* First three parameters as for
*
* @global object
* @global object
Expand Down Expand Up @@ -3559,10 +3559,10 @@ function get_context_url($context) {

/**
* Returns an array of all the known types of risk
* The array keys can be used, for example as CSS class names, or in calls to
* The array keys can be used, for example as CSS class names, or in calls to
* print_risk_icon. The values are the corresponding RISK_ constants.
*
* @return array all the known types of risk.
* @return array all the known types of risk.
*/
function get_all_risks() {
return array(
Expand Down Expand Up @@ -3649,7 +3649,7 @@ function fetch_context_capabilities($context) {
include_once($modfile);
$modfunction = $module->name.'_get_extra_capabilities';
if (function_exists($modfunction)) {
$extracaps = $modfunction();
$extracaps = $modfunction();
}
}
if(empty($extracaps)) {
Expand Down Expand Up @@ -3797,7 +3797,7 @@ function get_parent_contextid($context) {
* otherwise false.
*
* @param object $context a context object.
* @return bool
* @return bool
*/
function is_inside_frontpage($context) {
$frontpagecontext = get_context_instance(CONTEXT_COURSE, SITEID);
Expand Down Expand Up @@ -4057,7 +4057,7 @@ function get_capability_string($capabilityname) {
case 'webservice':
$string = get_string($stringname, 'webservice_'.$componentname);
break;

default:
$string = get_string($stringname);
break;
Expand Down Expand Up @@ -4442,7 +4442,7 @@ function get_assignable_roles($context, $rolenamedisplay = ROLENAME_ALIAS, $with
if (has_capability('moodle/site:doanything', get_context_instance(CONTEXT_SYSTEM))) {
// show all roles allowed in this context to admins
$raafrom = "";
$raawhere = "";
$raawhere = "";
}

$params['userid'] = $USER->id;
Expand Down Expand Up @@ -4620,7 +4620,7 @@ function get_overridable_roles($context, $rolenamedisplay = ROLENAME_ALIAS, $wit
SELECT ro.id, ro.name$extrafields
FROM {role} ro
ORDER BY ro.sortorder ASC", $params);

} else {
$roles = $DB->get_records_sql("
SELECT ro.id, ro.name$extrafields
Expand Down Expand Up @@ -5504,7 +5504,7 @@ function get_role_users($roleid, $context, $parent=false, $fields='',

/**
* Counts all the users assigned this role in this context or higher
*
*
* @global object
* @param mixed $roleid either int or an array of ints
* @param object $context
Expand Down Expand Up @@ -5766,7 +5766,7 @@ function get_users_from_role_on_context($role, $context) {

/**
* Simple function returning a boolean true if roles exist, otherwise false
*
*
* @global object
* @param int $userid
* @param int $roleid
Expand Down Expand Up @@ -5879,7 +5879,7 @@ function role_fix_names($roleoptions, $context, $rolenamedisplay=ROLENAME_ALIAS)
*
* @param string $cap component string a
* @param string $comp component string b
* @param mixed $contextlevel
* @param mixed $contextlevel
* @return bool whether 2 component are in different "sections"
*/
function component_level_changed($cap, $comp, $contextlevel) {
Expand Down Expand Up @@ -5966,7 +5966,7 @@ function build_context_path($force=false) {
*
* Different code for each database - mostly for performance reasons
*/
$dbfamily = $DB->get_dbfamily();
$dbfamily = $DB->get_dbfamily();
if ($dbfamily == 'mysql') {
$updatesql = "UPDATE {context} ct, {context_temp} temp
SET ct.path = temp.path,
Expand Down Expand Up @@ -6169,7 +6169,7 @@ function make_context_subobj($rec) {
/**
* Do some basic, quick checks to see whether $rec->context looks like a valid context object.
*
* @param object $rec a think that has a context, for example a course,
* @param object $rec a think that has a context, for example a course,
* course category, course modules, etc.
* @param int $contextlevel the type of thing $rec is, one of the CONTEXT_... constants.
* @return bool whether $rec->context looks like the correct context object
Expand Down Expand Up @@ -6316,5 +6316,3 @@ function role_cap_duplicate($sourcerole, $targetrole) {
$DB->insert_record('role_capabilities', $cap);
}
}

?>
16 changes: 7 additions & 9 deletions lib/ajax/ajaxlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ function setup_core_javascript(page_requirements_manager $requires) {

$requires->skip_link_to('maincontent', get_string('tocontent', 'access'));

// Note that, as a short-cut, the code
// Note that, as a short-cut, the code
// $js = "document.body.className += ' jsenabled';\n";
// is hard-coded in {@link page_requirements_manager::get_top_of_body_code)
$requires->yui_lib('container');
$requires->yui_lib('connection');
$requires->string_for_js('confirmation', 'admin');
$requires->string_for_js('cancel', 'moodle');
$requires->string_for_js('yes', 'moodle');
$requires->js_function_call('init_help_icons');
$requires->js_function_call('init_help_icons');
}


Expand Down Expand Up @@ -258,7 +258,7 @@ public function js_function_call($function, $arguments = array()) {

/**
* Make a language string available to JavaScript.
*
*
* All the strings will be available in a mstr object in the global namespace.
* So, for example, after a call to $PAGE->requires->string_for_js('course', 'moodle');
* then the JavaScript variable mstr.moodle.course will be 'Course', or the
Expand Down Expand Up @@ -327,7 +327,7 @@ public function strings_for_js($identifiers, $module, $a=NULL) {

/**
* Make some data from PHP available to JavaScript code.
*
*
* For example, if you call
* <pre>
* $PAGE->requires->data_for_js('mydata', array('name' => 'Moodle'));
Expand Down Expand Up @@ -360,7 +360,7 @@ public function data_for_js($variable, $data) {
$this->variablesinitialised[$variable] = 1;
return $requirement;
}

/**
* Creates a YUI event handler.
*
Expand Down Expand Up @@ -1090,9 +1090,9 @@ public function get_js_code() {
}

/**
* This class represents a Javascript event handler, listening for a
* This class represents a Javascript event handler, listening for a
* specific Event to occur on a DOM element identified by a given id.
* By default the data will be output at the end of the page, but you
* By default the data will be output at the end of the page, but you
* can change that using the {@link asap()}, {@link in_head()}, etc. methods.
*
* @copyright 2009 Nicolas Connault
Expand Down Expand Up @@ -1445,5 +1445,3 @@ function print_javascript($courseid, $return=false) {
}

}

?>
2 changes: 1 addition & 1 deletion lib/ajax/getnavbranch.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,4 @@
header('Content-type: text/xml');
echo '<?xml version="1.0" encoding="utf-8"?>';
// Convert and output the branch as XML
echo $converter->convert($branch);
echo $converter->convert($branch);
3 changes: 1 addition & 2 deletions lib/ajax/setuserpref.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php // $Id$
<?php

///////////////////////////////////////////////////////////////////////////
// //
Expand Down Expand Up @@ -54,4 +54,3 @@
}

echo 'OK';
?>
2 changes: 0 additions & 2 deletions lib/ajax/simpletest/testajaxlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -503,5 +503,3 @@ function test_ajaxenabled()
$this->assertTrue(ajaxenabled($tested_browsers));
}
}

?>
18 changes: 8 additions & 10 deletions lib/authlib.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

// This file is part of Moodle - http://moodle.org/
//
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
Expand All @@ -11,15 +11,15 @@
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Multiple plugin authentication Support library
*
* 2006-08-28 File created, AUTH return values defined.
*
*
* @package moodlecore
* @copyright 1999 onwards Martin Dougiamas http://dougiamas.com
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Expand Down Expand Up @@ -101,7 +101,7 @@ class auth_plugin_base {
/**
* This is the primary method that is used by the authenticate_user_login()
* function in moodlelib.php.
* function in moodlelib.php.
*
* This method should return a boolean indicating
* whether or not the username and password authenticate successfully.
Expand Down Expand Up @@ -131,7 +131,7 @@ function can_change_password() {

/**
* Returns the URL for changing the users' passwords, or empty if the default
* URL can be used.
* URL can be used.
*
* This method is used if can_change_password() returns true.
* This method is called only when user is logged in, it may use global $USER.
Expand All @@ -156,7 +156,7 @@ function is_internal() {
}

/**
* Updates the user's password.
* Updates the user's password.
*
* In previous versions of Moodle, the function
* auth_user_update_password accepted a username as the first parameter. The
Expand Down Expand Up @@ -420,7 +420,7 @@ function get_description() {
}
return $authdescription;
}

/**
* Returns whether or not the captcha element is enabled, and the admin settings fulfil its requirements.
*
Expand All @@ -433,5 +433,3 @@ function is_captcha_enabled() {


}

?>
2 changes: 0 additions & 2 deletions lib/base32.php
Original file line number Diff line number Diff line change
Expand Up @@ -194,5 +194,3 @@ function Base32_decode($inString) {

return $outString;
}

?>
Loading

0 comments on commit 117bd74

Please sign in to comment.