error/admin/sectionerror: Różnice pomiędzy wersjami

Z MoodleDocs
Skocz do:nawigacja, szukaj
Nie podano opisu zmian
 
Tim Hunt (dyskusja | edycje)
Nie podano opisu zmian
Linia 2: Linia 2:
  admin_externalpage_setup('foo');
  admin_externalpage_setup('foo');


Solution is to add the registration code to admin/server.php:
The solution is to add a reference to the page in the appropriate file in admin/settings/''XXX''.php. Something like:


  if (file_exists("$CFG->dirroot/$CFG->admin/foo.php")) {
  $ADMIN->add("''parent_section''", new admin_externalpage('foo', "Foo Admin Component", "$CFG->wwwroot/$CFG->admin/foo.php"));
    $ADMIN->add('server', new admin_externalpage('foo', "Foo Admin Component", "$CFG->wwwroot/$CFG->admin/foo.php"));
}

Wersja z 13:57, 1 sty 2009

The error means that a new admin page 'foo' (the one you're developing right now) is not registered with the Admin menu. It is triggered with the call:

admin_externalpage_setup('foo');

The solution is to add a reference to the page in the appropriate file in admin/settings/XXX.php. Something like:

$ADMIN->add("parent_section", new admin_externalpage('foo', "Foo Admin Component", "$CFG->wwwroot/$CFG->admin/foo.php"));