function pagelines_check_install() { $install = false; $url = add_query_arg(array('edtr' => 'on', 'toolbox' => 'open'), site_url()); if (isset($_REQUEST['pl-install-theme']) && !pl_is_wporg()) { $install = true; } if (is_admin()) { global $pagenow; if (is_customize_preview()) { return false; } if (isset($_REQUEST['activated']) && $pagenow == "themes.php" && !pl_is_wporg()) { $install = true; } if (isset($_REQUEST['activated']) && $pagenow == "themes.php" && pl_is_wporg()) { add_action('admin_notices', array($this, 'install_notice')); $install = false; } if (pl_is_wporg() && isset($_REQUEST['i-love-wporg'])) { $install = true; } } if ($install == true) { // Simon why do we need this?? if (get_theme_mod('pl_installed')) { wp_redirect($url); exit; } else { $url = $this->run_installation_routine(); wp_redirect($url); exit; } } }
function pl_karma($id = false, $args = array()) { if (pl_is_wporg()) { return false; } global $pl_karma; return $pl_karma->add_karma($id, $args); }
function __construct() { if (!pl_is_wporg()) { $this->settings['basic_settings'] = array('name' => __('Site Images', 'pagelines'), 'icon' => 'icon-picture', 'pos' => 2, 'opts' => $this->basic()); } $this->settings['social_media'] = array('name' => __('Social <span class="spamp">&</span> Local', 'pagelines'), 'icon' => 'icon-comments', 'pos' => 5, 'opts' => $this->social()); $this->settings['advanced'] = array('name' => __('Advanced', 'pagelines'), 'icon' => 'icon-wrench', 'pos' => 50, 'opts' => $this->advanced()); $this->settings['resets'] = array('name' => __('Resets', 'pagelines'), 'icon' => 'icon-undo', 'pos' => 55, 'opts' => $this->resets()); }
function updater_install() { $screen = get_current_screen(); if (pl_is_wporg() && 'appearance_page_PageLines-Admin' != $screen->id) { return false; } $message = pl_updater_txt(); if ($message) { echo '<div class="updated fade"><p>' . $message . '</p></div>' . "\n"; } }
function dms_update_two_point_ohh() { if (!is_user_logged_in()) { return false; } if (pl_is_wporg()) { return false; } // run the 2.0 install routine. $install = new PageLinesInstall(); $url = $install->run_installation_routine(); wp_safe_redirect($url); exit; }
function default_region($region) { $d = array(); if ($region == 'header') { $d = array(array('content' => array())); } elseif ($region == 'fixed') { $nav = pl_is_wporg() ? 'PLNavBar' : 'PLNavi'; $d = array(array('object' => $nav)); } elseif ($region == 'footer') { $d = array(array('content' => array(array('object' => 'SimpleNav')))); } elseif ($region == 'template') { $d = array(pl_default_template()); } return $d; }
function pagelines_check_install() { $install = false; if (isset($_REQUEST['pl-install-theme']) && !pl_is_wporg()) { $install = true; } if (is_admin()) { global $pagenow; if ($pagenow == 'customize.php') { if (pl_is_wporg()) { // customizer wont work, so just redirect to front page. wp_safe_redirect(site_url()); exit; } else { $install = true; } } if (isset($_REQUEST['activated']) && $pagenow == "themes.php" && !pl_is_wporg()) { $install = true; } if (isset($_REQUEST['activated']) && $pagenow == "themes.php" && pl_is_wporg()) { add_action('admin_notices', array($this, 'install_notice')); $install = false; } if (pl_is_wporg() && isset($_REQUEST['i-love-wporg'])) { $install = true; } } if ($install == true) { // Simon why do we need this?? // if( get_theme_mod( 'pl_installed' ) ) // return false; $url = $this->run_installation_routine(); wp_redirect($url); exit; } }
function pl_fix_login_image() { if (pl_is_wporg()) { return false; } $image_url = pl_setting('pl_login_image') ? pl_setting('pl_login_image') : PL_IMAGES . '/default-login-image.png'; $css = sprintf('body #login h1 a{background: url(%s) no-repeat top center;height: 80px; background-size:auto; width:auto;}', $image_url); inline_css_markup('pagelines-login-css', $css); }
function json_blob() { ob_start(); ?> <script> !function ($) { $.pl = { data: { list: <?php echo json_encode(pl_arrays_to_objects($this->sections_data)); ?> , local: <?php echo json_encode(pl_arrays_to_objects($this->current_page_data('local'))); ?> , type: <?php echo json_encode(pl_arrays_to_objects($this->current_page_data('type'))); ?> , global: <?php echo json_encode(pl_arrays_to_objects($this->current_page_data('global'))); ?> } , flags: { refreshOnSave: false , savingDialog: 'Saving' , refreshingDialog: 'Success! Reloading page' , layoutMode: '<?php echo $this->layout->get_layout_mode(); ?> ' , saving: false } , lang: function( args ){ var gt = new Gettext() return gt.gettext( args ) } , config: { userID: '<?php echo $this->get_user_id(); ?> ' , currentURL: '<?php echo $this->current_url(); ?> ' , siteURL: '<?php echo site_url(); ?> ' , nonce: '<?php echo wp_create_nonce("tgmpa-install"); ?> ' , pageTemplate: '<?php echo $this->page->template; ?> ' , templateMode: '<?php echo $this->page->template_mode(); ?> ' , pageID: '<?php echo $this->page->id; ?> ' , typeID: '<?php echo $this->page->typeid; ?> ' , pageTypeID: '<?php echo $this->page->type; ?> ' , pageTypeName: '<?php echo $this->page->type_name; ?> ' , devMode: <?php echo $this->get_dev_mode(); ?> , CacheKey: '<?php echo pl_get_cache_key(); ?> ' , isSpecial: '<?php echo $this->page->is_special(); ?> ' , isPro: <?php echo pl_is_wporg() ? "false\n" : "true\n"; ?> , opts: <?php echo json_encode(pl_arrays_to_objects($this->get_options_config())); ?> , settings: <?php echo json_encode(pl_arrays_to_objects($this->siteset->get_set('site'))); ?> , panels: <?php echo json_encode(pl_arrays_to_objects($this->get_panels_settings())); ?> , fonts: <?php echo json_encode(pl_arrays_to_objects($this->foundry->get_foundry())); ?> , menus: <?php echo json_encode(pl_arrays_to_objects($this->get_wp_menus())); ?> , extensions: <?php echo json_encode(pl_arrays_to_objects($this->extensions->get_list())); ?> , icons: <?php echo json_encode(pl_arrays_to_objects(pl_icon_array())); ?> , btns: <?php echo json_encode(pl_arrays_to_objects(pl_button_classes())); ?> , themes: <?php echo json_encode(pl_arrays_to_objects(pl_theme_classes())); ?> , imgSizes: <?php echo json_encode(pl_arrays_to_objects(pl_get_image_sizes())); ?> , animations: <?php echo json_encode(pl_arrays_to_objects(pl_animation_array())); ?> , taxes: <?php echo json_encode(pl_arrays_to_objects(pl_get_all_taxonomies())); ?> , urls: { adminURL: '<?php echo admin_url(); ?> ' , editPost: '<?php echo $this->edit_post_link(); ?> ' , menus: '<?php echo admin_url("nav-menus.php"); ?> ' , widgets: '<?php echo $this->edit_post_link(); ?> ' , CoreURL: '<?php echo pl_get_template_directory_uri(); ?> ' , ParentStyleSheetURL: '<?php echo get_template_directory_uri(); ?> ' , ChildStyleSheetURL: '<?php echo get_stylesheet_directory_uri(); ?> ' , siteURL: '<?php echo home_url(); ?> ' , mediaLibrary: '<?php echo pl_media_library_link(); ?> ' , mediaLibrary: '<?php echo pl_media_library_link(); ?> ' , mediaLibraryVideo: '<?php echo pl_media_library_link("video"); ?> ' , addMedia: '<?php echo admin_url("media-new.php"); ?> ' } <?php echo $this->json_blob_objects(); ?> } } }(window.jQuery); </script> <?php if (defined('PL_DEV') && PL_DEV) { pl_add_perform_data(ob_get_length(), __('Data Length', 'pagelines'), __('Characters', 'pagelines'), __('The total number of characters in the data blob. Watching size can be good to detect data leaks or other strange behavior.', 'pagelines')); } echo apply_filters('pl_data_blob', ob_get_clean()); }
function is_free_version() { return function_exists('pl_is_wporg') && pl_is_wporg() ? true : false; }
function pl_updater_txt() { if (!is_super_admin()) { return false; } $install_txt = __('Install the PageLines Updater plugin</a> to activate a key and get updates for your PageLines themes and plugins.', 'pagelines'); $activate_txt = __('Activate the PageLines Updater plugin</a> to activate your key and get updates for your PageLines themes and plugins.', 'pagelines'); if (pl_is_wporg()) { $install_txt = __('Install the PageLines Updater plugin</a> to upgrade to the Pro edition and get updates direct from PageLines.', 'pagelines'); $activate_txt = __('Activate the PageLines Updater plugin</a> to upgrade to the Pro edition and get updates direct from PageLines.', 'pagelines'); } //normal $active_plugins = apply_filters('active_plugins', get_option('active_plugins')); if (in_array('pagelines-updater/pagelines-updater.php', $active_plugins)) { return false; } // ms if (!function_exists('is_plugin_active_for_network')) { require_once ABSPATH . '/wp-admin/includes/plugin.php'; } if (is_plugin_active_for_network('pagelines-updater/pagelines-updater.php')) { return false; } if (!pl_check_updater_exists()) { $install_url = wp_nonce_url(network_admin_url('update.php?action=install-plugin&plugin=pagelines-updater'), 'install-plugin_pagelines-updater'); $message = sprintf('<a class="btn btn-mini btn-warning" href="%s"> %s', esc_url($install_url), $install_txt); } else { // installed... $activate_url = 'plugins.php?action=activate&plugin=' . urlencode('pagelines-updater/pagelines-updater.php') . '&plugin_status=all&paged=1&s&_wpnonce=' . urlencode(wp_create_nonce('activate-plugin_pagelines-updater/pagelines-updater.php')); $message = sprintf('<a class="btn btn-mini btn-warning" href="%s">%s', esc_url(network_admin_url($activate_url)), $activate_txt); } return $message; }