Exemple #1
0
 function admin_bar_array()
 {
     $m = array();
     $suffix = pl_tools_active() ? 'down' : 'right';
     $m[] = array('pos' => 10, 'parent' => '', 'id' => 'pl-ab-menu', 'title' => sprintf('<i class="pl-icon pl-icon-pagelines"></i> <i class="pl-icon pl-icon-action pl-icon-caret-%s"></i>', $suffix), 'rel' => 'plBuilder', 'href' => PL()->urls->editor);
     $m[] = array('pos' => 50, 'id' => 'pl-ab-builder', 'title' => sprintf('<i class="pl-icon pl-icon-list-alt"></i> %s', __('Page Editor', 'pl-platform')), 'rel' => 'plBuilder', 'href' => PL()->urls->editor);
     if (pl_tools_active()) {
         $m[] = array('pos' => 300, 'id' => 'pl-ab-off', 'rel' => '_plDeactivate', 'title' => sprintf('<i class="pl-icon pl-icon-remove"></i> %s', __('Turn Off', 'pl-platform')), 'href' => esc_url(PL()->urls->deactivate));
     }
     $m = apply_filters('pl_ab_menu', $m);
     return apply_filters('pl_ab_menu_always', $m);
 }
Exemple #2
0
 function initialize_libs()
 {
     /** Config Classes */
     global $pl_page;
     $pl_page = new PL_Page();
     /** Maps Data */
     global $maps_data_handler;
     $maps_data_handler = new PL_Map_Data();
     /** Section Handling Classes */
     global $pl_sections_data;
     $pl_sections_data = new PL_Section_Data();
     pl_hook('pl_after_data_setup');
     /** The media library link and iFrame handling */
     global $pl_medialib;
     $pl_medialib = new PL_Media_Library();
     /** AJAX */
     global $plajaxinit;
     $plajaxinit = new PLAJAXInit();
     global $pl_data_save;
     $pl_data_save = new PL_Save_Data();
     /** Base AJAX Handling API */
     global $plajaxupload;
     $plajaxupload = new PLAJAXUpload();
     /** Sections AJAX Loading */
     global $plsectionsload;
     $plsectionsload = new PL_Sections_Load();
     /** BINDING */
     /** Binding and handling of binds */
     global $plbinding;
     $plbinding = new PL_Binding();
     if (pl_tools_active()) {
         do_action('pl_reset_sections');
         new PL_Workarea($this);
     } else {
         new PL_JSON();
         new PL_UI_Site();
     }
     // run installer init actions
     if (is_admin()) {
         PL()->operations->init();
     }
 }
Exemple #3
0
 /**
  * Get a refresh token
  */
 function refresh_token($refresh_token)
 {
     $data = $this->get_user_data_var('domain_data');
     $plugins = count(PL_Platform_Functions::pl_get_plugins(true, true));
     $args = array('endpoint' => 'token', 'token' => $refresh_token, 'token_name' => 'refresh_token', 'grant_type' => 'refresh_token', 'extra' => array('domain' => $this->get_site_domain(), 'user' => $this->get_user_data_var('user_login'), 'gf' => is_object($data) && $data->grandfathered ? $data->grandfathered : false, 'pro' => get_site_option('pl_site_registered', false), 'used' => is_object($data) && $data->used ? $data->used : 0, 'allowed' => is_object($data) && $data->allowed ? $data->allowed : 0, 'pro_plug' => $plugins, 'local' => pl_is_local(), 'version' => PL()->version));
     $response = $this->oauth_send_post($args);
     if (is_object($response) && isset($response->refresh_token)) {
         return $response;
     } else {
         // we got an error, send error back as message and defer for 1 hour.
         $data = $this->data();
         if (isset($data->user->token_expire)) {
             $data->user->token_expire = time() + 3600;
             $this->save_cache_data($data);
         }
         return 'error';
     }
 }
Exemple #4
0
 /**
  * Create the URL for action link
  */
 function product_file_action_url($p)
 {
     /** WC formatted download info */
     if (is_object($p->download_data)) {
         $download_data = reset($p->download_data);
         $download_link = isset($download_data->file) ? $download_data->file : 'No File';
     } else {
         $download_link = $p->download_data;
     }
     $args = array('install_type' => $p->install_type, 'name' => $p->post_title, 'download_link' => $download_link, 'slug' => $p->slug, 'installed' => false);
     if (isset($p->installed) && $p->installed) {
         $args['action'] = sprintf('upgrade-%s', $args['install_type']);
         $args['installed'] = true;
     }
     if (isset($p->version)) {
         $args['version'] = $p->version;
     }
     return PL()->operations->install_url($args);
 }
Exemple #5
0
 /**
  * Work out the installed licence and display buttons accordingly
  */
 function version($data, $ui)
 {
     $domain_data = $ui->platform->oauth->get_domains_data();
     $registered = $ui->platform->oauth->is_site_registered();
     $local_pro = $ui->platform->oauth->is_local_and_has_pro();
     $can_register = $ui->platform->oauth->can_register_site();
     $grandfathered = $ui->platform->oauth->is_grandfathered();
     $grandfathered_txt = '';
     // if user has NOT registered this domain and is able to
     if (!$registered) {
         $version = __('Free', 'pl-platform');
         $desc = __('Only free features and extensions are available.', 'pl-platform');
         if ($can_register) {
             $args = array('domain' => $ui->platform->oauth->get_site_domain(), 'action' => 'add_domain');
             $domain_format = PL_Platform()->oauth->get_domain_data_format();
             $action_url = PL_Platform()->url('account', $args);
             $txt = __('Activate Pro ', 'pl-platform') . $domain_format;
             $action_txt = sprintf('<i class="pl-icon pl-icon-bolt"></i> %s', $txt);
         } else {
             $action_url = PL()->urls->purchase;
             $txt = __('<strong>Get Pro License Now</strong>', 'pl-platform');
             $action_txt = sprintf('<i class="pl-icon pl-icon-shopping-cart"></i> %s', $txt);
         }
         $thumb = pl_framework_url('images') . '/thumb-free.png';
     } else {
         $version = __('Professional', 'pl-platform');
         $desc = __('All features are available. Yay!', 'pl-platform');
         $desc .= $local_pro ? __('<p>(<strong>Localhost and at least one pro license detected in account.</strong>)</p>', 'pl-platform') : '';
         $action_url = PL_Platform()->url('extend');
         $action_txt = sprintf('<i class="pl-icon pl-icon-download"></i> %s', __('Install New Extensions', 'pl-platform'));
         $thumb = pl_framework_url('images') . '/thumb-pro.png';
     }
     // see if user is grandfathered in to platform.
     if (true == $grandfathered) {
         $grandfathered_txt = sprintf(' (%s)', __('Grandfathered', 'pl-platform'));
     }
     $desc .= sprintf('<p><strong>%s</strong> of <strong>%s total</strong> Pro licenses available in your account%s</p>', $domain_data->remaining, $domain_data->allowed, $grandfathered_txt);
     if (0 == $domain_data->allowed) {
         $desc = sprintf('<p>%s</p>', __('There are no Pro licenses available in your account.', 'pl-platform'));
     }
     $actions = sprintf('<div class="actions"><a class="button button-primary" href="%s">%s</a> &nbsp; <a class="button" href="%s">%s</a></div>', $action_url, $action_txt, PL()->urls->pro, __('Learn More', 'pl-platform'));
     echo $ui->banner(array('classes' => 'banner-dashboard', 'title' => __('PageLines Version', 'pl-platform'), 'suphead' => sprintf("PageLines Version"), 'header' => sprintf("<strong>%s</strong>", $version), 'subhead' => $desc, 'content' => $actions, 'src' => $thumb));
     if ($registered && !pl_is_local()) {
         $content = sprintf('<p class="banner-subheader">You will have %s %s after a successful handoff.</p>', $domain_data->remaining + 1, _n('slot', 'slots', $domain_data->remaining + 1, 'pl-platform'));
         echo $ui->banner(array('classes' => 'banner-dashboard', 'title' => __('Switching Accounts', 'pl-platform'), 'suphead' => sprintf("Need to handoff to a client?"), 'subhead' => sprintf('Get your professional slot back by activating pro with any other account.'), 'header' => 'Switch Accounts', 'content' => $content));
     }
 }
Exemple #6
0
 function has_installed_something()
 {
     $plugin_count = PL()->operations->pl_plugins_count();
     return $plugin_count > 1 ? true : false;
 }
Exemple #7
0
    function welcome_message()
    {
        $store_url = sprintf('<a href="%s">%s</a>', PL_Platform()->url('store'), __('Extension Engine', 'pl-platform'));
        ob_start();
        ?>
    <div class="intro clearfix">
      <img class="theme-screen" src="<?php 
        echo pl_framework_url('images') . '/PL5.png';
        ?>
" />
      <h3><?php 
        _e('Welcome to PageLines', 'pl-platform');
        ?>
</h3>
      <p><?php 
        _e('Congratulations! You\'re running PageLines.<br/>PageLines adds insanely-fast editing and customization tools to your site.<br/> ', 'pl-platform');
        ?>
</p>
      <div class="clear" ></div>
    </div>

    <?php 
        if (PL_Platform()->is_oriented() && !PL_Platform()->is_pro()) {
            ?>

      <h3><?php 
            _e('You are using the free version.', 'pl-platform');
            ?>
</h3>
      <ul class="reference-list">
        <li>
          <div class="list-icon"><i class="pl-icon pl-icon-pagelines"></i></div>
          <h4><?php 
            _e('Get the most from PageLines with Pro.', 'pl-platform');
            ?>
</h4>
          <p>
            <?php 
            _e('Get all pro extensions plus more every month. Also updates, options &amp; support.', 'pl-platform');
            ?>
          </p>
          <p>
            <?php 
            if (!PL_Platform()->oauth->can_register_site()) {
                $getclass = 'primary';
                $actclass = 'disabled';
            } else {
                $getclass = 'secondary';
                $actclass = 'primary';
            }
            $domains = PL_Platform()->oauth->get_domain_data_format();
            ?>
            <a class="button button-<?php 
            echo $getclass;
            ?>
" target="_blank" href="<?php 
            echo PL()->urls->purchase;
            ?>
"><i class="pl-icon pl-icon-shopping-cart"></i>&nbsp;<?php 
            _e('Purchase Pro License', 'pl-platform');
            ?>
 <i class="pl-icon pl-icon-caret-right"></i></a>

            <a class="button button-<?php 
            echo $actclass;
            ?>
" target="_blank" href="<?php 
            echo PL_Platform()->url('account');
            ?>
">
              <i class="pl-icon pl-icon-bolt"></i>&nbsp;
              <?php 
            _e('Activate Pro', 'pl-platform');
            ?>
              <?php 
            printf('%s', $domains);
            ?>
              </a>
          </p>
        </li>
      </ul>

    <?php 
        }
        ?>

    <h3><?php 
        _e('What can you do with PageLines? Everything.', 'pl-platform');
        ?>
</h3>
    <ul class="reference-list">
      <li>
        <div class="list-icon"><i class="pl-icon pl-icon-bolt"></i></div>
        <h4><?php 
        _e('Quick Start: "Insanely Fast Design &amp; Editing"', 'pl-platform');
        ?>
</h4>
        <p>
          <?php 
        _e('Quickly learn how to customize in real time with no coding, debugging or frustration.', 'pl-platform');
        ?>
        </p>
        <p>
          <a class="button button-primary" target="_blank" href="<?php 
        echo PL()->urls->quickstart;
        ?>
"><i class="pl-icon pl-icon-video-camera"></i>&nbsp;<?php 
        _e('Quick Start Video', 'pl-platform');
        ?>
</a>
        </p>
      </li>
      <li>
        <div class="list-icon"><i class="pl-icon pl-icon-plug"></i></div>
        <h4><?php 
        _e('Do anything with the extension engine. Really.', 'pl-platform');
        ?>
</h4>
        <p>
          <?php 
        printf(__('PageLines is built to be extended. Add some with the %s.', 'pl-platform'), $store_url);
        ?>
        </p>
        <p>
          <a class="button button-secondary" href="<?php 
        echo PL_Platform()->url('extend');
        ?>
"><i class="pl-icon pl-icon-plug"></i> <?php 
        _e('Install New Extensions', 'pl-platform');
        ?>
</a>
        </p>
      </li>
      <li>
        <div class="list-icon"><i class="pl-icon pl-icon-slack"></i></div>
        <h4><?php 
        _e('Connect with the community.', 'pl-platform');
        ?>
</h4>
        <p>
          <?php 
        printf(__('Join the PageLines community channels for help, updates, and great conversation.', 'pl-platform'), $store_url);
        ?>
        </p>
        <p>
          <a class="button" target="_blank" href="http://www.pagelines.com/community"><i class="pl-icon pl-icon-slack"></i> <?php 
        _e('Community Overview', 'pl-platform');
        ?>
</a>
        </p>
      </li>
      <li>
        <div class="list-icon"><i class="pl-icon pl-icon-smile-o"></i></div>
        <h4><?php 
        _e('We love to help.', 'pl-platform');
        ?>
</h4>
        <p>
          <?php 
        printf(__('Check out the PageLines Forums or documentation resources.', 'pl-platform'), $store_url);
        ?>
        </p>
        <p>
          <a class="button" href="http://www.pagelines.com/support" target="_blank"><i class="pl-icon pl-icon-smile-o"></i> <?php 
        _e('Support Overview', 'pl-platform');
        ?>
</a>
        </p>
      </li>
      <li>
        <div class="list-icon"><img src="<?php 
        echo pl_framework_url('images') . '/avatar-powers.jpg';
        ?>
" /></div>
        <h4><?php 
        _e('A note from me...', 'pl-platform');
        ?>
</h4>
        <p><?php 
        _e("Good luck with your site. We're happy and excited for you. Don't forget that we're here to help and your feedback is always welcome.", 'pl-platform');
        ?>
 <a href="http://www.pagelines.com/about" target="_blank">About PageLines</a></p>
        <div class="signature">
          <p><?php 
        _e('Sincerely', 'pl-platform');
        ?>
,</p>
          <img src="<?php 
        echo pl_framework_url('images') . '/signature-founder.png';
        ?>
" />
          <div class="citation"><?php 
        _e('Andrew Powers, Founder', 'pl-platform');
        ?>
</div>
        </div>
      </li>
    </ul>
    
    <?php 
        return ob_get_clean();
    }
Exemple #8
0
function pl_cred()
{
    $cred = sprintf('<div class="pl-cred"><a href="%s" title="%s"><i class="pl-icon pl-icon-pagelines"></i></a></div>', PL()->urls->pagelines, __('Built With PageLines for WordPress', 'pl-platform'));
    if (pl_user_setting('hide_pl_cred') && true == pl_is_professional()) {
        $cred = '';
    }
    return apply_filters('pl_cred', $cred);
}