本文整理汇总了PHP中moodle_page::set_pagetype方法的典型用法代码示例。如果您正苦于以下问题:PHP moodle_page::set_pagetype方法的具体用法?PHP moodle_page::set_pagetype怎么用?PHP moodle_page::set_pagetype使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类moodle_page
的用法示例。
在下文中一共展示了moodle_page::set_pagetype方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_block_manager
/**
* Returns the block manager for a given course.
*/
private function get_block_manager($course)
{
$page = new \moodle_page();
$page->set_context(\context_course::instance($course->id));
$page->set_pagetype('course-view-*');
return new \block_manager($page);
}
示例2: xmldb_local_iomad_dashboard_install
function xmldb_local_iomad_dashboard_install()
{
global $SITE;
// Add some default blocks to the dashboard
// yes, I know this isn't really what this is for!!
$systemcontext = context_system::instance();
$page = new moodle_page();
$page->set_context($systemcontext);
$page->set_pagetype('local-iomad-dashboard-index');
$page->set_pagelayout('mydashboard');
$page->blocks->add_region('content');
$defaultblocks = array('side_pre' => array('course_list'), 'content' => array('iomad_company_admin', 'iomad_reports'), 'side_post' => array('news_items'));
$page->blocks->add_blocks($defaultblocks);
return true;
}
示例3: if
theme_reset_all_caches();
} else if ($choose && $device && !$unsettheme && confirm_sesskey()) {
// Load the theme to make sure it is valid.
$theme = theme_config::load($choose);
// Get the config argument for the chosen device.
$themename = get_device_cfg_var_name($device);
set_config($themename, $theme->name);
// Create a new page for the display of the themes readme.
// This ensures that the readme page is shown using the new theme.
$confirmpage = new moodle_page();
$confirmpage->set_context($PAGE->context);
$confirmpage->set_url($PAGE->url);
$confirmpage->set_pagelayout($PAGE->pagelayout);
$confirmpage->set_pagetype($PAGE->pagetype);
$confirmpage->set_title($PAGE->title);
$confirmpage->set_heading($PAGE->heading);
// Get the core renderer for the new theme.
$output = $confirmpage->get_renderer('core');
echo $output->header();
echo $output->heading(get_string('themesaved'));
echo $output->box_start();
echo format_text(get_string('choosereadme', 'theme_'.$theme->name), FORMAT_MOODLE);
echo $output->box_end();
echo $output->continue_button($CFG->wwwroot . '/theme/index.php');
echo $output->footer();
exit;
} else if ($device && $unsettheme && confirm_sesskey() && ($device != 'default')) {
示例4: get_a_page_and_block_manager
protected function get_a_page_and_block_manager($regions, $context, $pagetype, $subpage = '') {
$page = new moodle_page;
$page->set_context($context);
$page->set_pagetype($pagetype);
$page->set_subpage($subpage);
$blockmanager = new testable_block_manager($page);
$blockmanager->add_regions($regions);
$blockmanager->set_default_region($regions[0]);
return array($page, $blockmanager);
}