summaryrefslogtreecommitdiff
path: root/classes/article.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-04-01 11:14:27 +0400
committerAndrew Dolgov <[email protected]>2013-04-01 11:14:27 +0400
commit1c9bda915bb8a734af27cc3a2d2dd1cc16f2d5fd (patch)
tree5d9244ab519b3611f0f1f411af50728a3f83a61d /classes/article.php
parenta7edcc5585b5d2995c4ea033c242bb42ce95ca78 (diff)
move several methods from dlg; fix displayed tags not updated after editing
Diffstat (limited to 'classes/article.php')
-rw-r--r--classes/article.php35
1 files changed, 34 insertions, 1 deletions
diff --git a/classes/article.php b/classes/article.php
index b10766bf5..79c94f59b 100644
--- a/classes/article.php
+++ b/classes/article.php
@@ -2,7 +2,7 @@
class Article extends Handler_Protected {
function csrf_ignore($method) {
- $csrf_ignored = array("redirect");
+ $csrf_ignored = array("redirect", "editarticletags");
return array_search($method, $csrf_ignored) !== false;
}
@@ -174,6 +174,39 @@ class Article extends Handler_Protected {
return $rc;
}
+ function editArticleTags() {
+
+ print __("Tags for this article (separated by commas):")."<br>";
+
+ $param = db_escape_string($this->link, $_REQUEST['param']);
+
+ $tags = get_article_tags($this->link, db_escape_string($this->link, $param));
+
+ $tags_str = join(", ", $tags);
+
+ print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"id\" value=\"$param\">";
+ print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"rpc\">";
+ print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"setArticleTags\">";
+
+ print "<table width='100%'><tr><td>";
+
+ print "<textarea dojoType=\"dijit.form.SimpleTextarea\" rows='4'
+ style='font-size : 12px; width : 100%' id=\"tags_str\"
+ name='tags_str'>$tags_str</textarea>
+ <div class=\"autocomplete\" id=\"tags_choices\"
+ style=\"display:none\"></div>";
+
+ print "</td></tr></table>";
+
+ print "<div class='dlgButtons'>";
+
+ print "<button dojoType=\"dijit.form.Button\"
+ onclick=\"dijit.byId('editTagsDlg').execute()\">".__('Save')."</button> ";
+ print "<button dojoType=\"dijit.form.Button\"
+ onclick=\"dijit.byId('editTagsDlg').hide()\">".__('Cancel')."</button>";
+ print "</div>";
+
+ }
}