<?php
if (!defined('IN_CONTEXT')) die('access violation error!');

//var_dump($curr_mblock);
$arr_params = array();
if (strlen(trim($curr_mblock->s_param)) > 0) {
	$arr_params = unserialize($curr_mblock->s_param);
}
?>
<script type="text/javascript" language="javascript">
<!--
var popup_win = false;

function on_success(response) {
    var o_result = _eval_json(response);
    if (!o_result) {
        return on_failure(response);
    }
    if (o_result.result == "OK") {
        reloadParent();
    } else {
        return on_failure(response);
    }
}

function on_failure(response) {
    alert("<?php _e('Update failed!'); ?>");
}

// 28/4/2010 Add >>
$(function(){
	if( $('#cids').length > 0 ) {
		var cids = $('#cids').val();
		var len = cids.length;
		
		if ( (cids == '0') || (cids == '') ) {
			$("select").find("option").attr("selected", true);
		} else {
			var cida = cids.split(',');
			for( var i=0; i<len; i++ ) {
				$("select").find("option").each(function(){
			    	if( $(this).val() == cida[i] ) $(this).attr("selected", true);
			    });
			}
		}
	}
	if( $('#cids2').length > 0 ) {
		var cids2 = $('#cids2').val();
		var len = cids2.length;
		
		if ( (cids2 == '0') || (cids2 == '') ) {
			$("select").find("option").attr("selected", true);
		} else {
			var cida = cids2.split(',');
			for( var i=0; i<len; i++ ) {
				$("select").find("option").each(function(){
			    	if( $(this).val() == cida[i] ) $(this).attr("selected", true);
			    });
			}
		}
	}
});
// 28/4/2010 Add <<
//-->

function chgmultiple(val) {
	var mar_data2 = document.getElementById("mar_data2");
	document.getElementById("ex_params_mar_direc_id_").options.length=0;
	if(val=="text"){
	
		mar_data2.style.display="";
		//隐藏左右
		document.getElementById("ex_params_mar_direc_id_").options.add(new Option("<?php echo __('Top');?>","top"));
		document.getElementById("ex_params_mar_direc_id_").options.add(new Option("<?php echo __('Down');?>","down"));
	}else{
		mar_data2.style.display="none";
		document.getElementById("ex_params_mar_direc_id_").options.add(new Option("<?php echo __('Top');?>","top"));
		document.getElementById("ex_params_mar_direc_id_").options.add(new Option("<?php echo __('Down');?>","Down"));
		document.getElementById("ex_params_mar_direc_id_").options.add(new Option("<?php echo __('Right');?>","right"));
		document.getElementById("ex_params_mar_direc_id_").options.add(new Option("<?php echo __('Left');?>","left"));
	}
}
function changeprd(val1,val2){
	var text = document.getElementById("ex_params_marquee_class_").value;
	var addRow=document.getElementById("row_id").getAttribute("rowspan");
	if(text=="text" && val1=="prd_info"){
		var val1="article_info";
	}
	document.getElementById("prd_info").style.display="none";
	document.getElementById("article_info").style.display="none";
	var mar_prd_id = document.getElementById(val1);
	var mar_data1 = document.getElementById(val2);
	if(mar_data1.checked){
		mar_prd_id.style.display="";
		if(val2 !="ex_params_marquee_data3_")
		document.getElementById("row_id").setAttribute("rowspan",parseInt(addRow)+1);
	}else {
		mar_prd_id.style.display="none";
		if(val2 !="ex_params_marquee_data3_")
		document.getElementById("row_id").setAttribute("rowspan",parseInt(addRow)-1);
	}
}
function reupload(id){
	var img_id = document.getElementById("reupload"+id);
	img_id.innerHTML = "<input type='file' name='prd_extpic[]' size='15' />";
}
<?php
if($arr_params['marquee_class']=="text"){

?>
$(function(){
document.getElementById("ex_params_mar_direc_id_").options.length=0;
document.getElementById("ex_params_mar_direc_id_").options.add(new Option("<?php echo __('Top');?>","top"));
document.getElementById("ex_params_mar_direc_id_").options.add(new Option("<?php echo __('Down');?>","down"));
});
<?php }?>
	
// 添加flash幻灯项
function AddSlideTr() {
	var curnum = $('#ex_params_slide_num_').val();
	var tempnum = $('#ex_params_slide_temp_num_').val();
	var newnum = parseInt(curnum) + 1;
	var newtempnum = parseInt(tempnum) + 1;
	
	if (newnum > 6) {
		alert("<?php _e('Add up to 6');?>");
		$('#slide_img_srtr').find('a:last').hide();
		return false;
	} else {
		var htmltr = '<tr id="slide_img_sctr'+newtempnum+'"><td class="label">'+"<?php _e('Select Image');?>"+'</td><td colspan="2" class="entry" style="border-top:1px dashed #F35D02">';
		htmltr += '<input type="text" value="" id="ex_params_slide_img_src'+newtempnum+'_" name="ex_params[slide_img_src'+newtempnum+']">&nbsp;';
		htmltr += '<a onclick="popup_win=show_imgpicker(\'ex_params[slide_img_src'+newtempnum+']\');return false;" href="#">'+"<?php _e('Select Image');?>"+'</a>';
		htmltr += '&nbsp;&nbsp;&nbsp;&nbsp;<a onclick="DelSlideTr('+newtempnum+');return false;" href="javascript:void(0);">'+"<?php _e('Delete the flash slide items');?>"+'</a></td></tr>';
		htmltr += '<tr id="slide_img_ordetr'+newtempnum+'"><td class="label">'+"<?php _e('Display order');?>"+'</td><td colspan="2" class="entry">';
        htmltr += '<input type="text" size="4" value="" id="ex_params_slide_img_order'+newtempnum+'_" name="ex_params[slide_img_order'+newtempnum+']"></td></tr>';
		htmltr += '<tr id="slide_img_urtr'+newtempnum+'"><td class="label">'+"<?php _e('Image Url');?>"+'</td><td colspan="2" class="entry">';
        htmltr += '<input type="text" size="28" value="http://" onblur="if(this.value==\'\') this.value=\'http:\/\/\'" onfocus="if(this.value==\'http:\/\/\') this.value=\'\'" id="ex_params_slide_img_uri'+newtempnum+'_" name="ex_params[slide_img_uri'+newtempnum+']">';
        htmltr += '&nbsp;&nbsp;<img class="title" src="admin/template/images/answer1.gif" alt="help" title="'+"<?php _e('Click the picture after the jump to the web site');?>"+'" /></td></tr>';
		htmltr += '<tr id="slide_img_destr'+newtempnum+'"><td class="label">'+"<?php _e('Description');?>"+'</td><td colspan="2" class="entry">';
	    htmltr += '<input type="text" size="28" value="" id="ex_params_slide_img_desc'+newtempnum+'_" name="ex_params[slide_img_desc'+newtempnum+']"></td></tr>';
		
		$('#slide_img_destr').after(htmltr);
		// ++
		$('#ex_params_slide_num_').val(newnum);
		$('#ex_params_slide_temp_num_').val(newtempnum);
	}
}
// 删除flash幻灯项
function DelSlideTr(trid) {
	$('#slide_img_srtr').find('a:last').show();
	var curnum = $('#ex_params_slide_num_').val();
	var newnum = parseInt(curnum) - 1;
	
	var imgsrc = $('#slide_img_sctr'+trid+' > .entry').find('input[type=text]').val();
	if (imgsrc.length) {
		_ajax_request('mod_media', 'del_image', {'img': encodeURI(imgsrc)}, slide_onsuccess, slide_onfailed);	
	}
	
	$('#slide_img_sctr'+trid).remove();
	$('#slide_img_ordetr'+trid).remove();
	$('#slide_img_urtr'+trid).remove();
	$('#slide_img_destr'+trid).remove();
	// --
	$('#ex_params_slide_num_').val(newnum);
}
function slide_onsuccess(response) {}
function slide_onfailed(response) {}
</script>
<?php



if($_GET['mar']==1) {
	$_rowspan = 2;
	if($arr_params['marquee_data1']==1){
		$_rowspan += 1;
	}
	if($arr_params['marquee_data2']==1){
		$_rowspan += 1;
	}
}else{
	$_rowspan = 4;
}
$mb_form = new Form('index.php', 'mblockform', 'check_login_info');
$mb_form->setEncType('multipart/form-data');
$mb_form->p_open('mod_tool', 'save_prop', '_ajax');
?>
<table id="mblockform_table" class="form_table" cellspacing="1">
    <tfoot>
        <tr>
            <td colspan="3">
            <?php
			echo Html::input('submit', 'submit', __('Save'));
            echo Html::input('reset', 'reset', __('Reset'));
            echo Html::input('hidden', 'mb[id]', $curr_mblock->id);
            echo Html::input('hidden', 'dispage', $_SERVER['HTTP_REFERER']);
            // for adding flash slide
            echo Html::input('hidden', 'ex_params[slide_num]', $arr_params['slide_num']);
            // temp hidden
            echo Html::input('hidden', 'ex_params[slide_temp_num]', $arr_params['slide_temp_num']);
            ?>
            </td>
        </tr>
    </tfoot>
    <tbody>
        <tr>
            <td class="label"><?php _e('Title'); ?></td>
            <td class="entry" width="210">
            <?php
            echo Html::input('text', 'mb[title]', $curr_mblock->title);
            ?>
            </td>
			<td class="entry" id="row_id" rowspan="<?php echo sizeof($params)+$_rowspan;?>" style="text-align:left;vertical-align:top;">
			<?php
			if($_GET['mar']==1) {
				$pic_arr = array();
				$pic_remote_arr = array();
				$text_arr = array();
				foreach($marquees as $marquee){
					if($marquee->marquee_type=='pic' && $marquee->flag==3){
						$pic_remote_arr[] = $marquee;
					}else if($marquee->marquee_type=='pic' && $marquee->flag==1){
						$pic_arr[] = $marquee;
					}else if($marquee->marquee_type=='text' && $marquee->flag==1){
						$text_arr[] = $marquee;
					}
				}
			?>
			
			<div id="prd_info" style="display:<?php if($arr_params['marquee_data3']==1 && $arr_params['marquee_class']=='pic'){echo '';}else{echo 'none';}?>">
				图片上传：<br>
				<input type="text" name="prd_extpic[]" id="prd_extpic1" value="<?php echo $pic_arr[0]->pic?>"  size=15/>&nbsp;<a href="#" onclick="popup_win=show_imgpicker('prd_extpic1');return false;" title="">选择图片</a>&nbsp;&nbsp;链接：<input type="text" name="prd_name[]" value="<?php echo $pic_arr[0]->link?>"><input type="hidden" name="prd_id[]" value="<?php echo $pic_arr[0]->id?>"><br />
				<input type="text" name="prd_extpic[]" id="prd_extpic2" value="<?php echo $pic_arr[1]->pic?>"  size=15/>&nbsp;<a href="#" onclick="popup_win=show_imgpicker('prd_extpic2');return false;" title="">选择图片</a>&nbsp;&nbsp;链接：<input type="text" name="prd_name[]" value="<?php echo $pic_arr[1]->link?>"><input type="hidden" name="prd_id[]" value="<?php echo $pic_arr[1]->id?>"><br />
				<input type="text" name="prd_extpic[]" id="prd_extpic3" value="<?php echo $pic_arr[2]->pic?>"  size=15/>&nbsp;<a href="#" onclick="popup_win=show_imgpicker('prd_extpic3');return false;" title="">选择图片</a>&nbsp;&nbsp;链接：<input type="text" name="prd_name[]" value="<?php echo $pic_arr[2]->link?>"><input type="hidden" name="prd_id[]" value="<?php echo $pic_arr[2]->id?>"><br />
				<br>
				网络图片：<br>
				图片地址：<input type="text" name="remote_pic[]" size='15' value="<?php echo $pic_remote_arr[0]->pic?>">&nbsp;链接：<input type="text" name="remote_name[]" value="<?php echo $pic_remote_arr[0]->link?>"><input type="hidden" name="remote_id[]" value="<?php echo $pic_remote_arr[0]->id?>"><br />
				图片地址：<input type="text" name="remote_pic[]" size='15' value="<?php echo $pic_remote_arr[1]->pic?>">&nbsp;链接：<input type="text" name="remote_name[]" value="<?php echo $pic_remote_arr[1]->link?>" ><input type="hidden" name="remote_id[]" value="<?php echo $pic_remote_arr[1]->id?>"<br />
				图片地址：<input type="text" name="remote_pic[]" size='15' value="<?php echo $pic_remote_arr[2]->pic?>">&nbsp;链接：<input type="text" name="remote_name[]" value="<?php echo $pic_remote_arr[2]->link?>"><input type="hidden" name="remote_id[]" value="<?php echo $pic_remote_arr[2]->id?>"<br />
			</div>
	
			<div id="article_info" style="display:<?php if($arr_params['marquee_data3']==1 && $arr_params['marquee_class']=='text'){echo '';}else{echo 'none';}?>">
				自定义文本：<br>
				文本标题：<input type="text" name="def_text[]" size='15' value="<?php echo $text_arr[0]->title?>">&nbsp;链接：<input type="text" name="def_name[]" value="<?php echo $text_arr[0]->link?>"><input type="hidden" name="def_id[]" value="<?php echo $text_arr[0]->id?>"><br />
				文本标题：<input type="text" name="def_text[]" size='15' value="<?php echo $text_arr[1]->title?>">&nbsp;链接：<input type="text" name="def_name[]" value="<?php echo $text_arr[1]->link?>"><input type="hidden" name="def_id[]" value="<?php echo $text_arr[1]->id?>"><br />
				文本标题：<input type="text" name="def_text[]" size='15' value="<?php echo $text_arr[2]->title?>">&nbsp;链接：<input type="text" name="def_name[]" value="<?php echo $text_arr[2]->link?>"><input type="hidden" name="def_id[]" value="<?php echo $text_arr[2]->id?>"><br />
				
			</div>
			<?php }?>
			</td>
        </tr>
        <tr>
            <td class="label"></td>
            <td class="entry">
            <?php
            echo Html::input('checkbox', 'mb[show_title]', '1', 
                Toolkit::switchText($curr_mblock->show_title, 
                    array('0' => '', '1' => 'checked="checked"')));
            ?>
            &nbsp;<?php _e('Show Title'); ?>
            </td>
        </tr>
        <!-- [Disable publish status temporarily] tr>
            <td class="label"><?php _e('Publish'); ?></td>
            <td class="entry">
            <?php
            echo Html::input('checkbox', 'mb[published]', '1', 
                Toolkit::switchText($curr_mblock->published, 
                    array('0' => '', '1' => 'checked="checked"')));
            ?>
            </td>
        </tr -->
        <tr>
            <td class="label"></td>
            <td class="entry">
            <?php
            $checked = '';
            if ($curr_mblock->s_query_hash == '_ALL') {
                $checked = 'checked="checked"';
            }
            echo Html::input('checkbox', 'dispallpg', '1', $checked);
            ?>
            &nbsp;<?php _e('Display on all pages'); ?>
            </td>
        </tr>
        <tr>
            <td class="label"></td>
            <td class="entry">
            <?php
            echo Html::input('checkbox', 'ismemonly', '1', 
                Toolkit::switchText(strval(ACL::isMemOnly($curr_mblock->for_roles)), 
                    array('0' => '', '1' => 'checked="checked"')));
            ?>
            &nbsp;<?php _e('Member only access'); ?>
            </td>
        </tr>
        <?php


        for ($i = 0; $i < sizeof($params); $i++) {
			if($_GET['mar']==1) {
				if(substr($params[$i]['id'],0,-2)=='mar_article_id' && $arr_params['marquee_data2']==1){
					$display = '';
				} else if(substr($params[$i]['id'],0,-2)=='mar_prd_id' && $arr_params['marquee_data1']==1){
					$display = '';
				}else if(in_array($params[$i]['id'],array('marquee_width','marquee_speed','mar_direc_id','marquee_class','marquee_data'))){
					$display = '';
				}else{
					$display = 'none';
				}
			}
			// for sitestarv1.3 slide_img_height/width start
			if (!in_array($params[$i]['id'], array('slide_img_width','slide_img_height'))) {
        ?>
        <tr id=<?php echo substr($params[$i]['id'],0,-2).'tr'; ?> style="display:<?php echo $display;?>">
            <td class="label"><?php _e($params[$i]['label']); ?></td>
            <td class="entry" <?php if (in_array($params[$i]['tag'],array('slide_input','slide_imgpicker'))){?>colspan="2"<?php }?>>
        <?php
            switch ($params[$i]['tag']) {
                case 'input':
                	switch ($params[$i]['type']) {
                		case 'text':
		                    echo Html::input($params[$i]['type'], 
		                        'ex_params['.$params[$i]['id'].']', 
		                        $arr_params[$params[$i]['id']], 
		                        $params[$i]['extra']);
                			break;
                	    case 'checkbox':
                	    	$element_extra = $params[$i]['extra'];
                	    	if (intval($arr_params[$params[$i]['id']]) == 1) {
                	    	    $element_extra .= ' checked="checked"';
                	    	}
		                    echo Html::input($params[$i]['type'], 
		                        'ex_params['.$params[$i]['id'].']', 
		                        $params[$i]['value'], 
		                        $element_extra);
                	    	break;
						case 'checkbox2':
							if($arr_params['marquee_data1']==1) { $check1= 'checked="checked"';}
							if($arr_params['marquee_data2']==1) { $check2= 'checked="checked"';}
							if($arr_params['marquee_data3']==1) { $check3= 'checked="checked"';}
							if($arr_params['marquee_class']=='pic') { $pic_none= 'none';}else{$pic_none= '';}
		                    echo '<span id="mar_data1">产品:';echo Html::input('checkbox', 
		                        'ex_params['.$params[$i]['page'][0].']', 
		                        $params[$i]['value'], 
		                        'onclick=changeprd("mar_prd_idtr","ex_params_marquee_data1_") '.$check1);echo '</span>';
							echo '<span id="mar_data2" style="display:'.$pic_none.'">文章:';echo Html::input('checkbox', 
		                        'ex_params['.$params[$i]['page'][1].']', 
		                        $params[$i]['value'], 
		                        'onclick=changeprd("mar_article_idtr","ex_params_marquee_data2_") '.$check2);echo '</span>';
							/*echo '<span id="mar_data3">自定义:';echo Html::input('checkbox', 
		                        'ex_params['.$params[$i]['page'][2].']', 
		                        $params[$i]['value'], 
		                       'onclick=changeprd("prd_info","ex_params_marquee_data3_") '.$check3);echo '</span>';
                	    	break; */
                	}
                    break;
                case 'textarea':
                    echo Html::textarea('ex_params['.$params[$i]['id'].']', 
                        $arr_params[$params[$i]['id']], 
                        $params[$i]['extra']);
                    break;
                case 'select':
                	switch ($params[$i]['fill_type']) {
                	    case 'objfunc':
                	    	$obj_name = $params[$i]['obj_name'];
                	    	$obj = new $obj_name();
                	    	$func = $params[$i]['func_name'];
                	    	$hash_entry =& $obj->$func();
                	    	echo Html::select('ex_params['.$params[$i]['id'].']', 
                	    		$hash_entry, $arr_params[$params[$i]['id']], 
                	    		$params[$i]['extra']);
                	    	break;
                	    // 28/4/2010 Add >>
                	    case 'multiple':
                	    	$key = str_replace('[]', '', $params[$i]['id']);
				        	$cids = $arr_params[$key];
				        	echo '<input type="hidden" name="cids" id="cids'.$params[$i]['cids'].'" value="'.$cids.'" />';
				        	
                	    	$obj_name = $params[$i]['obj_name'];
                	    	$obj = new $obj_name();
                	    	$func = $params[$i]['func_name'];
                	    	$hash_entry =& $obj->$func();
                	    	echo Html::select($params[$i]['id'], 
                	    		$hash_entry, '', $params[$i]['extra']);
                	        echo '&nbsp;&nbsp;<img id="answer" class="title" src="admin/template/images/answer1.gif" alt="help" title="'.__('Multi-select by Ctrl or Shift').'" />';
                	        break;
                	    // 28/4/2010 Add <<
                	    case 'array':
                	    	echo Html::select('ex_params['.$params[$i]['id'].']', 
                	    		$params[$i]['data'], $arr_params[$params[$i]['id']], 
                	    		$params[$i]['extra']);
                	    	break;
                	}
                	break;
                case 'imgpicker':
		            echo Html::input('text', 
		                'ex_params['.$params[$i]['id'].']', 
		                $arr_params[$params[$i]['id']], $params[$i]['extra']);
		            echo sprintf('&nbsp;<a href="#" onclick="popup_win=show_imgpicker(\'%s\');return false;" title="">%s</a>', 
		            	'ex_params['.$params[$i]['id'].']', __('Pick Image'));
                	break;
                // sitestarv1.3 09/09/2010 start
                case 'slide_imgpicker':
                	 echo Html::input('text', 
		                'ex_params['.$params[$i]['id'].']', 
		                $arr_params[$params[$i]['id']], $params[$i]['extra']);
		            echo sprintf('&nbsp;<a href="#" onclick="popup_win=show_imgpicker(\'%s\');return false;" title="">%s</a>', 
		            	'ex_params['.$params[$i]['id'].']', __('Pick Image'));
		            echo '&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:void(0);" onclick="AddSlideTr();return false;">'.__('Add the flash slide items').'</a>';
                	break;
                case 'slide_input':
                	echo Html::input($params[$i]['type'], 
		                        'ex_params['.$params[$i]['id'].']', 
		                        $arr_params[$params[$i]['id']], $params[$i]['extra']);
		        	if ($params[$i]['id'] == 'slide_img_uri1') {
		            	echo '&nbsp;&nbsp;<img class="title" src="admin/template/images/answer1.gif" alt="help" title="'.__('Click the picture after the jump to the web site').'" />';
		            }
                	break;
                // sitestarv1.3 09/09/2010 end 
                case 'flvpicker':
		            echo Html::input('text', 
		                'ex_params['.$params[$i]['id'].']', 
		                $arr_params[$params[$i]['id']], $params[$i]['extra']);
		            echo sprintf('&nbsp;<a href="#" onclick="popup_win=show_flvpicker(\'%s\');return false;" title="">%s</a>', 
		            	'ex_params['.$params[$i]['id'].']', __('Pick Flash'));
                	break;
				case 'upload_img':
					$marquees = Marquee::getImg();
					echo "<a href='index.php?_m=mod_tool&_a=upload_img'>".__("Add Img")."</a>";
					echo '<br />';
					if(sizeof($marquees) > 0){
					foreach($marquees as $marquee){
						echo "<img src='".$marquee['img_name']."' width=100 height=100>";
						echo "<a href='index.php?_m=mod_tool&_a=img_delete&id=".$marquee['id']."'>".__("Delete")."</a>&nbsp;";
						echo "<a href='index.php?_m=mod_tool&_a=img_edit&id=".$marquee['id']."'>".__("Edit")."</a>";
					}
					}
					echo Html::input("hidden","ex_params[id_marquee]");
					break;
            }
        ?>
            </td>
        </tr>
        <?php
        	}
        	// for sitestarv1.3 slide_img_height/width end
        if ($params[$i]['id'] == 'bulletin_type') {
        ?>
        <tr>
            <td class="label"></td>
            <td class="entry" colspan="2" style="color:#F35D02">
			<?php _e("Notice: To edit bulletin,please login 'Admin - Contents - Bulletins'");?>
            </td>
        </tr>
        <?php
        }
        if ($params[$i]['id'] == 'cpy_intro_number') {
        ?>
        <tr>
            <td class="label"></td>
            <td class="entry" colspan="2" style="color:#F35D02">
			<?php _e("Notice: To edit about content,please login 'Admin - Settings - Web Settings - Company Introduction'");?>
            </td>
        </tr>
        <?php	
        }
        }
        ?>
        <?php
        // for sitestarv1.3 adding flash-slide item(s)
        foreach ($arr_params as $ky => $val) {
    		$math = array();
    		if (preg_match("/^slide\_img\_src(\d+)$/i", $ky, $math)) {
    			$k = $math[1];
    			if ((intval($k) > 1) && !empty($arr_params['slide_img_src'.$k])) {
    				echo '<tr id="slide_img_sctr'.$k.'"><td class="label">'.__('Select Image').'</td><td colspan="2" class="entry" style="border-top:1px dashed #F35D02">';
    				echo Html::input('text', 'ex_params[slide_img_src'.$k.']', $arr_params['slide_img_src'.$k])."&nbsp;";
    				echo '<a onclick="popup_win=show_imgpicker(\'ex_params[slide_img_src'.$k.']\');return false;" href="#">'.__('Select Image').'</a>';
    				echo '&nbsp;&nbsp;&nbsp;&nbsp;<a onclick="DelSlideTr('.$k.');return false;" href="javascript:void(0);">'.__('Delete the flash slide items').'</a></td></tr>';
					echo '<tr id="slide_img_ordetr'.$k.'"><td class="label">'.__('Display order').'</td><td colspan="2" class="entry">';
					echo Html::input('text', 'ex_params[slide_img_order'.$k.']', $arr_params['slide_img_order'.$k], 'size="4"')."</td></tr>";
    				echo '<tr id="slide_img_urtr'.$k.'"><td class="label">'.__('Image Url').'</td><td colspan="2" class="entry">';
    				echo Html::input('text', 'ex_params[slide_img_uri'.$k.']', $arr_params['slide_img_uri'.$k], 'size="28"');
    				echo '&nbsp;&nbsp;<img class="title" src="admin/template/images/answer1.gif" alt="help" title="'.__('Click the picture after the jump to the web site').'" /></td></tr>';
    				echo '<tr id="slide_img_destr'.$k.'"><td class="label">'.__('Description').'</td><td colspan="2" class="entry">';
    				echo Html::input('text', 'ex_params[slide_img_desc'.$k.']', $arr_params['slide_img_desc'.$k], 'size="28"')."</td></tr>";
    			}
    		} else continue;
    	}
    	// slide_img_height/width
    	if (isset($arr_params['slide_img_width'])) {
    		echo '<tr id="slide_img_widtr"><td class="label">'.__('Flash slide width').'</td><td colspan="2" class="entry">';
    		echo Html::input('text', 'ex_params[slide_img_width]', $arr_params['slide_img_width'], 'size="4"')."</td></tr>";
    	}
    	if (isset($arr_params['slide_img_height'])) {
    		echo '<tr id="slide_img_heigtr"><td class="label">'.__('Flash slide height').'</td><td colspan="2" class="entry">';
    		echo Html::input('text', 'ex_params[slide_img_height]', $arr_params['slide_img_height'], 'size="4"')."</td></tr>";
    	}
        ?>
    </tbody>
</table>
<?php
$mb_form->close();
$custom_js = <<<JS
_ajax_submit(thisForm, on_success, on_failure);
return false;

JS;
$mb_form->addCustValidationJs($custom_js);
$mb_form->writeValidateJs();
?>
