Guides/Editor

* fix language selector
 * fix changelog
This commit is contained in:
Sarjuuk
2025-03-29 01:47:03 +01:00
parent ed25f1f5f5
commit b347794ce5
3 changed files with 7 additions and 24 deletions

View File

@@ -147,7 +147,6 @@ class GuidePage extends GenericPage
protected function generateContent() : void protected function generateContent() : void
{ {
/*
match ($this->show) match ($this->show)
{ {
self::SHOW_NEW => $this->displayNew(), self::SHOW_NEW => $this->displayNew(),
@@ -156,24 +155,6 @@ class GuidePage extends GenericPage
self::SHOW_CHANGELOG => $this->displayChangelog(), self::SHOW_CHANGELOG => $this->displayChangelog(),
default => trigger_error('GuidePage::generateContent - what content!?') default => trigger_error('GuidePage::generateContent - what content!?')
}; };
*/
switch ($this->show)
{
case self::SHOW_NEW:
$this->displayNew();
break;
case self::SHOW_EDITOR:
$this->displayEditor();
break;
case self::SHOW_GUIDE:
$this->displayGuide();
break;
case self::SHOW_CHANGELOG:
$this->displayChangelog();
break;
default:
trigger_error('GuidePage::generateContent - what content!?');
}
} }
private function displayNew() : void private function displayNew() : void

View File

@@ -53,9 +53,10 @@ $this->brick('pageTemplate');
<th><label for="locale"><?=Lang::main('language');?></label></th> <th><label for="locale"><?=Lang::main('language');?></label></th>
<td><select name="locale" id="locale" required="required" size="1"> <td><select name="locale" id="locale" required="required" size="1">
<?php <?php
foreach (Lang::locales() as $i => $l): foreach (Locale::cases() as $l):
if (Cfg::get('LOCALES') & (1 << $i)) if ($l->validate()):
echo ' <option value="'.$i.'"'.($this->editorFields('locale', true) == $i ? ' selected="selected"' : '').'>'.$l."</option>\n"; echo ' <option value="'.$l->value.'"'.($this->editorFields('locale', true) == $l->value ? ' selected="selected"' : '').'>'.$l->title()."</option>\n";
endif;
endforeach; endforeach;
?> ?>
</select></td> </select></td>
@@ -68,8 +69,9 @@ endforeach;
<select id="category" name="category" required="required"><option></option> <select id="category" name="category" required="required"><option></option>
<?php <?php
foreach (Lang::guide('category') as $i => $c): foreach (Lang::guide('category') as $i => $c):
if ($c) if ($c):
echo ' <option value="'.$i.'"'.($this->editorFields('category', true) == $i ? ' selected="selected"' : '').'>'.$c."</option>\n"; echo ' <option value="'.$i.'"'.($this->editorFields('category', true) == $i ? ' selected="selected"' : '').'>'.$c."</option>\n";
endif;
endforeach; endforeach;
?> ?>
</select> </select>

View File

@@ -9,7 +9,7 @@ $this->brick('announcement');
$this->brick('pageTemplate'); $this->brick('pageTemplate');
if (isset($this->notFound)): if ($this->notFound):
?> ?>
<?php <?php
if (!empty($this->doResync)): if (!empty($this->doResync)):