protected function get_footer($feedrecords) {
        global $PAGE;
        $footer = null;

        if ($this->config->block_rss_client_show_channel_link) {
            global $CFG;
            require_once($CFG->libdir.'/simplepie/moodle_simplepie.php');

            $feedrecord     = array_pop($feedrecords);
            $feed           = new moodle_simplepie($feedrecord->url);
            $channellink    = new moodle_url($feed->get_link());

            if (!empty($channellink)) {
                $footer = new block_rss_client\output\footer($channellink);
            }
        }

        if ($this->hasfailedfeeds) {
            if (has_any_capability(['block/rss_client:manageownfeeds', 'block/rss_client:manageanyfeeds'], $this->context)) {
                if ($footer === null) {
                    $footer = new block_rss_client\output\footer();
                }
                $manageurl = new moodle_url('/blocks/rss_client/managefeeds.php', ['courseid' => $PAGE->course->id]);
                $footer->set_failed($manageurl);
            }
        }

        return $footer;
    }
protected function get_footer($feedrecords) {
        global $PAGE;
        $footer = null;

        if ($this->config->block_rss_client_show_channel_link) {
            global $CFG;
            require_once($CFG->libdir.'/simplepie/moodle_simplepie.php');

            $feedrecord     = array_pop($feedrecords);
            $feed           = new moodle_simplepie($feedrecord->url);
            $channellink    = new moodle_url($feed->get_link());

            if (!empty($channellink)) {
                $footer = new block_rss_client\output\footer($channellink);
            }
        }

        if ($this->hasfailedfeeds) {
            if (has_any_capability(['block/rss_client:manageownfeeds', 'block/rss_client:manageanyfeeds'], $this->context)) {
                if ($footer === null) {
                    $footer = new block_rss_client\output\footer();
                }
                $manageurl = new moodle_url('/blocks/rss_client/managefeeds.php', ['courseid' => $PAGE->course->id]);
                $footer->set_failed($manageurl);
            }
        }

        return $footer;
    }
protected function get_footer ( $ feedrecords ) { global $ PAGE ; $ footer = null ; if ( $ this -> config -> block_rss_client_show_channel_link ) { global $ CFG ; require_once ( $ CFG -> libdir . '/simplepie/moodle_simplepie.php' ) ; $ feedrecord = array_pop ( $ feedrecords ) ; $ feed = new moodle_simplepie ( $ feedrecord -> url ) ; $ channellink = new moodle_url ( $ feed -> get_link ( ) ) ; if ( ! empty ( $ channellink ) ) { $ footer = new block_rss_client \ output \ footer ( $ channellink ) ; } } if ( $ this -> hasfailedfeeds ) { if ( has_any_capability ( [ 'block/rss_client:manageownfeeds' , 'block/rss_client:manageanyfeeds' ] , $ this -> context ) ) { if ( $ footer === null ) { $ footer = new block_rss_client \ output \ footer ( ) ; } $ manageurl = new moodle_url ( '/blocks/rss_client/managefeeds.php' , [ 'courseid' => $ PAGE -> course -> id ] ) ; $ footer -> set_failed ( $ manageurl ) ; } } return $ footer ; }
Gets the footer, which is the channel link of the last feed in our list of feeds

@param array $feedrecords The feed records from the database.
@return block_rss_client\output\footer|null The renderable footer or null if none should be displayed.
Gets the footer which is the channel link of the last feed in our list of feeds