Example #1
0
<?php

error_reporting(E_ERROR | E_WARNING);
try {
    require 'util.php';
    $type = $_GET['type'];
    $cate = get_par("cate");
    $list = get_test_cate_list();
    if ($type == 'addTest') {
        $text = get_par('text');
        $ld = get_par('ld');
        $rd = get_par('rd');
        $tpl = get_par('tpl');
        $class = $list[$cate];
        $add = get_par('add');
        $clsOptions = get_cls_options($cate);
        $properties = array("ld" => $ld, "rd" => $rd, "tpl" => $tpl);
        $options = array();
        if ($clsOptions['properties']) {
            foreach ($clsOptions['properties'] as $name => $value) {
                if ($value === true || $value === false) {
                    $properties[$name] = !!get_par($name);
                } else {
                    $properties[$name] = get_par($name);
                }
            }
        }
        if ($clsOptions['options']) {
            foreach ($clsOptions['options'] as $name => $value) {
                if ($value === true || $value === false) {
                    $options[$name] = !!get_par($name);
Example #2
0
	style="margin-top: 10px;">测试结果正确,添加到测试用例</button>
	
				
				<?php 
}
?>
				<button class="preview">预览</button>
<button class="cancel">取消</button>
</div>

</div>
</div>
</div>
<script>
var clsOptions = <?php 
echo json_encode(get_cls_options());
?>
;
</script>
<script>
$(function(){
	function escape_js(str){
		if(!str || 'string' != typeof str) return str;
		return str.replace(/["'<>\\\/`]/g, function($0){
		   return '&#'+ $0.charCodeAt(0) +';';
		});
	}
	var current = '';
	$('.cate a.item').click(function(event){
		event.preventDefault();
		var url = $(this).attr("href");