mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-09 15:38:27 +01:00
attempt to improve overlong-word-control behavior
This commit is contained in:
parent
78011ed719
commit
b9192c0f4c
@ -1747,25 +1747,38 @@ else
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$cont = explode(' ', $content[$key]);
|
$contlines = explode("\n", $content[$key]);
|
||||||
$ckarray = array();
|
$clarray = array();
|
||||||
foreach($cont as &$word)
|
foreach ($contlines as &$line)
|
||||||
{
|
{
|
||||||
// set blank behind all , and . if words are too long, apply wordwrap afterwards to make sure we get
|
if(strlen($line) < 75)
|
||||||
if (strlen($word)>75)
|
|
||||||
{
|
{
|
||||||
$buff = html::activate_links($word);
|
$clarray[] = $line;
|
||||||
if (strlen($buff) == strlen($word)) // no links -> try to break overlong words
|
continue;
|
||||||
{
|
|
||||||
if (!(strpos($word,',')===false) && strpos($word,', ')===false) $word = str_replace(',',', ',$word);
|
|
||||||
if (!(strpos($word,'.')===false) && strpos($word,'. ')===false) $word = str_replace('.','. ',$word);
|
|
||||||
$word = wordwrap($word, 75, ' ', true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$ckarray[] =$word;
|
$cont = explode(' ', $line);
|
||||||
|
$ckarray = array();
|
||||||
|
foreach($cont as &$word)
|
||||||
|
{
|
||||||
|
// set blank behind all , and . if words are too long, apply wordwrap afterwards to make sure we get
|
||||||
|
if (strlen($word)>75)
|
||||||
|
{
|
||||||
|
$buff = html::activate_links($word);
|
||||||
|
if (strlen($buff) == strlen($word)) // no links -> try to break overlong words
|
||||||
|
{
|
||||||
|
if (!(strpos($word,',')===false) && strpos($word,', ')===false) $word = str_replace(',',', ',$word);
|
||||||
|
if (!(strpos($word,'.')===false) && strpos($word,'. ')===false) $word = str_replace('.','. ',$word);
|
||||||
|
$word = wordwrap($word, 75, ' ', true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$ckarray[] =$word;
|
||||||
|
}
|
||||||
|
$line = join(' ',$ckarray);
|
||||||
|
unset($ckarray);
|
||||||
|
$clarray[] = $line;
|
||||||
}
|
}
|
||||||
$content[$key] = join(' ',$ckarray);
|
$content[$key] = join("\n",$clarray);
|
||||||
unset($ckarray);
|
unset($clarray);
|
||||||
}
|
}
|
||||||
if (is_numeric($_REQUEST['cat_id']))
|
if (is_numeric($_REQUEST['cat_id']))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user