mirror of
https://github.com/moodle/moodle.git
synced 2025-08-10 03:16:42 +02:00
MDL-76242 core_contentbank: Hide/show unlisted content
This commit is contained in:
parent
554a790bf0
commit
92e10322d4
10 changed files with 120 additions and 6 deletions
|
@ -122,6 +122,8 @@ class bankcontent implements renderable, templatable {
|
|||
$method = 'export_tool_'.$tool['action'];
|
||||
if (method_exists($this, $method)) {
|
||||
$this->$method($tool);
|
||||
} else {
|
||||
$this->export_tool_default($tool);
|
||||
}
|
||||
$data->tools[] = $tool;
|
||||
}
|
||||
|
@ -207,4 +209,17 @@ class bankcontent implements renderable, templatable {
|
|||
|
||||
$tool['contenttypes'] = $addoptions;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is the default output of a tool.
|
||||
* It will be displayed as a button by default.
|
||||
*
|
||||
* @param array $tool Data for rendering the Add dropdown, including the editable content types.
|
||||
* @return void
|
||||
*/
|
||||
private function export_tool_default(array &$tool) {
|
||||
if (empty($tool['checkbox']) && empty($tool['dropdown'])) {
|
||||
$tool['button'] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue