%%comment-list-anonymous-html%%
2002-07-18 17:31

%%preprocess%%
// format the object for display
$this->beryliumToHtml(); 
$this->getRuntimeVars();

// If untitled, just title it Comment
if ($this->title=="") $this->title= "Comment";


// set up delete/undelete icon
if ($this->status=="deleted") $this->deleteTag= "<img src='/bicons/undelete.gif' alt='un-delete' title='set status to hidden' align=absmiddle border=0> un-delete";
else $this->deleteTag= "<img src='/bicons/delete.gif' alt='delete' title='set status to deleted' align=absmiddle border=0> delete";

// alternating rows
$session=$GLOBALS[session];
if ($session->row=="" || $session->row==1) {
	$this->rowclass="oddrow";
	$GLOBALS[session]->row=2;
	}
else {
	$this->rowclass="evenrow";
	$GLOBALS[session]->row=1;
	}

// form
if ($this->insert && $sitemember->role!="anonymous") {
	$this->commentForm= "
		<hr><a name='commentform'>
	      <form method='post' name='commentCreate' action='$folder->baseUrl/comment-.html?method=save$session->cgi' class=commentForm>
			<input type=hidden name='parentobjtype' value='$object->objtype'>
			<input type=hidden name='parentid' value='$object->id'>
	                <input type=hidden name='author' value=''>
			<input type=hidden name='rank' value='100'>
			<input type=hidden name='status' value='posted'>
			<input type=hidden name='public' value='1'>
			<table border='0' align='center'>
				<tr> 
					<td colspan='2' class=commentTitle><img src='/bicons/comment.gif' align=absmiddle>&nbsp;Add your comments to this $object->flavor:</td>
				</tr>
				<tr> 
					<td align='right' valign='top'>Subject:</td>
					<td valign='top'><input type='text' name='title' size='42' maxlength='255'></td>
				</tr>
				<tr>
					<td align='right' valign='top'>Comment:</td>
					<td><textarea name='body' cols='46' wrap='VIRTUAL' rows='8'></textarea>
						<br>&nbsp;&nbsp;<a name='sc1' onclick=\"spellcheck('commentCreate','body');\">click here to spellcheck</a> | HTML not allowed, <a href='http://berylium.org/berylium/docs/document-quickbml.html' target='_blank'>use BML instead</a></td>
				</tr>
				<tr> 
					<td>&nbsp;</td>
					<td><input type='submit' name='submit' value='post' class='buttonstyle'></td>
				</tr>
			</table>
	      </form>";
	}
elseif ($this->insert) {
	$this->commentForm= "
		<hr><a name='commentform'>
	      <form method='post' name='commentCreate' action='$folder->baseUrl/comment-.html?method=save$session->cgi' class=commentForm>
			<input type=hidden name='parentobjtype' value='$object->objtype'>
			<input type=hidden name='parentid' value='$object->id'>
			<input type=hidden name='rank' value='100'>
			<input type=hidden name='status' value='posted'>
			<input type=hidden name='public' value='1'>
			<table border='0' align='center'>
				<tr> 
					<td colspan='2' class=commentTitle><img src='/bicons/comment.gif' align=absmiddle>&nbsp;Add your comments to this $object->flavor:</td>
				</tr>
				<tr> 
					<td align='right' valign='top'>Your name:</td>
					<td valign='top'>
						<img src='/bicons/spacer.gif' height=1 width=1><input type='radio' class='radiostyle' name='authType' value='anonymous' checked>
						Pseudonym: <input type='text' name='author' size='32' maxlength='255' align='absmiddle'><br>
						<img src='/bicons/spacer.gif' height=20 width=1><input type='radio' class='radiostyle' name='authType' value='login'>
						Use my nickname (you must already be a member; <a href='$object->baseUrl?method=createmember'>register here</a>)
					</td>
				</tr>
				<tr> 
					<td align='right' valign='top'>Subject:</td>
					<td valign='top'><input type='text' name='title' size='42' maxlength='255'></td>
				</tr>
				<tr>
					<td align='right' valign='top'>Comment:</td>
					<td><textarea name='body' cols='46' wrap='VIRTUAL' rows='8'></textarea>
						<br>&nbsp;&nbsp;<a name='sc1' onclick=\"spellcheck('commentCreate','body');\">click here to spellcheck</a> | HTML not allowed, <a href='http://berylium.org/berylium/docs/document-quickbml.html' target='_blank'>use BML instead</a></td>
				</tr>
				<tr> 
					<td>&nbsp;</td>
					<td><input type='submit' name='submit' value='post' class='buttonstyle'></td>
				</tr>
			</table>
	      </form>";
	}

if ( $this->update ) {
	berror("comment-list-anonymous-html: comment is updateable by this sitemember, showing controls...",1);
	$this->controlsTag= "
		<p align='right' class='commentControls'> 
			<a href='$this->idUrl?method=edit$session->cgi'><img src='/bicons/edit.gif' alt='edit' title='edit this object' align=absmiddle border=0></a> 
			<a href='$this->idUrl?method=edit$session->cgi'>edit</a> |
			<a href='$this->idUrl?method=delete$session->cgi'>$this->deleteTag</a>
			&nbsp;
		</p>";
	}
else berror("comment-list-anonymous-html: comment not updateable by this sitemember ($this->policyReport).",1);

%%header%%
<table width='96%'>
	<tr>

%%css%%
.comments { border: 1px; padding: 3px; border-style: none; border-color: #0099cc; }
.comments HR { height: 1px; background-color: #ff9900; border-style: none; }
.commentForm TD { padding: 5px; }
.commentTitle { color: #006699; font-weight: bold; }
.commentByline { color: #006699; }
.commentBody { color: #333344; font-size: 12px; line-height: 18px; }
.commentControls {font-size: 12px; line-height: 14px; font-weight: normal; }

%%template%%
		<td class='comments'><hr><span class=commentTitle><a name="comment:$this->id"></a>$this->iconTag&nbsp;$this->title</span><span class=commentByline> by $this->authorTag on $this->created.</span>
		<span class=commentBody><blockquote>$this->body</blockquote></span>
			$this->controlsTag
		</td>

%%listrow%%
	</tr>
	<tr>

%%nullobject%%

%%footer%%
	</tr>
	<tr>
		<td class='comments'>
			$this->commentForm
		</td>
	</tr>
</table>

%%postprocess%%

%%end of context%%
