How can i get the course and teacher name ?

Re: How can i get the course and teacher name ?

by Ivan Torres -
Number of replies: 0

Thanks Howard Miller...

I have another question....

How is posible that in module Avaible course can get the course name and the correspond teacher?? (image 1)

This method can be used to show it in the header of the course?


 $coursename = $chelper->get_course_formatted_name($course);

        $coursenamelink = html_writer::link(new moodle_url('/course/view.php', array('id' => $course->id)),

                                            $coursename, array('class' => $course->visible ? '' : 'dimmed'));

        $content .= html_writer::tag($nametag, $coursenamelink, array('class' => 'coursename'));

        // If we display course in collapsed form but the course has summary or course contacts, display the link to the info page.

        $content .= html_writer::start_tag('div', array('class' => 'moreinfo'));

        if ($chelper->get_show_courses() < self::COURSECAT_SHOW_COURSES_EXPANDED) {

            if ($course->has_summary() || $course->has_course_contacts() || $course->has_course_overviewfiles()) {

                $url = new moodle_url('/course/info.php', array('id' => $course->id));

                $image = html_writer::empty_tag('img', array('src' => $this->output->pix_url('i/info'),

                    'alt' => $this->strings->summary));

                $content .= html_writer::link($url, $image, array('title' => $this->strings->summary));

                // Make sure JS file to expand course content is included.

                $this->coursecat_include_js();

            }

        }

        $content .= html_writer::end_tag('div'); // .moreinfo


Thanks again Howard Miller...

Attachment click.jpg
Average of ratings: Useful (1)