use base 'BSE::TB::SiteCommon';
use base 'BSE::FormatterBase';
use BSE::TB::Articles;
+use BSE::MetaOwnerBase;
-our $VERSION = "1.005";
+our @ISA = qw(BSE::MetaOwnerBase);
+
+our $VERSION = "1.006";
sub images {
return;
1;
}
+sub tags {
+ ();
+}
+
sub has_tags {
0;
}
+sub meta_owner_type {
+ 'bse_article';
+}
+
+sub meta_meta_cfg_section {
+ "global article metadata";
+}
+
+sub meta_meta_cfg_prefix {
+ "article metadata";
+}
+
+sub metafields {
+ my ($self, $cfg) = @_;
+
+ $cfg ||= BSE::Cfg->single;
+
+ my %metanames = map { $_ => 1 } $self->metanames;
+
+ require BSE::ArticleMetaMeta;
+ my @fields = grep $metanames{$_->name} || $_->cond($self), BSE::ArticleMetaMeta->all_metametadata($cfg);
+
+ return ( @fields );
+}
+
+
1;
use constant MAX_FILE_DISPLAYNAME_LENGTH => 255;
use constant ARTICLE_CUSTOM_FIELDS_CFG => "article custom fields";
-our $VERSION = "1.052";
+our $VERSION = "1.053";
=head1 NAME
return;
}
- return \%article;
+ require BSE::DummyArticle;
+ return bless \%article, "BSE::DummyArticle";
}
sub add_form {
$self->_validate_tags(\@tags, \%errors);
}
+ my $meta;
+ if ($cgi->param("_save_meta")) {
+ require BSE::ArticleMetaMeta;
+ $meta = BSE::ArticleMetaMeta->retrieve($req, $article, \%errors);
+ }
+
if (keys %errors) {
if ($req->is_ajax) {
return $req->json_content
$article->set_tags([ grep /\S/, @tags ], \$error);
}
+ if ($meta) {
+ BSE::ArticleMetaMeta->save($article, $meta);
+ }
+
generate_article($articles, $article) if $Constants::AUTO_GENERATE;
if ($req->is_ajax) {
</tr>
<:or Article:><:eif Article:>
</table>
-<:.if !ifnew -:>
<:.set metas = [ article.metafields ] -:>
<: .if metas.size -:>
<fieldset>
<: .end for -:>
</fieldset>
<: .end if -:>
-<:.end if -:>
<p><: ifNew :>
<input type="submit" name="save" value="Add New <: articleType:>" />