Future/Frontend

* create php classes, each mirroring a js object
 * each frontend class implements __toString and json_serialize and as such can be directly used by the template
 * also allows for sane object creation before js screams in agony

 * usage TBD
This commit is contained in:
Sarjuuk
2025-07-26 23:47:41 +02:00
parent 58412e0491
commit bffdb9672e
17 changed files with 1075 additions and 159 deletions

View File

@@ -198,7 +198,7 @@ class CommunityContent
foreach ($results as $r)
{
(new Markup($r['body']))->parseGlobalsFromText(self::$jsGlobals);
Markup::parseTags($r['body'], self::$jsGlobals);
$reply = array(
'commentid' => $commentId,
@@ -359,7 +359,7 @@ class CommunityContent
$i = 0;
foreach ($results as $r)
{
(new Markup($r['body']))->parseGlobalsFromText(self::$jsGlobals);
Markup::parseTags($r['body'], self::$jsGlobals);
self::$jsGlobals[Type::USER][$r['userId']] = $r['userId'];
@@ -384,7 +384,7 @@ class CommunityContent
$c['responseroles'] = $r['responseRoles'];
$c['responseuser'] = $r['responseUser'];
(new Markup($r['responseBody']))->parseGlobalsFromText(self::$jsGlobals);
Markup::parseTags($r['responseBody'], self::$jsGlobals);
}
if ($r['editCount']) // lastEdit