Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
MDL-37414 blocks: re-added the ability to add some blocks to the My M…
…oodle
  • Loading branch information
mdjnelson committed Jan 22, 2013
1 parent 7def533 commit 528b5b7
Show file tree
Hide file tree
Showing 20 changed files with 49 additions and 293 deletions.
4 changes: 0 additions & 4 deletions blocks/glossary_random/block_glossary_random.php
Expand Up @@ -10,10 +10,6 @@ function init() {
$this->title = get_string('pluginname','block_glossary_random');
}

function applicable_formats() {
return array('all' => true, 'mod' => false, 'tag' => false, 'my' => false);
}

function specialization() {
global $CFG, $DB;

Expand Down
10 changes: 10 additions & 0 deletions blocks/glossary_random/db/access.php
Expand Up @@ -26,6 +26,16 @@

$capabilities = array(

'block/glossary_random:myaddinstance' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'user' => CAP_ALLOW
),

'clonepermissionsfrom' => 'moodle/my:manageblocks'
),

'block/glossary_random:addinstance' => array(
'riskbitmask' => RISK_SPAM | RISK_XSS,

Expand Down
69 changes: 0 additions & 69 deletions blocks/glossary_random/db/upgrade.php

This file was deleted.

1 change: 1 addition & 0 deletions blocks/glossary_random/lang/en/block_glossary_random.php
Expand Up @@ -28,6 +28,7 @@
$string['askinvisible'] = 'When users cannot edit or view the glossary, show this text (without link)';
$string['askviewglossary'] = 'When users can view the glossary but not add entries, show a link with this text';
$string['glossary_random:addinstance'] = 'Add a new random glossary entry block';
$string['glossary_random:myaddinstance'] = 'Add a new random glossary entry block to the My Moodle page';
$string['intro'] = 'Make sure you have at least one glossary with at least one entry added to this course. Then you can adjust the following settings';
$string['invisible'] = '(to be continued)';
$string['lastmodified'] = 'Last modified entry';
Expand Down
2 changes: 1 addition & 1 deletion blocks/glossary_random/version.php
Expand Up @@ -25,6 +25,6 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2012112901; // The current plugin version (Date: YYYYMMDDXX)
$plugin->version = 2012112902; // The current plugin version (Date: YYYYMMDDXX)
$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'block_glossary_random'; // Full name of the plugin (used for diagnostics)
2 changes: 1 addition & 1 deletion blocks/mentees/block_mentees.php
Expand Up @@ -7,7 +7,7 @@ function init() {
}

function applicable_formats() {
return array('all' => true, 'tag' => false, 'my' => false);
return array('all' => true, 'tag' => false);
}

function specialization() {
Expand Down
10 changes: 10 additions & 0 deletions blocks/mentees/db/access.php
Expand Up @@ -26,6 +26,16 @@

$capabilities = array(

'block/mentees:myaddinstance' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'user' => CAP_ALLOW
),

'clonepermissionsfrom' => 'moodle/my:manageblocks'
),

'block/mentees:addinstance' => array(
'riskbitmask' => RISK_SPAM | RISK_XSS,

Expand Down
69 changes: 0 additions & 69 deletions blocks/mentees/db/upgrade.php

This file was deleted.

1 change: 1 addition & 0 deletions blocks/mentees/lang/en/block_mentees.php
Expand Up @@ -27,5 +27,6 @@
$string['configtitleblankhides'] = 'Block title (no title if blank)';
$string['leaveblanktohide'] = 'leave blank to hide the title';
$string['mentees:addinstance'] = 'Add a new mentees block';
$string['mentees:myaddinstance'] = 'Add a new mentees block to the My Moodle page';
$string['newmenteesblock'] = '(new Mentees block)';
$string['pluginname'] = 'Mentees';
2 changes: 1 addition & 1 deletion blocks/mentees/version.php
Expand Up @@ -25,6 +25,6 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2012112901; // The current plugin version (Date: YYYYMMDDXX)
$plugin->version = 2012112902; // The current plugin version (Date: YYYYMMDDXX)
$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'block_mentees'; // Full name of the plugin (used for diagnostics)
4 changes: 0 additions & 4 deletions blocks/news_items/block_news_items.php
Expand Up @@ -5,10 +5,6 @@ function init() {
$this->title = get_string('pluginname', 'block_news_items');
}

function applicable_formats() {
return array('all' => true, 'mod' => false, 'tag' => false, 'my' => false);
}

function get_content() {
global $CFG, $USER;

Expand Down
10 changes: 10 additions & 0 deletions blocks/news_items/db/access.php
Expand Up @@ -26,6 +26,16 @@

$capabilities = array(

'block/news_items:myaddinstance' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'user' => CAP_ALLOW
),

'clonepermissionsfrom' => 'moodle/my:manageblocks'
),

'block/news_items:addinstance' => array(
'riskbitmask' => RISK_SPAM | RISK_XSS,

Expand Down
69 changes: 0 additions & 69 deletions blocks/news_items/db/upgrade.php

This file was deleted.

1 change: 1 addition & 0 deletions blocks/news_items/lang/en/block_news_items.php
Expand Up @@ -24,4 +24,5 @@
*/

$string['news_items:addinstance'] = 'Add a new latest news block';
$string['news_items:myaddinstance'] = 'Add a new latest news block to the My Moodle page';
$string['pluginname'] = 'Latest news';
2 changes: 1 addition & 1 deletion blocks/news_items/version.php
Expand Up @@ -25,6 +25,6 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2012112901; // The current plugin version (Date: YYYYMMDDXX)
$plugin->version = 2012112902; // The current plugin version (Date: YYYYMMDDXX)
$plugin->requires = 2012112900; // Requires this Moodle version
$plugin->component = 'block_news_items'; // Full name of the plugin (used for diagnostics)
4 changes: 0 additions & 4 deletions blocks/online_users/block_online_users.php
Expand Up @@ -10,10 +10,6 @@ function init() {
$this->title = get_string('pluginname','block_online_users');
}

function applicable_formats() {
return array('all' => true, 'mod' => false, 'tag' => false, 'my' => false);
}

function has_config() {
return true;
}
Expand Down
10 changes: 10 additions & 0 deletions blocks/online_users/db/access.php
Expand Up @@ -26,6 +26,16 @@

$capabilities = array(

'block/online_users:myaddinstance' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'user' => CAP_ALLOW
),

'clonepermissionsfrom' => 'moodle/my:manageblocks'
),

'block/online_users:addinstance' => array(
'riskbitmask' => RISK_SPAM | RISK_XSS,

Expand Down

0 comments on commit 528b5b7

Please sign in to comment.