Skip to content

Commit

Permalink
MDL-31831 whitespace clean - take2
Browse files Browse the repository at this point in the history
stronk7 committed Mar 1, 2012

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent c4a12af commit 5dbfbac
Showing 19 changed files with 60 additions and 53 deletions.
4 changes: 2 additions & 2 deletions blocks/community/communitycourse.php
Original file line number Diff line number Diff line change
@@ -128,7 +128,7 @@
$remove = optional_param('remove', '', PARAM_INTEGER);
$communityid = optional_param('communityid', '', PARAM_INTEGER);
if ($remove != -1 and !empty($communityid) and confirm_sesskey()) {
$communitymanager->block_community_remove_course($communityid, $USER->id);
$communitymanager->block_community_remove_course($communityid, $USER->id);
echo $OUTPUT->header();
echo $renderer->remove_success(new moodle_url(get_referer(false)));
echo $OUTPUT->footer();
@@ -245,4 +245,4 @@
}
}

echo $OUTPUT->footer();
echo $OUTPUT->footer();
6 changes: 3 additions & 3 deletions blocks/community/locallib.php
Original file line number Diff line number Diff line change
@@ -82,7 +82,7 @@ public function block_community_download_course_backup($course) {
global $CFG, $USER;
require_once($CFG->libdir . "/filelib.php");
require_once($CFG->dirroot. "/course/publish/lib.php");

$params['courseid'] = $course->id;
$params['filetype'] = HUB_BACKUP_FILE_TYPE;

@@ -104,7 +104,7 @@ public function block_community_download_course_backup($course) {
$token = $registeredhub->token;
$curlurl .= '&token='.$token;
}

$ch = curl_init($curlurl);
curl_setopt($ch, CURLOPT_FILE, $fp);
$data = curl_exec($ch);
@@ -143,4 +143,4 @@ public function block_community_remove_course($communityid, $userid) {
array('userid' => $userid, 'id' => $communityid));
}

}
}
2 changes: 1 addition & 1 deletion blocks/community/renderer.php
Original file line number Diff line number Diff line change
@@ -124,7 +124,7 @@ public function course_list($courses, $huburl, $contextcourseid) {
//create title html
$coursename = html_writer::tag('h3', $course->fullname,
array('class' => 'hubcoursetitle'));
$coursenamehtml = html_writer::tag('div', $coursename,
$coursenamehtml = html_writer::tag('div', $coursename,
array('class' => 'hubcoursetitlepanel'));

// create screenshots html
18 changes: 9 additions & 9 deletions blocks/community/yui/imagegallery/imagegallery.js
Original file line number Diff line number Diff line change
@@ -44,12 +44,12 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {

this.overlay.render();
this.overlay.hide();

//attach a show event on the image divs (<tag id='image-X'>)
for (var i=0;i<this.get('imageids').length;i++)
{
var imageid = this.get('imageids')[i];
this.imageidnumbers[imageid] = this.get('imagenumbers')[i];
this.imageidnumbers[imageid] = this.get('imagenumbers')[i];
Y.one('#image-'+imageid).on('click', this.show, this, imageid, 1);
}

@@ -60,9 +60,9 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {
if (this.imageloadingevent != null) {
this.imageloadingevent.detach();
}

var url = this.get('huburl') + "/local/hub/webservice/download.php?courseid="
+ imageid + "&filetype=screenshot&imagewidth=original&screenshotnumber=" + screennumber;
+ imageid + "&filetype=screenshot&imagewidth=original&screenshotnumber=" + screennumber;

/// set the mask
if (this.get('maskNode')) {
@@ -88,17 +88,17 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {
var overlaytitle = Y.one('#imagetitleoverlay');
var previousimagelink = "<div id=\"previousarrow\" class=\"imagearrow\">←</div>";
var nextimagelink = "<div id=\"nextarrow\" class=\"imagearrow\">→</div>";

/// need to load the images in the overlay
var overlay = Y.one('#imageoverlay');
overlay.setContent('');


overlay.append(Y.Node.create('<div style="text-align:center"><img id=\"imagetodisplay\" src="' + url
+ '" style="max-height:' + maxheight + 'px;"></div>'));
this.overlay.destroy();
this.overlay = new M.core.dialogue({
headerContent:previousimagelink + '<div id=\"imagenumber\" class=\"imagetitle\"> Image '
headerContent:previousimagelink + '<div id=\"imagenumber\" class=\"imagetitle\"> Image '
+ screennumber + ' / ' + this.imageidnumbers[imageid] + ' </div>' + nextimagelink,
bodyContent:Y.one('#imageoverlay').get('innerHTML'),
visible: false, //by default it is not displayed
@@ -127,7 +127,7 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {
if(overlaywidth > screenshot.width) {
overlaywidth = screenshot.width;
}

this.overlay.set('width', overlaywidth);
this.overlay.set("centered", true);
this.overlay.show();
@@ -196,4 +196,4 @@ YUI.add('moodle-block_community-imagegallery', function(Y) {

}, '@VERSION@', {
requires:['base','node','overlay', 'moodle-enrol-notification']
});
});
6 changes: 3 additions & 3 deletions blocks/dock.js
Original file line number Diff line number Diff line change
@@ -478,7 +478,7 @@ M.core_dock.delayEvent = function(event, options, target) {
*/
M.core_dock.fixTitleOrientation = function(item, title, text) {
var Y = this.Y;

var title = Y.one(title);

if(M.core_dock.cfg.orientation != 'vertical') {
@@ -809,7 +809,7 @@ M.core_dock.genericblock.prototype = {
*/
initialise_block : function(Y, node) {
M.core_dock.init(Y);

this.Y = Y;
if (!node) {
return false;
@@ -919,7 +919,7 @@ M.core_dock.genericblock.prototype = {
// Register an event so that when it is removed we can put it back as a block
dockitem.on('dockeditem:itemremoved', this.return_to_block, this, dockitem);
dock.add(dockitem);

if (!this.skipsetposition) {
// save the users preference
M.util.set_user_preference('docked_block_instance_'+this.id, 1);
2 changes: 1 addition & 1 deletion blocks/navigation/block_navigation.php
Original file line number Diff line number Diff line change
@@ -192,7 +192,7 @@ function get_content() {

$options = array();
$options['linkcategories'] = (!empty($this->config->linkcategories) && $this->config->linkcategories == 'yes');

// Grab the items to display
$renderer = $this->page->get_renderer('block_navigation');
$this->content = new stdClass();
11 changes: 9 additions & 2 deletions blocks/navigation/renderer.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
<?php

class block_navigation_renderer extends plugin_renderer_base {

/**
* Returns the content of the navigation tree.
*
* @param global_navigation $navigation
* @param int $expansionlimit
* @param array $options
* @return string $content
*/
public function navigation_tree(global_navigation $navigation, $expansionlimit, array $options = array()) {
$navigation->add_class('navigation_node');
$content = $this->navigation_node(array($navigation), array('class'=>'block_tree list'), $expansionlimit, $options);
@@ -116,4 +123,4 @@ protected function navigation_node($items, $attrs=array(), $expansionlimit=null,
}
}

}
}
2 changes: 1 addition & 1 deletion blocks/section_links/config_instance.html
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@
* Section links block
*
* @package moodlecore
* @Author Jason Hardin
* @Author Jason Hardin
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

12 changes: 6 additions & 6 deletions course/completion.php
Original file line number Diff line number Diff line change
@@ -144,12 +144,12 @@

// Update course total passing grade
if (!empty($data->criteria_grade)) {
if ($grade_item = grade_category::fetch_course_category($course->id)->grade_item) {
$grade_item->gradepass = $data->criteria_grade_value;
if (method_exists($grade_item, 'update')) {
$grade_item->update('course/completion.php');
}
}
if ($grade_item = grade_category::fetch_course_category($course->id)->grade_item) {
$grade_item->gradepass = $data->criteria_grade_value;
if (method_exists($grade_item, 'update')) {
$grade_item->update('course/completion.php');
}
}
}

redirect($CFG->wwwroot."/course/view.php?id=$course->id", get_string('changessaved'));
2 changes: 1 addition & 1 deletion course/publish/forms.php
Original file line number Diff line number Diff line change
@@ -333,7 +333,7 @@ public function definition() {

$editoroptions = array('maxfiles' => 0, 'maxbytes' => 0, 'trusttext' => false, 'forcehttps' => false);
$mform->addElement('editor', 'creatornotes', get_string('creatornotes', 'hub'), '', $editoroptions);
$mform->addRule('creatornotes', $strrequired, 'required', null, 'client');
$mform->addRule('creatornotes', $strrequired, 'required', null, 'client');
$mform->setType('creatornotes', PARAM_CLEANHTML);
$mform->addHelpButton('creatornotes', 'creatornotes', 'hub');

8 changes: 4 additions & 4 deletions course/publish/index.php
Original file line number Diff line number Diff line change
@@ -110,11 +110,11 @@
}

$renderer = $PAGE->get_renderer('core', 'publish');

/// UNPUBLISH
$cancel = optional_param('cancel', 0, PARAM_BOOL);
if (!empty($cancel) and confirm_sesskey()) {
$confirm = optional_param('confirm', 0, PARAM_BOOL);
$confirm = optional_param('confirm', 0, PARAM_BOOL);
$hubcourseid = optional_param('hubcourseid', 0, PARAM_INT);
$publicationid = optional_param('publicationid', 0, PARAM_INT);
$timepublished = optional_param('timepublished', 0, PARAM_INT);
@@ -161,7 +161,7 @@
empty($hubname)?$huburl:$hubname), 'notifysuccess');
}


/// OUTPUT
echo $OUTPUT->header();
echo $confirmmessage;
@@ -177,4 +177,4 @@

echo $OUTPUT->footer();

}
}
2 changes: 1 addition & 1 deletion course/publish/lib.php
Original file line number Diff line number Diff line change
@@ -279,7 +279,7 @@ public function get_sorted_subjects() {
$subsublevel[substr($key, 0, 8)][substr($key, 0, 10)][$key] = $option;
}
}

//recreate the initial structure returned by get_string_manager()
$subjects = array();
foreach ($toplevel as $key => $name) {
4 changes: 2 additions & 2 deletions course/publish/metadata.php
Original file line number Diff line number Diff line change
@@ -184,10 +184,10 @@
}

// PUBLISH ACTION

//publish the course information
$function = 'hub_register_courses';
$params = array('courses' => array($courseinfo));
$params = array('courses' => array($courseinfo));
try {
$courseids = $xmlrpcclient->call($function, $params);
} catch (Exception $e) {
4 changes: 2 additions & 2 deletions course/publish/renderer.php
Original file line number Diff line number Diff line change
@@ -119,7 +119,7 @@ public function registeredonhublisting($courseid, $publications) {
. $courseid . "&updatestatusid=" . $publication->id
. "&sesskey=" . sesskey()));
}
//add button cells
//add button cells
$cells = array($publication->enrollable ?
get_string('advertised', 'hub') : get_string('shared', 'hub'),
$hubname, userdate($publication->timepublished,
@@ -207,7 +207,7 @@ public function hubinfo($hubinfo) {
$hubdescription .= html_writer::tag('a', $hubinfo['name'],
array('class' => 'hublink', 'href' => $hubinfo['url'],
'onclick' => 'this.target="_blank"'));

$hubdescription .= html_writer::tag('div', format_text($hubinfo['description'], FORMAT_PLAIN),
array('class' => 'hubdescription'));
$hubdescription = html_writer::tag('div', $hubdescription, array('class' => 'hubinfo'));
4 changes: 2 additions & 2 deletions enrol/cohort/ajax.php
Original file line number Diff line number Diff line change
@@ -79,7 +79,7 @@
require_capability('enrol/cohort:config', $context);
$roleid = required_param('roleid', PARAM_INT);
$cohortid = required_param('cohortid', PARAM_INT);

$roles = $manager->get_assignable_roles();
if (!enrol_cohort_can_view_cohort($cohortid) || !array_key_exists($roleid, $roles)) {
throw new enrol_ajax_exception('errorenrolcohort');
@@ -112,4 +112,4 @@
}

echo json_encode($outcome);
die();
die();
4 changes: 2 additions & 2 deletions enrol/locallib.php
Original file line number Diff line number Diff line change
@@ -119,7 +119,7 @@ public function __construct(moodle_page $moodlepage, $course, $instancefilter =

/**
* Returns the current moodle page
* @return moodle_page
* @return moodle_page
*/
public function get_moodlepage() {
return $this->moodlepage;
@@ -1269,4 +1269,4 @@ abstract public function get_identifier();
* @param stdClass $properties
*/
abstract public function process(course_enrolment_manager $manager, array $users, stdClass $properties);
}
}
4 changes: 2 additions & 2 deletions filter/algebra/AlgParser.pm
Original file line number Diff line number Diff line change
@@ -553,10 +553,10 @@ sub tolatex {
if ($args[2]->[0] =~ /binop[12]|numberE|unop1/)
{($p3,$p4)=qw{ \left( \right) };}
if ($args[0] eq '/'){
# return('\frac{' . $p1 . $args[1]->tolatex() . $p2 . '}'.
# return('\frac{' . $p1 . $args[1]->tolatex() . $p2 . '}'.
# '{' . $p3 . $args[2]->tolatex() . $p4 . '}' );
return('\frac{' . $args[1]->tolatex() . '}'.
'{' . $args[2]->tolatex() . '}' );
'{' . $args[2]->tolatex() . '}' );
}
else{
return ($p1 . $args[1]->tolatex() . $p2 . $args[0] . $p3 .
16 changes: 8 additions & 8 deletions grade/edit/scale/edit_form.php
Original file line number Diff line number Diff line change
@@ -138,23 +138,23 @@ function validation($data, $files) {
if (count($scalearray) < 2) {
$errors['scale'] = get_string('badlyformattedscale', 'grades');
} else {
$thescale = implode(',',$scalearray);
$thescale = implode(',',$scalearray);

$textlib = textlib_get_instance();
$textlib = textlib_get_instance();
//this check strips out whitespace from the scale we're validating but not from those already in the DB
$count = $DB->count_records_select('scale', "courseid=:courseid AND ".$DB->sql_compare_text('scale', $textlib->strlen($thescale)).'=:scale',
array('courseid'=>$courseid, 'scale'=>$thescale));
$count = $DB->count_records_select('scale', "courseid=:courseid AND ".$DB->sql_compare_text('scale', $textlib->strlen($thescale)).'=:scale',
array('courseid'=>$courseid, 'scale'=>$thescale));

if ($count) {
//if this is a new scale but we found a duplice in the DB
//or we found a duplicate in another course report the error
if (empty($old->id) or $old->courseid != $courseid) {
$errors['scale'] = get_string('duplicatescale', 'grades');
$errors['scale'] = get_string('duplicatescale', 'grades');
} else if ($old->scale !== $thescale and $old->scale !== $data['scale']) {
//if the old scale from DB is different but we found a duplicate then we're trying to modify a scale to be a duplicate
$errors['scale'] = get_string('duplicatescale', 'grades');
}
}
$errors['scale'] = get_string('duplicatescale', 'grades');
}
}
}
}

2 changes: 1 addition & 1 deletion grade/report/overview/renderer.php
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ class gradereport_overview_renderer extends plugin_renderer_base {

public function graded_users_selector($report, $course, $userid, $groupid, $includeall) {
global $USER;

$select = grade_get_graded_users_select($report, $course, $userid, $groupid, $includeall);
$output = html_writer::tag('div', $this->output->render($select), array('id'=>'graded_users_selector'));
$output .= html_writer::tag('p', '', array('style'=>'page-break-after: always;'));

0 comments on commit 5dbfbac

Please sign in to comment.