No BSD License  

Highlights from
htmltool

htmltool

by

 

The HTML Toolbox (HT) stores various crosslink information about Matlab programs using HTML.

sig_wrt1(fid,Name,par,email)
function [] = sig_wrt1(fid,Name,par,email)
% [] = sig_wrt1(fid,Name,par,email)
% One of several possible programs that generate the HTML
% code for the signature.
% 
% INPUT PARAMETERS
%
% fid      = pointer to current file
% Name     = string with user name
% par      = parameter vector:
%  par(1)  = 0-> do not include the date, 1-> include
%  par(2)  = 0-> do not include the time, 1-> include
%  par(3)  = 0-> do not include the copyright GIF, 1-> include
%            The path to this gif-file can be changed in the m-code 
%            in this program
% email    = string containing the e-mail address. Optional
%
% Copyright (c) 1996 B.K. Alsberg
%


T=clock;
% T= [year month day hour minute seconds]
year = int2str(T(1));
month = int2str(T(2));
day = int2str(T(3));
hour = int2str(T(4));
minute = int2str(T(5));
seconds = int2str(T(6));

%%%% Init of color,font,size for first and second part of signature %%%
[color_str1,color_email_str,font,fontsize,html_TB_home,cp] = iniread2;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


if par(1) == 1
 date = [day,'/',month,' ',year];
else
 date = [];
end;

if par(2) == 1,
 time = [hour,':',minute];
else
 time =[];
end;



if par(3) == 1,
 image_str = ['<IMG SRC = "',html_TB_home,cp,'" >'];
else
 image_str =[];
end;


if length(email) >0,
 email_str = ['E-mail:</B><A HREF = "mailto:',email,'">',email,'</A></H4>'];
else
 email_str =  [];
end;

message ='Written by ';
str1 = [message,' ',Name,' ',time,' ',date,' ',image_str];

%here we transform from [0,1] space into [0,255] space
color_str12 = round(lintrans(color_str1,0,1,0,255));
color_email_str2 = round(lintrans(color_email_str,0,1,0,255));


 if font == 0
   front = '<B>';
   back  = '</B>';
 elseif font ==1,
   front = '<I>';
   back  = '</I>';
 else
   front = '';
   back  = '';
 end

if fontsize >0
 fnt = ['+',int2str(fontsize)];
else
 fnt = ['-',int2str(fontsize)];
end;

fz = '<FONT SIZE=';
p1 = '<P>';
p2 = '</P>';
fnt2 = '</FONT>';
h0 = '>';

%%%%%% Here we convert the color vector into proper HTML code %%%
  red = dec2hex(color_str12(1));
  if length(red) == 1, red = ['0',red]; end;
  green = dec2hex(color_str12(2));
  if length(green) == 1, green = ['0',green]; end;
  blue = dec2hex(color_str12(3));
  if length(blue) == 1, blue = ['0',blue]; end;
  htcd1 = ['#',red,green,blue];
  fntcol1 = ['<FONT COLOR="',htcd1,'">'];
  clear red green blue
 %%%%%%%%%%%%%%%%%%%%%%%%%%% Second line %%%%%%%%%%%%%%%%%%%

  red = dec2hex(color_email_str2(1));
  if length(red) == 1, red = ['0',red]; end;
  green = dec2hex(color_email_str2(2));
  if length(green) == 1, green = ['0',green]; end;
  blue = dec2hex(color_email_str2(3));
  if length(blue) == 1, blue = ['0',blue]; end;
  htcd2 = ['#',red,green,blue];
  fntcol2 = ['<FONT COLOR="',htcd2,'">'];

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

                                                                                                                   
 output1 = [p1,front,fntcol1,fz,fnt,h0,str1,fnt2,fnt2,back,p2];
 fprintf(fid,'%s \n',output1);

 output2 = [p1,front,fntcol2,fz,fnt,h0,email_str,fnt2,fnt2,back,p2];
 fprintf(fid,'%s \n',output2);

Contact us