aboutsummaryrefslogtreecommitdiffstats
path: root/config/cg2/sample
diff options
context:
space:
mode:
Diffstat (limited to 'config/cg2/sample')
-rw-r--r--config/cg2/sample/i18n/messages_de.xml7
-rw-r--r--config/cg2/sample/i18n/messages_en.xml7
-rw-r--r--config/cg2/sample/sample.inc37
-rw-r--r--config/cg2/sample/sample.xml18
-rw-r--r--config/cg2/sample/sample_ui.xml156
-rw-r--r--config/cg2/sample/sample_ui2.xml29
6 files changed, 254 insertions, 0 deletions
diff --git a/config/cg2/sample/i18n/messages_de.xml b/config/cg2/sample/i18n/messages_de.xml
new file mode 100644
index 00000000..0cfef583
--- /dev/null
+++ b/config/cg2/sample/i18n/messages_de.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<po creationdate ="2006-09-20 12:37+0100" translator="me@daniel.stefan.haischt.name">
+ <message msgid="hey, this is only meant for quick and dirty stuff, do NOT implement anything longer than 2 or 3 commands here! Btw, i was clicked."
+ msgstr="Hei, dies eignet sich nur f&#252;r Testzwecke. Benutze nur nur Quellcode der nicht mehr als 2 oder 3 Befehle umfasst! BTW, Ich wurde gedr&#252;ckt." />
+ <message msgid="Hi, don't abuse me, use include_javascript instead!"
+ msgstr="Hallo, missbrauche mich nicht. Nutze stattdessen include_javascript!" />
+</po> \ No newline at end of file
diff --git a/config/cg2/sample/i18n/messages_en.xml b/config/cg2/sample/i18n/messages_en.xml
new file mode 100644
index 00000000..1ee7d24d
--- /dev/null
+++ b/config/cg2/sample/i18n/messages_en.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<po creationdate ="2006-09-20 12:37+0100" translator="me@daniel.stefan.haischt.name">
+ <message msgid="hey, this is only meant for quick and dirty stuff, do NOT implement anything longer than 2 or 3 commands here! Btw, i was clicked."
+ msgstr="hey, this is only meant for quick and dirty stuff, do NOT implement anything longer than 2 or 3 commands here! Btw, i was clicked." />
+ <message msgid="Hi, don't abuse me, use include_javascript instead!"
+ msgstr="Hi, don't abuse me, use include_javascript instead!" />
+</po> \ No newline at end of file
diff --git a/config/cg2/sample/sample.inc b/config/cg2/sample/sample.inc
new file mode 100644
index 00000000..62ec59ab
--- /dev/null
+++ b/config/cg2/sample/sample.inc
@@ -0,0 +1,37 @@
+<?php
+//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');
+ //$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.';
+}
+
+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');
+}
+
+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()
+{
+ /* This allows you to perform an action when an specific submit button is
+ * 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');
+}
+?>
diff --git a/config/cg2/sample/sample.xml b/config/cg2/sample/sample.xml
new file mode 100644
index 00000000..d851c54e
--- /dev/null
+++ b/config/cg2/sample/sample.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<coregui_master>
+<version>2.0</version>
+
+<title>A fancy example</title>
+
+<!--<include>sample.inc</include>-->
+<!--<tabs_callback>sample_generate_tabs</tabs_callback>-->
+<tab>
+ <label>My fancy tab</label>
+ <interface>sample_ui.xml</interface>
+</tab>
+<tab>
+ <label>Another fancy tab</label>
+ <interface>sample_ui2.xml</interface>
+</tab>
+
+</coregui_master>
diff --git a/config/cg2/sample/sample_ui.xml b/config/cg2/sample/sample_ui.xml
new file mode 100644
index 00000000..aebe8bfe
--- /dev/null
+++ b/config/cg2/sample/sample_ui.xml
@@ -0,0 +1,156 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<coregui_interface>
+<version>2.0</version>
+<config>sample</config>
+
+<include>sample.inc</include>
+<!--<include>sample2.inc</include>-->
+<include_javascript>sample.js</include_javascript>
+
+<element>
+ <type>form</type>
+ <on_load_event>sample_on_load_event</on_load_event>
+ <on_sync_event>sample_on_sync_event</on_sync_event>
+ <widget>
+ <type>header</type>
+ <label xml:lang="en-US">Headers are useful to separate stuff...</label>
+ </widget>
+ <widget>
+ <type>textbox</type>
+ <name>mytextbox</name>
+ <label xml:lang="en-US">My fancy textbox</label>
+ <description xml:lang="en-US">This is a textbox.</description>
+ <value xml:lang="en-US">Welcome to the world of coregui 2.0</value>
+ <required/>
+ </widget>
+ <widget>
+ <type>ipsec_select</type>
+ <name>ipsec</name>
+ <label xml:lang="en-US">IPsec selection</label>
+ <description xml:lang="en-US">IPsec selection widget test.</description>
+ <multiple/>
+ </widget>
+ <widget>
+ <type>select</type>
+ <name>sample_sel</name>
+ <label xml:lang="en-US">Sample selection</label>
+ <option>
+ <name>foo</name>
+ <label xml:lang="en-US">Foo</label>
+ </option>
+ <option>
+ <name>bar</name>
+ <label xml:lang="en-US">Bar</label>
+ </option>
+ </widget>
+ <widget>
+ <type>interfaces_select</type>
+ <name>inter_sel</name>
+ <label xml:lang="en-US">Sample interfaces select</label>
+ <multiple/>
+ </widget>
+ <widget>
+ <type>textarea</type>
+ <name>mytextarea</name>
+ <label xml:lang="en-US">My fancy textarea</label>
+ <description xml:lang="en-US">Just testing descriptions...</description>
+ <value xml:lang="en-US">This widget can not be edited!</value>
+ <read_only/>
+ </widget>
+ <widget>
+ <type>checkbox</type>
+ <name>mycheckbox</name>
+ <label xml:lang="en-US">A sample checkbox</label>
+ <caption xml:lang="en-US">Check this nice checkbox</caption>
+ <description xml:lang="en-US">Now checkboxes can have a caption as well.</description>
+ <on_check_javascript>_('hey, this is only meant for quick and dirty stuff, do NOT implement anything longer than 2 or 3 commands here! Btw, i was clicked.');</on_check_javascript>
+ </widget>
+ <widget>
+ <type>submit</type>
+ <name>mysubmit</name>
+ <caption xml:lang="en-US">Send something</caption>
+ <on_submit_event>sample_on_submit_event</on_submit_event>
+ <group_start/>
+ </widget>
+ <widget>
+ <type>button</type>
+ <name>mybutton</name>
+ <caption xml:lang="en-US">Cancel something</caption>
+ <description xml:lang="en-US">The description for the last element in a group is the description that matters.</description>
+ <on_click_javascript>_('Hi, don\'t abuse me, use include_javascript instead!');</on_click_javascript>
+ <group_end/>
+ </widget>
+ <widget>
+ <type>textbox</type>
+ <name>dummydummy</name>
+ <label xml:lang="en-US">Just some dummy text</label>
+ <do_not_display/>
+ </widget>
+ <widget>
+ <type>checkbox</type>
+ <name>anothercheckbox</name>
+ <label xml:lang="en-US">Another checkbox</label>
+ <caption xml:lang="en-US">Enable</caption>
+ <description xml:lang="en-US">Another checkbox, this time after a group, and disabled.</description>
+ <disabled/>
+ </widget>
+</element>
+
+<element>
+ <type>table</type>
+ <buttons>move,edit,delete,add</buttons>
+ <on_apply_event>sample_on_apply_event</on_apply_event>
+ <widget>
+ <type>checkbox</type>
+ <name>dummycheckbox</name>
+ <label xml:lang="en-US">Dummy checkbox</label>
+ </widget>
+ <widget>
+ <type>port</type>
+ <name>dummyport</name>
+ <label xml:lang="en-US">Port</label>
+ <description xml:lang="en-US">Enter a port here.</description>
+ <value>3128</value>
+ <required/>
+ </widget>
+ <widget>
+ <type>textbox</type>
+ <name>dummysetting</name>
+ <label xml:lang="en-US">Dummy setting</label>
+ <description xml:lang="en-US">This dummy setting will not show up in the table.</description>
+ <not_in_table/>
+ </widget>
+ <widget>
+ <type>textarea</type>
+ <name>longfield</name>
+ <label xml:lang="en-US">Very long field</label>
+ <description xml:lang="en-US">Very very very very very long field.</description>
+ <highlighted/>
+ </widget>
+</element>
+
+<element>
+ <type>form</type>
+ <widget>
+ <type>header</type>
+ <label xml:lang="en-US">...such as two different forms</label>
+ </widget>
+ <widget>
+ <type>button</type>
+ <name>mybutton</name>
+ <label xml:lang="en-US">A simple button</label>
+ <caption xml:lang="en-US">Another silly button</caption>
+ </widget>
+</element>
+
+<element>
+ <type>table</type>
+ <widget>
+ <label xml:lang="en-US">Silly test</label>
+ </widget>
+ <widget>
+ <label xml:lang="en-US">Another field</label>
+ </widget>
+</element>
+
+</coregui_interface>
diff --git a/config/cg2/sample/sample_ui2.xml b/config/cg2/sample/sample_ui2.xml
new file mode 100644
index 00000000..aa17d49d
--- /dev/null
+++ b/config/cg2/sample/sample_ui2.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<coregui_interface>
+<version>2.0</version>
+<config>sample2</config>
+
+<element>
+ <type>form</type>
+ <widget>
+ <type>textbox</type>
+ <name>mytextbox</name>
+ <label xml:lang="en-US">My fancy textbox</label>
+ <value>Welcome to the world of coregui 2.0</value>
+ <required/>
+ </widget>
+ <widget>
+ <type>textarea</type>
+ <name>mytextarea</name>
+ <label xml:lang="en-US">My fancy textarea</label>
+ <value>This widget will be encoded to the config</value>
+ <encode/>
+ </widget>
+ <widget>
+ <type>submit</type>
+ <name>mysubmit</name>
+ <caption xml:lang="en-US">Submit this now</caption>
+ </widget>
+</element>
+
+</coregui_interface>