本文整理汇总了PHP中get_plugin_list函数的典型用法代码示例。如果您正苦于以下问题:PHP get_plugin_list函数的具体用法?PHP get_plugin_list怎么用?PHP get_plugin_list使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_plugin_list函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: definition
protected function definition()
{
global $CFG;
$mform =& $this->_form;
$mform->addElement('html', get_string('compilatioexplain', 'plagiarism_compilatio'));
$mform->addElement('checkbox', 'compilatio_use', get_string('usecompilatio', 'plagiarism_compilatio'));
$mform->addElement('text', 'compilatio_api', get_string('compilatio_api', 'plagiarism_compilatio'));
$mform->addHelpButton('compilatio_api', 'compilatio_api', 'plagiarism_compilatio');
$mform->addRule('compilatio_api', null, 'required', null, 'client');
$mform->setDefault('compilatio_api', 'http://service.compilatio.net/webservices/CompilatioUserClient2.wsdl');
$mform->addElement('passwordunmask', 'compilatio_password', get_string('compilatio_password', 'plagiarism_compilatio'));
$mform->addHelpButton('compilatio_password', 'compilatio_password', 'plagiarism_compilatio');
$mform->addRule('compilatio_password', null, 'required', null, 'client');
$mform->addElement('textarea', 'compilatio_student_disclosure', get_string('studentdisclosure', 'plagiarism_compilatio'), 'wrap="virtual" rows="6" cols="50"');
$mform->addHelpButton('compilatio_student_disclosure', 'studentdisclosure', 'plagiarism_compilatio');
$mform->setDefault('compilatio_student_disclosure', get_string('studentdisclosuredefault', 'plagiarism_compilatio'));
$mods = get_plugin_list('mod');
foreach ($mods as $mod => $modname) {
if (plugin_supports('mod', $mod, FEATURE_PLAGIARISM)) {
$modstring = 'compilatio_enable_mod_' . $mod;
$mform->addElement('checkbox', $modstring, get_string('compilatio_enableplugin', 'plagiarism_compilatio', get_string('pluginname', 'mod_' . $mod)));
}
}
$this->add_action_buttons(true);
}
示例2: offlinequiz_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 offlinequiz_report_list($context)
{
global $DB;
static $reportlist = null;
if (!is_null($reportlist)) {
return $reportlist;
}
$reports = $DB->get_records('offlinequiz_reports', null, 'displayorder DESC', 'name, capability');
$reportdirs = get_plugin_list('offlinequiz');
// Order the reports tab in descending order of displayorder.
$reportcaps = array();
foreach ($reports as $key => $report) {
if (array_key_exists($report->name, $reportdirs)) {
$reportcaps[$report->name] = $report->capability;
}
}
// Add any other reports, which are on disc but not in the DB, on the end.
foreach ($reportdirs as $reportname => $notused) {
if (!isset($reportcaps[$reportname])) {
$reportcaps[$reportname] = null;
}
}
$reportlist = array();
foreach ($reportcaps as $name => $capability) {
if (empty($capability)) {
$capability = 'mod/offlinequiz:viewreports';
}
if (has_capability($capability, $context)) {
$reportlist[] = $name;
}
}
return $reportlist;
}
示例3: 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 = 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;
}
示例4: definition
function definition()
{
global $USER, $CFG, $COURSE;
$mform =& $this->_form;
//Accessibility: "Required" is bad legend text.
$strgeneral = get_string('general');
$strrequired = get_string('required');
/// Add some extra hidden fields
$mform->addElement('hidden', 'id');
$mform->addElement('hidden', 'course', $COURSE->id);
/// Print the required moodle fields first
$mform->addElement('header', 'moodle', $strgeneral);
$mform->addElement('text', 'username', get_string('username'), 'size="20"');
$mform->addRule('username', $strrequired, 'required', null, 'client');
$mform->setType('username', PARAM_RAW);
$auths = get_plugin_list('auth');
$auth_options = array();
foreach ($auths as $auth => $unused) {
$auth_options[$auth] = auth_get_plugin_title($auth);
}
$mform->addElement('select', 'auth', get_string('chooseauthmethod', 'auth'), $auth_options);
$mform->setHelpButton('auth', array('authchange', get_string('chooseauthmethod', 'auth')));
$mform->setAdvanced('auth');
$mform->addElement('passwordunmask', 'newpassword', get_string('newpassword'), 'size="20"');
$mform->setHelpButton('newpassword', array('newpassword', get_string('leavetokeep')));
$mform->setType('newpassword', PARAM_RAW);
$mform->addElement('advcheckbox', 'preference_auth_forcepasswordchange', get_string('forcepasswordchange'));
$mform->setHelpButton('preference_auth_forcepasswordchange', array('forcepasswordchange', get_string('forcepasswordchange')));
/// shared fields
useredit_shared_definition($mform);
/// Next the customisable profile fields
profile_definition($mform);
$this->add_action_buttons(false, get_string('updatemyprofile'));
}
示例5: is_last
/**
* Is this the last plugin in the list?
*
* @return bool
*/
public final function is_last() {
if ((count(get_plugin_list($this->get_subtype()))-1) == get_config($this->get_subtype() . '_' . $this->get_type(), 'sortorder')) {
return true;
}
return false;
}
示例6: definition
/**
* items in the form
*/
public function definition()
{
global $CURMAN, $CFG;
parent::definition();
$mform =& $this->_form;
$mform->addElement('hidden', 'id');
$mform->setType('id', PARAM_INT);
$mform->addElement('text', 'name', get_string('userset_name', 'local_elisprogram'));
$mform->setType('name', PARAM_TEXT);
$mform->addRule('name', get_string('required'), 'required', NULL, 'client');
$mform->addHelpButton('name', 'userset_name', 'local_elisprogram');
$mform->addElement('textarea', 'display', get_string('userset_description', 'local_elisprogram'), array('cols' => 40, 'rows' => 2));
$mform->setType('display', PARAM_CLEAN);
$mform->addHelpButton('display', 'userset_description', 'local_elisprogram');
$current_cluster_id = isset($this->_customdata['obj']->id) ? $this->_customdata['obj']->id : '';
//obtain the non-child clusters that we could become the child of, with availability
//determined based on the edit capability
$contexts = usersetpage::get_contexts('local/elisprogram:userset_edit');
$non_child_clusters = cluster_get_non_child_clusters($current_cluster_id, $contexts);
//parent dropdown
$mform->addElement('select', 'parent', get_string('userset_parent', 'local_elisprogram'), $non_child_clusters);
$mform->addHelpButton('parent', 'userset_parent', 'local_elisprogram');
// allow plugins to add their own fields
$mform->addElement('header', 'userassociationfieldset', get_string('userset_userassociation', 'local_elisprogram'));
$plugins = get_plugin_list(userset::ENROL_PLUGIN_TYPE);
foreach ($plugins as $plugin => $plugindir) {
require_once elis::plugin_file(userset::ENROL_PLUGIN_TYPE . '_' . $plugin, 'lib.php');
call_user_func('cluster_' . $plugin . '_edit_form', $this, $mform, $current_cluster_id);
}
// custom fields
$this->add_custom_fields('cluster', 'local/elisprogram:userset_edit', 'local/elisprogram:userset_view', 'cluster');
$this->add_action_buttons();
}
示例7: list_components
/**
* Returns a list of all components installed on the server
*
* @return array (string)legacyname => (string)frankenstylename
*/
public static function list_components()
{
$list['moodle'] = 'core';
$coresubsystems = get_core_subsystems();
ksort($coresubsystems);
// should be but just in case
foreach ($coresubsystems as $name => $location) {
if ($name != 'moodle.org') {
$list[$name] = 'core_' . $name;
}
}
$plugintypes = get_plugin_types();
foreach ($plugintypes as $type => $location) {
$pluginlist = get_plugin_list($type);
foreach ($pluginlist as $name => $ununsed) {
if ($type == 'mod') {
if (array_key_exists($name, $list)) {
throw new Exception('Activity module and core subsystem name collision');
}
$list[$name] = $type . '_' . $name;
} else {
$list[$type . '_' . $name] = $type . '_' . $name;
}
}
}
return $list;
}
示例8: definition
function definition()
{
global $USER, $CFG, $COURSE;
$mform =& $this->_form;
$editoroptions = null;
$filemanageroptions = null;
$userid = $USER->id;
if (is_array($this->_customdata)) {
if (array_key_exists('editoroptions', $this->_customdata)) {
$editoroptions = $this->_customdata['editoroptions'];
}
if (array_key_exists('filemanageroptions', $this->_customdata)) {
$filemanageroptions = $this->_customdata['filemanageroptions'];
}
if (array_key_exists('userid', $this->_customdata)) {
$userid = $this->_customdata['userid'];
}
}
//Accessibility: "Required" is bad legend text.
$strgeneral = get_string('general');
$strrequired = get_string('required');
/// Add some extra hidden fields
$mform->addElement('hidden', 'id');
$mform->setType('id', PARAM_INT);
$mform->addElement('hidden', 'course', $COURSE->id);
$mform->setType('course', PARAM_INT);
/// Print the required moodle fields first
$mform->addElement('header', 'moodle', $strgeneral);
$mform->addElement('text', 'username', get_string('username'), 'size="20"');
$mform->addRule('username', $strrequired, 'required', null, 'client');
$mform->setType('username', PARAM_RAW);
$auths = get_plugin_list('auth');
$auth_options = array();
foreach ($auths as $auth => $unused) {
$auth_options[$auth] = get_string('pluginname', "auth_{$auth}");
}
$mform->addElement('select', 'auth', get_string('chooseauthmethod', 'auth'), $auth_options);
$mform->addHelpButton('auth', 'chooseauthmethod', 'auth');
$mform->addElement('advcheckbox', 'suspended', get_string('suspended', 'auth'));
$mform->addHelpButton('suspended', 'suspended', 'auth');
if (!empty($CFG->passwordpolicy)) {
$mform->addElement('static', 'passwordpolicyinfo', '', print_password_policy());
}
$mform->addElement('passwordunmask', 'newpassword', get_string('newpassword'), 'size="20"');
$mform->addHelpButton('newpassword', 'newpassword');
$mform->setType('newpassword', PARAM_RAW);
$mform->addElement('advcheckbox', 'preference_auth_forcepasswordchange', get_string('forcepasswordchange'));
$mform->addHelpButton('preference_auth_forcepasswordchange', 'forcepasswordchange');
/// shared fields
useredit_shared_definition($mform, $editoroptions, $filemanageroptions);
/// Next the customisable profile fields
profile_definition($mform, $userid);
if ($userid == -1) {
$btnstring = get_string('createuser');
} else {
$btnstring = get_string('updatemyprofile');
}
$this->add_action_buttons(false, $btnstring);
}
示例9: test_get_submission_plugins
public function test_get_submission_plugins() {
$this->setUser($this->editingteachers[0]);
$assign = $this->create_instance();
$installedplugins = array_keys(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');
}
}
示例10: is_last
/**
* Is this the last plugin in the list?
*
* @return bool
*/
public final function is_last() {
$lastindex = count(get_plugin_list($this->get_subtype()))-1;
$currentindex = get_config($this->get_subtype() . '_' . $this->get_type(), 'sortorder');
if ($lastindex == $currentindex) {
return true;
}
return false;
}
示例11: __construct
function __construct()
{
$listPlugins = get_plugin_list("local");
if (isset($listPlugins["tpebbb"])) {
require_once $listPlugins["tpebbb"] . "/lib.php";
} else {
throw new Exception("require plugin 'local/tpebbb'");
}
$this->tpebbb = new TpeBigBlueButton();
global $LS_KEY, $SC_KEY, $BASIC_KEY, $INTER_KEY, $ADVAN_KEY;
$LS_KEY = "LS";
$SC_KEY = "SC";
$BASIC_KEY = 'Basic';
$INTER_KEY = 'Inter';
$ADVAN_KEY = 'Advan';
}
示例12: 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 = get_plugin_types();
ksort($plugintypes);
foreach ($plugintypes as $type => $unused) {
$plugs = 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;
}
示例13: definition
public function definition()
{
$mform = $this->_form;
$behaviour = array('deferredfeedback' => 'Deferred feedback', 'adaptive' => 'Adaptive', 'adaptivenopenalty' => 'Adaptive (no penalties)');
$qtypes = get_plugin_list('qtype');
foreach ($qtypes as $qtype => $notused) {
$qtypes[$qtype] = get_string($qtype, 'qtype_' . $qtype);
}
$mform->addElement('header', 'h1', 'Either extract a specific question_session');
$mform->addElement('text', 'attemptid', 'Quiz attempt id', array('size' => '10'));
$mform->addElement('text', 'questionid', 'Question id', array('size' => '10'));
$mform->addElement('header', 'h2', 'Or find and extract an example by type');
$mform->addElement('select', 'behaviour', 'Behaviour', $behaviour);
$mform->addElement('text', 'statehistory', 'State history', array('size' => '10'));
$mform->addElement('select', 'qtype', 'Question type', $qtypes);
$mform->addElement('text', 'extratests', 'Extra conditions', array('size' => '50'));
$this->add_action_buttons(false, 'Create test case');
}
示例14: validation
public function validation($data)
{
$mform =& $this->_form;
$errors = array();
$indicators = get_plugin_list('engagementindicator');
$sum = 0;
foreach ($indicators as $indicator => $path) {
$key = "weighting_{$indicator}";
if (isset($data[$key]) && (!is_numeric($data[$key]) || $data[$key] > 100 || $data[$key] < 0)) {
$errors["weight_group_{$indicator}"] = get_string('weightingmustbenumeric', 'coursereport_engagement');
continue;
}
if (isset($data[$key])) {
$sum += $data[$key];
}
}
if ($sum != 100) {
$errors['weightings_desc'] = get_string('weightingsumtoonehundred', 'coursereport_engagement');
}
return $errors;
}
示例15: coursereport_engagement_get_course_summary
function coursereport_engagement_get_course_summary($courseid)
{
global $CFG, $DB;
$risks = array();
// TODO: We want this to rely on enabled indicators in the course...
require_once $CFG->libdir . '/pluginlib.php';
require_once $CFG->dirroot . '/course/report/engagement/locallib.php';
$pluginman = plugin_manager::instance();
$instances = get_plugin_list('engagementindicator');
if (!($weightings = $DB->get_records_menu('coursereport_engagement', array('course' => $courseid), '', 'indicator, weight'))) {
// Setup default weightings, all equal.
$weight = sprintf('%.2f', 1 / count($instances));
foreach ($instances as $name => $path) {
$record = new stdClass();
$record->course = $courseid;
$record->indicator = $name;
$record->weight = $weight;
$record->configdata = null;
$wid = $DB->insert_record('coursereport_engagement', $record);
$weightings[$name] = $weight;
}
}
foreach ($instances as $name => $path) {
$plugin = coursereport_engagement_get_plugin_info($pluginman, 'engagementindicator_' . $name);
if ($plugin->is_enabled() && file_exists("{$path}/indicator.class.php")) {
require_once "{$path}/indicator.class.php";
$classname = "indicator_{$name}";
$indicator = new $classname($courseid);
$indicatorrisks = $indicator->get_course_risks();
$weight = isset($weightings[$name]) ? $weightings[$name] : 0;
foreach ($indicatorrisks as $userid => $risk) {
if (!isset($risks[$userid])) {
$risks[$userid] = 0;
}
$risks[$userid] += $risk->risk * $weight;
}
}
}
return $risks;
}