From 26c074ed7e4e2881e91a014fc40a8f2d0115a632 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 6 Dec 2018 16:35:57 +0300 Subject: rework article header to use flexbox --- classes/article.php | 104 ++++++++++++++++++++++++++++------------------------ 1 file changed, 57 insertions(+), 47 deletions(-) (limited to 'classes/article.php') diff --git a/classes/article.php b/classes/article.php index 59830027b..4b18280d4 100755 --- a/classes/article.php +++ b/classes/article.php @@ -627,7 +627,8 @@ class Article extends Handler_Protected { } else { if ($line["comments"] && $line["link"] != $line["comments"]) { - $entry_comments = "".__("comments").""; + $entry_comments = "".__("comments").""; } } @@ -676,54 +677,56 @@ class Article extends Handler_Protected { $rv['content'] .= ""; } - $rv['content'] .= ""; + $rv['content'] .= ""; } - $rv['content'] .= "
"; + $rv['content'] .= "
"; - $rv['content'] .= "
"; + /* header */ - $entry_author = $line["author"]; - - if ($entry_author) { - $entry_author = __(" - ") . $entry_author; - } + $rv['content'] .= "
"; + $rv['content'] .= "
"; # row + //$entry_author = $line["author"] ? " - " . $line["author"] : ""; $parsed_updated = make_local_datetime($line["updated"], true, $owner_uid, true); - if (!$zoom_mode) - $rv['content'] .= "
$parsed_updated
"; - if ($line["link"]) { $rv['content'] .= "
" . - $line["title"] . "" . - "$entry_author
"; + href=\"" .htmlspecialchars($line["link"]) . "\">" . $line["title"] . "
"; } else { - $rv['content'] .= "
" . $line["title"] . "$entry_author
"; + $rv['content'] .= "
" . $line["title"] . "
"; } - if ($zoom_mode) { - $feed_title = htmlspecialchars($line["feed_title"]); + if (!$zoom_mode) + $rv['content'] .= "
$parsed_updated
"; - $rv['content'] .= "
$feed_title
"; + $rv['content'] .= "
"; # row - $rv['content'] .= "
$parsed_updated
"; + $rv['content'] .= "
"; # row + + /* left buttons */ + + $rv['content'] .= "
"; + foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_ARTICLE_LEFT_BUTTON) as $p) { + $rv['content'] .= $p->hook_article_left_button($line); } + $rv['content'] .= "
"; + + /* comments */ + + $rv['content'] .= "
$entry_comments
"; + $rv['content'] .= "
".$line['author']."
"; + + /* tags */ $tags_str = Article::format_tags_string($line["tags"], $id); $tags_str_full = join(", ", $line["tags"]); if (!$tags_str_full) $tags_str_full = __("no tags"); - if (!$entry_comments) $entry_comments = " "; # placeholder - - $rv['content'] .= "
- Tags "; + $rv['content'] .= "label_outline
"; if (!$zoom_mode) { $rv['content'] .= "$tags_str @@ -734,22 +737,39 @@ class Article extends Handler_Protected { id=\"ATSTRTIP-$id\" connectId=\"ATSTR-$id\" position=\"below\">$tags_str_full
"; - foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_ARTICLE_BUTTON) as $p) { - $rv['content'] .= $p->hook_article_button($line); - } - } else { $tags_str = strip_tags($tags_str); $rv['content'] .= "$tags_str"; } + $rv['content'] .= "
"; - $rv['content'] .= "
"; - foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_ARTICLE_LEFT_BUTTON) as $p) { - $rv['content'] .= $p->hook_article_left_button($line); + /* buttons */ + + $rv['content'] .= "
"; + foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_ARTICLE_BUTTON) as $p) { + $rv['content'] .= $p->hook_article_button($line); + } + $rv['content'] .= "
"; + + $rv['content'] .= "
"; # row + + $rv['content'] .= "
"; # header + + /* note */ + + $rv['content'] .= "
"; + if ($line['note']) { + $rv['content'] .= Article::format_article_note($id, $line['note'], !$zoom_mode); } + $rv['content'] .= "
"; + + /* content */ + + $lang = $line['lang'] ? $line['lang'] : "en"; + $rv['content'] .= "
"; - $rv['content'] .= "$entry_comments
"; + /* originally from */ if ($line["orig_feed_id"]) { @@ -776,17 +796,7 @@ class Article extends Handler_Protected { } } - $rv['content'] .= "
"; - - $rv['content'] .= "
"; - if ($line['note']) { - $rv['content'] .= Article::format_article_note($id, $line['note'], !$zoom_mode); - } - $rv['content'] .= "
"; - - if (!$line['lang']) $line['lang'] = 'en'; - - $rv['content'] .= "
"; + /* content body */ $rv['content'] .= $line["content"]; @@ -797,9 +807,9 @@ class Article extends Handler_Protected { $line["hide_images"]); } - $rv['content'] .= "
"; + $rv['content'] .= "
"; # content - $rv['content'] .= "
"; + $rv['content'] .= ""; # post } -- cgit v1.2.3