Logo Search packages:      
Sourcecode: bamboo version File versions  Download package

edit.php

<script language="JavaScript">
function submitform(formname,action,value) {
  f = document.forms[formname]; 
  f.elements[action].value = value;
  f.selectionstart.value = f.data.selectionStart;
  f.selectionend.value = f.data.selectionEnd;
  f.scrolltop.value = f.data.scrollTop;
  f.submit();
}
</script>

<form name=contentform action="<?=$action?>" method="POST">
  <input type=hidden name=action value="edit">
  <input type=hidden name=eaction value="placeholder">
  <input type=hidden name="selectionstart" value="0">
  <input type=hidden name="selectionend" value="0">
  <input type=hidden name="scrolltop" value="0">
  <input type=hidden name="lang" value="<?=$_SESSION['lang']?>">
  <table>
    <tr>
      <td colspan=2>
         <?= Lang::getlinks($page,"a=edit"); ?>
      </td>
    </tr>
    <tr>
      <td>
        <a class=button href="javascript:submitform('contentform','eaction','save')" style="text-decoration: none" accesskey='s'><u>S</u>ave</a>
        <a class=button href="javascript:submitform('contentform','eaction','preview')" style="text-decoration: none" accesskey='r'>P<u>r</u>eview</a>
        <a class=button href="javascript:submitform('contentform','eaction','publish')" style="text-decoration: none" accesskey='p'><u>P</u>ublish</a>
      </td>
      <td align=right>
        <a href="<?=$action?>?action=edit&eaction=guide" target="new">view text guide</a>
      </td>
    </tr>
    <tr><td colspan=2>
      <textarea id=data class=textinput name=data cols=90 rows=30 style="font-family: monospace;"><?= $e->text ?></textarea>
    </td></tr>
    <tr><td>
        <a class=button href="javascript:submitform('contentform','eaction','save')" style="text-decoration: none" accesskey='s'><u>S</u>ave</a>
        <a class=button href="javascript:submitform('contentform','eaction','preview')" style="text-decoration: none" accesskey='r'>P<u>r</u>eview</a>
        <a class=button href="javascript:submitform('contentform','eaction','publish')" style="text-decoration: none" accesskey='p'><u>P</u>ublish</a>
    </td>
    <td align=right>
<?php if ($draft) { ?>
       <a class=button href="javascript:submitform('contentform','eaction','cancel')" style="text-decoration: none" accesskey=''>Cancel Draft</a>
<?php } ?>
    </td></tr>
  </table>
</form>
<script language="JavaScript">
      <?php
          # this code will set the selection in the edit box based on either the request or the session.
            $start  = get('selectionstart', isset($_SESSION[$page->path.'#selectionstart']) ? $_SESSION[$page->path.'#selectionstart'] : '0');
            $end    = get('selectionend',   isset($_SESSION[$page->path.'#selectionend'])   ? $_SESSION[$page->path.'#selectionend']   : '0');
            $scroll = get('scrolltop',      isset($_SESSION[$page->path.'#scrolltop'])      ? $_SESSION[$page->path.'#scrolltop']      : '0');
      ?>
      document.forms['contentform'].data.focus();
      document.forms['contentform'].data.setSelectionRange(<?=$start?>, <?=$end?>);
      document.forms['contentform'].data.scrollTop = <?=$scroll?>;
</script>

<?php if ($draft) { ?>
You are editing an unpublished draft.
<?php } ?>

Generated by  Doxygen 1.6.0   Back to index