view m-toolbox/html_help/help/create_class_desc/create_link_box.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
line wrap: on
line source

function create_link_box(fid, indentation_in, box, box_category)

  %%% box_category = 'categorylist' or 'subcategorylist'

  indentation(1:indentation_in) = ' ';

  %%% Table predefinitions %%%
  fprintf(fid, '%s<!-- ===== link box: Begin ===== -->\n', indentation);
  fprintf(fid, '%s<p>\n', indentation);
  fprintf(fid, '%s  <table border="1"  width="80%%">\n', indentation);
  fprintf(fid, '%s    <tr>\n', indentation);
  fprintf(fid, '%s      <td>\n', indentation);
  fprintf(fid, '%s        <table border="0" cellpadding="5" class="%s" width="100%%">\n', indentation, box_category);
  fprintf(fid, '%s          <colgroup>\n', indentation);
  fprintf(fid, '%s            <col width="37%%"/>\n', indentation);
  fprintf(fid, '%s            <col width="63%%"/>\n', indentation);
  fprintf(fid, '%s          </colgroup>\n', indentation);
  fprintf(fid, '%s          <tbody>\n', indentation);

  for ii = 1:size(box,1)

    link_name = box{ii,1};
    link      = box{ii,2};
    link_desc = box{ii,3};

    %%% Table body %%%
    fprintf(fid, '%s            <tr valign="top">\n', indentation);
    fprintf(fid, '%s              <td>\n', indentation);
    fprintf(fid, '%s                <a href="%s">%s</a>\n', indentation, link, link_name);
    fprintf(fid, '%s              </td>\n', indentation);
    fprintf(fid, '%s              <td>%s</td>\n', indentation, link_desc);
    fprintf(fid, '%s            </tr>\n', indentation);

  end

  %%% Table end %%%
  fprintf(fid, '%s          </tbody>\n', indentation);
  fprintf(fid, '%s        </table>\n', indentation);
  fprintf(fid, '%s      </td>\n', indentation);
  fprintf(fid, '%s    </tr>\n', indentation);
  fprintf(fid, '%s  </table>\n', indentation);
  fprintf(fid, '%s</p>\n', indentation);
  fprintf(fid, '%s<!-- ===== link box: End ====== -->\n\n', indentation);

end