Allgemeine Aktionen:
Anmelden
Erstellen
▼
:
Kommentar erstellen
Wiki
▼
:
Dokumentenindex
»
Space:
ColorThemes
▼
:
Dokumentenverzeichnis
»
Seite:
WebHome
Suche
Aktionen:
Exportieren
▼
:
Als PDF exportieren
Als RTF exportieren
Als HTML exportieren
Weitere Aktionen
▼
:
Druckvorschau
Zeige den Quellcode
Willkommen in den metamagix Wikis!
»
Color Themes
Wiki-Quellcode von
Color Themes
Zuletzt geändert von
Administrator
am 2009/08/24 12:08
Inhalt
·
Kommentare
(0)
·
Anmerkungen
(0)
·
Anhänge
(0)
·
Historie
·
Information
Zeilennummern verstecken
1: = Color Themes = 2: {{velocity output="false"}} 3: #if("$!request.xaction" == 'setTheme' && "$!request.theme" != '' && $hasAdmin) 4: #set($preferencesDoc = $xwiki.getDocument('XWiki.XWikiPreferences')) 5: #set($preferencesObj = $preferencesDoc.getObject('XWiki.XWikiPreferences')) 6: $preferencesObj.set('colorTheme', $request.theme) 7: $preferencesDoc.save() 8: ## Redirect without xaction, so that refreshing doesn't set the same theme again. 9: $response.sendRedirect($doc.getURL('view', "theme=$request.theme")) 10: #stop 11: #elseif("$!request.xaction" == 'create' && "$!request.newThemeName" != '') 12: $response.sendRedirect($xwiki.getDocument('ColorThemes', $request.newThemeName).getURL('inline', 'template=ColorThemes.ColorThemeTemplate')) 13: #stop 14: #end 15: 16: $xwiki.ssx.use($doc.fullName) 17: 18: 19: ## 20: ## Page mockup, for displaying the theme colors 21: ## 22: #macro(themeMiniDemo $theme) 23: <div class="x-demo-page" style="background-color: $theme.pageBackgroundColor"> 24: <div class="x-demo-top-menu" style="background-color: $theme.menuBackgroundColor"> </div> 25: <div class="x-demo-header" style="background-color: $theme.pageHeaderBackgroundColor"> </div> 26: <div class="x-demo-page-content" style="background-color: $theme.pageContentBackgroundColor"> 27: <div class="x-demo-title" style="background-color: $theme.titleColor; border-color: $theme.borderColor"> </div> 28: <div class="x-demo-text1" style="background-color: $theme.textColor"></div> 29: <div class="x-demo-text2" style="background-color: $theme.textColor"></div> 30: <div class="x-demo-text3" style="background-color: $theme.textColor"></div> 31: <div class="x-demo-text4" style="background-color: $theme.linkColor"></div> 32: <div class="x-demo-text5" style="background-color: $theme.textColor"></div> 33: </div> 34: <div class="x-demo-right-panel"> 35: <div class="x-demo-panel-header" style="background-color: $theme.panelHeaderBackgroundColor; border-color: $theme.borderColor"> 36: <div class="x-demo-panel-header-text" style="background-color: $theme.panelHeaderTextColor"> </div> 37: </div> 38: <div class="x-demo-panel-contents" style="background-color: $theme.panelBackgroundColor"> 39: <div class="x-demo-panel-text1" style="background-color: $theme.panelTextColor"> </div> 40: <div class="x-demo-panel-text2" style="background-color: $theme.panelTextColor"> </div> 41: <div class="x-demo-panel-text3" style="background-color: $theme.panelTextColor"> </div> 42: </div> 43: </div> 44: </div> 45: #end 46: ## 47: ## 48: ## Theme information: title, creator, mockup 49: ## 50: #macro(displayTheme $themeDocName) 51: #if($xwiki.getXWikiPreference('colorTheme') == $themeDocName) 52: #set($isCurrentTheme = true) 53: #else 54: #set($isCurrentTheme = false) 55: #end 56: #set($themeDoc = $xwiki.getDocument($themeDocName)) 57: #set($themeObj = $themeDoc.getObject('ColorThemes.ColorThemeClass', true)) 58: #template('colorThemeInit.vm') 59: <div class="x-theme#if($isCurrentTheme) current-theme#end"> 60: #themeMiniDemo($theme) 61: <div class="x-theme-info"> 62: <div class="x-theme-title">[[$themeDoc.displayTitle>>$themeDocName]]</div> 63: {{html wiki="false"}} 64: <span class="theme-info">$msg.get('core.footer.creation', [$xwiki.getUserName($themeDoc.creator), $xwiki.formatDate($themeDoc.creationDate)])</span> 65: #if($hasAdmin && !$isCurrentTheme) 66: <div class="x-theme-set" id="$themeDoc.fullName"> 67: <a href="$doc.getURL('view', "xaction=setTheme&theme=${themeDoc.fullName}")" class="use-theme">$msg.get('xe.themes.useTheme')</a> 68: </div> 69: #end 70: {{/html}} 71: </div> 72: </div> 73: #end 74: ## 75: ## End macros 76: ## 77: ## 78: {{/velocity}} 79: 80: {{velocity}} 81: #if("$!request.theme" != '') 82: {{info}}$msg.get('xe.themes.themeSet', [$xwiki.getDocument($request.theme).displayTitle]){{/info}} 83: 84: #end 85: {{html wiki="true"}} 86: #set($currentTheme = $xwiki.getDocument('XWiki.XWikiPreferences').getObject('XWiki.XWikiPreferences').getProperty('colorTheme').value) 87: #if("$!currentTheme" == '') 88: #set($currentTheme = 'ColorThemes.DefaultColorTheme') 89: #end 90: == $msg.get('xe.themes.current') == 91: #displayTheme($currentTheme) 92: <div class="clearfloats"></div> 93: #set($query = ", BaseObject as theme where doc.fullName=theme.name and theme.className='ColorThemes.ColorThemeClass' and doc.fullName<>'ColorThemes.ColorThemeTemplate' and doc.fullName<>'$currentTheme' and doc.fullName<>'ColorThemes.ColorThemeSheet' order by doc.title") 94: #set($themeList = $xwiki.searchDocuments($query, 0, 0)) 95: #if($themeList.size() > 0) 96: == $msg.get('xe.themes.others') == 97: #end 98: #if(!$isGuest) 99: <form action="$doc.getURL()" method="post"> 100: <div class="x-theme-create"> 101: <input type="hidden" name="xaction" value="create"/> 102: <label for="newThemeName" class="hidden">$msg.get('xe.themes.create.nameLabel')</label> 103: <input type="text" name="newThemeName" id="newThemeName" value="$msg.get('xe.themes.create.nameTip')" class="withTip"/> 104: <span class="buttonwrapper"><input type="submit" value="$msg.get('xe.themes.create')" class="button"/></span> 105: </div> 106: </form> 107: #end 108: <div class="clearfloats"></div> 109: #foreach($themeDocName in $themeList) 110: #displayTheme($themeDocName) 111: #end 112: <div class="clearfloats"></div> 113: {{/html}} 114: {{/velocity}}