protected function section_edit_controls($course, $section, $onsectionpage = false) {
        global $PAGE;

        if (!$PAGE->user_is_editing()) {
            return array();
        }

        $controls = array();
        $items = $this->section_edit_control_items($course, $section, $onsectionpage);

        foreach ($items as $key => $item) {
                $url = empty($item['url']) ? '' : $item['url'];
                $icon = empty($item['icon']) ? '' : $item['icon'];
                $name = empty($item['name']) ? '' : $item['name'];
                $attr = empty($item['attr']) ? '' : $item['attr'];
                $class = empty($item['pixattr']['class']) ? '' : $item['pixattr']['class'];
                $alt = empty($item['pixattr']['alt']) ? '' : $item['pixattr']['alt'];
                $controls[$key] = html_writer::link(
                    new moodle_url($url), $this->output->pix_icon($icon, $alt),
                    $attr);
        }

        debugging('section_edit_controls() is deprecated, please use section_edit_control_items() instead.', DEBUG_DEVELOPER);
        return $controls;
    }