Ejemplo n.º 1
0
 function scripts()
 {
     pl_script('pl-site', pl_framework_url('js') . '/site.js', array('jquery'));
     pl_script('pl-common', pl_framework_url('js') . '/common.js');
     pl_style('pl-components', pl_framework_url('css') . '/components.css');
     //  wp_enqueue_media();
 }
Ejemplo n.º 2
0
 /**
  * Set Section Info
  *
  * Read information from the section header; assigns values found, or sets general default values if not
  *
  */
 function set_section_info($settings = array())
 {
     global $pl_sections_register;
     /** Set good defaults to allow maximum flexibility with overriding and creating multiple sections */
     $factory = $pl_sections_register->get_sections();
     $default_config = isset($factory['plugins'][$this->class_name]) ? $factory['plugins'][$this->class_name] : array();
     $default_settings = wp_parse_args($default_config, $pl_sections_register->default_headers());
     $this->settings = wp_parse_args($settings, $default_settings);
     if (isset($this->settings['id']) && !empty($this->settings['id'])) {
         $this->id = $this->settings['id'];
     } else {
         $this->id = str_replace('pl-section-', '', basename($this->settings['base_dir']));
     }
     /** Shorthand attributes: Set common section variables for easy use */
     $this->base_dir = $this->settings['base_dir'];
     $this->base_file = $this->settings['base_file'];
     $this->base_url = $this->settings['base_url'];
     $this->name = $this->settings['name'];
     $this->description = $this->settings['description'];
     $this->map = '';
     $this->set = '';
     $this->icon = $this->settings['icon'] = is_file(sprintf('%s/icon.png', $this->base_dir)) ? sprintf('%s/icon.png', $this->base_url) : pl_framework_url('images') . '/default-section-icon.png';
     /** Do localization for section */
     $langfile = sprintf('%s/%s.po', $this->base_dir, get_locale());
     if (is_file($langfile)) {
         load_textdomain($this->id, $langfile);
     }
     // set to true before ajax load
     $this->active_loading = false;
 }
Ejemplo n.º 3
0
 function admin_scripts()
 {
     wp_enqueue_media();
     pl_enqueue_color_picker();
     pl_load_codemirror(pl_framework_url('plugins'));
     wp_enqueue_script('pl-admin', pl_framework_url('js') . '/admin.js', array('jquery', 'wp-color-picker'));
     wp_enqueue_style('pl-components', pl_framework_url('css') . '/components.css');
     wp_enqueue_style('pl-admin', pl_framework_url('css') . '/admin.css');
     global $plfactory;
     $config = apply_filters('pl_admin_json', array('ajaxurl' => pl_ajax_url(), 'baseURL' => $this->base_url, 'cachekey' => $this->cache_key . $this->current_admin_page(), 'sections' => $plfactory->section_ids, 'security' => wp_create_nonce('pl-ajax-nonce'), 'extendURL' => PL_Platform()->url('extend')));
     wp_localize_script('pl-admin', 'PLAdmin', $config);
 }
Ejemplo n.º 4
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));
     }
 }
Ejemplo n.º 5
0
 /**
  * Process ajax response.
  */
 function ajax($response, $data)
 {
     $query = isset($data['queryVars']) ? $data['queryVars'] : array();
     if ('pros' == $query['special']) {
         $banner = pl_admin_banner(array('header' => '3rd Party Developers', 'subhead' => sprintf('Supported 3rd Party Extensions. Coming Soon!'), 'content' => '<a href="http://www.pagelines.com/developer/apply" class="button button-primary">Apply Now</a>', 'src' => pl_framework_url('images') . '/thumb-badge.png', 'classes' => 'banner-cards'));
         $response['cards'] = array('html' => $banner);
     } else {
         $cards = PL_Platform()->oauth->request('store', $query);
         $response['cards'] = $this->refine_cards($cards);
     }
     return $response;
 }
Ejemplo n.º 6
0
    function option_image_upload($o, $mode = 'image', $handling = 'url')
    {
        if ($handling == 'id' && !empty($o['val'])) {
            $att = wp_get_attachment_image_src($o['val']);
            $url = $att[0];
        } elseif (!empty($o['val'])) {
            $url = $o['val'];
        } else {
            $url = pl_framework_url('images') . '/image-preview.png';
        }
        $size = $mode == 'id' ? '14' : '36';
        $place = ucfirst($mode);
        $place .= $handling == 'id' ? ' ID' : ' URL';
        $button_text = $mode == 'file' ? 'Upload' : 'Select';
        $button_text = '' != $o['label'] ? $o['label'] : $button_text;
        ?>
    <label for="upload_image" class="image_uploader">
      <?php 
        if ('video' != $mode && 'audio' != $mode && 'file' != $mode) {
            ?>
      <div class="image_preview">
        <div class="image_preview_wrap pl-contrast">
          <img class="the_preview_image" src="<?php 
            echo $url;
            ?>
" />
        </div>
      </div>
      <?php 
        }
        ?>
      <div class="image_input">
          <input id="<?php 
        echo $o['id'];
        ?>
" class="upload_image_option pl-opt pl-form-control" type="text" size="<?php 
        echo $size;
        ?>
" name="<?php 
        echo $o['name'];
        ?>
" placeholder="<?php 
        echo $place;
        ?>
" value="<?php 
        echo $o['val'];
        ?>
" <?php 
        echo $o['required'];
        ?>
 />
          <p>
            <button class="button button-primary image_upload_button pl-form-image-upload" data-mode="<?php 
        echo $mode;
        ?>
" data-handling="<?php 
        echo $handling;
        ?>
"><i class="pl-icon pl-icon-upload"></i> <?php 
        echo $button_text;
        ?>
</button>
          </p>

      </div>
      <div class="clear"></div>
    </label>

    <?php 
    }
Ejemplo n.º 7
0
 function workarea_config()
 {
     global $pl_medialib, $pl_notifications;
     $a = array('siteName' => get_bloginfo('name'), 'siteDescription' => get_bloginfo('description'), 'plURL' => get_template_directory_uri(), 'siteURL' => do_shortcode('[pl_site_url]'), 'homeURL' => do_shortcode('[pl_home_url]'), 'uploadsURL' => do_shortcode('[pl_uploads_url]'), 'adminURL' => admin_url(), 'PLUI' => pl_framework_url('ui'), 'frontPage' => get_option('show_on_front', 'posts'), 'ajaxURL' => pl_ajax_url(), 'security' => wp_create_nonce('pl-ajax-nonce'), 'models' => array());
     $a['factory'] = $this->set_factory();
     // Edit current post URL
     $a['editPost'] = plns_edit_post_link();
     // Add menus URL
     $a['menus'] = admin_url("nav-menus.php");
     // Add/edit widgets URL
     $a['widgets'] = admin_url("widgets.php");
     // URL of core framework
     $a['CoreURL'] = get_template_directory_uri();
     // URL of parent theme
     $a['ParentStyleSheetURL'] = get_template_directory_uri();
     // URL of child theme, if active
     $a['ChildStyleSheetURL'] = get_stylesheet_directory_uri();
     $a['extendURL'] = function_exists('PL_Platform') ? PL_Platform()->url('extend') : '';
     // Media library link for use in iFrame
     $a['mediaLibrary'] = $pl_medialib->pl_media_library_link();
     //  Media library videos link for use in iFrame
     $a['mediaLibraryVideo'] = $pl_medialib->pl_media_library_link("video");
     // Add media link
     $a['addMediaURL'] = admin_url("media-new.php");
     // ID of the currently active user
     $a['userID'] = wp_get_current_user()->ID;
     // A cache key for various settings
     $a['CacheKey'] = pl_cache_key();
     // Is the user on localhost
     $a['LocalHost'] = pl_is_local();
     // Is developer mode activated?
     $a['debug'] = pl_dev_mode() ? 'true' : 'false';
     $a['btns'] = pl_btn_classes();
     $a['btnSizes'] = pl_button_sizes();
     $a['imgSizes'] = get_intermediate_image_sizes();
     $a['animations'] = pl_animations();
     $a['taxes'] = pl_get_taxonomies();
     $a['icons'] = pl_icons();
     $a['menus'] = pl_get_menus();
     $a['sidebars'] = pl_get_sidebars();
     $a['notifications'] = $pl_notifications;
     $a['urls'] = pl_get_system_urls();
     $a['translate'] = array();
     $a['locale'] = get_locale();
     return apply_filters('pl_workarea_json', $a);
 }
Ejemplo n.º 8
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();
    }
Ejemplo n.º 9
0
function pl_favicon()
{
    // WP 4.3 added favicons to core, if its available then let WP take over here.
    if (function_exists('wp_site_icon') && has_site_icon()) {
        return false;
    }
    $favicon = pl_user_setting('pl_favicon', pl_framework_url('images') . '/default-favicon.png');
    return sprintf('<link rel="shortcut icon" href="%s" type="image/x-icon" />%s', $favicon, "\n");
}