diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-05-13 01:43:47 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-05-13 01:43:47 +0000 |
commit | 99c26f30c6b1755670710f465efc40bc5331964d (patch) | |
tree | 4920d5eda592707a163cf90ef08503bd3841d294 /modules/tag/controllers | |
parent | 983dc66684999e03685a496f17ca75f81cd21ffe (diff) |
Allow users to enter multiple tags at once, split by space, semicolon
or comma.
Fixes ticket #193.
Diffstat (limited to 'modules/tag/controllers')
-rw-r--r-- | modules/tag/controllers/tags.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/tag/controllers/tags.php b/modules/tag/controllers/tags.php index 515ddd59..ad401fdb 100644 --- a/modules/tag/controllers/tags.php +++ b/modules/tag/controllers/tags.php @@ -52,7 +52,12 @@ class Tags_Controller extends REST_Controller { $form = tag::get_add_form($item); if ($form->validate()) { - tag::add($item, $form->add_tag->inputs["name"]->value); + foreach (split("[\,\ \;]", $form->add_tag->inputs["name"]->value) as $tag_name) { + $tag_name = trim($tag_name); + if ($tag_name) { + $tag = tag::add($item, $tag_name); + } + } print json_encode( array("result" => "success", |