@@ -47,7 +47,7 @@ class capquiz_admin_page_manage_capquiz_plugins extends admin_externalpage {
4747 */
4848 public function __construct (string $ subtype ) {
4949 $ this ->subtype = $ subtype ;
50- $ url = new moodle_url ('/mod/capquiz/adminmanageplugins.php ' , ['subtype ' => $ subtype ]);
50+ $ url = new \ core \ url ('/mod/capquiz/adminmanageplugins.php ' , ['subtype ' => $ subtype ]);
5151 parent ::__construct ('manage ' . $ subtype . 'plugins ' , get_string ('manage ' . $ subtype . 'plugins ' , 'capquiz ' ), $ url );
5252 }
5353
@@ -70,7 +70,7 @@ public function search($query): array {
7070 }
7171 }
7272 if ($ found ) {
73- $ result = new stdClass ();
73+ $ result = new \ stdClass ();
7474 $ result ->page = $ this ;
7575 $ result ->settings = [];
7676 return [$ this ->name => $ result ];
@@ -80,7 +80,6 @@ public function search($query): array {
8080 }
8181}
8282
83-
8483/**
8584 * Class that handles the display and configuration of the list of capquiz plugins.
8685 *
@@ -91,8 +90,8 @@ public function search($query): array {
9190 */
9291class capquiz_plugin_manager {
9392
94- /** @var moodle_url the url of the manage capquiz plugin page */
95- private moodle_url $ pageurl ;
93+ /** @var \core\url the url of the manage capquiz plugin page */
94+ private \ core \ url $ pageurl ;
9695
9796 /** @var string report */
9897 private string $ subtype ;
@@ -106,7 +105,7 @@ class capquiz_plugin_manager {
106105 * @param string $subtype
107106 */
108107 public function __construct (string $ subtype ) {
109- $ this ->pageurl = new moodle_url ('/mod/capquiz/adminmanageplugins.php ' , ['subtype ' => $ subtype ]);
108+ $ this ->pageurl = new \ core \ url ('/mod/capquiz/adminmanageplugins.php ' , ['subtype ' => $ subtype ]);
110109 $ this ->subtype = $ subtype ;
111110 }
112111
@@ -139,8 +138,7 @@ public function execute(string $action = 'view', ?string $plugin = null): void {
139138 */
140139 private function check_permissions (): void {
141140 require_login ();
142- $ systemcontext = context_system::instance ();
143- require_capability ('moodle/site:config ' , $ systemcontext );
141+ require_capability ('moodle/site:config ' , \core \context \system::instance ());
144142 }
145143
146144 /**
@@ -219,7 +217,7 @@ public function move_plugin(string $plugintomove, string $dir): string {
219217 * @return array The list of plugins
220218 */
221219 public function get_sorted_plugins_list (): array {
222- $ names = core_component ::get_plugin_list ($ this ->subtype );
220+ $ names = \ core \component ::get_plugin_list ($ this ->subtype );
223221 $ result = [];
224222 foreach ($ names as $ name => $ path ) {
225223 $ idx = get_config ($ this ->subtype . '_ ' . $ name , 'sortorder ' );
@@ -244,7 +242,7 @@ private function view_plugins_table(): void {
244242
245243 // Set up the table.
246244 $ this ->view_header ();
247- $ table = new flexible_table ($ this ->subtype . 'pluginsadminttable ' );
245+ $ table = new \ core_table \ flexible_table ($ this ->subtype . 'pluginsadminttable ' );
248246 $ table ->define_baseurl ($ this ->pageurl );
249247 $ table ->define_columns (['pluginname ' , 'version ' , 'hideshow ' , 'order ' , 'settings ' , 'uninstall ' ]);
250248 $ table ->define_headers ([get_string ($ this ->subtype . 'type ' , 'capquiz ' ),
@@ -286,8 +284,8 @@ private function view_plugins_table(): void {
286284
287285 $ exists = file_exists ($ CFG ->dirroot . '/mod/capquiz/ ' . $ shortsubtype . '/ ' . $ plugin . '/settings.php ' );
288286 if ($ row [1 ] !== '' && $ exists ) {
289- $ url = new moodle_url ('/admin/settings.php ' , ['section ' => $ this ->subtype . '_ ' . $ plugin ]);
290- $ row [] = html_writer::link ($ url , get_string ('settings ' ));
287+ $ url = new \ core \ url ('/admin/settings.php ' , ['section ' => $ this ->subtype . '_ ' . $ plugin ]);
288+ $ row [] = \ core \ output \ html_writer::link ($ url , get_string ('settings ' ));
291289 } else {
292290 $ row [] = ' ' ;
293291 }
@@ -324,14 +322,14 @@ private function view_header(): void {
324322 private function format_icon_link (string $ action , string $ plugin , string $ icon , string $ alt ): string {
325323 global $ OUTPUT ;
326324 if ($ action === 'delete ' ) {
327- $ url = core_plugin_manager ::instance ()->get_uninstall_url ($ this ->subtype . '_ ' . $ plugin , 'manage ' );
325+ $ url = \ core \plugin_manager ::instance ()->get_uninstall_url ($ this ->subtype . '_ ' . $ plugin , 'manage ' );
328326 if (!$ url ) {
329327 return ' ' ;
330328 }
331- return html_writer::link ($ url , get_string ('uninstallplugin ' , 'core_admin ' ));
329+ return \ core \ output \ html_writer::link ($ url , get_string ('uninstallplugin ' , 'core_admin ' ));
332330 }
333- $ url = new moodle_url ($ this ->pageurl , ['action ' => $ action , 'plugin ' => $ plugin , 'sesskey ' => sesskey ()]);
334- $ icon = new pix_icon ($ icon , $ alt , 'moodle ' , ['title ' => $ alt ]);
331+ $ url = new \ core \ url ($ this ->pageurl , ['action ' => $ action , 'plugin ' => $ plugin , 'sesskey ' => sesskey ()]);
332+ $ icon = new \ core \ output \ pix_icon ($ icon , $ alt , 'moodle ' , ['title ' => $ alt ]);
335333 return $ OUTPUT ->action_icon ($ url , $ icon , null , ['title ' => $ alt ]) . ' ' ;
336334 }
337335
0 commit comments