aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ratatoeskr/backend.php16
-rw-r--r--ratatoeskr/templates/src/systemtemplates/content_write.html2
2 files changed, 10 insertions, 8 deletions
diff --git a/ratatoeskr/backend.php b/ratatoeskr/backend.php
index 469d966..0f010d1 100644
--- a/ratatoeskr/backend.php
+++ b/ratatoeskr/backend.php
@@ -220,7 +220,7 @@ $backend_subactions = url_action_subactions(array(
try
{
- $inputs["section"] = Section::by_name($_POST["section"]);
+ $inputs["article_section"] = Section::by_name($_POST["section"]);
}
catch(DoesNotExistError $e)
{
@@ -244,17 +244,13 @@ $backend_subactions = url_action_subactions(array(
$article->text [$editlang] = new Translation($inputs["content"], $inputs["content_txtproc"]);
$article->excerpt[$editlang] = new Translation($inputs["excerpt"], $inputs["excerpt_txtproc"]);
$article->set_tags(maketags($inputs["tags"], $editlang));
- $article->set_section($inputs["section"]);
+ $article->set_section($inputs["article_section"]);
}
if(empty($article))
{
/* New Article */
$ste->vars["pagetitle"] = $translation["new_article"];
- $inputs = array(
- "date" => time(),
- "article_status" => ARTICLE_STATUS_LIVE
- );
if(empty($fail_reasons) and isset($_POST["save_article"]))
{
$article = Article::create($inputs["urlname"]);
@@ -307,7 +303,6 @@ $backend_subactions = url_action_subactions(array(
foreach(array(
"urlname" => "urlname",
- "section" => "article_section",
"status" => "article_status",
"timestamp" => "date",
"allow_comments" => "allow_comments"
@@ -330,6 +325,8 @@ $backend_subactions = url_action_subactions(array(
$inputs["excerpt"] = $translation_obj->text;
$inputs["excerpt_txtproc"] = $translation_obj->texttype;
}
+ if(!isset($inputs["article_section"]))
+ $inputs["article_section"] = $article->get_section();
if(!isset($inputs["tags"]))
$inputs["tags"] = array_map(function($tag) use ($editlang) { return $tag->name; }, $article->get_tags());
$ste->vars["morelangs"] = array();
@@ -341,6 +338,11 @@ $backend_subactions = url_action_subactions(array(
}
}
+ if(!isset($inputs["date"]))
+ $inputs["date"] = time();
+ if(!isset($inputs["article_status"]))
+ $inputs["article_status"] = ARTICLE_STATUS_LIVE;
+
/* Push data back to template */
if(isset($inputs["tags"]))
$ste->vars["tags"] = implode(", ", $inputs["tags"]);
diff --git a/ratatoeskr/templates/src/systemtemplates/content_write.html b/ratatoeskr/templates/src/systemtemplates/content_write.html
index 063fad1..a996a5b 100644
--- a/ratatoeskr/templates/src/systemtemplates/content_write.html
+++ b/ratatoeskr/templates/src/systemtemplates/content_write.html
@@ -33,7 +33,7 @@
<ste:get_translation for="article_section" />:
<select name="section" class="fullwidth">
<ste:foreach array="sections" value="section_name">
- <option name="<ste:escape>$section_name</ste:escape>"?{~{$section_name|eq|$article_section}| selected="selected"|}><ste:escape>$section_name</ste:escape></option>
+ <option value="<ste:escape>$section_name</ste:escape>"?{~{$section_name|eq|$article_section}| selected="selected"|}><ste:escape>$section_name</ste:escape></option>
</ste:foreach>
</select>
</p>