Note:

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

Voice Changelog: Difference between revisions

From MoodleDocs
Line 39: Line 39:
==index.php==
==index.php==


* Code added at beginning of index.php
* Change 1:Code added at beginning of index.php
     // Post Processing in case voiceXML is enabled
     // Post Processing in case voiceXML is enabled
     if (voicexmlenabled()) {
     if (voicexmlenabled()) {
Line 45: Line 45:
     }
     }


* Code Added at the end of index.php  
* Change 2:Code Added at the end of index.php  
     // Post Processing in case voiceXML is enabled
     // Post Processing in case voiceXML is enabled
     if (voicexmlenabled()) {
     if (voicexmlenabled()) {
Line 53: Line 53:
         echo $output;
         echo $output;
     }
     }
* Alternatively - Better Solution
    Change 1 code included in print_header() function in weblib.php
    Change 2 code included in print_footer() function in weblib.php
  - This will minimize the change in code. As all pages already have the above two functions. I have tested the code for index.php and need to extend it to other pages.

Revision as of 09:25, 17 June 2007

Moodle 2.0


Moodle Code

Lib

Voice XML

voicexmlenabled()

  • Added
  • Returns whether voicexml feature is enabled/allowed or not.

post_process_voice()

  • Added
  • Post processes xhtml code
  • Gets voice code from body and places it in the head (correct location).

Weblib

print_header()

  • Modified
  • Code for checking if voicexml is enabled and printing corresponding header information.

createlink()

  • Added
  • Outputs a HTML Link (A Tag) code and correspondingly also outputs
  • the voice code for it if $voice is true.
  • @usage print_location_comment(__FILE__, __LINE__);
  • @param string $href Link Location
  • @param string $linktext Link Text
  • @param string $otherattributes
  • @param boolean $voice Whether to output voice code
  • @return string

index.php

  • Change 1:Code added at beginning of index.php
   // Post Processing in case voiceXML is enabled
   if (voicexmlenabled()) {
       ob_start();
   }
  • Change 2:Code Added at the end of index.php
   // Post Processing in case voiceXML is enabled
   if (voicexmlenabled()) {
       $output = ob_get_contents();
       $output = post_process_voice($output);
       ob_end_clean(); 
       echo $output;
   }
  • Alternatively - Better Solution
   Change 1 code included in print_header() function in weblib.php
   Change 2 code included in print_footer() function in weblib.php
 - This will minimize the change in code. As all pages already have the above two functions. I have tested the code for index.php and need to extend it to other pages.