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


PHP context_helper::reset_levels方法代码示例

本文整理汇总了PHP中context_helper::reset_levels方法的典型用法代码示例。如果您正苦于以下问题:PHP context_helper::reset_levels方法的具体用法?PHP context_helper::reset_levels怎么用?PHP context_helper::reset_levels使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在context_helper的用法示例。


在下文中一共展示了context_helper::reset_levels方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: costcenter_custom_contexts_setup

    /**
     * Test case for custom context classes
     */
    public function costcenter_custom_contexts_setup() {
     
        global $CFG;
        static $customcontexts = array(
            27 => 'context_costcenter'
       
        );

        // save any existing custom contexts
        $existingcustomcontexts = get_config(null, 'custom_context_classes');

        set_config('custom_context_classes', serialize($customcontexts));
        initialise_cfg();
        context_helper::reset_levels();
        $alllevels = context_helper::get_all_levels();
        
      ///  $this->assertEquals($alllevels[11], 'context_costcenter');
        

        // clean-up & restore any custom contexts
        //set_config('custom_context_classes', ($existingcustomcontexts === false) ? null : $existingcustomcontexts);
       // initialise_cfg();
       // context_helper::reset_levels();
      //  $alllevels = context_helper::get_all_levels();
        
      //  print_object($alllevels);
    }
开发者ID:narasimhaeabyas,项目名称:tataaiapro,代码行数:30,代码来源:costcenter_contextlib.php

示例2: xmldb_local_elisprogram_install

/**
 * ELIS(TM): Enterprise Learning Intelligence Suite
 * Copyright (C) 2008-2013 Remote-Learner.net Inc (http://www.remote-learner.net)
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @package    local_elisprogram
 * @author     Remote-Learner.net Inc
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 * @copyright  (C) 2008-2013 Remote Learner.net Inc http://www.remote-learner.net
 *
 */
function xmldb_local_elisprogram_install()
{
    global $CFG, $DB;
    $elisadminblockinstalled = file_exists($CFG->dirroot . '/local/elisprogram/lib/setup.php') && $DB->record_exists('block', array('name' => 'elisadmin'));
    if ($elisadminblockinstalled) {
        require_once $CFG->dirroot . '/blocks/elisadmin/lib.php';
    }
    require_once $CFG->dirroot . '/local/elisprogram/lib/lib.php';
    // Install custom context levels.
    \local_eliscore\context\helper::set_custom_levels(\local_elisprogram\context\contextinfo::get_contextinfo());
    \local_eliscore\context\helper::install_custom_levels();
    // Initialize custom context levels.
    context_helper::reset_levels();
    \local_eliscore\context\helper::reset_levels();
    \local_eliscore\context\helper::init_levels();
    // Migrate component.
    $migrator = new \local_elisprogram\install\migration\elis26();
    if ($migrator->old_component_installed() === true) {
        $migrator->migrate();
    }
    //make sure the site has exactly one curr admin block instance
    //that is viewable everywhere
    if ($elisadminblockinstalled) {
        block_elisadmin_create_instance();
    }
    // make sure that the manager role can be assigned to all PM context levels
    update_capabilities('local_elisprogram');
    // load context levels
    pm_ensure_role_assignable('manager');
    pm_ensure_role_assignable('curriculumadmin');
    // Migrate dataroot files
    pm_migrate_certificate_files();
    // These notifications are default-on.
    pm_set_config('notify_addedtowaitlist_user', 1);
    pm_set_config('notify_enroledfromwaitlist_user', 1);
    pm_set_config('notify_incompletecourse_user', 1);
    // Ensure ELIS scheduled tasks is initialized.
    require_once $CFG->dirroot . '/local/eliscore/lib/tasklib.php';
    elis_tasks_update_definition('local_elisprogram');
    // Remove some lingering subplugins that were renamed
    unset_all_config_for_plugin('usersetenrol_manual');
    unset_all_config_for_plugin('usersetenrol_moodle_profile');
}
开发者ID:jamesmcq,项目名称:elis,代码行数:66,代码来源:install.php

示例3: reset_levels

 /**
  * Reset internal context levels array.
  *
  * @static
  */
 public static function reset_levels()
 {
     self::$puballlevels = null;
     parent::reset_levels();
 }
开发者ID:jamesmcq,项目名称:elis,代码行数:10,代码来源:helper.php

示例4: costcenter_custom_contexts_setup

 function costcenter_custom_contexts_setup() {
     
        global $CFG;
        static $customcontexts = array(
            27 => 'context_costcenter'
       
        );

        // save any existing custom contexts
        $existingcustomcontexts = get_config(null, 'custom_context_classes');

        set_config('custom_context_classes', serialize($customcontexts));
        initialise_cfg();
        context_helper::reset_levels();
        $alllevels = context_helper::get_all_levels();        

    }
开发者ID:narasimhaeabyas,项目名称:tataaiapro,代码行数:17,代码来源:moodlelib.php

示例5: test_customcontexts

 /**
  * Test case for custom context classes
  */
 public function test_customcontexts()
 {
     global $CFG;
     static $customcontexts = array(11 => 'context_bogus1', 12 => 'context_bogus2', 13 => 'context_bogus3');
     // save any existing custom contexts
     $existingcustomcontexts = get_config(null, 'custom_context_classes');
     set_config('custom_context_classes', serialize($customcontexts));
     initialise_cfg();
     context_helper::reset_levels();
     $alllevels = context_helper::get_all_levels();
     $this->assertEquals($alllevels[11], 'context_bogus1');
     $this->assertEquals($alllevels[12], 'context_bogus2');
     $this->assertEquals($alllevels[13], 'context_bogus3');
     // clean-up & restore any custom contexts
     set_config('custom_context_classes', $existingcustomcontexts === false ? null : $existingcustomcontexts);
     initialise_cfg();
     context_helper::reset_levels();
 }
开发者ID:evltuma,项目名称:moodle,代码行数:21,代码来源:customcontext_test.php


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