Proyectos de Subversion Moodle

Rev

Rev 11 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 11 Rev 1441
Línea 120... Línea 120...
120
        foreach ($this->toolbar as $tool) {
120
        foreach ($this->toolbar as $tool) {
121
            // Customize the output of a tool, like dropdowns.
121
            // Customize the output of a tool, like dropdowns.
122
            $method = 'export_tool_'.$tool['action'];
122
            $method = 'export_tool_'.$tool['action'];
123
            if (method_exists($this, $method)) {
123
            if (method_exists($this, $method)) {
124
                $this->$method($tool);
124
                $this->$method($tool);
-
 
125
            } else {
-
 
126
                $this->export_tool_default($tool);
125
            }
127
            }
126
            $data->tools[] = $tool;
128
            $data->tools[] = $tool;
127
        }
129
        }
Línea 128... Línea 130...
128
 
130
 
Línea 161... Línea 163...
161
                'contextid',
163
                'contextid',
162
                $allowedcontexts,
164
                $allowedcontexts,
163
                $this->context->id,
165
                $this->context->id,
164
                $strchoosecontext
166
                $strchoosecontext
165
            );
167
            );
166
            $singleselect->set_label($strchoosecontext, ['class' => 'sr-only']);
168
            $singleselect->set_label($strchoosecontext, ['class' => 'visually-hidden']);
167
            $data->allowedcontexts = $singleselect->export_for_template($output);
169
            $data->allowedcontexts = $singleselect->export_for_template($output);
168
        }
170
        }
Línea 169... Línea 171...
169
 
171
 
170
        return $data;
172
        return $data;
Línea 207... Línea 209...
207
            }
209
            }
208
        }
210
        }
Línea 209... Línea 211...
209
 
211
 
210
        $tool['contenttypes'] = $addoptions;
212
        $tool['contenttypes'] = $addoptions;
-
 
213
    }
-
 
214
 
-
 
215
    /**
-
 
216
     * This is the default output of a tool.
-
 
217
     * It will be displayed as a button by default.
-
 
218
     *
-
 
219
     * @param array $tool Data for rendering the Add dropdown, including the editable content types.
-
 
220
     * @return void
-
 
221
     */
-
 
222
    private function export_tool_default(array &$tool): void {
-
 
223
        if (empty($tool['checkbox']) && empty($tool['dropdown'])) {
-
 
224
            $tool['button'] = true;
-
 
225
        }
211
    }
226
    }