Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
moodle
moodle
Commits
db03bff7
Commit
db03bff7
authored
Jul 27, 2018
by
Mihail Geshoski
Browse files
MDL-62994 course: Final deprecation of add_modchoosertoggle()
parent
6e8235c7
Changes
2
Hide whitespace changes
Inline
Side-by-side
course/renderer.php
View file @
db03bff7
...
...
@@ -69,62 +69,10 @@ class core_course_renderer extends plugin_renderer_base {
}
/**
* Adds the item in course settings navigation to toggle modchooser
*
* Theme can overwrite as an empty function to exclude it (for example if theme does not
* use modchooser at all)
*
* @deprecated since 3.2
*/
protected
function
add_modchoosertoggle
()
{
debugging
(
'core_course_renderer::add_modchoosertoggle() is deprecated.'
,
DEBUG_DEVELOPER
);
global
$CFG
;
// Only needs to be done once per page.
if
(
!
$this
->
page
->
requires
->
should_create_one_time_item_now
(
'core_course_modchoosertoggle'
))
{
return
;
}
if
(
$this
->
page
->
state
>
moodle_page
::
STATE_PRINTING_HEADER
||
$this
->
page
->
course
->
id
==
SITEID
||
!
$this
->
page
->
user_is_editing
()
||
!
(
$context
=
context_course
::
instance
(
$this
->
page
->
course
->
id
))
||
!
has_capability
(
'moodle/course:manageactivities'
,
$context
)
||
!
course_ajax_enabled
(
$this
->
page
->
course
)
||
!
(
$coursenode
=
$this
->
page
->
settingsnav
->
find
(
'courseadmin'
,
navigation_node
::
TYPE_COURSE
))
||
!
(
$turneditingnode
=
$coursenode
->
get
(
'turneditingonoff'
)))
{
// Too late, or we are on site page, or we could not find the
// adjacent nodes in course settings menu, or we are not allowed to edit.
return
;
}
if
(
$this
->
page
->
url
->
compare
(
new
moodle_url
(
'/course/view.php'
),
URL_MATCH_BASE
))
{
// We are on the course page, retain the current page params e.g. section.
$modchoosertoggleurl
=
clone
(
$this
->
page
->
url
);
}
else
{
// Edit on the main course page.
$modchoosertoggleurl
=
new
moodle_url
(
'/course/view.php'
,
array
(
'id'
=>
$this
->
page
->
course
->
id
,
'return'
=>
$this
->
page
->
url
->
out_as_local_url
(
false
)));
}
$modchoosertoggleurl
->
param
(
'sesskey'
,
sesskey
());
if
(
$usemodchooser
=
get_user_preferences
(
'usemodchooser'
,
$CFG
->
modchooserdefault
))
{
$modchoosertogglestring
=
get_string
(
'modchooserdisable'
,
'moodle'
);
$modchoosertoggleurl
->
param
(
'modchooser'
,
'off'
);
}
else
{
$modchoosertogglestring
=
get_string
(
'modchooserenable'
,
'moodle'
);
$modchoosertoggleurl
->
param
(
'modchooser'
,
'on'
);
}
$modchoosertoggle
=
navigation_node
::
create
(
$modchoosertogglestring
,
$modchoosertoggleurl
,
navigation_node
::
TYPE_SETTING
,
null
,
'modchoosertoggle'
);
// Insert the modchoosertoggle after the settings node 'turneditingonoff' (navigation_node only has function to insert before, so we insert before and then swap).
$coursenode
->
add_node
(
$modchoosertoggle
,
'turneditingonoff'
);
$turneditingnode
->
remove
();
$coursenode
->
add_node
(
$turneditingnode
,
'modchoosertoggle'
);
$modchoosertoggle
->
add_class
(
'modchoosertoggle'
);
$modchoosertoggle
->
add_class
(
'visibleifjs'
);
user_preference_allow_ajax_update
(
'usemodchooser'
,
PARAM_BOOL
);
throw
new
coding_exception
(
'core_course_renderer::add_modchoosertoggle() can not be used anymore.'
);
}
/**
...
...
theme/upgrade.txt
View file @
db03bff7
...
...
@@ -13,6 +13,8 @@ information provided here is intended especially for theme designer.
- Microsoft Edge: The body class should change from safari to edge.
- Mobile safari: The class ios should exist, safari class should be removed.
* Remove class .safari styling from activity chooser dialog for theme boost and bootstrapbase.
* The following functions have been finally deprecated and can not be used anymore:
* core_course_renderer::add_modchoosertoggle()
=== 3.4 ===
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment