當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。