See how to save global config to work with this method

  1. <?php
  2. /**
  3.  * Global Settings Example
  4.  *
  5.  * @author Mark Nielsen
  6.  * @version $Id$
  7.  * @package blocks/helloworld
  8.  ***/
  9.  
  10. defined('MOODLE_INTERNAL'or die('Direct access to this script is forbidden.');
  11.  
  12. $configs   array();
  13. $configs[new admin_setting_configtext('textexample'get_string('textexample''block_helloworld')get_string('textexampledesc''block_helloworld')'Hello World!');
  14.  
  15. // Define the config plugin so it is saved to
  16. // the config_plugin table then add to the settings page
  17. foreach ($configs as $config{
  18.     $config->plugin 'blocks/helloworld';
  19.     $settings->add($config);
  20. }

Documentation generated on Thu, 28 Jun 2012 16:33:48 -0700 by phpDocumentor 1.4.3