Permalink
Browse files

MDL-34270 blocks: adding new add block capabilities

  • Loading branch information...
1 parent 6109f21 commit b291b59d6a980c69d5e4155742f61e69c6072ae3 @markn86 markn86 committed Nov 2, 2012
Showing with 1,930 additions and 53 deletions.
  1. +47 −0 blocks/activity_modules/db/access.php
  2. +2 −0 blocks/activity_modules/lang/en/block_activity_modules.php
  3. +1 −1 blocks/activity_modules/version.php
  4. +47 −0 blocks/admin_bookmarks/db/access.php
  5. +2 −1 blocks/admin_bookmarks/lang/en/block_admin_bookmarks.php
  6. +1 −1 blocks/admin_bookmarks/version.php
  7. +47 −0 blocks/blog_menu/db/access.php
  8. +2 −1 blocks/blog_menu/lang/en/block_blog_menu.php
  9. +1 −1 blocks/blog_menu/version.php
  10. +47 −0 blocks/blog_recent/db/access.php
  11. +2 −0 blocks/blog_recent/lang/en/block_blog_recent.php
  12. +1 −1 blocks/blog_recent/version.php
  13. +47 −0 blocks/blog_tags/db/access.php
  14. +2 −0 blocks/blog_tags/lang/en/block_blog_tags.php
  15. +1 −1 blocks/blog_tags/version.php
  16. +47 −0 blocks/calendar_month/db/access.php
  17. +2 −0 blocks/calendar_month/lang/en/block_calendar_month.php
  18. +1 −1 blocks/calendar_month/version.php
  19. +47 −0 blocks/calendar_upcoming/db/access.php
  20. +2 −0 blocks/calendar_upcoming/lang/en/block_calendar_upcoming.php
  21. +1 −1 blocks/calendar_upcoming/version.php
  22. +47 −0 blocks/comments/db/access.php
  23. +2 −0 blocks/comments/lang/en/block_comments.php
  24. +1 −1 blocks/comments/version.php
  25. +47 −0 blocks/community/db/access.php
  26. +3 −1 blocks/community/lang/en/block_community.php
  27. +1 −1 blocks/community/version.php
  28. +47 −0 blocks/completionstatus/db/access.php
  29. +25 −0 blocks/completionstatus/lang/en/block_completionstatus.php
  30. +1 −1 blocks/completionstatus/version.php
  31. +47 −0 blocks/course_list/db/access.php
  32. +2 −0 blocks/course_list/lang/en/block_course_list.php
  33. +1 −1 blocks/course_list/version.php
  34. +47 −0 blocks/course_overview/db/access.php
  35. +5 −2 blocks/course_overview/lang/en/block_course_overview.php
  36. +1 −1 blocks/course_overview/version.php
  37. +47 −0 blocks/course_summary/db/access.php
  38. +2 −0 blocks/course_summary/lang/en/block_course_summary.php
  39. +1 −1 blocks/course_summary/version.php
  40. +47 −0 blocks/feedback/db/access.php
  41. +26 −1 blocks/feedback/lang/en/block_feedback.php
  42. +1 −1 blocks/feedback/version.php
  43. +47 −0 blocks/glossary_random/db/access.php
  44. +2 −0 blocks/glossary_random/lang/en/block_glossary_random.php
  45. +1 −1 blocks/glossary_random/version.php
  46. +47 −0 blocks/html/db/access.php
  47. +2 −0 blocks/html/lang/en/block_html.php
  48. +1 −1 blocks/html/version.php
  49. +47 −0 blocks/login/db/access.php
  50. +2 −0 blocks/login/lang/en/block_login.php
  51. +1 −1 blocks/login/version.php
  52. +47 −0 blocks/mentees/db/access.php
  53. +2 −0 blocks/mentees/lang/en/block_mentees.php
  54. +1 −1 blocks/mentees/version.php
  55. +47 −0 blocks/messages/db/access.php
  56. +2 −0 blocks/messages/lang/en/block_messages.php
  57. +1 −1 blocks/messages/version.php
  58. +47 −0 blocks/mnet_hosts/db/access.php
  59. +2 −0 blocks/mnet_hosts/lang/en/block_mnet_hosts.php
  60. +1 −1 blocks/mnet_hosts/version.php
  61. +32 −4 blocks/moodleblock.class.php
  62. +47 −0 blocks/myprofile/db/access.php
  63. +4 −2 blocks/myprofile/lang/en/block_myprofile.php
  64. +1 −1 blocks/myprofile/version.php
  65. +47 −0 blocks/navigation/db/access.php
  66. +2 −0 blocks/navigation/lang/en/block_navigation.php
  67. +1 −1 blocks/navigation/version.php
  68. +47 −0 blocks/news_items/db/access.php
  69. +2 −0 blocks/news_items/lang/en/block_news_items.php
  70. +1 −1 blocks/news_items/version.php
  71. +19 −2 blocks/online_users/db/access.php
  72. +2 −0 blocks/online_users/lang/en/block_online_users.php
  73. +1 −1 blocks/online_users/version.php
  74. +47 −0 blocks/participants/db/access.php
  75. +2 −0 blocks/participants/lang/en/block_participants.php
  76. +1 −1 blocks/participants/version.php
  77. +47 −0 blocks/private_files/db/access.php
  78. +3 −0 blocks/private_files/lang/en/block_private_files.php
  79. +1 −1 blocks/private_files/version.php
  80. +47 −0 blocks/quiz_results/db/access.php
  81. +2 −0 blocks/quiz_results/lang/en/block_quiz_results.php
  82. +1 −1 blocks/quiz_results/version.php
  83. +47 −0 blocks/recent_activity/db/access.php
  84. +2 −0 blocks/recent_activity/lang/en/block_recent_activity.php
  85. +1 −1 blocks/recent_activity/version.php
  86. +19 −0 blocks/rss_client/db/access.php
  87. +2 −0 blocks/rss_client/lang/en/block_rss_client.php
  88. +1 −1 blocks/rss_client/version.php
  89. +47 −0 blocks/search_forums/db/access.php
  90. +2 −0 blocks/search_forums/lang/en/block_search_forums.php
  91. +1 −1 blocks/search_forums/version.php
  92. +47 −0 blocks/section_links/db/access.php
  93. +2 −0 blocks/section_links/lang/en/block_section_links.php
  94. +1 −1 blocks/section_links/version.php
  95. +47 −0 blocks/selfcompletion/db/access.php
  96. +2 −0 blocks/selfcompletion/lang/en/block_selfcompletion.php
  97. +1 −1 blocks/selfcompletion/version.php
  98. +47 −0 blocks/settings/db/access.php
  99. +2 −0 blocks/settings/lang/en/block_settings.php
  100. +1 −1 blocks/settings/version.php
  101. +47 −0 blocks/site_main_menu/db/access.php
  102. +2 −1 blocks/site_main_menu/lang/en/block_site_main_menu.php
  103. +1 −1 blocks/site_main_menu/version.php
  104. +47 −0 blocks/social_activities/db/access.php
  105. +2 −0 blocks/social_activities/lang/en/block_social_activities.php
  106. +1 −1 blocks/social_activities/version.php
  107. +47 −0 blocks/tag_flickr/db/access.php
  108. +2 −0 blocks/tag_flickr/lang/en/block_tag_flickr.php
  109. +1 −1 blocks/tag_flickr/version.php
  110. +47 −0 blocks/tag_youtube/db/access.php
  111. +2 −0 blocks/tag_youtube/lang/en/block_tag_youtube.php
  112. +1 −1 blocks/tag_youtube/version.php
  113. +47 −0 blocks/tags/db/access.php
  114. +2 −0 blocks/tags/lang/en/block_tags.php
  115. +1 −1 blocks/tags/version.php
View
47 blocks/activity_modules/db/access.php
@@ -0,0 +1,47 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Activity modules block caps.
+ *
+ * @package block_activity_modules
+ * @copyright Mark Nelson <markn@moodle.com>
+ * @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
+ )
+ ),
+);
View
2 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';
View
2 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)
View
47 blocks/admin_bookmarks/db/access.php
@@ -0,0 +1,47 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Admin bookmarks block caps.
+ *
+ * @package block_admin_bookmarks
+ * @copyright Mark Nelson <markn@moodle.com>
+ * @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
+ )
+ ),
+);
View
3 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';
-
View
2 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)
View
47 blocks/blog_menu/db/access.php
@@ -0,0 +1,47 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Blog menu block caps.
+ *
+ * @package block_blog_menu
+ * @copyright Mark Nelson <markn@moodle.com>
+ * @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
+ )
+ ),
+);
View
3 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';
-
View
2 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)
View
47 blocks/blog_recent/db/access.php
@@ -0,0 +1,47 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Blog recent block caps.
+ *
+ * @package block_blog_recent
+ * @copyright Mark Nelson <markn@moodle.com>
+ * @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
+ )
+ ),
+);
View
2 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';
View
2 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)
View
47 blocks/blog_tags/db/access.php
@@ -0,0 +1,47 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Blog tags block caps.
+ *
+ * @package block_blog_tags
+ * @copyright Mark Nelson <markn@moodle.com>
+ * @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
+ )
+ ),
+);
View
2 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';
View
2 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)
View
47 blocks/calendar_month/db/access.php
@@ -0,0 +1,47 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Calendar month block caps.
+ *
+ * @package block_calendar_month
+ * @copyright Mark Nelson <markn@moodle.com>
+ * @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
+ )
+ ),
+);
View
2 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';
View
2 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)
View
47 blocks/calendar_upcoming/db/access.php
@@ -0,0 +1,47 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Calendar upcoming block caps.
+ *
+ * @package block_calendar_upcoming
+ * @copyright Mark Nelson <markn@moodle.com>
+ * @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
+ )
+ ),
+);
View
2 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';
View
2 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)
View
47 blocks/comments/db/access.php
@@ -0,0 +1,47 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Comments block caps.
+ *
+ * @package block_comments
+ * @copyright Mark Nelson <markn@moodle.com>
+ * @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
+ )
+ ),
+);
View
2 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';
View
2 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)
View
47 blocks/community/db/access.php
@@ -0,0 +1,47 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Community block caps.
+ *
+ * @package block_community
+ * @copyright Mark Nelson <markn@moodle.com>
+ * @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
+ )
+ ),
+);
View
4 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 <jerome@mouneyrac.com>
+ * @author Jerome Mouneyrac <jerome@mouneyrac.com>
* @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}';
View
2 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)
View
47 blocks/completionstatus/db/access.php
@@ -0,0 +1,47 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Completion status block caps.
+ *
+ * @package block_completionstatus
+ * @copyright Mark Nelson <markn@moodle.com>
+ * @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
+ )
+ ),
+);
View
25 blocks/completionstatus/lang/en/block_completionstatus.php
@@ -1,6 +1,31 @@
<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * 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';
View
2 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);
View
47 blocks/course_list/db/access.php
@@ -0,0 +1,47 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Course list block caps.
+ *
+ * @package block_course_list
+ * @copyright Mark Nelson <markn@moodle.com>
+ * @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
+ )
+ ),
+);
View
2 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';
View
2 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)
View
47 blocks/course_overview/db/access.php
@@ -0,0 +1,47 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Course overview block caps.
+ *
+ * @package block_course_overview
+ * @copyright Mark Nelson <markn@moodle.com>
+ * @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
+ )
+ ),
+);
View
7 blocks/course_overview/lang/en/block_course_overview.php
@@ -21,12 +21,14 @@
* @copyright 2012 Adam Olley <adam.olley@netspot.com.au>
* @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 ';
+$string['youhavenomessages'] = 'You have no unread ';
View
2 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)
View
47 blocks/course_summary/db/access.php
@@ -0,0 +1,47 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Course summary block caps.
+ *
+ * @package block_course_summary
+ * @copyright Mark Nelson <markn@moodle.com>
+ * @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
+ )
+ ),
+);
View
2 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';
View
2 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)
View
47 blocks/feedback/db/access.php
@@ -0,0 +1,47 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Feedback block caps.
+ *
+ * @package block_feedback
+ * @copyright Mark Nelson <markn@moodle.com>
+ * @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
+ )
+ ),
+);
View
27 blocks/feedback/lang/en/block_feedback.php
@@ -1,5 +1,30 @@
<?php
-$string['pluginname'] = 'Feedback';
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * 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';
View
2 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)
View
47 blocks/glossary_random/db/access.php
@@ -0,0 +1,47 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Glossary random block caps.
+ *
+ * @package block_glossary_random
+ * @copyright Mark Nelson <markn@moodle.com>
+ * @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
+ )
+ ),
+);
View
2 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';
View
2 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)
View
47 blocks/html/db/access.php
@@ -0,0 +1,47 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * HTML block caps.
+ *
+ * @package block_html
+ * @copyright Mark Nelson <markn@moodle.com>
+ * @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
+ )
+ ),
+);
View
2 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';
View
2 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)
View
47 blocks/login/db/access.php
@@ -0,0 +1,47 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Login block caps.
+ *
+ * @package block_login
+ * @copyright Mark Nelson <markn@moodle.com>
+ * @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
+ )
+ ),
+);
View
2 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';
View
2 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)
View
47 blocks/mentees/db/access.php
@@ -0,0 +1,47 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Mentees block caps.
+ *
+ * @package block_mentees
+ * @copyright Mark Nelson <markn@moodle.com>
+ * @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
+ )
+ ),
+);
View
2 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';
View
2 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)
View
47 blocks/messages/db/access.php
@@ -0,0 +1,47 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Messages block caps.
+ *
+ * @package block_messages
+ * @copyright Mark Nelson <markn@moodle.com>
+ * @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
+ )
+ ),
+);
View
2 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';
View
2 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)
View
47 blocks/mnet_hosts/db/access.php
@@ -0,0 +1,47 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Mnet hosts block caps.
+ *
+ * @package block_mnet_hosts
+ * @copyright Mark Nelson <markn@moodle.com>
+ * @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
+ )
+ ),
+);
View
2 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';
View
2 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)
View
36 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');
}
View
47 blocks/myprofile/db/access.php
@@ -0,0 +1,47 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * My profile block caps.
+ *
+ * @package block_myprofile
+ * @copyright Mark Nelson <markn@moodle.com>
+ * @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
+ )
+ ),
+);
View
6 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';
View
2 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)
View
47 blocks/navigation/db/access.php
@@ -0,0 +1,47 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * Navigation block caps.
+ *
+ * @package block_navigation
+ * @copyright Mark Nelson <markn@moodle.com>
+ * @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
+ )
+ ),
+);
View
2 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';
View
2 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)
View
47 blocks/news_items/db/access.php
@@ -0,0 +1,47 @@
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * News items block caps.
+ *
+ * @package block_news_items
+ * @copyright Mark Nelson <markn@moodle.com>
+ * @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
+ )
+ ),
+);
View
2 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';
View
2 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)
View
21 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 @@
)
)
);
-
-
View
2 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';
View
2 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)
View
47 blocks/participants/db/access.php
@@ -0,0 +1,47 @@
+<?php
+// This file is part of Moodle - http://moodle.org/