@@ -16,16 +16,16 @@ discard block |
||
16 | 16 | global $CFG; |
17 | 17 | |
18 | 18 | $mform = $this->_form; |
19 | - $availablecourses = $this->_customdata['availablecourses']; // this contains the data of this form |
|
20 | - $featuredcourses = $this->_customdata['featuredcourses']; // this contains the data of this form |
|
19 | + $availablecourses = $this->_customdata['availablecourses']; // this contains the data of this form |
|
20 | + $featuredcourses = $this->_customdata['featuredcourses']; // this contains the data of this form |
|
21 | 21 | $availablecourseslist = array(); |
22 | 22 | foreach ($availablecourses as $c) { |
23 | - $availablecourseslist[$c->id] = $c->shortname . ' : ' . $c->fullname; |
|
23 | + $availablecourseslist[$c->id] = $c->shortname.' : '.$c->fullname; |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | // Forms to edit existing featured courses |
27 | 27 | foreach ($featuredcourses as $c) { |
28 | - $mform->addElement('header','featured', get_string('featuredcourse', 'block_featuredcourses', $c->shortname . ' - '. $c->fullname)); |
|
28 | + $mform->addElement('header', 'featured', get_string('featuredcourse', 'block_featuredcourses', $c->shortname.' - '.$c->fullname)); |
|
29 | 29 | |
30 | 30 | $mform->addElement('hidden', 'featured['.$c->id.'][id]', null); |
31 | 31 | $mform->setType('featured['.$c->id.'][id]', PARAM_INT); |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | } |
42 | 42 | |
43 | 43 | // Add a new featured course |
44 | - $mform->addElement('header','add', get_string('addfeaturedcourse', 'block_featuredcourses')); |
|
44 | + $mform->addElement('header', 'add', get_string('addfeaturedcourse', 'block_featuredcourses')); |
|
45 | 45 | |
46 | 46 | $mform->addElement('checkbox', 'doadd', get_string('doadd', 'block_featuredcourses')); |
47 | 47 |
@@ -31,7 +31,7 @@ |
||
31 | 31 | |
32 | 32 | class block_featuredcourses_delete_featuredcourse_form extends moodleform { |
33 | 33 | public function definition() { |
34 | - $mform =& $this->_form; |
|
34 | + $mform = & $this->_form; |
|
35 | 35 | |
36 | 36 | // hidden elements |
37 | 37 | $mform->addElement('hidden', 'id'); |
@@ -50,7 +50,7 @@ |
||
50 | 50 | |
51 | 51 | $PAGE->set_title(get_string('editpagetitle', 'block_featuredcourses')); |
52 | 52 | $PAGE->set_heading($site->fullname . ' - ' . |
53 | - get_string('pluginname', 'block_featuredcourses')); |
|
53 | + get_string('pluginname', 'block_featuredcourses')); |
|
54 | 54 | |
55 | 55 | echo $OUTPUT->header(); |
56 | 56 | echo $OUTPUT->heading(get_string('editpagedesc', 'block_featuredcourses')); |
@@ -49,7 +49,7 @@ |
||
49 | 49 | $site = get_site(); |
50 | 50 | |
51 | 51 | $PAGE->set_title(get_string('editpagetitle', 'block_featuredcourses')); |
52 | -$PAGE->set_heading($site->fullname . ' - ' . |
|
52 | +$PAGE->set_heading($site->fullname.' - '. |
|
53 | 53 | get_string('pluginname', 'block_featuredcourses')); |
54 | 54 | |
55 | 55 | echo $OUTPUT->header(); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | $mform = new block_featuredcourses_delete_featuredcourse_form(); |
39 | 39 | $newformdata = array('courseid'=>$courseid, |
40 | - 'confirmdelete'=>'1'); |
|
40 | + 'confirmdelete'=>'1'); |
|
41 | 41 | $mform->set_data($newformdata); |
42 | 42 | $formdata = $mform->get_data(); |
43 | 43 | |
@@ -60,10 +60,10 @@ discard block |
||
60 | 60 | |
61 | 61 | echo $OUTPUT->header(), |
62 | 62 | |
63 | - $OUTPUT->box_start('generalbox errorboxcontent boxaligncenter boxwidthnormal'), |
|
64 | - html_writer::tag('p', get_string('confirmdelete', 'block_featuredcourses'), array('class' => 'bold')); |
|
63 | + $OUTPUT->box_start('generalbox errorboxcontent boxaligncenter boxwidthnormal'), |
|
64 | + html_writer::tag('p', get_string('confirmdelete', 'block_featuredcourses'), array('class' => 'bold')); |
|
65 | 65 | |
66 | 66 | $mform->display(); |
67 | 67 | |
68 | 68 | echo $OUTPUT->box_end(), |
69 | - $OUTPUT->footer(); |
|
69 | + $OUTPUT->footer(); |
@@ -24,8 +24,8 @@ |
||
24 | 24 | |
25 | 25 | defined('MOODLE_INTERNAL') || die(); |
26 | 26 | |
27 | -$plugin->version = 2015042701; // The current plugin version (Date: YYYYMMDDXX) |
|
28 | -$plugin->requires = 2014110400; // Requires this Moodle version |
|
27 | +$plugin->version = 2015042701; // The current plugin version (Date: YYYYMMDDXX) |
|
28 | +$plugin->requires = 2014110400; // Requires this Moodle version |
|
29 | 29 | $plugin->release = 2; |
30 | 30 | $plugin->maturity = MATURITY_STABLE; |
31 | 31 | $plugin->component = 'block_featuredcourses'; // Full name of the plugin (used for diagnostics) |
@@ -112,7 +112,7 @@ |
||
112 | 112 | } |
113 | 113 | |
114 | 114 | public function instance_allow_multiple() { |
115 | - return false; |
|
115 | + return false; |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | public function has_config() { |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | } |
57 | 57 | if ($this->page->course->id == SITEID) { |
58 | 58 | $courses = self::get_featured_courses(); |
59 | - require_once($CFG->libdir. '/coursecatlib.php'); |
|
59 | + require_once($CFG->libdir.'/coursecatlib.php'); |
|
60 | 60 | $chelper = new coursecat_helper(); |
61 | 61 | foreach ($courses as $course) { |
62 | 62 | |
@@ -83,8 +83,8 @@ discard block |
||
83 | 83 | foreach ($course->get_course_overviewfiles() as $file) { |
84 | 84 | $isimage = $file->is_valid_image(); |
85 | 85 | $url = file_encode_url("{$CFG->wwwroot}/pluginfile.php", |
86 | - '/'. $file->get_contextid(). '/'. $file->get_component(). '/'. |
|
87 | - $file->get_filearea(). $file->get_filepath(). $file->get_filename(), !$isimage); |
|
86 | + '/'.$file->get_contextid().'/'.$file->get_component().'/'. |
|
87 | + $file->get_filearea().$file->get_filepath().$file->get_filename(), !$isimage); |
|
88 | 88 | if ($isimage) { |
89 | 89 | $contentimages .= html_writer::tag('div', |
90 | 90 | html_writer::empty_tag('img', array('src' => $url, 'style' => 'max-height: 150px')), |
@@ -98,9 +98,9 @@ discard block |
||
98 | 98 | array('class' => 'coursefile fp-filename-icon')); |
99 | 99 | } |
100 | 100 | } |
101 | - $content .= $contentimages. $contentfiles; |
|
101 | + $content .= $contentimages.$contentfiles; |
|
102 | 102 | |
103 | - $this->content->text .= $content. '</div>'; |
|
103 | + $this->content->text .= $content.'</div>'; |
|
104 | 104 | } |
105 | 105 | } |
106 | 106 |