From fe0ca0756af0ae0ccf08b5b5215026e385f243e5 Mon Sep 17 00:00:00 2001 From: Fernando Lemos Date: Wed, 2 Aug 2006 19:24:37 +0000 Subject: Sample cg2 files, used as reference for the implementation. Feel free to send me suggestions. Those are also not complete yet. --- packages/cg2/sample/sample.inc | 30 +++++++++ packages/cg2/sample/sample.xml | 17 +++++ packages/cg2/sample/sample_ui.xml | 130 +++++++++++++++++++++++++++++++++++++ packages/cg2/sample/sample_ui2.xml | 28 ++++++++ 4 files changed, 205 insertions(+) create mode 100644 packages/cg2/sample/sample.inc create mode 100644 packages/cg2/sample/sample.xml create mode 100644 packages/cg2/sample/sample_ui.xml create mode 100644 packages/cg2/sample/sample_ui2.xml (limited to 'packages/cg2/sample') diff --git a/packages/cg2/sample/sample.inc b/packages/cg2/sample/sample.inc new file mode 100644 index 00000000..9f53c8de --- /dev/null +++ b/packages/cg2/sample/sample.inc @@ -0,0 +1,30 @@ +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_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, performs better and + * is cleaner. */ + var_dump('BEING SUBMITTED'); +} +?> diff --git a/packages/cg2/sample/sample.xml b/packages/cg2/sample/sample.xml new file mode 100644 index 00000000..980d4f8e --- /dev/null +++ b/packages/cg2/sample/sample.xml @@ -0,0 +1,17 @@ + +2.0 + +A fancy example + + + + + + sample_ui.xml + + + + sample_ui2.xml + + + diff --git a/packages/cg2/sample/sample_ui.xml b/packages/cg2/sample/sample_ui.xml new file mode 100644 index 00000000..65d9ebdf --- /dev/null +++ b/packages/cg2/sample/sample_ui.xml @@ -0,0 +1,130 @@ + +2.0 +sample + +sample.inc + +sample.js + + + form + sample_on_load_event + sample_on_sync_event + + header + + + + textbox + mytextbox + + This is a textbox + Welcome to the world of coregui 2.0 + + + + textarea + mytextarea + + Just testing descriptions... + This widget can not be edited! + + + + checkbox + mycheckbox + + Check this nice checkbox + Now checkboxes can have a caption as well. + alert('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.'); + + + submit + mysubmit + Send something + sample_on_submit_event + + + + button + mybutton + Cancel something + The description for the last element in a group is the description that matters. + alert('Hi, don\'t abuse me, use include_javascript instead!'); + + + + textbox + dummydummy + + + + + checkbox + anothercheckbox + + Enable + Another checkbox, this time after a group, and disabled. + + + + + + table + move,edit,delete,add + Those stupid rules have been updated. Click this button to apply thechanges. + sample_on_sync_event + + checkbox + dummycheckbox + + + + port + dummyport + + Enter a port here. + 3128 + + + + textbox + dummysetting + + This dummy setting will not show up in the table. + + + + textarea + longfield + + Very very very very very long field. + + + + + + form + + header + + + + button + mybutton + + Another silly button + + + + + table + + + + + + + + + diff --git a/packages/cg2/sample/sample_ui2.xml b/packages/cg2/sample/sample_ui2.xml new file mode 100644 index 00000000..27c8cf6e --- /dev/null +++ b/packages/cg2/sample/sample_ui2.xml @@ -0,0 +1,28 @@ + +2.0 +sample2 + + + form + + textbox + mytextbox + + Welcome to the world of coregui 2.0 + + + + textarea + mytextarea + + This widget will be encoded to the config + + + + submit + mysubmit + Submit this now + + + + -- cgit v1.2.3