diff --git a/xwiki-platform-core/xwiki-platform-oldcore/src/main/resources/ApplicationResources.properties b/xwiki-platform-core/xwiki-platform-oldcore/src/main/resources/ApplicationResources.properties index 45149bb2ada7833f3f5f20190c02d106259e5bd4..dbdd4994402f1403c9bc22618122e0bfe639c24a 100644 --- a/xwiki-platform-core/xwiki-platform-oldcore/src/main/resources/ApplicationResources.properties +++ b/xwiki-platform-core/xwiki-platform-oldcore/src/main/resources/ApplicationResources.properties @@ -2067,15 +2067,17 @@ xe.admin.users.filter.lastname=Last name filter ### User profile management platform.user.profileConfigureSectionsTitle=Displayed sections -platform.user.profileConfigureSectionsLabel=Section Names -platform.user.profileConfigureSectionsHint=Space or newline separated list of section names to be displayed from the list of sections defined below. +platform.user.profileConfigureSectionsLabel=Section IDs +platform.user.profileConfigureSectionsHint=Space or newline separated list of section IDs to be displayed from the list of sections defined below. platform.user.profileConfigureSectionsAllTitle=All sections platform.user.profileConfigureSectionAddButtonLabel=Add platform.user.profileConfigureSectionRemoveButtonLabel=Remove +platform.user.profileConfigureSectionIdLabel=Section ID +platform.user.profileConfigureSectionIdHint=Unique identifier of this section. Must not contain spaces. platform.user.profileConfigureSectionNameLabel=Section Name -platform.user.profileConfigureSectionNameHint=Unique name of this section. Must not contain spaces. +platform.user.profileConfigureSectionNameHint=Display name of this section. This can be a fixed string or a [[translation key>>{0}]] (Example: $msg.get('key')). platform.user.profileConfigureSectionPropertiesLabel=Section Properties -platform.user.profileConfigureSectionPropertiesHint=Space or newline separated list of properties of the [[{0}]] class to display in this section. An optional [[microformats>>http://en.wikipedia.org/wiki/Microformat]] class can prefix the property name (example: given-name:first_name family-name:last_name). +platform.user.profileConfigureSectionPropertiesHint=Space or newline separated list of properties of the [[{0}]] class to display in this section. An optional [[microformats>>http://en.wikipedia.org/wiki/Microformat]] class can prefix the property name (Example: given-name:first_name family-name:last_name). platform.user.profileConfigureSaveButtonLabel=Save ### Skin diff --git a/xwiki-platform-core/xwiki-platform-user/xwiki-platform-user-ui/src/main/resources/XWiki/AdminUserProfileSheet.xml b/xwiki-platform-core/xwiki-platform-user/xwiki-platform-user-ui/src/main/resources/XWiki/AdminUserProfileSheet.xml index 64d2904f315470d65d1c921161b26bfeabb89681..a7ca5ddf803ff167bad4f1a385401150027a0d1f 100644 --- a/xwiki-platform-core/xwiki-platform-user/xwiki-platform-user-ui/src/main/resources/XWiki/AdminUserProfileSheet.xml +++ b/xwiki-platform-core/xwiki-platform-user/xwiki-platform-user-ui/src/main/resources/XWiki/AdminUserProfileSheet.xml @@ -159,11 +159,24 @@ <defaultWeb/> <nameField/> <validationScript/> + <id> + <customDisplay/> + <disabled>0</disabled> + <name>id</name> + <number>1</number> + <picker>0</picker> + <prettyName>Section ID</prettyName> + <size>30</size> + <unmodifiable>0</unmodifiable> + <validationMessage/> + <validationRegExp/> + <classType>com.xpn.xwiki.objects.classes.StringClass</classType> + </id> <name> <customDisplay/> <disabled>0</disabled> <name>name</name> - <number>1</number> + <number>2</number> <picker>0</picker> <prettyName>Section Name</prettyName> <size>30</size> @@ -177,7 +190,7 @@ <disabled>0</disabled> <editor>PureText</editor> <name>properties</name> - <number>2</number> + <number>3</number> <picker>0</picker> <prettyName>Properties to display</prettyName> <rows>5</rows> @@ -193,7 +206,10 @@ <className>XWiki.UserProfileSectionClass</className> <guid>5371585b-24cb-4cd4-b03c-02f82f3d0dc4</guid> <property> - <name>personal</name> + <id>personal</id> + </property> + <property> + <name>$msg.get('platform.core.profile.section.personal')</name> </property> <property> <properties>given-name:first_name @@ -212,11 +228,24 @@ <defaultWeb/> <nameField/> <validationScript/> + <id> + <customDisplay/> + <disabled>0</disabled> + <name>id</name> + <number>1</number> + <picker>0</picker> + <prettyName>Section ID</prettyName> + <size>30</size> + <unmodifiable>0</unmodifiable> + <validationMessage/> + <validationRegExp/> + <classType>com.xpn.xwiki.objects.classes.StringClass</classType> + </id> <name> <customDisplay/> <disabled>0</disabled> <name>name</name> - <number>1</number> + <number>2</number> <picker>0</picker> <prettyName>Section Name</prettyName> <size>30</size> @@ -230,7 +259,7 @@ <disabled>0</disabled> <editor>PureText</editor> <name>properties</name> - <number>2</number> + <number>3</number> <picker>0</picker> <prettyName>Properties to display</prettyName> <rows>5</rows> @@ -246,7 +275,10 @@ <className>XWiki.UserProfileSectionClass</className> <guid>f7f9f9a6-bd76-4eb8-8317-97c77a998227</guid> <property> - <name>contact</name> + <id>contact</id> + </property> + <property> + <name>$msg.get('platform.core.profile.section.contact')</name> </property> <property> <properties>email:email @@ -264,11 +296,24 @@ <defaultWeb/> <nameField/> <validationScript/> + <id> + <customDisplay/> + <disabled>0</disabled> + <name>id</name> + <number>1</number> + <picker>0</picker> + <prettyName>Section ID</prettyName> + <size>30</size> + <unmodifiable>0</unmodifiable> + <validationMessage/> + <validationRegExp/> + <classType>com.xpn.xwiki.objects.classes.StringClass</classType> + </id> <name> <customDisplay/> <disabled>0</disabled> <name>name</name> - <number>1</number> + <number>2</number> <picker>0</picker> <prettyName>Section Name</prettyName> <size>30</size> @@ -282,7 +327,7 @@ <disabled>0</disabled> <editor>PureText</editor> <name>properties</name> - <number>2</number> + <number>3</number> <picker>0</picker> <prettyName>Properties to display</prettyName> <rows>5</rows> @@ -298,7 +343,10 @@ <className>XWiki.UserProfileSectionClass</className> <guid>182ff962-7e7c-4c58-90b2-db05d5b4479f</guid> <property> - <name>links</name> + <id>links</id> + </property> + <property> + <name>$msg.get('platform.core.profile.section.links')</name> </property> <property> <properties>blog @@ -374,11 +422,16 @@ </dt> #set ($sectionObjects = $sheetDocument.getObjects($sectionObjectClassName)) #foreach ($sectionObject in $sectionObjects) - #set ($sectionName = $sectionObject.getProperty('name').value) <dt> <a class='hasIcon icon-button remove-button' href="$sheetDocument.getURL('objectremove', "classname=${sectionObjectClassName}&amp;classid=${sectionObject.number}&amp;xredirect=$escapetool.url(${xredirect})&amp;form_token=${formToken}")">$msg.get('platform.user.profileConfigureSectionRemoveButtonLabel')</a> + <label for="${sectionObjectClassName}_${sectionObject.number}_id">$msg.get('platform.user.profileConfigureSectionIdLabel')</label> + <span class='xHint'>$msg.get('platform.user.profileConfigureSectionIdHint')</span> + </dt> + <dd>$sheetDocument.display('id', 'edit', $sectionObject)</dd> + + <dt> <label for="${sectionObjectClassName}_${sectionObject.number}_name">$msg.get('platform.user.profileConfigureSectionNameLabel')</label> - <span class='xHint'>$msg.get('platform.user.profileConfigureSectionNameHint')</span> + <span class='xHint'>$msg.get('platform.user.profileConfigureSectionNameHint', 'http://platform.xwiki.org/xwiki/bin/view/DevGuide/InternationalizingApplications')</span> </dt> <dd>$sheetDocument.display('name', 'edit', $sectionObject)</dd> diff --git a/xwiki-platform-core/xwiki-platform-user/xwiki-platform-user-ui/src/main/resources/XWiki/UserProfileSectionClass.xml b/xwiki-platform-core/xwiki-platform-user/xwiki-platform-user-ui/src/main/resources/XWiki/UserProfileSectionClass.xml index b450ac731d5b8e8d2377d89136fa195c980d3285..f7d4c5272afb648f9310d3cbd298470215ef1c55 100644 --- a/xwiki-platform-core/xwiki-platform-user/xwiki-platform-user-ui/src/main/resources/XWiki/UserProfileSectionClass.xml +++ b/xwiki-platform-core/xwiki-platform-user/xwiki-platform-user-ui/src/main/resources/XWiki/UserProfileSectionClass.xml @@ -32,11 +32,24 @@ <defaultWeb/> <nameField/> <validationScript/> + <id> + <customDisplay/> + <disabled>0</disabled> + <name>id</name> + <number>1</number> + <picker>0</picker> + <prettyName>Section ID</prettyName> + <size>30</size> + <unmodifiable>0</unmodifiable> + <validationMessage/> + <validationRegExp/> + <classType>com.xpn.xwiki.objects.classes.StringClass</classType> + </id> <name> <customDisplay/> <disabled>0</disabled> <name>name</name> - <number>1</number> + <number>2</number> <picker>0</picker> <prettyName>Section Name</prettyName> <size>30</size> @@ -50,7 +63,7 @@ <disabled>0</disabled> <editor>PureText</editor> <name>properties</name> - <number>2</number> + <number>3</number> <picker>0</picker> <prettyName>Properties to display</prettyName> <rows>5</rows> diff --git a/xwiki-platform-core/xwiki-platform-user/xwiki-platform-user-ui/src/main/resources/XWiki/XWikiUserProfileSheet.xml b/xwiki-platform-core/xwiki-platform-user/xwiki-platform-user-ui/src/main/resources/XWiki/XWikiUserProfileSheet.xml index aa4e898906c9f65f814bee02d550a9c5b2e2d853..f671b155bd7b9f10adb59a5949ed4bd81cec2c9a 100644 --- a/xwiki-platform-core/xwiki-platform-user/xwiki-platform-user-ui/src/main/resources/XWiki/XWikiUserProfileSheet.xml +++ b/xwiki-platform-core/xwiki-platform-user/xwiki-platform-user-ui/src/main/resources/XWiki/XWikiUserProfileSheet.xml @@ -212,12 +212,23 @@ #set ($sectionsObject = $sheetDocument.getObject($sectionsObjectClassName)) #set ($sectionsToDisplayString = $sectionsObject.getProperty('sections').value) #set ($sectionsToDisplay = $sectionsToDisplayString.split('\s+')) - #foreach ($sectionName in $sectionsToDisplay) - #set ($sectionObject = $sheetDocument.getObject($sectionObjectClassName, 'name', $sectionName)) + #foreach ($sectionId in $sectionsToDisplay) + #set ($sectionObject = $sheetDocument.getObject($sectionObjectClassName, 'id', $sectionId)) + #set ($sectionName = "$!sectionObject.getProperty('name').value") + ## The section name will be evaluated. The admin can specify a static string or a call to $msg(...) to provide internationalization support. + #set ($sectionName = "#evaluate($!sectionName)") + ## If there is no section name specified, use the default translations prefix for the user profile, maybe we get lucky. + #if ("$!sectionName" == '') + #set ($sectionName = $msg.get("platform.core.profile.section.${sectionId}")) + #end + ## If that does not work either, just display the sectionID. + #if ("$!sectionName" == "platform.core.profile.section.${sectionId}") + #set ($sectionName = $sectionId) + #end #set ($sectionPropertiesString = $sectionObject.getProperty('properties').value) #set ($sectionProperties = $sectionPropertiesString.split('\s+')) - #if ($sectionProperties.size() > 0) - <h1>$msg.get("platform.core.profile.section.${sectionName}")</h1> + #if ($sectionProperties && $sectionProperties.size() > 0) + <h1>$sectionName</h1> <dl> #foreach ($sectionProperty in $sectionProperties) #set ($vCardData = $sectionProperty.split(':'))