MDL-60564 calendar: removed unnecessary get_new_event_button()
authorMark Nelson <markn@moodle.com>
Tue, 24 Oct 2017 07:02:12 +0000 (15:02 +0800)
committerMark Nelson <markn@moodle.com>
Tue, 24 Oct 2017 09:49:28 +0000 (17:49 +0800)
calendar/classes/external/day_exporter.php

index 28399e2..510922c 100644 (file)
@@ -155,9 +155,6 @@ class day_exporter extends exporter {
                 'type' => PARAM_BOOL,
                 'default' => false,
             ],
-            'new_event_button' => [
-                'type' => PARAM_RAW,
-            ],
         ];
     }
 
@@ -187,7 +184,6 @@ class day_exporter extends exporter {
             'previousperiod' => $this->get_previous_day_timestamp($daytimestamp),
             'nextperiod' => $this->get_next_day_timestamp($daytimestamp),
             'navigation' => $this->get_navigation(),
-            'new_event_button' => $this->get_new_event_button(),
             'viewdaylink' => $this->url->out(false),
         ];
 
@@ -273,32 +269,4 @@ class day_exporter extends exporter {
             'time' => $this->calendar->time,
         ]);
     }
-
-    /**
-     * Get the course filter selector.
-     *
-     * This is a temporary solution, this code will be removed by MDL-60096.
-     *
-     * @return string The html code for the course filter selector.
-     */
-    protected function get_new_event_button() {
-        // TODO remove this code on MDL-60096.
-        $output = \html_writer::start_tag('div', array('class' => 'buttons'));
-        $output .= \html_writer::start_tag('form',
-                array('action' => CALENDAR_URL . 'event.php', 'method' => 'get'));
-        $output .= \html_writer::start_tag('div');
-        $output .= \html_writer::empty_tag('input',
-                array('type' => 'hidden', 'name' => 'action', 'value' => 'new'));
-        $output .= \html_writer::empty_tag('input',
-                array('type' => 'hidden', 'name' => 'course', 'value' => $this->calendar->courseid));
-        $output .= \html_writer::empty_tag('input',
-                array('type' => 'hidden', 'name' => 'time', 'value' => $this->calendar->time));
-        $attributes = array('type' => 'submit', 'value' => get_string('newevent', 'calendar'),
-            'class' => 'btn btn-secondary');
-        $output .= \html_writer::empty_tag('input', $attributes);
-        $output .= \html_writer::end_tag('div');
-        $output .= \html_writer::end_tag('form');
-        $output .= \html_writer::end_tag('div');
-        return $output;
-    }
 }