- $params->{description} = $util->escape_html({}, $data->{title});
- $message = "no title!" if !$params->{description};
-
- # check user is valid
- if (!defined $user || !$user->{login}) {
- $message = "invalid author";
- }
- $params->{uid} = $user->{uid};
- $params->{article} = $data->{introtext};
- $params->{commentstatus} = $data->{commentstatus};
- $params->{action} = $data->{action} || 'preview';
- $params->{posttype} = $data->{posttype};
- $params->{tid} = $data->{tid};
-
- if ($data->{submissioncopy}) {
- $params->{promotetype} = "publicize";
- }
- else {
- $params->{promotetype} = "public";
- }
-
- # TODO: can select topics
- #$params->{topics_chosen} = { 49 => 10, }; # tid => weight
-
- #$extra_params->{createheaders} = $c->req->headers->to_string;
-
- if (length($message) > 0) {
- $c->render(json => { err => 1, message => $message });