本文整理匯總了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;
}