File:  [mozdev] / cdn / www / b2-include / b2edit.form.php
Revision 1.3: download - view: text, annotated - select for diffs - revision graph
Sun Mar 16 20:04:58 2003 UTC (16 years, 5 months ago) by cdn
Branches: MAIN
CVS tags: HEAD
trivialities

    1: <?php
    2: echo $tabletop;
    3: 
    4: switch($action) {
    5: 	case "post":
    6: 		$submitbutton_text = "Blog this !";
    7: 		$toprow_title = "New Post";
    8: 		$form_action = "post";
    9: 		$form_extra = "";
   10: 		if ($use_pingback) {
   11: 			$form_pingback = '<input type="checkbox" class="checkbox" name="post_pingback" value="1" checked="checked" tabindex="7" id="pingback" /><label for="pingback"> PingBack the URLs in this post</label><br />';
   12: 		} else {
   13: 			$form_pingback = '';
   14: 		}
   15: 		if ($use_trackback) {
   16: 			$form_trackback = '<br /><br /><label for="trackback"><b>TrackBack</b> a URI:</label><br /><input type="text" name="trackback_url" style="width: 415px" id="trackback" />';
   17: 		} else {
   18: 			$form_trackback = '';
   19: 		}
   20: 		if ($use_ljupdate) {
   21: 			$fljuchk = $lju_post ? 'checked="checked"' : '';
   22: 			$form_ljupdate = '<input type="checkbox" class="checkbox" name="post_ljupdate" value="1" '.$fljuchk.' tabindex="8" id="ljupdate" /><label for="ljupdate"> Update my LiveJournal</label><br />';
   23: 		} else {
   24: 			$form_ljupdate = '';
   25: 		}
   26: 		$colspan = 3;
   27: 		break;
   28: 	case "edit":
   29: 		$submitbutton_text ="Edit this !";
   30: 		$toprow_title = "Editing Post #".$postdata["ID"];
   31: 		$form_action = "editpost";
   32: 		$form_extra = "\" />\n<input type=\"hidden\" name=\"post_ID\" value=\"$post";
   33: 		$colspan = 2;
   34: 		$form_pingback = '<input type="hidden" name="post_pingback" value="0" />';
   35: 		$form_trackback = '';
   36: 		break;
   37: 	case "editcomment":
   38: 		$submitbutton_text ="Edit this !";
   39: 		$toprow_title = "Editing Comment #".$commentdata["comment_ID"];
   40: 		$form_action = "editedcomment";
   41: 		$form_extra = "\" />\n<input type=\"hidden\" name=\"comment_ID\" value=\"$comment\" />\n<input type=\"hidden\" name=\"comment_post_ID\" value=\"".$commentdata["comment_post_ID"];
   42: 		$colspan = 3;
   43: 		$form_pingback = '<input type="hidden" name="post_pingback" value="0" />';
   44: 		$form_trackback = '';
   45: 		break;
   46: }
   47: 
   48: ?>
   49: 
   50: <form name="post" action="b2edit.php" method="POST">
   51: <input type="hidden" name="user_ID" value="<?php echo $user_ID ?>" />
   52: <input type="hidden" name="action" value="<?php echo $form_action.$form_extra ?>" />
   53: 
   54: <table cellspacing="0" cellpadding="0" border="0" width="100%">
   55: <tr>
   56: 	<td<?php 
   57: 
   58: if ($action != "editcomment") {
   59: 
   60: // this is for everything but comment editing
   61: 	?>>
   62: 	<table height="60" align="left" cellpadding="0" cellspacing="0">
   63: 		<td height="60" width="190">
   64: 		<label for="title"><b>Title :</b></label><br />
   65: 		<input type="text" name="post_title" size="20" tabindex="1" style="width: 170px;" value="<?php echo $edited_post_title; ?>" id="title" />
   66: 		</td>
   67: 		<td>
   68: 		<label for="category"><b>Category :</b></label><br /><?php dropdown_categories(); ?>
   69: 		</td>
   70: 	</table>
   71: 	<?php
   72: 
   73: } else {
   74: 	
   75: // this is for comment editing
   76: 	?> colspan="2">&nbsp;</td>
   77: </tr>
   78: 
   79: <tr>
   80: 	<td>
   81: 	<label for="name"><b>Name :</b></label><br />
   82: 	<input type="text" name="newcomment_author" size="20" value="<?php echo format_to_edit($commentdata["comment_author"]) ?>" tabindex="1" id="name" /></td>
   83: 	<td>
   84: 	<label for="email"><b>E-mail :</b></label><br />
   85: 	<input type="text" name="newcomment_author_email" size="20" value="<?php echo format_to_edit($commentdata["comment_author_email"]) ?>" tabindex="2" id="email" /></td>
   86: 	<td>
   87: 	<label for="URL"><b>URL :</b></label><br />
   88: 	<input type="text" name="newcomment_author_url" size="20" value="<?php echo format_to_edit($commentdata["comment_author_url"]) ?>" tabindex="3" id="URL" />
   89: 	<?php
   90: 	
   91: }
   92: 
   93: 	?>
   94: 	</td>
   95: </tr>
   96: <tr>
   97: <td colspan="<?php echo $colspan; ?>">
   98: <table cellspacing="0" cellpadding="0" border="0" width="100%">
   99: <td valign="bottom">
  100: <?php
  101: if ($action != 'editcomment') {
  102: 	echo '<label for="content"><b>Post :</b></label>';
  103: } else {
  104: 	echo '<br /><label for="content"><b>Comment :</b></label>';
  105: }
  106: ?>
  107: </td>
  108: <td valign="bottom" align="right">
  109: <?php if ($use_quicktags) include(PROJECT_PATH . '/' . $b2inc.'/b2quicktags.php'); ?>
  110: </td>
  111: </table>
  112: 
  113: <textarea rows="9" cols="40" style="width:100%" name="content" tabindex="4" wrap="virtual" id="content"><?php echo $content ?></textarea><br />
  114: 
  115: <input type="checkbox" class="checkbox" name="post_autobr" value="1" <?php
  116: if ($autobr)
  117: echo " checked" ?> tabindex="7" id="autobr" /><label for="autobr"> Auto-BR (converts line-breaks into &lt;br /> tags)</label><br />
  118: 
  119: <?php echo $form_pingback ?>
  120: <?php echo $form_ljupdate ?>
  121: 
  122: <?php if ($use_preview) { ?>
  123: <input type="button" value="preview" onclick="preview(this.form);" class="search" tabindex="8" />
  124: <?php } ?>
  125: 
  126: <input type="submit" name="submit" value="<?php echo $submitbutton_text ?>" class="search" style="font-weight: bold;" tabindex="5" /> 
  127: 
  128: <?php if ($use_spellchecker) { ?>
  129: <!--<input type = "button" value = "Spell Check" onclick="var f=document.forms[0]; doSpell( 'en', f.post_content, '<?php echo $spellchecker_url ?>/sproxy.cgi', true);" class="search" tabindex="5" />-->
  130: <input type="button" value="Spellcheck" onclick="DoSpell('post','content','');" class="search" tabindex="9"/>
  131: <?php } ?>
  132: 
  133: <?php if ( ($use_fileupload) && ($user_level >= $fileupload_minlevel) && ((ereg(" ".$user_login." ", $fileupload_allowedusers)) || (trim($fileupload_allowedusers)=="")) ) { ?>
  134: <input type="button" value="upload a file/image" onclick="launchupload();" class="search"  tabindex="10" />
  135: <?php }
  136: 
  137: echo $form_trackback;
  138: 
  139: // if the level is 5+, allow user to edit the timestamp - not on 'new post' screen though
  140: #if (($user_level > 4) && ($action != "post"))
  141: if ($user_level > 4) {
  142: 	touch_time(($action=="edit"));
  143: }
  144: ?>
  145: <script language="JavaScript">
  146: <!--
  147: //	document.blog.post_content.focus();
  148: //-->
  149: </script>
  150: </td>
  151: </tr>
  152: </table>
  153: <?php echo $tablebottom ?>
  154: </form>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>