Development talk:Admin reports

From MoodleDocs

I am using Moodle 1.9. I have created a new reporting module in my local moodle server. I did have problems getting the admin. functions to work, i tried following the examples here but was not able to move forward. To accomplish the same thing, I completed these steps:

1 - Created a new folder under admin\report, called AU_ProfessionalDevelopment

2 - Copied index.php and settings.php from the admin\report\question folder (you could use a different folder under admin\report)

3 - edited setting.php, updating question with folder name AU_ProfessionalDevelopment.

code looked like this when done

$ADMIN->add('reports', new admin_externalpage('reportAU_ProfessionalDevelopment', get_string('AU_ProfessionalDevelopment', 'admin'), "$CFG->wwwroot/$CFG->admin/report/AU_ProfessionalDevelopment/index.php", 'moodle/site:config'));

4 - edited index.php, stripping out most of the code, leaving the following:

   require_once('../../../config.php');
   require_once($CFG->libdir.'/adminlib.php');
   admin_externalpage_setup('reportAU_ProfessionalDevelopment');
   admin_externalpage_print_header();

$header = "

Accelerateu PD Participant Activity Reporting

";

   echo $header;
   admin_externalpage_print_footer();

5 Reloaded the moodle page (i am logged in as the admin - and can see the Admin. Block). I can see AU_ProfessionalDevelopment in the admin\report block. Clicking on it loads my page with the admin header and footer.