仅适用于“我的家”用户的适用格式

时间:2015-06-09 11:16:29

标签: moodle

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,只更改了名称

1 个答案:

答案 0 :(得分:1)

更新 - 它应该只是'我'而不是'我的索引'。

另外,为了完整性,您可能需要添加all = false

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