Esempio n. 1
0
 /**
  *  Initiator
  */
 public static function get_instance()
 {
     if (!isset(self::$instance)) {
         self::$instance = new Layers_API();
     }
     return self::$instance;
 }
Esempio n. 2
0
<?php

// Get the API up and running for the plugin listing
$api = new Layers_API();
$layers_migrator = new Layers_Widget_Migrator();
$valid_types = array('stylekits', 'extensions', 'themes');
$type = isset($_GET['type']) ? $_GET['type'] : 'themes';
if (!in_array($type, $valid_types)) {
    return;
}
?>

<?php 
switch ($type) {
    case 'stylekits':
        $excerpt = __('StyleKits', 'layerswp');
        $products = $api->get_stylekit_list();
        $fallback_url = 'http://bit.ly/layers-stylekits';
        break;
    case 'extensions':
        $excerpt = __('Extensions', 'layerswp');
        $products = $api->get_extension_list();
        $fallback_url = 'http://bit.ly/layers-extensions';
        break;
    default:
        $excerpt = __('Themes', 'layerswp');
        $products = $api->get_theme_list();
        $fallback_url = 'http://bit.ly/layers-themes';
}
$all_authors = array();
?>
Esempio n. 3
0
    /**
     * Complex Header with Menu
     */
    public function marketplace_header($title = NULL, $excerpt = NULL)
    {
        $api = new Layers_API();
        if (isset($_GET['type'])) {
            $type = $_GET['type'];
        } else {
            $type = 'themes';
        }
        ?>
		<header class="layers-page-title layers-section-title layers-large layers-content-large layers-no-push-bottom">

				<?php 
        _e(sprintf('<a href="%s" class="layers-logo">Layers</a>', 'http://layerswp.com'), 'layerswp');
        ?>

				<?php 
        if (isset($title)) {
            ?>
					<h2 class="layers-heading" id="layers-options-header">
						<?php 
            echo esc_html($title);
            ?>
						<span class="layers-small">
							<?php 
            _e(sprintf('Powered by <a href="%s">Envato</a>', 'http://www.themeforest.net/?ref=obox'), 'layerswp');
            ?>
						</span>
					</h2>
				<?php 
        }
        ?>

				<?php 
        if (isset($excerpt)) {
            ?>
					<p class="layers-excerpt"><?php 
            echo esc_html($excerpt);
            ?>
</p>
				<?php 
        }
        ?>

				<nav class="layers-nav-horizontal layers-dashboard-nav">
					<ul>
						<li <?php 
        if ('themes' == $type) {
            ?>
class="active"<?php 
        }
        ?>
>
							<a href="<?php 
        echo admin_url('admin.php?page=layers-marketplace&type=themes');
        ?>
">
								<?php 
        _e('Themes', 'layerswp');
        ?>
							</a>
						</li>
						<li <?php 
        if ('extensions' == $type) {
            ?>
class="active"<?php 
        }
        ?>
>
							<a href="<?php 
        echo admin_url('admin.php?page=layers-marketplace&type=extensions');
        ?>
">
								<?php 
        _e('Extensions', 'layerswp');
        ?>
							</a>
						</li>
						<li <?php 
        if ('stylekits' == $type) {
            ?>
class="active"<?php 
        }
        ?>
>
							<a href="<?php 
        echo admin_url('admin.php?page=layers-marketplace&type=stylekits');
        ?>
">
								<?php 
        _e('Style Kits', 'layerswp');
        ?>
							</a>
						</li>
					</ul>
					<form class="layers-help-search" action="" target="_blank" method="get">
						<label><?php 
        _e('Filters: ', 'layerswp');
        ?>
</label>
						<select id="layers-marketplace-authors" class="push-right">
							<option value=""><?php 
        _e('All Authors', 'layerswp');
        ?>
</option>
						</select>
						<select id="layers-marketplace-sortby" name="sortby" data-action="<?php 
        echo admin_url('admin.php?page=layers-marketplace&type=' . $type);
        ?>
" class="push-right">
							<?php 
        if (is_array($api->get_sort_options())) {
            ?>
								<?php 
            foreach ($api->get_sort_options() as $value => $label) {
                ?>
									<option value="<?php 
                echo $value;
                ?>
"><?php 
                echo $label;
                ?>
</option>
								<?php 
            }
            ?>
							<?php 
        }
        ?>
						</select>
						<input id="layers-marketplace-search" type="search" placeholder="<?php 
        _e('Search...', 'layerswp');
        ?>
"/>
					</form>
				</nav>
		</header>
	<?php 
    }
<?php

// Get the API up and running for the plugin listing
$api = new Layers_API();
?>

<!-- Uderscore Temnplate -->
<?php 
if (!isset($_GET['tab']) || isset($_GET['tab']) && 'upsell_media' !== $_GET['tab']) {
    ?>
    <script type="text/html" id="tmpl-layers-discover-more-photos">
<?php 
}
?>
    <div class="layers-discover-more-photos">

        <div class="layers-section-title layers-large layers-text-center layers-push-bottom-large">
            <div class="layers-heading">
                <?php 
_e("Can't find the perfect image?", "layerswp");
?>
            </div>
            <div class="layers-excerpt">
                <?php 
_e(sprintf('Visit <a href="%s" target="_blank">Photodune</a> and find just the right photos for your site at incredibly affordable prices', 'http://bit.ly/layers-photodune'), 'layerswp');
?>
            </div>
        </div>

        <div class="layers-row layers-content layers-discover-more-feature layers-push-bottom">
            <?php 
Esempio n. 5
0
<?php

// Get the API up and running for the plugin listing
$api = new Layers_API();
$layers_migrator = new Layers_Widget_Migrator();
$current_page = $_GET['page'];
// Get Site to Ping
$marketplace = 'layers-envato-marketplace' == $_GET['page'] ? 'envato' : 'layerswp';
// Get Product Type
$valid_types = array('stylekits', 'extensions', 'themes');
$type = isset($_GET['type']) ? $_GET['type'] : 'themes';
if (!in_array($type, $valid_types)) {
    return;
}
// Set link and header variables
switch ($type) {
    case 'stylekits':
        $excerpt = __('Style Kits', 'layerswp');
        $site_key = 'cc';
        break;
    case 'extensions':
        $excerpt = __('Extensions', 'layerswp');
        $site_key = 'cc';
        break;
    default:
        $excerpt = __('Themes', 'layerswp');
        $site_key = 'tf';
}
// Get product lists
$products = $api->get_product_list($marketplace, $type);
$fallback_url = 'http://bit.ly/layers-' . $type;
Esempio n. 6
0
<?php

// Fetch current user information
$user = wp_get_current_user();
// Get the API up and running for the extension listing
$api = new Layers_API();
?>

<section class="layers-area-wrapper">

	<?php 
$this->header(__('Dashboard', 'layerswp'));
?>

	<div class="layers-row layers-well layers-content-large">
		<div class="layers-container-large">


			<div class="layers-row">

				<div class="layers-column layers-span-4">

					<div class="layers-panel layers-content layers-push-bottom">
						<div class="layers-section-title layers-small">
							<h3 class="layers-heading"><?php 
_e('Start Using Layers', 'layerswp');
?>
</h3>
							<p class="layers-excerpt">
								<?php 
_e('Follow the easy steps to creating amazing layouts quickly and easily. ', 'layerswp');
Esempio n. 7
0
<?php

// Get the API up and running for the plugin listing
$api = new Layers_API();
$layers_migrator = new Layers_Widget_Migrator();
$valid_types = array('stylekits', 'extensions', 'themes');
$type = isset($_GET['type']) ? $_GET['type'] : 'themes';
if (!in_array($type, $valid_types)) {
    return;
}
switch ($type) {
    case 'stylekits':
        $excerpt = __('Style Kits', 'layerswp');
        $products = $api->get_stylekit_list();
        $site_key = 'cc';
        $fallback_url = 'http://bit.ly/layers-stylekits';
        break;
    case 'extensions':
        $excerpt = __('Extensions', 'layerswp');
        $products = $api->get_extension_list();
        $site_key = 'cc';
        $fallback_url = 'http://bit.ly/layers-extensions';
        break;
    default:
        $excerpt = __('Themes', 'layerswp');
        $products = $api->get_theme_list();
        $site_key = 'tf';
        $fallback_url = 'http://bit.ly/layers-themes';
}
wp_enqueue_script('accordion');
$all_authors = array();
Esempio n. 8
0
 function layers_api_init()
 {
     $layer_updater = new Layers_API();
     $layer_updater->init();
 }