From: Marcel Werk Date: Tue, 6 Aug 2013 22:07:36 +0000 (+0200) Subject: Fixed word-wrap issues X-Git-Tag: 2.0.0_Beta_7~60 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=971f00fac06690a31f9193501e5cea817b2a545b;p=GitHub%2FWoltLab%2FWCF.git Fixed word-wrap issues --- diff --git a/com.woltlab.wcf/templates/moderationList.tpl b/com.woltlab.wcf/templates/moderationList.tpl index 5a65313393..5e3d8ba5a8 100644 --- a/com.woltlab.wcf/templates/moderationList.tpl +++ b/com.woltlab.wcf/templates/moderationList.tpl @@ -105,7 +105,7 @@

{lang}wcf.moderation.type.{@$definitionNames[$entry->objectTypeID]}{/lang} - {$entry->getTitle()} + {$entry->getTitle()|tableWordwrap}

{if $entry->getAffectedObject()->getUserID()}{$entry->getAffectedObject()->getUsername()}{else}{$entry->getAffectedObject()->getUsername()}{/if} - {@$entry->getAffectedObject()->getTime()|time} - {lang}wcf.moderation.type.{@$entry->getObjectTypeName()}{/lang} diff --git a/wcfsetup/install/files/acp/templates/acpSessionLog.tpl b/wcfsetup/install/files/acp/templates/acpSessionLog.tpl index 9ae12863b3..7bcc6f3cea 100644 --- a/wcfsetup/install/files/acp/templates/acpSessionLog.tpl +++ b/wcfsetup/install/files/acp/templates/acpSessionLog.tpl @@ -44,7 +44,7 @@ {$sessionAccessLog->getIpAddress()} {@$sessionAccessLog->time|time} {$sessionAccessLog->className} - {if !$sessionAccessLog->hasProtectedURI()}{$sessionAccessLog->requestURI|truncate:50}{else}{$sessionAccessLog->requestURI|truncate:50}{/if} + {if !$sessionAccessLog->hasProtectedURI()}{$sessionAccessLog->requestURI|truncate:50|tableWordwrap}{else}{$sessionAccessLog->requestURI|truncate:50|tableWordwrap}{/if} {$sessionAccessLog->requestMethod} {event name='columns'} diff --git a/wcfsetup/install/files/acp/templates/acpSessionLogList.tpl b/wcfsetup/install/files/acp/templates/acpSessionLogList.tpl index 921149b819..e76736502b 100644 --- a/wcfsetup/install/files/acp/templates/acpSessionLogList.tpl +++ b/wcfsetup/install/files/acp/templates/acpSessionLogList.tpl @@ -45,7 +45,7 @@ {@$sessionLog->sessionLogID} {$sessionLog->username} {$sessionLog->getIpAddress()}{if $sessionLog->hostname != $sessionLog->ipAddress}
{$sessionLog->hostname}{/if} - {$sessionLog->userAgent|truncate:75} + {$sessionLog->userAgent|truncate:75|tableWordwrap} {@$sessionLog->time|time} {@$sessionLog->lastActivityTime|time} {#$sessionLog->accesses} diff --git a/wcfsetup/install/files/acp/templates/attachmentList.tpl b/wcfsetup/install/files/acp/templates/attachmentList.tpl index 06761d535c..73be4e05ca 100644 --- a/wcfsetup/install/files/acp/templates/attachmentList.tpl +++ b/wcfsetup/install/files/acp/templates/attachmentList.tpl @@ -110,9 +110,9 @@
-

{$attachment->filename}

+

{$attachment->filename|tableWordwrap}

{if $attachment->userID}{$attachment->username}{else}{lang}wcf.user.guest{/lang}{/if}

- {if $attachment->getContainerObject()}

{$attachment->getContainerObject()->getTitle()}

{/if} + {if $attachment->getContainerObject()}

{$attachment->getContainerObject()->getTitle()|tableWordwrap}

{/if}
diff --git a/wcfsetup/install/files/acp/templates/tagList.tpl b/wcfsetup/install/files/acp/templates/tagList.tpl index 890f175314..29309338d5 100644 --- a/wcfsetup/install/files/acp/templates/tagList.tpl +++ b/wcfsetup/install/files/acp/templates/tagList.tpl @@ -75,7 +75,7 @@ {event name='rowButtons'} {#$tag->tagID} - {$tag->name} + {$tag->name|tableWordwrap} {if $tag->synonymFor === null}{#$tag->usageCount}{/if} {if $tag->languageName !== null}{$tag->languageName} ({$tag->languageCode}){/if} {if $tag->synonymFor !== null}{$tag->synonymName}{/if} diff --git a/wcfsetup/install/files/acp/templates/userList.tpl b/wcfsetup/install/files/acp/templates/userList.tpl index bd8c93e381..cb8fb360ee 100644 --- a/wcfsetup/install/files/acp/templates/userList.tpl +++ b/wcfsetup/install/files/acp/templates/userList.tpl @@ -112,7 +112,7 @@ {if $user->editable}{$user->username}{else}{$user->username}{/if} {foreach from=$columnHeads key=column item=columnLanguageVariable} - {if $columnValues[$user->userID][$column]|isset}{@$columnValues[$user->userID][$column]}{/if} + {if $columnValues[$user->userID][$column]|isset}{@$columnValues[$user->userID][$column]|tableWordwrap}{/if} {/foreach} {event name='columns'} diff --git a/wcfsetup/install/files/lib/system/template/plugin/TableWordwrapModifierTemplatePlugin.class.php b/wcfsetup/install/files/lib/system/template/plugin/TableWordwrapModifierTemplatePlugin.class.php new file mode 100644 index 0000000000..e2599ba520 --- /dev/null +++ b/wcfsetup/install/files/lib/system/template/plugin/TableWordwrapModifierTemplatePlugin.class.php @@ -0,0 +1,52 @@ + + * @package com.woltlab.wcf + * @subpackage system.template.plugin + * @category Community Framework + */ +class TableWordwrapModifierTemplatePlugin implements IModifierTemplatePlugin { + /** + * @see wcf\system\template\IModifierTemplatePlugin::execute() + */ + public function execute($tagArgs, TemplateEngine $tplObj) { + // values + $width = 30; + $break = "\xE2\x80\x8B"; + $string = $tagArgs[0]; + + $result = ''; + $substrings = explode(' ', $string); + + foreach ($substrings as $substring) { + if (!empty($result)) $result .= ' '; + + $length = StringUtil::length($substring); + if ($length > $width) { + $j = ceil($length / $width); + + for ($i = 0; $i < $j; $i++) { + if ($i) $result .= $break; + if ($width * ($i + 1) > $length) $result .= StringUtil::substring($substring, $width * $i); + else $result .= StringUtil::substring($substring, $width * $i, $width); + } + } + else { + $result .= $substring; + } + } + + return $result; + } +} diff --git a/wcfsetup/install/files/style/global.less b/wcfsetup/install/files/style/global.less index 38c21ba00a..70105f32aa 100644 --- a/wcfsetup/install/files/style/global.less +++ b/wcfsetup/install/files/style/global.less @@ -5,7 +5,7 @@ body { font-family: @wcfBaseFontFamily; font-size: @wcfBaseFontSize; line-height: @wcfBaseLineHeight; - word-break: break-all; + word-wrap: break-word; } small {