diff options
author | Kevin Chabowski <kevin@kch42.de> | 2012-01-31 00:22:26 +0100 |
---|---|---|
committer | Kevin Chabowski <kevin@kch42.de> | 2012-01-31 00:22:26 +0100 |
commit | f1391f02d0167fd24b0bda731a20a972cb0a8163 (patch) | |
tree | 8c2ec9ff32a4e2b1786c0ff8404de023d747ffb2 /ratatoeskr/backend.php | |
parent | 787e70f26bc02f5e11ad297629a0543c8d3adcda (diff) | |
download | ratatoeskr-cms-f1391f02d0167fd24b0bda731a20a972cb0a8163.tar.gz ratatoeskr-cms-f1391f02d0167fd24b0bda731a20a972cb0a8163.tar.bz2 ratatoeskr-cms-f1391f02d0167fd24b0bda731a20a972cb0a8163.zip |
Fixed article editor. Again.
* Fixed last bugfix -.-
* <option name...> --> <option value...>
I don't know how this had worked at all before...
Diffstat (limited to 'ratatoeskr/backend.php')
-rw-r--r-- | ratatoeskr/backend.php | 16 |
1 files changed, 9 insertions, 7 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"]); |