Revision 636
- Date:
- 2016/12/21 10:38:16
- Files:
Legend:
- Added
- Removed
- Modified
-
utf8/plugins/tag/comps/contenido/tag/ajax/manage.html
74 74 $result{fallback} = 1; 75 75 } 76 76 } 77 my ($prop) = grep { $_->{type} eq 'tagset' } $doc->structure; 78 if ( ref $prop && !(exists $prop->{virtual} && $prop->{virtual}) ) { 79 my $class = $doc->class; 80 my $name = $prop->{attr}; 81 my $is_extra = scalar( grep { ref $_ && $_->{attr} eq $name } $class->class_table->required_properties ) ? 0 : 1; 82 83 my $result; 84 my @tags; 85 if ( $doc->id ) { 86 @tags = $keeper->get_documents( 87 class => 'tag::Tag', 88 lclass => 'tag::Cloud', 89 ldest => $doc->id, 90 ldestclass => $doc->class, 91 ); 92 if ( @tags ) { 93 $result = []; 94 foreach my $tag ( @tags ) { 95 push @$result, { id => $tag->id, name => $is_extra ? $tag->name : Encode::decode('utf-8', $tag->name) }; 96 } 97 unless ( $is_extra ) { 98 $result = Encode::encode('utf-8', JSON::XS->new->encode( $result )); 99 } 100 } 101 warn Dumper $result if $DEBUG; 102 $doc->$name( $result ); 103 $doc->store; 104 } 105 } 77 $keeper->{tag}->store_extras( $doc ) 106 78 } 107 79 $result{ok} = 1 unless exists $result{fallback}; 108 80 -
utf8/plugins/tag/lib/tag/Keeper.pm
76 76 push @$result, { id => $tag->id, name => $is_extra ? $tag->name : Encode::decode('utf-8', $tag->name) }; 77 77 } 78 78 unless ( $is_extra ) { 79 $result = Encode::encode('utf-8', $json->encode( $result )); 79 $result = Encode::encode('utf-8', JSON::XS->new->encode( $result )); 80 80 } 81 81 } 82 warn Dumper $result if $DEBUG; 82 warn Data::Dumper::Dumper $result if $DEBUG; 83 83 $object->$name( $result ); 84 84 $object->store; 85 85 }