~canonical-sysadmins/wordpress/4.8.1

« back to all changes in this revision

Viewing changes to wp-admin/themes.php

  • Committer: Barry Price
  • Date: 2016-08-17 04:49:28 UTC
  • mto: This revision was merged to the branch mainline in revision 22.
  • Revision ID: barry.price@canonical.com-20160817044928-viijiwb4tl8jwzmp
new upstream release 4.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
if ( ! current_user_can( 'switch_themes' ) && ! current_user_can( 'edit_theme_options' ) ) {
13
13
        wp_die(
14
14
                '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
15
 
                '<p>' . __( 'You are not allowed to edit theme options on this site.' ) . '</p>',
 
15
                '<p>' . __( 'Sorry, you are not allowed to edit theme options on this site.' ) . '</p>',
16
16
                403
17
17
        );
18
18
}
40
40
                if ( ! current_user_can( 'delete_themes' ) ) {
41
41
                        wp_die(
42
42
                                '<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
43
 
                                '<p>' . __( 'You are not allowed to delete this item.' ) . '</p>',
 
43
                                '<p>' . __( 'Sorry, you are not allowed to delete this item.' ) . '</p>',
44
44
                                403
45
45
                        );
46
46
                }
89
89
        if ( is_multisite() ) {
90
90
                $help_install = '<p>' . __('Installing themes on Multisite can only be done from the Network Admin section.') . '</p>';
91
91
        } else {
92
 
                $help_install = '<p>' . sprintf( __('If you would like to see more themes to choose from, click on the &#8220;Add New&#8221; button and you will be able to browse or search for additional themes from the <a href="%s" target="_blank">WordPress.org Theme Directory</a>. Themes in the WordPress.org Theme Directory are designed and developed by third parties, and are compatible with the license WordPress uses. Oh, and they&#8217;re free!'), 'https://wordpress.org/themes/' ) . '</p>';
 
92
                $help_install = '<p>' . sprintf( __('If you would like to see more themes to choose from, click on the &#8220;Add New&#8221; button and you will be able to browse or search for additional themes from the <a href="%s" target="_blank">WordPress Theme Directory</a>. Themes in the WordPress Theme Directory are designed and developed by third parties, and are compatible with the license WordPress uses. Oh, and they&#8217;re free!'), 'https://wordpress.org/themes/' ) . '</p>';
93
93
        }
94
94
 
95
95
        get_current_screen()->add_help_tab( array(
145
145
 
146
146
add_thickbox();
147
147
wp_enqueue_script( 'theme' );
 
148
wp_enqueue_script( 'updates' );
148
149
wp_enqueue_script( 'customize-loader' );
149
150
 
150
151
require_once( ABSPATH . 'wp-admin/admin-header.php' );
248
249
        <?php } else { ?>
249
250
                <div class="theme-screenshot blank"></div>
250
251
        <?php } ?>
 
252
 
 
253
        <?php if ( $theme['hasUpdate'] ) : ?>
 
254
                <div class="update-message notice inline notice-warning notice-alt">
 
255
                        <p><?php _e( 'New version available. <button class="button-link" type="button">Update now</button>' ); ?></p>
 
256
                </div>
 
257
        <?php endif; ?>
 
258
 
251
259
        <span class="more-details" id="<?php echo $aria_action; ?>"><?php _e( 'Theme Details' ); ?></span>
252
260
        <div class="theme-author"><?php printf( __( 'By %s' ), $theme['author'] ); ?></div>
253
261
 
269
277
                        <a class="button button-primary customize load-customize hide-if-no-customize" href="<?php echo $theme['actions']['customize']; ?>"><?php _e( 'Customize' ); ?></a>
270
278
                <?php } ?>
271
279
        <?php } else { ?>
272
 
                <a class="button button-secondary activate" href="<?php echo $theme['actions']['activate']; ?>"><?php _e( 'Activate' ); ?></a>
 
280
                <?php
 
281
                /* translators: %s: Theme name */
 
282
                $aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
 
283
                ?>
 
284
                <a class="button button-secondary activate" href="<?php echo $theme['actions']['activate']; ?>" aria-label="<?php echo esc_attr( $aria_label ); ?>"><?php _e( 'Activate' ); ?></a>
273
285
                <?php if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { ?>
274
286
                        <a class="button button-primary load-customize hide-if-no-customize" href="<?php echo $theme['actions']['customize']; ?>"><?php _e( 'Live Preview' ); ?></a>
275
287
                <?php } ?>
276
288
        <?php } ?>
277
289
 
278
290
        </div>
279
 
 
280
 
        <?php if ( $theme['hasUpdate'] ) { ?>
281
 
                <div class="theme-update"><?php _e( 'Update Available' ); ?></div>
282
 
        <?php } ?>
283
291
</div>
284
292
<?php endforeach; ?>
285
293
        </div>
368
376
        <# } else { #>
369
377
                <div class="theme-screenshot blank"></div>
370
378
        <# } #>
 
379
 
 
380
        <# if ( data.hasUpdate ) { #>
 
381
                <div class="update-message notice inline notice-warning notice-alt"><p><?php _e( 'New version available. <button class="button-link" type="button">Update now</button>' ); ?></p></div>
 
382
        <# } #>
 
383
 
371
384
        <span class="more-details" id="{{ data.id }}-action"><?php _e( 'Theme Details' ); ?></span>
372
 
        <div class="theme-author"><?php printf( __( 'By %s' ), '{{{ data.author }}}' ); ?></div>
 
385
        <div class="theme-author">
 
386
                <?php
 
387
                /* translators: %s: Theme author name */
 
388
                printf( __( 'By %s' ), '{{{ data.author }}}' );
 
389
                ?>
 
390
        </div>
373
391
 
374
392
        <# if ( data.active ) { #>
375
393
                <h2 class="theme-name" id="{{ data.id }}-name">
376
394
                        <?php
377
 
                        /* translators: %s: theme name */
 
395
                        /* translators: %s: Theme name */
378
396
                        printf( __( '<span>Active:</span> %s' ), '{{{ data.name }}}' );
379
397
                        ?>
380
398
                </h2>
383
401
        <# } #>
384
402
 
385
403
        <div class="theme-actions">
386
 
 
387
 
        <# if ( data.active ) { #>
388
 
                <# if ( data.actions.customize ) { #>
389
 
                        <a class="button button-primary customize load-customize hide-if-no-customize" href="{{{ data.actions.customize }}}"><?php _e( 'Customize' ); ?></a>
 
404
                <# if ( data.active ) { #>
 
405
                        <# if ( data.actions.customize ) { #>
 
406
                                <a class="button button-primary customize load-customize hide-if-no-customize" href="{{{ data.actions.customize }}}"><?php _e( 'Customize' ); ?></a>
 
407
                        <# } #>
 
408
                <# } else { #>
 
409
                        <?php
 
410
                        /* translators: %s: Theme name */
 
411
                        $aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
 
412
                        ?>
 
413
                        <a class="button button-secondary activate" href="{{{ data.actions.activate }}}" aria-label="<?php echo $aria_label; ?>"><?php _e( 'Activate' ); ?></a>
 
414
                        <a class="button button-primary load-customize hide-if-no-customize" href="{{{ data.actions.customize }}}"><?php _e( 'Live Preview' ); ?></a>
390
415
                <# } #>
391
 
        <# } else { #>
392
 
                <a class="button button-secondary activate" href="{{{ data.actions.activate }}}"><?php _e( 'Activate' ); ?></a>
393
 
                <a class="button button-primary load-customize hide-if-no-customize" href="{{{ data.actions.customize }}}"><?php _e( 'Live Preview' ); ?></a>
394
 
        <# } #>
395
 
 
396
416
        </div>
397
 
 
398
 
        <# if ( data.hasUpdate ) { #>
399
 
                <div class="theme-update"><?php _e( 'Update Available' ); ?></div>
400
 
        <# } #>
401
417
</script>
402
418
 
403
419
<script id="tmpl-theme-single" type="text/template">
448
464
                                <?php echo implode( ' ', $current_theme_actions ); ?>
449
465
                        </div>
450
466
                        <div class="inactive-theme">
 
467
                                <?php
 
468
                                /* translators: %s: Theme name */
 
469
                                $aria_label = sprintf( _x( 'Activate %s', 'theme' ), '{{ data.name }}' );
 
470
                                ?>
451
471
                                <# if ( data.actions.activate ) { #>
452
 
                                        <a href="{{{ data.actions.activate }}}" class="button button-secondary activate"><?php _e( 'Activate' ); ?></a>
 
472
                                        <a href="{{{ data.actions.activate }}}" class="button button-secondary activate" aria-label="<?php echo $aria_label; ?>"><?php _e( 'Activate' ); ?></a>
453
473
                                <# } #>
454
474
                                <a href="{{{ data.actions.customize }}}" class="button button-primary load-customize hide-if-no-customize"><?php _e( 'Live Preview' ); ?></a>
455
475
                        </div>
461
481
        </div>
462
482
</script>
463
483
 
464
 
<?php require( ABSPATH . 'wp-admin/admin-footer.php' );
 
484
<?php
 
485
wp_print_request_filesystem_credentials_modal();
 
486
wp_print_admin_notice_templates();
 
487
wp_print_update_row_templates();
 
488
 
 
489
require( ABSPATH . 'wp-admin/admin-footer.php' );