Merge branch 'master_MDL-32002' of git://github.com/danmarsden/moodle

This commit is contained in:
Sam Hemelryk 2012-08-08 09:43:44 +12:00
commit 60312b3189
4 changed files with 118 additions and 93 deletions

View file

@ -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
*