mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
Merge branch 'master_MDL-32002' of git://github.com/danmarsden/moodle
This commit is contained in:
commit
60312b3189
4 changed files with 118 additions and 93 deletions
|
@ -6925,95 +6925,6 @@ class admin_setting_manageexternalservices extends admin_setting {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Special class for plagiarism administration.
|
||||
*
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
class admin_setting_manageplagiarism extends admin_setting {
|
||||
/**
|
||||
* Calls parent::__construct with specific arguments
|
||||
*/
|
||||
public function __construct() {
|
||||
$this->nosave = true;
|
||||
parent::__construct('plagiarismui', get_string('plagiarismsettings', 'plagiarism'), '', '');
|
||||
}
|
||||
|
||||
/**
|
||||
* Always returns true
|
||||
*
|
||||
* @return true
|
||||
*/
|
||||
public function get_setting() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Always returns true
|
||||
*
|
||||
* @return true
|
||||
*/
|
||||
public function get_defaultsetting() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Always returns '' and doesn't write anything
|
||||
*
|
||||
* @return string Always returns ''
|
||||
*/
|
||||
public function write_setting($data) {
|
||||
// do not write any setting
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Return XHTML to display control
|
||||
*
|
||||
* @param mixed $data Unused
|
||||
* @param string $query
|
||||
* @return string highlight
|
||||
*/
|
||||
public function output_html($data, $query='') {
|
||||
global $CFG, $OUTPUT;
|
||||
|
||||
// display strings
|
||||
$txt = get_strings(array('settings', 'name'));
|
||||
|
||||
$plagiarismplugins = get_plugin_list('plagiarism');
|
||||
if (empty($plagiarismplugins)) {
|
||||
return get_string('nopluginsinstalled', 'plagiarism');
|
||||
}
|
||||
|
||||
$return = $OUTPUT->heading(get_string('availableplugins', 'plagiarism'), 3, 'main');
|
||||
$return .= $OUTPUT->box_start('generalbox authsui');
|
||||
|
||||
$table = new html_table();
|
||||
$table->head = array($txt->name, $txt->settings);
|
||||
$table->align = array('left', 'center');
|
||||
$table->data = array();
|
||||
$table->attributes['class'] = 'manageplagiarismtable generaltable';
|
||||
|
||||
// iterate through auth plugins and add to the display table
|
||||
$authcount = count($plagiarismplugins);
|
||||
foreach ($plagiarismplugins as $plugin => $dir) {
|
||||
if (file_exists($dir.'/settings.php')) {
|
||||
$displayname = "<span>".get_string($plugin, 'plagiarism_'.$plugin)."</span>";
|
||||
// settings link
|
||||
$settings = "<a href=\"$CFG->wwwroot/plagiarism/$plugin/settings.php\">{$txt->settings}</a>";
|
||||
// add a row to the table
|
||||
$table->data[] =array($displayname, $settings);
|
||||
}
|
||||
}
|
||||
$return .= html_writer::table($table);
|
||||
$return .= get_string('configplagiarismplugins', 'plagiarism');
|
||||
$return .= $OUTPUT->box_end();
|
||||
return highlight($query, $return);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Special class for overview of external services
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue