Merge branch 'MDL-45596-master' of git://github.com/FMCorz/moodle

This commit is contained in:
Dan Poltawski 2014-07-08 10:50:55 +01:00
commit 772d658f1d
2 changed files with 11 additions and 3 deletions

View file

@ -74,8 +74,16 @@ abstract class core_role_capability_table_base {
public function display() { public function display() {
if (count($this->capabilities) > self::NUM_CAPS_FOR_SEARCH) { if (count($this->capabilities) > self::NUM_CAPS_FOR_SEARCH) {
global $PAGE; global $PAGE;
$PAGE->requires->strings_for_js(array('filter', 'clear'), 'moodle'); $jsmodule = array(
$PAGE->requires->js_init_call('M.core_role.init_cap_table_filter', array($this->id, $this->context->id)); 'name' => 'rolescapfilter',
'fullpath' => '/admin/roles/module.js',
'strings' => array(
array('filter', 'moodle'),
array('clear', 'moodle'), ),
'requires' => array('node', 'cookie', 'escape')
);
$PAGE->requires->js_init_call('M.core_role.init_cap_table_filter', array($this->id, $this->context->id), false,
$jsmodule);
} }
echo '<table class="' . implode(' ', $this->classes) . '" id="' . $this->id . '">' . "\n<thead>\n"; echo '<table class="' . implode(' ', $this->classes) . '" id="' . $this->id . '">' . "\n<thead>\n";
echo '<tr><th class="name" align="left" scope="col">' . get_string('capability', 'core_role') . '</th>'; echo '<tr><th class="name" align="left" scope="col">' . get_string('capability', 'core_role') . '</th>';

View file

@ -51,7 +51,7 @@ M.core_role.init_cap_table_filter = function(Y, tableid, contextid) {
marginRight : 'auto' marginRight : 'auto'
}); });
// Create the capability search input. // Create the capability search input.
this.input = Y.Node.create('<input type="text" id="'+this.table.get('id')+'capabilitysearch" value="'+filtervalue+'" />'); this.input = Y.Node.create('<input type="text" id="'+this.table.get('id')+'capabilitysearch" value="'+Y.Escape.html(filtervalue)+'" />');
// Create a label for the search input. // Create a label for the search input.
this.label = Y.Node.create('<label for="'+this.input.get('id')+'">'+M.str.moodle.filter+' </label>'); this.label = Y.Node.create('<label for="'+this.input.get('id')+'">'+M.str.moodle.filter+' </label>');
// Create a clear button to clear the input. // Create a clear button to clear the input.