move resources around
This commit is contained in:
parent
1da9fd81d9
commit
4417945078
@ -42,7 +42,7 @@ class Strings extends StringsBase
|
|||||||
* @return array<string,string|string[]>|StringsPack
|
* @return array<string,string|string[]>|StringsPack
|
||||||
*/
|
*/
|
||||||
public static function getStringsPack(string $name, bool $raw = false): array|StringsPack {
|
public static function getStringsPack(string $name, bool $raw = false): array|StringsPack {
|
||||||
$file = APP_ROOT.'/src/strings/'.$name.'.yaml';
|
$file = APP_ROOT.'/resources/strings/'.$name.'.yaml';
|
||||||
$data = yaml_parse_file($file);
|
$data = yaml_parse_file($file);
|
||||||
if ($data === false)
|
if ($data === false)
|
||||||
logError(__METHOD__.': yaml_parse_file failed on file '.$file);
|
logError(__METHOD__.': yaml_parse_file failed on file '.$file);
|
||||||
|
@ -8,7 +8,7 @@ use Twig\Loader\LoaderInterface;
|
|||||||
class ErrorSkin
|
class ErrorSkin
|
||||||
extends BaseSkin
|
extends BaseSkin
|
||||||
{
|
{
|
||||||
const string TEMPLATES_ROOT = APP_ROOT.'/src/skins/error';
|
const string TEMPLATES_ROOT = APP_ROOT.'/resources/skins/error';
|
||||||
|
|
||||||
protected function getTwigLoader(): LoaderInterface {
|
protected function getTwigLoader(): LoaderInterface {
|
||||||
return new FilesystemLoader(self::TEMPLATES_ROOT, APP_ROOT);
|
return new FilesystemLoader(self::TEMPLATES_ROOT, APP_ROOT);
|
||||||
|
@ -73,7 +73,7 @@ abstract class FeaturedSkin
|
|||||||
$h = $this->svgDefs[$name]['height'];
|
$h = $this->svgDefs[$name]['height'];
|
||||||
if ($in_place) {
|
if ($in_place) {
|
||||||
$svg = '<svg id="svgicon_'.$name.'" width="'.$w.'" height="'.$h.'" fill="currentColor" viewBox="0 0 '.$w.' '.$h.'">';
|
$svg = '<svg id="svgicon_'.$name.'" width="'.$w.'" height="'.$h.'" fill="currentColor" viewBox="0 0 '.$w.' '.$h.'">';
|
||||||
$svg .= file_get_contents(APP_ROOT.'/src/skins/svg/'.$name.'.svg');
|
$svg .= file_get_contents(APP_ROOT.'/resources/skins/svg/'.$name.'.svg');
|
||||||
$svg .= '</svg>';
|
$svg .= '</svg>';
|
||||||
return $svg;
|
return $svg;
|
||||||
} else {
|
} else {
|
||||||
@ -179,7 +179,7 @@ HTML;
|
|||||||
protected function getSVGTags(): string {
|
protected function getSVGTags(): string {
|
||||||
$buf = '<svg style="display: none">';
|
$buf = '<svg style="display: none">';
|
||||||
foreach ($this->svgDefs as $name => $icon) {
|
foreach ($this->svgDefs as $name => $icon) {
|
||||||
$content = file_get_contents(APP_ROOT.'/src/skins/svg/'.$name.'.svg');
|
$content = file_get_contents(APP_ROOT.'/resources/skins/svg/'.$name.'.svg');
|
||||||
$buf .= "<symbol id=\"svgicon_{$name}\" viewBox=\"0 0 {$icon['width']} {$icon['height']}\" fill=\"currentColor\">$content</symbol>";
|
$buf .= "<symbol id=\"svgicon_{$name}\" viewBox=\"0 0 {$icon['width']} {$icon['height']}\" fill=\"currentColor\">$content</symbol>";
|
||||||
}
|
}
|
||||||
$buf .= '</svg>';
|
$buf .= '</svg>';
|
||||||
|
@ -24,7 +24,7 @@ class MainHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function GET_books() {
|
public function GET_books() {
|
||||||
$html = MarkupUtil::markdownToHtml(file_get_contents(APP_ROOT.'/data/ic_books.md'));
|
$html = MarkupUtil::markdownToHtml(file_get_contents(APP_ROOT.'/resources/data/ic_books.md'));
|
||||||
$this->skin->title = lang('books');
|
$this->skin->title = lang('books');
|
||||||
$this->skin->options->headSection = 'books';
|
$this->skin->options->headSection = 'books';
|
||||||
$this->skin->set(['html' => $html]);;
|
$this->skin->set(['html' => $html]);;
|
||||||
|
@ -32,7 +32,7 @@ class ForeignOneSkin
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected function getTwigLoader(): LoaderInterface {
|
protected function getTwigLoader(): LoaderInterface {
|
||||||
$twig_loader = new FilesystemLoader(APP_ROOT.'/src/skins/foreignone', APP_ROOT);
|
$twig_loader = new FilesystemLoader(APP_ROOT.'/resources/skins/foreignone', APP_ROOT);
|
||||||
// $twig_loader->addPath(APP_ROOT.'/htdocs/svg', 'svg');
|
// $twig_loader->addPath(APP_ROOT.'/htdocs/svg', 'svg');
|
||||||
return $twig_loader;
|
return $twig_loader;
|
||||||
}
|
}
|
||||||
|
@ -31,8 +31,8 @@ class InvisibleCollegeSkin
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected function getTwigLoader(): LoaderInterface {
|
protected function getTwigLoader(): LoaderInterface {
|
||||||
$twig_loader = new FilesystemLoader(APP_ROOT.'/src/skins/ic', APP_ROOT);
|
$twig_loader = new FilesystemLoader(APP_ROOT.'/resources/skins/ic', APP_ROOT);
|
||||||
$twig_loader->addPath(APP_ROOT.'/src/skins/foreignone', 'foreignone');
|
$twig_loader->addPath(APP_ROOT.'/resources/skins/foreignone', 'foreignone');
|
||||||
return $twig_loader;
|
return $twig_loader;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ class TZO
|
|||||||
public static function getStrings(): array {
|
public static function getStrings(): array {
|
||||||
static $strings;
|
static $strings;
|
||||||
if ($strings === null)
|
if ($strings === null)
|
||||||
$strings = yaml_parse_file(APP_ROOT.'/data/tzo/info.yaml');
|
$strings = yaml_parse_file(APP_ROOT.'/resources/data/tzo/info.yaml');
|
||||||
return $strings;
|
return $strings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ class TZOPart
|
|||||||
if ($this->html !== null)
|
if ($this->html !== null)
|
||||||
return $this->html;
|
return $this->html;
|
||||||
|
|
||||||
$markdown_file = APP_ROOT.'/data/tzo/'.($this->appendix ? 'appendix' : $this->part).'.md';
|
$markdown_file = APP_ROOT.'/resources/data/tzo/'.($this->appendix ? 'appendix' : $this->part).'.md';
|
||||||
$md = file_get_contents($markdown_file);
|
$md = file_get_contents($markdown_file);
|
||||||
|
|
||||||
// images
|
// images
|
||||||
|
@ -30,7 +30,7 @@ class OmniaSkin
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected function getTwigLoader(): LoaderInterface {
|
protected function getTwigLoader(): LoaderInterface {
|
||||||
$twig_loader = new FilesystemLoader(APP_ROOT.'/src/skins/omnia', APP_ROOT);
|
$twig_loader = new FilesystemLoader(APP_ROOT.'/resources/skins/omnia', APP_ROOT);
|
||||||
return $twig_loader;
|
return $twig_loader;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user