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 anzeigen
= Color Themes = {{velocity output="false"}} #if("$!request.xaction" == 'setTheme' && "$!request.theme" != '' && $hasAdmin) #set($preferencesDoc = $xwiki.getDocument('XWiki.XWikiPreferences')) #set($preferencesObj = $preferencesDoc.getObject('XWiki.XWikiPreferences')) $preferencesObj.set('colorTheme', $request.theme) $preferencesDoc.save() ## Redirect without xaction, so that refreshing doesn't set the same theme again. $response.sendRedirect($doc.getURL('view', "theme=$request.theme")) #stop #elseif("$!request.xaction" == 'create' && "$!request.newThemeName" != '') $response.sendRedirect($xwiki.getDocument('ColorThemes', $request.newThemeName).getURL('inline', 'template=ColorThemes.ColorThemeTemplate')) #stop #end $xwiki.ssx.use($doc.fullName) ## ## Page mockup, for displaying the theme colors ## #macro(themeMiniDemo $theme) <div class="x-demo-page" style="background-color: $theme.pageBackgroundColor"> <div class="x-demo-top-menu" style="background-color: $theme.menuBackgroundColor"> </div> <div class="x-demo-header" style="background-color: $theme.pageHeaderBackgroundColor"> </div> <div class="x-demo-page-content" style="background-color: $theme.pageContentBackgroundColor"> <div class="x-demo-title" style="background-color: $theme.titleColor; border-color: $theme.borderColor"> </div> <div class="x-demo-text1" style="background-color: $theme.textColor"></div> <div class="x-demo-text2" style="background-color: $theme.textColor"></div> <div class="x-demo-text3" style="background-color: $theme.textColor"></div> <div class="x-demo-text4" style="background-color: $theme.linkColor"></div> <div class="x-demo-text5" style="background-color: $theme.textColor"></div> </div> <div class="x-demo-right-panel"> <div class="x-demo-panel-header" style="background-color: $theme.panelHeaderBackgroundColor; border-color: $theme.borderColor"> <div class="x-demo-panel-header-text" style="background-color: $theme.panelHeaderTextColor"> </div> </div> <div class="x-demo-panel-contents" style="background-color: $theme.panelBackgroundColor"> <div class="x-demo-panel-text1" style="background-color: $theme.panelTextColor"> </div> <div class="x-demo-panel-text2" style="background-color: $theme.panelTextColor"> </div> <div class="x-demo-panel-text3" style="background-color: $theme.panelTextColor"> </div> </div> </div> </div> #end ## ## ## Theme information: title, creator, mockup ## #macro(displayTheme $themeDocName) #if($xwiki.getXWikiPreference('colorTheme') == $themeDocName) #set($isCurrentTheme = true) #else #set($isCurrentTheme = false) #end #set($themeDoc = $xwiki.getDocument($themeDocName)) #set($themeObj = $themeDoc.getObject('ColorThemes.ColorThemeClass', true)) #template('colorThemeInit.vm') <div class="x-theme#if($isCurrentTheme) current-theme#end"> #themeMiniDemo($theme) <div class="x-theme-info"> <div class="x-theme-title">[[$themeDoc.displayTitle>>$themeDocName]]</div> {{html wiki="false"}} <span class="theme-info">$msg.get('core.footer.creation', [$xwiki.getUserName($themeDoc.creator), $xwiki.formatDate($themeDoc.creationDate)])</span> #if($hasAdmin && !$isCurrentTheme) <div class="x-theme-set" id="$themeDoc.fullName"> <a href="$doc.getURL('view', "xaction=setTheme&theme=${themeDoc.fullName}")" class="use-theme">$msg.get('xe.themes.useTheme')</a> </div> #end {{/html}} </div> </div> #end ## ## End macros ## ## {{/velocity}} {{velocity}} #if("$!request.theme" != '') {{info}}$msg.get('xe.themes.themeSet', [$xwiki.getDocument($request.theme).displayTitle]){{/info}} #end {{html wiki="true"}} #set($currentTheme = $xwiki.getDocument('XWiki.XWikiPreferences').getObject('XWiki.XWikiPreferences').getProperty('colorTheme').value) #if("$!currentTheme" == '') #set($currentTheme = 'ColorThemes.DefaultColorTheme') #end == $msg.get('xe.themes.current') == #displayTheme($currentTheme) <div class="clearfloats"></div> #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") #set($themeList = $xwiki.searchDocuments($query, 0, 0)) #if($themeList.size() > 0) == $msg.get('xe.themes.others') == #end #if(!$isGuest) <form action="$doc.getURL()" method="post"> <div class="x-theme-create"> <input type="hidden" name="xaction" value="create"/> <label for="newThemeName" class="hidden">$msg.get('xe.themes.create.nameLabel')</label> <input type="text" name="newThemeName" id="newThemeName" value="$msg.get('xe.themes.create.nameTip')" class="withTip"/> <span class="buttonwrapper"><input type="submit" value="$msg.get('xe.themes.create')" class="button"/></span> </div> </form> #end <div class="clearfloats"></div> #foreach($themeDocName in $themeList) #displayTheme($themeDocName) #end <div class="clearfloats"></div> {{/html}} {{/velocity}}