Implemented new type: mail

* display and link clientside mails to other types and events
 * fixed favorites menu for new types
 * fixed sorting column triggered spells in enchantment listview
 * some misc cleanups
This commit is contained in:
Sarjuuk
2018-12-15 01:49:55 +01:00
parent ccef11323b
commit fd04e9f977
38 changed files with 682 additions and 171 deletions

View File

@@ -6,7 +6,6 @@ class Lang
private static $main;
private static $account;
private static $user;
private static $mail;
private static $game;
private static $maps;
private static $profiler;
@@ -26,6 +25,7 @@ class Lang
private static $icon;
private static $item;
private static $itemset;
private static $mail;
private static $npc;
private static $pet;
private static $quest;
@@ -124,6 +124,33 @@ class Lang
return $b;
}
public static function trimTextClean(string $text, int $length = 100) : string
{
// remove line breaks
$text = strtr($text, ["\n" => ' ', "\r" => ' ']);
// limit whitespaces to one at a time
$text = preg_replace('/\s+/', ' ', trim($text));
// limit previews to 100 chars + whatever it takes to make the last word full
if ($length > 0 && mb_strlen($text) > $length)
{
$n = 0;
$b = [];
$parts = explode(' ', $text);
while ($n < $length && $parts)
{
$_ = array_shift($parts);
$n += mb_strlen($_);
$b[] = $_;
}
$text = implode(' ', $b).'…';
}
return $text;
}
public static function sort($prop, $group, $method = SORT_NATURAL)
{

View File

@@ -236,6 +236,8 @@ $lang = array(
'items' => "Gegenstände",
'itemset' => "Ausrüstungsset",
'itemsets' => "Ausrüstungssets",
'mail' => "Brief",
'mails' => "Briefe",
'mechanic' => "Auswirkung",
'mechAbbr' => "Ausw.",
'meetingStone' => "Versammlungsstein",
@@ -783,9 +785,8 @@ $lang = array(
'comments' => "Kommentare",
'screenshots' => "Screenshots",
'videos' => "Videos",
'posts' => "Forenbeiträge"
),
'mail' => array(
'posts' => "Forenbeiträge",
// user mail
'tokenExpires' => "Das Token wird in %s verfallen.",
'accConfirm' => ["Kontobestätigung", "Willkommen bei ".CFG_NAME_SHORT."!\r\n\r\nKlicke auf den Link um euren Account zu aktivieren.\r\n\r\n".HOST_URL."?account=signup&token=%s\r\n\r\nFalls Ihr diese Mail nicht angefordert habt kann sie einfach ignoriert werden."],
'recoverUser' => ["Benutzernamenanfrage", "Folgt diesem Link um euch anzumelden.\r\n\r\n".HOST_URL."?account=signin&token=%s\r\n\r\nFalls Ihr diese Mail nicht angefordert habt kann sie einfach ignoriert werden."],
@@ -1028,9 +1029,6 @@ $lang = array(
'enabledByQDesc'=> "Ihr könnt diese Quest nur annehmen, wenn eins der nachfolgenden Quests aktiv ist",
'gainsDesc' => "Bei Abschluss dieser Quest erhaltet Ihr",
'theTitle' => 'den Titel "%s"',
'mailDelivery' => "Ihr werdet diesen Brief%s%s erhalten",
'mailBy' => ' von <a href="?npc=%d">%s</a>',
'mailIn' => " nach %s",
'unavailable' => "Diese Quest wurde als nicht genutzt markiert und kann weder erhalten noch vollendet werden.",
'experience' => "Erfahrung",
'expConvert' => "(oder %s, wenn auf Stufe %d vollendet)",
@@ -1042,7 +1040,6 @@ $lang = array(
'spellLearn' => "Ihr erlernt",
'bonusTalents' => "%d |4Talentpunkt:Talentpunkte;",
'spellDisplayed'=> ' (<a href="?spell=%d">%s</a> wird angezeigt)',
'attachment' => "Anlage",
'questInfo' => array(
0 => "Normal", 1 => "Gruppe", 21 => "Leben", 41 => "PvP", 62 => "Schlachtzug", 81 => "Dungeon", 82 => "Weltereignis",
83 => "Legendär", 84 => "Eskorte", 85 => "Heroisch", 88 => "Schlachtzug (10)", 89 => "Schlachtzug (25)"
@@ -1159,6 +1156,16 @@ $lang = array(
"Narration Music", "Narration", 50 => "Zone Ambience", 52 => "Emitters", 53 => "Vehicles", 1000 => "Meine Playlist"
)
),
'mail' => array(
'notFound' => "Dieser Brief existiert nicht.",
'attachment' => "Anlage",
'mailDelivery' => 'Ihr werdet <a href="?mail=%d">diesen Brief</a>%s%s erhalten',
'mailBy' => ' von <a href="?npc=%d">%s</a>',
'mailIn' => " nach %s",
'delay' => "Verzögerung",
'sender' => "Absender",
'untitled' => "Unbetitelter Brief"
),
'pet' => array(
'notFound' => "Diese Tierart existiert nicht.",
'exotic' => "Exotisch",

View File

@@ -236,6 +236,8 @@ $lang = array(
'items' => "Items",
'itemset' => "item Set",
'itemsets' => "Item Sets",
'mail' => "mail",
'mails' => "Mails",
'mechanic' => "Mechanic",
'mechAbbr' => "Mech.",
'meetingStone' => "Meeting Stone",
@@ -783,9 +785,8 @@ $lang = array(
'comments' => "Comments",
'screenshots' => "Screenshots",
'videos' => "Videos",
'posts' => "Forum posts"
),
'mail' => array(
'posts' => "Forum posts",
// user mail
'tokenExpires' => "This token expires in %s.",
'accConfirm' => ["Account Confirmation", "Welcome to ".CFG_NAME_SHORT."!\r\n\r\nClick the Link below to activate your account.\r\n\r\n".HOST_URL."?account=signup&token=%s\r\n\r\nIf you did not request this mail simply ignore it."],
'recoverUser' => ["User Recovery", "Follow this link to log in.\r\n\r\n".HOST_URL."?account=signin&token=%s\r\n\r\nIf you did not request this mail simply ignore it."],
@@ -1028,9 +1029,6 @@ $lang = array(
'enabledByQDesc'=> "This quest is available only, when one of these quests are active",
'gainsDesc' => "Upon completion of this quest you will gain",
'theTitle' => 'the title "%s"', // partly REWARD_TITLE
'mailDelivery' => "You will receive this letter%s%s",
'mailBy' => ' by <a href="?npc=%d">%s</a>',
'mailIn' => " after %s",
'unavailable' => "This quest was marked obsolete and cannot be obtained or completed.",
'experience' => "experience",
'expConvert' => "(or %s if completed at level %d)",
@@ -1042,7 +1040,6 @@ $lang = array(
'spellLearn' => "You will learn", // REWARD_SPELL
'bonusTalents' => "%d talent |4point:points;", // partly LEVEL_UP_CHAR_POINTS
'spellDisplayed'=> ' (<a href="?spell=%d">%s</a> is displayed)',
'attachment' => "Attachment",
'questInfo' => array(
0 => "Normal", 1 => "Group", 21 => "Life", 41 => "PvP", 62 => "Raid", 81 => "Dungeon", 82 => "World Event",
83 => "Legendary", 84 => "Escort", 85 => "Heroic", 88 => "Raid (10)", 89 => "Raid (25)"
@@ -1159,6 +1156,16 @@ $lang = array(
"Narration Music", "Narration", 50 => "Zone Ambience", 52 => "Emitters", 53 => "Vehicles", 1000 => "My Playlist"
)
),
'mail' => array(
'notFound' => "This mail doesn't exist.",
'attachment' => "Attachment",
'mailDelivery' => 'You will receive <a href="?mail=%d">this letter</a>%s%s',
'mailBy' => ' by <a href="?npc=%d">%s</a>',
'mailIn' => " after %s",
'delay' => "Delay",
'sender' => "Sender",
'untitled' => "Untitled Mail"
),
'pet' => array(
'notFound' => "This pet family doesn't exist.",
'exotic' => "Exotic",

View File

@@ -236,6 +236,8 @@ $lang = array(
'items' => "Objetos",
'itemset' => "conjunto de objetos",
'itemsets' => "Conjuntos de objetos",
'mail' => "mail",
'mails' => "Mails",
'mechanic' => "Mecanica",
'mechAbbr' => "Mec.",
'meetingStone' => "Roca de encuentro",
@@ -783,9 +785,8 @@ $lang = array(
'comments' => "Comentarios",
'screenshots' => "Capturas de pantalla",
'videos' => "Vídeos",
'posts' => "Mensajes en los foros"
),
'mail' => array(
'posts' => "Mensajes en los foros",
// user mail
'tokenExpires' => "Este token expira en %s",
'accConfirm' => ["Confirmación de Cuenta", "Bienvenido a ".CFG_NAME_SHORT."!\r\n\r\nHaga click en el enlace siguiente para activar su cuenta.\r\n\r\n".HOST_URL."?account=signup&token=%s\r\n\r\nSi usted no solicitó este correo, por favor ignorelo."],
'recoverUser' => ["Recuperacion de Usuario", "Siga a este enlace para ingresar.\r\n\r\n".HOST_URL."?account=signin&token=%s\r\n\r\nSi usted no solicitó este correo, por favor ignorelo."],
@@ -1028,9 +1029,6 @@ $lang = array(
'enabledByQDesc'=> "Para aceptar esta misión debes haber tener activa alguna de estas misiones",
'gainsDesc' => "Cuando completes esta misión ganarás",
'theTitle' => 'el título "%s"',
'mailDelivery' => "Usted recibirá esta carta%s%s",
'mailBy' => ' del <a href="?npc=%d">%s</a>',
'mailIn' => " después de %s",
'unavailable' => "Esta misión fue marcada como obsoleta y no puede ser obtenida o completada.",
'experience' => "experiencia",
'expConvert' => "(o %s si se completa al nivel %d)",
@@ -1042,7 +1040,6 @@ $lang = array(
'spellLearn' => "Aprenderás",
'bonusTalents' => "%d |4punto:puntos; de talento",
'spellDisplayed'=> ' (mostrando <a href="?spell=%d">%s</a>)',
'attachment' => "Adjunto",
'questInfo' => array(
0 => "Normal", 1 => "Élite", 21 => "Vida", 41 => "JcJ", 62 => "Banda", 81 => "Mazmorra", 82 => "Evento del mundo",
83 => "Legendaria", 84 => "Escolta", 85 => "Heroica", 88 => "Banda (10)", 89 => "Banda (25)"
@@ -1159,6 +1156,16 @@ $lang = array(
"Narration Music", "Narration", 50 => "Zone Ambience", 52 => "Emitters", 53 => "Vehicles", 1000 => "Mi Lista de Reproducción"
)
),
'mail' => array(
'notFound' => "This mail doesn't exist.",
'attachment' => "Adjunto",
'mailDelivery' => "Usted recibirá esta carta%s%s",
'mailBy' => ' del <a href="?npc=%d">%s</a>',
'mailIn' => " después de %s",
'delay' => "Delay",
'sender' => "Sender",
'untitled' => "Untitled Mail"
),
'pet' => array(
'notFound' => "Esta familia de mascotas no existe.",
'exotic' => "Exótica",

View File

@@ -236,6 +236,8 @@ $lang = array(
'items' => "Objets",
'itemset' => "ensemble d'objets",
'itemsets' => "Ensembles d'objets",
'mail' => "mail",
'mails' => "Mails",
'mechanic' => "Mécanique",
'mechAbbr' => "Mécan.",
'meetingStone' => "Pierre de rencontre",
@@ -783,9 +785,8 @@ $lang = array(
'comments' => "Commentaires",
'screenshots' => "Captures d'écran",
'videos' => "Vidéos",
'posts' => "Messages sur le forum"
),
'mail' => array(
'posts' => "Messages sur le forum",
// user mail
'tokenExpires' => "This token expires in %s.",
'accConfirm' => ["Activation de compte", "Bienvenue sur ".CFG_NAME_SHORT."!\r\n\r\nCliquez sur le lien ci-dessous pour activer votre compte.\r\n\r\n".HOST_URL."?account=signup&token=%s\r\n\r\nSi vous n'avez pas demandé cet email, ignorez le."],
'recoverUser' => ["Récupération d'utilisateur", "Suivez ce lien pour vous connecter.\r\n\r\n".HOST_URL."?account=signin&token=%s\r\n\r\nSi vous n'avez pas demandé cet email, ignorez le."],
@@ -1028,9 +1029,6 @@ $lang = array(
'enabledByQDesc'=> "Vous pouvez faire cette quête seulement quand cette quête est active",
'gainsDesc' => "Lors de l'achèvement de cette quête vous gagnerez",
'theTitle' => '"%s"', // empty on purpose!
'mailDelivery' => "Vous recevrez cette lettre%s%s",
'mailBy' => ' de <a href="?npc=%d">%s</a>',
'mailIn' => " après %s",
'unavailable' => "Cette quête est marquée comme obsolète et ne peut être obtenue ou accomplie.",
'experience' => "points d'expérience",
'expConvert' => "(ou %s si completé au niveau %d)",
@@ -1042,7 +1040,6 @@ $lang = array(
'spellLearn' => "Vous apprendrez",
'bonusTalents' => "%d |4point:points; de talent",
'spellDisplayed'=> ' (<a href="?spell=%d">%s</a> affichés)',
'attachment' => "[Attachment]",
'questInfo' => array(
0 => "Standard", 1 => "Groupe", 21 => "Vie", 41 => "JcJ", 62 => "Raid", 81 => "Donjon", 82 => "Évènement mondial",
83 => "Légendaire", 84 => "Escorte", 85 => "Héroïque", 88 => "Raid (10)", 89 => "Raid (25)"
@@ -1159,6 +1156,16 @@ $lang = array(
"Narration Music", "Narration", 50 => "Zone Ambience", 52 => "Emitters", 53 => "Vehicles", 1000 => "Ma playlist"
)
),
'mail' => array(
'notFound' => "This mail doesn't exist.",
'attachment' => "[Attachment]",
'mailDelivery' => "Vous recevrez cette lettre%s%s",
'mailBy' => ' de <a href="?npc=%d">%s</a>',
'mailIn' => " après %s",
'delay' => "Delay",
'sender' => "Sender",
'untitled' => "Untitled Mail"
),
'pet' => array(
'notFound' => "Cette famille de familiers n'existe pas.",
'exotic' => "Exotique",

View File

@@ -236,6 +236,8 @@ $lang = array(
'items' => "Предметы",
'itemset' => "комплект",
'itemsets' => "Комплекты",
'mail' => "mail",
'mails' => "Mails",
'mechanic' => "Механика",
'mechAbbr' => "Механика",
'meetingStone' => "Камень встреч",
@@ -783,9 +785,8 @@ $lang = array(
'comments' => "Комментарии",
'screenshots' => "Скриншоты",
'videos' => "Видео",
'posts' => "Сообщений на форумах"
),
'mail' => array(
'posts' => "Сообщений на форумах",
// user mail
'tokenExpires' => "This token expires in %s.",
'accConfirm' => ["Account Confirmation", "Welcome to ".CFG_NAME_SHORT."!\r\n\r\nClick the Link below to activate your account.\r\n\r\n".HOST_URL."?account=signup&token=%s\r\n\r\nIf you did not request this mail simply ignore it."],
'recoverUser' => ["User Recovery", "Follow this link to log in.\r\n\r\n".HOST_URL."?account=signin&token=%s\r\n\r\nIf you did not request this mail simply ignore it."],
@@ -1028,9 +1029,6 @@ $lang = array(
'enabledByQDesc'=> "Вы можете получить это задание, только когда эти задания доступны",
'gainsDesc' => "По завершении этого задания, вы получите",
'theTitle' => '"%s"', // empty on purpose!
'mailDelivery' => "Вы получите это письмо%s%s",
'mailBy' => ' от <a href="?npc=%d">%s</a>',
'mailIn' => " через %s",
'unavailable' => "пометили это задание как устаревшее — его нельзя получить или выполнить.",
'experience' => "опыта",
'expConvert' => "(или %s на %d-м уровне)",
@@ -1042,7 +1040,6 @@ $lang = array(
'spellLearn' => "Вы изучите",
'bonusTalents' => "%d |4очко талантов:очка талантов:очков талантов;",
'spellDisplayed'=> ' (показано: <a href="?spell=%d">%s</a>)',
'attachment' => "[Attachment]",
'questInfo' => array(
0 => "Обычный", 1 => "Группа", 21 => "Жизнь", 41 => "PvP", 62 => "Рейд", 81 => "Подземелье", 82 => "Игровое событие",
83 => "Легенда", 84 => "Сопровождение", 85 => "Героическое", 88 => "Рейд (10)", 89 => "Рейд (25)"
@@ -1159,6 +1156,16 @@ $lang = array(
"Narration Music", "Narration", 50 => "Zone Ambience", 52 => "Emitters", 53 => "Vehicles", 1000 => "Мой плейлист"
)
),
'mail' => array(
'notFound' => "This mail doesn't exist.",
'attachment' => "[Attachment]",
'mailDelivery' => "Вы получите это письмо%s%s",
'mailBy' => ' от <a href="?npc=%d">%s</a>',
'mailIn' => " через %s",
'delay' => "Delay",
'sender' => "Sender",
'untitled' => "Untitled Mail"
),
'pet' => array(
'notFound' => "Такой породы питомцев не существует.",
'exotic' => "Экзотический",

View File

@@ -236,6 +236,8 @@ $lang = array(
'items' => "物品",
'itemset' => "套装",
'itemsets' => "套装",
'mail' => "mail",
'mails' => "Mails",
'mechanic' => "机制",
'mechAbbr' => "机制",
'meetingStone' => "集合石",
@@ -783,9 +785,8 @@ $lang = array(
'comments' => "评论",
'screenshots' => "截图",
'videos' => "视频",
'posts' => "Forum posts"
),
'mail' => array(
'posts' => "Forum posts",
// user mail
'tokenExpires' => "此令牌将在%s过期。",
'accConfirm' => ["Account Confirmation", "Welcome to ".CFG_NAME_SHORT."!\r\n\r\nClick the Link below to activate your account.\r\n\r\n".HOST_URL."?account=signup&token=%s\r\n\r\nIf you did not request this mail simply ignore it."],
'recoverUser' => ["User Recovery", "Follow this link to log in.\r\n\r\n".HOST_URL."?account=signin&token=%s\r\n\r\nIf you did not request this mail simply ignore it."],
@@ -1028,9 +1029,6 @@ $lang = array(
'enabledByQDesc'=> "只有当这些任务中的一个活跃时,这个任务才可用",
'gainsDesc' => "完成这个任务后,你将获得",
'theTitle' => '头衔 "%s"',
'mailDelivery' => "你会收到这封信%s%s",
'mailBy' => '由<a href="?npc=%d">%s</a>所写',
'mailIn' => " after %s",
'unavailable' => "这项任务已被标记为过时,无法获得或完成。",
'experience' => "经验",
'expConvert' => "(或%s如果在等级%d完成",
@@ -1042,7 +1040,6 @@ $lang = array(
'spellLearn' => "你将学会",
'bonusTalents' => "%d天赋|4点数:点数;",
'spellDisplayed'=> ' (<a href="?spell=%d">%s</a> is displayed)',
'attachment' => "附件",
'questInfo' => array(
0 => "普通", 1 => "组队", 21 => "职业", 41 => "PvP", 62 => "团队", 81 => "地下城", 82 => "世界事件",
83 => "传说", 84 => "护送", 85 => "英雄", 88 => "团队10", 89 => "团队25"
@@ -1159,6 +1156,16 @@ $lang = array(
"叙事音乐", "叙事", 50 => "区域气氛", 52 => "发射器", 53 => "载具", 1000 => "我的播放列表"
)
),
'mail' => array(
'notFound' => "This mail doesn't exist.",
'attachment' => "附件",
'mailDelivery' => 'You will receive <a href="?mail=%d">this letter</a>%s%s', // "你会收到这封信%s%s",
'mailBy' => '由<a href="?npc=%d">%s</a>所写',
'mailIn' => " after %s",
'delay' => "Delay",
'sender' => "Sender",
'untitled' => "Untitled Mail"
),
'pet' => array(
'notFound' => "这个宠物家族不存在。",
'exotic' => "异域的",