From 2ed58f814eab9c3bbdada6b8e2ebfccfc9395894 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Thu, 6 Jun 2024 02:44:38 +0800 Subject: add image and description to user query share (#6541) * add description to user queries and rss feed * add image url to user queries and rss feed * Fix i18n * remove itunes image tag and xml definition --------- Co-authored-by: Alexandre Alapetite --- app/Models/UserQuery.php | 26 ++++++++++++++++++++++++++ app/Models/View.php | 2 ++ 2 files changed, 28 insertions(+) (limited to 'app/Models') diff --git a/app/Models/UserQuery.php b/app/Models/UserQuery.php index 6f7996b07..73bf52ef8 100644 --- a/app/Models/UserQuery.php +++ b/app/Models/UserQuery.php @@ -25,6 +25,8 @@ class FreshRSS_UserQuery { private array $categories; /** @var array $labels */ private array $labels; + private string $description = ''; + private string $imageUrl = ''; public static function generateToken(string $salt): string { if (!FreshRSS_Context::hasSystemConf()) { @@ -77,6 +79,12 @@ class FreshRSS_UserQuery { if (isset($query['shareOpml'])) { $this->shareOpml = $query['shareOpml']; } + if (isset($query['description'])) { + $this->description = $query['description']; + } + if (isset($query['imageUrl'])) { + $this->imageUrl = $query['imageUrl']; + } // linked too deeply with the search object, need to use dependency injection $this->search = new FreshRSS_BooleanSearch($query['search'], 0, 'AND', false); @@ -101,6 +109,8 @@ class FreshRSS_UserQuery { 'token' => $this->token, 'shareRss' => $this->shareRss, 'shareOpml' => $this->shareOpml, + 'description' => $this->description, + 'imageUrl' => $this->imageUrl, ]); } @@ -282,4 +292,20 @@ class FreshRSS_UserQuery { } return ''; } + + public function getDescription(): string { + return $this->description; + } + + public function setDescription(string $description): void { + $this->description = $description; + } + + public function getImageUrl(): string { + return $this->imageUrl; + } + + public function setImageUrl(string $imageUrl): void { + $this->imageUrl = $imageUrl; + } } diff --git a/app/Models/View.php b/app/Models/View.php index 2595cd1fa..4823283d3 100644 --- a/app/Models/View.php +++ b/app/Models/View.php @@ -106,6 +106,8 @@ class FreshRSS_View extends Minz_View { public string $rss_url = ''; public string $rss_base = ''; public bool $internal_rendering = false; + public string $description; + public string $image_url; // Content preview public string $fatalError; -- cgit v1.2.3