General Actions:
Log-in
Wiki:
L3D's Wiki
▼
:
Document Index
»
Space:
Blog
▼
:
Document Index
»
Page:
BlogPostSheet
Search
Page Actions:
Export
▼
:
Export as PDF
Export as RTF
Export as HTML
More actions
▼
:
Print preview
View Source
Welcome to your wiki
»
Wiki blog
»
XClass representing a blog entry
»
Sheet for displaying blog entries
Wiki source code of
Sheet for displaying blog entries
Last modified by
Administrator
on 2008/11/20 16:17
Content
·
Comments
(0)
·
Attachments
(0)
·
History
·
Information
Hide line numbers
1: #includeMacros("Blog.BlogCode") 2: #includeMacros("Blog.CategoriesCode") 3: #getEntryObject($doc $entryObj) 4: #if("$!entryObj" == '') 5: #warning("This is not a blog post!") 6: #elseif($context.action != 'inline') 7: ## View mode 8: #isPublished($entryObj $isPublished) 9: #isHidden($entryObj $isHidden) 10: ## displayBlog requires a list of documents, and whether to display only an extract or the full entry. 11: #displayBlog([$doc.fullName] 'single' false) 12: #else 13: <dl> 14: <dt>Title:</dt> 15: <dd>$doc.display("title", "edit", $entryObj)</dd> 16: <dt>Content:</dt> 17: <dd>$doc.display("content", "edit", $entryObj)</dd> 18: <dt>Summary (optional):</dt> 19: <dd>$doc.display("extract", "edit", $entryObj)</dd> 20: <dt>Category:</dt> 21: <dd> 22: #getCategoriesHierarchy('' $tree) 23: <div id="blog_category_container"> 24: #displayCategoriesHierarchy($tree 'selectable')</div> 25: #showCreateCategoryBox($tree) 26: </dd> 27: </dl> 28: #template('tagedit.vm') 29: #isPublished($entryObj $isPublished) 30: #if($isPublished) 31: #if($doc.creator == $context.user) 32: #publishMessageBox("This article was published on ${doc.display('publishDate', 'view', $entryObj)}") 33: #hideMessageBox("Hide article $doc.display('hidden', 'edit', $entryObj)") 34: #end 35: #else 36: #set($defaultDate = $xwiki.getDocument($blogPostTemplate).getObject($blogPostClassname).getProperty('publishDate').value.time) 37: #if($entryObj.getProperty('publishDate').value.time == $defaultDate) 38: ## The publish date was not set, force it to be the creation date 39: $entryObj.set('publishDate', $doc.creationDate) 40: #end 41: #publishMessageBox("This article is not published yet. <label>*Publish ${doc.display('published', 'edit', $entryObj)}*</label>\\<label>Set the publication date to: ${doc.display('publishDate', 'edit', $entryObj)}</label>") 42: #end 43: #set($newtitle = $request.title) 44: #if($newtitle) 45: #set($newtitle = $newtitle.replaceAll('"',"'")) 46: <script type="text/javascript"> 47: {pre} 48: ## TODO: Set the correct date. This does not work since the current form buttons break onsumbit events. 49: ## Event.observe(document.getElementById('${formname}'), 'submit', function(evt) {alert(this); alert(evt); return false;}, true); 50: var title = "${newtitle}"; 51: document.forms.inline["${entryObj.getxWikiClass().getName()}_${entryObj.number}_title"].value = title; 52: {/pre} 53: </script> 54: #end 55: #end
Quick Links
L3D Calendar
Wiki Dashboard
Document Index
Blog
Sandbox