|
10 | 10 |
|
11 | 11 | class Channel extends Element |
12 | 12 | { |
13 | | - private $xmlVersion = "1.0"; |
| 13 | + // private $xmlVersion = "1.0"; |
14 | 14 | private $rssVersion = "2.0"; |
15 | 15 |
|
16 | 16 | private $title = ""; |
17 | 17 | private $link = ""; |
18 | 18 | private $description = ""; |
19 | | - private $otherChannelMeta = []; |
| 19 | + // private $content = []; |
| 20 | + // private $otherChannelMeta = []; |
20 | 21 |
|
21 | 22 | private $language = ""; |
22 | 23 |
|
@@ -68,67 +69,22 @@ public function unfold(): string |
68 | 69 | Element::description($this->description) |
69 | 70 | ]); |
70 | 71 |
|
71 | | - Shoop::dictionary($this->otherChannelMeta)->each( |
72 | | - function($value, $element) use (&$content) { |
73 | | - $content = $content->plus(Element::fold($element, $value)); |
74 | | - }); |
| 72 | + // Shoop::dictionary($this->otherChannelMeta)->each( |
| 73 | + // function($value, $element) use (&$content) { |
| 74 | + // $content = $content->plus(Element::fold($element, $value)); |
| 75 | + // }); |
75 | 76 |
|
76 | 77 | return Shoop::string( |
77 | 78 | Element::rss( |
78 | | - Element::channel(...$content) |
| 79 | + Element::channel( |
| 80 | + ...Shoop::array($this->content) |
| 81 | + ->each(function($item) { |
| 82 | + dd($item->unfold()); |
| 83 | + return $item->unfold(); |
| 84 | + }) |
| 85 | + ) |
79 | 86 | )->attr("version ". $this->rssVersion)->unfold() |
80 | 87 | )->start('<?xml version="'. $this->xmlVersion .'"?>'."\n")->unfold(); |
81 | | - |
82 | | - // return Shoop::string( |
83 | | - // Element::fold("rss", |
84 | | - // Element::fold("channel", |
85 | | - // Element::fold("title", static::rssTitle()), |
86 | | - // Element::fold("link", static::rssLink()), |
87 | | - // Element::fold("description", static::rssDescription()), |
88 | | - // Element::fold("language", "en-us"), |
89 | | - // Element::fold("copyright", static::copyright()->unfold()), |
90 | | - // ...static::rssItemsStoreItems()->each(function($path) { |
91 | | - // $markdown = static::uriContentStore($path)->markdown(); |
92 | | - |
93 | | - // $title = $markdown->meta()->title; |
94 | | - // $link = Shoop::string(static::rssLink()) |
95 | | - // ->plus($path)->unfold(); |
96 | | - |
97 | | - // $description = ($markdown->meta()->description === null) |
98 | | - // ? $markdown->html() |
99 | | - // : $markdown->meta()->description(); |
100 | | - // if ($description->count()->isUnfolded(0)) { |
101 | | - // return ""; |
102 | | - // } |
103 | | - // $description = $description->replace(static::rssDescriptionReplacements()) |
104 | | - // ->dropTags()->divide(" ")->isGreaterThan(50, function($result, $description) { |
105 | | - // return ($result) |
106 | | - // ? $description->first(50)->join(" ")->plus("...") |
107 | | - // : $description->join(" "); |
108 | | - // }); |
109 | | - |
110 | | - // $timestamp = ($markdown->meta()->created === null) |
111 | | - // ? "" |
112 | | - // : Carbon::createFromFormat("Ymd", $markdown->meta()->created, "America/Detroit") |
113 | | - // ->hour(12) |
114 | | - // ->minute(0) |
115 | | - // ->second(0) |
116 | | - // ->toRssString(); |
117 | | - // $t = (strlen($timestamp) > 0) |
118 | | - // ? Element::fold("pubDate", $timestamp) |
119 | | - // : ""; |
120 | | - |
121 | | - // $item = Element::fold( |
122 | | - // "item", |
123 | | - // Element::fold("title", htmlspecialchars($title)), |
124 | | - // Element::fold("link", $link), |
125 | | - // Element::fold("guid", $link), |
126 | | - // Element::fold("description", htmlspecialchars($description)), |
127 | | - // $t |
128 | | - // ); |
129 | | - // return $item; |
130 | | - // })->noEmpties() |
131 | | - // ) |
132 | 88 | } |
133 | 89 |
|
134 | 90 | /** |
|
0 commit comments