|
|
@@ -21,7 +21,9 @@ class FreshRSS_UserQuery {
|
|
|
private string $token = '';
|
|
|
private bool $shareRss = false;
|
|
|
private bool $shareOpml = false;
|
|
|
- private bool $publishLabelsInsteadOfTags = false;
|
|
|
+ private bool $includeUserLabels = false;
|
|
|
+ private bool $excludeArticleTags = false;
|
|
|
+ private string $userLabelPrefix = '';
|
|
|
/** @var array<int,FreshRSS_Category> $categories where the key is the category ID */
|
|
|
private array $categories;
|
|
|
/** @var array<int,FreshRSS_Tag> $labels where the key is the label ID */
|
|
|
@@ -44,7 +46,8 @@ class FreshRSS_UserQuery {
|
|
|
|
|
|
/**
|
|
|
* @param array{get?:string,name?:string,order?:string,search?:string,state?:int,url?:string,token?:string,
|
|
|
- * shareRss?:bool,shareOpml?:bool,publishLabelsInsteadOfTags?:bool,description?:string,imageUrl?:string} $query
|
|
|
+ * shareRss?:bool,shareOpml?:bool,includeUserLabels?:bool,excludeArticleTags?:bool,userLabelPrefix?:string,
|
|
|
+ * publishLabelsInsteadOfTags?:bool,description?:string,imageUrl?:string} $query
|
|
|
* @param array<FreshRSS_Category> $categories
|
|
|
* @param array<FreshRSS_Tag> $labels
|
|
|
*/
|
|
|
@@ -76,6 +79,9 @@ class FreshRSS_UserQuery {
|
|
|
unset($link['name']);
|
|
|
unset($link['shareOpml']);
|
|
|
unset($link['shareRss']);
|
|
|
+ unset($link['includeUserLabels']);
|
|
|
+ unset($link['excludeArticleTags']);
|
|
|
+ unset($link['userLabelPrefix']);
|
|
|
unset($link['publishLabelsInsteadOfTags']);
|
|
|
$this->url = Minz_Url::display(['params' => $link]);
|
|
|
}
|
|
|
@@ -94,9 +100,24 @@ class FreshRSS_UserQuery {
|
|
|
if (isset($query['shareOpml'])) {
|
|
|
$this->shareOpml = $query['shareOpml'];
|
|
|
}
|
|
|
- if (isset($query['publishLabelsInsteadOfTags'])) {
|
|
|
- $this->publishLabelsInsteadOfTags = (bool)$query['publishLabelsInsteadOfTags'];
|
|
|
+
|
|
|
+ if (isset($query['publishLabelsInsteadOfTags'])) { // Legacy
|
|
|
+ $this->includeUserLabels = (bool)$query['publishLabelsInsteadOfTags'];
|
|
|
+ $this->excludeArticleTags = (bool)$query['publishLabelsInsteadOfTags'];
|
|
|
+ if ($this->includeUserLabels) {
|
|
|
+ $this->userLabelPrefix = '';
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (isset($query['includeUserLabels'])) {
|
|
|
+ $this->includeUserLabels = (bool)$query['includeUserLabels'];
|
|
|
+ }
|
|
|
+ if (isset($query['excludeArticleTags'])) {
|
|
|
+ $this->excludeArticleTags = (bool)$query['excludeArticleTags'];
|
|
|
}
|
|
|
+ if (isset($query['userLabelPrefix'])) {
|
|
|
+ $this->userLabelPrefix = (string)$query['userLabelPrefix'];
|
|
|
+ }
|
|
|
+
|
|
|
if (isset($query['description'])) {
|
|
|
$this->description = $query['description'];
|
|
|
}
|
|
|
@@ -116,7 +137,7 @@ class FreshRSS_UserQuery {
|
|
|
*
|
|
|
* @return array{get?:string,name?:string,order?:string,search?:string,
|
|
|
* state?:int,url?:string,token?:string,shareRss?:bool,shareOpml?:bool,
|
|
|
- * publishLabelsInsteadOfTags?:bool,description?:string,imageUrl?:string}
|
|
|
+ * includeUserLabels?:bool,excludeArticleTags?:bool,userLabelPrefix?:string,description?:string,imageUrl?:string}
|
|
|
*/
|
|
|
public function toArray(): array {
|
|
|
return array_filter([
|
|
|
@@ -129,7 +150,9 @@ class FreshRSS_UserQuery {
|
|
|
'token' => $this->token,
|
|
|
'shareRss' => $this->shareRss,
|
|
|
'shareOpml' => $this->shareOpml,
|
|
|
- 'publishLabelsInsteadOfTags' => $this->publishLabelsInsteadOfTags,
|
|
|
+ 'includeUserLabels' => $this->includeUserLabels,
|
|
|
+ 'excludeArticleTags' => $this->excludeArticleTags,
|
|
|
+ 'userLabelPrefix' => $this->userLabelPrefix,
|
|
|
'description' => $this->description,
|
|
|
'imageUrl' => $this->imageUrl,
|
|
|
], fn($v): bool => $v !== '' && $v !== 0 && $v !== false);
|
|
|
@@ -287,12 +310,28 @@ class FreshRSS_UserQuery {
|
|
|
return $this->shareOpml;
|
|
|
}
|
|
|
|
|
|
- public function setPublishLabelsInsteadOfTags(bool $publishLabelsInsteadOfTags): void {
|
|
|
- $this->publishLabelsInsteadOfTags = $publishLabelsInsteadOfTags;
|
|
|
+ public function setIncludeUserLabels(bool $includeUserLabels): void {
|
|
|
+ $this->includeUserLabels = $includeUserLabels;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function includeUserLabels(): bool {
|
|
|
+ return $this->includeUserLabels;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function setExcludeArticleTags(bool $excludeArticleTags): void {
|
|
|
+ $this->excludeArticleTags = $excludeArticleTags;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function excludeArticleTags(): bool {
|
|
|
+ return $this->excludeArticleTags;
|
|
|
+ }
|
|
|
+
|
|
|
+ public function setUserLabelPrefix(string $userLabelPrefix): void {
|
|
|
+ $this->userLabelPrefix = $userLabelPrefix;
|
|
|
}
|
|
|
|
|
|
- public function publishLabelsInsteadOfTags(): bool {
|
|
|
- return $this->publishLabelsInsteadOfTags;
|
|
|
+ public function userLabelPrefix(): string {
|
|
|
+ return $this->userLabelPrefix;
|
|
|
}
|
|
|
|
|
|
protected function sharedUrl(bool $xmlEscaped = true): string {
|