Moodle联系和收费3.2+

问题描述 投票:3回答:1

所以,我有下一个问题: 我尝试创建新的div @type@

/message/templates/message_area_contact.mustache

所以代码看起来像这样:

 ... <div class="name">
        {{fullname}}   
       <div style="font-style: italic; font-weight: 100;">{{type}}</div>
        {{#showonlinestatus}}
            <span {{^isonline}}class="hidden"{{/isonline}} data-region="contact-icon-online">
                {{#pix}} t/go, core, {{#str}} online, message {{/str}} {{/pix}}
            </span>...

然后,在\message\classes\helper.php中代码是这样的:

if (user_has_role_assignment ($userfields->id, 3)) 
{
    $data->type = "teacher";    
} else {
    $data->type = "student";        
}

还不够,在message\classes\output\messagearea\contact.php__construct add next

$this->type = $contact->type;

export_for_template

$contact->type = $this->type;

所以,毕竟我有

下一步 - > http://skrinshoter.ru/s/020218/5uGffk1d

看起来很完美,但当我更改“联系人”的标签时,我有

没什么 - > http://skrinshoter.ru/s/020218/hNZE5HUO

知道什么可以帮助我显示联系人的类型吗?

javascript php ajax moodle mustache
1个回答
0
投票

所以,我错过了一个动作 - 管理中的清理缓存。在此新的div块出现在联系人中之后。

© www.soinside.com 2019 - 2024. All rights reserved.