Dictionary Category
[show modes: view edit]

[begin mode export][end mode export]

[begin mode title][end mode title]

[begin mode category_abbr]
<a href="/?id=[$_id]" title="[$_priority]">[$_title]</a> &nbsp; 
[end mode category_abbr]

[begin mode entry_abbr]
[end mode entry_abbr]

[begin mode abbr]
<i>Category</i>: <a href="/?id=[$_id]">[$_title]</a><br>
[end mode abbr]

[begin mode view]
[_wiki_format(getv("desc"))]
<p>The following dictionary entries are of the category <b>[$_title]</b>:</p>
[
	$q = {.[$_title].};
	$f = query_run("category_query", query("cp", 0, "title collate utf8_unicode_ci", "parent", $_parent, "body", {%[$_title]%}, "template", title2id("Dictionary Entry")));
	$f = foreach($f) {[
		if($_index > 0) {[
			$n = substr($_data, 0, strpos($_data, ":"));
			$b = strpos($_data, $q);
			$_data = iif($b != "-1", page("abbr", $n));
		]};
	]};
	$f;
]
[end mode view]

[begin mode category_query]
[end mode category_query]

[begin mode edit]
<form method="post" action="/">
	<input type="hidden" name="id" value="[$_id]">
	<input type="hidden" name="mode" value="submit">
<table>
<tr><td>Category Name:
	<td><input class="textbox" name="title" value="[edit_display($_title)]">
<tr><td>Dictionary ID (Parent):
	<td><input class="textbox" name="parent" value="[edit_display($_parent)]" type="number">
<tr><td>Template ID:
	<td><input class="textbox" name="template" value="[edit_display($_template)]" type="number">
<tr><td>Author ID:
	<td><input class="textbox" name="author" value="[edit_display($_author)]" type="number">
<tr><td>Permissions:
	<td><input class="textbox" name="permissions" value="[$_permissions]">
<tr><td>Priority:
	<td><input class="textbox" name="priority" value="[$_priority]" type="number">
<tr><td>Description:<br><small>(<a href="/?Formatting and Markup">markup</a>)</small>
	<td><textarea name="desc">[edit_display(getv("desc"))]</textarea>
<tr><td>
	<td><span class="buttonbox"><input type="submit" name="Submit"></span>
</table>
</form>
[end mode edit]

[begin mode submit]
[
	$_title = $_params.title;
	$_parent = $_params.parent;
	$_template = $_params.template;
	$_author = $_params.author;
	$_permissions = $_params.permissions;
	$_priority = $_params.priority;
	putv("desc", $_params.desc);
	msg_start();
	]
	It's done.<br><br>
	<a href="/?id=[$_parent]">Go back to parent entry</a>.<br><br>
	<a href="/?id=[$_parent]&mode=add_category">Go back to add
	another category to the parent entry</a>.
	[
	msg_end();
]
[end mode submit]