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 | |
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')
-rw-r--r-- | ratatoeskr/backend.php | 16 | ||||
-rw-r--r-- | ratatoeskr/templates/src/systemtemplates/content_write.html | 2 |
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> |