本文整理汇总了PHP中Dashboard::get_user_role方法的典型用法代码示例。如果您正苦于以下问题:PHP Dashboard::get_user_role方法的具体用法?PHP Dashboard::get_user_role怎么用?PHP Dashboard::get_user_role使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dashboard
的用法示例。
在下文中一共展示了Dashboard::get_user_role方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
echo html_writer::start_tag('form', array('action' => '.', 'method' => 'get'));
echo html_writer::start_tag('div');
echo html_writer::empty_tag('input', array('type' => 'hidden', 'id' => 'completion_dynamic_change', 'name' => 'completion_dynamic_change', 'value' => '0'));
echo html_writer::end_tag('div');
echo html_writer::end_tag('form');
}
/* Payment status */
$ds = new Dashboard();
$status = $ds->get_user_status();
if ($status == 0) {
$message = $ds->get_user_warning_message();
echo $message;
die;
}
/* Payments history */
$roleid = $ds->get_user_role($USER->id);
if ($roleid == 5 && $USER->username != 'manager' && $USER->username != 'admin') {
$payments_history = $ds->get_payments_history_block($COURSE->id, $USER->id);
echo $payments_history;
}
// Course wrapper start.
echo html_writer::start_tag('div', array('class' => 'course-content'));
// make sure that section 0 exists (this function will create one if it is missing)
course_create_sections_if_missing($course, 0);
// get information about course modules and existing module types
// format.php in course formats may rely on presence of these variables
$modinfo = get_fast_modinfo($course);
$modnames = get_module_types_names();
$modnamesplural = get_module_types_names(true);
$modnamesused = $modinfo->get_used_module_names();
$mods = $modinfo->get_cms();
示例2: get_user_specific_navbar_items
public function get_user_specific_navbar_items()
{
global $DB, $COURSE, $USER;
$ds = new Dashboard();
$role_id = $ds->get_user_role($USER->id);
$items = $ds->get_navbar_items($role_id);
return $items;
}