Пример #1
0
    /**
     * Output the main landing page for the Sputnik administration screen.
     */
    protected static function dashboard()
    {
        ?>
		<p><?php 
        _e('Some text about WPEconomy goes here! This will eventually be replaced with a dashboard-like interface, including latest news, etc.', 'wpsc');
        ?>
</p>

		<h4><?php 
        _e('Search', 'wpsc');
        ?>
</h4>
		<p class="install-help"><?php 
        _e('Search for plugins by keyword.', 'wpsc');
        ?>
</p>
		<?php 
        Sputnik_Admin::search_form();
        ?>

		<h4><?php 
        _e('Popular tags');
        ?>
</h4>
		<p class="install-help"><?php 
        _e('You may also browse based on the most popular tags on the store:', 'wpsc');
        ?>
</p>
<?php 
        echo '<p class="popular-tags">';
        try {
            $api_tags = Sputnik::get_tags();
            //Set up the tags in a way which can be interpreted by wp_generate_tag_cloud()
            $tags = array();
            foreach ($api_tags as $tag) {
                $tags[$tag->name] = (object) array('link' => esc_url(self::build_url(array('tab' => 'search', 's' => urlencode($tag->name)))), 'name' => $tag->name, 'id' => sanitize_title_with_dashes($tag->name), 'count' => $tag->count);
            }
            echo wp_generate_tag_cloud($tags, array('single_text' => __('%s plugin', 'wpsc'), 'multiple_text' => __('%s plugins', 'wpsc')));
        } catch (Exception $e) {
            echo $e->getMessage();
        }
        echo '</p><br class="clear" />';
    }
Пример #2
0
    public function display_tablenav($which)
    {
        global $tab;
        if ($tab === 'account') {
            return;
        }
        if (!Sputnik::account_is_linked()) {
            return;
        }
        $account = Sputnik::get_account();
        if ('top' == $which) {
            ?>
			<div class="tablenav top">
				<div class="alignright actions">
<?php 
            if (in_array($tab, array('dashboard', 'search'))) {
                ?>
					<?php 
                Sputnik_Admin::search_form();
            }
            switch ($this->view) {
                case 'list':
                    $view = 'grid';
                    $name = __('Grid', 'wp-e-commerce');
                    break;
                case 'grid':
                    $view = 'list';
                    $name = __('List', 'wp-e-commerce');
                    break;
            }
            ?>
					<!--<a href="<?php 
            echo add_query_arg('view', $view);
            ?>
" class="view-as-<?php 
            echo $view;
            ?>
 button"><?php 
            echo $name;
            ?>
</a>-->
				</div>
<?php 
            $this->pagination($which);
            ?>
				<img src="<?php 
            echo esc_url(wpsc_get_ajax_spinner());
            ?>
" class="ajax-loading list-ajax-loading" alt="" />
				<br class="clear" />
			</div>
		<?php 
        } else {
            ?>
			<div class="tablenav bottom">
				<?php 
            $this->pagination($which);
            ?>
				<img src="<?php 
            echo esc_url(wpsc_get_ajax_spinner());
            ?>
" class="ajax-loading list-ajax-loading" alt="" />
				<br class="clear" />
			</div>
		<?php 
        }
    }
Пример #3
0
    public function display_tablenav($which)
    {
        global $tab;
        if ($tab === 'account') {
            return;
        }
        $account = Sputnik::get_account();
        if ('top' == $which) {
            ?>
			<div class="tablenav top">
				<div class="alignright account">
					<?php 
            printf(__('Logged in as %s', 'wp-e-commerce'), '<a href="' . menu_page_url('sputnik-account', false) . '" class="account-link">' . $account->name . '</a>');
            if ($tab === 'search') {
                ?>
					<?php 
                Sputnik_Admin::search_form();
            }
            ?>
				</div>
<?php 
            $this->pagination($which);
            ?>
				<img src="<?php 
            echo esc_url(wpsc_get_ajax_spinner());
            ?>
" class="ajax-loading list-ajax-loading" alt="" />
				<br class="clear" />
			</div>
		<?php 
        } else {
            ?>
			<div class="tablenav bottom">
				<?php 
            $this->pagination($which);
            ?>
				<img src="<?php 
            echo esc_url(wpsc_get_ajax_spinner());
            ?>
" class="ajax-loading list-ajax-loading" alt="" />
				<br class="clear" />
			</div>
		<?php 
        }
    }