Wiki Root Page Groupless Version
[show modes: view edit]
[begin mode table]
[
$q = query({include_[$_id]}, "", "title", "parent", $_id);
$c = query_count($q);
if($c != "0") {
<tr><th><a href="/?id=[$_id]">[$_title]</a>
<td>[getv("synopsis")]
};]
[end mode table]
[begin mode floatpic]
[$e = getv("picture");
if($e != "") {
<p style="text-align: right">
<a href="/?id=[$_id]"><img src="[info_display($e)]" title="[$_title]" style="max-height: 60px;"></a>
</p>
}]
[end mode floatpic]
[begin mode abbr]
[
iif(can_read(), {
    <li><a href="/?id=[$_id]">[$_title]</a></li>
    });
]
[end mode abbr]
[begin mode view]

[$e = getv("picture");
if($e != "") {<img src="[info_display($e)]" style="max-width: 50%; float: right; margin-left: 10px; margin-bottom: 10px;">};]

[_wiki_format(getv("description"), "1");]

[$d = index("abbr", $_id);]

[if($d != "") {
<h2>Documents</h2>
<ul>
[$d]
</ul>
};]
[if(can_comment()) {
<p><b>Create New</b>: <a href="/?id=[$_id]&mode=add"> Document</a> · <a href="/?id=[$_id]&mode=add_dict">Dictionary</a></p>
};]

[if(can_direct()) {
	[msg_start({clear: both; text-align: center;})]
	<!-- <a href="/edit_group.star?id=[$_group]">Edit Users and Permissions</a> &middot; --> <a href="/?id=[$_id]&mode=edit">Edit This Page</a>
	[msg_end()]
};
]
<div style="clear: both;"></div>
[end mode view]
[begin mode edit]
<form action="/" method="post">
	<input type="hidden" name="id" value="[$_id]">
	<input type="hidden" name="mode" value="submit">
	Name:
	<input type="text" name="title" value="[edit_display($_title)]" style="width: 100%">
	Subtitle:	
	<input type="text" name="subtitle" value="[edit_display($_subtitle)]" style="width: 100%">
	Synopsis:	
	<input type="text" name="synopsis" value="[edit_display(getv("synopsis"))]" style="width: 100%">
	Picture URL:
	<input type="text" name="picture" value="[edit_display(getv("picture"))]" style="width: 100%;">
	Description:
	<textarea name="description" rows="10" style="width: 100%;">[edit_display(getv("description"));]</textarea>
<br>
<span style="font-size: 80%">You can use some formatting here. See <a href="/?Formatting and Markup" target="_new">this page</a> for more details.</span>
<br>

	<input type="submit" value="Submit">
</form>
[end mode edit]
[begin mode submit]
[
	$_title = $_params.title;
//	set_group_name($_group, $_params.title);
	$_subtitle = $_params.subtitle;
	putv("picture", $_params.picture);
	putv("description", $_params.description);
	putv("synopsis", $_params.synopsis);
]
<h2>Update Complete</h2>
<p><a href="/?id=[$_id]">Click here to return to the project's root page</a>.</p>
[end mode submit]
[begin mode add]
<form method="post" action="/">
	<input type="hidden" name="id" value="[$_id]">
	<input type="hidden" name="mode" value="add_submit">
	<b>Document Title</b>: <input type="text" name="title">
	<input type="submit" value="Submit">
</form>
[end mode add]
[begin mode add_submit]
[
$e = new_page($_params.title, $_id);
if($e > 0) {
    [
    set_template($e, title2id("Wiki Page"));
    set_group($e, $_group);
    set_permissions($e, "cadrecadrec-dr----r-");
    set_body($e, {<!>pr=1<!>ge=1<!>gd=1<!>body=});
    page("edit", $e);
    ]
} else {
    [msg_start();]
    Disaster. It failed! Maybe you should check the error log.
    [msg_end();]
};
]
[end mode add_submit]
[begin mode add_dict]
<form method="post" action="/">
	<input type="hidden" name="id" value="[$_id]">
	<input type="hidden" name="mode" value="add_dict_submit">
	<b>Dictionary Title</b>: <input type="text" name="title">
	<input type="submit" value="Submit">
</form>
[end mode add_dict]
[begin mode add_dict_submit]
[
$e = new_page($_params.title, $_id);
if($e > 0) {
    [
    set_template($e, title2id("Dictionary"));
    set_group($e, $_group);
    set_permissions($e, "cadrecadrec-dr----r-");
    page("edit", $e);
    ]
} else {
    [msg_start();]
    Disaster. It failed! Maybe you should check the error log.
    [msg_end();]
};
]
[end mode add_dict_submit]