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


PHP core_component::get_plugin_list方法代码示例

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


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

示例1: definition

 function definition()
 {
     global $CFG;
     $mform =& $this->_form;
     //$mform->addElement('html', get_string('unplagexplain', 'plagiarism_unplag'));
     $mform->addElement('checkbox', 'unplag_use', get_string('useunplag', 'plagiarism_unplag'));
     $mform->addElement('text', 'unplag_client_id', get_string('unplag_client_id', 'plagiarism_unplag'));
     $mform->addHelpButton('unplag_client_id', 'unplag_client_id', 'plagiarism_unplag');
     $mform->addRule('unplag_client_id', null, 'required', null, 'client');
     $mform->setType('unplag_client_id', PARAM_TEXT);
     $mform->addElement('text', 'unplag_api_secret', get_string('unplag_api_secret', 'plagiarism_unplag'));
     $mform->addHelpButton('unplag_api_secret', 'unplag_api_secret', 'plagiarism_unplag');
     $mform->addRule('unplag_api_secret', null, 'required', null, 'client');
     $mform->setType('unplag_api_secret', PARAM_TEXT);
     $mform->addElement('text', 'unplag_lang', get_string('unplag_lang', 'plagiarism_unplag'));
     $mform->addHelpButton('unplag_lang', 'unplag_lang', 'plagiarism_unplag');
     $mform->addRule('unplag_lang', null, 'required', null, 'client');
     $mform->setDefault('unplag_lang', 'en-US');
     $mform->setType('unplag_lang', PARAM_TEXT);
     $mform->addElement('textarea', 'unplag_student_disclosure', get_string('studentdisclosure', 'plagiarism_unplag'), 'wrap="virtual" rows="6" cols="50"');
     $mform->addHelpButton('unplag_student_disclosure', 'studentdisclosure', 'plagiarism_unplag');
     $mform->setDefault('unplag_student_disclosure', get_string('studentdisclosuredefault', 'plagiarism_unplag'));
     $mform->setType('unplag_student_disclosure', PARAM_TEXT);
     $mods = core_component::get_plugin_list('mod');
     foreach ($mods as $mod => $modname) {
         if (plugin_supports('mod', $mod, FEATURE_PLAGIARISM)) {
             $modstring = 'unplag_enable_mod_' . $mod;
             $mform->addElement('checkbox', $modstring, get_string('unplag_enableplugin', 'plagiarism_unplag', $mod));
         }
     }
     $this->add_action_buttons(true);
 }
开发者ID:POETGroup,项目名称:moodle-plagiarism_unplag,代码行数:32,代码来源:unplag_form.php

示例2: enrol_get_plugins

/**
 * Returns instances of enrol plugins
 * @param bool $enabled return enabled only
 * @return array of enrol plugins name=>instance
 */
function enrol_get_plugins($enabled)
{
    global $CFG;
    $result = array();
    if ($enabled) {
        // sorted by enabled plugin order
        $enabled = explode(',', $CFG->enrol_plugins_enabled);
        $plugins = array();
        foreach ($enabled as $plugin) {
            $plugins[$plugin] = "{$CFG->dirroot}/enrol/{$plugin}";
        }
    } else {
        // sorted alphabetically
        $plugins = core_component::get_plugin_list('enrol');
        ksort($plugins);
    }
    foreach ($plugins as $plugin => $location) {
        if (!file_exists("{$location}/lib.php")) {
            continue;
        }
        include_once "{$location}/lib.php";
        $class = "enrol_{$plugin}_plugin";
        if (!class_exists($class)) {
            continue;
        }
        $result[$plugin] = new $class();
    }
    return $result;
}
开发者ID:helenagarcia90,项目名称:moodle,代码行数:34,代码来源:enrollib.php

示例3: scorm_report_list

function scorm_report_list($context)
{
    global $CFG;
    static $reportlist;
    if (!empty($reportlist)) {
        return $reportlist;
    }
    $installed = core_component::get_plugin_list('scormreport');
    foreach ($installed as $reportname => $notused) {
        // Moodle 2.8+ style of autoloaded classes.
        $classname = "scormreport_{$reportname}\\report";
        if (class_exists($classname)) {
            $report = new $classname();
            if ($report->canview($context)) {
                $reportlist[] = $reportname;
            }
            continue;
        }
        // Legacy style of naming classes.
        $pluginfile = $CFG->dirroot . '/mod/scorm/report/' . $reportname . '/report.php';
        if (is_readable($pluginfile)) {
            debugging("Please use autoloaded classnames for your plugin. Refer MDL-46469 for details", DEBUG_DEVELOPER);
            include_once $pluginfile;
            $reportclassname = "scorm_{$reportname}_report";
            if (class_exists($reportclassname)) {
                $report = new $reportclassname();
                if ($report->canview($context)) {
                    $reportlist[] = $reportname;
                }
            }
        }
    }
    return $reportlist;
}
开发者ID:evltuma,项目名称:moodle,代码行数:34,代码来源:reportlib.php

示例4: test_get_course_formats

 public function test_get_course_formats()
 {
     $result = tool_uploadcourse_helper::get_course_formats();
     $this->assertSame(array_keys(core_component::get_plugin_list('format')), $result);
     // Should be similar as first result, as cached.
     $this->assertSame($result, tool_uploadcourse_helper::get_course_formats());
 }
开发者ID:alanaipe2015,项目名称:moodle,代码行数:7,代码来源:helper_test.php

示例5: test_duplicate

 /**
  * Tests the backup and restore of single activity to same course (duplicate)
  * when it contains fields and views.
  */
 public function test_duplicate()
 {
     global $DB, $CFG;
     $this->resetAfterTest(true);
     $this->setAdminUser();
     $generator = $this->getDataGenerator();
     $dataformgenerator = $generator->get_plugin_generator('mod_dataform');
     // Create a course.
     $course = $generator->create_course();
     // DATAFORM 1.
     $params = array('course' => $course->id, 'grade' => 100);
     $dataform1 = $dataformgenerator->create_instance($params);
     $df1 = mod_dataform_dataform::instance($dataform1->id);
     // Add fields.
     $fieldtypes = array_keys(core_component::get_plugin_list('dataformfield'));
     $fieldtypescount = count($fieldtypes);
     foreach ($fieldtypes as $type) {
         $df1->field_manager->add_field($type);
     }
     // Add views.
     $viewtypes = array_keys(core_component::get_plugin_list('dataformview'));
     $viewtypescount = count($viewtypes);
     foreach ($viewtypes as $type) {
         $df1->view_manager->add_view($type);
     }
     // Fetch the grade item.
     $params = array('itemtype' => 'mod', 'itemmodule' => 'dataform', 'iteminstance' => $dataform1->id, 'courseid' => $course->id, 'itemnumber' => 0);
     $gradeitem1 = grade_item::fetch($params);
     // Check number of dataforms.
     $this->assertEquals(1, $DB->count_records('dataform'));
     // Check number of fields.
     $this->assertEquals($fieldtypescount, $DB->count_records('dataform_fields'));
     $this->assertEquals($fieldtypescount, $DB->count_records('dataform_fields', array('dataid' => $dataform1->id)));
     // Check number of views.
     $this->assertEquals($viewtypescount, $DB->count_records('dataform_views'));
     $this->assertEquals($viewtypescount, $DB->count_records('dataform_views', array('dataid' => $dataform1->id)));
     // Check number of filters.
     // $this->assertEquals(2, $DB->count_records('dataform_filters'));
     // $this->assertEquals(2, $DB->count_records('dataform_filters', array('dataid' => $dataform1->id)));.
     // DUPLICATE the dataform instance.
     $dataform2 = $dataformgenerator->duplicate_instance($course, $dataform1->cmid);
     // Check number of dataforms.
     $this->assertEquals(2, $DB->count_records('dataform'));
     // Check duplication of fields.
     $this->assertEquals($fieldtypescount * 2, $DB->count_records('dataform_fields'));
     $this->assertEquals($fieldtypescount, $DB->count_records('dataform_fields', array('dataid' => $dataform1->id)));
     $this->assertEquals($fieldtypescount, $DB->count_records('dataform_fields', array('dataid' => $dataform2->id)));
     // Check duplication of views.
     $this->assertEquals($viewtypescount * 2, $DB->count_records('dataform_views'));
     $this->assertEquals($viewtypescount, $DB->count_records('dataform_views', array('dataid' => $dataform1->id)));
     $this->assertEquals($viewtypescount, $DB->count_records('dataform_views', array('dataid' => $dataform2->id)));
     // Check number of filters.
     // $this->assertEquals(4, $DB->count_records('dataform_filters');
     // $this->assertEquals(2, $DB->count_records('dataform_filters', array('dataid' => $dataform1->id));
     // $this->assertEquals(2, $DB->count_records('dataform_filters', array('dataid' => $dataform2->id));.
     // Dataform cleanup.
     $dataformgenerator->delete_all_instances();
 }
开发者ID:parksandwildlife,项目名称:learning,代码行数:62,代码来源:backup_restore_test.php

示例6: test_field_events

 /**
  * Test field events for standard types.
  */
 public function test_field_events()
 {
     $this->setAdminUser();
     $df = $this->get_a_dataform();
     $fieldtypes = array_keys(core_component::get_plugin_list('dataformfield'));
     foreach ($fieldtypes as $type) {
         $this->try_crud_field($type, $df);
     }
 }
开发者ID:parksandwildlife,项目名称:learning,代码行数:12,代码来源:events_test.php

示例7: get_list_of_calendar_types

 /**
  * Returns a list of calendar typess available for use.
  *
  * @return array the list of calendar types
  */
 public static function get_list_of_calendar_types()
 {
     $calendars = array();
     $calendardirs = \core_component::get_plugin_list('calendartype');
     foreach ($calendardirs as $name => $location) {
         $calendars[$name] = get_string('name', "calendartype_{$name}");
     }
     return $calendars;
 }
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:14,代码来源:type_factory.php

示例8: test_get_submission_plugins

 public function test_get_submission_plugins()
 {
     $this->setUser($this->editingteachers[0]);
     $assign = $this->create_instance();
     $installedplugins = array_keys(core_component::get_plugin_list('assignsubmission'));
     foreach ($assign->get_submission_plugins() as $plugin) {
         $this->assertContains($plugin->get_type(), $installedplugins, 'Submission plugin not in list of installed plugins');
     }
 }
开发者ID:janaece,项目名称:globalclassroom4_clean,代码行数:9,代码来源:locallib_test.php

示例9: is_last

 /**
  * Is this the last plugin in the list?
  *
  * @return bool
  */
 public final function is_last()
 {
     $lastindex = count(core_component::get_plugin_list($this->get_subtype())) - 1;
     $currentindex = get_config($this->get_subtype() . '_' . $this->get_type(), 'sortorder');
     if ($lastindex == $currentindex) {
         return true;
     }
     return false;
 }
开发者ID:EmmanuelYupit,项目名称:educursos,代码行数:14,代码来源:assignmentplugin.php

示例10: xmldb_dataform_install

/**
 * Install the plugin.
 */
function xmldb_dataform_install()
{
    // Enable existing field plugins.
    $type = 'dataformfield';
    $enabled = array_keys(core_component::get_plugin_list($type));
    set_config("enabled_{$type}", implode(',', $enabled), 'mod_dataform');
    // Enable existing view plugins.
    $type = 'dataformview';
    $enabled = array_keys(core_component::get_plugin_list($type));
    set_config("enabled_{$type}", implode(',', $enabled), 'mod_dataform');
}
开发者ID:parksandwildlife,项目名称:learning,代码行数:14,代码来源:install.php

示例11: rcontent_report_list

/**
 * Returns an array of reports to which the current user has access to.
 * @return array reports are ordered as they should be for display in tabs.
 */
function rcontent_report_list()
{
    global $DB;
    static $reportlist = null;
    if (!is_null($reportlist)) {
        return $reportlist;
    }
    $reportdirs = core_component::get_plugin_list('rcontent');
    // Add any reports, which are on disc but not in the DB, on the end.
    foreach ($reportdirs as $reportname => $notused) {
        $reportlist[] = $reportname;
    }
    return $reportlist;
}
开发者ID:kevin-bruton,项目名称:marsupial,代码行数:18,代码来源:reportlib.php

示例12: service_list

 /**
  * Get a list of services available in this Moodle installation.
  *
  * @return array plugin name => array('name' => '\class\implementing\service')
  */
 public static function service_list()
 {
     global $CFG;
     $result = array();
     foreach (\core_component::get_plugin_types() as $plugintype => $fulldir) {
         foreach (\core_component::get_plugin_list($plugintype) as $name => $dir) {
             $frankenstyle = $plugintype . '_' . $name;
             if ($services = self::get_services($frankenstyle)) {
                 $result[$frankenstyle] = $services;
             }
         }
     }
     return $result;
 }
开发者ID:pauln,项目名称:local_nagios,代码行数:19,代码来源:service.php

示例13: definition

 public function definition()
 {
     $mform =& $this->_form;
     $mform->addElement('html', get_string('urkundexplain', 'plagiarism_urkund'));
     $mform->addElement('checkbox', 'urkund_use', get_string('useurkund', 'plagiarism_urkund'));
     $mform->addElement('text', 'urkund_api', get_string('urkund_api', 'plagiarism_urkund'));
     $mform->addHelpButton('urkund_api', 'urkund_api', 'plagiarism_urkund');
     $mform->addRule('urkund_api', null, 'required', null, 'client');
     $mform->setDefault('urkund_api', 'https://secure.urkund.com/api/submissions');
     $mform->setType('urkund_api', PARAM_URL);
     $mform->addElement('text', 'urkund_username', get_string('urkund_username', 'plagiarism_urkund'));
     $mform->addHelpButton('urkund_username', 'urkund_username', 'plagiarism_urkund');
     $mform->addRule('urkund_username', null, 'required', null, 'client');
     $mform->setType('urkund_username', PARAM_TEXT);
     $mform->addElement('passwordunmask', 'urkund_password', get_string('urkund_password', 'plagiarism_urkund'));
     $mform->addHelpButton('urkund_password', 'urkund_password', 'plagiarism_urkund');
     $mform->addRule('urkund_password', null, 'required', null, 'client');
     $mform->setType('urkund_password', PARAM_TEXT);
     $mform->addElement('text', 'urkund_lang', get_string('urkund_lang', 'plagiarism_urkund'));
     $mform->addHelpButton('urkund_lang', 'urkund_lang', 'plagiarism_urkund');
     $mform->addRule('urkund_lang', null, 'required', null, 'client');
     $mform->setDefault('urkund_lang', 'en-US');
     $mform->setType('urkund_lang', PARAM_TEXT);
     $mform->addElement('textarea', 'urkund_student_disclosure', get_string('studentdisclosure', 'plagiarism_urkund'), 'wrap="virtual" rows="6" cols="50"');
     $mform->addHelpButton('urkund_student_disclosure', 'studentdisclosure', 'plagiarism_urkund');
     $mform->setDefault('urkund_student_disclosure', get_string('studentdisclosuredefault', 'plagiarism_urkund'));
     $mform->setType('urkund_student_disclosure', PARAM_TEXT);
     $mform->addElement('checkbox', 'urkund_optout', get_string('urkund_enableoptout', 'plagiarism_urkund'), '<br/>' . get_string('urkund_enableoptoutdesc', 'plagiarism_urkund'));
     $mform->setDefault('urkund_optout', true);
     $mform->addElement('text', 'urkund_wordcount', get_string('wordcount', 'plagiarism_urkund'));
     $mform->addHelpButton('urkund_wordcount', 'wordcount', 'plagiarism_urkund');
     $mform->setType('urkund_wordcount', PARAM_INT);
     $mform->addRule('urkund_wordcount', null, 'required', null, 'client');
     $mform->setDefault('urkund_wordcount', '50');
     $mods = core_component::get_plugin_list('mod');
     foreach ($mods as $mod => $modname) {
         if (plugin_supports('mod', $mod, FEATURE_PLAGIARISM)) {
             $modstring = 'urkund_enable_mod_' . $mod;
             $mform->addElement('checkbox', $modstring, get_string('urkund_enableplugin', 'plagiarism_urkund', $mod));
             if ($modname == 'assign') {
                 $mform->setDefault($modstring, 1);
             }
         }
     }
     $this->add_action_buttons(true);
 }
开发者ID:ramdesh,项目名称:moodle-plagiarism_urkund,代码行数:46,代码来源:urkund_form.php

示例14: get_all_plugins_with_tests

 /**
  * Returns all the plugins having tests
  * @param string $testtype The kind of test we are looking for
  * @return array  all the plugins having tests
  */
 private static function get_all_plugins_with_tests($testtype)
 {
     $pluginswithtests = array();
     $plugintypes = core_component::get_plugin_types();
     ksort($plugintypes);
     foreach ($plugintypes as $type => $unused) {
         $plugs = core_component::get_plugin_list($type);
         ksort($plugs);
         foreach ($plugs as $plug => $fullplug) {
             // Look for tests recursively
             if (self::directory_has_tests($fullplug, $testtype)) {
                 $pluginswithtests[$type . '_' . $plug] = $fullplug;
             }
         }
     }
     return $pluginswithtests;
 }
开发者ID:evltuma,项目名称:moodle,代码行数:22,代码来源:tests_finder.php

示例15: get_blocks_from_path

 /**
  * Load all the blocks information needed for a given path within moodle2 backup
  *
  * This function, given one full path (course, activities/xxxx) will look for all the
  * blocks existing in the backup file, returning one array used to build the
  * proper restore plan by the @restore_plan_builder
  */
 public static function get_blocks_from_path($path)
 {
     global $DB;
     $blocks = array();
     // To return results
     static $availableblocks = array();
     // Get and cache available blocks
     if (empty($availableblocks)) {
         $availableblocks = array_keys(core_component::get_plugin_list('block'));
     }
     $path = $path . '/blocks';
     // Always look under blocks subdir
     if (!is_dir($path)) {
         return array();
     }
     if (!($dir = opendir($path))) {
         return array();
     }
     while (false !== ($file = readdir($dir))) {
         if ($file == '.' || $file == '..') {
             // Skip dots
             continue;
         }
         if (is_dir($path . '/' . $file)) {
             // Dir found, check it's a valid block
             if (!file_exists($path . '/' . $file . '/block.xml')) {
                 // Skip if xml file not found
                 continue;
             }
             // Extract block name
             $blockname = preg_replace('/(.*)_\\d+/', '\\1', $file);
             // Check block exists and is installed
             if (in_array($blockname, $availableblocks) && $DB->record_exists('block', array('name' => $blockname))) {
                 $blocks[$path . '/' . $file] = $blockname;
             }
         }
     }
     closedir($dir);
     return $blocks;
 }
开发者ID:nikitskynikita,项目名称:moodle,代码行数:47,代码来源:backup_general_helper.class.php


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