[ Index ]

PHP Cross Reference of Moodle 1.9.3 [Build 15-Oct-2008]

title

Body

[close]

/lib/editor/htmlarea/popups/ -> insert_table.php (source)

   1  <?php // $Id: insert_table.php,v 1.4 2007/01/27 23:23:44 skodak Exp $
   2      require("../../../../config.php");
   3  
   4      $id = optional_param('id', SITEID, PARAM_INT);
   5  
   6      require_course_login($id);
   7      @header('Content-Type: text/html; charset=utf-8');
   8  ?>
   9  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  10      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  11  <html>
  12  <head>
  13  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  14    <title><?php print_string("inserttable","editor");?></title>
  15  <script type="text/javascript" src="popup.js"></script>
  16  <script type="text/javascript">
  17  //<![CDATA[
  18  
  19  function Init() {
  20    __dlg_init();
  21    document.getElementById('f_rows').focus();
  22  };
  23  
  24  function onOK() {
  25    var required = {
  26      "f_rows": "You must enter a number of rows",
  27      "f_cols": "You must enter a number of columns"
  28    };
  29    for (var i in required) {
  30      var el = document.getElementById(i);
  31      if (!el.value) {
  32        alert(required[i]);
  33        el.focus();
  34        return false;
  35      }
  36    }
  37    var fields = ["f_rows", "f_cols", "f_width", "f_unit",
  38                  "f_align", "f_border", "f_spacing", "f_padding"];
  39    var param = new Object();
  40    for (var i in fields) {
  41      var id = fields[i];
  42      var el = document.getElementById(id);
  43      param[id] = el.value;
  44    }
  45    __dlg_close(param);
  46    return false;
  47  };
  48  
  49  function onCancel() {
  50    __dlg_close(null);
  51    return false;
  52  };
  53  //[[>
  54  </script>
  55  
  56  <style type="text/css">
  57  html, body {
  58    background: ButtonFace;
  59    color: ButtonText;
  60    font: 11px Tahoma,Verdana,sans-serif;
  61    margin: 0px;
  62    padding: 0px;
  63  }
  64  body { padding: 5px; }
  65  table {
  66    font: 11px Tahoma,Verdana,sans-serif;
  67  }
  68  form p {
  69    margin-top: 5px;
  70    margin-bottom: 5px;
  71  }
  72  .fl { width: 9em; float: left; padding: 2px 5px; text-align: right; }
  73  .fr { width: 7em; float: left; padding: 2px 5px; text-align: right; }
  74  fieldset { padding: 0px 10px 5px 5px; }
  75  select, input, button { font: 11px Tahoma,Verdana,sans-serif; }
  76  button { width: 70px; }
  77  .space { padding: 2px; }
  78  
  79  .title { background: #ddf; color: #000; font-weight: bold; font-size: 120%; padding: 3px 10px; margin-bottom: 10px;
  80  border-bottom: 1px solid black; letter-spacing: 2px;
  81  }
  82  form { padding: 0px; margin: 0px; }
  83  </style>
  84  </head>
  85  <body onload="Init()">
  86  
  87  <div class="title"><?php print_string("inserttable","editor") ?></div>
  88  
  89  <form action="" method="get">
  90  <table border="0" style="padding: 0px; margin: 0px">
  91    <tbody>
  92  
  93    <tr>
  94      <td style="width: 4em; text-align: right"><?php print_string("rows","editor") ?>:</td>
  95      <td><input type="text" name="f_rows" id="f_rows" size="5" title="Number of rows" value="2" /></td>
  96      <td></td>
  97      <td></td>
  98      <td></td>
  99    </tr>
 100    <tr>
 101      <td style="width: 4em; text-align: right"><?php print_string("cols","editor") ?>:</td>
 102      <td><input type="text" name="f_cols" id="f_cols" size="5" title="Number of columns" value="4" /></td>
 103      <td style="width: 4em; text-align: right"><?php print_string("width","editor") ?>:</td>
 104      <td><input type="text" name="f_width" id="f_width" size="5" title="Width of the table" value="100" /></td>
 105      <td><select size="1" name="f_unit" id="f_unit" title="Width unit">
 106        <option value="%" selected="selected"  ><?php print_string("percent","editor") ?></option>
 107        <option value="px"              ><?php print_string("pixels","editor") ?></option>
 108        <option value="em"              >Em</option>
 109      </select></td>
 110    </tr>
 111  
 112    </tbody>
 113  </table>
 114  
 115  <p />
 116  
 117  <fieldset style="float: left; margin-left: 5px;">
 118  <legend><?php print_string("layout","editor") ?></legend>
 119  
 120  <div class="space"></div>
 121  
 122  <div class="fl"><?php print_string("alignment","editor") ?>:</div>
 123  <select size="1" name="f_align" id="f_align"
 124    title="Positioning of this image">
 125    <option value="" selected="selected"                ><?php print_string("notset","editor") ?></option>
 126    <option value="left"                         ><?php print_string("left","editor") ?></option>
 127    <option value="right"                        ><?php print_string("right","editor") ?></option>
 128    <option value="texttop"                      ><?php print_string("texttop","editor") ?></option>
 129    <option value="middle"                    ><?php print_string("middle","editor") ?></option>
 130    <option value="baseline"                     ><?php print_string("baseline","editor") ?></option>
 131    <option value="absbottom"                    ><?php print_string("absbottom","editor") ?></option>
 132    <option value="bottom"                       ><?php print_string("bottom","editor") ?></option>
 133    <option value="middle"                       ><?php print_string("middle","editor") ?></option>
 134    <option value="top"                          ><?php print_string("top","editor") ?></option>
 135  </select>
 136  
 137  <p />
 138  
 139  <div class="fl"><?php print_string("borderthickness","editor") ?>:</div>
 140  <input type="text" name="f_border" id="f_border" size="5" value="1"
 141  title="Leave empty for no border" />
 142  <!--
 143  <p />
 144  
 145  <div class="fl">Collapse borders:</div>
 146  <input type="checkbox" name="collapse" id="f_collapse" />
 147  -->
 148  <div class="space"></div>
 149  
 150  </fieldset>
 151  
 152  <fieldset style="float:right; margin-right: 5px;">
 153  <legend><?php print_string("spacing","editor") ?></legend>
 154  
 155  <div class="space"></div>
 156  
 157  <div class="fr"><?php print_string("cellspacing","editor") ?>:</div>
 158  <input type="text" name="f_spacing" id="f_spacing" size="5" value="1"
 159  title="Space between adjacent cells" />
 160  
 161  <p />
 162  
 163  <div class="fr"><?php print_string("cellpadding","editor") ?>:</div>
 164  <input type="text" name="f_padding" id="f_padding" size="5" value="1"
 165  title="Space between content and border in cell" />
 166  
 167  <div class="space"></div>
 168  
 169  </fieldset>
 170  
 171  <div style="margin-top: 85px; text-align: right;">
 172  <hr />
 173  <button type="button" name="ok" onclick="return onOK();"><?php print_string("ok","editor") ?></button>
 174  <button type="button" name="cancel" onclick="return onCancel();"><?php print_string("cancel","editor") ?></button>
 175  </div>
 176  </form>
 177  </body>
 178  </html>


Generated: Wed Jan 14 11:33:29 2009 Cross-referenced by PHPXref 0.7