General Actions:
Log-in
Register
Wiki:
games
▼
:
Document Index
»
Space:
XWiki
▼
:
Document Index
»
Page:
XWikiUserWatchListSheet
Search
en
Page Actions:
Export
▼
:
Export as PDF
Export as RTF
Export as HTML
More actions
▼
:
Print preview
View Source
XWikiUsers
»
XWikiUserSheet
»
XWikiUserWatchListSheet
Wiki source code of
XWikiUserWatchListSheet
Last modified by
Administrator
on 2011/11/06 20:09
Content
·
Comments
(0)
·
Annotations
(0)
·
Attachments
(0)
·
History
·
Information
Hide line numbers
1: {{velocity}} 2: #set($obj = $doc.getObject("XWiki.XWikiUsers")) 3: #if(!$obj) 4: = $msg.get('xe.admin.users.sheet') = 5: 6: {{info}}$msg.get('xe.admin.users.applyonusers'){{/info}}## 7: #else 8: #set($watchOject = $doc.getObject('XWiki.WatchListClass')) 9: {{html clean="false" wiki="true"}} 10: $xwiki.ssx.use("XWiki.XWikiUserSheet")## 11: <div class="#if($context.action == 'view')half #{else}full #{end}column"> 12: <div class="watchlistManagement"> 13: #if($xcontext.action == 'view' && $hasEdit) 14: <div class="editProfileCategory"><a href="$doc.getURL('inline', 'category=watchlist')"><span class="hidden">$msg.get('platform.core.profile.category.watchlist.edit')</span></a></div> 15: #end 16: <h1>$msg.get('platform.core.profile.section.watchlistManagement')</h1> 17: <dl> 18: <dt class="label"><label>$msg.get('platform.core.profile.watchlist.notifier')</label></dt> 19: #set($notifierDocs = $xwiki.watchlist.getNotifiers()) 20: #set($currentNotifier = $watchOject.getProperty('interval').getValue()) 21: <dd> 22: #if($xcontext.action=='view') 23: #if("$!currentNotifier" != "") 24: #foreach($notifierDoc in $notifierDocs) 25: #if($notifierDoc.getFullName() == $currentNotifier) 26: $notifierDoc.getPlainTitle() 27: #end 28: #end 29: #end 30: #else 31: <select name="XWiki.WatchListClass_0_interval"> 32: <option value=""> </option> 33: #foreach($notifierDoc in $notifierDocs) 34: <option value="$notifierDoc.getFullName()"#if($notifierDoc.getFullName()==$currentNotifier) selected="selected"#end>$notifierDoc.getPlainTitle()</option> 35: #end 36: </select> 37: #end 38: </dd> 39: <dt class="label"><label#if($context.action != 'view') for="XWiki.WatchListClass_0_automaticwatch"#end>$msg.get('XWiki.WatchListClass_automaticwatch')</label></dt> 40: <dd> 41: $watchOject.automaticwatch 42: </dd> 43: </dl> 44: </div> 45: </div> 46: #if ($xcontext.action == 'view') 47: <div class="half column"> 48: <div class="watchlistRss"> 49: <h1>$msg.get('watchlist.staytuned.rss')</h1> 50: <a id="watchlistRssLink" rel="_blank" href="$xwiki.getURL("XWiki.WatchListRss", "view", "xpage=plain&outputSyntax=plain")">$msg.get("watchlist.staytuned.rss.info")</a> 51: </div> 52: #end 53: #if ($xcontext.action == 'view') 54: <div class="watchlistElements"> 55: <h1>$msg.get('platform.core.profile.section.watchlistElements')</h1> 56: #set($collist = ["type", "wiki","space", "document", "actions"]) 57: #set($colprops = { 58: "type": { "sortable":false }, 59: "wiki": { "sortable":false }, 60: "space": { "sortable":false }, 61: "document": { "sortable":false }}) 62: #set($options = { "resultPage" : "XWiki.XWikiUserWatchListLiveTableResults", 63: "rowCount": 10, 64: "description": "This table lists all watched elements.", 65: "translationPrefix": "watchlist.table.", 66: "callback": "function (row, i, table) { 67: var tr = new Element('tr'); 68: tr.insert(new Element('td').insert(new Element('span').addClassName(row.type + 'WatchlistType'))); 69: tr.insert(new Element('td').insert(new Element('a', { href : row.wikiUrl}).update(row.wikiName))); 70: if (row.spaceUrl != '') { 71: tr.insert(new Element('td').insert(new Element('a', { href : row.spaceUrl}).update(row.spaceName))); 72: } else { 73: tr.insert(new Element('td').update(row.spaceName)); 74: } 75: if (row.pageUrl != '') { 76: tr.insert(new Element('td').insert(new Element('a', { href : row.pageUrl}).update(row.pageName))); 77: } else { 78: tr.insert(new Element('td').update(row.pageName)); 79: } 80: var deleteLink = new Element('a', { 81: href : row.deleteUrl 82: }); 83: deleteLink.insert(new Element('img', { 84: 'src' : '${xwiki.getSkinFile('icons/silk/cross.gif')}' 85: })); 86: deleteLink.observe('click', function(event) { 87: Event.stop(event); 88: if (row.deleteUrl.indexOf('/') == 0) { 89: // DeleteURL is from the same domain 90: var surl = row.deleteUrl; 91: var myAjax = new Ajax.Request( 92: surl, 93: { 94: method: 'get', 95: onComplete: function(transport) { 96: this.clearCache(); 97: this.showRows(this.currentOffset, this.limit); 98: }.bind(this) 99: } 100: ); 101: } else { 102: // DeleteURL is from another domain, which prevents an AJAX request to be used here. We make a browser request and use xredirect to come back to the current page. 103: var separator = (row.deleteUrl.indexOf('?') == -1) ? '?' : '&'; 104: window.location = row.deleteUrl + separator + 'xredirect=' + window.location; 105: } 106: }.bind(this)); 107: tr.insert(new Element('td').insert(deleteLink)); 108: return tr; 109: }" }) 110: #livetable("mywatchlist" $collist $colprops $options) 111: </div> 112: </div> 113: #end 114: <div class="clearfloats"> </div> 115: {{/html}}## 116: #end 117: {{/velocity}}