%%document-index-anonymous-html%%
2002-07-21 14:10

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

// convert generic flavor to objtype:
if ($this->flavor=="Generic") $this->flavor= "Document";

// headline fix if only title
if ($this->title=="" && $this->headline=="") $this->title= "Untitled ($this->name)";
elseif ($this->title=="") $this->title= $this->headline;

// icon fix for this layout...
if ($this->imageid==0) $this->iconTag= "<div style='margin-top: 10px;'>$this->iconTag</div>";

// more tag if body exists
if ($this->body!="") $this->moreTag="<a href='$this->baseUrl'>full document</a> &raquo; |";

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

// show folder link?
if ($folder->id != $this->folderid) $this->folderTag= bparsebml(", in [folder:$this->folderid]");
	
// show archive link?
if ($folder->rank<=500) {
	$this->archiveTag="
		<table class='objTable' cellspacing=5 cellpadding=5>
			<tr>
				<td align='center'>
					<a href='$folder->baseUrl$this->objtype-.html?method=listall'>$folder->title $this->objtype archive</a>
				</td>
			</tr>
		</table>";
	}
	
// how many comments?
$query= "SELECT COUNT(obj.id) FROM comment AS obj WHERE obj.parentobjtype='$this->objtype' AND obj.parentid='$this->id' $session->statuswhere $session->publicwhere";
if ($result=@mysql_query($query)) {
	$commentTotal= mysql_fetch_row($result);
	$this->commentTotal= $commentTotal[0]." ";
	if ($this->commentTotal==0) $this->commentTotal="";
	}

// EDITING
// edit tag for document owner
if ($this->owner && ( $this->canSave['document'] || $this->canSave['all'] )) {
	if ($this->rank > $sitemember->rank) $this->editTag= "";
	else $this->editTag= "|
			<img src='/bicons/bulbsgif/$this->glow.gif' alt='$this->publishStatus' title='document:$this->id is $this->publishStatus' align=absmiddle border=0> |
			<a href='$this->baseUrl?method=edit'><img src='/bicons/edit.gif' alt='edit' title='edit this object' align=absmiddle border=0 /></a> |
			<a href='$this->baseUrl?method=pickup'><img src='/bicons/pickup.gif' alt='pick up' title='pick up this object' align=absmiddle border=0 /></a>
			";
	}

// editor controls for editors
if ($this->editor) {
	$this->editTag= "|
			<a href='$this->baseUrl?method=toggleRank'><img src='/bicons/bulbsgif/$this->glow.gif' alt='$this->publishStatus' title='document:$this->id is $this->publishStatus' align=absmiddle border=0></a> |
			<a href='$this->baseUrl?method=edit'><img src='/bicons/edit.gif' alt='edit' title='edit this object' align=absmiddle border=0 /></a> |
			<a href='$this->baseUrl?method=pickup'><img src='/bicons/pickup.gif' alt='pick up' title='pick up this object' align=absmiddle border=0 /></a> |
			<img src='/bicons/event.gif' alt='updated $this->updated' title='created $this->created - updated $this->updated' align=absmiddle border=0 />&nbsp;
			";
	}
 
%%header%%



%%css%%



%%template%%
<table class='objTable' cellspacing=5 cellpadding=5>
	<tr class='$this->rowclass'>
		<td>
			<table class='objHeader'>
				<tr>
					<td width='1' valign='top'>$this->iconTag</td>
					<td>
						<span class='objFlavor'>$this->flavor:<br></span>
						<span class='objTitle'><a href="$this->baseUrl">$this->title</a>
						<span class='objByline'> <br> 
							By $this->authorTag on $this->dateTag$this->folderTag.</span>
					</td>
				</tr>
			</table>
			<blockquote class='objDescription'>$this->description</blockquote>
			<p align="right" class='info'>$this->moreTag 
				<a href='$this->baseUrl#comments'><img src='/bicons/comment.gif' alt='' title='view/add comments' align=absmiddle border=0></a>
				<a href='$this->baseUrl#comments'>$this->commentTotal<!-- -->comments</a>
				$this->editTag
			</p>
		</td>
	</tr>
</table>



%%listrow%%
 



%%nullobject%%
 



%%footer%%
$this->archiveTag


%%postprocess%%



%%end of context%%
