Areatrigger/Names

* fix unnamed areatrigger after fetching them from DB and not clientside
Mail/Names
 * fix unnamed mails after fetching them from DB and not clientside
This commit is contained in:
Sarjuuk
2020-02-24 01:46:50 +01:00
parent 3ff855afe8
commit aa66a7644b
12 changed files with 23 additions and 21 deletions

View File

@@ -18,6 +18,15 @@ class AreaTriggerList extends BaseType
's' => ['j' => ['?_spawns s ON s.type = 503 AND s.typeId = a.id', true], 's' => ', s.areaId']
);
public function __construct($conditions)
{
parent::__construct($conditions);
foreach ($this->iterate() as $id => &$_curTpl)
if (!$_curTpl['name'])
$_curTpl['name'] = 'Unnamed Areatrigger #' . $id;
}
public function getListviewData()
{
$data = [];

View File

@@ -21,9 +21,14 @@ class MailList extends BaseType
return;
// post processing
foreach ($this->iterate() as &$_curTpl)
foreach ($this->iterate() as $_id => &$_curTpl)
{
$_curTpl['name'] = Util::localizedString($_curTpl, 'subject', true);
if (!$_curTpl['name'])
{
$_curTpl['name'] = sprintf(Lang::mail('untitled'), $_id);
$_curTpl['subject_loc0'] = $_curTpl['name'];
}
}
}

View File

@@ -1164,7 +1164,7 @@ $lang = array(
'mailIn' => " nach %s",
'delay' => "Verzögerung",
'sender' => "Absender",
'untitled' => "Unbetitelter Brief"
'untitled' => "Unbetitelter Brief #%d"
),
'pet' => array(
'notFound' => "Diese Tierart existiert nicht.",

View File

@@ -1164,7 +1164,7 @@ $lang = array(
'mailIn' => " after %s",
'delay' => "Delay",
'sender' => "Sender",
'untitled' => "Untitled Mail"
'untitled' => "Untitled Mail #%d"
),
'pet' => array(
'notFound' => "This pet family doesn't exist.",

View File

@@ -1164,7 +1164,7 @@ $lang = array(
'mailIn' => " después de %s",
'delay' => "Delay",
'sender' => "Sender",
'untitled' => "Untitled Mail"
'untitled' => "Untitled Mail #%d"
),
'pet' => array(
'notFound' => "Esta familia de mascotas no existe.",

View File

@@ -1164,7 +1164,7 @@ $lang = array(
'mailIn' => " après %s",
'delay' => "Delay",
'sender' => "Sender",
'untitled' => "Untitled Mail"
'untitled' => "Untitled Mail #%d"
),
'pet' => array(
'notFound' => "Cette famille de familiers n'existe pas.",

View File

@@ -1164,7 +1164,7 @@ $lang = array(
'mailIn' => " через %s",
'delay' => "Delay",
'sender' => "Sender",
'untitled' => "Untitled Mail"
'untitled' => "Untitled Mail #%d"
),
'pet' => array(
'notFound' => "Такой породы питомцев не существует.",

View File

@@ -1164,7 +1164,7 @@ $lang = array(
'mailIn' => " after %s",
'delay' => "Delay",
'sender' => "Sender",
'untitled' => "Untitled Mail"
'untitled' => "Untitled Mail #%d"
),
'pet' => array(
'notFound' => "这个宠物家族不存在。",

View File

@@ -30,9 +30,7 @@ class MailPage extends GenericPage
$this->extendGlobalData($this->subject->getJSGlobals());
$this->name = Util::ucFirst($this->subject->getField('subject', true));
if (!$this->name)
$this->name = Lang::mail('untitled');
$this->name = Util::ucFirst($this->subject->getField('name', true));
}
protected function generateContent()

View File

@@ -384,12 +384,10 @@ class ZonePage extends GenericPage
if (!$tpl)
continue;
$n = Util::localizedString($tpl, 'name');
$addToSOM('areatrigger', array(
'coords' => [[$spawn['posX'], $spawn['posY']]],
'level' => $spawn['floor'],
'name' => $tpl['name'] ?: 'Unnamed AT #'.$spawn['typeId'],
'name' => Util::localizedString($tpl, 'name', true, true),
'type' => TYPE_AREATRIGGER,
'id' => $spawn['typeId'],
'description' => 'Type: '.Lang::areatrigger('types', $tpl['type'])

View File

@@ -27,10 +27,6 @@ Listview.templates.areatrigger = {
var a = $WH.ce('a');
a.style.fontFamily = 'Verdana, sans-serif';
a.href = this.getItemLink(areatrigger);
if (!areatrigger.name){
areatrigger.name = 'Unnamed Areatrigger'
a.className = 'q0';
}
$WH.ae(a, $WH.ct(areatrigger.name));
$WH.ae(wrapper, a);

View File

@@ -27,10 +27,6 @@ Listview.templates.mail = {
var a = $WH.ce('a');
a.style.fontFamily = 'Verdana, sans-serif';
a.href = this.getItemLink(mail);
if (!mail.subject){
mail.subject = 'Untitled Mail'
a.className = 'q0';
}
$WH.ae(a, $WH.ct(mail.subject));
$WH.ae(wrapper, a);