aboutsummaryrefslogtreecommitdiff
path: root/ratatoeskr/frontend.php
diff options
context:
space:
mode:
authorKevin Chabowski <kevin@kch42.de>2011-12-27 13:35:09 +0100
committerKevin Chabowski <kevin@kch42.de>2011-12-27 13:35:09 +0100
commita2ee929485e2a55492cbc161b4270038099b26f8 (patch)
tree85da3c19a6dba358f95a7e13b8bcbc77eab435fe /ratatoeskr/frontend.php
parentcf2a4a79eb8344ab1c3303d4bdbb80c91d94925b (diff)
downloadratatoeskr-cms-a2ee929485e2a55492cbc161b4270038099b26f8.tar.gz
ratatoeskr-cms-a2ee929485e2a55492cbc161b4270038099b26f8.tar.bz2
ratatoeskr-cms-a2ee929485e2a55492cbc161b4270038099b26f8.zip
Article now has get/set_tags() and get/set_section()
Diffstat (limited to 'ratatoeskr/frontend.php')
-rw-r--r--ratatoeskr/frontend.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/ratatoeskr/frontend.php b/ratatoeskr/frontend.php
index 92197f5..142915c 100644
--- a/ratatoeskr/frontend.php
+++ b/ratatoeskr/frontend.php
@@ -89,21 +89,22 @@ function article_transform_ste($article, $lang)
global $rel_path_to_root;
$languages = array();
+ $a_section = $article->get_section();
foreach($article->title as $language => $_)
- $languages[$language] = "$rel_path_to_root/$language/{$article->section->name}/{$article->urlname}";
+ $languages[$language] = "$rel_path_to_root/$language/{$a_section->name}/{$article->urlname}";
return array(
"id" => $article->get_id(),
"urlname" => $article->urlname,
- "fullurl" => htmlesc("$rel_path_to_root/$lang/{$article->section->name}/{$article->urlname}"),
+ "fullurl" => htmlesc("$rel_path_to_root/$lang/{$a_section->name}/{$article->urlname}"),
"title" => htmlesc($article->title[$lang]->text),
"text" => textprocessor_apply(str_replace("%root%", $rel_path_to_root, $article->text[$lang]->text), $article->text[$lang]->texttype),
"excerpt" => textprocessor_apply(str_replace("%root%", $rel_path_to_root, $article->excerpt[$lang]->text), $article->excerpt[$lang]->texttype),
"custom" => $article->custom,
"status" => $article->status,
- "section" => section_transform_ste($article->section, $lang),
+ "section" => section_transform_ste($a_section, $lang),
"timestamp" => $article->timestamp,
- "tags" => array_map(function($tag) use ($lang) { return tag_transform_ste($tag, $lang); }, $article->tags),
+ "tags" => array_map(function($tag) use ($lang) { return tag_transform_ste($tag, $lang); }, $article->get_tags()),
"languages" => $languages,
"comments_allowed" => $article->comments_allowed
);
@@ -181,12 +182,14 @@ $ste->register_tag("articles_get", function($ste, $params, $sub)
$result = Article::by_multi($params);
+ /*
+ FIXME:
if(isset($params["tag"]))
{
if(!isset($result))
$result = Article::all();
$result = array_filter($result, function($article) use ($params) { return isset($article->tags[$params["tag"]]); });
- }
+ }*/
/* Now filter out the articles, where the current language does not exist */
$result = array_filter($result, function($article) use ($lang) { return isset($article->title[$lang]); });