@@ -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(); |
@@ -114,12 +114,12 @@ |
||
114 | 114 | // my moodle can only have SITEID and it's redundant here, so take it away |
115 | 115 | public function applicable_formats() { |
116 | 116 | return array('all' => false, |
117 | - 'site' => true, |
|
118 | - 'site-index' => true); |
|
117 | + 'site' => true, |
|
118 | + 'site-index' => true); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | public function instance_allow_multiple() { |
122 | - return false; |
|
122 | + return false; |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | function has_config() {return true;} |
@@ -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 | |
@@ -86,8 +86,8 @@ discard block |
||
86 | 86 | foreach ($course->get_course_overviewfiles() as $file) { |
87 | 87 | $isimage = $file->is_valid_image(); |
88 | 88 | $url = file_encode_url("$CFG->wwwroot/pluginfile.php", |
89 | - '/'. $file->get_contextid(). '/'. $file->get_component(). '/'. |
|
90 | - $file->get_filearea(). $file->get_filepath(). $file->get_filename(), !$isimage); |
|
89 | + '/'.$file->get_contextid().'/'.$file->get_component().'/'. |
|
90 | + $file->get_filearea().$file->get_filepath().$file->get_filename(), !$isimage); |
|
91 | 91 | if ($isimage) { |
92 | 92 | $contentimages .= html_writer::tag('div', |
93 | 93 | html_writer::empty_tag('img', array('src' => $url, 'style' => 'max-height: 150px')), |
@@ -101,10 +101,10 @@ discard block |
||
101 | 101 | array('class' => 'coursefile fp-filename-icon')); |
102 | 102 | } |
103 | 103 | } |
104 | - $content .= $contentimages. $contentfiles; |
|
104 | + $content .= $contentimages.$contentfiles; |
|
105 | 105 | |
106 | 106 | |
107 | - $this->content->text .= $content. '</div>'; |
|
107 | + $this->content->text .= $content.'</div>'; |
|
108 | 108 | } |
109 | 109 | } |
110 | 110 | |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | return false; |
123 | 123 | } |
124 | 124 | |
125 | - function has_config() {return true;} |
|
125 | + function has_config() {return true; } |
|
126 | 126 | |
127 | 127 | public function cron() { |
128 | 128 | return true; |
@@ -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) |