From b291b59d6a980c69d5e4155742f61e69c6072ae3 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Fri, 2 Nov 2012 14:32:01 +0800 Subject: [PATCH] MDL-34270 blocks: adding new add block capabilities --- blocks/activity_modules/db/access.php | 47 +++++++++++++++++++ .../lang/en/block_activity_modules.php | 2 + blocks/activity_modules/version.php | 2 +- blocks/admin_bookmarks/db/access.php | 47 +++++++++++++++++++ .../lang/en/block_admin_bookmarks.php | 3 +- blocks/admin_bookmarks/version.php | 2 +- blocks/blog_menu/db/access.php | 47 +++++++++++++++++++ blocks/blog_menu/lang/en/block_blog_menu.php | 3 +- blocks/blog_menu/version.php | 2 +- blocks/blog_recent/db/access.php | 47 +++++++++++++++++++ .../blog_recent/lang/en/block_blog_recent.php | 2 + blocks/blog_recent/version.php | 2 +- blocks/blog_tags/db/access.php | 47 +++++++++++++++++++ blocks/blog_tags/lang/en/block_blog_tags.php | 2 + blocks/blog_tags/version.php | 2 +- blocks/calendar_month/db/access.php | 47 +++++++++++++++++++ .../lang/en/block_calendar_month.php | 2 + blocks/calendar_month/version.php | 2 +- blocks/calendar_upcoming/db/access.php | 47 +++++++++++++++++++ .../lang/en/block_calendar_upcoming.php | 2 + blocks/calendar_upcoming/version.php | 2 +- blocks/comments/db/access.php | 47 +++++++++++++++++++ blocks/comments/lang/en/block_comments.php | 2 + blocks/comments/version.php | 2 +- blocks/community/db/access.php | 47 +++++++++++++++++++ blocks/community/lang/en/block_community.php | 4 +- blocks/community/version.php | 2 +- blocks/completionstatus/db/access.php | 47 +++++++++++++++++++ .../lang/en/block_completionstatus.php | 25 ++++++++++ blocks/completionstatus/version.php | 2 +- blocks/course_list/db/access.php | 47 +++++++++++++++++++ .../course_list/lang/en/block_course_list.php | 2 + blocks/course_list/version.php | 2 +- blocks/course_overview/db/access.php | 47 +++++++++++++++++++ .../lang/en/block_course_overview.php | 7 ++- blocks/course_overview/version.php | 2 +- blocks/course_summary/db/access.php | 47 +++++++++++++++++++ .../lang/en/block_course_summary.php | 2 + blocks/course_summary/version.php | 2 +- blocks/feedback/db/access.php | 47 +++++++++++++++++++ blocks/feedback/lang/en/block_feedback.php | 27 ++++++++++- blocks/feedback/version.php | 2 +- blocks/glossary_random/db/access.php | 47 +++++++++++++++++++ .../lang/en/block_glossary_random.php | 2 + blocks/glossary_random/version.php | 2 +- blocks/html/db/access.php | 47 +++++++++++++++++++ blocks/html/lang/en/block_html.php | 2 + blocks/html/version.php | 2 +- blocks/login/db/access.php | 47 +++++++++++++++++++ blocks/login/lang/en/block_login.php | 2 + blocks/login/version.php | 2 +- blocks/mentees/db/access.php | 47 +++++++++++++++++++ blocks/mentees/lang/en/block_mentees.php | 2 + blocks/mentees/version.php | 2 +- blocks/messages/db/access.php | 47 +++++++++++++++++++ blocks/messages/lang/en/block_messages.php | 2 + blocks/messages/version.php | 2 +- blocks/mnet_hosts/db/access.php | 47 +++++++++++++++++++ .../mnet_hosts/lang/en/block_mnet_hosts.php | 2 + blocks/mnet_hosts/version.php | 2 +- blocks/moodleblock.class.php | 36 ++++++++++++-- blocks/myprofile/db/access.php | 47 +++++++++++++++++++ blocks/myprofile/lang/en/block_myprofile.php | 6 ++- blocks/myprofile/version.php | 2 +- blocks/navigation/db/access.php | 47 +++++++++++++++++++ .../navigation/lang/en/block_navigation.php | 2 + blocks/navigation/version.php | 2 +- blocks/news_items/db/access.php | 47 +++++++++++++++++++ .../news_items/lang/en/block_news_items.php | 2 + blocks/news_items/version.php | 2 +- blocks/online_users/db/access.php | 21 ++++++++- .../lang/en/block_online_users.php | 2 + blocks/online_users/version.php | 2 +- blocks/participants/db/access.php | 47 +++++++++++++++++++ .../lang/en/block_participants.php | 2 + blocks/participants/version.php | 2 +- blocks/private_files/db/access.php | 47 +++++++++++++++++++ .../lang/en/block_private_files.php | 3 ++ blocks/private_files/version.php | 2 +- blocks/quiz_results/db/access.php | 47 +++++++++++++++++++ .../lang/en/block_quiz_results.php | 2 + blocks/quiz_results/version.php | 2 +- blocks/recent_activity/db/access.php | 47 +++++++++++++++++++ .../lang/en/block_recent_activity.php | 2 + blocks/recent_activity/version.php | 2 +- blocks/rss_client/db/access.php | 19 ++++++++ .../rss_client/lang/en/block_rss_client.php | 2 + blocks/rss_client/version.php | 2 +- blocks/search_forums/db/access.php | 47 +++++++++++++++++++ .../lang/en/block_search_forums.php | 2 + blocks/search_forums/version.php | 2 +- blocks/section_links/db/access.php | 47 +++++++++++++++++++ .../lang/en/block_section_links.php | 2 + blocks/section_links/version.php | 2 +- blocks/selfcompletion/db/access.php | 47 +++++++++++++++++++ .../lang/en/block_selfcompletion.php | 2 + blocks/selfcompletion/version.php | 2 +- blocks/settings/db/access.php | 47 +++++++++++++++++++ blocks/settings/lang/en/block_settings.php | 2 + blocks/settings/version.php | 2 +- blocks/site_main_menu/db/access.php | 47 +++++++++++++++++++ .../lang/en/block_site_main_menu.php | 3 +- blocks/site_main_menu/version.php | 2 +- blocks/social_activities/db/access.php | 47 +++++++++++++++++++ .../lang/en/block_social_activities.php | 2 + blocks/social_activities/version.php | 2 +- blocks/tag_flickr/db/access.php | 47 +++++++++++++++++++ .../tag_flickr/lang/en/block_tag_flickr.php | 2 + blocks/tag_flickr/version.php | 2 +- blocks/tag_youtube/db/access.php | 47 +++++++++++++++++++ .../tag_youtube/lang/en/block_tag_youtube.php | 2 + blocks/tag_youtube/version.php | 2 +- blocks/tags/db/access.php | 47 +++++++++++++++++++ blocks/tags/lang/en/block_tags.php | 2 + blocks/tags/version.php | 2 +- 115 files changed, 1930 insertions(+), 53 deletions(-) create mode 100644 blocks/activity_modules/db/access.php create mode 100644 blocks/admin_bookmarks/db/access.php create mode 100644 blocks/blog_menu/db/access.php create mode 100644 blocks/blog_recent/db/access.php create mode 100644 blocks/blog_tags/db/access.php create mode 100644 blocks/calendar_month/db/access.php create mode 100644 blocks/calendar_upcoming/db/access.php create mode 100644 blocks/comments/db/access.php create mode 100644 blocks/community/db/access.php create mode 100644 blocks/completionstatus/db/access.php create mode 100644 blocks/course_list/db/access.php create mode 100644 blocks/course_overview/db/access.php create mode 100644 blocks/course_summary/db/access.php create mode 100644 blocks/feedback/db/access.php create mode 100644 blocks/glossary_random/db/access.php create mode 100644 blocks/html/db/access.php create mode 100644 blocks/login/db/access.php create mode 100644 blocks/mentees/db/access.php create mode 100644 blocks/messages/db/access.php create mode 100644 blocks/mnet_hosts/db/access.php create mode 100644 blocks/myprofile/db/access.php create mode 100644 blocks/navigation/db/access.php create mode 100644 blocks/news_items/db/access.php create mode 100644 blocks/participants/db/access.php create mode 100644 blocks/private_files/db/access.php create mode 100644 blocks/quiz_results/db/access.php create mode 100644 blocks/recent_activity/db/access.php create mode 100644 blocks/search_forums/db/access.php create mode 100644 blocks/section_links/db/access.php create mode 100644 blocks/selfcompletion/db/access.php create mode 100644 blocks/settings/db/access.php create mode 100644 blocks/site_main_menu/db/access.php create mode 100644 blocks/social_activities/db/access.php create mode 100644 blocks/tag_flickr/db/access.php create mode 100644 blocks/tag_youtube/db/access.php create mode 100644 blocks/tags/db/access.php diff --git a/blocks/activity_modules/db/access.php b/blocks/activity_modules/db/access.php new file mode 100644 index 0000000000000..9041f65faef63 --- /dev/null +++ b/blocks/activity_modules/db/access.php @@ -0,0 +1,47 @@ +. + +/** + * Activity modules block caps. + * + * @package block_activity_modules + * @copyright Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + + 'block/activity_modules:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), + + 'block/activity_modules:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), +); diff --git a/blocks/activity_modules/lang/en/block_activity_modules.php b/blocks/activity_modules/lang/en/block_activity_modules.php index e7fd6e4317eba..b4d4cfe88f779 100644 --- a/blocks/activity_modules/lang/en/block_activity_modules.php +++ b/blocks/activity_modules/lang/en/block_activity_modules.php @@ -23,4 +23,6 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ +$string['activity_modules:addinstance'] = 'Add a new activities block'; +$string['activity_modules:myaddinstance'] = 'Add a new activities block to the My Moodle page'; $string['pluginname'] = 'Activities'; diff --git a/blocks/activity_modules/version.php b/blocks/activity_modules/version.php index 8758d2ceecf79..320921935fc62 100644 --- a/blocks/activity_modules/version.php +++ b/blocks/activity_modules/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'block_activity_modules'; // Full name of the plugin (used for diagnostics) diff --git a/blocks/admin_bookmarks/db/access.php b/blocks/admin_bookmarks/db/access.php new file mode 100644 index 0000000000000..7ff3e92e40915 --- /dev/null +++ b/blocks/admin_bookmarks/db/access.php @@ -0,0 +1,47 @@ +. + +/** + * Admin bookmarks block caps. + * + * @package block_admin_bookmarks + * @copyright Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + + 'block/admin_bookmarks:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), + + 'block/admin_bookmarks:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), +); diff --git a/blocks/admin_bookmarks/lang/en/block_admin_bookmarks.php b/blocks/admin_bookmarks/lang/en/block_admin_bookmarks.php index 8fbd9b380e494..6f78c0d09bbef 100644 --- a/blocks/admin_bookmarks/lang/en/block_admin_bookmarks.php +++ b/blocks/admin_bookmarks/lang/en/block_admin_bookmarks.php @@ -23,5 +23,6 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ +$string['admin_bookmarks:addinstance'] = 'Add a new admin bookmarks block'; +$string['admin_bookmarks:myaddinstance'] = 'Add a new admin bookmarks block to the My Moodle page'; $string['pluginname'] = 'Admin bookmarks'; - diff --git a/blocks/admin_bookmarks/version.php b/blocks/admin_bookmarks/version.php index 87f6ff93b0787..691286c96332f 100644 --- a/blocks/admin_bookmarks/version.php +++ b/blocks/admin_bookmarks/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'block_admin_bookmarks'; // Full name of the plugin (used for diagnostics) diff --git a/blocks/blog_menu/db/access.php b/blocks/blog_menu/db/access.php new file mode 100644 index 0000000000000..205127e79042d --- /dev/null +++ b/blocks/blog_menu/db/access.php @@ -0,0 +1,47 @@ +. + +/** + * Blog menu block caps. + * + * @package block_blog_menu + * @copyright Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + + 'block/blog_menu:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), + + 'block/blog_menu:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), +); diff --git a/blocks/blog_menu/lang/en/block_blog_menu.php b/blocks/blog_menu/lang/en/block_blog_menu.php index 9a715dc9f0a99..60f08a2a47a0b 100644 --- a/blocks/blog_menu/lang/en/block_blog_menu.php +++ b/blocks/blog_menu/lang/en/block_blog_menu.php @@ -23,5 +23,6 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ +$string['blog_menu:addinstance'] = 'Add a new blog menu block'; +$string['blog_menu:myaddinstance'] = 'Add a new blog menu block to the My Moodle page'; $string['pluginname'] = 'Blog menu'; - diff --git a/blocks/blog_menu/version.php b/blocks/blog_menu/version.php index 3ce19886b21d2..0b58ac8abd504 100644 --- a/blocks/blog_menu/version.php +++ b/blocks/blog_menu/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'block_blog_menu'; // Full name of the plugin (used for diagnostics) diff --git a/blocks/blog_recent/db/access.php b/blocks/blog_recent/db/access.php new file mode 100644 index 0000000000000..bcd56e9b8d05d --- /dev/null +++ b/blocks/blog_recent/db/access.php @@ -0,0 +1,47 @@ +. + +/** + * Blog recent block caps. + * + * @package block_blog_recent + * @copyright Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + + 'block/blog_recent:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), + + 'block/blog_recent:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), +); diff --git a/blocks/blog_recent/lang/en/block_blog_recent.php b/blocks/blog_recent/lang/en/block_blog_recent.php index 2315c56e35019..fa1c8b8adf59d 100644 --- a/blocks/blog_recent/lang/en/block_blog_recent.php +++ b/blocks/blog_recent/lang/en/block_blog_recent.php @@ -23,6 +23,8 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ +$string['blog_recent:addinstance'] = 'Add a new recent blog entries block'; +$string['blog_recent:myaddinstance'] = 'Add a new recent blog entries block to the My Moodle page'; $string['norecentblogentries'] = 'No recent entries'; $string['numentriestodisplay'] = 'Number of recent entries to display'; $string['pluginname'] = 'Recent blog entries'; diff --git a/blocks/blog_recent/version.php b/blocks/blog_recent/version.php index dde30e032c5af..9758711d2c404 100644 --- a/blocks/blog_recent/version.php +++ b/blocks/blog_recent/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'block_blog_recent'; // Full name of the plugin (used for diagnostics) diff --git a/blocks/blog_tags/db/access.php b/blocks/blog_tags/db/access.php new file mode 100644 index 0000000000000..d1cd45b58f533 --- /dev/null +++ b/blocks/blog_tags/db/access.php @@ -0,0 +1,47 @@ +. + +/** + * Blog tags block caps. + * + * @package block_blog_tags + * @copyright Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + + 'block/blog_tags:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), + + 'block/blog_tags:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), +); diff --git a/blocks/blog_tags/lang/en/block_blog_tags.php b/blocks/blog_tags/lang/en/block_blog_tags.php index f271d372d2ea6..cc3c25e6f8447 100644 --- a/blocks/blog_tags/lang/en/block_blog_tags.php +++ b/blocks/blog_tags/lang/en/block_blog_tags.php @@ -23,4 +23,6 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ +$string['blog_tags:addinstance'] = 'Add a new blog tags block'; +$string['blog_tags:myaddinstance'] = 'Add a new blog tags block to the My Moodle page'; $string['pluginname'] = 'Blog tags'; diff --git a/blocks/blog_tags/version.php b/blocks/blog_tags/version.php index 2152f9d970b9c..237dd3e9acdbc 100644 --- a/blocks/blog_tags/version.php +++ b/blocks/blog_tags/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'block_blog_tags'; // Full name of the plugin (used for diagnostics) diff --git a/blocks/calendar_month/db/access.php b/blocks/calendar_month/db/access.php new file mode 100644 index 0000000000000..0daa023191406 --- /dev/null +++ b/blocks/calendar_month/db/access.php @@ -0,0 +1,47 @@ +. + +/** + * Calendar month block caps. + * + * @package block_calendar_month + * @copyright Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + + 'block/calendar_month:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), + + 'block/calendar_month:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), +); diff --git a/blocks/calendar_month/lang/en/block_calendar_month.php b/blocks/calendar_month/lang/en/block_calendar_month.php index 8187b3c407da8..887a1ef8378e2 100644 --- a/blocks/calendar_month/lang/en/block_calendar_month.php +++ b/blocks/calendar_month/lang/en/block_calendar_month.php @@ -23,4 +23,6 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ +$string['calendar_month:addinstance'] = 'Add a new calendar block'; +$string['calendar_month:myaddinstance'] = 'Add a new calendar block to the My Moodle page'; $string['pluginname'] = 'Calendar'; diff --git a/blocks/calendar_month/version.php b/blocks/calendar_month/version.php index 449f0889ca673..72db71102dafb 100644 --- a/blocks/calendar_month/version.php +++ b/blocks/calendar_month/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'block_calendar_month'; // Full name of the plugin (used for diagnostics) diff --git a/blocks/calendar_upcoming/db/access.php b/blocks/calendar_upcoming/db/access.php new file mode 100644 index 0000000000000..f323a0bd0e01e --- /dev/null +++ b/blocks/calendar_upcoming/db/access.php @@ -0,0 +1,47 @@ +. + +/** + * Calendar upcoming block caps. + * + * @package block_calendar_upcoming + * @copyright Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + + 'block/calendar_upcoming:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), + + 'block/calendar_upcoming:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), +); diff --git a/blocks/calendar_upcoming/lang/en/block_calendar_upcoming.php b/blocks/calendar_upcoming/lang/en/block_calendar_upcoming.php index 4d33bd945e504..130b716fac4a7 100644 --- a/blocks/calendar_upcoming/lang/en/block_calendar_upcoming.php +++ b/blocks/calendar_upcoming/lang/en/block_calendar_upcoming.php @@ -23,4 +23,6 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ +$string['calendar_upcoming:addinstance'] = 'Add a new upcoming events block'; +$string['calendar_upcoming:myaddinstance'] = 'Add a new upcoming events block to the My Moodle page'; $string['pluginname'] = 'Upcoming events'; diff --git a/blocks/calendar_upcoming/version.php b/blocks/calendar_upcoming/version.php index 86d947bc1b820..e25aba65441a7 100644 --- a/blocks/calendar_upcoming/version.php +++ b/blocks/calendar_upcoming/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'block_calendar_upcoming'; // Full name of the plugin (used for diagnostics) diff --git a/blocks/comments/db/access.php b/blocks/comments/db/access.php new file mode 100644 index 0000000000000..b3b10d36c027e --- /dev/null +++ b/blocks/comments/db/access.php @@ -0,0 +1,47 @@ +. + +/** + * Comments block caps. + * + * @package block_comments + * @copyright Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + + 'block/comments:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), + + 'block/comments:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), +); diff --git a/blocks/comments/lang/en/block_comments.php b/blocks/comments/lang/en/block_comments.php index ead57dbaf5242..01c919adbafed 100644 --- a/blocks/comments/lang/en/block_comments.php +++ b/blocks/comments/lang/en/block_comments.php @@ -23,4 +23,6 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ +$string['comments:myaddinstance'] = 'Add a new comments block to the My Moodle page'; +$string['comments:addinstance'] = 'Add a new comments block'; $string['pluginname'] = 'Comments'; diff --git a/blocks/comments/version.php b/blocks/comments/version.php index db0ee48d93350..e1b711837d96d 100644 --- a/blocks/comments/version.php +++ b/blocks/comments/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'block_comments'; // Full name of the plugin (used for diagnostics) diff --git a/blocks/community/db/access.php b/blocks/community/db/access.php new file mode 100644 index 0000000000000..4242ee569a7d9 --- /dev/null +++ b/blocks/community/db/access.php @@ -0,0 +1,47 @@ +. + +/** + * Community block caps. + * + * @package block_community + * @copyright Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + + 'block/community:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), + + 'block/community:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), +); diff --git a/blocks/community/lang/en/block_community.php b/blocks/community/lang/en/block_community.php index ec78b5ad2c2d4..ef509e315010f 100644 --- a/blocks/community/lang/en/block_community.php +++ b/blocks/community/lang/en/block_community.php @@ -19,7 +19,7 @@ * Strings for component 'block_community', language 'en', branch 'MOODLE_20_STABLE' * * @package block_community - * @author Jerome Mouneyrac + * @author Jerome Mouneyrac * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ @@ -37,6 +37,8 @@ $string['blocks'] = 'Blocks'; $string['cannotselecttopsubject'] = 'Cannot select a top subject level'; $string['comments'] = 'Comments ({$a})'; +$string['community:addinstance'] = 'Add a new community finder block'; +$string['community:myaddinstance'] = 'Add a new community finder block to the My Moodle page'; $string['contentinfo'] = 'Subject: {$a->subject} - Audience: {$a->audience} - Educational level: {$a->educationallevel}'; $string['continue'] = 'Continue'; $string['contributors'] = ' - Contributors: {$a}'; diff --git a/blocks/community/version.php b/blocks/community/version.php index 18ca3c43fdcb7..77cf6081ca2b2 100644 --- a/blocks/community/version.php +++ b/blocks/community/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'block_community'; // Full name of the plugin (used for diagnostics) diff --git a/blocks/completionstatus/db/access.php b/blocks/completionstatus/db/access.php new file mode 100644 index 0000000000000..91213c397eb50 --- /dev/null +++ b/blocks/completionstatus/db/access.php @@ -0,0 +1,47 @@ +. + +/** + * Completion status block caps. + * + * @package block_completionstatus + * @copyright Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + + 'block/completionstatus:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), + + 'block/completionstatus:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), +); diff --git a/blocks/completionstatus/lang/en/block_completionstatus.php b/blocks/completionstatus/lang/en/block_completionstatus.php index 6658c17dff4c0..3c90759f70b62 100644 --- a/blocks/completionstatus/lang/en/block_completionstatus.php +++ b/blocks/completionstatus/lang/en/block_completionstatus.php @@ -1,6 +1,31 @@ . + +/** + * Strings for component 'block_completionstatus', language 'en', branch 'MOODLE_20_STABLE' + * + * @package block_completionstatus + * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + $string['completionprogressdetails'] = 'Completion progress details'; +$string['completionstatus:addinstance'] = 'Add a new course completion status block'; +$string['completionstatus:myaddinstance'] = 'Add a new course completion status block to the My Moodle page'; $string['criteriagroup'] = 'Criteria group'; $string['firstofsecond'] = '{$a->first} of {$a->second}'; $string['pluginname'] = 'Course completion status'; diff --git a/blocks/completionstatus/version.php b/blocks/completionstatus/version.php index f47016c9c3514..c9fc3df83b91e 100644 --- a/blocks/completionstatus/version.php +++ b/blocks/completionstatus/version.php @@ -26,7 +26,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'block_completionstatus'; $plugin->dependencies = array('report_completion' => 2012061700); \ No newline at end of file diff --git a/blocks/course_list/db/access.php b/blocks/course_list/db/access.php new file mode 100644 index 0000000000000..8dfbfa686b506 --- /dev/null +++ b/blocks/course_list/db/access.php @@ -0,0 +1,47 @@ +. + +/** + * Course list block caps. + * + * @package block_course_list + * @copyright Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + + 'block/course_list:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), + + 'block/course_list:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), +); diff --git a/blocks/course_list/lang/en/block_course_list.php b/blocks/course_list/lang/en/block_course_list.php index 4e79fc13a4bdb..4265f45527c66 100644 --- a/blocks/course_list/lang/en/block_course_list.php +++ b/blocks/course_list/lang/en/block_course_list.php @@ -27,6 +27,8 @@ $string['allcourses'] = 'Admin user sees all courses'; $string['configadminview'] = 'What should the admin see in the course list block?'; $string['confighideallcourseslink'] = 'Hide "All courses" link at the bottom of the block. Link hiding does not affects Admin\'s view'; +$string['course_list:addinstance'] = 'Add a new courses block'; +$string['course_list:myaddinstance'] = 'Add a new courses block to the My Moodle page'; $string['hideallcourseslink'] = 'Hide All courses link'; $string['owncourses'] = 'Admin user sees own courses'; $string['pluginname'] = 'Courses'; diff --git a/blocks/course_list/version.php b/blocks/course_list/version.php index 79ab1afa49667..d30f69b5e8d1e 100644 --- a/blocks/course_list/version.php +++ b/blocks/course_list/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'block_course_list'; // Full name of the plugin (used for diagnostics) diff --git a/blocks/course_overview/db/access.php b/blocks/course_overview/db/access.php new file mode 100644 index 0000000000000..15ecf2c64877c --- /dev/null +++ b/blocks/course_overview/db/access.php @@ -0,0 +1,47 @@ +. + +/** + * Course overview block caps. + * + * @package block_course_overview + * @copyright Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + + 'block/course_overview:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), + + 'block/course_overview:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), +); diff --git a/blocks/course_overview/lang/en/block_course_overview.php b/blocks/course_overview/lang/en/block_course_overview.php index 0419efcf9e25b..d7be8555e25c4 100644 --- a/blocks/course_overview/lang/en/block_course_overview.php +++ b/blocks/course_overview/lang/en/block_course_overview.php @@ -21,12 +21,14 @@ * @copyright 2012 Adam Olley * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -$string['pluginname'] = 'Course overview'; + $string['activityoverview'] = 'You have {$a}s that need attention'; $string['alwaysshowall'] = 'Always Show All'; $string['collapseall'] = 'Collapse All Course Lists'; $string['configotherexpanded'] = 'If enabled, Other Courses will be expanded by default unless overriden by user preferences.'; $string['configpreservestates'] = 'If enabled, the collapsed/expanded states set by the user are stored and used on each load.'; +$string['course_overview:addinstance'] = 'Add a new course overview block'; +$string['course_overview:myaddinstance'] = 'Add a new course overview block to the My Moodle page'; $string['defaultmaxcourses'] = 'Default maximum courses'; $string['defaultmaxcoursesdesc'] = 'Maximum courses which should be displayed on course overview block, 0 will show all courses'; $string['expandall'] = 'Expand All Course Lists'; @@ -39,6 +41,7 @@ $string['movecoursehere'] = 'Move course here'; $string['numtodisplay'] = 'Number of courses to display: '; $string['otherexpanded'] = 'Other Courses Expanded'; +$string['pluginname'] = 'Course overview'; $string['preservestates'] = 'Preserve Expanded States'; $string['shortnameprefix'] = 'Includes {$a}'; $string['shortnamesufixsingular'] = ' (and {$a} other)'; @@ -50,4 +53,4 @@ $string['view_edit_profile'] = '(View and edit your profile.)'; $string['welcome'] = 'Welcome {$a}'; $string['youhavemessages'] = 'You have {$a} unread '; -$string['youhavenomessages'] = 'You have no unread '; \ No newline at end of file +$string['youhavenomessages'] = 'You have no unread '; diff --git a/blocks/course_overview/version.php b/blocks/course_overview/version.php index 4208588dab713..787f52b8a9d1c 100644 --- a/blocks/course_overview/version.php +++ b/blocks/course_overview/version.php @@ -24,6 +24,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012062800; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'block_course_overview'; // Full name of the plugin (used for diagnostics) \ No newline at end of file diff --git a/blocks/course_summary/db/access.php b/blocks/course_summary/db/access.php new file mode 100644 index 0000000000000..b34a101d8507c --- /dev/null +++ b/blocks/course_summary/db/access.php @@ -0,0 +1,47 @@ +. + +/** + * Course summary block caps. + * + * @package block_course_summary + * @copyright Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + + 'block/course_summary:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), + + 'block/course_summary:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), +); diff --git a/blocks/course_summary/lang/en/block_course_summary.php b/blocks/course_summary/lang/en/block_course_summary.php index ca2b53b92c2dd..836cbfc9a4f59 100644 --- a/blocks/course_summary/lang/en/block_course_summary.php +++ b/blocks/course_summary/lang/en/block_course_summary.php @@ -24,4 +24,6 @@ */ $string['coursesummary'] = 'Course summary'; +$string['course_summary:addinstance'] = 'Add a new course/site description block'; +$string['course_summary:myaddinstance'] = 'Add a new course/site description block to the My Moodle page'; $string['pluginname'] = 'Course/Site description'; diff --git a/blocks/course_summary/version.php b/blocks/course_summary/version.php index 482a4cb40c865..5e9801f6cf5c8 100644 --- a/blocks/course_summary/version.php +++ b/blocks/course_summary/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'block_course_summary'; // Full name of the plugin (used for diagnostics) diff --git a/blocks/feedback/db/access.php b/blocks/feedback/db/access.php new file mode 100644 index 0000000000000..79829ec7de4e4 --- /dev/null +++ b/blocks/feedback/db/access.php @@ -0,0 +1,47 @@ +. + +/** + * Feedback block caps. + * + * @package block_feedback + * @copyright Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + + 'block/feedback:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), + + 'block/feedback:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), +); diff --git a/blocks/feedback/lang/en/block_feedback.php b/blocks/feedback/lang/en/block_feedback.php index 8d1bca4e6fe9c..ab696135c3254 100644 --- a/blocks/feedback/lang/en/block_feedback.php +++ b/blocks/feedback/lang/en/block_feedback.php @@ -1,5 +1,30 @@ . + +/** + * Strings for component 'block_feedback', language 'en', branch 'MOODLE_20_STABLE' + * + * @package block_feedback + * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + $string['feedback'] = 'Feedback'; +$string['feedback:addinstance'] = 'Add a new feedback block'; +$string['feedback:myaddinstance'] = 'Add a new feedback block to the My Moodle page'; $string['missing_feedback_module'] = 'This blocks relies on the Feedback activity module, but that module is not present!'; +$string['pluginname'] = 'Feedback'; diff --git a/blocks/feedback/version.php b/blocks/feedback/version.php index cd36d5f401ef4..dee24211210da 100644 --- a/blocks/feedback/version.php +++ b/blocks/feedback/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'block_feedback'; // Full name of the plugin (used for diagnostics) diff --git a/blocks/glossary_random/db/access.php b/blocks/glossary_random/db/access.php new file mode 100644 index 0000000000000..f4c9bfeadf1b0 --- /dev/null +++ b/blocks/glossary_random/db/access.php @@ -0,0 +1,47 @@ +. + +/** + * Glossary random block caps. + * + * @package block_glossary_random + * @copyright Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + + 'block/glossary_random:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), + + 'block/glossary_random:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), +); diff --git a/blocks/glossary_random/lang/en/block_glossary_random.php b/blocks/glossary_random/lang/en/block_glossary_random.php index efcb980200f83..ddb483d0c733e 100644 --- a/blocks/glossary_random/lang/en/block_glossary_random.php +++ b/blocks/glossary_random/lang/en/block_glossary_random.php @@ -27,6 +27,8 @@ $string['askaddentry'] = 'When users can add entries to the glossary, show a link with this text'; $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'; diff --git a/blocks/glossary_random/version.php b/blocks/glossary_random/version.php index 7a4ef6e08843d..1d70116888d26 100644 --- a/blocks/glossary_random/version.php +++ b/blocks/glossary_random/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'block_glossary_random'; // Full name of the plugin (used for diagnostics) diff --git a/blocks/html/db/access.php b/blocks/html/db/access.php new file mode 100644 index 0000000000000..e0e9e07f01485 --- /dev/null +++ b/blocks/html/db/access.php @@ -0,0 +1,47 @@ +. + +/** + * HTML block caps. + * + * @package block_html + * @copyright Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + + 'block/html:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), + + 'block/html:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), +); diff --git a/blocks/html/lang/en/block_html.php b/blocks/html/lang/en/block_html.php index d331059e3f7ae..47ebe4ab32b22 100644 --- a/blocks/html/lang/en/block_html.php +++ b/blocks/html/lang/en/block_html.php @@ -29,6 +29,8 @@ $string['configclasses_help'] = 'The purpose of this configuration is to aid with theming by helping distinguish HTML blocks from each other. Any CSS classes entered here (space delimited) will be appended to the block\'s default classes.'; $string['configcontent'] = 'Content'; $string['configtitle'] = 'Block title'; +$string['html:addinstance'] = 'Add a new HTML block'; +$string['html:myaddinstance'] = 'Add a new HTML block to the My Moodle page'; $string['leaveblanktohide'] = 'leave blank to hide the title'; $string['newhtmlblock'] = '(new HTML block)'; $string['pluginname'] = 'HTML'; diff --git a/blocks/html/version.php b/blocks/html/version.php index 8ebbc49e20c51..94b1efdd23e7e 100644 --- a/blocks/html/version.php +++ b/blocks/html/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'block_html'; // Full name of the plugin (used for diagnostics) diff --git a/blocks/login/db/access.php b/blocks/login/db/access.php new file mode 100644 index 0000000000000..42776ca688257 --- /dev/null +++ b/blocks/login/db/access.php @@ -0,0 +1,47 @@ +. + +/** + * Login block caps. + * + * @package block_login + * @copyright Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + + 'block/login:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), + + 'block/login:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), +); diff --git a/blocks/login/lang/en/block_login.php b/blocks/login/lang/en/block_login.php index 1d5f117ffe4ef..83dd8dca3f0d6 100644 --- a/blocks/login/lang/en/block_login.php +++ b/blocks/login/lang/en/block_login.php @@ -23,4 +23,6 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ +$string['login:addinstance'] = 'Add a new login block'; +$string['login:myaddinstance'] = 'Add a new login block to the My Moodle page'; $string['pluginname'] = 'Login'; diff --git a/blocks/login/version.php b/blocks/login/version.php index 60fead7fcb9b0..78f4d670bac2c 100644 --- a/blocks/login/version.php +++ b/blocks/login/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'block_login'; // Full name of the plugin (used for diagnostics) diff --git a/blocks/mentees/db/access.php b/blocks/mentees/db/access.php new file mode 100644 index 0000000000000..cae7a4661bfd6 --- /dev/null +++ b/blocks/mentees/db/access.php @@ -0,0 +1,47 @@ +. + +/** + * Mentees block caps. + * + * @package block_mentees + * @copyright Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + + 'block/mentees:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), + + 'block/mentees:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), +); diff --git a/blocks/mentees/lang/en/block_mentees.php b/blocks/mentees/lang/en/block_mentees.php index 7b443bbbc5215..3a220578139d4 100644 --- a/blocks/mentees/lang/en/block_mentees.php +++ b/blocks/mentees/lang/en/block_mentees.php @@ -26,5 +26,7 @@ $string['configtitle'] = 'Block title'; $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'; diff --git a/blocks/mentees/version.php b/blocks/mentees/version.php index 1642f311e8fb3..66f51a7de960a 100644 --- a/blocks/mentees/version.php +++ b/blocks/mentees/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'block_mentees'; // Full name of the plugin (used for diagnostics) diff --git a/blocks/messages/db/access.php b/blocks/messages/db/access.php new file mode 100644 index 0000000000000..9a8e7a1a13d45 --- /dev/null +++ b/blocks/messages/db/access.php @@ -0,0 +1,47 @@ +. + +/** + * Messages block caps. + * + * @package block_messages + * @copyright Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + + 'block/messages:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), + + 'block/messages:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), +); diff --git a/blocks/messages/lang/en/block_messages.php b/blocks/messages/lang/en/block_messages.php index 6f91fa3e503b7..b542a7a47745d 100644 --- a/blocks/messages/lang/en/block_messages.php +++ b/blocks/messages/lang/en/block_messages.php @@ -23,4 +23,6 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ +$string['messages:addinstance'] = 'Add a new messages block'; +$string['messages:myaddinstance'] = 'Add a new messages block to the My Moodle page'; $string['pluginname'] = 'Messages'; diff --git a/blocks/messages/version.php b/blocks/messages/version.php index 93c6a9140183e..8482826e0ea02 100644 --- a/blocks/messages/version.php +++ b/blocks/messages/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'block_messages'; // Full name of the plugin (used for diagnostics) diff --git a/blocks/mnet_hosts/db/access.php b/blocks/mnet_hosts/db/access.php new file mode 100644 index 0000000000000..2800a3df838ca --- /dev/null +++ b/blocks/mnet_hosts/db/access.php @@ -0,0 +1,47 @@ +. + +/** + * Mnet hosts block caps. + * + * @package block_mnet_hosts + * @copyright Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + + 'block/mnet_hosts:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), + + 'block/mnet_hosts:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), +); diff --git a/blocks/mnet_hosts/lang/en/block_mnet_hosts.php b/blocks/mnet_hosts/lang/en/block_mnet_hosts.php index c8e273e96092e..1da1a2adb2d8d 100644 --- a/blocks/mnet_hosts/lang/en/block_mnet_hosts.php +++ b/blocks/mnet_hosts/lang/en/block_mnet_hosts.php @@ -26,5 +26,7 @@ $string['error_authmnetneeded'] = 'MNet authentication plugin must be enabled to see the list of MNet network servers'; $string['error_localusersonly'] = 'Remote users can not jump to other MNet network servers from this host'; $string['error_roamcapabilityneeded'] = 'Users need the capability \'Roam to a remote application via MNet\' to see the list of MNet network servers'; +$string['mnet_hosts:addinstance'] = 'Add a new network servers block'; +$string['mnet_hosts:myaddinstance'] = 'Add a new network servers block to the My Moodle page'; $string['pluginname'] = 'Network servers'; $string['server'] = 'Server'; diff --git a/blocks/mnet_hosts/version.php b/blocks/mnet_hosts/version.php index 2548a40bfec5f..8f936c5bc747b 100644 --- a/blocks/mnet_hosts/version.php +++ b/blocks/mnet_hosts/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'block_mnet_hosts'; // Full name of the plugin (used for diagnostics) diff --git a/blocks/moodleblock.class.php b/blocks/moodleblock.class.php index d5a20a254ac7b..c7ef9376c95b7 100644 --- a/blocks/moodleblock.class.php +++ b/blocks/moodleblock.class.php @@ -558,20 +558,48 @@ function user_can_edit() { function user_can_addto($page) { global $USER; - if (has_capability('moodle/block:edit', $page->context)) { + $capability = 'block/' . $this->name() . ':addinstance'; + if ($this->has_add_block_capability($page, $capability) + && has_capability('moodle/block:edit', $page->context)) { return true; } // 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 - && $page->context->instanceid == $USER->id) { // Page belongs to this user - return has_capability('moodle/my:manageblocks', $page->context); + && $page->context->contextlevel == CONTEXT_USER // Page belongs to a user + && $page->context->instanceid == $USER->id) { // Page belongs to this user + $capability = 'block/' . $this->name() . ':myaddinstance'; + return $this->has_add_block_capability($page, $capability) + && has_capability('moodle/my:manageblocks', $page->context); } return false; } + /** + * Returns true if the user can add a block to a page. + * + * @param moodle_page $page + * @param string $capability the capability to check + * @return boolean true if user can add a block, false otherwise. + */ + private function has_add_block_capability($page, $capability) { + // Check if the capability exists. + if (!get_capability_info($capability)) { + // Debug warning that the capability does not exist, but no more than once per page. + static $warned = array(); + if (!isset($warned[$this->name()])) { + debugging('The block ' .$this->name() . ' does not define the standard capability ' . + $capability , DEBUG_DEVELOPER); + $warned[$this->name()] = 1; + } + // If the capability does not exist, the block can always be added. + return true; + } else { + return has_capability($capability, $page->context); + } + } + static function get_extra_capabilities() { return array('moodle/block:view', 'moodle/block:edit'); } diff --git a/blocks/myprofile/db/access.php b/blocks/myprofile/db/access.php new file mode 100644 index 0000000000000..413ab165cc096 --- /dev/null +++ b/blocks/myprofile/db/access.php @@ -0,0 +1,47 @@ +. + +/** + * My profile block caps. + * + * @package block_myprofile + * @copyright Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + + 'block/myprofile:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), + + 'block/myprofile:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), +); diff --git a/blocks/myprofile/lang/en/block_myprofile.php b/blocks/myprofile/lang/en/block_myprofile.php index 74dea91236225..450b640cd5589 100644 --- a/blocks/myprofile/lang/en/block_myprofile.php +++ b/blocks/myprofile/lang/en/block_myprofile.php @@ -24,8 +24,6 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -$string['pluginname'] = 'Logged in user'; -$string['myprofile_settings'] = 'Visible user information'; $string['contentsettings'] = 'Display settings for content region'; $string['display_picture'] = 'Display picture'; $string['display_country'] = 'Display country'; @@ -45,3 +43,7 @@ $string['display_lastaccess'] = 'Display last access'; $string['display_currentlogin'] = 'Display current login'; $string['display_lastip'] = 'Display last IP'; +$string['myprofile:addinstance'] = 'Add a new logged in user block'; +$string['myprofile:myaddinstance'] = 'Add a new logged in user block to the My Moodle page'; +$string['myprofile_settings'] = 'Visible user information'; +$string['pluginname'] = 'Logged in user'; diff --git a/blocks/myprofile/version.php b/blocks/myprofile/version.php index 9e8f652af6264..a2bbdcb2f7df4 100644 --- a/blocks/myprofile/version.php +++ b/blocks/myprofile/version.php @@ -26,6 +26,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'block_myprofile'; // Full name of the plugin (used for diagnostics) diff --git a/blocks/navigation/db/access.php b/blocks/navigation/db/access.php new file mode 100644 index 0000000000000..bdc6b8a395a85 --- /dev/null +++ b/blocks/navigation/db/access.php @@ -0,0 +1,47 @@ +. + +/** + * Navigation block caps. + * + * @package block_navigation + * @copyright Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + + 'block/navigation:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), + + 'block/navigation:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), +); diff --git a/blocks/navigation/lang/en/block_navigation.php b/blocks/navigation/lang/en/block_navigation.php index 1fb2aa3f191bb..c00d802f19916 100644 --- a/blocks/navigation/lang/en/block_navigation.php +++ b/blocks/navigation/lang/en/block_navigation.php @@ -31,6 +31,8 @@ $string['enabledockdesc'] = 'Allow the user to dock this block'; $string['expansionlimit'] = 'Generate navigation for the following'; $string['linkcategoriesdesc'] = 'Display categories as links'; +$string['navigation:addinstance'] = 'Add a new navigation block'; +$string['navigation:myaddinstance'] = 'Add a new navigation block to the My Moodle page'; $string['pluginname'] = 'Navigation'; $string['trimmode'] = 'Trim mode'; $string['trimmoderight'] = 'Trim characters from the right'; diff --git a/blocks/navigation/version.php b/blocks/navigation/version.php index b6454c733ede0..8fa942a5fc35f 100644 --- a/blocks/navigation/version.php +++ b/blocks/navigation/version.php @@ -24,6 +24,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'block_navigation'; // Full name of the plugin (used for diagnostics) diff --git a/blocks/news_items/db/access.php b/blocks/news_items/db/access.php new file mode 100644 index 0000000000000..72b1aa689aadd --- /dev/null +++ b/blocks/news_items/db/access.php @@ -0,0 +1,47 @@ +. + +/** + * News items block caps. + * + * @package block_news_items + * @copyright Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + + 'block/news_items:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), + + 'block/news_items:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), +); diff --git a/blocks/news_items/lang/en/block_news_items.php b/blocks/news_items/lang/en/block_news_items.php index d13568af95315..d1ab3d86cbbff 100644 --- a/blocks/news_items/lang/en/block_news_items.php +++ b/blocks/news_items/lang/en/block_news_items.php @@ -23,4 +23,6 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ +$string['news_items:addinstance'] = 'Add a new latest news block'; +$string['news_items:myaddinstance'] = 'Add a new navigation block to the My Moodle page'; $string['pluginname'] = 'Latest news'; diff --git a/blocks/news_items/version.php b/blocks/news_items/version.php index 19f981432d56a..1c9e875298c26 100644 --- a/blocks/news_items/version.php +++ b/blocks/news_items/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'block_news_items'; // Full name of the plugin (used for diagnostics) diff --git a/blocks/online_users/db/access.php b/blocks/online_users/db/access.php index ff00c60bb0037..bcfcfe60ee835 100644 --- a/blocks/online_users/db/access.php +++ b/blocks/online_users/db/access.php @@ -26,6 +26,25 @@ $capabilities = array( + 'block/online_users:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), + + 'block/online_users:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), + 'block/online_users:viewlist' => array( 'captype' => 'read', @@ -40,5 +59,3 @@ ) ) ); - - diff --git a/blocks/online_users/lang/en/block_online_users.php b/blocks/online_users/lang/en/block_online_users.php index 360ef48fa3852..034fce5fc5aa9 100644 --- a/blocks/online_users/lang/en/block_online_users.php +++ b/blocks/online_users/lang/en/block_online_users.php @@ -24,6 +24,8 @@ */ $string['configtimetosee'] = 'Number of minutes determining the period of inactivity after which a user is no longer considered to be online.'; +$string['online_users:addinstance'] = 'Add a new online users block'; +$string['online_users:myaddinstance'] = 'Add a new online users block to the My Moodle page'; $string['online_users:viewlist'] = 'View list of online users'; $string['periodnminutes'] = 'last {$a} minutes'; $string['pluginname'] = 'Online users'; diff --git a/blocks/online_users/version.php b/blocks/online_users/version.php index 34e50b512f175..5afa7ebd43f75 100644 --- a/blocks/online_users/version.php +++ b/blocks/online_users/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'block_online_users'; // Full name of the plugin (used for diagnostics) diff --git a/blocks/participants/db/access.php b/blocks/participants/db/access.php new file mode 100644 index 0000000000000..fcf3812fdac99 --- /dev/null +++ b/blocks/participants/db/access.php @@ -0,0 +1,47 @@ +. + +/** + * Participants block caps. + * + * @package block_participants + * @copyright Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + + 'block/participants:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), + + 'block/participants:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), +); diff --git a/blocks/participants/lang/en/block_participants.php b/blocks/participants/lang/en/block_participants.php index 134399646b17c..fc2ec8b501113 100644 --- a/blocks/participants/lang/en/block_participants.php +++ b/blocks/participants/lang/en/block_participants.php @@ -23,4 +23,6 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ +$string['participants:addinstance'] = 'Add a new people block'; +$string['participants:myaddinstance'] = 'Add a new people block to the My Moodle page'; $string['pluginname'] = 'People'; diff --git a/blocks/participants/version.php b/blocks/participants/version.php index ca8564f78354a..eaa18599b5ccc 100644 --- a/blocks/participants/version.php +++ b/blocks/participants/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'block_participants'; // Full name of the plugin (used for diagnostics) diff --git a/blocks/private_files/db/access.php b/blocks/private_files/db/access.php new file mode 100644 index 0000000000000..f2d059e687653 --- /dev/null +++ b/blocks/private_files/db/access.php @@ -0,0 +1,47 @@ +. + +/** + * Private files block caps. + * + * @package block_private_files + * @copyright Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + + 'block/private_files:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), + + 'block/private_files:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), +); diff --git a/blocks/private_files/lang/en/block_private_files.php b/blocks/private_files/lang/en/block_private_files.php index e3970e6fa3ba3..b672ddeb92a01 100644 --- a/blocks/private_files/lang/en/block_private_files.php +++ b/blocks/private_files/lang/en/block_private_files.php @@ -26,3 +26,6 @@ $string['managemyfiles'] = 'Manage my files'; $string['pluginname'] = 'My private files'; $string['privatefiles'] = 'Private files'; +$string['private_files:addinstance'] = 'Add a new private files block'; +$string['private_files:myaddinstance'] = 'Add a new private files block to the My Moodle page'; + diff --git a/blocks/private_files/version.php b/blocks/private_files/version.php index d2737bf633505..3f5ec71ac5f8a 100644 --- a/blocks/private_files/version.php +++ b/blocks/private_files/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'block_private_files'; // Full name of the plugin (used for diagnostics) diff --git a/blocks/quiz_results/db/access.php b/blocks/quiz_results/db/access.php new file mode 100644 index 0000000000000..e410cff8f78ec --- /dev/null +++ b/blocks/quiz_results/db/access.php @@ -0,0 +1,47 @@ +. + +/** + * Quiz results block caps. + * + * @package block_quiz_results + * @copyright Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + + 'block/quiz_results:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), + + 'block/quiz_results:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), +); diff --git a/blocks/quiz_results/lang/en/block_quiz_results.php b/blocks/quiz_results/lang/en/block_quiz_results.php index b3bda7ff4f0f0..a035cbc4126e1 100644 --- a/blocks/quiz_results/lang/en/block_quiz_results.php +++ b/blocks/quiz_results/lang/en/block_quiz_results.php @@ -46,6 +46,8 @@ $string['error_emptyquizrecord'] = 'There is an error right now with this block: the selected quiz does not seem to exist in the database.'; $string['error_nogroupsexist'] = 'There is an error right now with this block: it is set to display grades in group mode, but the course has no defined groups.'; $string['pluginname'] = 'Quiz results'; +$string['quiz_results:addinstance'] = 'Add a new quiz results block'; +$string['quiz_results:myaddinstance'] = 'Add a new quiz results block to the My Moodle page'; $string['worstgrade'] = 'The lowest grade:'; $string['worstgrades'] = 'The {$a} lowest grades:'; $string['worstgroupgrade'] = 'The group with the lowest average:'; diff --git a/blocks/quiz_results/version.php b/blocks/quiz_results/version.php index eb8a929873c23..22eeac757f8d4 100644 --- a/blocks/quiz_results/version.php +++ b/blocks/quiz_results/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'block_quiz_results'; // Full name of the plugin (used for diagnostics) diff --git a/blocks/recent_activity/db/access.php b/blocks/recent_activity/db/access.php new file mode 100644 index 0000000000000..249b35e5f6b78 --- /dev/null +++ b/blocks/recent_activity/db/access.php @@ -0,0 +1,47 @@ +. + +/** + * Recent activity block caps. + * + * @package block_recent_activity + * @copyright Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + + 'block/recent_activity:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), + + 'block/recent_activity:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), +); diff --git a/blocks/recent_activity/lang/en/block_recent_activity.php b/blocks/recent_activity/lang/en/block_recent_activity.php index 9284efd5297a0..6d47dce433137 100644 --- a/blocks/recent_activity/lang/en/block_recent_activity.php +++ b/blocks/recent_activity/lang/en/block_recent_activity.php @@ -24,3 +24,5 @@ */ $string['pluginname'] = 'Recent activity'; +$string['recent_activity:addinstance'] = 'Add a new recent activity block'; +$string['recent_activity:myaddinstance'] = 'Add a new recent activity block to the My Moodle page'; diff --git a/blocks/recent_activity/version.php b/blocks/recent_activity/version.php index 006ae718d5155..9eefc82ca7f62 100644 --- a/blocks/recent_activity/version.php +++ b/blocks/recent_activity/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'block_recent_activity'; // Full name of the plugin (used for diagnostics) diff --git a/blocks/rss_client/db/access.php b/blocks/rss_client/db/access.php index 6eeb8629d9b73..0f9c77bf3dfcc 100644 --- a/blocks/rss_client/db/access.php +++ b/blocks/rss_client/db/access.php @@ -26,6 +26,25 @@ $capabilities = array( + 'block/rss_client:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), + + 'block/rss_client:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), + 'block/rss_client:manageownfeeds' => array( 'captype' => 'write', diff --git a/blocks/rss_client/lang/en/block_rss_client.php b/blocks/rss_client/lang/en/block_rss_client.php index 33ca8175a12cb..77e161c30b43d 100644 --- a/blocks/rss_client/lang/en/block_rss_client.php +++ b/blocks/rss_client/lang/en/block_rss_client.php @@ -62,10 +62,12 @@ $string['pickfeed'] = 'Pick a news feed'; $string['pluginname'] = 'Remote RSS feeds'; $string['remotenewsfeed'] = 'Remote news feed'; +$string['rss_client:addinstance'] = 'Add a new remote RSS feeds block'; $string['rss_client:createprivatefeeds'] = 'Create private RSS feeds'; $string['rss_client:createsharedfeeds'] = 'Create shared RSS feeds'; $string['rss_client:manageanyfeeds'] = 'Manage any RSS feeds'; $string['rss_client:manageownfeeds'] = 'Manage own RSS feeds'; +$string['rss_client:myaddinstance'] = 'Add a new remote RSS feeds block to the My Moodle page'; $string['seeallfeeds'] = 'See all feeds'; $string['sharedfeed'] = 'Shared feed'; $string['shownumentrieslabel'] = 'Max number entries to show per block.'; diff --git a/blocks/rss_client/version.php b/blocks/rss_client/version.php index 266a8bc25eea0..c19bcfff43d7c 100644 --- a/blocks/rss_client/version.php +++ b/blocks/rss_client/version.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'block_rss_client'; // Full name of the plugin (used for diagnostics) $plugin->cron = 300; // Set min time between cron executions to 300 secs (5 mins) diff --git a/blocks/search_forums/db/access.php b/blocks/search_forums/db/access.php new file mode 100644 index 0000000000000..1034313eabadd --- /dev/null +++ b/blocks/search_forums/db/access.php @@ -0,0 +1,47 @@ +. + +/** + * Search forums block caps. + * + * @package block_search_forums + * @copyright Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + + 'block/search_forums:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), + + 'block/search_forums:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), +); diff --git a/blocks/search_forums/lang/en/block_search_forums.php b/blocks/search_forums/lang/en/block_search_forums.php index d71a51076e485..3b998ba3df3c4 100644 --- a/blocks/search_forums/lang/en/block_search_forums.php +++ b/blocks/search_forums/lang/en/block_search_forums.php @@ -25,3 +25,5 @@ $string['advancedsearch'] = 'Advanced search'; $string['pluginname'] = 'Search forums'; +$string['search_forums:addinstance'] = 'Add a new search forums block'; +$string['search_forums:myaddinstance'] = 'Add a new search forums block for the My Moodle page'; diff --git a/blocks/search_forums/version.php b/blocks/search_forums/version.php index 02039837907b5..8a77b0587bdd4 100644 --- a/blocks/search_forums/version.php +++ b/blocks/search_forums/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'block_search_forums'; // Full name of the plugin (used for diagnostics) diff --git a/blocks/section_links/db/access.php b/blocks/section_links/db/access.php new file mode 100644 index 0000000000000..3b2288c81a74c --- /dev/null +++ b/blocks/section_links/db/access.php @@ -0,0 +1,47 @@ +. + +/** + * Section links block caps. + * + * @package block_section_links + * @copyright Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + + 'block/section_links:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), + + 'block/section_links:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), +); diff --git a/blocks/section_links/lang/en/block_section_links.php b/blocks/section_links/lang/en/block_section_links.php index 57e8c12d1c9b0..c267cd1765419 100644 --- a/blocks/section_links/lang/en/block_section_links.php +++ b/blocks/section_links/lang/en/block_section_links.php @@ -34,5 +34,7 @@ $string['numsections1'] = 'Number of sections'; $string['numsections2'] = 'Alternative number of sections'; $string['pluginname'] = 'Section links'; +$string['section_links:addinstance'] = 'Add a new section links block'; +$string['section_links:myaddinstance'] = 'Add a new section links block to the My Moodle page'; $string['topics'] = 'Topics'; $string['weeks'] = 'Weeks'; diff --git a/blocks/section_links/version.php b/blocks/section_links/version.php index 1bfd4f0ea2c30..9b24bfecbe4ba 100644 --- a/blocks/section_links/version.php +++ b/blocks/section_links/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'block_section_links'; // Full name of the plugin (used for diagnostics) diff --git a/blocks/selfcompletion/db/access.php b/blocks/selfcompletion/db/access.php new file mode 100644 index 0000000000000..ae0b0749fe0d6 --- /dev/null +++ b/blocks/selfcompletion/db/access.php @@ -0,0 +1,47 @@ +. + +/** + * Self completion block caps. + * + * @package block_selfcompletion + * @copyright Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + + 'block/selfcompletion:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), + + 'block/selfcompletion:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), +); diff --git a/blocks/selfcompletion/lang/en/block_selfcompletion.php b/blocks/selfcompletion/lang/en/block_selfcompletion.php index 403d0b2f2a751..e7c89d32ae35e 100644 --- a/blocks/selfcompletion/lang/en/block_selfcompletion.php +++ b/blocks/selfcompletion/lang/en/block_selfcompletion.php @@ -27,3 +27,5 @@ $string['completecourse'] = 'Complete course'; $string['pluginname'] = 'Self completion'; $string['selfcompletionnotenabled'] = 'The self completion criteria has not been enabled for this course'; +$string['selfcompletion:addinstance'] = 'Add a new self completion block'; +$string['selfcompletion:myaddinstance'] = 'Add a new self completion block to the My Moodle page'; diff --git a/blocks/selfcompletion/version.php b/blocks/selfcompletion/version.php index 92a5a56073f52..9fc46d672cae2 100644 --- a/blocks/selfcompletion/version.php +++ b/blocks/selfcompletion/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'block_selfcompletion'; // Full name of the plugin (used for diagnostics) diff --git a/blocks/settings/db/access.php b/blocks/settings/db/access.php new file mode 100644 index 0000000000000..257f46e18b7ae --- /dev/null +++ b/blocks/settings/db/access.php @@ -0,0 +1,47 @@ +. + +/** + * Settings block caps. + * + * @package block_settings + * @copyright Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + + 'block/settings:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), + + 'block/settings:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), +); diff --git a/blocks/settings/lang/en/block_settings.php b/blocks/settings/lang/en/block_settings.php index 51a7d50e8aa08..356384306ef68 100644 --- a/blocks/settings/lang/en/block_settings.php +++ b/blocks/settings/lang/en/block_settings.php @@ -26,3 +26,5 @@ $string['enabledock'] = 'Allow the user to dock this block'; $string['pluginname'] = 'Settings'; +$string['settings:addinstance'] = 'Add a new settings block'; +$string['settings:myaddinstance'] = 'Add a new settings block to the My Moodle page'; diff --git a/blocks/settings/version.php b/blocks/settings/version.php index 686672b70e4be..9740627c6f9d6 100644 --- a/blocks/settings/version.php +++ b/blocks/settings/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'block_settings'; // Full name of the plugin (used for diagnostics) diff --git a/blocks/site_main_menu/db/access.php b/blocks/site_main_menu/db/access.php new file mode 100644 index 0000000000000..4f5d0fdbe28c5 --- /dev/null +++ b/blocks/site_main_menu/db/access.php @@ -0,0 +1,47 @@ +. + +/** + * Site main menu block caps. + * + * @package block_site_main_menu + * @copyright Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + + 'block/site_main_menu:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), + + 'block/site_main_menu:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), +); diff --git a/blocks/site_main_menu/lang/en/block_site_main_menu.php b/blocks/site_main_menu/lang/en/block_site_main_menu.php index f4c92fc9e1e95..0a2f4785e9e23 100644 --- a/blocks/site_main_menu/lang/en/block_site_main_menu.php +++ b/blocks/site_main_menu/lang/en/block_site_main_menu.php @@ -24,4 +24,5 @@ */ $string['pluginname'] = 'Main menu'; - +$string['site_main_menu:addinstance'] = 'Add a new main menu block'; +$string['site_main_menu:myaddinstance'] = 'Add a new main menu block to the My Moodle page'; diff --git a/blocks/site_main_menu/version.php b/blocks/site_main_menu/version.php index 0930f06faaac5..931c4339659a5 100644 --- a/blocks/site_main_menu/version.php +++ b/blocks/site_main_menu/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'block_site_main_menu'; // Full name of the plugin (used for diagnostics) diff --git a/blocks/social_activities/db/access.php b/blocks/social_activities/db/access.php new file mode 100644 index 0000000000000..e33ec2cbac516 --- /dev/null +++ b/blocks/social_activities/db/access.php @@ -0,0 +1,47 @@ +. + +/** + * Social activities block caps. + * + * @package block_social_activities + * @copyright Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + + 'block/social_activities:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), + + 'block/social_activities:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), +); diff --git a/blocks/social_activities/lang/en/block_social_activities.php b/blocks/social_activities/lang/en/block_social_activities.php index 16d91eeecbd61..abb566667bb69 100644 --- a/blocks/social_activities/lang/en/block_social_activities.php +++ b/blocks/social_activities/lang/en/block_social_activities.php @@ -24,3 +24,5 @@ */ $string['pluginname'] = 'Social activities'; +$string['social_activities:addinstance'] = 'Add a new social activities block'; +$string['social_activities:myaddinstance'] = 'Add a new social activities block to the My Moodle page'; diff --git a/blocks/social_activities/version.php b/blocks/social_activities/version.php index 26002a0cedd8e..beb85635dedce 100644 --- a/blocks/social_activities/version.php +++ b/blocks/social_activities/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'block_social_activities'; // Full name of the plugin (used for diagnostics) diff --git a/blocks/tag_flickr/db/access.php b/blocks/tag_flickr/db/access.php new file mode 100644 index 0000000000000..bf88cdf879ab9 --- /dev/null +++ b/blocks/tag_flickr/db/access.php @@ -0,0 +1,47 @@ +. + +/** + * Tag flickr block caps. + * + * @package block_tag_flickr + * @copyright Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + + 'block/tag_flickr:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), + + 'block/tag_flickr:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), +); diff --git a/blocks/tag_flickr/lang/en/block_tag_flickr.php b/blocks/tag_flickr/lang/en/block_tag_flickr.php index 76f8e8a5eb3e2..6dc31725ef634 100644 --- a/blocks/tag_flickr/lang/en/block_tag_flickr.php +++ b/blocks/tag_flickr/lang/en/block_tag_flickr.php @@ -37,3 +37,5 @@ $string['pluginname'] = 'Flickr'; $string['relevance'] = 'Relevance'; $string['sortby'] = 'Sort by'; +$string['tag_flickr:addinstance'] = 'Add a new flickr block'; +$string['tag_flickr:myaddinstance'] = 'Add a new flickr block to the My Moodle page'; diff --git a/blocks/tag_flickr/version.php b/blocks/tag_flickr/version.php index 32889146359a8..89a4226e29eba 100644 --- a/blocks/tag_flickr/version.php +++ b/blocks/tag_flickr/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'block_tag_flickr'; // Full name of the plugin (used for diagnostics) diff --git a/blocks/tag_youtube/db/access.php b/blocks/tag_youtube/db/access.php new file mode 100644 index 0000000000000..6000d12a63510 --- /dev/null +++ b/blocks/tag_youtube/db/access.php @@ -0,0 +1,47 @@ +. + +/** + * Tag youtube block caps. + * + * @package block_tag_youtube + * @copyright Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + + 'block/tag_youtube:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), + + 'block/tag_youtube:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), +); diff --git a/blocks/tag_youtube/lang/en/block_tag_youtube.php b/blocks/tag_youtube/lang/en/block_tag_youtube.php index cb1180a3acdf4..0e3dc8f93474b 100644 --- a/blocks/tag_youtube/lang/en/block_tag_youtube.php +++ b/blocks/tag_youtube/lang/en/block_tag_youtube.php @@ -42,4 +42,6 @@ $string['pluginname'] = 'Youtube'; $string['scienceandtech'] = 'Science & Tech'; $string['sports'] = 'Sports'; +$string['tag_youtube:addinstance'] = 'Add a new youtube block'; +$string['tag_youtube:myaddinstance'] = 'Add a new youtube block to the My Moodle page'; $string['travel'] = 'Travel & Places'; diff --git a/blocks/tag_youtube/version.php b/blocks/tag_youtube/version.php index 91bb65603a9fd..7dbf882b0d812 100644 --- a/blocks/tag_youtube/version.php +++ b/blocks/tag_youtube/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012061700; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'block_tag_youtube'; // Full name of the plugin (used for diagnostics) diff --git a/blocks/tags/db/access.php b/blocks/tags/db/access.php new file mode 100644 index 0000000000000..04504a2a2846a --- /dev/null +++ b/blocks/tags/db/access.php @@ -0,0 +1,47 @@ +. + +/** + * Tags block caps. + * + * @package block_tags + * @copyright Mark Nelson + * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later + */ + +defined('MOODLE_INTERNAL') || die(); + +$capabilities = array( + + 'block/tags:myaddinstance' => array( + 'captype' => 'write', + 'contextlevel' => CONTEXT_SYSTEM, + 'archetypes' => array( + 'user' => CAP_ALLOW + ) + ), + + 'block/tags:addinstance' => array( + 'riskbitmask' => RISK_SPAM | RISK_XSS, + + 'captype' => 'write', + 'contextlevel' => CONTEXT_BLOCK, + 'archetypes' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), +); diff --git a/blocks/tags/lang/en/block_tags.php b/blocks/tags/lang/en/block_tags.php index ddd340ed8367a..7f2d59fc82723 100644 --- a/blocks/tags/lang/en/block_tags.php +++ b/blocks/tags/lang/en/block_tags.php @@ -70,5 +70,7 @@ $string['showcoursetagsdef'] = 'Display the course tagging features in the tags block, allowing students to tag courses.'; $string['suggestedtagthisunit'] = 'Suggested tag to this course:'; $string['tags'] = 'tags'; +$string['tags:addinstance'] = 'Add a new tags block'; +$string['tags:myaddinstance'] = 'Add a new tags block to the My Moodle page'; $string['tagthisunit'] = 'Tag this course:'; $string['tagunits'] = 'to tag your favourite courses'; diff --git a/blocks/tags/version.php b/blocks/tags/version.php index d4b93d125a520..2c02165a2c0d4 100644 --- a/blocks/tags/version.php +++ b/blocks/tags/version.php @@ -25,6 +25,6 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2012082800; // The current plugin version (Date: YYYYMMDDXX) +$plugin->version = 2012091600; // The current plugin version (Date: YYYYMMDDXX) $plugin->requires = 2012061700; // Requires this Moodle version $plugin->component = 'block_tags'; // Full name of the plugin (used for diagnostics)