mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-31831 whitespace clean - take2
This commit is contained in:
parent
c4a12afaf9
commit
5dbfbacc49
@ -128,7 +128,7 @@ if ($usercandownload and $download != -1 and !empty($downloadcourseid) and confi
|
||||
$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 @@ if (!empty($courses)) {
|
||||
}
|
||||
}
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
echo $OUTPUT->footer();
|
||||
|
@ -82,7 +82,7 @@ class block_community_manager {
|
||||
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 @@ class block_community_manager {
|
||||
$token = $registeredhub->token;
|
||||
$curlurl .= '&token='.$token;
|
||||
}
|
||||
|
||||
|
||||
$ch = curl_init($curlurl);
|
||||
curl_setopt($ch, CURLOPT_FILE, $fp);
|
||||
$data = curl_exec($ch);
|
||||
@ -143,4 +143,4 @@ class block_community_manager {
|
||||
array('userid' => $userid, 'id' => $communityid));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ class block_community_renderer extends plugin_renderer_base {
|
||||
//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
|
||||
|
@ -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']
|
||||
});
|
||||
});
|
||||
|
@ -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);
|
||||
|
@ -192,7 +192,7 @@ class block_navigation extends block_base {
|
||||
|
||||
$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();
|
||||
|
@ -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 @@ class block_navigation_renderer extends plugin_renderer_base {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
*/
|
||||
|
||||
|
@ -144,12 +144,12 @@ if ($form->is_cancelled()){
|
||||
|
||||
// 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'));
|
||||
|
@ -333,7 +333,7 @@ class course_publication_form extends moodleform {
|
||||
|
||||
$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');
|
||||
|
||||
|
@ -110,11 +110,11 @@ if (has_capability('moodle/course:publish', get_context_instance(CONTEXT_COURSE,
|
||||
}
|
||||
|
||||
$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 @@ if (has_capability('moodle/course:publish', get_context_instance(CONTEXT_COURSE,
|
||||
empty($hubname)?$huburl:$hubname), 'notifysuccess');
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// OUTPUT
|
||||
echo $OUTPUT->header();
|
||||
echo $confirmmessage;
|
||||
@ -177,4 +177,4 @@ if (has_capability('moodle/course:publish', get_context_instance(CONTEXT_COURSE,
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -279,7 +279,7 @@ class course_publish_manager {
|
||||
$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) {
|
||||
|
@ -184,10 +184,10 @@ if (has_capability('moodle/course:publish', get_context_instance(CONTEXT_COURSE,
|
||||
}
|
||||
|
||||
// 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) {
|
||||
|
@ -119,7 +119,7 @@ class core_publish_renderer extends plugin_renderer_base {
|
||||
. $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 @@ class core_publish_renderer extends plugin_renderer_base {
|
||||
$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'));
|
||||
|
@ -79,7 +79,7 @@ switch ($action) {
|
||||
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 @@ switch ($action) {
|
||||
}
|
||||
|
||||
echo json_encode($outcome);
|
||||
die();
|
||||
die();
|
||||
|
@ -119,7 +119,7 @@ class course_enrolment_manager {
|
||||
|
||||
/**
|
||||
* Returns the current moodle page
|
||||
* @return moodle_page
|
||||
* @return moodle_page
|
||||
*/
|
||||
public function get_moodlepage() {
|
||||
return $this->moodlepage;
|
||||
@ -1269,4 +1269,4 @@ abstract class enrol_bulk_enrolment_operation {
|
||||
* @param stdClass $properties
|
||||
*/
|
||||
abstract public function process(course_enrolment_manager $manager, array $users, stdClass $properties);
|
||||
}
|
||||
}
|
||||
|
@ -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 .
|
||||
|
@ -138,23 +138,23 @@ class edit_scale_form extends moodleform {
|
||||
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');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;'));
|
||||
|
Loading…
x
Reference in New Issue
Block a user