当前位置: 首页>>代码示例>>PHP>>正文


PHP moodle_page::set_pagetype方法代码示例

本文整理汇总了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);
 }
开发者ID:unikent,项目名称:moodle-tool_cat,代码行数:10,代码来源:block_region.php

示例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;
}
开发者ID:sumitnegi933,项目名称:Moodle_lms_New,代码行数:15,代码来源:install.php

示例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')) {
开发者ID:verbazend,项目名称:AWFA,代码行数:31,代码来源:index.php

示例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);
    }
开发者ID:Jtgadbois,项目名称:Pedadida,代码行数:12,代码来源:blocklib_test.php


注:本文中的moodle_page::set_pagetype方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。