@@ -84,112 +84,16 @@ public function add_event_button($courseid, $unused1 = null, $unused2 = null, $u
84
84
}
85
85
86
86
/**
87
- * Displays an event
88
- *
89
- * @deprecated since 3.9
90
- *
91
- * @param calendar_event $event
92
- * @param bool $showactions
93
- * @return string
87
+ * @deprecated 3.9
94
88
*/
95
- public function event (calendar_event $ event , $ showactions =true ) {
96
- global $ CFG ;
97
- debugging ('This function is no longer used ' , DEBUG_DEVELOPER );
98
-
99
- $ event = calendar_add_event_metadata ($ event );
100
- $ context = $ event ->context ;
101
- $ output = '' ;
102
-
103
- $ output .= $ this ->output ->box_start ('card-header clearfix ' );
104
- if (calendar_edit_event_allowed ($ event ) && $ showactions ) {
105
- if (calendar_delete_event_allowed ($ event )) {
106
- $ editlink = new moodle_url (CALENDAR_URL .'event.php ' , array ('action ' => 'edit ' , 'id ' => $ event ->id ));
107
- $ deletelink = new moodle_url (CALENDAR_URL .'delete.php ' , array ('id ' => $ event ->id ));
108
- if (!empty ($ event ->calendarcourseid )) {
109
- $ editlink ->param ('course ' , $ event ->calendarcourseid );
110
- $ deletelink ->param ('course ' , $ event ->calendarcourseid );
111
- }
112
- } else {
113
- $ params = array ('update ' => $ event ->cmid , 'return ' => true , 'sesskey ' => sesskey ());
114
- $ editlink = new moodle_url ('/course/mod.php ' , $ params );
115
- $ deletelink = null ;
116
- }
117
-
118
- $ commands = html_writer::start_tag ('div ' , array ('class ' => 'commands float-sm-end ' ));
119
- $ commands .= html_writer::start_tag ('a ' , array ('href ' => $ editlink ));
120
- $ str = get_string ('tt_editevent ' , 'calendar ' );
121
- $ commands .= $ this ->output ->pix_icon ('t/edit ' , $ str );
122
- $ commands .= html_writer::end_tag ('a ' );
123
- if ($ deletelink != null ) {
124
- $ commands .= html_writer::start_tag ('a ' , array ('href ' => $ deletelink ));
125
- $ str = get_string ('tt_deleteevent ' , 'calendar ' );
126
- $ commands .= $ this ->output ->pix_icon ('t/delete ' , $ str );
127
- $ commands .= html_writer::end_tag ('a ' );
128
- }
129
- $ commands .= html_writer::end_tag ('div ' );
130
- $ output .= $ commands ;
131
- }
132
- if (!empty ($ event ->icon )) {
133
- $ output .= $ event ->icon ;
134
- } else {
135
- $ output .= $ this ->output ->spacer (array ('height ' => 16 , 'width ' => 16 ));
136
- }
137
-
138
- if (!empty ($ event ->referer )) {
139
- $ output .= $ this ->output ->heading ($ event ->referer , 3 , array ('class ' => 'referer ' ));
140
- } else {
141
- $ output .= $ this ->output ->heading (
142
- format_string ($ event ->name , false , array ('context ' => $ context )),
143
- 3 ,
144
- array ('class ' => 'name d-inline-block ' )
145
- );
146
- }
147
- // Show subscription source if needed.
148
- if (!empty ($ event ->subscription ) && $ CFG ->calendar_showicalsource ) {
149
- if (!empty ($ event ->subscription ->url )) {
150
- $ source = html_writer::link ($ event ->subscription ->url ,
151
- get_string ('subscriptionsource ' , 'calendar ' , $ event ->subscription ->name ));
152
- } else {
153
- // File based ical.
154
- $ source = get_string ('subscriptionsource ' , 'calendar ' , $ event ->subscription ->name );
155
- }
156
- $ output .= html_writer::tag ('div ' , $ source , array ('class ' => 'subscription ' ));
157
- }
158
- if (!empty ($ event ->courselink )) {
159
- $ output .= html_writer::tag ('div ' , $ event ->courselink );
160
- }
161
- if (!empty ($ event ->time )) {
162
- $ output .= html_writer::tag ('span ' , $ event ->time , array ('class ' => 'date float-sm-end me-1 ' ));
163
- } else {
164
- $ humantime = \core_calendar \output \humandate::create_from_timestamp (
165
- timestamp: $ event ->timestart ,
166
- near: null ,
167
- timeonly: true ,
168
- );
169
- $ output .= html_writer::tag ('span ' , $ this ->output ->render ($ humantime ));
170
- }
171
-
172
- if (!empty ($ event ->actionurl )) {
173
- $ actionlink = html_writer::link (new moodle_url ($ event ->actionurl ), $ event ->actionname );
174
- $ output .= html_writer::tag ('div ' , $ actionlink , ['class ' => 'action ' ]);
175
- }
176
-
177
- $ output .= $ this ->output ->box_end ();
178
- $ eventdetailshtml = '' ;
179
- $ eventdetailsclasses = '' ;
180
-
181
- $ eventdetailshtml .= format_text ($ event ->description , $ event ->format , array ('context ' => $ context ));
182
- $ eventdetailsclasses .= 'description card-block ' ;
183
- if (isset ($ event ->cssclass )) {
184
- $ eventdetailsclasses .= ' ' .$ event ->cssclass ;
185
- }
186
-
187
- if (!empty ($ eventdetailshtml )) {
188
- $ output .= html_writer::tag ('div ' , $ eventdetailshtml , array ('class ' => $ eventdetailsclasses ));
189
- }
190
-
191
- $ eventhtml = html_writer::tag ('div ' , $ output , array ('class ' => 'card ' ));
192
- return html_writer::tag ('div ' , $ eventhtml , array ('class ' => 'event ' , 'id ' => 'event_ ' . $ event ->id ));
89
+ #[\core \attribute \deprecated(
90
+ replacement: 'event no longer used ' ,
91
+ since: '3.9 ' ,
92
+ mdl: 'MDL-58866 ' ,
93
+ final: true ,
94
+ )]
95
+ public function event () {
96
+ \core \deprecation::emit_deprecation_if_present (__FUNCTION__ );
193
97
}
194
98
195
99
/**
0 commit comments