Changeset 998
- Timestamp:
- 08/28/08 21:47:30 (3 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/StyleCatcher-2.1-dev/plugins/StyleCatcher/lib/StyleCatcher/CMS.pm
r985 r998 428 428 if ( $type =~ m!^text/css! ) { 429 429 $data->{auto}{url} = $url; 430 my $theme = fetch_theme( $url, ['collection:auto'] ); 430 my $theme = fetch_theme( 431 url => $url, 432 tags => ['collection:auto'], 433 ); 431 434 $data->{themes} = [$theme]; 432 435 } … … 464 467 my $themes = []; 465 468 for my $repo_theme (@repo_themes) { 466 my $theme = fetch_theme( $repo_theme, [] ); 469 my $theme = fetch_theme( 470 url => $repo_theme, 471 ); 467 472 push @$themes, $theme if $theme; 468 473 } … … 536 541 next unless -d $theme; 537 542 $theme =~ s/.*[\\\/]//; 538 $themes->{$theme} = 539 fetch_theme( $theme_dir, ['collection:mt-designs'], $theme_url, 540 $theme_dir ); 543 $themes->{$theme} = fetch_theme( 544 url => $theme_dir, 545 tags => ['collection:mt-designs'], 546 baseurl => $theme_url, 547 basepath => $theme_dir, 548 ); 541 549 $themes->{$theme}{name} = $themes->{$theme}{name}; 542 550 $themes->{$theme}{prefix} = 'default'; … … 553 561 next unless -d $theme; 554 562 $theme =~ s/.*[\\\/]//; 555 $themes->{$theme} = 556 fetch_theme( $theme_dir, ['collection:my-designs'] ); 563 $themes->{$theme} = fetch_theme( 564 url => $theme_dir, 565 tags => ['collection:my-designs'], 566 ); 557 567 $themes->{$theme}{prefix} = 'local'; 558 568 } … … 568 578 sub fetch_theme { 569 579 my $app = MT->app; 570 my ( $url, $tags, $baseurl, $basepath ) = @_; 580 my %param = @_; 581 my ($url, $tags, $baseurl, $basepath, $default_metadata) 582 = @param{qw( url tags baseurl basepath metadata )}; 583 $tags ||= []; 571 584 572 585 my $theme; … … 685 698 686 699 my %field_map = ( 687 author_url => [ 'designer_url', 'author_url', 'author uri' ],688 700 title => [ 'name', 'theme name' ], 689 701 author => [ 'designer', 'author' ], 702 author_url => [ 'designer_url', 'author_url', 'author uri' ], 703 template_set => [ 'template_set', 'template' ], 690 704 ); 691 705 while (my ($best_name, $possible_names) = each %field_map) { 692 706 ($metadata{$best_name}) = grep { defined } 693 delete @metadata{ @$possible_names } ;694 } 695 707 delete @metadata{ @$possible_names }, q{}; 708 } 709 696 710 require MT::Util; 697 711 my $data = { 698 712 name => $theme, 699 description => $metadata{description} || '',713 description => $metadata{description} || q{}, 700 714 title => $metadata{title} || '(Untitled)', 701 715 url => $url, 702 716 imageSmall => $thumbnails{thumbnail}, 703 717 imageBig => $thumbnails{thumbnail_large}, 704 layouts => $metadata{layouts} || '',718 layouts => $metadata{layouts} || q{}, 705 719 sort => $metadata{name} || $theme || q{}, 706 720 tags => $tags, 707 721 blogs => [], 708 author => $metadata{author} || q{}, 709 author_url => $metadata{author_url} || q{}, 722 author => $metadata{author}, 723 author_url => $metadata{author_url}, 724 template_set => $metadata{template_set}, 710 725 author_affiliation => $metadata{author_affiliation} || q{}, 711 726 }; branches/StyleCatcher-2.1-dev/plugins/StyleCatcher/tmpl/view.tmpl
r817 r998 76 76 mixer = new TC.Mixer(); 77 77 // initialize mixer object 78 mixer.addSelectedDisplay( "display-details-content" ); 78 var display = mixer.addSelectedDisplay( "display-details-content" ); 79 display.entryProperties['template_set'] = 'Template Set'; 79 80 mixer.onselect = selectDesign; 80 81 }
