aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/cg2/sample/sample.inc15
-rw-r--r--packages/cg2/sample/sample_ui.xml3
2 files changed, 12 insertions, 6 deletions
diff --git a/packages/cg2/sample/sample.inc b/packages/cg2/sample/sample.inc
index 9f53c8de..62ec59ab 100644
--- a/packages/cg2/sample/sample.inc
+++ b/packages/cg2/sample/sample.inc
@@ -1,11 +1,11 @@
<?php
-var_dump('BEING INCLUDED');
+//var_dump('BEING INCLUDED');
function sample_on_load_event(&$widgets)
{
/* Called when the form is just loaded. You receive the array widgets as
* argument, and can modify it to alter the behavior of the form. */
- var_dump('BEING LOADED');
+ //var_dump('BEING LOADED');
//$widget =& $widgets[2];
$widget =& get_widget($widgets, 'mytextarea');
$widget->value='This example shows how to change the text inside a text box from within the include file, when the form is loaded.';
@@ -16,7 +16,14 @@ function sample_on_sync_event()
/* This is called when the form is posted. You generally want to sync the
* configurations in the XML file to settings in files spread across the file
* system or maybe restart a service here. */
- var_dump('BEING SYNCED');
+ //var_dump('BEING SYNCED');
+}
+
+function sample_on_apply_event()
+{
+ /* This is called when a configuration has been changed and the user is
+ * prompted to apply the changes and clicks "Apply changes". */
+ var_dump('BEING APPLIED');
}
function sample_on_submit_event()
@@ -25,6 +32,6 @@ function sample_on_submit_event()
* clicked. This should only be used when you have more than one submit
* button in the same form. Otherwise, <on_load_event> performs better and
* is cleaner. */
- var_dump('BEING SUBMITTED');
+ //var_dump('BEING SUBMITTED');
}
?>
diff --git a/packages/cg2/sample/sample_ui.xml b/packages/cg2/sample/sample_ui.xml
index 65d9ebdf..f862b103 100644
--- a/packages/cg2/sample/sample_ui.xml
+++ b/packages/cg2/sample/sample_ui.xml
@@ -72,8 +72,7 @@
<element>
<type>table</type>
<buttons>move,edit,delete,add</buttons>
- <apply>Those stupid rules have been updated. Click this button to apply thechanges.</apply>
- <on_sync_event>sample_on_sync_event</on_sync_event>
+ <on_apply_event>sample_on_apply_event</on_apply_event>
<widget>
<type>checkbox</type>
<name>dummycheckbox</name>