Changeset 4156 for trunk

Show
Ignore:
Timestamp:
08/29/09 00:42:22 (3 months ago)
Author:
fumiakiy
Message:

Mereged hanson to trunk. "svn merge -r4124:4151 http://code.sixapart.com/svn/movabletype/branches/hanson ."

Location:
trunk
Files:
30 modified

Legend:

Unmodified
Added
Removed
  • trunk/lib/MT/App/Search.pm

    r4155 r4156  
    6666                }, 
    6767                'sort' => 'authored_on', 
    68                 terms  => { status => 2, class => '*' }, #MT::Entry::RELEASE() 
     68                terms  => {  
     69                    status => 2,  #MT::Entry::RELEASE() 
     70                    class => $app->param('archive_type') ? 'entry' : '*',  
     71                }, 
    6972                filter_types => { 
    7073                    author   => \&_join_author, 
     
    722725    } 
    723726    else { 
    724  
    725727        my $tmpl_id = $q->param ('template_id'); 
    726728        if ($tmpl_id && $tmpl_id =~ /^\d+$/) { 
    727729            $tmpl = $app->model('template')->lookup ($tmpl_id); 
     730            return $app->errtrans( 'No such template' ) 
     731                unless ($tmpl); 
     732            return $app->errtrans( 'template_id cannot be a global template' ) 
     733                if ($tmpl->blog_id == 0); 
     734            return $app->errtrans( 'Output file cannot be asp or php' ) 
     735                if ($tmpl->outfile && !$app->config->SearchAlwaysAllowTemplateID  
     736                    && ($tmpl->outfile =~ /\.asp/i || $tmpl->outfile =~ /\.php/i)); 
     737 
     738            if ($q->param('archive_type')) { 
     739                my $at = $q->param('archive_type'); 
     740                my $archiver = MT->publisher->archiver($at); 
     741                return return $app->errtrans( 'You must pass a valid archive_type with the template_id' ) 
     742                    unless ($archiver || $at eq 'Index'); 
     743 
     744                if ($at ne 'Index') { 
     745                    return $app->errtrans( 'Template must have identifier entry_listing for non-Index archive types' ) 
     746                        unless ($app->config->SearchAlwaysAllowTemplateID || $tmpl->identifier eq 'entry_listing'); 
     747                    my $blog = $app->model('blog')->load($tmpl->blog_id); 
     748                    return $app->errtrans( 'Blog file extension cannot be asp or php for these archives' ) 
     749                        if (!$app->config->SearchAlwaysAllowTemplateID 
     750                            && ($blog->file_extension =~ /^php$/i || $blog->file_extension =~ /^asp$/i)); 
     751                } else { 
     752                    return $app->errtrans( 'Template must have identifier main_index for Index archive type' ) 
     753                        unless ($app->config->SearchAlwaysAllowTemplateID || $tmpl->identifier eq 'main_index'); 
     754                } 
     755            } 
     756            else { 
     757                return $app->errtrans( 'You must pass a valid archive_type with the template_id' ); 
     758            } 
    728759        } 
    729760 
     
    732763        elsif ( my $blog_id = $ctx->stash('blog_id') ) { 
    733764            my $tmpl_class = $app->model('template'); 
    734             if ($tmpl_id) { 
    735                 $tmpl = $tmpl_class->load({ blog_id => $blog_id, id => $tmpl_id }); 
    736             } else { 
    737                 $tmpl = $tmpl_class->load({ blog_id => $blog_id, type => 'search_results' }); 
    738             } 
     765            $tmpl = $tmpl_class->load({ blog_id => $blog_id, type => 'search_results' }); 
    739766        } 
    740767        unless ($tmpl) { 
    741  
    742768            # load template from search_template path 
    743769            # template_paths method does the magic 
  • trunk/lib/MT/Asset.pm

    r4155 r4156  
    349349        MT::Util::encode_html($asset->url), 
    350350        MT::Util::encode_html($fname); 
    351     return $asset->enclose($text); 
     351    my $app = MT->instance; 
     352    return $app->param('edit_field') =~ /^customfield/ ? $asset->enclose($text) : $text; 
    352353} 
    353354 
     
    357358    my $id = $asset->id; 
    358359    my $type = $asset->class; 
    359     return $html; 
     360    return qq{<form mt:asset-id="$id" class="mt-enclosure mt-enclosure-$type" style="display: inline;">$html</form>}; 
    360361} 
    361362 
  • trunk/lib/MT/Asset/Image.pm

    r4155 r4156  
    261261    my $text    = ''; 
    262262 
     263    my $app = MT->instance; 
     264    $param->{enclose} = 0 unless ($app->param('edit_field') =~ /^customfield/); 
    263265    $param->{enclose} = 1 unless exists $param->{enclose}; 
    264266 
  • trunk/lib/MT/Blog.pm

    r4155 r4156  
    501501    my ($type) = @_; 
    502502    my %at = map { lc $_ => 1 } split(/,/, $blog->archive_type); 
    503     return exists $at{lc $type} ? 1 : 0; 
     503    return 0 unless exists $at{lc $type}; 
     504 
     505    my $result = 0; 
     506    require MT::TemplateMap; 
     507    my @maps = MT::TemplateMap->load({blog_id => $blog->id, 
     508                                      archive_type => $type}); 
     509    return 0 unless @maps; 
     510    require MT::PublishOption; 
     511    foreach my $map (@maps) {   
     512        $result++ if $map->build_type != MT::PublishOption::DISABLED(); 
     513    } 
     514    return $result; 
    504515} 
    505516 
  • trunk/lib/MT/CMS/Asset.pm

    r4155 r4156  
    10351035                    $target_file =~ s/$ext_old/$ext_temp/; 
    10361036                    $relative_path =~ s/$ext_old/$ext_temp/; 
     1037                    $relative_url =~ s/$ext_old/$ext_temp/; 
    10371038                    $asset_file =~ s/$ext_old/$ext_temp/; 
    10381039                    $basename =~ s/$ext_old/$ext_temp/; 
     
    12721273        $asset->file_ext($ext); 
    12731274        $asset->blog_id($blog_id); 
     1275        $asset->label($local_basename); 
    12741276        $asset->created_by( $app->user->id ); 
    12751277    } 
  • trunk/lib/MT/CMS/Comment.pm

    r4155 r4156  
    316316 
    317317    my %terms; 
     318 
     319    if ( !$app->param('blog_id') && !$app->user->is_superuser ) { 
     320        require MT::Permission; 
     321        $terms{blog_id} = [ 
     322            map { $_->blog_id } 
     323              grep { $_->can_view_feedback } 
     324              MT::Permission->load( { author_id => $app->user->id } ) 
     325        ]; 
     326    } 
     327 
    318328    my $filter_col = $app->param('filter'); 
    319329    if ( $filter_col && ( my $val = $app->param('filter_val') ) ) { 
  • trunk/lib/MT/CMS/Entry.pm

    r4155 r4156  
    181181       require MT::ObjectAsset; 
    182182       my $assets =(); 
    183        if ($q->param('asset_id') && !$id) { 
     183       if ($q->param('reedit') && $q->param('include_asset_ids')) { 
     184           my $include_asset_ids = $app->param('include_asset_ids'); 
     185           my @asset_ids = split(',', $include_asset_ids); 
     186           foreach my $asset_id (@asset_ids) { 
     187               my $asset = MT::Asset->load($asset_id); 
     188               if ($asset) { 
     189                   my $asset_1; 
     190                   if ($asset->class eq 'image') { 
     191                       $asset_1 = {asset_id => $asset->id, asset_name => $asset->file_name, asset_thumb => $asset->thumbnail_url(Width=>100)}; 
     192                   } else { 
     193                       $asset_1 = {asset_id => $asset->id, asset_name => $asset->file_name}; 
     194                   } 
     195                   push @{$assets}, $asset_1; 
     196               } 
     197           } 
     198       } 
     199       elsif ($q->param('asset_id') && !$id) { 
    184200           my $asset = MT::Asset->load($q->param('asset_id')); 
    185201           my $asset_1 = {asset_id => $asset->id, asset_name => $asset->file_name}; 
    186202           push @{$assets}, $asset_1; 
    187203       } 
    188        if ($id) { 
     204       elsif ($id) { 
    189205           my @assets = MT::Asset->load({ class => '*' }, 
    190206                                        { join => MT::ObjectAsset->join_on(undef, {asset_id => \'= asset_id', object_ds => 'entry', object_id => $id })}); 
     
    201217       $param->{asset_loop} = $assets; 
    202218    } 
    203  
     219     
    204220    ## Load categories and process into loop for category pull-down. 
    205221    require MT::Placement; 
     
    11201136    } 
    11211137    for my $data ( 
    1122         qw( authored_on_date authored_on_time basename_manual basename_old category_ids tags ) 
     1138        qw( authored_on_date authored_on_time basename_manual basename_old category_ids tags include_asset_ids ) 
    11231139      ) 
    11241140    { 
  • trunk/lib/MT/CMS/Tools.pm

    r4155 r4156  
    124124        $tmpl = $app->load_tmpl( 'cms/dialog/recover.tmpl' ); 
    125125    } 
     126    $param->{system_template} = 1; 
    126127    $tmpl->param($param); 
    127128    return $tmpl; 
     
    320321        $tmpl = $app->load_tmpl( 'cms/dialog/new_password.tmpl' ); 
    321322    } 
     323    $param->{system_template} = 1; 
    322324    $tmpl->param($param); 
    323325    return $tmpl; 
  • trunk/lib/MT/Core.pm

    r4155 r4156  
    407407            'GenerateTrackBackRSS' => { default => 0, }, 
    408408            'DBIRaiseError'        => { default => 0, }, 
     409            'SearchAlwaysAllowTemplateID' => { default => 0, }, 
    409410             
    410411            ## Search settings, copied from Jay's mt-search and integrated 
     
    584585            'FastCGIMaxTime'  => { default => 60 * 60 }, # 1 hour 
    585586            'FastCGIMaxRequests' => { default => 1000 }, # 1000 requests 
     587 
     588            'RPTFreeMemoryLimit' => undef, 
     589            'RPTProcessCap' => undef, 
     590            'RPTSwapMemoryLimit' => undef, 
     591            'SchwartzClientDeadline' => undef, 
     592            'SchwartzFreeMemoryLimit' => undef, 
     593            'SchwartzSwapMemoryLimit' => undef, 
    586594        }, 
    587595        upgrade_functions => \&load_upgrade_fns, 
  • trunk/lib/MT/Image.pm

    r3531 r4156  
    412412    my($w, $h) = $image->get_dimensions(@_); 
    413413    my $src = $image->{gd}; 
    414     my $gd = GD::Image->new($w, $h); 
     414    my $gd = GD::Image->new($w, $h, 1);  # True color image (24 bit) 
    415415    $gd->copyResampled($src, 0, 0, 0, 0, $w, $h, $image->{width}, $image->{height}); 
    416416    ($image->{gd}, $image->{width}, $image->{height}) = ($gd, $w, $h); 
     
    423423    my ($size, $x, $y) = @param{qw( Size X Y )}; 
    424424    my $src = $image->{gd}; 
    425     my $gd = GD::Image->new($size, $size); 
     425    my $gd = GD::Image->new($size, $size, 1);  # True color image (24 bit) 
    426426    $gd->copy($src, 0, 0, $x, $y, $size, $size); 
    427427    ($image->{gd}, $image->{width}, $image->{height}) = ($gd, $size, $size); 
  • trunk/lib/MT/L10N/de.pm

    r4155 r4156  
    302302## default_templates/signin.mtml 
    303303        'Sign In' => 'Anmelden', 
    304         'You are signed in as ' => 'Sie sind angemeldet als', 
     304        'You are signed in as ' => 'Sie sind angemeldet als ', 
    305305        'sign out' => 'abmelden', 
    306306        'You do not have permission to sign in to this blog.' => 'Sie haben keine Berechtigung zur Anmeldung an diesem Blog.', 
     
    60186018       'This is set to the same URL as the original blog.' => 'Die URL entspricht der des Ursprungsblogs.', # Translate - New # OK 
    60196019       'This will overwrite the original blog.' => 'Das Ursprungsblog wird ÃŒberschrieben.', # Translate - New # OK 
    6020  
     6020       'No such template' => 'Keine solche Vorlage', # Translate - New 
     6021       'template_id cannot be a global template' => 'template_id kann keine globale Vorlage sein.', # Translate - New 
     6022       'Output file cannot be asp or php' => 'Die Ausgabedatei darf weder ASP noch PHP sein.', # Translate - New 
     6023       'You must pass a valid archive_type with the template_id' => 'template_id erfordert ein gÃŒltiges archive_type-Parameter.', # Translate - New 
     6024       'Template must have identifier entry_listing for non-Index archive types' => 'FÃŒr Nicht-Index-Archive sind in der Vorlage eine entry_listing-Angabe erforderlich.', # Translate - New 
     6025       'Blog file extension cannot be asp or php for these archives' => 'Dateien dieses Archivs dÃŒrfen weder auf .asp noch auf .php enden.', # Translate - New 
     6026       'Template must have identifier main_index for Index archive type' => 'FÃŒr Index-Archive sind in der Vorlage eine main_index-Angabe erforderlich. ', # Translate - New 
     6027       'Add New' => 'Neues Asset', # Translate - Case 
     6028       'No asset(s) associated with this [_1]' => 'Keine Assets verknÃŒpft ', # Translate - New 
    60216029); 
    60226030 
  • trunk/lib/MT/L10N/es.pm

    r4155 r4156  
    60186018       'This is set to the same URL as the original blog.' => 'La URL coincide con la original del blog.', # Translate - New 
    60196019       'This will overwrite the original blog.' => 'Esto sobreescribirá el blog original.', # Translate - New 
    6020  
     6020       'No such template' => 'Esa plantilla no existe', # Translate - New 
     6021        'template_id cannot be a global template' => 'template_id no puede ser una plantilla global', # Translate - New 
     6022        'Output file cannot be asp or php' => 'El fichero de salida no puede ser asp o php', # Translate - New 
     6023        'You must pass a valid archive_type with the template_id' => 'Debe pasar un tipo de archivo (archive_type) válido con el template_id', # Translate - New 
     6024        'Template must have identifier entry_listing for non-Index archive types' => 'La plantilla debe tener un identificador entry_listing para los tipos de archivos que no sean índices', # Translate - New 
     6025        'Blog file extension cannot be asp or php for these archives' => 'El fichero del blog no puede ser asp o php para estos archivos', # Translate - New 
     6026        'Template must have identifier main_index for Index archive type' => 'La plantilla debe tener un identificador main_index para el tipo de archivos índices', # Translate - New 
     6027        'Add New' => 'Añadir nuevo', # Translate - Case 
     6028        'No asset(s) associated with this [_1]' => 'No existe/n elemento/s asociados a [_1]', # Translate - New 
    60216029); 
    60226030 
  • trunk/lib/MT/L10N/fr.pm

    r4155 r4156  
    16551655        'Role Name' => 'Nom du rÃŽle', 
    16561656        'Roles Selected' => 'RÃŽles sélectionnés', 
    1657         '' => '', # Translate - New 
    16581657        'Grant Permissions' => 'Ajouter des autorisations', 
    16591658        'You cannot delete your own association.' => 'Vous ne pouvez pas supprimer votre propre association.', 
     
    25572556        'Paths where logs are placed.' => 'Chemins où les logs seront placés', # Translate - New 
    25582557        'Logging Threshold' => 'Limite des logs', # Translate - New 
    2559         'Logging threshold for the App' => 'Limite des logs pour \'application', # Translate - New 
     2558        'Logging threshold for the App' => 'Limite des logs pour l\'application', # Translate - New 
    25602559        'Send Email To' => 'Envoyer un email à', # Translate - New 
    25612560        'The email address where you want to send test email to.' => 'Adresse email à laquelle vous souhaitez envoyer un email de test.', # Translate - New 
     
    60206019       'This is set to the same URL as the original blog.' => 'La valeur est la même URL que le blog original', # Translate - New 
    60216020       'This will overwrite the original blog.' => 'Cela réecrira le blog original', # Translate - New  
    6022  
     6021       'No such template' => 'Aucun gabarit', # Translate - New 
     6022       'template_id cannot be a global template' => 'template_id ne peut pas être un gabarit global', # Translate - New 
     6023       'Output file cannot be asp or php' => 'Le fichier de sortie ne peut pas être asp ou php', # Translate - New 
     6024       'You must pass a valid archive_type with the template_id' => 'Vous devez communiquer un archive_type valide avec un template_id', # Translate - New 
     6025       'Template must have identifier entry_listing for non-Index archive types' => 'Les gabarits doivent avoir un identifiant entry_listing pour des types d\'archives sans index', # Translate - New 
     6026       'Blog file extension cannot be asp or php for these archives' => 'L\'extention de fichiers d\'un blog ne peut pas être asp ou php', # Translate - New 
     6027       'Template must have identifier main_index for Index archive type' => 'Les gabarits doivent avoir un identifiant main_undex pour les archives de type Index', # Translate - New 
     6028       'Add New' => 'Nouvel élément', # Translate - Case 
     6029       'No asset(s) associated with this [_1]' => 'Aucun élément associé avec ce [_1]', # Translate - New 
    60236030); 
    60246031 
  • trunk/lib/MT/L10N/ja.pm

    r4155 r4156  
    855855        'Invalid value: [_1]' => '䞍正な倀です: [_1]', 
    856856        'No column was specified to search for [_1].' => '[_1]で怜玢するカラムが指定されおいたせん。', 
     857        'No such template' => 'テンプレヌトがありたせん。', # Translate - New 
     858        'template_id cannot be a global template' => 'template_id にグロヌバルテンプレヌトは指定できたせん。', # Translate - New 
     859        'Output file cannot be asp or php' => '出力ファむル名にaspやphpは指定できたせん。', # Translate - New 
     860        'You must pass a valid archive_type with the template_id' => 'template_idずarchive_typeを指定しおください。', # Translate - New 
     861        'Template must have identifier entry_listing for non-Index archive types' => 'むンデックス以倖のテンプレヌトでは、entry_listingのテンプレヌトしか指定できたせん。', # Translate - New 
     862        'Blog file extension cannot be asp or php for these archives' => 'このアヌカむブでaspやphpを出力ファむル名に指定するこずはできたせん。', # Translate - New 
     863        'Template must have identifier main_index for Index archive type' => 'main_indexのテンプレヌトしか指定できたせん。', # Translate - New 
    857864        'The search you conducted has timed out.  Please simplify your query and try again.' => 'タむムアりトしたした。お手数ですが怜玢をやり盎しおください。', 
    858865 
     
    12631270## lib/MT/CMS/Asset.pm 
    12641271        'Files' => 'ファむル', 
     1272        'Extension changed from [_1] to [_2]' => '拡匵子を[_1]から[_2]に倉曎したした。', # Translate - New 
    12651273        'Can\'t load file #[_1].' => 'ID:[_1]のファむルをロヌドできたせん。', 
    12661274        'No permissions' => '暩限がありたせん。', 
     
    13161324¥åŠ›ã—ãŠçµžã‚ŠèŸŒã¿', 
    13171325        'Blog Name' => 'ブログ名', 
     1326        '[_1] changed from [_2] to [_3]' => '[_1]を[_2]から[_3]ぞ倉曎したした。', # Translate - New 
    13181327        'Saved Blog Changes' => 'ブログぞの倉曎冠
    13191328容', 
     
    13881397        'Save failed: [_1]' => '保存できたせんでした: [_1]', 
    13891398        'Saving object failed: [_1]' => 'オブゞェクトを保存できたせんでした: [_1]', 
     1399        '\'[_1]\' edited the template \'[_2]\' in the blog \'[_3]\'' => '[_1] が ブログ [_3] のテンプレヌト「[_2]」を線集したした。', # Translate - New 
     1400        '\'[_1]\' edited the global template \'[_2]\'' => '[_1] がグロヌバルテンプレヌト [_2] を線集したした。', # Translate - New 
    13901401        'Invalid parameter' => '䞍正なパラメヌタです。', 
    13911402        'Load failed: [_1]' => 'ロヌドできたせんでした: [_1]', 
     
    14071418ƒã®ãƒ–ログず同じサむトパスです。', 
    14081419        'You need to specify a Site Path' => 'サむトパスを指定しおください。', 
    1409         'Entries must be cloned if trackbacks or comments are cloned' => 'コメントたたはトラックバックを耇補するずきはブログ蚘事も耇補しなければなりたせん。', 
     1420        'Entries must be cloned if comments and trackbacks are cloned' => 'コメントたたはトラックバックを耇補するずきはブログ蚘事も耇補しなければなりたせん。', 
    14101421        'Entries must be cloned if comments are cloned' => 'コメントを耇補するずきはブログ蚘事も耇補しなければなりたせん。', 
    14111422        'Entries must be cloned if trackbacks are cloned' => 'トラックバックを耇補するずきはブログ蚘事も耇補しなければなりたせん。', 
     
    15951606        'Test email from Movable Type' => 'Movable Type からのテストメヌルです', 
    15961607        'This is the test email sent by your installation of Movable Type.' => 'Movable Type から送信されたテストメヌルです。', 
    1597         'Mail was not properly sent' => 'メヌルを送信したした', 
     1608        'Mail was not properly sent' => 'メヌルを送信できたせんでした', 
     1609        'Test e-mail was successfully sent to [_1]' => 'テストメヌルを [_1] に送信したした。', # Translate - New 
     1610        'These setting(s) are overridden by a value in the MT configuration file: [_1]. Remove the value from the configuration file in order to control the value on this page.' => 'この蚭定よりも[_1]に指定されおいる倀の方が優å 
     1611ˆã•れたす。このペヌゞで蚭定を行う堎合はファむルから倀を削陀しおください。', # Translate - New 
     1612        'Email address is [_1]' => 'メヌルアドレス: [_1]', # Translate - New 
     1613        'Debug mode is [_1]' => 'デバッグモヌド: [_1]', # Translate - New 
     1614        'Performance logging is on' => 'パフォヌマンスログ: ON', # Translate - New 
     1615        'Performance logging is off' => 'パフォヌマンスログ: OFF', # Translate - New 
     1616        'Performance log path is [_1]' => 'パフォヌマンスログのパス: [_1]', # Translate - New 
     1617        'Performance log threshold is [_1]' => 'パフォヌマンスログのしきい倀: [_1]', # Translate - New 
     1618        'System Settings Changes Took Place' => 'システム蚭定ぞの曎新', # Translate - New 
    15981619        'Invalid password recovery attempt; can\'t recover password in this configuration' => 'パスワヌドの再蚭定に倱敗したした。この構成では再蚭定はできたせん。', 
    15991620        'Invalid author_id' => 'ナヌザヌのIDが䞍正です。', 
     
    30723093## tmpl/cms/dialog/clone_blog.tmpl 
    30733094        'Verify Blog Settings' => 'ブログの蚭定を確認する', 
     3095        'This is set to the same URL as the original blog.' => 'å 
     3096ƒã®ãƒ–ログず同じURLが蚭定されおいたす。', # Translate - New 
     3097        'This will overwrite the original blog.' => 'このたたにしおおくずå 
     3098ƒã®ãƒ–ログを䞊曞きしおしたいたす。', # Translate - New 
    30743099        'This is set to the same URL as the original blog. Would you like to <a href="javascript:history.back()" id="site-url-back-link">go back</a> and change it?' => 'å 
    30753100ƒã®ãƒ–ログず同じURLが蚭定されおいたす。<a href="javascript:history.back()" id="site-url-back-link">戻っお蚭定を倉曎</a>したすか?', 
     
    35233548        'Outbound TrackBack URLs' => 'トラックバック送信å 
    35243549ˆURL', 
    3525         'The published order of these assets can be changed using template tag modifiers.' => 'å 
    3526 ¬é–‹ã™ã‚‹ãšãã®äžŠã³é †ã¯ãƒ†ãƒ³ãƒ—レヌトタグのモディファむアで倉曎できたす。', 
     3550        'No asset(s) associated with this [_1]' => '[_1] 二関連づけられたアむテムはありたせん。', # Translate - New 
     3551        'The published order of these assets can be changed using [_1]template tag modifiers[_2].' => 'å 
     3552¬é–‹ã™ã‚‹ãšãã®äžŠã³é †ã¯[_1]テンプレヌトタグのモディファむア[_2]で倉曎できたす。', 
    35273553        'You have unsaved changes to this entry that will be lost.' => '保存されおいないブログ蚘事ぞの倉曎は倱われたす。', 
    35283554        'You have unsaved changes to this page that will be lost.' => '保存されおいないりェブペヌゞぞの倉曎は倱われたす。', 
  • trunk/lib/MT/L10N/nl.pm

    r4155 r4156  
    60196019        'This is set to the same URL as the original blog.' => 'Dit staat ingesteld op dezelfde URL als de oorspronkelijke blog.', # Translate - New 
    60206020        'This will overwrite the original blog.' => 'Dit zal de oorspronkelijke blog overschrijven.', # Translate - New 
    6021  
    6022  
     6021        'No such template' => 'Sjabloon bestaat niet', # Translate - New 
     6022       'template_id cannot be a global template' => 'template_id mag geen systeemsjabloon zijn', # Translate - New 
     6023       'Output file cannot be asp or php' => 'Uitvoerbestand mag geen asp of php zijn', # Translate - New 
     6024       'You must pass a valid archive_type with the template_id' => 'U moet een geldig archieftype doorgeven met het template_id', # Translate - New 
     6025       'Template must have identifier entry_listing for non-Index archive types' => 'Sjabloon moet de identifier \'entry_listing\' hebben voor niet-index archieftypes', # Translate - New 
     6026       'Blog file extension cannot be asp or php for these archives' => 'Blogextensie kan niet asp of php zijn voor deze archieven', # Translate - New 
     6027       'Template must have identifier main_index for Index archive type' => 'Sjabloon moet de identifier \'main_index\' hebben voor het index archieftype', # Translate - New 
     6028       'Add New' => 'Nieuw toevogen', # Translate - Case 
     6029       'No asset(s) associated with this [_1]' => 'Geen mediabestan(en) geassociëerd met [_1]', # Translate - New 
     6030         
    60236031); 
    60246032 
  • trunk/lib/MT/Meta.pm

    • Property svn:keywords set to Author Date Id Revision
    r4155 r4156  
    33# GNU General Public License, version 2. 
    44# 
    5 # $Id: Meta.pm 71460 2008-01-18 18:01:06Z ykerherve $ 
     5# $Id$ 
    66 
    77package MT::Meta; 
  • trunk/lib/MT/Meta/Proxy.pm

    • Property svn:keywords set to Author Date Id Revision
    r4155 r4156  
    33# GNU General Public License, version 2. 
    44# 
    5 # $Id: Proxy.pm 71506 2008-01-18 23:13:43Z ykerherve $ 
     5# $Id$ 
    66 
    77package MT::Meta::Proxy; 
  • trunk/lib/MT/ObjectDriverFactory.pm

    r4155 r4156  
    128128        if ( my $dbh = $driver->dbh ) { 
    129129            $dbh->disconnect; 
     130            $driver->dbh(undef); 
    130131        } 
    131132        $MT::Object::DRIVER = undef; 
     
    135136        if ( my $dbh = $driver->dbh ) { 
    136137            $dbh->disconnect; 
     138            $driver->dbh(undef); 
    137139        } 
    138140    } 
  • trunk/lib/MT/Serialize.pm

    r4155 r4156  
    110110                } elsif ($ref eq 'ARRAY') { 
    111111                  $frozen .= 'A' . pack('N', scalar(@$value)); 
    112                   push(@stack, ['ARRAY' => @$value]); 
     112                  push(@stack, ['ARRAY' => @$value]) 
     113                    if scalar @$value;                   
    113114                } elsif ($ref eq 'HASH') { 
    114                   $frozen .= 'H' . pack('N', scalar(keys %$value));  
    115                   push(@stack, ['HASH' => %$value]); 
     115                  $frozen .= 'H' . pack('N', scalar(keys %$value)); 
     116                  push(@stack, ['HASH' => %$value]) 
     117                    if scalar keys %$value; 
    116118                } else { 
    117119                  die "Unexpected type '$ref' in _macrofreeze\n"; 
  • trunk/lib/MT/Summary.pm

    • Property svn:keywords set to Author Date Id Revision
    r4155 r4156  
    1 # Movable Type (r) (C) 2001-2009 Six Apart, Ltd. All Rights Reserved. 
    2 # This code cannot be redistributed without permission from www.sixapart.com. 
    3 # For more information, consult your Movable Type license. 
     1# Movable Type (r) Open Source (C) 2001-2009 Six Apart, Ltd. 
     2# This program is distributed under the terms of the 
     3# GNU General Public License, version 2. 
     4# 
     5# $Id$ 
    46 
    57package MT::Summary; 
  • trunk/lib/MT/Summary/Author.pm

    • Property svn:keywords set to Author Date Id Revision
    r4155 r4156  
     1# Movable Type (r) Open Source (C) 2001-2009 Six Apart, Ltd. 
     2# This program is distributed under the terms of the 
     3# GNU General Public License, version 2. 
     4# 
     5# $Id$ 
    16 
    27# Core Summary Object Framework functions for MT::Author 
  • trunk/lib/MT/Summary/Entry.pm

    • Property svn:keywords set to Author Date Id Revision
    r4155 r4156  
     1# Movable Type (r) Open Source (C) 2001-2009 Six Apart, Ltd. 
     2# This program is distributed under the terms of the 
     3# GNU General Public License, version 2. 
     4# 
     5# $Id$ 
    16 
    27# Core Summary Object Framework functions for MT::Entry 
  • trunk/lib/MT/Summary/Proxy.pm

    • Property svn:keywords set to Author Date Id Revision
    r4155 r4156  
    1 # Movable Type (r) (C) 2001-2009 Six Apart, Ltd. All Rights Reserved. 
    2 # This code cannot be redistributed without permission from www.sixapart.com. 
    3 # For more information, consult your Movable Type license. 
     1# Movable Type (r) Open Source (C) 2001-2009 Six Apart, Ltd. 
     2# This program is distributed under the terms of the 
     3# GNU General Public License, version 2. 
    44# 
    5 # $Id: Proxy.pm 71506 2008-01-18 23:13:43Z ykerherve $ 
     5# $Id$ 
    66 
    77package MT::Summary::Proxy; 
  • trunk/lib/MT/Summary/Triggers.pm

    • Property svn:keywords set to Author Date Id Revision
    r4155 r4156  
    1 # Movable Type (r) (C) 2001-2009 Six Apart, Ltd. All Rights Reserved. 
    2 # This code cannot be redistributed without permission from www.sixapart.com. 
    3 # For more information, consult your Movable Type license. 
     1# Movable Type (r) Open Source (C) 2001-2009 Six Apart, Ltd. 
     2# This program is distributed under the terms of the 
     3# GNU General Public License, version 2. 
    44# 
    5 # $Id: Proxy.pm 71506 2008-01-18 23:13:43Z ykerherve $ 
     5# $Id$ 
    66 
    77package MT::Summary::Triggers; 
  • trunk/lib/MT/Template/ContextHandlers.pm

    r4155 r4156  
    79647964    # for the case that we want to use mt:Entries with mt-search 
    79657965    # send to MT::Template::Search if searh results are found 
    7966     my $results_iter = $ctx->stash('results'); 
    7967     require MT::Template::Context::Search; 
    7968     return MT::Template::Context::Search::_hdlr_results($ctx, $args, $cond) if ($results_iter); 
     7966    if ($ctx->stash('results') && $args->{search_results} == 1) { 
     7967        require MT::Template::Context::Search; 
     7968        return MT::Template::Context::Search::_hdlr_results($ctx, $args, $cond); 
     7969    } 
    79697970 
    79707971    $ctx->set_blog_load_context($args, \%blog_terms, \%blog_args) 
  • trunk/lib/MT/Worker/Summarize.pm

    • Property svn:keywords set to Author Date Id Revision
    r4155 r4156  
    1 # Movable Type (r) (C) 2001-2009 Six Apart, Ltd. All Rights Reserved. 
    2 # This code cannot be redistributed without permission from www.sixapart.com. 
    3 # For more information, consult your Movable Type license. 
     1# Movable Type (r) Open Source (C) 2001-2009 Six Apart, Ltd. 
     2# This program is distributed under the terms of the 
     3# GNU General Public License, version 2. 
     4# 
     5# $Id$ 
    46 
    57package MT::Worker::Summarize; 
  • trunk/lib/MT/Worker/SummaryWatcher.pm

    • Property svn:keywords set to Author Date Id Revision
    r4155 r4156  
    1 # Movable Type (r) (C) 2001-2009 Six Apart, Ltd. All Rights Reserved. 
    2 # This code cannot be redistributed without permission from www.sixapart.com. 
    3 # For more information, consult your Movable Type license. 
     1# Movable Type (r) Open Source (C) 2001-2009 Six Apart, Ltd. 
     2# This program is distributed under the terms of the 
     3# GNU General Public License, version 2. 
     4# 
     5# $Id$ 
    46 
    57package MT::Worker::SummaryWatcher; 
     
    1416    my $class                = shift; 
    1517    my TheSchwartz::Job $job = shift; 
    16     my $registry             = MT->registry; 
     18    #my $registry            = MT->registry; 
     19    my $registry            = MT->registry("summaries"); 
    1720    use Data::Dumper; 
    18     for my $summarizable ( keys %{ $registry->{summaries} } ) { 
     21    #for my $summarizable ( keys %{ $registry->{summaries} } ) { 
     22    for my $summarizable ( keys %{ $registry } ) { 
    1923        my $meta_pkg = MT->model($summarizable)->meta_pkg('summary'); 
    2024        my $summ_iter 
     
    2428        while ( my $summary = $summ_iter->() ) { 
    2529            my $priority 
    26                 = $registry->{summaries}->{$summarizable}->{ $summary->class } 
     30#                = $registry->{summaries}->{$summarizable}->{ $summary->class } 
     31                = $registry->{$summarizable}->{ $summary->class } 
    2732                ->{priority}; 
    2833            $priority ||= undef; 
    29             my $id         = $summary->$id_field; 
     34            my $id        = $summary->$id_field; 
    3035            my $class_type = MT->model($summarizable)->class_type 
    3136                || MT->model($summarizable)->datasource; 
  • trunk/php/lib/block.mtifarchivetypeenabled.php

    r3531 r4156  
    1414        $at = preg_quote($at); 
    1515        $blog_at = ',' . $blog['blog_archive_type'] . ','; 
    16         $enabled = preg_match("/,$at,/", $blog_at); 
    17         $map = $ctx->mt->db->fetch_templatemap( 
    18             array('type' => $at, 'blog_id' => $blog['blog_id'])); 
    19         if (empty($map)) 
    20             $enabled = 0; 
     16        $enabled = 0; 
     17        $at_exists = preg_match("/,$at,/", $blog_at); 
     18        if ($at_exists) { 
     19            $maps = $ctx->mt->db->fetch_templatemap( 
     20                array('type' => $at, 'blog_id' => $blog['blog_id'])); 
     21            if (!empty($maps)) { 
     22                foreach ($maps as $map) { 
     23                    if ($map['templatemap_build_type']) 
     24                        $enabled++; 
     25                } 
     26            } 
     27        } 
    2128        return $ctx->_hdlr_if($args, $content, $ctx, $repeat, $enabled); 
    2229    } else { 
  • trunk/tmpl/cms/dialog/asset_insert.tmpl

    r4155 r4156  
    33window.parent.app.insertHTML( '<mt:var name="upload_html" escape="js">', '<mt:var name="edit_field" escape="js">' ); 
    44</mt:setvarblock> 
     5 
     6 
    57<script type="text/javascript"> 
    68/* <![CDATA[ */ 
     9 
     10// do the following first... asset manager stuff is ONLY for edit entry 
     11<mt:if name="upload_html"> 
     12    <mt:var name="insert_script"> 
     13</mt:if> 
     14 
     15<mt:unless name="extension_message"> 
     16    closeDialog(); 
     17</mt:unless> 
    718 
    819// remove the no assets text if it's there 
     
    1223}  
    1324 
    14 // make sure the asset isn't there already 
    15 var Asset = window.parent.document.getElementById("list-asset-<mt:AssetID>"); 
    16 if (Asset) { 
    17     // do nothing 
     25// make sure asset list is present in an entry edit page 
     26var AssetList = window.parent.document.getElementById("asset-list"); 
     27 
     28if (AssetList) { 
     29    // make sure the asset isn't there already and that we're in the edit entry page 
     30    var Asset = window.parent.document.getElementById("list-asset-<mt:AssetID>"); 
     31 
     32    if (Asset) { 
     33        // do nothing 
     34    } 
     35    else { 
     36        // add the asset's id to the include_asset_ids hidden input 
     37        var asset_ids = window.parent.document.getElementById("include_asset_ids").value; 
     38        window.parent.document.getElementById("include_asset_ids").value = asset_ids + ",<mt:AssetID>"; 
     39 
     40        // create the link to the asset page with asset name as label 
     41        var myAssetLink = window.document.createElement('a'); 
     42        myAssetLink.setAttribute('href', '<mt:CGIPath><mt:AdminScript>?__mode=view&_type=asset&blog_id=<mt:var name="blog_id">&id=<mt:AssetID>'); 
     43        myAssetLink.appendChild(document.createTextNode('<mt:AssetFileName encode_js="1">')); 
     44 
     45        // create the remove link icon 
     46        var myRemoveIcon = window.document.createElement('img'); 
     47        myRemoveIcon.setAttribute('src', '<mt:StaticWebPath>images/status_icons/close.gif'); 
     48        myRemoveIcon.setAttribute('alt', 'Remove asset'); 
     49 
     50        // create the remove link for this asset 
     51        var myRemoveLink = window.document.createElement('a'); 
     52        myRemoveLink.setAttribute('href', 'javascript:removeAssetFromList(<mt:AssetID>)'); 
     53        myRemoveLink.setAttribute('class', 'remove-asset'); 
     54        myRemoveLink.appendChild(myRemoveIcon); 
     55 
     56        // create the asset list item 
     57        var myElement = window.document.createElement('li'); 
     58        myElement.setAttribute('id', 'list-asset-<mt:AssetID>'); 
     59        <mt:If tag="AssetType" eq="image"> 
     60            myElement.setAttribute('onmouseover', 'show(\'list-image-<mt:AssetID>\', window.parent.document)'); 
     61            myElement.setAttribute('onmouseout','hide(\'list-image-<mt:AssetID>\', window.parent.document)'); 
     62        </mt:If> 
     63        myElement.appendChild(myAssetLink); 
     64        myElement.appendChild(myRemoveLink); 
     65 
     66        // I HATE IE! 
     67        if (document.attachEvent) { 
     68            var oldLis = window.parent.document.getElementById("asset-list").innerHTML; 
     69            var newLi  = '<li id="list-asset-<mt:AssetID>" onmouseover="show(\'list-image-<mt:AssetID>\', window.parent.document)" onmouseout="hide(\'list-image-<mt:AssetID>\', window.parent.document)">'  
     70                         + myElement.innerHTML + '</li>'; 
     71            window.parent.document.getElementById("asset-list").innerHTML = oldLis + newLi; 
     72        }  
     73        else { 
     74            window.parent.document.getElementById("asset-list").appendChild(myElement); 
     75        } 
     76 
     77        // create the image thumbnail if it exists 
     78        <mt:If tag="AssetType" eq="image"> 
     79            var myImageElement = window.document.createElement('img'); 
     80            myImageElement.setAttribute('id', 'list-image-<mt:AssetID>'); 
     81            myImageElement.setAttribute('src', '<mt:AssetThumbnailURL width="100" encode_js="1">'); 
     82            myImageElement.setAttribute('class', 'list-image hidden'); 
     83            myElement.appendChild(myImageElement); 
     84        </mt:If> 
     85    } 
    1886} 
    19 else { 
    20     // add the asset's id to the include_asset_ids hidden input 
    21     var asset_ids = window.parent.document.getElementById("include_asset_ids").value; 
    22     window.parent.document.getElementById("include_asset_ids").value = asset_ids + ",<mt:AssetID>"; 
    23  
    24     // create the link to the asset page with asset name as label 
    25     var myAssetLink = window.document.createElement('a'); 
    26     myAssetLink.setAttribute('href', '<mt:CGIPath><mt:AdminScript>?__mode=view&_type=asset&blog_id=<mt:var name="blog_id">&id=<mt:AssetID>'); 
    27     myAssetLink.appendChild(document.createTextNode('<mt:AssetFileName encode_js="1">')); 
    28  
    29     // create the remove link icon 
    30     var myRemoveIcon = window.document.createElement('img'); 
    31     myRemoveIcon.setAttribute('src', '<mt:StaticWebPath>images/status_icons/close.gif'); 
    32     myRemoveIcon.setAttribute('alt', 'Remove asset'); 
    33  
    34     // create the remove link for this asset 
    35     var myRemoveLink = window.document.createElement('a'); 
    36     myRemoveLink.setAttribute('href', 'javascript:removeAssetFromList(<mt:AssetID>)'); 
    37         myRemoveLink.setAttribute('class', 'remove-asset'); 
    38     myRemoveLink.appendChild(myRemoveIcon); 
    39  
    40     // create the asset list item 
    41     var myElement = window.document.createElement('li'); 
    42     myElement.setAttribute('id', 'list-asset-<mt:AssetID>'); 
    43     <mt:If tag="AssetType" eq="image"> 
    44         myElement.setAttribute('onmouseover', 'show(\'list-image-<mt:AssetID>\', window.parent.document)'); 
    45         myElement.setAttribute('onmouseout','hide(\'list-image-<mt:AssetID>\', window.parent.document)'); 
    46     </mt:If> 
    47     myElement.appendChild(myAssetLink); 
    48     myElement.appendChild(myRemoveLink); 
    49  
    50     // I HATE IE! 
    51     if (document.attachEvent) { 
    52         var oldLis = window.parent.document.getElementById("asset-list").innerHTML; 
    53         var newLi  = '<li id="list-asset-<mt:AssetID>" onmouseover="show(\'list-image-<mt:AssetID>\', window.parent.document)" onmouseout="hide(\'list-image-<mt:AssetID>\', window.parent.document)">'  
    54                      + myElement.innerHTML + '</li>'; 
    55         window.parent.document.getElementById("asset-list").innerHTML = oldLis + newLi; 
    56     }  
    57     else { 
    58         window.parent.document.getElementById("asset-list").appendChild(myElement); 
    59     } 
    60  
    61     // create the image thumbnail if it exists 
    62     <mt:If tag="AssetType" eq="image"> 
    63         var myImageElement = window.document.createElement('img'); 
    64         myImageElement.setAttribute('id', 'list-image-<mt:AssetID>'); 
    65         myImageElement.setAttribute('src', '<mt:AssetThumbnailURL width="100" encode_js="1">'); 
    66         myImageElement.setAttribute('class', 'list-image hidden'); 
    67         myElement.appendChild(myImageElement); 
    68     </mt:If> 
    69 } 
    70 <mt:if name="upload_html"> 
    71     <mt:var name="insert_script"> 
    72 </mt:if> 
    73  
    74 <mt:unless name="extension_message"> 
    75     closeDialog(); 
    76 </mt:unless> 
    7787 
    7888/* ]]> */ 
     
    8595        <mt:var name="extension_message"> 
    8696    </mtapp:statusmsg> 
    87 </mt:if> 
    8897 
    89 <div class="actions-bar"> 
    9098    <div class="actions-bar-inner pkg actions"> 
    9199        <form action="" method="get" onsubmit="return false"> 
     
    99107        </form> 
    100108    </div> 
    101 </div> 
     109</mt:if> 
     110 
    102111 
    103112<mt:include name="dialog/footer.tmpl"> 
  • trunk/tmpl/cms/edit_entry.tmpl

    r4155 r4156  
    475475    <mtapp:widget 
    476476        id="asset_container" 
    477         label="Assets"> 
     477        label="<__trans phrase="Assets">"> 
    478478                <div class="asset-list-header"> 
    479479                <a href="javascript:void(0)" class="add-new-asset-link"  
    480480           onclick="openDialog(null,'list_assets','_type=asset&edit_field=&blog_id=<mt:var name="blog_id">&dialog_view=1&no_insert=1');return false;"> 
    481                 Add New 
     481                <__trans phrase="Add New"> 
    482482                </a> 
    483483                </div> 
     
    500500                </mt:loop> 
    501501            <mt:else> 
    502                 <li id="empty-asset-list">No asset(s) associated with this <mt:var name="object_type"></li> 
     502                <li id="empty-asset-list"><__trans phrase="No asset(s) associated with this [_1]" params="<mt:var name="object_type">"></li> 
    503503            </mt:if> 
    504504        </ul>