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
ef78cf8f
Commit
ef78cf8f
authored
Feb 26, 2019
by
Dan Marsden
Browse files
MDL-63995 blocks: Remove unused capabilities and warning.
parent
3271c39c
Changes
22
Show whitespace changes
Inline
Side-by-side
blocks/moodleblock.class.php
View file @
ef78cf8f
...
...
@@ -580,6 +580,9 @@ class block_base {
function
user_can_addto
(
$page
)
{
global
$USER
;
// List of formats this block supports.
$formats
=
$this
->
applicable_formats
();
// The blocks in My Moodle are a special case and use a different capability.
if
(
!
empty
(
$USER
->
id
)
&&
$page
->
context
->
contextlevel
==
CONTEXT_USER
// Page belongs to a user
...
...
@@ -587,7 +590,6 @@ class block_base {
&&
$page
->
pagetype
==
'my-index'
)
{
// Ensure we are on the My Moodle page
// If the block cannot be displayed on /my it is ok if the myaddinstance capability is not defined.
$formats
=
$this
->
applicable_formats
();
// Is 'my' explicitly forbidden?
// If 'all' has not been allowed, has 'my' been explicitly allowed?
if
((
isset
(
$formats
[
'my'
])
&&
$formats
[
'my'
]
==
false
)
...
...
@@ -601,6 +603,12 @@ class block_base {
&&
has_capability
(
'moodle/my:manageblocks'
,
$page
->
context
);
}
}
// Check if this is a block only used on /my.
unset
(
$formats
[
'my'
]);
if
(
empty
(
$formats
))
{
// Block can only be added to /my - return false.
return
false
;
}
$capability
=
'block/'
.
$this
->
name
()
.
':addinstance'
;
if
(
$this
->
has_add_block_capability
(
$page
,
$capability
)
...
...
blocks/myoverview/db/access.php
View file @
ef78cf8f
...
...
@@ -34,17 +34,5 @@ $capabilities = array(
),
'clonepermissionsfrom'
=>
'moodle/my:manageblocks'
),
'block/myoverview:addinstance'
=>
array
(
'riskbitmask'
=>
RISK_SPAM
|
RISK_XSS
,
'captype'
=>
'write'
,
'contextlevel'
=>
CONTEXT_BLOCK
,
'archetypes'
=>
array
(
'manager'
=>
CAP_ALLOW
),
'clonepermissionsfrom'
=>
'moodle/site:manageblocks'
)
);
blocks/myoverview/lang/en/block_myoverview.php
View file @
ef78cf8f
...
...
@@ -54,7 +54,6 @@ $string['future'] = 'Future';
$string
[
'inprogress'
]
=
'In progress'
;
$string
[
'lastaccessed'
]
=
'Last accessed'
;
$string
[
'list'
]
=
'List'
;
$string
[
'myoverview:addinstance'
]
=
'Add a new course overview block'
;
$string
[
'myoverview:myaddinstance'
]
=
'Add a new course overview block to Dashboard'
;
$string
[
'past'
]
=
'Past'
;
$string
[
'pluginname'
]
=
'Course overview'
;
...
...
blocks/myoverview/upgrade.txt
0 → 100644
View file @
ef78cf8f
This file describes API changes in the myoverview block code.
=== 3.7 ===
* The 'block/myoverview:addinstance' capability has been removed. It has never been used in code.
\ No newline at end of file
blocks/myoverview/version.php
View file @
ef78cf8f
...
...
@@ -24,6 +24,6 @@
defined
(
'MOODLE_INTERNAL'
)
||
die
();
$plugin
->
version
=
201
81203
00
;
// The current plugin version (Date: YYYYMMDDXX).
$plugin
->
version
=
201
90226
00
;
// The current plugin version (Date: YYYYMMDDXX).
$plugin
->
requires
=
2018112800
;
// Requires this Moodle version.
$plugin
->
component
=
'block_myoverview'
;
// Full name of the plugin (used for diagnostics).
blocks/recentlyaccessedcourses/db/access.php
View file @
ef78cf8f
...
...
@@ -34,15 +34,5 @@ $capabilities = array(
),
'clonepermissionsfrom'
=>
'moodle/my:manageblocks'
),
'block/recentlyaccessedcourses:addinstance'
=>
array
(
'captype'
=>
'write'
,
'contextlevel'
=>
CONTEXT_BLOCK
,
'archetypes'
=>
array
(
'manager'
=>
CAP_ALLOW
),
'clonepermissionsfrom'
=>
'moodle/site:manageblocks'
)
);
blocks/recentlyaccessedcourses/lang/en/block_recentlyaccessedcourses.php
View file @
ef78cf8f
...
...
@@ -22,6 +22,5 @@
*/
$string
[
'pluginname'
]
=
'Recently accessed courses'
;
$string
[
'privacy:metadata'
]
=
'The Recently accessed courses block does not store any personal data.'
;
$string
[
'recentlyaccessedcourses:addinstance'
]
=
'Add a new Recently accessed courses block'
;
$string
[
'recentlyaccessedcourses:myaddinstance'
]
=
'Add a new recently accessed courses block to Dashboard'
;
$string
[
'nocourses'
]
=
'No recent courses'
;
\ No newline at end of file
blocks/recentlyaccessedcourses/upgrade.txt
0 → 100644
View file @
ef78cf8f
This file describes API changes in the recentlyaccesscourses block code.
=== 3.7 ===
* The 'block/recentlyaccesscourses:addinstance' capability has been removed. It has never been used in code.
\ No newline at end of file
blocks/recentlyaccessedcourses/version.php
View file @
ef78cf8f
...
...
@@ -22,6 +22,6 @@
*/
defined
(
'MOODLE_INTERNAL'
)
||
die
();
$plugin
->
version
=
201
81203
00
;
// The current plugin version (Date: YYYYMMDDXX).
$plugin
->
version
=
201
90226
00
;
// The current plugin version (Date: YYYYMMDDXX).
$plugin
->
requires
=
2018112800
;
// Requires this Moodle version.
$plugin
->
component
=
'block_recentlyaccessedcourses'
;
// Full name of the plugin (used for diagnostics).
blocks/recentlyaccesseditems/db/access.php
View file @
ef78cf8f
...
...
@@ -29,13 +29,5 @@ $capabilities = array(
'user'
=>
CAP_ALLOW
),
'clonepermissionsfrom'
=>
'moodle/my:manageblocks'
),
'block/recentlyaccesseditems:addinstance'
=>
array
(
'captype'
=>
'write'
,
'contextlevel'
=>
CONTEXT_BLOCK
,
'archetypes'
=>
array
(
'manager'
=>
CAP_ALLOW
),
'clonepermissionsfrom'
=>
'moodle/site:manageblocks'
)
);
\ No newline at end of file
blocks/recentlyaccesseditems/lang/en/block_recentlyaccesseditems.php
View file @
ef78cf8f
...
...
@@ -28,5 +28,4 @@ $string['privacy:metadata:block_recentlyaccesseditemstablesummary'] = 'The Recen
$string
[
'privacy:metadata:timeaccess'
]
=
'The time when the user last accessed the item'
;
$string
[
'privacy:metadata:userid'
]
=
'The ID of the user who accessed the item'
;
$string
[
'privacy:recentlyaccesseditemspath'
]
=
'Recently accessed items'
;
$string
[
'recentlyaccesseditems:addinstance'
]
=
'Add a new recently accessed items block'
;
$string
[
'recentlyaccesseditems:myaddinstance'
]
=
'Add a new recently accessed items block to Dashboard'
;
\ No newline at end of file
blocks/recentlyaccesseditems/upgrade.txt
0 → 100644
View file @
ef78cf8f
This file describes API changes in the recentlyaccesseditems block code.
=== 3.7 ===
* The 'block/recentlyaccesseditems:addinstance' capability has been removed. It has never been used in code.
\ No newline at end of file
blocks/recentlyaccesseditems/version.php
View file @
ef78cf8f
...
...
@@ -22,6 +22,6 @@
*/
defined
(
'MOODLE_INTERNAL'
)
||
die
();
$plugin
->
version
=
201
8120301
;
// The current plugin version (Date: YYYYMMDDXX).
$plugin
->
version
=
201
9022600
;
// The current plugin version (Date: YYYYMMDDXX).
$plugin
->
requires
=
2018112800
;
// Requires this Moodle version.
$plugin
->
component
=
'block_recentlyaccesseditems'
;
// Full name of the plugin (used for diagnostics).
blocks/starredcourses/db/access.php
View file @
ef78cf8f
...
...
@@ -34,15 +34,5 @@ $capabilities = array(
),
'clonepermissionsfrom'
=>
'moodle/my:manageblocks'
),
'block/starredcourses:addinstance'
=>
array
(
'captype'
=>
'write'
,
'contextlevel'
=>
CONTEXT_BLOCK
,
'archetypes'
=>
array
(
'manager'
=>
CAP_ALLOW
),
'clonepermissionsfrom'
=>
'moodle/site:manageblocks'
),
)
);
blocks/starredcourses/lang/en/block_starredcourses.php
View file @
ef78cf8f
...
...
@@ -24,6 +24,5 @@
$string
[
'pluginname'
]
=
'Starred courses'
;
$string
[
'privacy:metadata'
]
=
'The starred courses block does not store any personal data.'
;
$string
[
'starredcourses:addinstance'
]
=
'Add a new starred courses block'
;
$string
[
'starredcourses:myaddinstance'
]
=
'Add a new starred courses block to Dashboard'
;
$string
[
'nocourses'
]
=
'No starred courses'
;
\ No newline at end of file
blocks/starredcourses/upgrade.txt
0 → 100644
View file @
ef78cf8f
This file describes API changes in the starredcourses block code.
=== 3.7 ===
* The 'block/starredcourses:addinstance' capability has been removed. It has never been used in code.
\ No newline at end of file
blocks/starredcourses/version.php
View file @
ef78cf8f
...
...
@@ -23,6 +23,6 @@
*/
defined
(
'MOODLE_INTERNAL'
)
||
die
;
$plugin
->
version
=
201
81203
00
;
$plugin
->
version
=
201
90226
00
;
$plugin
->
requires
=
2018112800
;
$plugin
->
component
=
'block_starredcourses'
;
\ No newline at end of file
blocks/timeline/db/access.php
View file @
ef78cf8f
...
...
@@ -34,17 +34,5 @@ $capabilities = array(
),
'clonepermissionsfrom'
=>
'moodle/my:manageblocks'
),
'block/timeline:addinstance'
=>
array
(
'riskbitmask'
=>
RISK_SPAM
|
RISK_XSS
,
'captype'
=>
'write'
,
'contextlevel'
=>
CONTEXT_BLOCK
,
'archetypes'
=>
array
(
'manager'
=>
CAP_ALLOW
),
'clonepermissionsfrom'
=>
'moodle/site:manageblocks'
)
);
blocks/timeline/lang/en/block_timeline.php
View file @
ef78cf8f
...
...
@@ -32,7 +32,6 @@ $string['ariaviewselector'] = 'Sort timeline items';
$string
[
'ariaviewselectoroption'
]
=
'{$a} sort option'
;
$string
[
'duedate'
]
=
'Due date'
;
$string
[
'morecourses'
]
=
'More courses'
;
$string
[
'timeline:addinstance'
]
=
'Add a new timeline block'
;
$string
[
'timeline:myaddinstance'
]
=
'Add a new timeline block to Dashboard'
;
$string
[
'nocoursesinprogress'
]
=
'No in-progress courses'
;
$string
[
'noevents'
]
=
'No upcoming activities due'
;
...
...
blocks/timeline/upgrade.txt
0 → 100644
View file @
ef78cf8f
This file describes API changes in the timeline block code.
=== 3.7 ===
* The 'block/timeline:addinstance' capability has been removed. It has never been used in code.
\ No newline at end of file
Prev
1
2
Next
Write
Preview
Supports
Markdown
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