Ejemplo n.º 1
0
function jetpack_infinite_scroll_more_info()
{
    $support_text = sprintf(__('If you are a theme author, you can learn about adding support for Infinite Scroll at <a href="%1$s">%1$s</a>.', 'jetpack'), 'http://jetpack.me/support/infinite-scroll/');
    ?>

	<?php 
    if (!Jetpack::is_active() || Jetpack::is_active() && current_theme_supports('infinite-scroll')) {
        ?>
		<p><?php 
        esc_html_e('When you write great content, all you really want is people to find it, right?', 'jetpack');
        ?>
</p>

		<p><?php 
        esc_html_e("With the Infinite Scroll module and a supported theme, that's exactly what happens. Instead of the old way of navigating down a page by scrolling and then clicking a link to get to the next page, waiting for a page refresh&mdash;the document model of the web&mdash;infinite scrolling pulls the next set of posts automatically into view when the reader approaches the bottom of the page, more like an application.", 'jetpack');
        ?>
</p>

	<?php 
    } else {
        ?>
		<p><?php 
        echo esc_html(sprintf(__("At this time, your theme, %s, doesn't support Infinite Scroll. Unlike other Jetpack modules, Infinite Scroll needs information from your theme to function properly.", 'jetpack'), function_exists('wp_get_theme') ? wp_get_theme()->Name : get_current_theme()));
        ?>
</p>

		<p><?php 
        esc_html_e("Until your theme supports Infinite Scroll, you won't be able to activate this module.", 'jetpack');
        ?>
</p>

		<?php 
        if (current_user_can('update_themes')) {
            ob_start();
            theme_update_available(function_exists('wp_get_theme') ? wp_get_theme() : (object) get_theme(get_current_theme()));
            $theme_update_available = ob_get_clean();
            if (!empty($theme_update_available)) {
                ?>
				<p><?php 
                printf(__('There is an update available for your theme. You may wish to check if this update adds Infinite Scroll support by visiting the <a href="%s">WordPress Updates</a> page.', 'jetpack'), esc_url(admin_url('update-core.php')));
                ?>
</p>
			<?php 
            } else {
                ?>
				<p><?php 
                echo $support_text;
                ?>
</p>
			<?php 
            }
            ?>
		<?php 
        } else {
            ?>
			<p><?php 
            echo $support_text;
            ?>
</p>
		<?php 
        }
        ?>
	<?php 
    }
}
    function display_rows()
    {
        $themes = $this->items;
        foreach ($themes as $theme) {
            ?>
<div class="available-theme"><?php 
            $template = $theme->get_template();
            $stylesheet = $theme->get_stylesheet();
            $title = $theme->display('Name');
            $version = $theme->display('Version');
            $author = $theme->display('Author');
            $activate_link = wp_nonce_url("themes.php?action=activate&amp;template=" . urlencode($template) . "&amp;stylesheet=" . urlencode($stylesheet), 'switch-theme_' . $stylesheet);
            $preview_link = esc_url(add_query_arg(array('preview' => 1, 'template' => urlencode($template), 'stylesheet' => urlencode($stylesheet), 'preview_iframe' => true, 'TB_iframe' => 'true'), home_url('/')));
            $actions = array();
            $actions['activate'] = '<a href="' . $activate_link . '" class="activatelink" title="' . esc_attr(sprintf(__('Activate &#8220;%s&#8221;'), $title)) . '">' . __('Activate') . '</a>';
            $actions['preview'] = '<a href="' . $preview_link . '" class="hide-if-customize" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $title)) . '">' . __('Preview') . '</a>';
            if (current_user_can('edit_theme_options')) {
                $actions['preview'] .= '<a href="' . wp_customize_url($stylesheet) . '" class="load-customize hide-if-no-customize">' . __('Live Preview') . '</a>';
            }
            if (!is_multisite() && current_user_can('delete_themes')) {
                $actions['delete'] = '<a class="submitdelete deletion" href="' . wp_nonce_url('themes.php?action=delete&amp;stylesheet=' . urlencode($stylesheet), 'delete-theme_' . $stylesheet) . '" onclick="' . "return confirm( '" . esc_js(sprintf(__("You are about to delete this theme '%s'\n  'Cancel' to stop, 'OK' to delete."), $title)) . "' );" . '">' . __('Delete') . '</a>';
            }
            $actions = apply_filters('theme_action_links', $actions, $theme);
            $delete_action = isset($actions['delete']) ? '<div class="delete-theme">' . $actions['delete'] . '</div>' : '';
            unset($actions['delete']);
            ?>

			<a href="<?php 
            echo $preview_link;
            ?>
" class="screenshot hide-if-customize">
				<?php 
            if ($screenshot = $theme->get_screenshot()) {
                ?>
					<img src="<?php 
                echo esc_url($screenshot);
                ?>
" alt="" />
				<?php 
            }
            ?>
			</a>
			<a href="<?php 
            echo wp_customize_url($stylesheet);
            ?>
" class="screenshot load-customize hide-if-no-customize">
				<?php 
            if ($screenshot = $theme->get_screenshot()) {
                ?>
					<img src="<?php 
                echo esc_url($screenshot);
                ?>
" alt="" />
				<?php 
            }
            ?>
			</a>

			<h3><?php 
            echo $title;
            ?>
</h3>
			<div class="theme-author"><?php 
            printf(__('By %s'), $author);
            ?>
</div>
			<div class="action-links">
				<ul>
					<?php 
            foreach ($actions as $action) {
                ?>
						<li><?php 
                echo $action;
                ?>
</li>
					<?php 
            }
            ?>
					<li class="hide-if-no-js"><a href="#" class="theme-detail"><?php 
            _e('Details');
            ?>
</a></li>
				</ul>
				<?php 
            echo $delete_action;
            ?>

				<?php 
            theme_update_available($theme);
            ?>
			</div>

			<div class="themedetaildiv hide-if-js">
				<p><strong><?php 
            _e('Version: ');
            ?>
</strong><?php 
            echo $version;
            ?>
</p>
				<p><?php 
            echo $theme->display('Description');
            ?>
</p>
				<?php 
            if ($theme->parent()) {
                printf(' <p class="howto">' . __('This <a href="%1$s">child theme</a> requires its parent theme, %2$s.') . '</p>', __('http://codex.wordpress.org/Child_Themes'), $theme->parent()->display('Name'));
            }
            ?>
			</div>

			</div>
		<?php 
        }
    }
Ejemplo n.º 3
0
echo implode(' | ', $options);
if ($ct->tags) {
    ?>
	<p><?php 
    _e('Tags:');
    ?>
 <?php 
    echo join(', ', $ct->tags);
    ?>
</p>
	<?php 
}
?>
</div>
<?php 
theme_update_available($ct);
?>

</div>

<br class="clear" />
<?php 
if (!current_user_can('switch_themes')) {
    echo '</div>';
    require './admin-footer.php';
    exit;
}
?>

<h3><?php 
_e('Available Themes');
Ejemplo n.º 4
0
<?php 
                }
                if ($tags) {
                    ?>
<p><?php 
                    _e('Tags:');
                    ?>
 <?php 
                    echo join(', ', $tags);
                    ?>
</p>
<?php 
                }
                ?>
		<?php 
                theme_update_available($themes[$theme_name]);
            }
            // end if not empty theme_name
            ?>
	</td>
<?php 
        }
        // end foreach $cols
        ?>
</tr>
<?php 
    }
    // end foreach $table
    ?>
</table>
<?php 
    function display_rows()
    {
        $themes = $this->items;
        $theme_names = array_keys($themes);
        natcasesort($theme_names);
        foreach ($theme_names as $theme_name) {
            $class = array('available-theme');
            ?>
	<div class="<?php 
            echo join(' ', $class);
            ?>
">
	<?php 
            if (!empty($theme_name)) {
                $template = $themes[$theme_name]['Template'];
                $stylesheet = $themes[$theme_name]['Stylesheet'];
                $title = $themes[$theme_name]['Title'];
                $version = $themes[$theme_name]['Version'];
                $description = $themes[$theme_name]['Description'];
                $author = $themes[$theme_name]['Author'];
                $screenshot = $themes[$theme_name]['Screenshot'];
                $stylesheet_dir = $themes[$theme_name]['Stylesheet Dir'];
                $template_dir = $themes[$theme_name]['Template Dir'];
                $parent_theme = $themes[$theme_name]['Parent Theme'];
                $theme_root = $themes[$theme_name]['Theme Root'];
                $theme_root_uri = $themes[$theme_name]['Theme Root URI'];
                $preview_link = esc_url(get_option('home') . '/');
                if (is_ssl()) {
                    $preview_link = str_replace('http://', 'https://', $preview_link);
                }
                $preview_link = htmlspecialchars(add_query_arg(array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => true, 'TB_iframe' => 'true'), $preview_link));
                $preview_text = esc_attr(sprintf(__('Preview of &#8220;%s&#8221;'), $title));
                $tags = $themes[$theme_name]['Tags'];
                $thickbox_class = 'thickbox thickbox-preview';
                $activate_link = wp_nonce_url("themes.php?action=activate&amp;template=" . urlencode($template) . "&amp;stylesheet=" . urlencode($stylesheet), 'switch-theme_' . $template);
                $activate_text = esc_attr(sprintf(__('Activate &#8220;%s&#8221;'), $title));
                $actions = array();
                $actions[] = '<a href="' . $activate_link . '" class="activatelink" title="' . $activate_text . '">' . __('Activate') . '</a>';
                $actions[] = '<a href="' . $preview_link . '" class="thickbox thickbox-preview" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $theme_name)) . '">' . __('Preview') . '</a>';
                if (!is_multisite() && current_user_can('delete_themes')) {
                    $actions[] = '<a class="submitdelete deletion" href="' . wp_nonce_url("themes.php?action=delete&amp;template={$stylesheet}", 'delete-theme_' . $stylesheet) . '" onclick="' . "return confirm( '" . esc_js(sprintf(__("You are about to delete this theme '%s'\n  'Cancel' to stop, 'OK' to delete."), $theme_name)) . "' );" . '">' . __('Delete') . '</a>';
                }
                $actions = apply_filters('theme_action_links', $actions, $themes[$theme_name]);
                $actions = implode(' | ', $actions);
                ?>
		<a href="<?php 
                echo $preview_link;
                ?>
" class="<?php 
                echo $thickbox_class;
                ?>
 screenshot">
<?php 
                if ($screenshot) {
                    ?>
			<img src="<?php 
                    echo $theme_root_uri . '/' . $stylesheet . '/' . $screenshot;
                    ?>
" alt="" />
<?php 
                }
                ?>
		</a>
<h3><?php 
                /* translators: 1: theme title, 2: theme version, 3: theme author */
                printf(__('%1$s %2$s by %3$s'), $title, $version, $author);
                ?>
</h3>
<p class="description"><?php 
                echo $description;
                ?>
</p>
<span class='action-links'><?php 
                echo $actions;
                ?>
</span>
	<?php 
                if (current_user_can('edit_themes') && $parent_theme) {
                    /* translators: 1: theme title, 2:  template dir, 3: stylesheet_dir, 4: theme title, 5: parent_theme */
                    ?>
	<p><?php 
                    printf(__('The template files are located in <code>%2$s</code>. The stylesheet files are located in <code>%3$s</code>. <strong>%4$s</strong> uses templates from <strong>%5$s</strong>. Changes made to the templates will affect both themes.'), $title, str_replace(WP_CONTENT_DIR, '', $template_dir), str_replace(WP_CONTENT_DIR, '', $stylesheet_dir), $title, $parent_theme);
                    ?>
</p>
<?php 
                } else {
                    ?>
	<p><?php 
                    printf(__('All of this theme&#8217;s files are located in <code>%2$s</code>.'), $title, str_replace(WP_CONTENT_DIR, '', $template_dir), str_replace(WP_CONTENT_DIR, '', $stylesheet_dir));
                    ?>
</p>
<?php 
                }
                if ($tags) {
                    ?>
<p><?php 
                    _e('Tags:');
                    ?>
 <?php 
                    echo join(', ', $tags);
                    ?>
</p>
<?php 
                }
                ?>
		<?php 
                theme_update_available($themes[$theme_name]);
            }
            // end if not empty theme_name
            ?>
	</div>
<?php 
        }
        // end foreach $theme_names
    }
Ejemplo n.º 6
0
	<h4>
		<?php echo $ct->display('Name'); ?>
	</h4>

	<div>
		<ul class="theme-info">
			<li><?php printf( __('By %s'), $ct->display('Author') ); ?></li>
			<li><?php printf( __('Version %s'), $ct->display('Version') ); ?></li>
		</ul>
		<p class="theme-description"><?php echo $ct->display('Description'); ?></p>
		<?php if ( $ct->parent() ) {
			printf( ' <p class="howto">' . __( 'This <a href="%1$s">child theme</a> requires its parent theme, %2$s.' ) . '</p>',
				__( 'http://codex.wordpress.org/Child_Themes' ),
				$ct->parent()->display( 'Name' ) );
		} ?>
		<?php theme_update_available( $ct ); ?>
	</div>

	<?php
	// Pretend you didn't see this.
	$options = array();
	if ( is_array( $submenu ) && isset( $submenu['themes.php'] ) ) {
		foreach ( (array) $submenu['themes.php'] as $item) {
			$class = '';
			if ( 'themes.php' == $item[2] || 'theme-editor.php' == $item[2] )
				continue;
			// 0 = name, 1 = capability, 2 = file
			if ( ( strcmp($self, $item[2]) == 0 && empty($parent_file)) || ($parent_file && ($item[2] == $parent_file)) )
				$class = ' class="current"';
			if ( !empty($submenu[$item[2]]) ) {
				$submenu[$item[2]] = array_values($submenu[$item[2]]); // Re-index.
    function display_rows()
    {
        $themes = $this->items;
        foreach ($themes as $theme) {
            ?>
<div class="available-theme"><?php 
            $template = $theme->get_template();
            $stylesheet = $theme->get_stylesheet();
            $title = $theme->display('Name');
            $version = $theme->display('Version');
            $author = $theme->display('Author');
            $activate_link = wp_nonce_url("themes.php?action=activate&amp;template=" . urlencode($template) . "&amp;stylesheet=" . urlencode($stylesheet), 'switch-theme_' . $template);
            $preview_link = esc_url(add_query_arg(array('preview' => 1, 'template' => $template, 'stylesheet' => $stylesheet, 'preview_iframe' => true, 'TB_iframe' => 'true'), home_url('/')));
            $actions = array();
            $actions[] = '<a href="' . $activate_link . '" class="activatelink" title="' . esc_attr(sprintf(__('Activate &#8220;%s&#8221;'), $title)) . '">' . __('Activate') . '</a>';
            $actions[] = '<a href="' . $preview_link . '" class="hide-if-customize" title="' . esc_attr(sprintf(__('Preview &#8220;%s&#8221;'), $title)) . '">' . __('Preview') . '</a>' . '<a href="' . wp_customize_url($stylesheet) . '" class="load-customize hide-if-no-customize">' . __('Customize') . '</a>';
            if (!is_multisite() && current_user_can('delete_themes')) {
                $actions['delete'] = '<a class="submitdelete deletion" href="' . wp_nonce_url("themes.php?action=delete&amp;template={$stylesheet}", 'delete-theme_' . $stylesheet) . '" onclick="' . "return confirm( '" . esc_js(sprintf(__("You are about to delete this theme '%s'\n  'Cancel' to stop, 'OK' to delete."), $title)) . "' );" . '">' . __('Delete') . '</a>';
            }
            $actions = apply_filters('theme_action_links', $actions, $theme);
            $delete_action = isset($actions['delete']) ? '<div class="delete-theme">' . $actions['delete'] . '</div>' : '';
            unset($actions['delete']);
            ?>

			<a href="<?php 
            echo $preview_link;
            ?>
" class="screenshot hide-if-customize">
				<?php 
            if ($screenshot = $theme->get_screenshot()) {
                ?>
					<img src="<?php 
                echo esc_url($screenshot);
                ?>
" alt="" />
				<?php 
            }
            ?>
			</a>
			<a href="<?php 
            echo wp_customize_url($stylesheet);
            ?>
" class="screenshot load-customize hide-if-no-customize">
				<?php 
            if ($screenshot = $theme->get_screenshot()) {
                ?>
					<img src="<?php 
                echo esc_url($screenshot);
                ?>
" alt="" />
				<?php 
            }
            ?>
			</a>

			<h3><?php 
            echo $title;
            ?>
</h3>
			<div class="theme-author"><?php 
            printf(__('By %s'), $author);
            ?>
</div>
			<div class="action-links">
				<ul>
					<?php 
            foreach ($actions as $action) {
                ?>
						<li><?php 
                echo $action;
                ?>
</li>
					<?php 
            }
            ?>
					<li class="hide-if-no-js"><a href="#" class="theme-detail" tabindex='4'><?php 
            _e('Details');
            ?>
</a></li>
				</ul>
				<?php 
            echo $delete_action;
            ?>

				<?php 
            theme_update_available($theme);
            ?>
			</div>

			<div class="themedetaildiv hide-if-js">
				<p><strong><?php 
            _e('Version: ');
            ?>
</strong><?php 
            echo $version;
            ?>
</p>
				<p><?php 
            echo $theme->display('Description');
            ?>
</p>
				<?php 
            if (current_user_can('edit_themes') && $theme->parent()) {
                /* translators: 1: theme title, 2:  template dir, 3: stylesheet_dir, 4: theme title, 5: parent_theme */
                ?>
					<p><?php 
                printf(__('The template files are located in <code>%2$s</code>. The stylesheet files are located in <code>%3$s</code>. <strong>%4$s</strong> uses templates from <strong>%5$s</strong>. Changes made to the templates will affect both themes.'), $title, str_replace(WP_CONTENT_DIR, '', $theme->get_template_directory()), str_replace(WP_CONTENT_DIR, '', $theme->get_stylesheet_directory()), $title, $theme->parent()->display('Name'));
                ?>
</p>
				<?php 
            } else {
                /* translators: 1: theme title, 2:  template dir, 3: stylesheet_dir */
                ?>
					<p><?php 
                printf(__('All of this theme&#8217;s files are located in <code>%2$s</code>.'), $title, str_replace(WP_CONTENT_DIR, '', $theme->get_template_directory()), str_replace(WP_CONTENT_DIR, '', $theme->get_stylesheet_directory()));
                ?>
</p>
				<?php 
            }
            ?>
			</div>

			</div>
		<?php 
        }
    }