This manual is deprecated. Please visit https://groupoffice.readthedocs.io for the latest documentation.

Difference between revisions of "Extending settings with your own module"

From Group-Office Groupware and CRM Documentation
Jump to: navigation, search
Line 9: Line 9:
 
For submitting your form fields you need to override the static "submitSettings" function:
 
For submitting your form fields you need to override the static "submitSettings" function:
 
<pre>
 
<pre>
public static function submitSettings(&$settingsController, &$params, &$response, $user) {
+
 
 +
class GO_Modulename_ModulenameModule extends GO_Base_Module{
 +
 
 +
  ......
 +
 
 +
  public static function submitSettings(&$settingsController, &$params, &$response, $user) {
 
 
return parent::submitSettings($settingsController, $params, $response, $user);
+
    return parent::submitSettings($settingsController, $params, $response, $user);
}
+
  }
 +
 
 +
  ......
 
</pre>
 
</pre>
  
Line 18: Line 25:
 
For loading your form fields you need to override the static "loadSettings" function:
 
For loading your form fields you need to override the static "loadSettings" function:
 
<pre>
 
<pre>
public static function loadSettings(&$settingsController, &$params, &$response, $user) {
+
 
 +
class GO_Modulename_ModulenameModule extends GO_Base_Module{
 +
 
 +
  ......
 +
 
 +
  public static function loadSettings(&$settingsController, &$params, &$response, $user) {
 
 
return parent::loadSettings($settingsController, $params, $response, $user);
+
    return parent::loadSettings($settingsController, $params, $response, $user);
}
+
  }
 +
 
 +
  ......
 
</pre>
 
</pre>

Revision as of 10:27, 27 July 2012

When creating your own module then you probably would have some module settings that you want to add to the Group-Office settings panel.

Therefore you will need to add your form fields to the settings tab panel and you will need to add some PHP code in your own module to handle those form fields.


In your ModulenameModule.php file you need to override 2 static functions:

For submitting your form fields you need to override the static "submitSettings" function:


class GO_Modulename_ModulenameModule extends GO_Base_Module{

  ......

  public static function submitSettings(&$settingsController, &$params, &$response, $user) {
				
    return parent::submitSettings($settingsController, $params, $response, $user);
  }

  ......


For loading your form fields you need to override the static "loadSettings" function:

	

class GO_Modulename_ModulenameModule extends GO_Base_Module{

  ......

  public static function loadSettings(&$settingsController, &$params, &$response, $user) {
		
    return parent::loadSettings($settingsController, $params, $response, $user);
  }

  ......