<? global $vis_language; ?>
   <form id="vis_staff_signature_form" name="vis_staff_signature_form" class="form-horizontal" method="post">
      <input type="hidden" name="vis_staff_id" id="vis_staff_id" value="<? echo $operation['vis_staff_id']; ?>" />
      <div class="form-group">
         <label class="col-sm-2 control-label"><? echo $vis_language['TXTDOMAIN']; ?></label>
         <div class="col-sm-2">	
            <div class="checkbox m-n i-checks pull-left "><label><input type="checkbox" name="vis_sign_all_domain" id="vis_sign_all_domain" onchange="toggle_domain_list();" value="1" /><i></i></label></div><label class="control-label m-l-xs" style="cursor:pointer"><? echo $vis_language['TXTALLDOMAIN']; ?></label>
         </div>
         <div class="col-sm-8" id="vis_domain_list">	
            <select name="vis_domain" id="vis_domain" class="selectpicker" <? if(count($domain)>10) echo 'data-live-search="true"';?>  onchange="vis_changeforum_signature(this)">
            <?	 for($i=0;$i<count($domain);$i++){
				 echo '<option value="'.$domain[$i]['domain_id'].'">'.$domain[$i]['domain_name'].'</option>';  }?>				
            </select>
         </div>
      </div>
      <div class="form-group">
         <label class="col-sm-2 control-label"></label>
         <div class="col-sm-10">
              <textarea name="vis_forum_signature_content" id="vis_forum_signature_content" ><? echo $forum_signature; ?></textarea>
         </div>
      </div>
      <div class="line b-b line-lg pull-in"></div>
      <br/>
      <div class="form-group">
         <div class="col-sm-4 col-sm-offset-2">
            <button onclick="$('#vis_workpanel_div').visExecution('submit_form',{'vis_module':'home', 'vis_operation':'update_forum_signature', 'vis_form':'vis_staff_signature_form','vis_staff_signature_content':$('.redactor-editor').html(), 'vis_staff_id':<? echo $operation['vis_staff_id']; ?>})" class="btn btn-primary" type="button"><? echo $vis_language['TXTUPDATE']; ?></button>
         </div>
      </div>
   </form>
<script>
   var id= $('#vis_staff_id').val();
   $(".selectpicker").selectpicker();
   <? if (!defined('VIS_HTML_EDITOR') || VIS_HTML_EDITOR == 1) { ?>
	   $(function(){
			$('#vis_forum_signature_content').redactor({
				buttonSource: true,			
				minHeight: 180, // pixels
				maxHeight: 180,
				imageUpload: "index.php?vis_tmpst="+new Date().getTime()+"&vis_module=ticket&vis_operation=upload_file&vis_static_area=editor_image_upload",           
				imageUploadParam: 'files',
                deniedTags: ['html', 'head', 'link', 'body', 'meta', 'script','applet'],
                plugins: ['source']
			});
		});  
		$("#vis_forum_signature_content").val("<? echo addslashes(trim($forum_signature));?>");
	<? } ?>
	function vis_changeforum_signature(e){
			$.ajax({
                url: 'index.php',
   			    data: {'vis_module':"home", 'vis_operation':"load_forum_signature" ,'vis_domain':e.value,'vis_staff_id':id},
   			    type: "POST",
                success: function(data) {
			           <? if (!defined('VIS_HTML_EDITOR') || VIS_HTML_EDITOR == 1) { ?>
							if(e.value==0) $(".redactor-editor").hide();
							else $('#vis_forum_signature_content').redactor('code.set', data);
					   <?php }
						else {?>
						$("#vis_forum_signature_content").val(data);
						<?php } ?>
   		        }
			});
      }
	function toggle_domain_list()
	{
	  	 if($('#vis_sign_all_domain').is(":checked")) $('#vis_domain_list').hide();
     	  else $('#vis_domain_list').show();
	}
</script>
<script src="<?= VIS_PATH_SCRIPT; ?>file-input/bootstrap-filestyle.min.js"></script>
