Development talk:Admin reports: Difference between revisions

From MoodleDocs
(creating admin report)
 
(Removing all content from page)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
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:


Created a new folder under admin\report, called AU_ProfessionalDevelopment
Copied index.php and settings.php from the admin\report\question folder (you could use a different folder under admin\report)
edited the setting.php file, updating the code where it says '''question''' with my 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'));
edited the index.php, stripping out most of the code, leaving the following:
    require_once('../../../config.php');
    require_once($CFG->libdir.'/adminlib.php');
# these functions
    admin_externalpage_setup('reportAU_ProfessionalDevelopment');
    admin_externalpage_print_header();
    //print_heading(get_string('admin report', 'myReport'));
$header = "<h2>Accelerateu PD Participant Activity Reporting</h2>";
    echo $header;
    admin_externalpage_print_footer();
When i reloaded my moodle page, i could see '''AU_ProfessionalDevelopment''' within the admin\report block.  When i click on the report - it loads my page with the admin header and footer.

Latest revision as of 20:00, 20 August 2009