mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-23 07:09:20 +01:00
PHP test page, works inside eGW + validation test
This commit is contained in:
parent
e76cf6eab2
commit
9f3551cc7a
13
etemplate/js/test/et2_test_input_validator.json
Normal file
13
etemplate/js/test/et2_test_input_validator.json
Normal file
@ -0,0 +1,13 @@
|
||||
var validation_data = {
|
||||
"content": {
|
||||
"textbox": "Always"
|
||||
},
|
||||
"sel_options": {
|
||||
"select": {
|
||||
one: "One",
|
||||
two: "Two",
|
||||
three: "Three"
|
||||
}
|
||||
},
|
||||
};
|
||||
|
17
etemplate/js/test/et2_test_input_validator.xet
Normal file
17
etemplate/js/test/et2_test_input_validator.xet
Normal file
@ -0,0 +1,17 @@
|
||||
<overlay>
|
||||
<grid>
|
||||
<columns>
|
||||
<column/>
|
||||
</columns>
|
||||
|
||||
<rows>
|
||||
<row><textbox id="textbox" required="false" /></row>
|
||||
<row><box><description value="Must be checked" /><checkbox id="checkbox" label="Must be checked" required="true" /></box></row>
|
||||
<!-- Not working yet
|
||||
<row><int id="int_min" min="5" label="Must be at least 5" /></row>
|
||||
<row><listbox id="select" options="Select one" required="true" /></row>
|
||||
-->
|
||||
<row><button label="Check" /></row>
|
||||
</rows>
|
||||
</grid>
|
||||
</overlay>
|
48
etemplate/js/test/test.php
Normal file
48
etemplate/js/test/test.php
Normal file
@ -0,0 +1,48 @@
|
||||
<?php
|
||||
/**
|
||||
* Test stuff from within an eGW framework
|
||||
*/
|
||||
|
||||
$GLOBALS['egw_info'] = array(
|
||||
'flags' => array(
|
||||
'currentapp' => 'etemplate',
|
||||
'noheader' => True,
|
||||
'nonavbar' => True,
|
||||
'app_header' => 'eT2 Test'
|
||||
)
|
||||
);
|
||||
include('../../../header.inc.php');
|
||||
|
||||
egw_framework::validate_file('.','etemplate2','etemplate');
|
||||
egw_framework::validate_file('jquery','jquery.tools.min','phpgwapi'); // Not needed once JS require works for files like this
|
||||
egw_framework::includeCSS('/etemplate/js/test/test.css');
|
||||
|
||||
common::egw_header();
|
||||
// parse_navbar();
|
||||
?>
|
||||
<script src="et2_test_timesheet_edit.json"></script>
|
||||
<script src="et2_test_input_validator.json"></script>
|
||||
Testing from inside framework, so JS includes work
|
||||
<div class="header">Choose one of the following tests:</div>
|
||||
<div id="linklist">
|
||||
<a href="#" onclick="open_xet('et2_test_timesheet_edit.xet', timesheet_data);">Timesheet edit dialog</a>
|
||||
<a href="#" onclick="open_xet('et2_test_template.xet');">Template proxy test</a>
|
||||
<a href="#" onclick="open_xet('et2_test_grid.xet');">Grid test</a>
|
||||
<a href="#" onclick="open_xet('et2_test_tabbox.xet');">Tabs test</a>
|
||||
<a href="#" onclick="open_xet('et2_test_basic_widgets.xet');">Basic widgits</a>
|
||||
<a href="#" onclick="open_xet('et2_test_input_validator.xet', validation_data);">Validation</a>
|
||||
</div>
|
||||
<div class="header">ETemplate2 container:</div>
|
||||
<div id="time"></div>
|
||||
<div id="container"></div>
|
||||
<script>
|
||||
var et2 = new etemplate2(document.getElementById("container"), "etemplate.etemplate_new.ajax_process_content");
|
||||
|
||||
function open_xet(file, content) {
|
||||
et2.load(file, content);
|
||||
}
|
||||
</script>
|
||||
<?php
|
||||
common::egw_footer();
|
||||
|
||||
?>
|
Loading…
Reference in New Issue
Block a user