: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* Provide a admin area view for the plugin
* This file is used to markup the admin-facing aspects of the plugin.
* @link https://themify.me/
* @subpackage Tbp/admin/partials
$themes = self::prepare_themes_for_js();
if(current_user_can('upload_files') ) {
$canInstall=current_user_can( 'manage_options' );
$canEdit=current_user_can( 'edit_theme_options' );
$canSwitch=current_user_can( 'switch_themes' );
$canDelete=current_user_can( 'delete_themes' );
$count = count( $themes );
add_filter( 'tbp_pointers_register', array('TBP_Pointers','setNoThemePointer' ));
<h2><?php _e( 'Themes', 'tbp'); ?>
<span class="title-count theme-count"><?php echo $count; ?></span>
<div id="placeholder_pointer_add_new_theme" style="display: inline-block;position: relative;">
<a data-type="theme" class="page-title-action" href="#"><?php _e('Add New', 'tbp') ?></a>
<?php elseif(defined('DISALLOW_FILE_MODS') && DISALLOW_FILE_MODS):?>
<div class="notice notice-warning"><p><?php _e("Can't add themes because 'DISALLOW_FILE_MODS' is defined on your WordPress config file 'wp-config.php'",'tbp')?></p></div>
<div id="placeholder_pointer_theme_activated" style="position: relative;display: inline-block;">
<a class="add-new-h2" href="<?php echo admin_url( 'edit.php?post_type='.Tbp_Templates::$post_type ); ?>"><?php _e('Go to Templates', 'tbp') ?></a>
<input placeholder="<?php _e('Search installed themes...', 'tbp') ?>" type="search" id="wp-filter-search-input" class="wp-filter-search">
<div class="theme-browser rendered tbp_theme_browser">
* This PHP is synchronized with the tmpl-theme template below!
foreach ( $themes as $theme ) :?>
<div class="theme tbp_theme<?php if ( $theme['active'] ) echo ' active'; ?>" tabindex="0">
<div class="tb_more_details" data-id="<?php echo $theme['theme_id']; ?>">
<?php if ( ! empty( $theme['screenshot'][0] ) ) { ?>
<div class="theme-screenshot">
<img src="<?php echo $theme['screenshot'][0]; ?>" alt="" />
<div class="theme-screenshot blank"></div>
<span class="more-details"><?php _e( 'Theme Details','tbp'); ?></span>
<div class="theme-id-container">
<?php if ( $theme['active'] ):?>
<span><?php _e( 'Active:','tbp'); ?></span>
<?php echo $theme['name']; ?>
<div class="theme-actions">
<?php if ( $theme['active'] ): ?>
<a href="<?php echo $theme['actions']['deactivate']; ?>" class="button button-secondary"><?php _e( 'Deactivate', 'tbp'); ?></a>
<a class="button button-secondary" href="<?php echo $theme['actions']['activate']; ?>"><?php _e( 'Activate', 'tbp'); ?></a>
<a class="button button-primary tbp_lightbox_edit" href="#" data-post-id="<?php echo $theme['theme_id']; ?>"><?php _e( 'Edit', 'tbp'); ?></a>
<?php if ( $theme['hasUpdate'] ): ?>
<div class="theme-update"><?php _e( 'Update Available','tbp' ); ?></div>
<div class="theme add-new-theme">
<a href="#" class="tbp_lightbox_edit">
<div class="theme-screenshot"><span></span></div>
<h3 class="theme-name"><?php _e('Add New Theme','tbp')?></h3></a>
<div class="theme-overlay"></div>
<p class="no-themes"><?php _e( 'No themes found. Try a different search.','tbp' ); ?></p>
<script id="tmpl-tbp-theme-single" type="text/template">
<div class="theme-backdrop"></div>
<div class="theme-header">
<button class="left dashicons dashicons-no<# if ( !data.prev ) { #> disabled<#}#>"><span class="screen-reader-text"><?php _e( 'Show previous theme','tbp' ); ?></span></button>
<button class="right dashicons dashicons-no<# if ( !data.next ) { #> disabled<#}#>"><span class="screen-reader-text"><?php _e( 'Show next theme','tbp' ); ?></span></button>
<button class="close dashicons dashicons-no"><span class="screen-reader-text"><?php _e( 'Close overlay','tbp' ); ?></span></button>
<div class="theme-about">
<div class="theme-screenshots">
<# if ( data.screenshot[0] ) { #>
<div class="screenshot"><img src="{{ data.screenshot[0] }}" alt="{{data.name }}" /></div>
<div class="screenshot blank"></div>
<# if ( data.active ) { #>
<span class="current-label"><?php _e( 'Current Theme','tbp' ); ?></span>
<h3 class="theme-name">{{{ data.name }}}<span class="theme-version"><?php printf( __( 'Version: %s','tbp' ), '{{ data.version }}' ); ?></span></h3>
<h4 class="theme-author"><?php printf( __( 'By %s','tbp' ), '{{{ data.authorAndUri }}}' ); ?></h4>
<# if ( data.hasUpdate ) { #>
<div class="theme-update-message">
<h4 class="theme-update"><?php _e( 'Update Available','tbp' ); ?></h4>
<p class="theme-description">{{{ data.description }}}</p>
<div class="theme-actions">
<# if (!data.active && data.actions.activate ) { #>
<a href="{{{ data.actions.activate }}}" class="button button-secondary"><?php _e( 'Activate','tbp'); ?></a>
<a class="button button-primary tbp_lightbox_edit" href="#" data-post-id="{{{ data.theme_id }}}"><?php _e( 'Edit', 'tbp'); ?></a>
<# if ( data.actions.export ) { #>
<a href="{{{ data.actions.export }}}" class="button button-secondary"><?php _e( 'Export', 'tbp'); ?></a>
<a class="button button-secondary tbp_lightbox_duplicate" href="#" data-post-id="{{{ data.theme_id }}}"><?php _e( 'Duplicate', 'tbp'); ?></a>
<# if ( data.active ) { #>
<a href="{{{ data.actions.deactivate }}}" class="button button-secondary"><?php _e( 'Deactivate', 'tbp'); ?></a>
<# if ( ! data.active && data.actions['delete'] ) { #>
<a href="{{{ data.actions['delete'] }}}" class="button button-secondary delete-theme"><?php _e( 'Delete','tbp'); ?></a>
<a class="button button-secondary" href="<?php echo add_query_arg( 'tbp_erase_demo', 1 ); ?>"><?php _e( 'Erase Demo', 'tbp'); ?></a>