Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Talk:Admin reports: Difference between revisions

From MoodleDocs
No edit summary
No edit summary
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:
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
'''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'')
'''2 -''' Copied index.php and settings.php from the admin\report\question folder (''you could use a different folder under admin\report'')
3 - edited the setting.php file, updating the code where it says '''question''' with folder name '''AU_ProfessionalDevelopment'''.
'''3 -''' edited the setting.php file, updating the code where it says '''question''' with folder name '''AU_ProfessionalDevelopment'''.


code looked like this when done
code looked like this when done
Line 10: Line 10:
$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'));
$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 the index.php, stripping out most of the code, leaving the following:
'''4 -''' edited the index.php, stripping out most of the code, leaving the following:


     require_once('../../../config.php');
     require_once('../../../config.php');
Line 22: Line 22:
     admin_externalpage_print_footer();
     admin_externalpage_print_footer();


5 Reloaded the moodle page (i am logged in as the admin - and can see the Admin. Block).  
'''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.  When i click on the report - it loads my page with the admin header and footer.
I can see '''AU_ProfessionalDevelopment''' in the admin\report block.  When i click on the report - it loads my page with the admin header and footer.

Revision as of 19:53, 20 August 2009

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 the setting.php file, updating the code where it says 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 the 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. When i click on the report - it loads my page with the admin header and footer.