applicable_formats()
函数中的数组需要什么才能在用户的My home
页面上显示?我已将my-index
设为true。
acces.php
<?php
$capabilities = array(
'block/groups:myaddinstance' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'user' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/my:manageblocks'
),
'block/groups:addinstance' => array(
'riskbitmask' => RISK_SPAM | RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_BLOCK,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/site:manageblocks'
),
);
我从块教程中复制了access.php,只更改了名称
答案 0 :(得分:1)
更新 - 它应该只是'我'而不是'我的索引'。
另外,为了完整性,您可能需要添加all = false
public function applicable_formats() {
return array('all' => false, my' => true);
}