Add a new category
Log-in
|
Blog
:
Welcome to your wiki
>
Wiki blog
>
Add a new category
Top Menu
Show
:
Comments
Attachments
History
Information
Stampa
:
Stampa
Anteprima di stampa
Esporta come PDF
Esporta in formato RTF
Esporta come HTML
Esporta in formato XAR
Wiki source code of
Add a new category
Show line numbers
#set($space = "$!request.space") #if("$!request.name" != ’’) #if($space != "") #set($newCategoryDoc = $xwiki.getDocument("${space}.${request.name}")) #else #set($newCategoryDoc = $xwiki.getDocument("${request.name}")) #end #if($newCategoryDoc.isNew()) #set($newCategoryObj = $newCategoryDoc.newObject("Blog.CategoryClass")) $newCategoryObj.set("name", $request.name) $newCategoryObj.set("description", $request.description) $newCategoryDoc.setParent($request.parent) #set($content = "#includ") #set($content = "${content}eForm(’Blog.CategorySheet’)") $newCategoryDoc.setContent($content) $newCategoryDoc.save() #set($catLink = "[${newCategoryDoc.name}>${newCategoryDoc.fullName}]") #info($msg.get("xe.blog.category.created", [$catLink])) #else $response.setStatus(409) #set($catLink = "[${newCategoryDoc.name}>${newCategoryDoc.fullName}]") #warning($msg.get("xe.blog.category.exists", [$catLink])) #end #end <form action="" method="post"> <div> #if($space != "") <input type="hidden" name="space" value="$space"/> #end <dl> <dt><label for="name">$msg.get("xe.blog.categories.name")</label></dt> <dd><input type="text" name="name" id="name" style="width: 95%"/></dd> #if("$!parentCategory" == "") <dt><label for="parent">$msg.get("xe.blog.categories.parentcategory")</label></dt> #set($sql = ", BaseObject obj where ") #if($space != "") #set($sql = "${sql}doc.space = ’${space}’ and ") #end #set($sql = "${sql}obj.name = doc.fullName and obj.className = ’Blog.CategoryClass’ and doc.fullName <> ’Blog.CategoryTemplate’ order by doc.name") <dd><select name="parent" id="parent" style="width: 95%"> <option selected="selected" value="Blog.Categories">None</option> #foreach($category in $xwiki.searchDocuments($sql)) <option value="$category">$xwiki.getDocument($category).display(’name’, ’view’)</option> #end </select></dd> #else <dt><input type="hidden" name="parent" value="$parentCategory"/></dt> #end <dt><label for="description">$msg.get("xe.blog.categories.description")</label></dt> <dd><textarea name="description" id="description" rows="2" cols="20" style="width: 95%"></textarea></dd> </dl> <span class="buttonwrapper"><input type="submit" value="$msg.get("xe.blog.categories.add")" class="button"/></span> </div> </form>
Recent Blog Posts
The first post of your wiki's blog
Blog Categories
News
(1)
Other
(0)
Personal
(0)
Blog Archive
2009
(1)
Search
Quick Links
Wiki Dashboard
Document Index
Blog
Sandbox
My Recent Modifications
dany
|
marco