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
{
/*
match ($this->show)
{
self::SHOW_NEW => $this->displayNew(),
@@ -156,24 +155,6 @@ class GuidePage extends GenericPage
self::SHOW_CHANGELOG => $this->displayChangelog(),
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

View File

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

View File

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