diff --git a/admin/actions.admin.php b/admin/actions.admin.php
index f0c6aee9..b174a3ad 100644
--- a/admin/actions.admin.php
+++ b/admin/actions.admin.php
@@ -5,7 +5,7 @@
/**
* Show Options Panel after theme activation
- *
+ *
* @package PageLines Framework
* @subpackage Redirects
* @since 1.0.0
@@ -15,7 +15,7 @@
/**
* Add Javascript for Layout Controls from the Layout UI class
- *
+ *
* @package PageLines Framework
* @subpackage LayoutUI
* @since 2.0.b3
@@ -37,9 +37,9 @@
* @return string
*/
function pagelines_admin_body_class( $class ){
-
+
$class = $class.'pagelines_ui';
-
+
return $class;
}
/**
@@ -64,7 +64,7 @@ function pagelines_check_php(){
*
* AJAX OPTION SAVING
* Used to save via AJAX theme options and image uploads
- *
+ *
* @package PageLines Framework
* @since 1.2.0
*/
@@ -78,33 +78,33 @@ function pagelines_ajax_callback() {
$setting = $_POST['setting'];
$button_id = $_POST['oid'];
- $pieces = explode( 'OID', $_POST['oid'] );
+ $pieces = explode( 'OID', $_POST['oid'] );
$oid = $pieces[0];
$parent_oid = ( isset($pieces[1]) ) ? $pieces[1] : null;
// Uploads
if( $save_type == 'upload' ) {
-
-
+
+
$arr_file_type = wp_check_filetype( basename( $_FILES[$button_id]['name'] ));
-
+
$uploaded_file_type = $arr_file_type['type'];
-
+
// Set an array containing a list of acceptable formats
$allowed_file_types = array( 'image/jpg','image/jpeg','image/gif','image/png', 'image/x-icon');
-
+
if( in_array( $uploaded_file_type, $allowed_file_types ) ) {
$filename = $_FILES[ $button_id ];
- $filename['name'] = preg_replace( '/[^a-zA-Z0-9._\-]/', '', $filename['name'] );
-
+ $filename['name'] = preg_replace( '/[^a-zA-Z0-9._\-]/', '', $filename['name'] );
+
$override['test_form'] = false;
- $override['action'] = 'wp_handle_upload';
-
+ $override['action'] = 'wp_handle_upload';
+
$uploaded_file = wp_handle_upload( $filename, $override );
-
+
$upload_tracking[] = $button_id;
-
+
plupop( $oid, $uploaded_file['url'], array( 'setting' => $setting, 'parent' => $parent_oid ) );
$name = 'PageLines- ' . addslashes( $filename['name'] );
@@ -120,24 +120,24 @@ function pagelines_ajax_callback() {
$attach_id = wp_insert_attachment( $attachment, $uploaded_file['file'] );
$attach_data = wp_generate_attachment_metadata( $attach_id, $uploaded_file['file'] );
wp_update_attachment_metadata( $attach_id, $attach_data );
-
+
} else
$uploaded_file['error'] = __( 'Unsupported file type!', 'pagelines' );
-
+
if( !empty( $uploaded_file['error'] ) )
echo sprintf( __('Upload Error: %s', 'pagelines' ) , $uploaded_file['error'] );
else{
//print_r($r);
echo $uploaded_file['url']; // Is the Response
-
+
}
} elseif( $save_type == 'image_reset' ){
plupop( $oid, null, array( 'setting' => $setting, 'parent' => $parent_oid ) );
}
-
+
die();
}
-
+
/**
* (AJAX) Save Template Map
*
@@ -176,12 +176,12 @@ function ajax_save_template_map() {
save_template_map( $templatemap );
PageLinesRenderCSS::flush_version( false );
-
+
echo true;
die();
}
-
+
/**
* Ajax Save Options Callback
*
@@ -214,7 +214,7 @@ function pagelines_ajax_save_option_callback() {
*/
add_action( 'admin_init', 'pagelines_inline_help' );
function pagelines_inline_help() {
-
+
$pl_help = new PageLines_Inline_Help;
}
@@ -266,13 +266,13 @@ function pl_post_columns($columns) {
function pl_posts_show_columns($name) {
global $post;
switch ($name) {
-
+
case 'feature':
if( has_post_thumbnail( $post->ID )) {
the_post_thumbnail( array(48,48) );
}
-
- break;
+
+ break;
}
}
@@ -292,17 +292,17 @@ function pl_page_show_columns($name) {
switch ($name) {
case 'template':
$template = get_post_meta( $post->ID, '_wp_page_template', true );
-
- if ( 'default' == $template ) {
+
+ if ( 'default' == $template ) {
_e( 'Default', 'pagelines' );
break;
}
$file = sprintf( '%s/%s', PL_PARENT_DIR, $template );
-
+
if ( !is_file( $file ) )
$file = sprintf( '%s/%s', CHILD_DIR, $template );
-
+
if ( !is_file( $file ) ) {
printf( '%s ', admin_url( sprintf( 'post.php?post=%s&action=edit', $post->ID ) ), __( 'No Template Assigned', 'pagelines' ) ) ;
break;
@@ -314,16 +314,16 @@ function pl_page_show_columns($name) {
$template = $data['name'];
else
$template = __( 'Default', 'pagelines' );
-
+
echo $template;
break;
-
+
case 'feature':
if( has_post_thumbnail( $post->ID )) {
the_post_thumbnail( array(48,48) );
}
-
- break;
+
+ break;
}
}
diff --git a/admin/actions.options.php b/admin/actions.options.php
index 1f87d8c3..f35cdf0c 100644
--- a/admin/actions.options.php
+++ b/admin/actions.options.php
@@ -1,4 +1,4 @@
-& Drop", 'pagelines' ), 'edit_theme_options', 'pagelines_templates', 'pagelines_build_templates_interface' );
-
+
$_pagelines_ext_hook = pagelines_insert_menu( PL_MAIN_DASH, __( 'Extend', 'pagelines' ), 'edit_theme_options', PL_ADMIN_STORE_SLUG, 'pagelines_build_extension_interface' );
-
+
}
-
+
}
/**
- *
+ *
* PageLines menu wrapper
*/
function pagelines_insert_menu( $page_title, $menu_title, $capability, $menu_slug, $function ) {
@@ -56,7 +56,7 @@ function pagelines_insert_menu( $page_title, $menu_title, $capability, $menu_slu
/**
* Full version menu wrapper.
- *
+ *
*/
function pagelines_add_admin_menu() {
global $menu;
@@ -76,7 +76,7 @@ function pagelines_add_admin_menu() {
* @TODO document
*
*/
-function pagelines_build_option_interface(){
+function pagelines_build_option_interface(){
pagelines_register_hook( 'pagelines_before_optionUI' );
$args = array(
'sanitize' => 'pagelines_settings_callback',
@@ -88,21 +88,21 @@ function pagelines_build_option_interface(){
* Build Extension Interface
* Will handle adding additional sections, plugins, child themes
*/
-function pagelines_build_templates_interface(){
-
+function pagelines_build_templates_interface(){
+
$args = array(
- 'title' => __( "Drag & Drop Template Setup", 'pagelines' ),
+ 'title' => __( "Drag & Drop Template Setup", 'pagelines' ),
'settings' => PAGELINES_TEMPLATES,
'callback' => 'templates_array',
'basic_reset' => true,
- 'reset_cb' => 'reset_templates_to_default',
- 'show_save' => false,
- 'show_reset' => false,
+ 'reset_cb' => 'reset_templates_to_default',
+ 'show_save' => false,
+ 'show_reset' => false,
'tabs' => false
);
-
+
$optionUI = new PageLinesOptionsUI( $args );
-
+
}
@@ -110,14 +110,14 @@ function pagelines_build_templates_interface(){
* Build Extension Interface
* Will handle adding additional sections, plugins, child themes
*/
-function pagelines_build_extension_interface(){
-
+function pagelines_build_extension_interface(){
+
$args = array(
- 'title' => __( 'The PageLines Store', 'pagelines' ),
+ 'title' => __( 'The PageLines Store', 'pagelines' ),
'settings' => PAGELINES_EXTENSION,
'callback' => 'extension_array',
- 'show_save' => false,
- 'show_reset' => false,
+ 'show_save' => false,
+ 'show_reset' => false,
'fullform' => false,
'reset_store' => true
);
@@ -128,16 +128,16 @@ function pagelines_build_extension_interface(){
* Build Extension Interface
* Will handle adding additional sections, plugins, child themes
*/
-function pagelines_build_account_interface(){
-
+function pagelines_build_account_interface(){
+
global $account_control;
-
+
$args = array(
'title' => __( 'PageLines Dashboard', 'pagelines' ),
'settings' => PAGELINES_ACCOUNT,
'callback' => array( $account_control, 'pagelines_account_array' ),
- 'show_save' => false,
- 'show_reset' => false,
+ 'show_save' => false,
+ 'show_reset' => false,
'fullform' => false,
);
$optionUI = new PageLinesOptionsUI( $args );
@@ -148,13 +148,13 @@ function pagelines_build_account_interface(){
* Build Meta Interface
* Will handle meta for non-meta pages.. e.g. tags, categories
*/
-function pagelines_build_special(){
-
+function pagelines_build_special(){
+
$args = array(
- 'title' => __( 'Page Option Setup', 'pagelines' ),
+ 'title' => __( 'Page Option Setup', 'pagelines' ),
'settings' => PAGELINES_SPECIAL,
'callback' => 'special_page_settings_array',
- 'show_reset' => false,
+ 'show_reset' => false,
'basic_reset' => true
);
$optionUI = new PageLinesOptionsUI( $args );
@@ -177,14 +177,14 @@ function pagelines_theme_settings_init() {
global $_pagelines_special_hook;
global $_pagelines_templates_hook;
global $_pagelines_account_hook;
-
+
// Call only on PL pages
add_action( "admin_print_scripts-{$_pagelines_options_page_hook}", 'pagelines_theme_settings_scripts' );
add_action( "admin_print_scripts-{$_pagelines_ext_hook}", 'pagelines_theme_settings_scripts' );
add_action( "admin_print_scripts-{$_pagelines_special_hook}", 'pagelines_theme_settings_scripts' );
add_action( "admin_print_scripts-{$_pagelines_templates_hook}", 'pagelines_theme_settings_scripts' );
add_action( "admin_print_scripts-{$_pagelines_account_hook}", 'pagelines_theme_settings_scripts' );
-
+
// WordPress Page types
add_action( 'load-post.php', 'pagelines_theme_settings_scripts' );
add_action( 'load-post-new.php', 'pagelines_theme_settings_scripts' );
@@ -200,22 +200,22 @@ function pagelines_theme_settings_init() {
*
*/
function pagelines_theme_settings_scripts() {
-
+
// Add Body Class
add_filter( 'admin_body_class', 'pagelines_admin_body_class' );
wp_enqueue_script( 'jquery-ajaxupload', PL_ADMIN_JS . '/jquery.ajaxupload.js', array( 'jquery' ), PL_CORE_VERSION );
- wp_enqueue_script( 'jquery-cookie', PL_ADMIN_JS . '/jquery.ckie.js', array( 'jquery' ), PL_CORE_VERSION );
+ wp_enqueue_script( 'jquery-cookie', PL_ADMIN_JS . '/jquery.ckie.js', array( 'jquery' ), PL_CORE_VERSION );
wp_enqueue_script( 'jquery-ui-core' );
wp_enqueue_script( 'jquery-ui-tabs' );
wp_enqueue_script( 'jquery-ui-dialog' );
wp_enqueue_script( 'script-pagelines-settings', PL_ADMIN_JS . '/script.settings.js', array( 'jquery' ), PL_CORE_VERSION );
wp_enqueue_script( 'jquery-ui-effects', PL_ADMIN_JS . '/jquery.effects.js', array( 'jquery' ), PL_CORE_VERSION ); // just has highlight effect
- wp_enqueue_script( 'jquery-ui-draggable' );
+ wp_enqueue_script( 'jquery-ui-draggable' );
wp_enqueue_script( 'jquery-ui-sortable' );
- wp_enqueue_script( 'script-pagelines-common', PL_ADMIN_JS . '/script.common.js', array( 'jquery' ), PL_CORE_VERSION );
-
+ wp_enqueue_script( 'script-pagelines-common', PL_ADMIN_JS . '/script.common.js', array( 'jquery' ), PL_CORE_VERSION );
+
// Prettify
wp_enqueue_script( 'codemirror', PL_ADMIN_JS . '/codemirror/codemirror.js', array( 'jquery' ), PL_CORE_VERSION );
wp_enqueue_script( 'codemirror-css', PL_ADMIN_JS . '/codemirror/css/css.js', array( 'jquery' ), PL_CORE_VERSION );
@@ -224,33 +224,33 @@ function pagelines_theme_settings_scripts() {
wp_enqueue_script( 'codemirror-xml', PL_ADMIN_JS . '/codemirror/xml/xml.js', array( 'jquery' ), PL_CORE_VERSION );
wp_enqueue_script( 'codemirror-html', PL_ADMIN_JS . '/codemirror/htmlmixed/htmlmixed.js', array( 'jquery' ), PL_CORE_VERSION );
wp_enqueue_style( 'codemirror', PL_ADMIN_JS . '/codemirror/codemirror.css' );
-
+
// Color Picker
wp_enqueue_script( 'colorpicker-js', PL_ADMIN_JS . '/colorpicker/js/colorpicker.js', array( 'jquery' ), PL_CORE_VERSION );
- wp_enqueue_style( 'colorpicker', PL_ADMIN_JS . '/colorpicker/css/colorpicker.css' );
+ wp_enqueue_style( 'colorpicker', PL_ADMIN_JS . '/colorpicker/css/colorpicker.css' );
wp_enqueue_script( 'jquery-colorbox', PL_ADMIN_JS . '/colorbox/jquery.colorbox-min.js', array( 'jquery' ), PL_CORE_VERSION );
- wp_enqueue_style( 'colorbox', PL_ADMIN_JS . '/colorbox/colorbox.css' );
-
- wp_enqueue_script( 'thickbox' );
- wp_enqueue_style( 'thickbox' );
-
+ wp_enqueue_style( 'colorbox', PL_ADMIN_JS . '/colorbox/colorbox.css' );
+
+ wp_enqueue_script( 'thickbox' );
+ wp_enqueue_style( 'thickbox' );
+
wp_enqueue_script( 'jquery-layout', PL_ADMIN_JS . '/jquery.layout.js', array( 'jquery' ), PL_CORE_VERSION );
-
+
$custom_css = array(
'lineNumbers' => true,
'mode' => 'text/x-less',
- 'lineWrapping' => true,
+ 'lineWrapping' => true,
);
-
+
$headers = array(
'lineNumbers' => true,
'mode' => 'text/html',
'lineWrapping' => true,
- );
-
+ );
+
wp_localize_script( 'script-pagelines-common', 'cm_customcss', apply_filters( 'pagelines_customcss_cm_options', $custom_css ) );
wp_localize_script( 'script-pagelines-common', 'cm_headers', apply_filters( 'pagelines_headerscripts_cm_options', $headers ) );
}
@@ -263,13 +263,13 @@ function pagelines_theme_settings_scripts() {
*
*/
function load_head(){
-
+
// Admin CSS
printf( ' ', PL_ADMIN_CSS, PL_CORE_VERSION );
-
-
-
- if( ploption( 'pagelines_favicon' ) )
+
+
+
+ if( ploption( 'pagelines_favicon' ) )
printf( ' ', ploption( 'pagelines_favicon' ) );
// Load on PageLines pages
@@ -287,12 +287,12 @@ function load_head(){
*
*/
function pagelines_register_settings() {
-
-
+
+
register_setting( PAGELINES_SETTINGS, PAGELINES_SETTINGS, 'pagelines_settings_callback' );
register_setting( PAGELINES_SPECIAL, PAGELINES_SPECIAL );
register_setting( PAGELINES_TEMPLATES, PAGELINES_TEMPLATES );
-
+
/* Typography Options */
$GLOBALS['pl_foundry'] = new PageLinesFoundry;
@@ -302,40 +302,40 @@ function pagelines_register_settings() {
pagelines_import_export();
pagelines_process_reset_options();
-
+
if ( !isset($_REQUEST['page'] ) || $_REQUEST['page'] != 'pagelines' )
return;
-
- global $new_default_settings;
-
+
+ global $new_default_settings;
+
/*
New Default Options in Child Themes
*/
if( !isset( $_GET['newoptions'] ) && pagelines_activate_or_reset() && !empty($new_default_settings ) ){
-
+
$type = sprintf( '&%s=true', pagelines_activate_or_reset() );
-
+
foreach( $new_default_settings as $key => $set )
plupop( $set['key'], $set['value'], array( 'parent' => $set['parent'], 'subkey' => $set['subkey'], 'setting' => $set['setting'] ) );
-
+
wp_redirect( admin_url( PL_SETTINGS_URL.'&newoptions=true'.$type ) );
}
-
+
/*
Handle Reset of Options
*/
if ( ploption( 'reset') ) {
-
+
update_option( PAGELINES_SETTINGS, pagelines_settings_defaults() );
-
+
global $extension_control;
-
+
$extension_control->flush_caches();
-
+
wp_redirect( admin_url( PL_SETTINGS_URL.'&reset=true' ) );
-
+
exit;
-
+
}
}
@@ -349,7 +349,7 @@ function pagelines_register_settings() {
*
*/
function pagelines_enable_debug( $option_array ) {
-
+
$debug = new PageLinesDebug;
$debug_option_array['debug'] = array(
'debug_info' => array(
@@ -367,91 +367,91 @@ function pagelines_enable_debug( $option_array ) {
*
*/
function pagelines_admin_confirms(){
-
+
$confirms = array();
-
+
if( isset( $_GET['settings-updated'] ) )
$confirms[]['text'] = sprintf( __( "%s Settings Saved. View Your Site → ", 'pagelines' ), PL_NICECHILDTHEMENAME, home_url() );
if( isset($_GET['pageaction']) ){
-
+
if( $_GET['pageaction']=='activated' && !isset($_GET['settings-updated']) ){
$confirms['activated']['text'] = sprintf( __( 'Congratulations! %s Has Been Successfully Activated.', 'pagelines' ), PL_NICECHILDTHEMENAME );
$confirms['activated']['class'] = 'activated';
}
-
+
elseif( $_GET['pageaction']=='import' && isset($_GET['imported'] )){
$confirms['settings-import']['text'] = __( 'Congratulations! New settings have been successfully imported.', 'pagelines' );
$confirms['settings-import']['class'] = "settings-import";
}
-
+
elseif( $_GET['pageaction']=='import' && isset($_GET['error']) && !isset($_GET['settings-updated']) ){
$confirms['settings-import-error']['text'] = __( 'There was an error with import. Please make sure you are using the correct file.', 'pagelines' );
}
-
+
}
-
+
if( isset( $_GET['reset'] ) ){
-
+
if( isset( $_GET['opt_id'] ) && $_GET['opt_id'] == 'resettemplates' )
$confirms['reset']['text'] = __( 'Template Configuration Restored To Default.', 'pagelines' );
-
+
elseif( isset($_GET['opt_id'] ) && $_GET['opt_id'] == 'resetlayout' )
$confirms['reset']['text'] = __( 'Layout Dimensions Restored To Default.', 'pagelines' );
else
$confirms['reset']['text'] = __( 'Settings Restored To Default.', 'pagelines' );
-
+
}
if ( isset( $_GET['plinfo'] ) )
$confirms[]['text'] = __( 'Launchpad settings saved.', 'pagelines' );
-
+
if ( isset( $_GET['extend_upload'] ) )
$confirms[]['text'] = sprintf( __( 'Successfully uploaded your %s', 'pagelines' ), $_GET['extend_upload'] );
-
+
if ( isset( $_GET['extend_text'] ) )
switch( $_GET['extend_text'] ) {
-
+
case 'section_delete':
$confirms[]['text'] = __( 'Section was deleted.', 'pagelines' );
break;
-
+
case 'section_install':
$confirms[]['text'] = __( 'Section was installed.', 'pagelines' );
break;
-
+
case 'section_upgrade':
$confirms[]['text'] = __( 'Section was upgraded.', 'pagelines' );
break;
-
+
case 'plugin_install':
$confirms[]['text'] = __( 'Plugin was installed.', 'pagelines' );
break;
-
+
case 'plugin_delete':
$confirms[]['text'] = __( 'Plugin was deleted.', 'pagelines' );
break;
-
+
case 'plugin_upgrade':
$confirms[]['text'] = __( 'Plugin was upgraded.', 'pagelines' );
break;
-
+
case 'theme_install':
$confirms[]['text'] = __( 'Theme installed.', 'pagelines' );
break;
-
+
case 'theme_upgrade':
$confirms[]['text'] = __( 'Theme upgraded.', 'pagelines' );
break;
case 'theme_delete';
$confirms[]['text'] = __( 'Theme deleted.', 'pagelines' );
break;
-
+
}
if ( ! empty( $confirms ) )
do_action( 'extend_flush' );
-
+
return apply_filters( 'pagelines_admin_confirms', $confirms );
-
+
}
@@ -461,22 +461,22 @@ function pagelines_admin_confirms(){
* @TODO document
*
*/
-function pagelines_draw_confirms(){
-
+function pagelines_draw_confirms(){
+
$confirms = pagelines_admin_confirms();
$save_text = sprintf( '%s Settings Saved. View Your Site → ', PL_NICECHILDTHEMENAME, home_url());
printf( '
', $save_text);
if( !empty( $confirms ) ){
foreach ( $confirms as $c ){
-
+
$class = ( isset($c['class'] ) ) ? $c['class'] : null;
-
+
printf( '', $class, $c['text'] );
}
}
-}
+}
/**
@@ -485,33 +485,33 @@ function pagelines_draw_confirms(){
*
*/
function pagelines_admin_errors(){
-
+
$errors = array();
-
+
if( ie_version() && ie_version() < 8){
-
+
$errors['ie']['title'] = sprintf( __( 'You are using Internet Explorer version: %s', 'pagelines' ), ie_version() );
$errors['ie']['text'] = __( "Advanced options don't support Internet Explorer version 7 or lower. Please switch to a standards based browser that will allow you to easily configure your site (e.g. Firefox, Chrome, Safari, even IE8 or better would work).", 'pagelines' );
-
+
}
-
+
if( floatval( phpversion() ) < 5.0){
$errors['php']['title'] = sprintf( __( 'You are using PHP version %s', 'pagelines' ), phpversion() );
$errors['php']['text'] = __( 'Version 5 or higher is required for this theme to work correctly. Please check with your host about upgrading to a newer version.', 'pagelines' );
}
if ( isset( $_GET['extend_error'] ) ) {
$errors['extend']['title'] = __( 'Extension problem found', 'pagelines' );
-
+
switch( $_GET['extend_error'] ) {
-
+
case 'blank':
$errors['extend']['text'] = __( 'No file selected!', 'pagelines' );
break;
-
+
case 'filename':
$errors['extend']['text'] = __( 'The file did not appear to be a PageLines section.', 'pagelines' );
break;
-
+
default:
$errors['extend']['text'] = sprintf( __( 'Unknown error: %s', 'pagelines' ), $_GET['extend_error'] );
break;
@@ -519,7 +519,7 @@ function pagelines_admin_errors(){
}
return apply_filters( 'pagelines_admin_notifications', $errors );
-
+
}
@@ -528,12 +528,12 @@ function pagelines_admin_errors(){
* @TODO document
*
*/
-function pagelines_error_messages(){
-
+function pagelines_error_messages(){
+
$errors = pagelines_admin_errors();
- if( !empty( $errors ) ):
+ if( !empty( $errors ) ):
foreach ( $errors as $e ): ?>
-
+
@@ -543,8 +543,8 @@ function pagelines_error_messages(){
-
-option_id = (isset( $_REQUEST['oid'] )) ? $_REQUEST['oid'] : '';
add_filter( 'attachment_fields_to_edit', array( $this, 'attachment_fields_to_edit' ), 15, 2 );
@@ -563,56 +563,56 @@ function __construct() {
}
}
-
+
function the_js(){
?>
-
+
-
+
ID;
-
+
$image_url = wp_get_attachment_url($attach_id);
-
- $form_fields['buttons'] = array(
+
+ $form_fields['buttons'] = array(
'tr' => sprintf(
'
%s
- ',
+ ',
$this->option_id,
$image_url,
__( 'Select This Image For Option', 'pagelines' )
- )
+ )
);
- $form_fields['context'] = array(
- 'input' => 'hidden',
- 'value' => 'pl-custom-attach'
+ $form_fields['context'] = array(
+ 'input' => 'hidden',
+ 'value' => 'pl-custom-attach'
);
return $form_fields;
diff --git a/admin/admin.head.php b/admin/admin.head.php
index a9a1adcb..0138d1b3 100644
--- a/admin/admin.head.php
+++ b/admin/admin.head.php
@@ -1,74 +1,74 @@
-setup_google_loaders();
-
+
pagelines_register_hook( 'pagelines_admin_head' ); // Hook
?>
\ No newline at end of file
diff --git a/admin/class.account.php b/admin/class.account.php
index b6571250..6aa51b19 100644
--- a/admin/class.account.php
+++ b/admin/class.account.php
@@ -1,6 +1,6 @@
pl_add_welcome();
}
-
-
+
+
$d['_plus_extensions'] = $this->pl_add_extensions_dash();
$d['_live_chat'] = $this->pl_add_live_chat_dash();
$d['_resources'] = $this->pl_add_support_dash();
@@ -71,24 +71,24 @@ function pagelines_account_array(){
'layout' => 'full',
)
);
-
+
if(!pl_deprecate_v2()){
-
+
$d['Import-Export'] = array(
'icon' => PL_ADMIN_ICONS.'/extend-inout.png',
'import_set' => array(
'default' => '',
'type' => 'import_export',
'layout' => 'full',
- 'title' => __( 'Import/Export PageLines Settings', 'pagelines' ),
+ 'title' => __( 'Import/Export PageLines Settings', 'pagelines' ),
'shortexp' => __( 'Use this form to upload PageLines settings from another install.', 'pagelines' ),
)
);
-
+
}
-
- return apply_filters( 'pagelines_account_array', $d );
+
+ return apply_filters( 'pagelines_account_array', $d );
}
/**
@@ -101,15 +101,15 @@ function pagelines_account_array(){
* @return string
*/
function get_intro( $o ) {
-
+
if ( is_file( get_stylesheet_directory() . '/welcome.php' ) ) {
-
+
ob_start();
include( get_stylesheet_directory() . '/welcome.php' );
- $welcome = ob_get_clean();
-
+ $welcome = ob_get_clean();
+
$a = array();
-
+
if ( is_file( get_stylesheet_directory() . '/welcome.png' ) )
$icon = get_stylesheet_directory_uri() . '/welcome.png';
else
@@ -121,7 +121,7 @@ function get_intro( $o ) {
'flag' => 'hide_option',
'exp' => $welcome
)
- );
+ );
$o = array_merge( $a, $o );
}
return $o;
@@ -147,7 +147,7 @@ function get_live_bill(){
$url = pagelines_check_credentials( 'vchat' );
$iframe = ( $url ) ? sprintf( '
', $url ) : false;
- $rand =
+ $rand =
ob_start();
?>
@@ -164,10 +164,10 @@ function get_live_bill(){
-
@@ -178,11 +178,11 @@ function get_live_bill(){
else
if ( !VPLUS )
- printf( '
%s ', pl_get_plus_link(), __( 'Upgrade to PageLines Plus', 'pagelines' ) );?>
+ printf( '
%s ', pl_get_plus_link(), __( 'Upgrade to PageLines Plus', 'pagelines' ) );?>
- wp_debug_info();
$this->debug_info_template();
}
-
+
/**
* Main output.
* @return str Formatted results for page.
*
*/
function debug_info_template(){
-
+
$out = '';
foreach($this->debug_info as $element ) {
-
+
if ( $element['value'] ) {
-
+
$out .= ''.ucfirst($element['title']).' : '. ucfirst($element['value']);
$out .= (isset($element['extra'])) ? "{$element['extra']}
" : '';
$out .= ' ';
}
}
- wp_die( $out, 'PageLines Debug Info', array( 'response' => 200, 'back_link' => true) );
+ wp_die( $out, 'PageLines Debug Info', array( 'response' => 200, 'back_link' => true) );
}
/**
@@ -63,30 +63,30 @@ function debug_info_template(){
* @return array Test results.
*/
function wp_debug_info(){
-
+
global $wpdb, $wp_version, $platform_build;
-
+
// Set data & variables first
$uploads = wp_upload_dir();
// Get user role
$current_user = wp_get_current_user();
$user_roles = $current_user->roles;
$user_role = array_shift($user_roles);
-
+
// Format data for processing by a template
-
+
$this->debug_info[] = array(
'title' => 'WordPress Version',
- 'value' => $wp_version,
+ 'value' => $wp_version,
'level' => false,
);
-
+
$this->debug_info[] = array(
'title' => 'Multisite Enabled',
'value' => ( is_multisite() ) ? 'Yes' : 'No',
'level' => false
);
-
+
$this->debug_info[] = array(
'title' => 'Current Role',
'value' => $user_role,
@@ -204,13 +204,13 @@ function wp_debug_info(){
'value' => php_sapi_name(),
'level' => false
);
-
-
-
+
+
+
$processUser = ( ! function_exists( 'posix_geteuid') || ! function_exists( 'posix_getpwuid' ) ) ? 'posix functions are disabled on this host!' : posix_getpwuid(posix_geteuid());
if ( is_array( $processUser ) )
$processUser = $processUser['name'];
-
+
$this->debug_info[] = array(
'title' => 'PHP User',
'value' => $processUser,
@@ -222,13 +222,13 @@ function wp_debug_info(){
'value' => PHP_OS,
'level' => false
);
-
+
if ( get_pagelines_option('disable_updates') == true || ( is_multisite() && ! is_super_admin() ) ) {
$this->debug_info[] = array(
'title' => 'Automatic Updates',
'value' => 'Disabled',
'level' => false
- );
+ );
} else {
$this->debug_info[] = array(
'title' => 'Launchpad',
@@ -272,8 +272,8 @@ function debug_get_plugins() {
}
if ( ! is_admin() ) {
-
+
if( isset( $_GET['pldebug'] ) )
new PageLinesDebug;
-
+
}
\ No newline at end of file
diff --git a/admin/class.extend.actions.php b/admin/class.extend.actions.php
index abb65b81..0edb3b50 100644
--- a/admin/class.extend.actions.php
+++ b/admin/class.extend.actions.php
@@ -1,15 +1,15 @@
ui = new PageLinesExtendUI;
- add_action( 'wp_ajax_pagelines_ajax_extend_it_callback', array(&$this, 'extend_it_callback' ) );
+ add_action( 'wp_ajax_pagelines_ajax_extend_it_callback', array(&$this, 'extend_it_callback' ) );
add_action( 'admin_init', array(&$this, 'extension_uploader' ) );
add_action( 'admin_init', array(&$this, 'check_creds' ) );
}
/**
- *
+ *
* Extension AJAX callbacks
- *
+ *
*/
function extend_it_callback( $uploader = false, $checked = null ) {
@@ -39,9 +39,9 @@ function extend_it_callback( $uploader = false, $checked = null ) {
$path = $_POST['extend_path'];
$product = $_POST['extend_product'];
$dash = isset( $_POST['extend_dash'] ) ? $_POST['extend_dash'] : false;
-
-
-
+
+
+
if ( $uploader === 'pagelines_ajax_extend_it_callback' )
$uploader = false;
@@ -50,7 +50,7 @@ function extend_it_callback( $uploader = false, $checked = null ) {
switch ( $mode ) {
case 'integration_download':
-
+
$this->integration_download( $type, $file, $path, $uploader, $checked );
break;
@@ -58,55 +58,55 @@ function extend_it_callback( $uploader = false, $checked = null ) {
case 'integration_activate':
integration_activate( $type, $file, $path, $uploader, $checked );
-
+
break;
case 'integration_deactivate':
integration_deactivate( $type, $file, $path, $uploader, $checked );
- break;
+ break;
+
+ case 'plugin_install':
- case 'plugin_install':
-
$this->plugin_install( $type, $file, $path, $uploader, $checked, $dash );
-
+
break;
case 'plugin_upgrade':
$this->plugin_upgrade( $type, $file, $path, $uploader, $checked, $dash );
-
+
break;
case 'plugin_delete':
-
+
$this->plugin_delete( $type, $file, $path, $uploader, $checked );
-
+
break;
case 'plugin_activate':
$this->plugin_activate( $type, $file, $path, $uploader, $checked );
-
+
break;
case 'plugin_deactivate':
$this->plugin_deactivate( $type, $file, $path, $uploader, $checked );
-
+
break;
case 'section_install':
$this->section_install( $type, $file, $path, $uploader, $checked );
-
+
break;
case 'section_upgrade':
$this->section_upgrade( $type, $file, $path, $uploader, $checked, $dash );
-
+
break;
case 'section_delete':
@@ -118,26 +118,26 @@ function extend_it_callback( $uploader = false, $checked = null ) {
case 'section_activate':
$this->section_activate( $type, $file, $path, $uploader, $checked );
-
+
break;
case 'section_deactivate':
$this->section_deactivate( $type, $file, $path, $uploader, $checked );
-
+
break;
case 'theme_install':
$this->theme_install( $type, $file, $path, $uploader, $checked );
-
+
break;
case 'theme_upgrade':
$this->theme_upgrade( $type, $file, $path, $uploader, $checked, $dash );
- break;
+ break;
case 'theme_delete':
@@ -148,7 +148,7 @@ function extend_it_callback( $uploader = false, $checked = null ) {
case 'theme_activate':
$this->theme_activate( $type, $file, $path, $uploader, $checked );
-
+
break;
case 'theme_deactivate':
@@ -156,7 +156,7 @@ function extend_it_callback( $uploader = false, $checked = null ) {
$this->theme_deactivate( $type, $file, $path, $uploader, $checked );
break;
-
+
case 'redirect':
$this->redirect( $type, $file, $path, $uploader, $checked );
@@ -172,35 +172,35 @@ function extend_it_callback( $uploader = false, $checked = null ) {
case 'login':
$this->login( $type, $file, $path, $uploader, $checked );
-
+
break;
-
+
case 'version_fail':
-
+
$this->version_fail( $type, $file, $path, $uploader, $checked );
break;
-
+
case 'depends_fail':
-
+
$this->depends_fail( $type, $file, $path, $uploader, $checked );
break;
-
+
case 'pro_fail':
-
+
$this->pro_fail( $type, $file, $path, $uploader, $checked );
break;
-
+
case 'subscribe':
-
+
$this->subscribe( $type, $file, $path, $uploader, $checked );
break;
-
+
case 'unsubscribe':
-
+
$this->unsubscribe( $type, $file, $path, $uploader, $checked );
break;
@@ -210,10 +210,10 @@ function extend_it_callback( $uploader = false, $checked = null ) {
/**
* Uploader for sections.
- *
+ *
*/
function extension_uploader() {
-
+
if ( !empty($_POST['upload_check'] ) && check_admin_referer( 'pagelines_extend_upload', 'upload_check') ) {
if ( $_FILES[ $_POST['type']]['size'] == 0 ) {
@@ -225,7 +225,7 @@ function extension_uploader() {
$type = $_POST['type'];
$filename = $_FILES[ $type ][ 'name' ];
$payload = $_FILES[ $type ][ 'tmp_name' ];
-
+
if ( !preg_match( '/section-([^\.]*)\.zip/i', $filename, $out ) ) {
$this->page_reload( PL_ADMIN_STORE_SLUG.'&extend_error=filename', null, 0 );
exit();
@@ -240,13 +240,13 @@ function extension_uploader() {
$this->extend_it_callback( $uploader, null );
exit;
- }
+ }
}
-
+
/**
* See if we have filesystem permissions.
- *
- */
+ *
+ */
/**
*
@@ -254,25 +254,25 @@ function extension_uploader() {
*
*/
function check_creds( $extend = null, $context = WP_PLUGIN_DIR ) {
-
+
if ( get_filesystem_method() == 'direct' ) {
-
+
WP_Filesystem();
return;
}
if ( isset( $_GET['creds'] ) && $_POST && WP_Filesystem( $_POST ) )
$this->extend_it_callback( false, true );
-
+
if ( !$extend )
- return;
+ return;
if ( false === ( $creds = @request_filesystem_credentials( admin_url( PL_ADMIN_STORE_URL.'&creds=yes' ), $type = '', $error = false, $context, $extra_fields = array( 'extend_mode', 'extend_type', 'extend_file', 'extend_path', 'extend_product' ) ) ) ) {
- exit;
- }
+ exit;
+ }
}
-
-
+
+
// return true if were NOT using direct fs.
/**
@@ -281,71 +281,71 @@ function check_creds( $extend = null, $context = WP_PLUGIN_DIR ) {
*
*/
function get_fs_method(){
-
+
global $wp_filesystem;
-
+
if ( is_object( $wp_filesystem ) && $wp_filesystem->method != 'direct' )
return true;
else
return false;
}
-
-
+
+
/**
* Generate a download link.
- *
+ *
*/
function make_url( $type, $file, $product = null ) {
-
+
return sprintf( '%s%ss/download.php?d=%s.zip%s', PL_API_FETCH, $type, $file, ( isset( $product ) ) ? '&product=' . $product : '' );
-
+
}
-
+
/**
* Get a PayPal link.
- *
+ *
*/
function get_payment_link( $product ) {
-
+
return sprintf( 'https://pagelines.com/api/?paypal=%s|%s', $product, admin_url( 'admin.php' ) );
}
-
-
+
+
/**
* Reload the page
* Helper function
*/
function page_reload( $location, $product = null, $message = '') {
-
+
do_action( 'extend_flush' );
-
+
if ( $this->get_fs_method() ) {
-
+
$time = 0;
} else {
$time = 700;
echo $message;
}
-
+
$r = rand( 1,100 );
-
+
$admin = admin_url( sprintf( 'admin.php?r=%1$s&page=%2$s', $r, $location ) );
-
+
$location = ( $product ) ? self::get_payment_link( $product ) : $admin;
- printf(
- '',
- $location,
- $time
+ printf(
+ '',
+ $location,
+ $time
);
-
+
}
function int_download( $location, $time = 300 ) {
-
+
$r = rand( 1,100 );
$admin = admin_url( sprintf( 'admin.php?r=%1$s&page=%2$s', $r, PL_ADMIN_STORE_SLUG.'#integrations' ) );
- printf( '', $location, $time );
+ printf( '', $location, $time );
printf( '', $admin, 700 );
}
@@ -364,35 +364,35 @@ function sandbox( $file, $type ) {
/**
* Throw up on error
*/
- function error_handler( $type ) {
-
+ function error_handler( $type ) {
+
$a = error_get_last();
-
+
$error = '';
-
+
// Unable to activate
if( $a['type'] == 4 || $a['type'] == 1 )
$error .= sprintf( 'Unable to activate the %s.', $type );
-
+
//Error on line
if( $error && is_pl_debug() )
$error .= sprintf( ' %s in %s on line: %s', $a['message'], basename( $a['file'] ), $a['line'] );
-
+
echo $error;
}
-
-
+
+
/**
* Provide Download to integration
*/
function integration_download( $type, $file, $path, $uploader, $checked ) {
-
+
$url = $this->make_url( $type, $file );
-
+
echo __( 'Downloaded', 'pagelines' );
-
+
$this->int_download( $url );
-
+
}
/**
*
@@ -400,7 +400,7 @@ function integration_download( $type, $file, $path, $uploader, $checked ) {
*
*/
function subscribe( $type, $file, $path, $uploader, $checked ) {
-
+
print __( 'Subscribing...', 'pagelines' );
$data = explode ( '|', $path );
@@ -412,21 +412,21 @@ function subscribe( $type, $file, $path, $uploader, $checked ) {
'username' => $data[0]
)
);
-
+
$url = 'api.pagelines.com/subscribe/' . $data[1];
-
+
$result = pagelines_try_api($url, $options);
if ( $result['response']['code'] == 200 && $result['body'] == $data[1] )
{
- delete_transient( sprintf( PL_ADMIN_STORE_SLUG.'_%ss', $type ) );
- $message = __( 'Done.', 'pagelines' );
+ delete_transient( sprintf( PL_ADMIN_STORE_SLUG.'_%ss', $type ) );
+ $message = __( 'Done.', 'pagelines' );
$text = sprintf( '&extend_text=%s_install', $type );
$this->page_reload( PL_ADMIN_STORE_SLUG . $text, null, $message );
}
-
- }
+
+ }
/**
*
@@ -434,11 +434,11 @@ function subscribe( $type, $file, $path, $uploader, $checked ) {
*
*/
function unsubscribe( $type, $file, $path, $uploader, $checked ) {
-
+
print __( 'Unsubscribing...', 'pagelines');
$data = explode ( '|', $path );
-
+
$options = array(
'body' => array(
'email' => get_bloginfo( 'admin_email'),
@@ -454,12 +454,12 @@ function unsubscribe( $type, $file, $path, $uploader, $checked ) {
if ( $result['response']['code'] == 200 && $result['body'] == $data[1] )
{
- delete_transient( sprintf( PL_ADMIN_STORE_SLUG.'_%ss', $type ) );
- $message = __( 'Done.', 'pagelines' );
+ delete_transient( sprintf( PL_ADMIN_STORE_SLUG.'_%ss', $type ) );
+ $message = __( 'Done.', 'pagelines' );
$text = sprintf( '&extend_text=%s_install#added', $type );
$this->page_reload( PL_ADMIN_STORE_SLUG . $text, null, $message );
}
-
+
}
/**
@@ -468,11 +468,11 @@ function unsubscribe( $type, $file, $path, $uploader, $checked ) {
*
*/
function version_fail( $type, $file, $path, $uploader, $checked ) {
-
+
printf( __( 'You need to have version %s of the framework for this %s', 'pagelines' ), $file, $path );
-
+
}
-
+
/**
*
@@ -480,11 +480,11 @@ function version_fail( $type, $file, $path, $uploader, $checked ) {
*
*/
function depends_fail( $type, $file, $path, $uploader, $checked ) {
-
+
printf( __( 'You need to install %s first.', 'pagelines' ), $file );
-
+
}
-
+
/**
*
@@ -492,11 +492,11 @@ function depends_fail( $type, $file, $path, $uploader, $checked ) {
*
*/
function pro_fail( $type, $file, $path, $uploader, $checked ) {
-
+
printf( __( 'This %s needs a Pro license.', 'pagelines' ), $path );
-
+
}
-
+
/**
*
@@ -504,32 +504,32 @@ function pro_fail( $type, $file, $path, $uploader, $checked ) {
*
*/
function plugin_install( $type, $file, $path, $uploader, $checked, $dash) {
-
+
$this->wp_libs();
-
+
if ( !$checked )
$this->check_creds( 'extend', WP_PLUGIN_DIR );
$skin = new PageLines_Upgrader_Skin();
$upgrader = new Plugin_Upgrader( $skin );
- $destination = $this->make_url( $type, $file );
+ $destination = $this->make_url( $type, $file );
@$upgrader->install( $destination );
$this->sandbox( WP_PLUGIN_DIR . $path, 'plugin' );
activate_plugin( $path );
-
- $message = __( 'Plugin Installed.', 'pagelines' );
+
+ $message = __( 'Plugin Installed.', 'pagelines' );
$text = '&extend_text=plugin_install#your_plugins';
-
+
$url = PL_ADMIN_STORE_SLUG;
-
+
if ( $dash ) {
$url = PL_MAIN_DASH;
}
- $this->page_reload( $url, null, $message );
+ $this->page_reload( $url, null, $message );
}
-
+
/**
*
@@ -537,19 +537,19 @@ function plugin_install( $type, $file, $path, $uploader, $checked, $dash) {
*
*/
function plugin_delete( $type, $file, $path, $uploader, $checked ) {
-
+
$this->wp_libs();
-
+
if ( !$checked )
- $this->check_creds( 'extend', WP_PLUGIN_DIR );
+ $this->check_creds( 'extend', WP_PLUGIN_DIR );
global $wp_filesystem;
delete_plugins( array( ltrim( $file, '/' ) ) );
- $message = __( 'Plugin Deleted.', 'pagelines' );
+ $message = __( 'Plugin Deleted.', 'pagelines' );
$text = '&extend_text=plugin_delete#your_plugins';
$this->page_reload( PL_ADMIN_STORE_SLUG . $text, null, $message );
-
+
}
-
+
/**
*
@@ -557,11 +557,11 @@ function plugin_delete( $type, $file, $path, $uploader, $checked ) {
*
*/
function plugin_upgrade( $type, $file, $path, $uploader, $checked, $dash ) {
-
+
$this->wp_libs();
-
+
if ( !$checked )
- $this->check_creds( 'extend' );
+ $this->check_creds( 'extend' );
global $wp_filesystem;
$skin = new PageLines_Upgrader_Skin();
@@ -569,7 +569,7 @@ function plugin_upgrade( $type, $file, $path, $uploader, $checked, $dash ) {
$active = is_plugin_active( ltrim( $file, '/' ) );
deactivate_plugins( array( $file ) );
-
+
$wp_filesystem->delete( trailingslashit( WP_PLUGIN_DIR ) . $path, true, false );
@$upgrader->install( $this->make_url( $type, $path ) );
@@ -581,15 +581,15 @@ function plugin_upgrade( $type, $file, $path, $uploader, $checked, $dash ) {
$text = '&extend_text=plugin_upgrade#your_plugins';
$url = PL_ADMIN_STORE_SLUG;
-
+
if ( $dash ) {
$url = PL_MAIN_DASH;
$this->remove_update( $path );
}
$this->page_reload( $url, null, $message );
-
+
}
-
+
function remove_update( $slug ) {
$updates = json_decode( get_theme_mod( 'pending_updates' ) );
@@ -607,14 +607,14 @@ function remove_update( $slug ) {
*
*/
function plugin_activate( $type, $file, $path, $uploader, $checked ) {
-
+
$this->sandbox( WP_PLUGIN_DIR . $file, 'plugin' );
activate_plugin( $file );
$message = __( 'Plugin Activated.', 'pagelines' );
$this->page_reload( PL_ADMIN_STORE_SLUG, null, $message );
-
+
}
-
+
/**
*
@@ -622,14 +622,14 @@ function plugin_activate( $type, $file, $path, $uploader, $checked ) {
*
*/
function plugin_deactivate( $type, $file, $path, $uploader, $checked ) {
-
+
deactivate_plugins( array( $file ) );
// Output
$message = __( 'Plugin Deactivated.', 'pagelines' );
$this->page_reload( PL_ADMIN_STORE_SLUG, null, $message );
}
-
+
/**
*
@@ -639,29 +639,29 @@ function plugin_deactivate( $type, $file, $path, $uploader, $checked ) {
function section_install( $type, $file, $path, $uploader, $checked ) {
$this->wp_libs();
-
+
if ( !$checked )
- $this->check_creds( 'extend', WP_PLUGIN_DIR );
+ $this->check_creds( 'extend', WP_PLUGIN_DIR );
global $wp_filesystem;
$skin = new PageLines_Upgrader_Skin();
$upgrader = new PageLines_Section_Installer( $skin );
$time = 0;
-
+
$url = ( $uploader ) ? $file : $this->make_url( $type, $path );
$out = @$upgrader->install( $url );
$wp_filesystem->move( trailingslashit( $wp_filesystem->wp_plugins_dir() ) . $path, sprintf( '%s/pagelines-sections/%s', trailingslashit( $wp_filesystem->wp_plugins_dir() ), $path ) );
-
+
$this->sections_reset();
$text = '&extend_text=section_install#your_added_sections';
if ( $uploader && is_wp_error( $out ) )
$this->page_reload( sprintf( PL_ADMIN_STORE_SLUG.'&extend_error=%s', $out->get_error_code() ) , null, 0 );
else
$this->page_reload( PL_ADMIN_STORE_SLUG . $text, null, __( 'Section Installed.', 'pagelines' ) );
-
+
}
-
+
/**
*
@@ -671,21 +671,21 @@ function section_install( $type, $file, $path, $uploader, $checked ) {
function section_delete( $type, $file, $path, $uploader, $checked ) {
$this->wp_libs();
-
+
if ( !$checked ) {
- $this->check_creds( 'extend', PL_EXTEND_DIR );
+ $this->check_creds( 'extend', PL_EXTEND_DIR );
}
global $wp_filesystem;
$wp_filesystem->delete( sprintf( '%s/pagelines-sections/%s', trailingslashit( $wp_filesystem->wp_plugins_dir() ), $file ), true, false );
-
+
$this->sections_reset();
$message = __( 'Section Deleted.', 'pagelines' );
$text = '&extend_text=section_delete#your_added_sections';
$this->page_reload( PL_ADMIN_STORE_SLUG . $text, null, $message );
-
+
}
-
+
/**
*
@@ -695,9 +695,9 @@ function section_delete( $type, $file, $path, $uploader, $checked ) {
function section_upgrade( $type, $file, $path, $uploader, $checked, $dash ) {
$this->wp_libs();
-
+
if ( !$checked )
- $this->check_creds( 'extend', PL_EXTEND_DIR );
+ $this->check_creds( 'extend', PL_EXTEND_DIR );
global $wp_filesystem;
$skin = new PageLines_Upgrader_Skin();
@@ -707,15 +707,15 @@ function section_upgrade( $type, $file, $path, $uploader, $checked, $dash ) {
$folder = sprintf( '%s/pagelines-sections/%s', trailingslashit( $wp_filesystem->wp_plugins_dir() ), $file );
$wp_filesystem->delete( $folder, true, false );
-
- @$upgrader->install( $this->make_url( 'section', $file ) );
+
+ @$upgrader->install( $this->make_url( 'section', $file ) );
$wp_filesystem->move( trailingslashit( $wp_filesystem->wp_plugins_dir() ) . $file, sprintf( '%s/pagelines-sections/%s', trailingslashit( $wp_filesystem->wp_plugins_dir() ), $file ) );
-
+
$this->sections_reset();
// Output
$text = '&extend_text=section_upgrade#your_added_sections';
$message = __( 'Section Upgraded', 'pagelines' );
-
+
$url = PL_ADMIN_STORE_SLUG;
if ( $dash ) {
$url = PL_MAIN_DASH;
@@ -723,7 +723,7 @@ function section_upgrade( $type, $file, $path, $uploader, $checked, $dash ) {
}
$this->page_reload( $url, null, $message );
}
-
+
/**
*
@@ -739,9 +739,9 @@ function section_activate( $type, $file, $path, $uploader, $checked ) {
// Output
$message = __( 'Section Activated.', 'pagelines' );
$this->page_reload( PL_ADMIN_STORE_SLUG, null, $message );
-
+
}
-
+
/**
*
@@ -749,17 +749,17 @@ function section_activate( $type, $file, $path, $uploader, $checked ) {
*
*/
function section_deactivate( $type, $file, $path, $uploader, $checked ) {
-
+
$disabled = get_option( 'pagelines_sections_disabled', array( 'child' => array(), 'parent' => array() ) );
- $disabled[$path][$file] = true;
+ $disabled[$path][$file] = true;
update_option( 'pagelines_sections_disabled', $disabled );
$this->sections_reset();
// Output
$message = __( 'Section Deactivated.', 'pagelines' );
$this->page_reload( PL_ADMIN_STORE_SLUG, null, $message );
-
+
}
-
+
/**
*
@@ -769,10 +769,10 @@ function section_deactivate( $type, $file, $path, $uploader, $checked ) {
function theme_install( $type, $file, $path, $uploader, $checked ) {
$this->wp_libs();
-
+
if ( !$checked ) {
$this->check_creds( 'extend', PL_EXTEND_THEMES_DIR );
- }
+ }
$skin = new PageLines_Upgrader_Skin();
$upgrader = new Theme_Upgrader( $skin );
global $wp_filesystem;
@@ -782,9 +782,9 @@ function theme_install( $type, $file, $path, $uploader, $checked ) {
$text = '&extend_text=theme_install#your_themes';
$message = __( 'Theme Installed.', 'pagelines' );
$this->page_reload( PL_ADMIN_STORE_SLUG . $text, null, $message );
-
+
}
-
+
/**
*
@@ -794,9 +794,9 @@ function theme_install( $type, $file, $path, $uploader, $checked ) {
function theme_delete( $type, $file, $path, $uploader, $checked ) {
$this->wp_libs();
-
+
if ( !$checked ) {
- $this->check_creds( 'extend', PL_EXTEND_THEMES_DIR );
+ $this->check_creds( 'extend', PL_EXTEND_THEMES_DIR );
}
global $wp_filesystem;
$wp_filesystem->delete( trailingslashit( PL_EXTEND_THEMES_DIR ) . $file, true, false );
@@ -804,9 +804,9 @@ function theme_delete( $type, $file, $path, $uploader, $checked ) {
$text = '&extend_text=theme_delete#your_themes';
$message = __( 'Theme Deleted.', 'pagelines' );
$this->page_reload( PL_ADMIN_STORE_SLUG . $text, null, $message );
-
+
}
-
+
/**
*
@@ -816,9 +816,9 @@ function theme_delete( $type, $file, $path, $uploader, $checked ) {
function theme_upgrade( $type, $file, $path, $uploader, $checked, $dash) {
$this->wp_libs();
-
+
if ( !$checked )
- $this->check_creds( 'extend', PL_EXTEND_THEMES_DIR );
+ $this->check_creds( 'extend', PL_EXTEND_THEMES_DIR );
global $wp_filesystem;
$active = ( basename( get_stylesheet_directory() ) === $file ) ? true : false;
@@ -838,17 +838,17 @@ function theme_upgrade( $type, $file, $path, $uploader, $checked, $dash) {
// Output
$text = '&extend_text=theme_upgrade#your_themes';
$message = __( 'Theme Upgraded.', 'pagelines' );
-
+
$url = PL_ADMIN_STORE_SLUG;
-
+
if ( $dash ) {
$url = PL_MAIN_DASH;
$this->remove_update( $path );
}
$this->page_reload( $url, null, $message );
-
+
}
-
+
/**
*
@@ -856,15 +856,15 @@ function theme_upgrade( $type, $file, $path, $uploader, $checked, $dash) {
*
*/
function theme_activate( $type, $file, $path, $uploader, $checked ) {
-
+
switch_theme( basename( get_template_directory() ), $file );
delete_transient( 'pagelines_sections_cache' );
$message = __( 'Theme Activated.', 'pagelines' );
$this->page_reload( PL_ADMIN_STORE_SLUG, null, $message );
-
+
}
-
+
/**
*
@@ -872,15 +872,15 @@ function theme_activate( $type, $file, $path, $uploader, $checked ) {
*
*/
function theme_deactivate( $type, $file, $path, $uploader, $checked ) {
-
+
switch_theme( basename( get_template_directory() ), basename( get_template_directory() ) );
delete_transient( 'pagelines_sections_cache' );
-
+
$message = __( 'Theme Deactivated.', 'pagelines' );
$this->page_reload( PL_ADMIN_STORE_SLUG, null, $message );
-
+
}
-
+
/**
*
@@ -888,11 +888,11 @@ function theme_deactivate( $type, $file, $path, $uploader, $checked ) {
*
*/
function redirect( $type, $file, $path, $uploader, $checked ) {
-
- echo sprintf( __( 'Sorry only network admins can install %ss.', 'pagelines' ), $type );
-
+
+ echo sprintf( __( 'Sorry only network admins can install %ss.', 'pagelines' ), $type );
+
}
-
+
/**
*
@@ -900,12 +900,12 @@ function redirect( $type, $file, $path, $uploader, $checked ) {
*
*/
function purchase( $type, $file, $path, $uploader, $checked ) {
-
+
_e( 'Taking you to PayPal.com', 'pagelines' );
$this->page_reload( PL_ADMIN_STORE_SLUG, $file );
-
+
}
-
+
/**
*
@@ -913,12 +913,12 @@ function purchase( $type, $file, $path, $uploader, $checked ) {
*
*/
function login( $type, $file, $path, $uploader, $checked ) {
-
+
_e( 'Moving to account setup..', 'pagelines' );
$this->page_reload( PL_MAIN_DASH . '#Your_Account' );
-
+
}
-
+
/**
*
@@ -926,12 +926,12 @@ function login( $type, $file, $path, $uploader, $checked ) {
*
*/
function wp_libs() {
-
+
include_once( ABSPATH . 'wp-admin/includes/class-wp-upgrader.php' );
include( PL_ADMIN . '/library.extension.php' );
-
- }
-
+
+ }
+
/**
*
@@ -939,7 +939,7 @@ function wp_libs() {
*
*/
function sections_reset() {
-
+
global $load_sections;
delete_transient( 'pagelines_sections_cache' );
$load_sections->pagelines_register_sections( true, false );
diff --git a/admin/class.extend.integrations.php b/admin/class.extend.integrations.php
index ffdd3c2d..093e9ad2 100644
--- a/admin/class.extend.integrations.php
+++ b/admin/class.extend.integrations.php
@@ -1,35 +1,35 @@
get_latest_cached( 'integrations' );
- if ( !is_object($integrations ) )
+ if ( !is_object($integrations ) )
return $integrations;
- $integrations = json_decode( json_encode( $integrations ), true ); // convert objects to arrays
+ $integrations = json_decode( json_encode( $integrations ), true ); // convert objects to arrays
+
-
$list = $this->get_master_list( $integrations, $type, $tab );
-
- $args = array(
- 'list' => $list,
- 'tab' => $tab,
- 'type' => 'integrations',
- 'mode' => 'download'
+
+ $args = array(
+ 'list' => $list,
+ 'tab' => $tab,
+ 'type' => 'integrations',
+ 'mode' => 'download'
);
-
+
return $this->ui->extension_list( $args );
}
-
+
}
@@ -39,17 +39,17 @@ function extension_integrations( $tab = '' ) {
*
*/
function is_integration_active( $key ){
-
+
$ints = get_option( PAGELINES_INTEGRATIONS );
-
- if( is_array($ints)
+
+ if( is_array($ints)
&& isset( $ints[$key] )
&& isset( $ints[$key]['activated'] )
){
return $ints[$key]['activated'];
- } else
+ } else
return false;
-
+
}
@@ -59,13 +59,13 @@ function is_integration_active( $key ){
*
*/
function integration_activate( $type, $slug, $name, $uploader, $checked ) {
-
+
toggle_integration($slug, $name, true);
-
+
echo __( 'Options Activated', 'pagelines' );
-
+
integration_reload( PL_ADMIN_STORE_SLUG );
-
+
}
@@ -76,13 +76,13 @@ function integration_activate( $type, $slug, $name, $uploader, $checked ) {
*/
function integration_deactivate( $type, $slug, $name, $uploader, $checked ) {
-
+
toggle_integration($slug, $name, false);
-
+
echo __( 'Options Deactivated', 'pagelines' );
-
+
integration_reload( PL_ADMIN_STORE_SLUG );
-
+
}
@@ -92,18 +92,18 @@ function integration_deactivate( $type, $slug, $name, $uploader, $checked ) {
*
*/
function integration_reload( $location ){
-
+
$r = rand( 1,100 );
-
+
$admin = admin_url( sprintf( 'admin.php?r=%1$s&page=%2$s', $r, $location ) );
- printf(
- '',
- $admin,
+ printf(
+ '',
+ $admin,
700
);
-
-
+
+
}
@@ -113,8 +113,8 @@ function integration_reload( $location ){
*
*/
function toggle_integration( $slug, $name, $activated = false){
-
-
+
+
$current_integrations = get_option( PAGELINES_INTEGRATIONS );
$new = array(
@@ -124,11 +124,11 @@ function toggle_integration( $slug, $name, $activated = false){
'activated' => $activated
)
);
-
+
$new_integrations = wp_parse_args($new, $current_integrations);
-
+
update_option( PAGELINES_INTEGRATIONS, $new_integrations );
-
+
}
// Returns the name
@@ -138,14 +138,14 @@ function toggle_integration( $slug, $name, $activated = false){
* @TODO document
*
*/
-function get_integration_path($ext){
-
+function get_integration_path($ext){
+
$name = (isset($ext['name'])) ? $ext['name'] : 'No Name';
$path = $ext['name'];
return $path;
-
+
}
@@ -155,29 +155,29 @@ function get_integration_path($ext){
*
*/
function handle_integrations_meta(){
-
+
global $metapanel_options;
-
+
$current_integrations = get_option( PAGELINES_INTEGRATIONS );
-
+
if ( ! $current_integrations )
return array();
$ints = array();
foreach($current_integrations as $slug => $info){
-
+
if(isset($info['activated']) && $info['activated']){
-
+
$key = str_replace('pagelines-integration-', '', strtolower($slug));
-
+
$ints[$key] = array(
'icon' => sprintf('%s/%s.png', PL_ADMIN_ICONS, $key),
- 'metapanel' => $metapanel_options->posts_metapanel( $key, 'integration' ),
+ 'metapanel' => $metapanel_options->posts_metapanel( $key, 'integration' ),
);
-
+
}
-
+
}
-
- return $ints;
+
+ return $ints;
}
\ No newline at end of file
diff --git a/admin/class.extend.php b/admin/class.extend.php
index 489c753f..812ada5f 100644
--- a/admin/class.extend.php
+++ b/admin/class.extend.php
@@ -6,7 +6,7 @@
* TODO Make some use of the tags system
*
* Install PageLines plugins and looks after them.
- *
+ *
* @author PageLines
* @package PageLines Framework
* @since 2.0
@@ -18,7 +18,7 @@ function __construct() {
$this->username = get_pagelines_credentials( 'user' );
$this->password = get_pagelines_credentials( 'pass' );
-
+
$this->ui = new PageLinesExtendUI;
$this->fileactions = new PageLinesExtendActions;
add_action( 'admin_init', array(&$this, 'launchpad_returns' ) );
@@ -32,12 +32,12 @@ function __construct() {
*
*/
function flush_caches() {
-
+
delete_transient( EXTEND_UPDATE );
delete_transient( 'pagelines_extend_themes' );
delete_transient( 'pagelines_extend_sections' );
delete_transient( 'pagelines_extend_plugins' );
- delete_transient( 'pagelines_extend_integrations' );
+ delete_transient( 'pagelines_extend_integrations' );
delete_transient( 'pagelines_sections_cache' );
remove_theme_mod( 'available_updates' );
remove_theme_mod( 'pending_updates' );
@@ -50,7 +50,7 @@ function flush_caches() {
*
*/
function extension_engine( $type, $set = ''){
-
+
switch ( $type ){
case 'section_added' :
@@ -68,7 +68,7 @@ function extension_engine( $type, $set = ''){
case 'integration' :
$out = ExtensionIntegrations::extension_integrations( $set );
break;
- }
+ }
return $out;
}
@@ -79,15 +79,15 @@ function extension_engine( $type, $set = ''){
*
*/
function master_array( $type, $key, $ext, $tab ){
-
- $a = array(
+
+ $a = array(
'plversion' => PL_CORE_VERSION,
'price' => 'free',
'featured' => 'false',
'type' => 'internal',
'depends' => false
);
-
+
$ext = wp_parse_args( $ext, $a );
$actions = array(
@@ -98,8 +98,8 @@ function master_array( $type, $key, $ext, $tab ){
'case' => $type.'_install',
'type' => $type,
'file' => $this->get_the_file( 'install', $type, $key, $ext, $tab ),
- 'condition' => $this->show_install_button( $type, $key, $ext, $tab ),
- 'path' => $this->get_the_path( 'install', $type, $key, $ext, $tab ),
+ 'condition' => $this->show_install_button( $type, $key, $ext, $tab ),
+ 'path' => $this->get_the_path( 'install', $type, $key, $ext, $tab ),
),
'redirect' => array(
'mode' => 'redirect',
@@ -108,12 +108,12 @@ function master_array( $type, $key, $ext, $tab ){
'type' => $type,
'condition' => $this->do_redirect( $type, $key, $ext, $tab ),
'file' => $this->get_the_file( 'redirect', $type, $key, $ext, $tab ),
- 'path' => $this->get_the_path( 'redirect', $type, $key, $ext, $tab ),
+ 'path' => $this->get_the_path( 'redirect', $type, $key, $ext, $tab ),
),
'login' => array(
'mode' => 'login',
'case' => 'login',
- 'condition' => $this->show_login_button( $type, $key, $ext, $tab ),
+ 'condition' => $this->show_login_button( $type, $key, $ext, $tab ),
'type' => $type,
'file' => $this->get_the_file( 'login', $type, $key, $ext, $tab ),
'text' => __( 'Login to install or purchase →', 'pagelines' ),
@@ -126,7 +126,7 @@ function master_array( $type, $key, $ext, $tab ){
'dtext' => __( 'Redirecting', 'pagelines' ),
'type' => $type,
'condition' => $this->show_purchase_button( $type, $key, $ext, $tab ),
- 'file' => $this->paypal_link( $type, $key, $ext, $tab ),
+ 'file' => $this->paypal_link( $type, $key, $ext, $tab ),
),
'plus' => array(
'mode' => 'install',
@@ -136,14 +136,14 @@ function master_array( $type, $key, $ext, $tab ){
'type' => $type,
'file' => $this->get_the_file( 'install', $type, $key, $ext, $tab ),
'condition' => $this->show_plus_button( $type, $key, $ext, $tab ),
- 'path' => $this->get_the_path( 'install', $type, $key, $ext, $tab ),
+ 'path' => $this->get_the_path( 'install', $type, $key, $ext, $tab ),
),
'activate' => array(
'mode' => 'activate',
'condition' => $this->show_activate_button( $type, $key, $ext, $tab ),
'case' => $type.'_activate',
'type' => $type,
- 'path' => $this->get_the_path( 'activate', $type, $key, $ext, $tab ),
+ 'path' => $this->get_the_path( 'activate', $type, $key, $ext, $tab ),
'file' => $this->get_the_file( 'activate', $type, $key, $ext, $tab ),
'text' => __( 'Activate', 'pagelines' ),
'dtext' => __( 'Activating', 'pagelines' ),
@@ -204,7 +204,7 @@ function master_array( $type, $key, $ext, $tab ){
'condition' => $this->is_pro_only( $type, $key, $ext, $tab ),
'text' => __( 'Upgrade to Pro', 'pagelines' ),
),
-
+
'download' => array(
'mode' => 'download',
'condition' => $this->show_download_button( $type, $key, $ext, $tab ),
@@ -230,10 +230,10 @@ function master_array( $type, $key, $ext, $tab ){
'condition' => $this->show_subscribe_button( $type, $key, $ext, $tab ),
'text' => __( 'Subscribe', 'pagelines' ),
),
-
-
- );
- return $actions;
+
+
+ );
+ return $actions;
}
// ======================
@@ -248,7 +248,7 @@ function master_array( $type, $key, $ext, $tab ){
*/
function show_in_tab( $type, $key, $ext, $tab ){
- $a = array(
+ $a = array(
'plversion' => PL_CORE_VERSION,
'price' => 'free',
'featured' => 'false',
@@ -256,13 +256,13 @@ function show_in_tab( $type, $key, $ext, $tab ){
'sections-plugin' => ( isset( $ext['file']) && PL_EXTEND_SECTIONS_PLUGIN === basename( $ext['file'] ) ) ? true : false,
'type' => 'internal'
);
-
+
$ext = wp_parse_args( $ext, $a );
-
+
if($type == 'section'){
-
+
$ext = (array) $ext;
-
+
if ( $tab === 'user' && ( $ext['type'] === 'custom' || $ext['type'] === 'parent' ) )
return false;
if ( $tab === 'user' && ( $ext['type'] != 'parent' && $ext['type'] != 'custom' ) )
@@ -270,7 +270,7 @@ function show_in_tab( $type, $key, $ext, $tab ){
elseif ( $tab === 'internal' && ( $ext['type'] === 'custom' || $ext['type'] === 'child' ) )
return false;
elseif ( $tab === 'internal' && ( ! VPRO && $ext['edition'] === 'pro' ) )
- return false;
+ return false;
elseif ( $tab === 'child' && $ext['type'] != 'custom' )
return false;
elseif ( $ext['type'] == 'parent' && $ext['class_exists'] )
@@ -281,50 +281,50 @@ function show_in_tab( $type, $key, $ext, $tab ){
return false;
elseif( $tab == 'featured' && $ext['featured'] == 'false' )
return false;
- else
+ else
return true;
-
+
} elseif($type == 'plugin'){
if ( $tab == 'featured' && $ext['featured'] == 'false' )
return false;
-
+
if ( $tab === 'installed' && (!$ext['loaded'] || $ext['sections-plugin']) )
return false;
-
+
elseif ( ( $tab === 'premium' ) && $ext['price'] === 'free' )
return false;
elseif ( $tab === 'free' && $ext['price'] != 'free' )
return false;
-
- else
+
+ else
return true;
-
+
} elseif($type == 'theme'){
- $featured = ( isset( $ext['featured'] ) ) ? (bool) $ext['featured'] : false;
+ $featured = ( isset( $ext['featured'] ) ) ? (bool) $ext['featured'] : false;
$ext['exists'] = $this->is_installed('theme', $key, $ext);
-
+
if ( is_file( sprintf( '%s/themes/%s/style.css', WP_CONTENT_DIR, $key ) ) )
$exists = true;
-
- if ( $tab === 'featured' && $ext['featured'] === 'true' )
+
+ if ( $tab === 'featured' && $ext['featured'] === 'true' )
return true;
- elseif ( $tab === 'featured' && $ext['featured'] === 'false' )
+ elseif ( $tab === 'featured' && $ext['featured'] === 'false' )
return false;
-
- elseif ( ( $tab == 'premium' || $tab == 'featured' ) && $ext['price'] == 'free' )
+
+ elseif ( ( $tab == 'premium' || $tab == 'featured' ) && $ext['price'] == 'free' )
return false;
- elseif ( $tab == 'free' && $ext['price'] != 'free' )
+ elseif ( $tab == 'free' && $ext['price'] != 'free' )
return false;
-
+
elseif ( $tab == 'installed' && !$ext['exists'] )
return false;
-
+
else
- return true;
+ return true;
}
return true;
}
@@ -338,7 +338,7 @@ function show_in_tab( $type, $key, $ext, $tab ){
function version_check( $version ){
return ( version_compare( PL_CORE_VERSION, $version ) >= 0 ) ? true : false;
}
-
+
/**
*
@@ -346,10 +346,10 @@ function version_check( $version ){
*
*/
function depends_check( $type, $key, $ext, $tab ) {
-
+
if ( $type == 'plugin' ) {
-
- if ( !empty( $ext['depends']) ) {
+
+ if ( !empty( $ext['depends']) ) {
$file = sprintf( '%s/%s/%s.php', WP_PLUGIN_DIR, $ext['depends'], $ext['depends'] );
if ( !is_file( $file ) )
return true;
@@ -358,7 +358,7 @@ function depends_check( $type, $key, $ext, $tab ) {
}
return false;
}
-
+
/**
*
@@ -366,30 +366,30 @@ function depends_check( $type, $key, $ext, $tab ) {
*
*/
function show_upgrade_available($type, $key, $ext, $tab){
-
+
if ( EXTEND_NETWORK )
return false;
-
+
if ( $type == 'plugin' ) {
-
+
if( $this->is_installed($type, $key, $ext)
&& ! $this->in_the_store( $type, $key, $ext, $tab )
&& $this->upgrade_available( $this->get_api_version($type, $key, $ext), $this->get_the_version($type, $key, $ext) )
){
return true;
- } else
- return false;
+ } else
+ return false;
}
-
+
if( $this->is_installed( $type, $key, $ext )
&& $this->upgrade_available( $this->get_api_version( $type, $key, $ext ), $ext['version'] )
){
return true;
- } else
+ } else
return false;
-
+
}
-
+
/**
*
@@ -403,7 +403,7 @@ function upgrade_available( $api_version, $installed_version ){
else
return false;
}
-
+
/**
*
@@ -417,7 +417,7 @@ function show_download_button( $type, $key, $ext, $tab ){
else
return false;
}
-
+
/**
*
@@ -438,20 +438,20 @@ function show_login_button( $type, $key, $ext, $tab ){
&& 'user' == $tab || 'installed' == $tab
&& isset( $ext['price'] )
&& $ext['price']
- && $ext['price'] != 'free'
+ && $ext['price'] != 'free'
) return true;
-
- if( !EXTEND_NETWORK
+
+ if( !EXTEND_NETWORK
&& !$this->is_purchased( $type, $key, $ext )
&& $this->in_the_store( $type, $key, $ext, $tab )
&& !$this->is_installed( $type, $key, $ext )
&& ! $this->version_fail( $ext['plversion'] )
) return true;
-
+
return false;
}
-
+
/**
*
@@ -463,9 +463,9 @@ function show_install_button( $type, $key, $ext, $tab){
if ( $type == 'integration' )
return false;
- if( !$this->is_installed( $type, $key, $ext )
- && $this->is_purchased( $type, $key, $ext )
- && $this->in_the_store( $type, $key, $ext, $tab )
+ if( !$this->is_installed( $type, $key, $ext )
+ && $this->is_purchased( $type, $key, $ext )
+ && $this->in_the_store( $type, $key, $ext, $tab )
&& ! EXTEND_NETWORK
&& ! $this->version_fail( $ext['plversion'] )
&& ! $this->depends_check( $type, $key, $ext, $tab )
@@ -475,7 +475,7 @@ function show_install_button( $type, $key, $ext, $tab){
else
return false;
}
-
+
/**
*
@@ -483,26 +483,26 @@ function show_install_button( $type, $key, $ext, $tab){
*
*/
function is_pro_only( $type, $key, $ext, $tab ) {
-
+
if ( isset( $ext['edition']) && 'pro' == strtolower( $ext['edition'] ) && ! VPRO )
return true;
- else
- return false;
+ else
+ return false;
}
-
+
/**
*
* @TODO document
*
*/
function is_subscribed( $type, $key, $ext, $tab ) {
-
+
if ( isset( $ext['subscribed'] ) )
return true;
- else
- return false;
+ else
+ return false;
}
-
+
/**
*
* @TODO document
@@ -519,7 +519,7 @@ function show_subscribe_button( $type, $key, $ext, $tab ){
&& $this->updates_configured()
){
return true;
- } else
+ } else
return false;
}
@@ -538,7 +538,7 @@ function show_unsubscribe_button( $type, $key, $ext, $tab ){
&& $this->updates_configured()
){
return true;
- } else
+ } else
return false;
}
@@ -550,15 +550,15 @@ function show_unsubscribe_button( $type, $key, $ext, $tab ){
*
*/
function show_installed_button( $type, $key, $ext, $tab ){
-
+
if( $this->is_installed( $type, $key, $ext )
&& $this->in_the_store( $type, $key, $ext, $tab )
){
return true;
- } else
- return false;
+ } else
+ return false;
}
-
+
/**
*
@@ -566,11 +566,11 @@ function show_installed_button( $type, $key, $ext, $tab ){
*
*/
function subscription_enabled(){
-
+
if( defined( 'STORE_SUBSRIPTIONS_DISABLE' ) || ! VPRO )
return false;
- else
- return true;
+ else
+ return true;
}
/**
@@ -582,16 +582,16 @@ function show_delete_button( $type, $key, $ext, $tab ){
if ( $type == 'section' && ( $tab == 'child' || $tab == 'internal' ) )
return false;
-
+
if( !$this->is_active( $type, $key, $ext )
&& $this->is_installed( $type, $key, $ext )
&& !EXTEND_NETWORK
&& !$this->in_the_store( $type, $key, $ext, $tab )
){
return true;
- } else
+ } else
return false;
-
+
}
@@ -603,47 +603,47 @@ function show_delete_button( $type, $key, $ext, $tab ){
function is_installed( $type, $key, $ext, $tab = '' ){
if( 'dash_rss' == $tab && 'plugin' == $type ) {
-
+
if ( is_dir( sprintf( '%s/%s', WP_PLUGIN_DIR, $ext['slug'] ) ) && file_exists( sprintf( '%s/%s/%s.php', WP_PLUGIN_DIR, $ext['slug'], $ext['slug'] ) ) )
return true;
}
if( $type == 'section' ){
-
+
$status = ( isset($ext['status'] ) ) ? true : false;
-
+
if ( isset( $ext['base_file'] ) )
$path = $ext['base_file'];
else
$path = sprintf( '%s/%s/section.php', PL_EXTEND_DIR, $ext['slug'] );
-
+
if( is_file( $path ) )
return true;
- else
+ else
return false;
} elseif( $type == 'plugin' ){
if( isset( $ext['status']['status'] ) && $ext['status']['status'] != '' )
return true;
- else
+ else
return false;
} elseif( $type == 'theme' ){
-
+
$check_file = sprintf( '%s/themes/%s/style.css', WP_CONTENT_DIR, $key );
if ( is_file( $check_file ) )
$exists = true;
-
+
if( isset( $exists ) && $data = pl_get_theme_data( $key ) )
return true;
else
return false;
- }
+ }
}
-
+
/**
*
@@ -657,7 +657,7 @@ function show_purchase_button( $type, $key, $ext, $tab ){
if( EXTEND_NETWORK ) {
if( ( 'user' == $tab || 'installed' == $tab )
- && ! $this->is_purchased( $type, $key, $ext )
+ && ! $this->is_purchased( $type, $key, $ext )
&& $this->is_premium( $type, $key, $ext )
&& !($this->is_user_plus() && $this->is_plus_product( $type, $key, $ext, $tab ))
@@ -665,10 +665,10 @@ function show_purchase_button( $type, $key, $ext, $tab ){
return false;
}
- if( !EXTEND_NETWORK
- && $this->updates_configured()
+ if( !EXTEND_NETWORK
+ && $this->updates_configured()
&& $this->in_the_store( $type, $key, $ext, $tab )
- && !$this->is_purchased( $type, $key, $ext )
+ && !$this->is_purchased( $type, $key, $ext )
&& !$this->is_installed( $type, $key, $ext )
&& $this->is_premium( $type, $key, $ext )
&& ! $this->version_fail( $ext['plversion'] )
@@ -676,21 +676,21 @@ function show_purchase_button( $type, $key, $ext, $tab ){
&& ! $this->is_pro_only( $type, $key, $ext, $tab )
){
return true;
- } else
+ } else
return false;
}
-
+
/**
*
* @TODO document
*
*/
function show_plus_button( $type, $key, $ext, $tab ){
-
- if( !EXTEND_NETWORK
- && $this->updates_configured()
+
+ if( !EXTEND_NETWORK
+ && $this->updates_configured()
&& $this->in_the_store( $type, $key, $ext, $tab )
- && !$this->is_purchased( $type, $key, $ext )
+ && !$this->is_purchased( $type, $key, $ext )
&& !$this->is_installed( $type, $key, $ext )
&& $this->is_premium( $type, $key, $ext )
&& ! $this->version_fail( $ext['plversion'] )
@@ -698,7 +698,7 @@ function show_plus_button( $type, $key, $ext, $tab ){
&& $this->is_plus_product( $type, $key, $ext, $tab )
){
return true;
- } else
+ } else
return false;
}
@@ -711,12 +711,12 @@ function show_plus_button( $type, $key, $ext, $tab ){
function is_premium( $type, $key, $ext ){
$ext = (array) $ext;
- if( isset( $ext['price'] )
- && $ext['price'] != 'free'
- && (int) $ext['price'] >= 0
+ if( isset( $ext['price'] )
+ && $ext['price'] != 'free'
+ && (int) $ext['price'] >= 0
){
return true;
- } else
+ } else
return false;
}
@@ -729,18 +729,18 @@ function is_premium( $type, $key, $ext ){
function is_purchased( $type, $key, $ext ){
if($type == 'section'){
-
+
return ( isset( $ext['purchased'] ) && $ext['purchased'] == 'purchased' ) ? true : false;
-
+
} else {
-
+
if( isset( $ext['purchased'] ) )
- return true;
+ return true;
else
return false;
}
}
-
+
/**
*
@@ -780,30 +780,30 @@ function show_activate_button( $type, $key, $ext, $tab ){
&& ! $this->is_pro_only( $type, $key, $ext, $tab )
){
return true;
- } else
+ } else
return false;
}
-
-
+
+
/**
*
* @TODO document
*
*/
function show_deactivate_button( $type, $key, $ext, $tab ){
-
- if ( $type == 'integration' && VDEV )
+
+ if ( $type == 'integration' && VDEV )
return is_integration_active( $key );
-
+
if( $this->is_active( $type, $key, $ext )
&& ! $this->in_the_store( $type, $key, $ext, $tab )
&& ! $this->is_persistant( $type, $key, $ext, $tab )
){
return true;
- } else
+ } else
return false;
}
-
+
/**
*
@@ -811,7 +811,7 @@ function show_deactivate_button( $type, $key, $ext, $tab ){
*
*/
function is_persistant( $type, $key, $ext, $tab ) {
-
+
if ( isset( $ext['persistant'] ) && true == $ext['persistant'] )
return true;
else
@@ -828,20 +828,20 @@ function is_active( $type, $key, $ext ){
if ( $type == 'integration' )
return is_integration_active($key);
-
+
elseif($type == 'plugin'){
if( isset( $ext['status']['status'] ) && $ext['status']['status'] == 'active' )
return true;
- else
+ else
return false;
-
+
}elseif( $type == 'section' ){
-
+
if( isset( $ext['status'] ) && $ext['status'] == 'enabled' )
return true;
else
return false;
-
+
} elseif( $type == 'theme' ){
if( $key == basename( get_stylesheet_directory() ) )
@@ -849,7 +849,7 @@ function is_active( $type, $key, $ext ){
else
return false;
}
-
+
}
@@ -862,14 +862,14 @@ function in_the_store( $type, $key, $ext, $tab ){
if ( $type == 'integration' )
return true;
-
+
if( $tab == 'free' || $tab == 'premium' || $tab == 'featured' )
return true;
else
return false;
-
+
}
-
+
/**
*
* @TODO document
@@ -879,10 +879,10 @@ function is_plus_product( $type, $key, $ext, $tab ) {
if(isset($ext['plus_product']) && $ext['plus_product']) {
return true;
}
-
+
return false;
}
-
+
/**
*
* @TODO document
@@ -892,7 +892,7 @@ function is_user_plus() {
if(VPLUS) {
return true;
}
-
+
return false;
}
@@ -904,7 +904,7 @@ function is_user_plus() {
function purchase_button( $purchased = false, $store = true ){
return ( $store && !EXTEND_NETWORK && !$purchased && !$this->login_button( $purchased ) ) ? true : false;
}
-
+
/**
*
@@ -914,7 +914,7 @@ function purchase_button( $purchased = false, $store = true ){
function install_button( $installed = false, $purchased = false, $version = 0 ){
return ( $this->version_check( $version ) && !EXTEND_NETWORK && $purchased && ! $installed) ? true : false;
}
-
+
/**
*
@@ -924,7 +924,7 @@ function install_button( $installed = false, $purchased = false, $version = 0 ){
function version_fail( $version ){
return ( ! $this->version_check( $version ) ) ? true : false;
}
-
+
/**
*
@@ -934,7 +934,7 @@ function version_fail( $version ){
function updates_configured( ){
return ( pagelines_check_credentials() ) ? true : false;
}
-
+
/**
*
@@ -959,25 +959,25 @@ function do_redirect( $type, $key, $ext, $tab ){
*
*/
function image_path( $type, $key, $ext, $tab ) {
-
+
if( $type == 'integration' ) {
if( isset( $ext['screen'] ) && $ext['screen'] )
return sprintf( '%s/files/integrations/img/%s-thumb.png',untrailingslashit( PL_API_CDN ), $key );
}
-
+
if ( $type == 'plugin' ) {
-
+
if ( $this->is_installed( $type, $key, $ext, $tab ) ) {
-
+
if ( is_file( sprintf( '%s/%s/thumb.png', WP_PLUGIN_DIR, $ext['slug'] ) ) )
return sprintf( '%s/thumb.png', plugins_url( $ext['slug'] ) );
} else {
-
+
if( isset( $ext['screen'] ) && $ext['screen'] )
return sprintf( '%s/files/%ss/img/%s-thumb.png', untrailingslashit( PL_API_CDN ), $type, $ext['slug'] );
}
}
-
+
if ( $type == 'section' ) {
if ( isset( $ext['base_dir'] ) && is_file( sprintf( '%s/thumb.png', $ext['base_dir'] ) ) )
@@ -986,27 +986,27 @@ function image_path( $type, $key, $ext, $tab ) {
if( isset( $ext['screen'] ) && $ext['screen'] )
return sprintf( '%s/files/%ss/img/%s-thumb.png', untrailingslashit( PL_API_CDN ), $type, $ext['slug'] );
}
-
+
if ( $type == 'theme' ) {
- if ( ( $this->show_install_button( $type, $key, $ext, $tab ) || $this->show_purchase_button( $type, $key, $ext, $tab ) || $this->show_login_button( $type, $key, $ext, $tab ) || EXTEND_NETWORK ) )
+ if ( ( $this->show_install_button( $type, $key, $ext, $tab ) || $this->show_purchase_button( $type, $key, $ext, $tab ) || $this->show_login_button( $type, $key, $ext, $tab ) || EXTEND_NETWORK ) )
if ( isset( $ext['screen'] ) && $ext['screen'] )
- return sprintf( '%s/files/themes/img/%s-thumb.png', untrailingslashit( PL_API_CDN ), $key );
+ return sprintf( '%s/files/themes/img/%s-thumb.png', untrailingslashit( PL_API_CDN ), $key );
// theme installed or no screenshot...
if ( is_file( sprintf( '%s/%s/thumb.png', get_theme_root(), $key ) ) )
return sprintf( '%s/%s/thumb.png', get_theme_root_uri(), $key );
-
+
if ( is_file( sprintf( '%s/%s/screenshot.png', get_theme_root(), $key ) ) )
return sprintf( '%s/%s/screenshot.png', get_theme_root_uri(), $key );
}
return PL_ADMIN_IMAGES . '/thumb-default.png';
}
-
-
+
+
/**
*
* @Todo make this a serialized array of all data.
@@ -1015,19 +1015,19 @@ function image_path( $type, $key, $ext, $tab ) {
function get_the_path( $button, $type, $key, $ext, $tab ){
- // If Section >>>
+ // If Section >>>
if ( ( $button == 'deactivate' || $button == 'activate' ) && $type == 'section' )
return $ext['type'];
-
+
if ( ( $button == 'install' || $button == 'delete' ) && $type == 'section' ) {
- return $key;
- }
-
+ return $key;
+ }
+
if( $type == 'integration' )
return get_integration_path($ext);
-
+
}
-
+
/**
*
@@ -1038,17 +1038,17 @@ function get_the_file( $button, $type, $key, $ext, $tab ){
if ( $button == 'delete' || $button == 'upgrade' ) {
if ( $type == 'section'
- && isset( $ext['base_dir'] )
+ && isset( $ext['base_dir'] )
) {
- return basename( $ext['base_dir'] );
+ return basename( $ext['base_dir'] );
}
}
-
-
+
+
if ( $type == 'section' ) {
- return $ext['class'];
+ return $ext['class'];
} elseif( $type == 'plugin' ){
-
+
if( $button == 'activate'
|| $button == 'deactivate'
|| $button == 'delete'
@@ -1056,16 +1056,16 @@ function get_the_file( $button, $type, $key, $ext, $tab ){
return $ext['file'];
} else
return $key;
-
-
+
+
}elseif( $type == 'theme' ){
- return $key;
-
+ return $key;
+
} else
return $key;
-
+
}
-
+
/**
*
@@ -1078,7 +1078,7 @@ function paypal_link( $type, $key, $ext, $tab ){
elseif( isset( $ext['productid'] ) )
$p = $ext['productid'];
- return ( isset( $p ) && isset( $ext['uid'] ) ) ? sprintf( '%s,%s|%s|%s', $p, $ext['uid'], $ext['price'], $ext['name'] ) : '';
+ return ( isset( $p ) && isset( $ext['uid'] ) ) ? sprintf( '%s,%s|%s|%s', $p, $ext['uid'], $ext['price'], $ext['name'] ) : '';
}
@@ -1088,29 +1088,29 @@ function paypal_link( $type, $key, $ext, $tab ){
*
*/
function purchase_text( $type, $key, $ext, $tab ){
-
+
$ext = (array) $ext;
-
+
$price = ( isset( $ext['price'] ) ) ? sprintf( ' ($%s) ', $ext['price'] ) : '';
- return sprintf( '%s%s', __( 'Purchase', 'pagelines' ), $price );
+ return sprintf( '%s%s', __( 'Purchase', 'pagelines' ), $price );
}
-
-
+
+
/**
*
* @TODO document
*
*/
function plus_text( $type, $key, $ext, $tab ){
-
+
$ext = (array) $ext;
-
+
$price = ( isset( $ext['price'] ) ) ? sprintf( ' ($%s) ', $ext['price'] ) : '';
- return sprintf( '%s%s', __( 'Free PageLines Plus', 'pagelines' ), '' . $price . '' );
+ return sprintf( '%s%s', __( 'Free PageLines Plus', 'pagelines' ), '' . $price . '' );
}
-
+
/**
*
@@ -1118,10 +1118,10 @@ function plus_text( $type, $key, $ext, $tab ){
*
*/
function get_the_version($type, $key, $ext){
-
+
// has to be the installed version.
if ( $this->is_installed( $type, $key, $ext ) ) {
-
+
if ( $type == 'plugin' )
return $ext['status']['data']['Version'];
}
@@ -1135,45 +1135,45 @@ function get_the_version($type, $key, $ext){
*
*/
function get_api_version( $type, $key, $ext ) {
-
+
if ( isset( $ext['apiversion'] ) )
return $ext['apiversion'];
-
+
return false;
}
-
+
/**
*
* @TODO document
*
*/
function get_product_id( $ext ) {
-
+
if ( isset( $ext['pid'] ) )
return $ext['pid'];
-
+
if ( isset( $ext['productid'] ) )
return $ext['productid'];
-
+
return false;
}
-
+
/**
*
* @TODO document
*
*/
function parse_buttons( $actions, $core_actions ){
-
+
$actions = wp_parse_args( $actions, $core_actions );
-
+
foreach( $actions as $action => $button ){
if( isset( $core_actions[$action] ) ){
$actions[$action] = wp_parse_args( $button, $core_actions[$action] );
}
}
return $actions;
- }
+ }
/**
* Simple cache.
@@ -1193,7 +1193,7 @@ function get_latest_cached( $type, $flush = null, $timeout = 86400 ) {
)
);
// if v4 all, we just want stuff, its cached on the server.
- if( 'all' == $type ) {
+ if( 'all' == $type ) {
$response = pagelines_try_api( $url, $options );
if ( $response !== false ) {
@@ -1201,26 +1201,26 @@ function get_latest_cached( $type, $flush = null, $timeout = 86400 ) {
$api = wp_remote_retrieve_body( $response );
return json_decode( $api );
}
- return false;
+ return false;
}
-
+
if ( false === ( $api_check = get_transient( 'pagelines_extend_' . $type ) ) ) {
-
+
// ok no transient, we need an update...
-
+
$response = pagelines_try_api( $url, $options );
-
+
if ( $response !== false ) {
-
+
// ok we have the data parse and store it
-
+
$api = wp_remote_retrieve_body( $response );
set_transient( 'pagelines_extend_' . $type, true, $timeout );
update_option( 'pagelines_extend_' . $type, $api );
- }
+ }
}
- $api = get_option( 'pagelines_extend_' . $type, false );
+ $api = get_option( 'pagelines_extend_' . $type, false );
if( ! $api )
return __( 'Unable to fetch from API ', 'pagelines' );
@@ -1230,18 +1230,18 @@ function get_latest_cached( $type, $flush = null, $timeout = 86400 ) {
/**
* Refresh the PageLines store cache
- *
+ *
*/
function launchpad_returns() {
-
+
if (isset( $_GET['api_returned'] ) || isset( $_POST['reset_store'] ) )
$this->flush_caches();
}
/**
* Check if we have the extend plugin.
- *
- */
+ *
+ */
/**
*
@@ -1249,40 +1249,40 @@ function launchpad_returns() {
*
*/
function has_extend_plugin( $status = false ){
-
+
if($status){
-
+
if( is_file( PL_EXTEND_INIT ) && current( $this->plugin_check_status( PL_EXTEND_INIT ) ) == 'notactive' )
return 'notactive';
elseif( !is_dir( PL_EXTEND_DIR ) || !is_file( PL_EXTEND_INIT ) )
return 'notinstalled';
else
return 'active';
-
+
} else {
if ( !is_dir( PL_EXTEND_DIR ) || ( is_file( PL_EXTEND_INIT ) && current( $this->plugin_check_status( PL_EXTEND_INIT ) ) == 'notactive' ) )
return false;
- else
+ else
return true;
}
}
-
+
/**
* Get current status for a plugin.
- *
+ *
*/
function plugin_check_status( $file ) {
-
+
if ( !is_file( $file ) )
return ;
$data = get_plugin_data( $file );
- if ( in_array( str_replace( '.php', '', basename( $file ) ), pagelines_register_plugins() ) )
+ if ( in_array( str_replace( '.php', '', basename( $file ) ), pagelines_register_plugins() ) )
return array( 'status' => 'active', 'version' => $data['Version'], 'data' => $data );
else
return array( 'status' => 'notactive', 'version' => $data['Version'], 'data' => $data );
}
-
+
/**
*
@@ -1290,13 +1290,13 @@ function plugin_check_status( $file ) {
*
*/
function get_the_tags( $type, $key, $ext, $tab ) {
-
+
if ( isset( $ext['tags'] ) && ! empty( $ext['tags'] ) )
return $ext['tags'];
else
return '';
}
-
+
/**
*
@@ -1304,7 +1304,7 @@ function get_the_tags( $type, $key, $ext, $tab ) {
*
*/
function get_the_author( $type, $key, $ext, $tab ) {
-
+
if ( isset( $ext['author'] ) && ! empty( $ext['author'] ) )
return $ext['author'];
else
@@ -1318,7 +1318,7 @@ function get_the_author( $type, $key, $ext, $tab ) {
*
*/
function get_the_author_uri( $type, $key, $ext, $tab ) {
-
+
if ( isset( $ext['external'] ) && ! empty( $ext['external'] ) )
return $ext['external'];
@@ -1326,8 +1326,8 @@ function get_the_author_uri( $type, $key, $ext, $tab ) {
return $ext['author_url'];
else
return admin_url();
- }
-
+ }
+
/**
*
@@ -1335,13 +1335,13 @@ function get_the_author_uri( $type, $key, $ext, $tab ) {
*
*/
function get_the_name( $type, $key, $ext, $tab ) {
-
+
if ( isset( $ext['name'] ) && ! empty( $ext['name'] ) )
return $ext['name'];
else
return '';
}
-
+
/**
*
@@ -1349,16 +1349,16 @@ function get_the_name( $type, $key, $ext, $tab ) {
*
*/
function get_the_desc( $type, $key, $ext, $tab ) {
-
+
if ( isset( $ext['text'] ) && ! empty( $ext['text'] ) )
return $ext['text'];
if ( isset( $ext['description'] ) )
return wp_kses( $ext['description'], array() );
-
+
return '';
}
-
+
/**
*
@@ -1366,13 +1366,13 @@ function get_the_desc( $type, $key, $ext, $tab ) {
*
*/
function get_the_count( $type, $key, $ext, $tab ) {
-
+
if ( isset( $ext['count'] ) && ! empty( $ext['count'] ) )
return $ext['count'];
else
return '0';
}
-
+
/**
*
@@ -1380,13 +1380,13 @@ function get_the_count( $type, $key, $ext, $tab ) {
*
*/
function get_the_screen( $type, $key, $ext, $tab ) {
-
+
if ( isset( $ext['screen'] ) && ! empty( $ext['screen'] ) )
return $ext['screen'];
else
return false;
}
-
+
/**
*
@@ -1394,13 +1394,13 @@ function get_the_screen( $type, $key, $ext, $tab ) {
*
*/
function get_the_object( $type, $key, $ext, $tab ) {
-
+
if ( isset( $ext['class'] ) && ! empty( $ext['class'] ) )
return $ext['class'];
else
return false;
}
-
+
/**
*
@@ -1408,11 +1408,11 @@ function get_the_object( $type, $key, $ext, $tab ) {
*
*/
function get_info_url( $type, $key, $ext, $tab ) {
-
+
$slug = ( isset( $ext['slug'] ) ) ? $ext['slug'] : $key;
return sprintf( '%s/%ss/%s/?product_ref=true', PL_STORE_URL, $type, $slug );
}
-
+
/**
*
@@ -1420,11 +1420,11 @@ function get_info_url( $type, $key, $ext, $tab ) {
*
*/
function get_demo_url( $type, $key, $ext, $tab ) {
-
+
return ( isset( $ext['demo'] ) ) ? $ext['demo'] : '';
}
-
+
/**
*
@@ -1432,15 +1432,15 @@ function get_demo_url( $type, $key, $ext, $tab ) {
*
*/
function get_external_url( $type, $key, $ext, $tab ) {
-
+
if ( isset( $ext['external'] ) )
return $ext['external'];
-
+
if ( isset( $ext['authorurl'] ) )
return $ext['authorurl'];
}
-
+
/**
*
@@ -1450,17 +1450,17 @@ function get_external_url( $type, $key, $ext, $tab ) {
function depends_nice_name( $type, $key, $ext, $tab ) {
if ( isset( $ext['depends'] ) ) {
-
+
if ( $type == 'plugin' ) {
-
+
$plugins = $this->get_latest_cached( 'plugins' );
-
+
if ( isset($plugins->$ext['depends']) && isset( $plugins->$ext['depends']->name ) )
return $plugins->$ext['depends']->name;
- }
+ }
}
}
-
+
/**
*
@@ -1471,12 +1471,12 @@ function get_master_list( $extension, $type, $tab, $mode = '') {
$list = array();
foreach( (array) $extension as $key => $ext ) {
-
+
$ext = (array) $ext;
if( !$this->show_in_tab( $type, $key, $ext, $tab ) )
- continue;
-
+ continue;
+
if ( 'installed' == $mode )
$array_key = basename( $ext['base_dir'] );
else
@@ -1486,7 +1486,7 @@ function get_master_list( $extension, $type, $tab, $mode = '') {
}
return ( !empty( $list ) ) ? $list : '';
}
-
+
/**
*
@@ -1494,9 +1494,9 @@ function get_master_list( $extension, $type, $tab, $mode = '') {
*
*/
function get_the_tab( $type, $key, $ext, $tab ) {
-
+
return $tab;
-
+
}
@@ -1506,22 +1506,22 @@ function get_the_tab( $type, $key, $ext, $tab ) {
*
*/
function master_list( $type, $key, $ext, $tab ) {
-
+
$ext['apiversion'] = ( isset( $ext['apiversion'] ) ) ? $ext['apiversion'] : $ext['version'];
-
+
if ( !isset( $ext['status'] ) )
$ext['status'] = array( 'status' => '' );
-
+
$list = array(
$type => $ext,
- 'name' => $this->get_the_name( $type, $key, $ext, $tab ),
+ 'name' => $this->get_the_name( $type, $key, $ext, $tab ),
'active' => $this->is_active( $type, $key, $ext ),
- 'version' => $this->get_the_version( $type, $key, $ext ),
+ 'version' => $this->get_the_version( $type, $key, $ext ),
'desc' => $this->get_the_desc( $type, $key, $ext, $tab ),
'tags' => $this->get_the_tags( $type, $key, $ext, $tab ),
'image' => $this->image_path( $type, $key, $ext, $tab ),
'auth' => $this->get_the_author( $type, $key, $ext, $tab ),
- 'auth_url' => $this->get_the_author_uri( $type, $key, $ext, $tab ),
+ 'auth_url' => $this->get_the_author_uri( $type, $key, $ext, $tab ),
'key' => $key,
'type' => $type,
'infourl' => $this->get_info_url( $type, $key, $ext, $tab ),
@@ -1533,47 +1533,47 @@ function master_list( $type, $key, $ext, $tab ) {
'external' => $this->get_external_url( $type, $key, $ext, $tab ),
'tab' => $this->get_the_tab( $type, $key, $ext, $tab )
);
-
+
return $list;
}
-
+
function updates_list( $args ) {
-
+
$updates = ( array ) get_theme_mod( 'available_updates' );
-
- $defaults = array(
+
+ $defaults = array(
'list' => array(),
'type' => 'plugin'
);
$o = wp_parse_args( $args, $defaults );
-
+
if ( ! is_array( $o['list'] ) )
return;
if ( 'section' == $o['type'] ) {
-
+
$sections = array();
foreach( $o['list'] as $a => $b ) {
-
+
if( isset( $b['pid'] ) && $b['pid'] )
$sections[$b['class']] = array( 'section' => $b );
}
- $o['list'] = $sections;
+ $o['list'] = $sections;
}
foreach( $o['list'] as $key => $d ) {
-
+
$ext = $d[ $o['type'] ];
-
+
$id = ( $this->is_installed( $o['type'], $key, $ext ) ) ? $this->get_product_id( $ext ) : false;
-
+
if( $id ) {
$version = $this->get_the_version( $o['type'], $key, $ext );
-
+
if ( $id && $version )
$updates[$id] = $version;
}
- }
+ }
set_theme_mod( 'available_updates', $updates );
}
diff --git a/admin/class.extend.plugins.php b/admin/class.extend.plugins.php
index 07d01feb..2e4722da 100644
--- a/admin/class.extend.plugins.php
+++ b/admin/class.extend.plugins.php
@@ -1,7 +1,7 @@
get_master_list( $plugins, $type, $tab );
$this->updates_list( array( 'list' => $list, 'type' => 'plugin' ) );
-
+
return $this->ui->extension_list( array( 'list' => $list, 'tab' => $tab, 'type' => 'plugins' ) );
}
@@ -39,10 +39,10 @@ function extension_plugins( $tab = '' ) {
*
*/
function load_plugins(){
-
+
$plugins = $this->get_latest_cached( 'plugins' );
- if ( !is_object($plugins) )
+ if ( !is_object($plugins) )
return $plugins;
$output = '';
@@ -50,14 +50,14 @@ function load_plugins(){
$plugins = pagelines_store_object_sort( $plugins );
$plugins = json_decode(json_encode($plugins), true); // convert objects to arrays
-
+
$plugins = self::external_plugins( $plugins );
-
+
foreach( $plugins as $key => $plugin )
$plugins[$key]['file'] = sprintf('/%1$s/%1$s.php', $key);
-
+
// get status of each plugin
foreach( $plugins as $key => $ext ) {
$plugins[$key]['status'] = $this->plugin_check_status( WP_PLUGIN_DIR . $ext['file'] );
@@ -73,12 +73,12 @@ function load_plugins(){
}
return $plugins;
}
-
+
/*
* Get installed plugins and if they have the PageLines header, include them in the store.
*/
function external_plugins( $plugins ) {
-
+
$default_headers = array(
'Demo' => 'Demo',
'External' => 'External',
@@ -89,20 +89,20 @@ function external_plugins( $plugins ) {
if ( is_multisite() )
return $plugins;
-
+
$ext_plugins = (array) get_plugins();
-
+
foreach( $ext_plugins as $ext => $data ) {
-
+
$new_key = rtrim( str_replace( basename( $ext ), '', $ext ), '/' );
unset( $ext_plugins[$ext] );
if ( !array_key_exists( $new_key, $plugins ) ) {
-
+
$a = get_file_data( WP_PLUGIN_DIR . '/' . $ext, $default_headers );
if ( !empty( $a['PageLines'] ) && !empty( $new_key ) ) {
- $plugins[$new_key]['name'] = $data['Name'];
+ $plugins[$new_key]['name'] = $data['Name'];
$plugins[$new_key]['slug'] = $new_key;
$plugins[$new_key]['text'] = $data['Description'];
$plugins[$new_key]['version'] = $data['Version'];
@@ -116,14 +116,14 @@ function external_plugins( $plugins ) {
$plugins[$new_key]['long'] = $a['Long'];
$plugins[$new_key]['depends'] = $a['Depends'];
}
- }
+ }
}
return $plugins;
}
-
+
/**
* Remove our plugins from the maim WordPress updates.
- *
+ *
*/
function pagelines_plugins_remove( $r, $url ) {
@@ -137,11 +137,11 @@ function pagelines_plugins_remove( $r, $url ) {
if ( !empty( $data['pagelines'] ) ) {
unset( $plugins->plugins[$plugin] );
- unset( $plugins->active[array_search( $plugin, $plugins->active )] );
+ unset( $plugins->active[array_search( $plugin, $plugins->active )] );
}
}
- $r['body']['plugins'] = serialize( $plugins );
+ $r['body']['plugins'] = serialize( $plugins );
}
- return $r;
- }
+ return $r;
+ }
}
\ No newline at end of file
diff --git a/admin/class.extend.sections.php b/admin/class.extend.sections.php
index d74f1194..2fd4eaa2 100644
--- a/admin/class.extend.sections.php
+++ b/admin/class.extend.sections.php
@@ -1,40 +1,40 @@
ui->extension_banner( __( 'A PageLines child theme is not currently activated', 'pagelines' ) );
-
+
if ( !$this->has_extend_plugin() )
return $this->ui->get_extend_plugin( $this->has_extend_plugin('status'), $tab );
$list = array();
$type = 'section';
-
+
if ( 'install' == $mode ) {
$sections = $this->get_latest_cached( 'sections' );
- if ( !is_object( $sections ) )
+ if ( !is_object( $sections ) )
return $sections;
$sections = pagelines_store_object_sort( $sections );
$list = $this->get_master_list( $sections, $type, $tab );
-
+
} // end install mode
-
+
if ( 'installed' == $mode ) {
-
+
global $load_sections;
-
+
// Get sections
-
+
$available = $load_sections->pagelines_register_sections( true, true );
$disabled = get_option( 'pagelines_sections_disabled', array() );
@@ -45,17 +45,17 @@ function extension_sections( $tab = '', $mode = 'install' ) {
$available[$key] = self::sort_status( $section, $disabled, $available, $upgradable );
}
-
- $sections = self::merge_sections( $available );
+
+ $sections = self::merge_sections( $available );
$this->updates_list( array( 'list' => $sections, 'type' => 'section' ) );
- $list = $this->get_master_list( $sections, $type, $tab, 'installed' );
-
+ $list = $this->get_master_list( $sections, $type, $tab, 'installed' );
+
} // end installed mode
-
-
-
+
+
+
return $this->ui->extension_list( array( 'list' => $list, 'tab' => $tab, 'type' => 'sections' ) );
}
@@ -66,14 +66,14 @@ function extension_sections( $tab = '', $mode = 'install' ) {
*
*/
function merge_sections( $sections ) {
-
+
$out = array();
-
+
foreach ( $sections as $key => $section) {
-
+
$out = array_merge( $out, $sections[$key] );
}
-
+
return $out;
}
@@ -84,14 +84,14 @@ function merge_sections( $sections ) {
*
*/
function sort_status( $section, $disabled, $available, $upgradable) {
-
+
if (! is_array( $section ) )
return;
foreach( $section as $key => $ext) {
$section[$key]['status'] = ( isset( $disabled[ $ext['type'] ][ $ext['class'] ] ) ) ? 'disabled' : 'enabled';
$section[$key] = self::check_version( $section[$key], $upgradable );
$section[$key]['class_exists'] = ( isset( $available['child'][ $ext['class'] ] ) || isset( $available['custom'][ $ext['class'] ] ) ) ? true : false;
-
+
$slug = basename( $ext['base_dir'] );
$section[$key]['subscribed'] = ( isset( $upgradable->$slug->subscribed ) ) ? $upgradable->$slug->subscribed : null;
$section[$key]['pid'] = ( isset( $upgradable->$slug->productid ) ) ? $upgradable->$slug->productid : null;
@@ -107,7 +107,7 @@ function sort_status( $section, $disabled, $available, $upgradable) {
*
*/
function check_version( $ext, $upgradable ) {
-
+
if ( isset( $ext['base_dir'] ) ) {
$upgrade = basename( $ext['base_dir'] );
if ( isset( $upgradable->$upgrade->version ) ) {
diff --git a/admin/class.extend.themes.php b/admin/class.extend.themes.php
index c00bdc1f..a012a33c 100644
--- a/admin/class.extend.themes.php
+++ b/admin/class.extend.themes.php
@@ -1,33 +1,33 @@
get_latest_cached( 'themes' );
- if ( !is_object($themes) )
+ if ( !is_object($themes) )
return $themes;
$themes = self::extension_scan_themes( $themes );
$list = $this->get_master_list( $themes, $type, $tab );
- $this->updates_list( array( 'list' => $list, 'type' => 'theme' ) );
-
+ $this->updates_list( array( 'list' => $list, 'type' => 'theme' ) );
+
return $this->ui->extension_list( array( 'list' => $list, 'tab' => $tab, 'type' => 'themes', 'mode' => 'graphic' ) );
}
-
+
/**
* Scan for themes and combine api with installed.
- *
- */
+ *
+ */
/**
*
@@ -35,7 +35,7 @@ function extension_themes( $tab = '' ) {
*
*/
function extension_scan_themes( $themes ) {
-
+
$default_headers = array(
'Demo' => 'Demo',
'External' => 'External',
@@ -46,46 +46,46 @@ function extension_scan_themes( $themes ) {
$themes = pagelines_store_object_sort( $themes );
$themes = json_decode(json_encode($themes), true);
-
+
$get_themes = apply_filters( 'store_get_themes', pl_get_themes() );
foreach( $get_themes as $theme => $theme_data ) {
$up = null;
$purchased = null;
-
+
// Now we add our data...
$theme_file = $theme_data['Stylesheet Files'][0];
$pl_theme_data = get_file_data( $theme_file, $default_headers );
-
+
if ( $theme_data['Template'] != 'pagelines' )
continue;
-
+
if ( 'pagelines' == $theme_data['Stylesheet'] )
continue;
-
- // check for an update...
- if ( isset( $themes[ $theme_data['Stylesheet'] ]['version'] ) && $themes[ $theme_data['Stylesheet'] ]['version'] > $theme_data['Version'])
+
+ // check for an update...
+ if ( isset( $themes[ $theme_data['Stylesheet'] ]['version'] ) && $themes[ $theme_data['Stylesheet'] ]['version'] > $theme_data['Version'])
$up = $themes[ $theme_data['Stylesheet'] ]['version'];
else
$up = '';
-
+
$pid = ( isset( $themes[ $theme_data['Stylesheet'] ]['productid'] ) ) ? $themes[ $theme_data['Stylesheet'] ]['productid'] : '';
$subscribed = ( isset( $themes[ $theme_data['Stylesheet'] ]['subscribed'] ) ) ? $themes[ $theme_data['Stylesheet'] ]['subscribed'] : null;
if ( in_array( $theme, $themes ) )
continue;
-
+
$purchased = ( isset( $themes[ $theme_data['Stylesheet'] ]['purchased'] ) ) ? $themes[ $theme_data['Stylesheet'] ]['purchased'] : '';
// If we got this far, theme is a pagelines child theme not handled by the API
// So we need to inject it into our themes array.
-
+
$plus = ( isset( $themes[ $theme_data['Stylesheet'] ]['plus_product'] ) ) ? $themes[ $theme_data['Stylesheet'] ]['plus_product'] : false;
-
+
$new_theme = array();
$new_theme['name'] = $theme_data['Name'];
$new_theme['author'] = $theme_data['Author Name'];
$new_theme['author_url'] = $theme_data['Author URI'];
- $new_theme['apiversion'] = $up;
+ $new_theme['apiversion'] = $up;
$new_theme['version'] = $theme_data['Version'];
$new_theme['text'] = $theme_data['Description'];
$new_theme['long'] = $pl_theme_data['Long'];
@@ -101,9 +101,9 @@ function extension_scan_themes( $themes ) {
if ( $purchased )
$new_theme['purchased'] = $purchased;
$new_theme['plus_product'] = $plus;
- $themes[$theme_data['Stylesheet']] = $new_theme;
+ $themes[$theme_data['Stylesheet']] = $new_theme;
}
return $themes;
}
-
+
}
\ No newline at end of file
diff --git a/admin/class.extend.ui.php b/admin/class.extend.ui.php
index f922d80e..cdaf9ec3 100644
--- a/admin/class.extend.ui.php
+++ b/admin/class.extend.ui.php
@@ -1,6 +1,6 @@
exprint = 'onClick="extendIt(\'%s\', \'%s\', \'%s\', \'%s\', \'%s\', \'%s\', \'%s\', \'%s\')"';
-
+
$this->defaultpane = array(
- 'name' => 'Unnamed',
- 'version' => 'No version',
+ 'name' => 'Unnamed',
+ 'version' => 'No version',
'active' => false,
- 'desc' => 'No description.',
+ 'desc' => 'No description.',
'auth_url' => 'http://www.pagelines.com',
'auth' => 'PageLines',
'image' => PL_ADMIN_IMAGES . '/thumb-default.png',
@@ -33,7 +33,7 @@ function __construct() {
'type' => '',
'count' => '',
'status' => '',
- 'actions' => array(),
+ 'actions' => array(),
'screen' => '',
'screenshot'=> '',
'extended' => '',
@@ -42,19 +42,19 @@ function __construct() {
'external' => '',
'demo' => ''
);
-
+
/**
* Hooked Actions
*/
add_action('admin_head', array(&$this, 'extension_js'));
-
+
}
/**
* Draw a list of extended items
*/
function extension_list( $args ){
-
+
$defaults = array (
'list' => array(),
@@ -64,9 +64,9 @@ function extension_list( $args ){
'ext' => '',
'active' => ''
);
-
+
$list = wp_parse_args( $args, $defaults );
-
+
if( empty( $list['list'] ) ) {
if ( $list['tab'] == 'installed' )
return $this->extension_banner( sprintf( __( 'Installed %s will appear here.', 'pagelines' ), $list['type'] ) );
@@ -76,38 +76,38 @@ function extension_list( $args ){
$count = 1;
if ( $list['mode'] == 'download' ) {
-
+
foreach( $list['list'] as $eid => $e ){
$list['ext'] .= $this->graphic_pane( $e, 'download', $count );
$count++;
}
- $output = sprintf('', $list['ext']);
- return $output;
+ $output = sprintf('', $list['ext']);
+ return $output;
}
-
-
+
+
if($list['mode'] == 'graphic'){
-
+
$count = 1;
foreach( $list['list'] as $eid => $e ){
-
+
if(isset($e['active']) && $e['active'])
$list['active'] .= $this->graphic_pane( $e, 'active', $count);
else
$list['ext'] .= $this->graphic_pane( $e, '', $count);
-
+
$count++;
}
$output = sprintf(
- '',
- $list['active'],
+ '',
+ $list['active'],
$list['ext']
);
-
+
} else {
-
+
$count = 1;
foreach( $list['list'] as $eid => $e ){
if(isset($e['active']) && $e['active'])
@@ -117,15 +117,15 @@ function extension_list( $args ){
$count++;
}
$output = sprintf(
- '',
- $list['active'],
+ '',
+ $list['active'],
$list['ext']
);
-
+
}
return $output;
}
-
+
/**
*
@@ -133,134 +133,134 @@ function extension_list( $args ){
*
*/
function graphic_pane( $e, $style = '', $count = ''){
-
+
$e = wp_parse_args( $e, $this->defaultpane);
$image = sprintf( ' ', $e['image'] );
-
+
if ( 'integration' != $e['type'] )
$title = sprintf('', $e['infourl'], $e['name'] );
else
$title = sprintf('%s ', $e['name'] );
-
+
$text = sprintf('%s
', $e['desc']);
-
+
$details = $this->grab_details( $e );
-
+
$link = $this->get_extend_buttons( $e, $style ) ;
-
+
$dtitle = ($style == 'active') ? __('Active Theme ', 'pagelines') : '';
-
- $alt = ($count % 2 == 0) ? 'alt_row' : '';
-
+
+ $alt = ($count % 2 == 0) ? 'alt_row' : '';
+
$out = sprintf(
- '',
- $style,
+ '',
+ $style,
$alt,
- $dtitle,
- $image,
- $title,
- $text,
+ $dtitle,
+ $image,
+ $title,
+ $text,
$link,
join($details, ' | ')
-
+
);
-
-
+
+
return $out;
-
+
}
-
+
function pane_template( $e, $style = '', $count = ''){
-
+
$e = wp_parse_args( $e, $this->defaultpane);
$image = sprintf( ' ', $e['image'] );
-
+
if ( 'internal' != $e['tab'] && 'child' != $e['tab'] )
$title = sprintf('', $e['infourl'], $e['name'] );
else
$title = sprintf('%s ', $e['name'] );
-
+
$text = sprintf('%s
', $e['desc']);
-
+
$details = $this->grab_details( $e );
-
+
$link = $this->get_extend_buttons( $e, $style ) ;
-
+
$dtitle = ($style == 'active') ? __('Activated ', 'pagelines') : '';
-
- $alt = ($count % 2 == 0) ? 'alt_row' : '';
-
+
+ $alt = ($count % 2 == 0) ? 'alt_row' : '';
+
$out = sprintf(
- '',
- $style,
+ '',
+ $style,
$alt,
- $dtitle,
- $image,
- $title,
- $text,
+ $dtitle,
+ $image,
+ $title,
+ $text,
$link,
join($details, ' | ')
-
+
);
-
-
+
+
return $out;
-
+
}
-
+
/**
*
* @TODO document
*
*/
function pane_template_old( $e, $count ){
-
+
$demo = '';
$external = '';
$info = '';
$auth = '';
$s = wp_parse_args( $e, $this->defaultpane);
-
+
// if we are 'core' tab or 'child' tab we dont want to see store urls or versions, they are pointless...
$int = ( isset( $s['section']['type'] ) && ( $s['section']['type'] == 'parent' || $s['section']['type'] == 'custom') ) ? true : false;
$alt = ($count % 2 == 0) ? 'alt_row' : '';
-
+
$details = $this->grab_details( $s );
-
+
// Thumb
$thumb = sprintf( '', $s['image'] );
$title = sprintf(
- '',
- $s['name'],
+ '',
+ $s['name'],
$this->get_extend_buttons( $e )
);
$body = sprintf(
- '',
- $s['desc'],
+ '',
+ $s['desc'],
join($details, ' | ')
);
$out = sprintf(
- '',
+ '',
$alt,
- $thumb,
- $title,
+ $thumb,
+ $title,
$body
);
return $out;
-
+
}
@@ -270,9 +270,9 @@ function pane_template_old( $e, $count ){
*
*/
function grab_details( $args ){
-
+
$target = 'target="_blank"';
- $details = array();
+ $details = array();
if( 'internal' != $args['tab'] && $args['version'] )
$details['version'] = sprintf( 'v%s ', $args['version'] );
@@ -280,17 +280,17 @@ function grab_details( $args ){
if( 'internal' != $args['tab'] && 'integration' != $args['type'] )
$details['overview'] = sprintf( 'Overview ', $target, $args['infourl'] );
-
+
if ( $args['external'] )
$details['homepage'] = sprintf( 'Homepage ', $target, $args['external'] );
-
+
if ( $args['demo'] )
$details['demo'] = sprintf( 'Demo ', $target, $args['demo'] );
-
+
return $details;
}
-
+
/**
*
@@ -298,27 +298,27 @@ function grab_details( $args ){
*
*/
function get_extend_buttons( $e, $style = 'small'){
-
- /*
+
+ /*
'Mode' = the extension handling mode
'Key' = the key of the element in the array, for the response
'Type' = what is being extended
'File' = the url for the extension/install/update
'duringText' = the text while the extension is happening
*/
-
+
$buttons = '';
foreach( $e['actions'] as $type => $a ){
-
+
if($a['condition'])
$buttons .= $this->extend_button( $e['key'], $a, $style);
-
+
}
-
+
return $buttons;
-
+
}
-
+
/**
*
@@ -326,45 +326,45 @@ function get_extend_buttons( $e, $style = 'small'){
*
*/
function extend_button( $key, $a, $style = 'small'){
-
+
$d = array(
'mode' => '',
- 'case' => '',
- 'file' => '',
+ 'case' => '',
+ 'file' => '',
'text' => 'Extend',
'dtext' => '',
- 'key' => $key,
+ 'key' => $key,
'type' => '',
'path' => '',
'product' => 0,
'confirm' => false,
'dashboard' => false
);
-
+
$a = wp_parse_args($a, $d);
-
+
$js_call = ( $a['mode'] == 'installed' ) ? '' : sprintf( $this->exprint, $a['case'], $a['key'], $a['type'], $a['file'], $a['path'], $a['product'], $a['dtext'], $a['dashboard']);
-
+
if( $a['mode'] == 'deactivate' || $a['mode'] == 'delete' || $a['mode'] == 'installed' )
$class = 'discrete';
- else
+ else
$class = '';
-
+
if ( $a['mode'] == 'subscribe' )
$class = 'discrete subscribe';
if ( $a['mode'] == 'unsubscribe' )
- $class = 'discrete unsubscribe';
-
+ $class = 'discrete unsubscribe';
+
if($style == 'superlink')
$button = OptEngine::superlink( $a['text'], $a['mode'], '', '', $js_call);
else
$button = sprintf('%s ', $class, $js_call, $a['text']);
-
+
return $button;
}
-
-
+
+
/**
*
@@ -372,71 +372,71 @@ function extend_button( $key, $a, $style = 'small'){
*
*/
function install_button( $e ){
-
-
+
+
$install_js_call = sprintf( $this->exprint, 'section_install', $key, 'sections', $key, __( 'Installing', 'pagelines' ) );
$button = OptEngine::superlink( __( 'Install Section', 'pagelines' ), 'black', '', '', $install_js_call);
-
+
}
-
+
/**
* Draw a list of extended items
*/
function get_extend_plugin( $status = '', $tab = '' ){
-
+
$key = 'ext'.$tab;
-
+
$name = 'pagelines-sections';
-
+
if($status == 'notactive'){
- $file = '/' . trailingslashit( $name ) . $name . '.php';
+ $file = '/' . trailingslashit( $name ) . $name . '.php';
$btext = 'Activate Sections';
$text = sprintf( __( 'Sections plugin installed, now activate it!', 'pagelines' ) );
$install_js_call = sprintf( $this->exprint, 'plugin_activate', $key, 'plugins', $file, '', '', __( 'Activating', 'pagelines' ), 0 );
-
+
} elseif($status == 'notinstalled'){
$btext = __( 'Install It Now!', 'pagelines' );
$text = __( 'You need to install and activate PageLines Sections Plugin', 'pagelines' );
-
- $install_js_call = sprintf(
- $this->exprint,
- 'plugin_install',
- $key,
- 'plugin',
- 'pagelines-sections',
+
+ $install_js_call = sprintf(
+ $this->exprint,
+ 'plugin_install',
+ $key,
+ 'plugin',
+ 'pagelines-sections',
'/pagelines-sections/pagelines-sections.php',
- '',
+ '',
__( 'Installing', 'pagelines' ),
0
);
}
-
+
$eresponse = 'response'.$key;
-
+
// The button
$install_button = OptEngine::superlink($btext, 'blue', 'install_now iblock', '', $install_js_call);
-
+
// The banner
return sprintf('%s %s
', $eresponse, $text, $install_button);
}
-
+
/**
* Draw a list of extended items
*/
function extension_banner( $text, $click = '', $button_text = 'Add Some →' ){
-
+
if($click != ''){
$thebutton = OptEngine::superlink($button_text, 'blue', 'install_now iblock', $click );
$button = sprintf(' %s', $thebutton );
-
- } else
+
+ } else
$button = '';
-
+
// The banner
return sprintf('%s %s
', $text, $button);
}
-
+
/**
*
@@ -444,9 +444,9 @@ function extension_banner( $text, $click = '', $button_text = 'Add Some →'
*
*/
function upload_form( $type, $disabled = false ){
-
+
$file = $type;
-
+
if ( $disabled )
return $this->extension_banner( __( 'Sorry uploads do not work with this server config, please use FTP!', 'pagelines' ) );
@@ -466,11 +466,11 @@ function upload_form( $type, $disabled = false ){
- extension_banner( __( 'Search functionality is currently disabled. Check back soon!', 'pagelines' ) );
}
-
+
/**
- *
+ *
* Add Javascript to header (hook in contructor)
- *
+ *
*/
- function extension_js(){
-
+ function extension_js(){
+
if ( !isset( $_GET['page'] ) || ( strpos( $_GET['page'], PL_ADMIN_STORE_SLUG ) === false && strpos( $_GET['page'], PL_MAIN_DASH ) === false) )
return;
?>
__( 'Your Sections From Your Child Theme', 'pagelines' ),
'callback' => $extension_control->extension_engine( 'section_added', 'child' )
),
-
-
+
+
)
),
@@ -608,7 +608,7 @@ function extension_array( ){
'title' => __( 'Your Installed PageLines Themes', 'pagelines' ),
'callback' => $extension_control->extension_engine( 'theme', 'installed' )
),
-
+
)
),
'Plugins' => array(
@@ -619,20 +619,20 @@ function extension_array( ){
'title' => __( 'Your Installed PageLines Plugins', 'pagelines' ),
'callback' => $extension_control->extension_engine( 'plugin', 'installed' )
),
-
+
)
),
-
+
'Integrations' => array(
'icon' => PL_ADMIN_ICONS.'/puzzle.png',
'htabs' => array(
-
+
'available_integrations' => array(
'title' => __( 'Available PageLines Integrations', 'pagelines' ),
'callback' => $extension_control->extension_engine( 'integration' )
)
- )
+ )
)
);
if( EXTEND_NETWORK ) {
@@ -642,7 +642,7 @@ function extension_array( ){
unset( $d['Integrations']);
}
- return apply_filters('extension_array', $d);
+ return apply_filters('extension_array', $d);
}
/**
@@ -652,7 +652,7 @@ function extension_array( ){
*/
function store_subtabs( $type ){
global $extension_control;
-
+
$s = array(
'type' => 'subtabs',
'class' => 'left ht-special',
@@ -669,37 +669,37 @@ function store_subtabs( $type ){
'class' => 'right',
),
);
-
-
+
+
foreach($s as $key => $subtab){
-
+
if($type == 'theme'){
-
+
$s['title'] = __( 'Add New Themes', 'pagelines' );
-
+
if($key == 'featured' || $key == 'premium' || $key == 'free')
$s[$key]['callback'] = $extension_control->extension_engine( $type, $key );
-
+
} elseif ($type == 'section'){
-
+
$s['title'] = __( 'Add New Sections', 'pagelines' );
-
+
if($key == 'featured' || $key == 'premium' || $key == 'free')
$s[$key]['callback'] = $extension_control->extension_engine( 'section_extend', $key );
-
+
$s['upload'] = array(
'title' => __( 'Upload', 'pagelines' ),
'callback' => $extension_control->ui->upload_form( 'section', ( !is_writable( WP_PLUGIN_DIR ) ) ? true : false )
);
-
+
} elseif ($type == 'plugin' ){
-
+
$s['title'] = __( 'Add New Plugins', 'pagelines' );
-
+
if($key == 'featured' || $key == 'premium' || $key == 'free')
$s[$key]['callback'] = $extension_control->extension_engine( $type, $key );
}
}
- return $s;
+ return $s;
}
\ No newline at end of file
diff --git a/admin/class.options.metapanel.php b/admin/class.options.metapanel.php
index 910421ba..510a3c38 100644
--- a/admin/class.options.metapanel.php
+++ b/admin/class.options.metapanel.php
@@ -1,6 +1,6 @@
ptype = PageLinesTemplate::current_admin_post_type();
-
- $this->page_for_posts = ( isset($post) && get_option( 'page_for_posts' ) === $post->ID ) ? true : false;
-
+
+ $this->page_for_posts = ( isset($post) && get_option( 'page_for_posts' ) === $post->ID ) ? true : false;
+
$this->blacklist = apply_filters( 'pagelines_meta_blacklist', array( 'banners', 'feature', 'boxes', 'attachment', 'revision', 'nav_menu_item' ));
-
+
$defaults = array(
'id' => 'pagelines-metapanel',
'name' => $this->get_the_title(),
'posttype' => $this->get_the_post_types(),
- 'location' => 'normal',
- 'priority' => 'low',
- 'hide_tabs' => false,
- 'global' => false,
+ 'location' => 'normal',
+ 'priority' => 'low',
+ 'hide_tabs' => false,
+ 'global' => false,
'handle' => 'metatabs',
);
- $this->settings = wp_parse_args($settings, $defaults); // settings for post type
-
+ $this->settings = wp_parse_args($settings, $defaults); // settings for post type
+
$this->register_actions();
$this->hide_tabs = $this->settings['hide_tabs'];
-
+
}
@@ -63,17 +63,17 @@ function register_actions(){
$privelidge = (ploption('hide_controls_meta')) ? ploption('hide_controls_meta') : 'publish_posts';
if ( !current_user_can( $privelidge ) )
- return;
-
+ return;
+
// Adds the box
add_action( 'admin_menu', array(&$this, 'add_metapanel_box') );
-
-
+
+
// Saves the options.
add_action( 'post_updated', array(&$this, 'save_meta_options') );
-
+
}
-
+
/**
*
@@ -81,26 +81,26 @@ function register_actions(){
*
*/
function add_metapanel_box(){
-
-
-
+
+
+
foreach( $this->settings['posttype'] as $post_type){
-
+
if( $this->settings['global'] ){
$obj = get_post_type_object($post_type);
-
+
if( pl_deprecate_v2() || !is_object($obj) || !$obj->public )
continue;
- }
-
+ }
+
add_meta_box($this->settings['id'], $this->settings['name'], 'pagelines_metapanel_callback', $post_type, $this->settings['location'], $this->settings['priority'], array( $this ));
}
-
-
-
+
+
+
}
-
-
+
+
/**
*
@@ -108,22 +108,22 @@ function add_metapanel_box(){
*
*/
function get_the_post_types(){
-
- // if not in this array, then show the
+
+ // if not in this array, then show the
$post_id = ( isset( $_GET['post'] ) ) ? $_GET['post'] : ( isset($_POST['post_ID']) ? $_POST['post_ID'] : null );
if( isset( $post_id ) && !in_array( get_post_type( $post_id ), $this->blacklist ) )
$pt = array( 'post', 'page', get_post_type( $post_id ) );
- else
+ else
$pt = array( 'post', 'page' );
-
-
+
+
return $pt;
}
-
-
-
+
+
+
/**
*
@@ -132,31 +132,31 @@ function get_the_post_types(){
*/
function get_edit_type(){
global $post;
-
+
if(!isset($this->ptype))
$this->ptype = PageLinesTemplate::current_admin_post_type();
-
+
if($this->ptype == 'post' || $this->ptype == 'page'){
-
+
$current_template = (isset($post)) ? get_post_meta($post->ID, '_wp_page_template', true) : false;
-
+
$this->page_templates = array_flip( get_page_templates() );
-
+
if( $this->ptype == 'page' && $current_template && $current_template != 'default') {
if(isset($this->page_templates[$current_template]))
$slug = $this->page_templates[$current_template];
-
+
}elseif( $this->ptype == 'page' )
$slug = 'Default Page';
elseif( $this->ptype == 'post' )
$slug = 'Single Post';
elseif( $this->page_for_posts )
$slug = 'Blog Page';
- else
+ else
$slug = '';
-
-
+
+
} elseif( $this->ptype )
$slug = $this->ptype;
elseif(isset($_GET['page']) && $_GET['page'] == PL_SPECIAL_OPTS_SLUG)
@@ -166,10 +166,10 @@ function get_edit_type(){
if(isset($slug))
$this->edit_slug = $slug;
-
+
return ( isset( $slug ) ) ? $slug : '';
}
-
+
/**
*
@@ -182,7 +182,7 @@ function get_the_title(){
$name = $this->base_name;
return $name;
}
-
+
/**
* Register a new tab for the meta panel
* This will look at Clone values and draw cloned tabs for cloned sections
@@ -190,131 +190,131 @@ function get_the_title(){
* @since 2.0.b4
*/
function register_tab( $o = array(), $option_array = array(), $location = 'bottom') {
-
+
$d = array(
'id' => '',
'name' => '',
'icon' => '',
- 'clone_id' => 1,
+ 'clone_id' => 1,
'active' => true
);
$o = wp_parse_args($o, $d);
-
+
$tab_id = $o['id'].$o['clone_id'];
-
+
if( isset($o['clone_id']) && $o['clone_id'] != 1 ){
-
+
$name = sprintf('%s (#%s)', $o['name'], $o['clone_id']);
-
+
/**
* For cloned tab, unset keys and change to new val w/ key
*/
foreach($option_array as $key => $opt){
-
+
if($opt['type'] == 'text_content' || $opt['type'] == 'text_content_reverse'){
unset( $option_array[$key] );
continue;
}
-
+
$newkey = join( '_', array($key, $o['clone_id']) );
-
-
-
+
+
+
if(isset($opt['title']))
$opt['title'] = sprintf('%s (#%s)', $opt['title'], $o['clone_id']);
-
+
$new = $option_array[$newkey] = $opt;
-
+
unset( $option_array[$key] );
-
+
/**
* For multi options, keys will need to be changed too.
*/
if( pagelines_is_multi_option( $key, $opt ) && isset($option_array[$newkey]['selectvalues']) && is_array($option_array[$newkey]['selectvalues']) ){
foreach($option_array[$newkey]['selectvalues'] as $skey => $sopt){
-
+
$snewkey = join( '_', array($skey, $o['clone_id']) );
-
+
$option_array[$newkey]['selectvalues'][$snewkey] = $sopt;
-
+
unset( $option_array[$newkey]['selectvalues'][$skey] );
}
}
-
-
+
+
}
-
-
- } else
+
+
+ } else
$name = $o['name'];
-
-
+
+
if($location == 'top'){
-
+
$top[ $tab_id ] = new stdClass;
-
+
$top[ $tab_id ]->options = $option_array;
$top[ $tab_id ]->icon = $o['icon'];
$top[ $tab_id ]->active = $o['active'];
$top[ $tab_id ]->clone_id = $o['clone_id'];
$top[ $tab_id ]->name = $name;
-
+
$this->tabs = array_merge($top, $this->tabs);
-
+
} else {
-
+
$this->tabs[ $tab_id ] = new stdClass;
-
+
$this->tabs[ $tab_id ]->options = $option_array;
$this->tabs[ $tab_id ]->icon = $o['icon'];
$this->tabs[ $tab_id ]->active = $o['active'];
$this->tabs[ $tab_id ]->clone_id = $o['clone_id'];
$this->tabs[ $tab_id ]->name = $name;
}
-
+
}
-
+
/**
*
* @TODO document
*
*/
- function draw_panel(){
- global $post_ID;
+ function draw_panel(){
+ global $post_ID;
global $pagelines_template;
-
+
// if page doesn't support settings
if ( $this->page_for_posts ){
- $this->non_meta_template();
+ $this->non_meta_template();
return;
}
-
+
$set = array(
'handle' => $this->settings['handle'],
'title' => $this->settings['name'],
'tag' => ui_key($this->get_edit_type()),
'type' => 'meta',
'stext' => __('Save Meta Settings','pagelines'),
- 'tabs' => $this->tabs,
- 'hidetabs' => $this->hide_tabs,
- 'post_ID' => $post_ID,
+ 'tabs' => $this->tabs,
+ 'hidetabs' => $this->hide_tabs,
+ 'post_ID' => $post_ID,
'post_type' => $this->settings['posttype'],
);
-
+
$panel = new PLPanel();
-
+
$panel->the_panel($set);
}
-
+
/**
*
@@ -322,32 +322,32 @@ function draw_panel(){
*
*/
function posts_metapanel( $type, $mode = 'meta' ){
-
-
+
+
$option_engine = new OptEngine( PAGELINES_SPECIAL );
-
+
$handle = 'postsTabs'.$type;
-
+
// Zero Out Tabs
$this->tabs = array();
-
+
do_global_meta_options( $mode );
-
- $special_template = new PageLinesTemplate( $type );
-
+
+ $special_template = new PageLinesTemplate( $type );
+
$special_template->load_section_optionator( $mode, $type );
ob_start(); ?>
-
-
+
-
-
+
+
tabs) != 1): ?>
@@ -356,11 +356,11 @@ function posts_metapanel( $type, $mode = 'meta' ){
- active && $type != 'default' )
+ active && $type != 'default' )
printf('inactive ');
-
- echo substr($t->name, 0, 17);
+
+ echo substr($t->name, 0, 17);
?>
@@ -371,40 +371,40 @@ function posts_metapanel( $type, $mode = 'meta' ){
-
+
tabs as $tab => $t): ?>
- name;
-
- if(!$t->active && $type != 'default')
+
+ if(!$t->active && $type != 'default')
echo OptEngine::superlink(__( 'Inactive On Template', 'pagelines' ), 'black', 'right', admin_url('admin.php?page=pagelines_templates'));
elseif($type == 'default')
echo OptEngine::superlink(__( 'Sitewide Defaults', 'pagelines' ), null, 'right');
?>
- options as $oid => $o){
$o['special'] = $type;
$o['scontrol'] = $mode;
$o['clone_id'] = (isset($t->clone_id)) ? $t->clone_id : 1;
-
+
$option_engine->option_engine($oid, $o);
}
?>
-
+
Note: Individual page settings do not work on the blog page (use the settings panel ).
-
+
settings['posttype'] ) ) ? true : false;
if((isset($_POST['update']) || isset($_POST['save']) || isset($_POST['publish'])) && $post_type_save){
-
-
-
+
+
+
$page_template = (isset($_POST['page_template'])) ? $_POST['page_template'] : null;
$save_template = $this->get_save_template_type($_POST['post_type'], $page_template);
$template_type = new PageLinesTemplate($save_template);
$template_type->load_section_optionator( );
-
-
+
+
// Loop through tabs
foreach($this->tabs as $tab => $t){
// Loop through tab options
foreach($t->options as $oid => $o){
-
-
-
+
+
+
if($oid == 'section_control')
$this->save_sc( $postID );
elseif($oid == 'page_background_image')
$this->save_bg( $oid, $postID );
elseif($o['type'] == 'text_content' || $o['type'] == 'text_content_reverse'){
-
+
$option_value = isset( $_POST[$oid] ) ? $_POST[ $oid ] : null;
-
+
plupop($oid, $option_value);
plupop($oid, $option_value, array('setting' => PAGELINES_SPECIAL));
-
+
}elseif($o['type'] == 'check' && (bool) pldefault($oid)){
-
+
$reverse = $oid."_reverse";
-
+
$option_value = isset( $_POST[$reverse] ) ? $_POST[ $reverse ] : null;
-
+
if( !empty($option_value) || get_post_meta($postID, $reverse) ){
-
+
update_post_meta($postID, $reverse, $option_value );
-
+
}
-
-
+
+
} else {
-
-
-
+
+
+
// Note: If the value is null, then test to see if the option is already set to something
// create and overwrite the option to null in that case (i.e. it is being set to empty)
if(isset($o['selectvalues']) && pagelines_is_multi_option($oid, $o) ){
-
+
foreach($o['selectvalues'] as $sid =>$s ){
$option_value = isset($_POST[$sid]) ? $_POST[$sid] : null;
-
+
if(!empty($option_value) || get_post_meta($postID, $sid))
update_post_meta($postID, $sid, $option_value );
}
-
+
} else {
-
+
$option_value = isset( $_POST[$oid] ) ? $_POST[ $oid ] : null;
-
-
+
+
if( !empty($option_value) || get_post_meta($postID, $oid) ){
-
+
update_post_meta($postID, $oid, $option_value );
-
+
}
-
-
+
+
}
-
-
+
+
}
}
}
}
}
-
+
/**
*
@@ -523,7 +523,7 @@ function save_meta_options( $postID ){
*
*/
function get_save_template_type( $post_type = null, $template = 'default'){
-
+
if( $post_type == 'post' ){
return 'single';
} elseif( $post_type == 'page' ){
@@ -532,11 +532,11 @@ function get_save_template_type( $post_type = null, $template = 'default'){
return $template_name;
} elseif( isset($post_type) )
return $post_type;
- else
+ else
return 'default';
-
+
}
-
+
/**
*
@@ -545,17 +545,17 @@ function get_save_template_type( $post_type = null, $template = 'default'){
*/
function save_bg ( $oid, $postID ) {
$bg = OptEngine::_background_image_array();
-
+
foreach($bg as $k => $i){
$bgid = $oid.$k;
-
+
$option_value = isset($_POST[$bgid]) ? $_POST[$bgid] : null;
if(!empty($option_value) || get_post_meta($postID, $bgid))
update_post_meta($postID, $bgid, $option_value );
}
}
-
+
/**
*
@@ -565,35 +565,35 @@ function save_bg ( $oid, $postID ) {
function save_sc( $postID ){
global $pagelines_template;
- global $post;
+ global $post;
$save_template = new PageLinesTemplate();
-
+
foreach( $save_template->map as $hook => $h ){
-
+
if(isset($h['sections'])){
foreach($h['sections'] as $key => $section_slug)
- $this->save_section_control($postID, $section_slug, $hook );
-
+ $this->save_section_control($postID, $section_slug, $hook );
+
} elseif (isset($h['templates'])){
foreach($h['templates'] as $template => $t){
-
+
if( isset($t['sections']) && !empty($t['sections'])){
foreach($t['sections'] as $key => $section_slug){
$template_slug = $hook.'-'.$template;
- $this->save_section_control($postID, $section_slug, $template_slug );
+ $this->save_section_control($postID, $section_slug, $template_slug );
}
}
-
+
}
}
-
+
}
-
+
}
-
+
/**
*
@@ -601,18 +601,18 @@ function save_sc( $postID ){
*
*/
function save_section_control($postID, $sid, $template_slug ){
-
-
+
+
$check_name_hide = meta_option_name( array('hide', $template_slug, $sid) );
$this->save_meta($postID, $check_name_hide);
-
+
$check_name_show = meta_option_name( array('show', $template_slug, $sid) );
-
+
$this->save_meta($postID, $check_name_show);
-
+
}
-
+
/**
*
@@ -620,16 +620,16 @@ function save_section_control($postID, $sid, $template_slug ){
*
*/
function save_meta($postID, $name){
-
+
$option_value = isset($_POST[ $name ]) ? $_POST[ $name ] : null;
-
+
if(!empty($option_value) || get_post_meta($postID, $name))
update_post_meta($postID, $name, $option_value );
}
-
+
}
/////// END OF MetaOptions CLASS ////////
@@ -642,7 +642,7 @@ function save_meta($postID, $name){
function pagelines_metapanel_callback($post, $object){
$object['args'][0]->draw_panel();
-
+
}
@@ -652,21 +652,21 @@ function pagelines_metapanel_callback($post, $object){
*
*/
function register_metatab($settings, $option_array, $section = '', $location = 'bottom'){
-
+
// Have to hack around this for version 3
if(has_action('override_metatab_register')){
-
+
do_action('override_metatab_register', $option_array);
-
+
} else {
global $metapanel_options;
-
+
foreach($option_array as $key => $opt)
$option_array[$key]['section'] = $section;
-
+
$metapanel_options->register_tab($settings, $option_array, $location);
}
-
+
}
@@ -682,7 +682,7 @@ function add_global_meta_options( $meta_array = array(), $location = 'bottom'){
$global_meta_options = array_merge($meta_array, $global_meta_options);
else
$global_meta_options = array_merge($global_meta_options, $meta_array);
-
+
}
/**
@@ -691,22 +691,22 @@ function add_global_meta_options( $meta_array = array(), $location = 'bottom'){
*
*/
function do_global_meta_options( $mode = '' ){
-
+
global $global_meta_options;
-
+
$metatab_settings = array(
'id' => 'general_page_meta',
'name' => __( 'Page Setup', 'pagelines' ),
'icon' => PL_ADMIN_ICONS . '/ileaf.png'
);
-
+
if($mode == 'integration')
unset($global_meta_options['_pagelines_layout_mode']);
if($mode == 'default')
- return;
-
+ return;
+
register_metatab($metatab_settings, $global_meta_options, '', 'top');
}
@@ -718,9 +718,9 @@ function do_global_meta_options( $mode = '' ){
function special_page_settings_array( ){
global $metapanel_options;
-
+
$d = array(
-
+
'site_defaults' => array(
'metapanel' => $metapanel_options->posts_metapanel( 'default', 'default' ),
'icon' => PL_ADMIN_ICONS.'/equalizer.png'
@@ -728,15 +728,15 @@ function special_page_settings_array( ){
'blog_page' => array(
'metapanel' => $metapanel_options->posts_metapanel( 'posts' ),
'icon' => PL_ADMIN_ICONS.'/blog.png'
- ),
+ ),
'archive_page' => array(
'metapanel' => $metapanel_options->posts_metapanel( 'archive' ),
- 'icon' => PL_ADMIN_ICONS.'/archives.png',
+ 'icon' => PL_ADMIN_ICONS.'/archives.png',
'version' => 'pro'
),
'category_page' => array(
'metapanel' => $metapanel_options->posts_metapanel( 'category' ),
- 'icon' => PL_ADMIN_ICONS.'/category.png',
+ 'icon' => PL_ADMIN_ICONS.'/category.png',
'version' => 'pro'
),
'search_results' => array(
@@ -746,26 +746,26 @@ function special_page_settings_array( ){
),
'tag_listing' => array(
'metapanel' => $metapanel_options->posts_metapanel('tag'),
- 'icon' => PL_ADMIN_ICONS.'/tag.png',
+ 'icon' => PL_ADMIN_ICONS.'/tag.png',
'version' => 'pro'
),
'author_posts' => array(
'metapanel' => $metapanel_options->posts_metapanel('author'),
- 'icon' => PL_ADMIN_ICONS.'/author.png',
+ 'icon' => PL_ADMIN_ICONS.'/author.png',
'version' => 'pro'
),
'404_page' => array(
'metapanel' => $metapanel_options->posts_metapanel('404_page'),
- 'icon' => PL_ADMIN_ICONS.'/404.png',
+ 'icon' => PL_ADMIN_ICONS.'/404.png',
'version' => 'pro'
),
);
-
+
$ints = handle_integrations_meta();
-
+
$d = array_merge($d, $ints);
- return apply_filters('postsmeta_settings_array', $d);
+ return apply_filters('postsmeta_settings_array', $d);
}
/**
@@ -775,12 +775,12 @@ function special_page_settings_array( ){
*/
function get_global_meta_options(){
$opts = array(
-
+
'_pagelines_layout_mode' => array(
'type' => 'graphic_selector',
- 'sprite' => PL_ADMIN_IMAGES.'/sprite-layouts.png',
- 'height' => '50px',
- 'width' => '50px',
+ 'sprite' => PL_ADMIN_IMAGES.'/sprite-layouts.png',
+ 'height' => '50px',
+ 'width' => '50px',
'selectvalues' => array(
'fullwidth' => array( 'name' => __( 'Fullwidth layout', 'pagelines' ), 'version' => 'pro', 'offset' => '0px 0px'),
'one-sidebar-right' => array( 'name' => __( 'One sidebar on right', 'pagelines' ), 'offset' => '0px -50px'),
@@ -790,38 +790,38 @@ function get_global_meta_options(){
'two-sidebar-center' => array( 'name' => __( 'Two sidebars, one on each side', 'pagelines' ), 'version' => 'pro', 'offset' => '0px -250px' ),
),
'title' => __( 'Individual Page Content Layout', 'pagelines' ),
- 'inputlabel' => __( 'Select Page Layout', 'pagelines' ),
- 'layout' => 'interface',
+ 'inputlabel' => __( 'Select Page Layout', 'pagelines' ),
+ 'layout' => 'interface',
'shortexp' => __( 'Select the layout that will be used on this page', 'pagelines' ),
'exp' => '',
),
-
+
'section_control' => array(
'type' => 'section_control',
'title' => __( 'Individual Page Section Control', 'pagelines' ),
- 'layout' => 'interface',
+ 'layout' => 'interface',
'shortexp' => __( 'Control which sections appear on this specific page', 'pagelines' ),
'exp' => '',
),
-
+
'page_background_image' => array(
- 'title' => 'Page Background Image',
+ 'title' => 'Page Background Image',
'shortexp' => 'Setup A Background Image For This Page',
'exp' => 'Use this option to apply a background image to this page. This option will only be applied to the current page.Positioning Use percentages to position the images, 0% corresponds to the "top" or "left" side, 50% to center, etc..',
'type' => 'background_image',
- 'selectors' => cssgroup('page_background_image'),
+ 'selectors' => cssgroup('page_background_image'),
'disabled_mode' => 'color_control'
),
'disable_mobile_view' => array(
'default' => false,
'type' => 'check',
'title' => __( 'Disable Mobile Optimized View', 'pagelines' ),
- 'inputlabel' => __( 'Disable Mobile View', 'pagelines' ),
+ 'inputlabel' => __( 'Disable Mobile View', 'pagelines' ),
'shortexp' => __( 'Make it so mobile devices will see the full site, not the mobile optimized one.', 'pagelines' ),
'exp' => __( 'By default PageLines accommodates mobile devices resolution and shows a mobile optimized view. Check this option to make it so users see your full site.', 'pagelines' ),
),
-
+
);
-
+
return apply_filters('global_meta_options', $opts);
}
diff --git a/admin/class.options.panel.php b/admin/class.options.panel.php
index bb6a0add..a0087975 100644
--- a/admin/class.options.panel.php
+++ b/admin/class.options.panel.php
@@ -1,6 +1,6 @@
'plpanel',
'title' => '',
'tag' => false,
'type' => null,
'stext' => __('Save', 'pagelines'),
- 'tabs' => array(),
- 'hidetabs' => false,
- 'post_ID' => null,
+ 'tabs' => array(),
+ 'hidetabs' => false,
+ 'post_ID' => null,
'post_type' => null,
'user' => null
);
$this->s = wp_parse_args($s, $defaults); // settings for post type
-
+
$hide_tabs = ( count($this->s['tabs']) == 1 ) ? true : $this->s['hidetabs'];
-
-
+
+
if(!$hide_tabs)
- $this->tabs_setup( $this->s['handle'] );
-
-
+ $this->tabs_setup( $this->s['handle'] );
+
+
?>
head( $this->s['title'], $this->s['tag'], $this->s['stext'] ); ?>
- tabn( $this->s['tabs'] );
$this->load_tabs($this->s['type'], $this->s['tabs'], $hide_tabs, $this->s['post_ID'], $this->s['user']);
-
+
?>
panel_foot( $this->s['stext'], $this->s['post_type']); ?>
-
-s['hidetabs']):
?>
-
-
-
+
s['type'] == 'meta' && $post_ID) ? esc_url( get_permalink($post_ID) ) : home_url();
$pl_link_title = ($this->s['type'] == 'meta' && $post_ID) ? __('View Page →', 'pagelines') : __('View Site →', 'pagelines');
?>
-
+
@@ -117,15 +117,15 @@ function head( $title, $tag, $stext ){
-
+
-
+
-
+ function tabn( $tabs ){ ?>
+
-
+
$t ):?>
- name;
-
- if(isset($post_ID) && !$t->active)
+
+ if(isset($post_ID) && !$t->active)
echo OptEngine::superlink(__( 'Inactive On Template', 'pagelines' ), 'black', 'right', admin_url('admin.php?page=pagelines_templates'));
-
+
?>
load_engine( $type, $t->options, $post_ID, $user); ?>
@@ -188,7 +188,7 @@ function load_tabs( $type, $tabs, $hide_tabs = false, $post_ID = null, $user = n
$o)
$option_engine->option_engine($oid, $o, $flag);
-
+
}
-
+
/**
*
@@ -213,8 +213,8 @@ function load_engine( $type, $opts, $post_ID = null, $user = null ){
*
*/
function panel_foot( $save_text, $post_type){
- ?>
-
+ ?>
+
-
+
sprintf( '%s %s', ( is_child_theme() ) ? PL_NICECHILDTHEMENAME : '', __( 'Global Settings', 'pagelines') ),
'callback' => null,
- 'settings' => PAGELINES_SETTINGS,
+ 'settings' => PAGELINES_SETTINGS,
'sanitize' => '',
'show_save' => true,
- 'show_reset' => true,
+ 'show_reset' => true,
'basic_reset' => false,
'reset_cb' => false,
'title_size' => 'normal',
- 'fullform' => true,
- 'tabs' => true,
- 'reset_store' => false,
+ 'fullform' => true,
+ 'tabs' => true,
+ 'reset_store' => false,
);
-
+
$this->set = wp_parse_args( $args, $defaults );
// Set option array callbacks
$this->option_array = (isset($this->set['callback'])) ? call_user_func( $this->set['callback'] ) : get_option_array( false );
-
+
$this->primary_settings = ($this->set['settings'] == PAGELINES_SETTINGS) ? true : false;
-
+
$this->tab_cookie = 'PLTab_'.$this->set['settings'];
-
-
-
+
+
+
// Draw the thing
- $this->build_header();
+ $this->build_header();
$this->build_body();
- $this->build_footer();
-
+ $this->build_footer();
+
}
-
+
/**
* Option Interface Header
*
@@ -60,16 +60,16 @@ function build_header(){?>
set['fullform'] )
$this->fullform_head();
-
+
$this->get_tab_setup();
-
- $this->_get_confirmations_and_system_checking();
-
+
+ $this->_get_confirmations_and_system_checking();
+
?>
-
+
- %s', $this->set['title'], $title_tag );
-
- echo apply_filters( 'pagelines_settings_main_title', $panel_title );
-
- ?>
+
+ echo apply_filters( 'pagelines_settings_main_title', $panel_title );
+
+ ?>
View Your Site →
@@ -108,7 +108,7 @@ function build_header(){?>
*/
function fullform_head(){ ?>
*
*/
function _get_confirmations_and_system_checking(){
-
+
// Load Ajax confirmation
printf('');
-
+
// get confirmations
pagelines_draw_confirms();
-
+
// Get server error messages
pagelines_error_messages();
}
-
+
/**
* Option Interface Footer
*
@@ -172,7 +172,7 @@ function build_footer(){?>
- set['reset_store']):?>
+ set['reset_store']):?>
set['fullform'] )
$this->fullform_foot();
-
+
if($this->set['basic_reset'])
$this->basic_reset();
-
+
?>
-
+
function basic_reset(){ ?>
set['settings'] );
- global $pl_section_factory;
-
+ global $pl_section_factory;
+
$tabs = ($this->set['tabs']) ? true : false;
?>
-
-
+
+
- option_array as $menu => $oids){
-
+
$pro_tab = (!VPRO && isset($oids['version']) && $oids['version'] == 'pro') ? true : false;
-
+
$bg = (isset($oids['icon'])) ? sprintf('style="background: transparent url(%s) no-repeat 0 0;"', $oids['icon']) : '';
-
+
$name = ($pro_tab) ? sprintf('%s (Pro) ', ui_key($menu)) : ui_key($menu);
-
+
$special_class = ($pro_tab) ? 'pro_tab' : '';
-
+
printf('%2$s ', $menu, $name, $bg, $special_class);
}
-
+
?>
-
-
+
+
@@ -277,51 +277,51 @@ function build_body(){
get_pro_call();
-
+
foreach($this->option_array as $menu => $oids){
-
+
$pro_tab = (!VPRO && isset($oids['version']) && $oids['version'] == 'pro') ? true : false;
-
+
$bg = (isset($oids['icon'])) ? sprintf('style="background: transparent url(%s) no-repeat 10px 16px;"', $oids['icon']) : '';
-
+
$is_htabs = ( isset($oids['htabs']) ) ? true : false;
-
+
// The tab container start....
printf('
', $menu, ($is_htabs) ? 'htabs-interface' : '');
-
+
// Draw Menu Title w/ Icon
if( stripos($menu, '_') !== 0 )
printf('
', $bg, ui_key($menu) );
-
-
+
+
// Render Options
if( isset($oids['htabs']))
OptEngine::get_horizontal_nav( $menu, $oids );
-
+
elseif( $pro_tab )
- echo $this->show_banner(
+ echo $this->show_banner(
sprintf('The pro or dev version is needed for "%s" meta options.
Please use "Blog Page" options instead.', ui_key($menu)),
- 'http://www.pagelines.com/pricing',
+ 'http://www.pagelines.com/pricing',
'Upgrade »'
- );
-
+ );
+
elseif( isset($oids['metapanel']))
echo $oids['metapanel'];
-
+
else{
-
+
foreach( $oids as $oid => $o ){
-
+
if( $oid != 'icon' )
$option_engine->option_engine($oid, $o);
-
-
+
+
}
}
-
+
echo '
';
}
- ?>
+ ?>
%s', $thebutton );
-
- } else
+
+ } else
$button = '';
-
+
// The banner
return sprintf('
%s %s
', $text, $button);
}
@@ -350,41 +350,41 @@ function show_banner( $text, $click = '', $button_text = 'Add Some →' ){
*/
function get_tab_setup(){ ?>
*
*/
function get_pro_call(){
- global $pl_section_factory;
-
+ global $pl_section_factory;
+
$usections = $pl_section_factory->unavailable_sections;
-
+
?>
@@ -403,31 +403,31 @@ function get_pro_call(){
You Are Using PageLines Lite Edition
-
PageLines Lite is the
free version of .
- Upgrade to the Pro edition for more sections & options, no credit link, enhanced social & SEO, support and
more...
-
+
PageLines Lite is the
free version of .
+ Upgrade to the Pro edition for more sections & options, no credit link, enhanced social & SEO, support and
more...
+
%s
', $pro_buttons);
-
+
?>
-
+
Why You'll Love the Professional or Developer edition...
-
+
When you upgrade you get 30+ pro drag & drop sections, 200+ CMS options, SEO and social enhancements and way, way more.
@@ -437,32 +437,32 @@ function get_pro_call(){
Some specifics:
-
+
Professional Sections In Pro Version
- name;
-
+
echo join(' · ', $list_sections);
?>
-
-
New Templates and Template Areas (i.e. places to put sections)
-
+
-
+
New Settings & Options
- $o){
@@ -470,18 +470,18 @@ function get_pro_call(){
$list[] = $o['title'];
}
}
-
+
echo join(' · ', $list);
-
+
?>
-
-
-
+
+
+
-
+
-
+
tabs as $tab => $t){
-
+
// Loop through tab options
foreach($t->options as $oid => $o){
-
-
+
+
// Note: If the value is null, then test to see if the option is already set to something
// create and overwrite the option to null in that case (i.e. it is being set to empty)
if(isset($o['selectvalues']) && pagelines_is_multi_option($oid, $o) ){
-
+
foreach($o['selectvalues'] as $sid =>$s ){
$option_value = isset($_POST[$sid]) ? $_POST[$sid] : null;
-
+
if(!empty($option_value) || pl_um($sid, $user_ID))
update_post_meta($user_ID, $sid, $option_value );
}
-
+
} else {
-
-
+
+
$option_value = isset($_POST[$oid]) ? $_POST[$oid] : null;
if(!empty($option_value) || pl_um($oid, $user_ID))
update_user_meta($user_ID, $oid, $option_value );
-
+
}
-
-
+
+
}
-
+
}
-
+
}
-
-
-
+
+
+
/**
*
@@ -99,7 +99,7 @@ function save_profile_admin( $user_ID ){
*
*/
function do_panel( $user ){
-
+
if( empty($this->tabs) )
return;
@@ -109,17 +109,17 @@ function do_panel( $user ){
'tag' => false,
'type' => 'profile',
'stext' => __('Save Profile Options','pagelines'),
- 'tabs' => $this->tabs,
+ 'tabs' => $this->tabs,
'user' => $user
);
$panel = new PLPanel();
$panel->the_panel( $set );
-
+
}
-
+
/**
*
@@ -127,28 +127,28 @@ function do_panel( $user ){
*
*/
function admin_settings_tab( $user ){
-
+
if( empty($this->admin_options) )
return;
-
+
$set = array(
- 'id' => 'profile_admin_settings',
- 'opts' => $this->admin_options,
- 'icon' => PL_ADMIN_ICONS.'/admin.png',
- 'role' => 'admin',
+ 'id' => 'profile_admin_settings',
+ 'opts' => $this->admin_options,
+ 'icon' => PL_ADMIN_ICONS.'/admin.png',
+ 'role' => 'admin',
'name' => 'Admin Options'
);
$this->register_tab($set, 'top');
-
+
}
-
+
public function register_admin_opts( $opts ){
-
+
$this->admin_options = array_merge( $this->admin_options, $opts );
-
+
}
-
+
/**
*
@@ -156,11 +156,11 @@ public function register_admin_opts( $opts ){
*
*/
function user_opts( ){
-
+
$this->current_tabs = array_merge($this->current_tabs, $this->get_tabs('user'));
}
-
+
/**
*
@@ -168,16 +168,16 @@ function user_opts( ){
*
*/
function get_tabs($role = 'user'){
-
+
$rtabs = array();
foreach($this->tabs as $tid => $t){
if($t->role == $role)
- $rtabs[$tid] = $t;
+ $rtabs[$tid] = $t;
}
-
+
return $rtabs;
}
-
+
/**
* Register a new tab for the meta panel
* This will look at Clone values and draw cloned tabs for cloned sections
@@ -185,7 +185,7 @@ function get_tabs($role = 'user'){
* @since 2.0.b4
*/
function register_tab( $set, $location = 'bottom') {
-
+
$d = array(
'id' => '',
'opts' => array(),
@@ -196,25 +196,25 @@ function register_tab( $set, $location = 'bottom') {
);
$s = wp_parse_args($set, $d);
-
+
$tab_id = $s['id'];
-
+
if($location == 'top'){
-
+
$top[ $tab_id ] = new stdClass;
-
+
$top[$tab_id]->options = $s['opts'];
$top[$tab_id]->icon = $s['icon'];
$top[$tab_id]->active = $s['active'];
$top[$tab_id]->name = $s['name'];
$top[$tab_id]->role = $s['role'];
-
+
$this->tabs = array_merge($top, $this->tabs);
-
+
} else {
-
+
$this->tabs[ $tab_id ] = new stdClass;
-
+
$this->tabs[ $tab_id ]->options = $s['opts'];
$this->tabs[ $tab_id ]->icon = $s['icon'];
$this->tabs[ $tab_id ]->active = $s['active'];
@@ -261,22 +261,22 @@ function register_profile_admin_opts( $opts ){
*
*/
function pl_user_id(){
-
-
+
+
if(isset($_GET['user_id']))
return (int) $_GET['user_id'];
else{
-
+
global $user_ID;
return $user_ID;
-
+
}
-
+
}
/**
- *
+ *
* Not used currently, added here for reference.
*/
function pl_leaderboard(){
@@ -284,14 +284,14 @@ function pl_leaderboard(){
// Returns the SUM of karma within a period, and total
$rows = $wpdb->get_results( "SELECT k.user_id,
- SUM(IF(k.timestamp > ADDDATE( NOW(), INTERVAL - {$period_units} {$period} ), k.karma, 0)) AS recent_karma,
+ SUM(IF(k.timestamp > ADDDATE( NOW(), INTERVAL - {$period_units} {$period} ), k.karma, 0)) AS recent_karma,
SUM(k.karma) as total_karma
FROM $wpdb->chess_karma k, $wpdb->usermeta u
WHERE u.user_id = k.user_id
AND u.meta_key = 'pagelines_pro_publish'
AND u.meta_value = 'true'
- GROUP BY k.user_id
+ GROUP BY k.user_id
ORDER BY recent_karma DESC LIMIT $number" );
-
- return $rows;
+
+ return $rows;
}
diff --git a/admin/class.rss.php b/admin/class.rss.php
index c8afa453..83f58575 100644
--- a/admin/class.rss.php
+++ b/admin/class.rss.php
@@ -1,14 +1,14 @@
'http://api.pagelines.com/rss/rss2.php',
@@ -25,11 +25,11 @@ function get_dash_rss( $args = array() ) {
);
$args = wp_parse_args( $args, $defaults );
-
+
$out = array();
$this->items = $args['items'];
- $this->feed_url = $args['feed'];
+ $this->feed_url = $args['feed'];
$rss = fetch_feed( $this->feed_url );
@@ -44,7 +44,7 @@ function get_dash_rss( $args = array() ) {
}
if ( !$rss->get_item_quantity() ) {
-
+
$out[] = array(
'title' => 'RSS',
'test' => 'Apparently, there is nothing new yet!'
@@ -55,7 +55,7 @@ function get_dash_rss( $args = array() ) {
}
$items = $this->items;
-
+
foreach ( $rss->get_items(0, $items) as $item ) {
@@ -72,10 +72,10 @@ function get_dash_rss( $args = array() ) {
$title = $item->get_title();
$content = $item->get_content();
if( $args['community'] ) {
-
+
$d = self::com_url( $item->get_description() );
$link = $d[0];
- $content = $d[1];
+ $content = $d[1];
}
$out[] = array(
@@ -91,11 +91,11 @@ function get_dash_rss( $args = array() ) {
return $out;
}
-
+
function com_url( $d ) {
-
+
preg_match( '#(http://[^<]*)
#', $d, $out );
- $d = str_replace( $out[0], '', $d );
+ $d = str_replace( $out[0], '', $d );
return array( $out[1], $d );
}
-}
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/admin/class.ui.layout.php b/admin/class.ui.layout.php
index 6b00950b..076321d5 100644
--- a/admin/class.ui.layout.php
+++ b/admin/class.ui.layout.php
@@ -1,6 +1,6 @@
-
+
@@ -164,7 +164,7 @@ function draw_layout_control($optionid, $option_settings){ ?>
global $pagelines_layout;
$saved_layout = $pagelines_layout->layout_map['saved_layout'];
-
+
foreach(get_the_layouts() as $layout): ?>
@@ -191,9 +191,9 @@ function get_layout_selector( $oid, $o ){ ?>
-
+
-
+
@@ -214,14 +214,14 @@ function layout_control_javascript(){ ?>
jQuery(document).ready(function(){
/*
- Layout Builder Control
+ Layout Builder Control
*/
// Default Layout Select
jQuery(' .layout-select-default .layout-image-border').click(function(){
LayoutSelectControl(this);
});
-
jQuery('.'+LayoutMode).addClass('selectededitor');
margin->bwidth;
$ewidth = $mylayout->east->bwidth;
$wwidth = $mylayout->west->bwidth;
?>
- if (LayoutMode == '') {
+ if (LayoutMode == '') {
marginwidth = mwidth + 2;
innereastwidth = ;
- innerwestwidth = ;
+ innerwestwidth = ;
gtrwidth = 10
}
-
+
setLayoutBuilder(LayoutMode, marginwidth, innereastwidth, innerwestwidth, gtrwidth);
- });
+ });
});
-
+
/*]]>*/ $setting );
-
+
$this->sc_settings = ploption('section-control', $oset);
$this->sc_global = ploption('section-control', array('setting' => PAGELINES_TEMPLATES));
$this->sc_namespace = sprintf('%s[section-control]', $setting);
-
+
$this->template_map = get_option( PAGELINES_TEMPLATE_MAP );
-
-
+
+
$this->factory = $pl_section_factory->sections;
-
+
$this->template = $pagelines_template;
-
+
}
@@ -44,15 +44,15 @@ function __construct( $oid, $o, $setting = PAGELINES_SETTINGS ) {
*
*/
function sc_name( $ta, $sid, $field, $sub = null){
-
-
+
+
if(isset($sub))
return sprintf('%s[%s][%s][%s][%s]', $this->sc_namespace, $ta, $sid, $field, $sub);
- else
+ else
return sprintf('%s[%s][%s][%s]', $this->sc_namespace, $ta, $sid, $field);
-
+
}
-
+
/**
*
@@ -60,18 +60,18 @@ function sc_name( $ta, $sid, $field, $sub = null){
*
*/
function sc_value( $ta, $sid, $field, $sub = null){
-
+
if(isset($sub))
return isset($this->sc_settings[$ta][$sid][$field][$sub]) ? $this->sc_settings[$ta][$sid][$field][$sub] : null;
- else
+ else
return isset($this->sc_settings[$ta][$sid][$field]) ? $this->sc_settings[$ta][$sid][$field] : null;
-
+
}
-
-
+
+
/**
- *
+ *
*
* Template Builder (Sections Drag & Drop)
*
@@ -82,15 +82,15 @@ function sc_value( $ta, $sid, $field, $sub = null){
*
*/
function draw_template_builder(){
-
+
$this->do_confirms_and_hidden_fields();
-
+
echo '
';
-
- $this->draw_template_select();
-
+
+ $this->draw_template_select();
+
$this->do_template_builder();
-
+
echo '
';
}
@@ -100,26 +100,26 @@ function draw_template_builder(){
* @TODO document
*
*/
- function do_confirms_and_hidden_fields(){
- $dtoggle = (get_option('pl_section_desc_toggle')) ? get_option('pl_section_desc_toggle') : 'show';
+ function do_confirms_and_hidden_fields(){
+ $dtoggle = (get_option('pl_section_desc_toggle')) ? get_option('pl_section_desc_toggle') : 'show';
?>
-
-
+
+
-
+
+ ?>
+
@@ -141,7 +141,7 @@ function draw_template_select(){
-
+
@@ -176,22 +176,22 @@ function draw_template_select(){
-
+
-
+
-
+
_sub_selector('templates', 'sel-templates-sub', __('For Which Type of Page?', 'pagelines'));
-
+
$this->_sub_selector('main', 'sel-content-sub', __('Which Content Area Type?', 'pagelines'));
-
+
}
@@ -202,28 +202,28 @@ function draw_template_select(){
*/
function _sub_selector($type = 'templates', $class, $title = '', $subtitle = ''){
global $pagelines_template;
-
-
+
+
// The Buttons
$buttons = '';
foreach($pagelines_template->map[$type]['templates'] as $template => $t){
-
+
if( (!isset($t['version']) || ($t['version'] == 'pro' && VPRO)) && isset($t['name'])){
-
+
if( isset($t['page_type']) && $t['page_type'] == 'page')
$name = sprintf('
Template | %s', $t['name']);
else
$name = $t['name'];
-
+
$buttons .= sprintf('
', join( '-', array($type, $template) ), $name);
-
+
}
-
+
}
-
+
// Output
printf('
', $class, $title, $buttons);
-
+
}
@@ -233,30 +233,30 @@ function _sub_selector($type = 'templates', $class, $title = '', $subtitle = '')
*
*/
function do_template_builder(){
-
+
global $pagelines_template;
global $unavailable_section_areas;
?>
-map as $hook => $h){
-
+
if( isset($h['templates']) ){
-
+
foreach($h['templates'] as $tid => $t )
- $this->section_banks( $tid, $t, $hook, $h );
-
- } else
+ $this->section_banks( $tid, $t, $hook, $h );
+
+ } else
$this->section_banks( $hook, $h );
-
+
}?>
%s', $addl) : '';
if( !isset( $tfield['name'] ) )
@@ -279,14 +279,14 @@ function section_banks($template, $tfield, $hook = null, $hook_info = array()){
2. Arrange Sections In Area With Drag & Drop
-
+
@@ -300,9 +300,9 @@ function section_banks($template, $tfield, $hook = null, $hook_info = array()){
-
-
-
+
+
+
@@ -313,14 +313,14 @@ function section_banks($template, $tfield, $hook = null, $hook_info = array()){
-
+
-
+
section_setup_controls(); ?>
avail = $this->factory;
+
+ $this->avail = $this->factory;
if( isset($t['sections']) && is_array($t['sections'])){
-
+
foreach($t['sections'] as $sid){
- $pieces = explode("ID", $sid);
+ $pieces = explode("ID", $sid);
$section = (string) $pieces[0];
$clone_id = (isset($pieces[1])) ? $pieces[1] : 1;
@@ -346,30 +346,30 @@ function active_bank( $tid, $t, $ta, $ts ){
'section' => $section,
'sid' => $sid,
'template' => $tid,
- 'id' => 'section_' . $sid,
- 'icon' => $s->settings['icon'],
- 'name' => $s->name,
+ 'id' => 'section_' . $sid,
+ 'icon' => $s->settings['icon'],
+ 'name' => $s->name,
'desc' => $s->settings['description'],
'req' => $s->settings['required'],
'controls' => true,
'tslug' => $ts,
'tarea' => $ta,
- 'clone' => $clone_id,
+ 'clone' => $clone_id,
'cloning' => $s->settings['cloning']
-
+
);
$this->draw_section( $section_args );
-
+
if(isset($this->avail[$section]))
unset($this->avail[$section]);
-
- }
+
+ }
}
}
- }
-
+ }
+
/**
*
@@ -381,57 +381,57 @@ function passive_bank( $template, $t, $hook, $h, $template_slug ){
// Remove the sections that aren't compatible
$draw = array();
foreach( $this->avail as $sid => $s){
-
+
/* Flip values and keys */
$works_with = (is_array($s->settings['workswith'])) ? array_flip( $s->settings['workswith'] ) : array();
$fails_with = (is_array($s->settings['failswith'])) ? array_flip( $s->settings['failswith'] ) : array();
$markup_type = (!empty($h)) ? $h['markup'] : $t['markup'];
- if(!isset( $works_with[ $template ] )
- && !isset( $works_with[ $hook ])
- && !isset( $works_with[ $hook.'-'.$template ] )
+ if(!isset( $works_with[ $template ] )
+ && !isset( $works_with[ $hook ])
+ && !isset( $works_with[ $hook.'-'.$template ] )
&& !isset($works_with[$markup_type])
- || (
+ || (
isset( $fails_with[ $template ] )
|| isset($fails_with[ $hook ] )
|| ( isset( $fails_with['pagelines_special_pages()'] ) && is_pagelines_special ( array( 'type' => $template ) ) )
)
)
continue;
-
- $draw[ $sid ] = $s;
+
+ $draw[ $sid ] = $s;
}
-
+
// Draw in Column format
-
+
$col = 1;
$numcol = 2;
$count = 1;
$total = count( $draw );
$coltotal = ( $total % 2 ) ? $total+1 : $total;
-
+
if(!empty($draw)){
foreach($draw as $sid => $s){
-
+
$start_list = ( $count == 1 || ($coltotal / ($count - 1) ) == $numcol ) ? true : false;
$end_list = ( $count == $total || ($coltotal / ($count) ) == $numcol ) ? true : false;
-
+
if($start_list)
printf('', $col);
-
+
$section_args = array(
'id' => 'section_' . $sid,
'template' => $template,
'sid' => $sid,
- 'section' => $sid,
- 'icon' => $s->settings['icon'],
- 'name' => $s->name,
- 'desc' => $s->settings['description'],
+ 'section' => $sid,
+ 'icon' => $s->settings['icon'],
+ 'name' => $s->name,
+ 'desc' => $s->settings['description'],
'tslug' => $template_slug,
'tarea' => $hook,
'cloning' => $s->settings['cloning']
);
$this->draw_section( $section_args );
-
+
if($end_list){
printf(' ');
$col++;
@@ -441,17 +441,17 @@ function passive_bank( $template, $t, $hook, $h, $template_slug ){
} else {
printf('');
}
-
+
}
-
+
/**
*
* @TODO document
*
*/
- function draw_section( $args ){
-
+ function draw_section( $args ){
+
$defaults = array(
'section' => '',
'sid' => '',
@@ -461,32 +461,32 @@ function draw_section( $args ){
'name' => '',
'desc' => '',
'controls' => false,
- 'tslug' => '',
+ 'tslug' => '',
'tarea' => '',
- 'req' => false,
- 'clone' => '1',
+ 'req' => false,
+ 'clone' => '1',
'cloning' => false
);
$a = wp_parse_args( $args, $defaults );
-
- $check_value = (bool) $this->sc_value( $a['tslug'], $a['sid'], 'hide' );
-
+
+ $check_value = (bool) $this->sc_value( $a['tslug'], $a['sid'], 'hide' );
+
printf('', $a['id'], ($a['req']) ? 'required-section' : '', ($check_value) ? 'hidden-section' : '');
printf('
', $a['icon']);
-
- printf('
', (!$a['controls']) ? 'style="display:none;"' : '');
+
+ printf('
', (!$a['controls']) ? 'style="display:none;"' : '');
printf('
%s %s ', $a['name'], ($a['clone'] != 1) ? '#'.$a['clone'] : '' );
printf('
%s ', $this->help_control(), $a['desc']);
-
- echo '
';
-
- $this->inline_section_control($a);
-
+
+ echo '';
+
+ $this->inline_section_control($a);
+
echo ' ';
-
+
}
-
+
/**
*
@@ -495,64 +495,64 @@ function draw_section( $args ){
*/
function inline_section_control($a){
-
- // Options
+
+ // Options
$check_name = $this->sc_name( $a['tslug'], $a['sid'], 'hide' );
- $check_value = (bool) $this->sc_value( $a['tslug'], $a['sid'], 'hide' );
+ $check_value = (bool) $this->sc_value( $a['tslug'], $a['sid'], 'hide' );
printf('', (!$a['controls']) ? 'style="display:none;"' : '');
-
+
if($a['cloning']){
-
+
$clone_js = (VPRO) ? sprintf('onClick="cloneSection(\'%s\');"', $a['id']) : '';
-
+
$clone_text = (VPRO) ? __( 'Clone', 'pagelines' ) : __( "Clone
(PRO) ", 'pagelines' );
-
+
$clone_class = (!VPRO) ? 'disabled_clone_button' : '';
-
+
$clone_btn = sprintf('
', $clone_class, $clone_js, $clone_text );
-
+
$remove_clone = sprintf('
', ($a['clone'] == 1) ? 'display: none;' : '', $a['id']);
-
+
printf('
%s %s
', $clone_btn, $remove_clone);
}
-
+
if($this->show_sc( $a['template'] )){
-
+
$clone = ($a['clone'] != 1) ? sprintf('
%s ', '#' . $a['clone']) : '';
printf('
%s %s %s ', $a['name'], $clone, __( 'Settings', 'pagelines' ) );
-
+
echo '
';
-
-
+
+
$checkbox = sprintf('
', $check_name, checked( $check_value, true, false));
$label = sprintf('
%s ', $check_name, '', __( 'Hide This By Default', 'pagelines' ) );
-
+
printf('
%s %s
', $checkbox, $label);
-
-
+
+
echo '
';
-
+
} else
echo __('No settings in this template area.', 'pagelines');
-
-
+
+
echo '
';
-
+
}
-
-
+
+
/**
* Show section control?
* On some template areas, e.g. posts, single, 404, they have their own interface.. so none is needed
*/
function show_sc( $t ){
-
+
return ( is_pagelines_special( array( 'type' => $t ) ) ) ? false : true;
}
-
+
/**
*
@@ -560,15 +560,15 @@ function show_sc( $t ){
*
*/
function section_setup_controls(){
-
+
$onclick = "PageLinesSlideToggle('.s-description', '.describe_toggle', '.setup_control_text','Hide Section Descriptions', 'Show Section Descriptions', 'pl_section_desc_toggle');";
-
+
printf('%s Section Descriptions
', $onclick, ( $this->help() ) ? 'Hide' : 'Show' );
-
+
}
-
+
/**
- *
+ *
*
* Show Section Control Option in MetaPanel
*
@@ -578,32 +578,32 @@ function section_setup_controls(){
* @since 4.0
*
*/
- function section_control_interface($oid, $o){
-
+ function section_control_interface($oid, $o){
+
if(isset($_GET['page']) && $_GET['page'] == 'pagelines_meta')
return;
-
+
if( isset($o['special']) ){
$this->template->adjust_template_type($o['special']);
$is_special = true;
- } else
+ } else
$is_special = false;
-
+
$integration = ( $o['scontrol'] == 'integration' ) ? true : false;
-
+
$template_slug = join( '-', array('templates', $this->template->template_type) );
$main_slug = join( '-', array('main', $this->template->template_type) );
global $metapanel_options;
-
+
$editing = ($is_special) ? ucfirst($o['special']) : $metapanel_options->edit_slug;
?>
-
+
-
-
+
@@ -638,10 +638,10 @@ function section_control_interface($oid, $o){
-
+
%s
', __( 'Area is empty.', 'pagelines') );
return;
}
-
+
echo '';
foreach($sections as $key => $sid){
-
-
- $pieces = explode('ID', $sid);
+
+
+ $pieces = explode('ID', $sid);
$section = (string) $pieces[0];
$clone_id = (isset($pieces[1])) ? $pieces[1] : 1;
-
+
// Get section information
if( isset($this->factory[ $section ]) ){
-
- $section_data = $this->factory[ $section ];
-
+
+ $section_data = $this->factory[ $section ];
+
$hidden_by_default = isset($this->sc_global[$template_slug][$sid]['hide']) ? $this->sc_global[$template_slug][$sid]['hide'] : null;
$check_type = ( $hidden_by_default ) ? 'show' : 'hide';
-
+
// Make the field 'key'
$option_name = ($is_special) ? $this->sc_name( $template_slug, $sid, $o['special'], $check_type ) : meta_option_name( array($check_type, $template_slug, $sid) );
$check_value = ($is_special) ? $this->sc_value( $template_slug, $sid, $o['special'], $check_type ) : get_pagelines_meta($option_name, $post->ID);
-
+
// The name of the section
$clone = ($clone_id != 1) ? ' #'.$clone_id : '';
$check_label = ucfirst($check_type).' ' . $section_data->name.$clone;
@@ -721,22 +721,22 @@ function sc_inputs( $template_slug, $sections, $o){
- ', $option_name, checked((bool) $check_value, true, false) );
- printf('%s ', $section_data->icon, $check_label);
-
+ printf('%s ', $section_data->icon, $check_label);
+
?>
-
';
-
+
}
-
+
/**
*
@@ -744,10 +744,10 @@ function sc_inputs( $template_slug, $sections, $o){
*
*/
function help_control(){
- if(!$this->help())
+ if(!$this->help())
return 'style="display:none"';
}
-
+
/**
*
@@ -757,8 +757,8 @@ function help_control(){
function help(){
if( get_option('pl_section_desc_toggle') == 'hide' || get_option('pl_section_desc_toggle') == false || !get_option('pl_section_desc_toggle') )
return false;
- else
- return true;
+ else
+ return true;
}
}
@@ -780,10 +780,10 @@ function templates_array(){
'default' => '',
'type' => 'templates',
'layout' => 'interface',
- 'title' => __( 'Drag & Drop Template Setup', 'pagelines'),
+ 'title' => __( 'Drag & Drop Template Setup', 'pagelines'),
'shortexp' => __( "Use draggable sections to control the design of your site's templates.", 'pagelines'),
- )
+ )
);
-
- return apply_filters('pagelines_templates_opt_array', $return);
+
+ return apply_filters('pagelines_templates_opt_array', $return);
}
\ No newline at end of file
diff --git a/admin/class.ui.typography.php b/admin/class.ui.typography.php
index 0e2fec96..37985028 100644
--- a/admin/class.ui.typography.php
+++ b/admin/class.ui.typography.php
@@ -1,6 +1,6 @@
foundry = $pl_foundry;
$this->fonts = $pl_foundry->foundry;
-
+
}
/**
@@ -31,21 +31,21 @@ function __construct() {
* Main Layout Drag and Drop
*
*/
- function build_typography_control($oid, $o){
+ function build_typography_control($oid, $o){
$preview_styles = '';
$preview_styles = $this->foundry->get_type_css( ploption($oid) );
-
+
echo OptEngine::input_label( get_pagelines_option_id($oid, 'font'), __('Select Font', 'pagelines'));
-
+
$opts = $this->get_opts($oid, $o, pagelines_sub_option($oid, 'font'));
-
+
$extra = 'onChange="PageLinesStyleFont(this, \'font-family\')" size="1"';
-
+
echo OptEngine::input_select( get_pagelines_option_id($oid, 'font'), get_pagelines_option_name($oid, 'font'), $opts, 'fontselector', $extra);
-
+
?>
@@ -71,10 +71,10 @@ function build_typography_control($oid, $o){
get_opts($oid, $o, $o['val']), 'fontselector');
-
-
+
+
}
-
+
/**
*
@@ -97,27 +97,27 @@ function fonts_option($oid, $o){
*
*/
function get_opts($oid, $o, $val){
-
+
$opts = '';
foreach($this->fonts as $fid => $f){
$free = (isset($f['free']) && $f['free']) ? true : false;
if(!VPRO && !$free){
}else{
- $font_name = $f['name'];
+ $font_name = $f['name'];
if($f['web_safe']) $font_name .= ' *';
if($f['google']) $font_name .= ' G';
-
+
$title = sprintf('title="%s"', $this->foundry->gfont_key($fid));
-
+
$opts .= OptEngine::input_option( $fid, selected( $fid, $val, false), $font_name, $f['family'], $title);
}
-
+
}
-
+
return $opts;
-
+
}
@@ -137,7 +137,7 @@ function get_type_styles($oid, $o){
// Small Caps?
$this->_get_type_select($oid, array('id' => 'variant', 'inputlabel' => 'Variant', 'prop' => 'font-variant', 'selectvalues' => array('normal' => 'Normal', 'small-caps' => 'Small-Caps'), 'default' => 'normal'));
- // Bold?
+ // Bold?
$this->_get_type_select($oid, array('id' => 'weight', 'inputlabel' => 'Weight', 'prop' => 'font-weight', 'selectvalues' => array('normal' => 'Normal', 'bold' => 'Bold', 'lighter' => 'Light'), 'default' => 'normal'));
// Italic?
@@ -163,7 +163,7 @@ function get_type_advanced($oid, $o){ ?>
* @TODO document
*
*/
- function _get_type_em_select($oid, $o){
+ function _get_type_em_select($oid, $o){
$option_value = ( pagelines_sub_option($oid, 'kern') ) ? pagelines_sub_option($oid, 'kern') : '0.00em';
?>
@@ -171,12 +171,12 @@ function _get_type_em_select($oid, $o){
—SELECT—
- %1$s', $em, selected($em, $option_value, false));
}
?>
@@ -190,7 +190,7 @@ function _get_type_em_select($oid, $o){
* @TODO document
*
*/
- function _get_type_select($oid, $o){
+ function _get_type_select($oid, $o){
$option_value = ( pagelines_sub_option($oid, $o['id']) ) ? pagelines_sub_option($oid, $o['id']) : $o['default'];
?>
diff --git a/admin/class.updates.php b/admin/class.updates.php
index 632fd110..1d211e50 100644
--- a/admin/class.updates.php
+++ b/admin/class.updates.php
@@ -1,8 +1,8 @@
-url_theme = apply_filters( 'pagelines_theme_update_url', PL_API . 'v3' );
$this->theme = 'PageLines';
@@ -34,12 +34,12 @@ function pagelines_theme_check_version() {
} else {
add_action('admin_notices', array(&$this,'pagelines_theme_update_nag') );
add_filter('site_transient_update_themes', array(&$this,'pagelines_theme_update_push') );
- add_filter('transient_update_themes', array(&$this,'pagelines_theme_update_push') );
+ add_filter('transient_update_themes', array(&$this,'pagelines_theme_update_push') );
add_action('load-update.php', array(&$this,'pagelines_theme_clear_update_transient') );
add_action('load-themes.php', array(&$this,'pagelines_theme_clear_update_transient') );
}
}
-
+
/**
* TODO Document!
*/
@@ -49,14 +49,14 @@ function pagelines_theme_update_push($value) {
if ( $pagelines_update && isset( $pagelines_update['package'] ) && $pagelines_update['package'] !== 'bad' ) {
$value->response['pagelines'] = $pagelines_update;
-
- $this->site_tran->response['pagelines'] = $pagelines_update;
+
+ $this->site_tran->response['pagelines'] = $pagelines_update;
set_site_transient( 'update_themes', $this->site_tran );
return $this->site_tran;
}
return $value;
}
-
+
/**
* TODO Document!
*/
@@ -78,39 +78,39 @@ function pagelines_theme_clear_update_transient() {
}
-
+
/**
* TODO Document!
*/
function pagelines_theme_update_nag() {
-
+
$pagelines_update = $this->pagelines_theme_update_check();
if ( ! is_super_admin() || ! $pagelines_update || ! current_user_can( 'edit_themes' ) )
return false;
-
+
if ( $this->username == '' || $this->password == '' || $pagelines_update['package'] == 'bad' ) {
-
+
// add_filter('pagelines_admin_notifications', array(&$this,'bad_creds') );
}
-
+
echo '';
-
+
printf( '
%s Framework %s is available.', $this->theme, esc_html( $pagelines_update['new_version'] ) );
-
- printf(
- ' %s',
- ( $pagelines_update['package'] != 'bad' )
- ? sprintf( 'You should update now .', admin_url('update-core.php') )
- : sprintf( 'Click here to setup your PageLines account.', PLAdminPaths::account() )
+
+ printf(
+ ' %s',
+ ( $pagelines_update['package'] != 'bad' )
+ ? sprintf( 'You should update now .', admin_url('update-core.php') )
+ : sprintf( 'Click here to setup your PageLines account.', PLAdminPaths::account() )
);
echo ( $pagelines_update['extra'] ) ? sprintf(' %s', $pagelines_update['extra'] ) : '';
echo '
';
-
- }
-
+
+ }
+
/**
* TODO Document!
*/
@@ -150,9 +150,9 @@ function pagelines_theme_update_check() {
$this->set_transients( $pagelines_update, 60*60*24 );
if ( isset( $pagelines_update['licence'] ) )
update_pagelines_licence( $pagelines_update['licence'] );
-
+
$this->pagelines_get_user_updates();
-
+
}
// If we're already using the latest version, return FALSE
@@ -161,13 +161,13 @@ function pagelines_theme_update_check() {
return $pagelines_update;
}
-
-
+
+
function set_transients( $pagelines_update, $time ) {
-
- set_transient( EXTEND_UPDATE, $pagelines_update, $time );
+
+ set_transient( EXTEND_UPDATE, $pagelines_update, $time );
}
-
+
function pagelines_get_user_updates() {
$options = array(
diff --git a/admin/class.welcome.php b/admin/class.welcome.php
index c5a67344..350e0eda 100644
--- a/admin/class.welcome.php
+++ b/admin/class.welcome.php
@@ -1,12 +1,12 @@
- __( 'Some Tips To Get You Started', 'pagelines' ),
- 'data' => $this->welcome_array(),
- 'icon' => PL_ADMIN_ICONS . '/light-bulb.png',
+ 'data' => $this->welcome_array(),
+ 'icon' => PL_ADMIN_ICONS . '/light-bulb.png',
'excerpt-trim' => false
- );
+ );
$view = $this->get_welcome_billboard();
-
+
$view .= $dash->wrap_dashboard_pane('tips', $args);
-
+
$view .= $this->getting_started_video();
$args = array(
'title' => __( 'Core WordPress Graphical/Functional Support', 'pagelines' ),
- 'data' => $this->get_welcome_plugins(),
- 'icon' => PL_ADMIN_ICONS . '/extend-plugins.png',
- 'excerpt-trim' => false,
- 'align' => 'right',
- 'btn-text' => 'Get It',
+ 'data' => $this->get_welcome_plugins(),
+ 'icon' => PL_ADMIN_ICONS . '/extend-plugins.png',
+ 'excerpt-trim' => false,
+ 'align' => 'right',
+ 'btn-text' => 'Get It',
'target' => 'new'
- );
+ );
$view .= $this->get_support_banner();
@@ -58,7 +58,7 @@ function get_welcome(){
return apply_filters('pagelines_welcome_intro', $view);
}
-
+
function getting_started_video(){
ob_start();
?>
@@ -71,48 +71,48 @@ function getting_started_video(){
- array(
- 'title' => __( 'The First Rule', 'pagelines' ),
- 'text' => __( "It's time we introduce you to the first rule. The first rule of PageLines is that you come first. We truly appreciate your business and support.", 'pagelines' ),
+ 'title' => __( 'The First Rule', 'pagelines' ),
+ 'text' => __( "It's time we introduce you to the first rule. The first rule of PageLines is that you come first. We truly appreciate your business and support.", 'pagelines' ),
'img' => PL_ADMIN_ICONS . '/first-rule.png'
- ),
+ ),
'story3' => array(
- 'title' => __( 'Drag & Drop Template Setup', 'pagelines' ),
- 'text' => sprintf( __( "Check out the Template Setup panel ! Using drag and drop you can completely control the appearance of your templates. Learn more in the docs .", 'pagelines' ), admin_url(PL_TEMPLATE_SETUP_URL) ),
+ 'title' => __( 'Drag & Drop Template Setup', 'pagelines' ),
+ 'text' => sprintf( __( "Check out the Template Setup panel ! Using drag and drop you can completely control the appearance of your templates. Learn more in the docs .", 'pagelines' ), admin_url(PL_TEMPLATE_SETUP_URL) ),
'img' => PL_ADMIN_ICONS . '/dash-drag-drop.png'
),
'story4' => array(
- 'title' => __( 'Set Up Your Extensions', 'pagelines' ),
- 'text' => __( "To maximize PageLines you're gonna need some extensions. Head over to the extensions page to get supported plugins and learn about extensions in the Store and Plus.", 'pagelines' ),
+ 'title' => __( 'Set Up Your Extensions', 'pagelines' ),
+ 'text' => __( "To maximize PageLines you're gonna need some extensions. Head over to the extensions page to get supported plugins and learn about extensions in the Store and Plus.", 'pagelines' ),
'img' => PL_ADMIN_ICONS . '/dash-plug.png'
),
'spprt' => array(
- 'title' => __( 'Get Fast Support', 'pagelines' ),
- 'text' => __( "For help getting started, we offer our customers tons of support including comprehensive docs , and an active, moderated forum .", 'pagelines' ),
+ 'title' => __( 'Get Fast Support', 'pagelines' ),
+ 'text' => __( "For help getting started, we offer our customers tons of support including comprehensive docs , and an active, moderated forum .", 'pagelines' ),
'img' => PL_ADMIN_ICONS . '/dash-light-bulb.png'
),
'opts' => array(
- 'title' => __( 'Site-Wide Vs. Page-by-Page Options', 'pagelines' ),
- 'text' => __( "PageLines is completely set up using a combination of site-wide and page-by-page options. Configure your site wide settings in the 'site options' panel, and setup your page by page options on individual pages, and in the 'page options' panel, which is used to set defaults and manage multiple post pages (like your blog).", 'pagelines' ),
+ 'title' => __( 'Site-Wide Vs. Page-by-Page Options', 'pagelines' ),
+ 'text' => __( "PageLines is completely set up using a combination of site-wide and page-by-page options. Configure your site wide settings in the 'site options' panel, and setup your page by page options on individual pages, and in the 'page options' panel, which is used to set defaults and manage multiple post pages (like your blog).", 'pagelines' ),
'img' => PL_ADMIN_ICONS . '/dash-opts.png'
),
'widgets' => array(
- 'title' => __( 'Menus and Widgets', 'pagelines' ),
- 'text' => __( "PageLines makes use of WordPress functionality to help you manage your site faster and better. Specifically, you'll be using WP menus and widgets so you may want to familiarize yourself with those interfaces as well.", 'pagelines' ),
+ 'title' => __( 'Menus and Widgets', 'pagelines' ),
+ 'text' => __( "PageLines makes use of WordPress functionality to help you manage your site faster and better. Specifically, you'll be using WP menus and widgets so you may want to familiarize yourself with those interfaces as well.", 'pagelines' ),
'img' => PL_ADMIN_ICONS . '/dash-setting.png'
),
);
-
+
return $data;
-
+
}
/**
@@ -126,10 +126,10 @@ function welcome_array(){
* @return mixed|void
*/
function get_welcome_billboard(){
-
+
ob_start();
?>
-
+
@@ -138,17 +138,17 @@ function get_welcome_billboard(){
-
@@ -160,7 +160,7 @@ function get_support_banner(){
- array(
'title' => __( 'Post Types Order', 'pagelines' ),
- 'link' => 'http://wordpress.org/extend/plugins/post-types-order/',
+ 'link' => 'http://wordpress.org/extend/plugins/post-types-order/',
'text' => __( 'Allows you to re-order custom post types like features and boxes.', 'pagelines' ),
'btn-text' => 'Get On WordPress.org'
),
'specialrecent' => array(
'title' => __( 'Special Recent Posts', 'pagelines' ),
- 'link' => 'http://wordpress.org/extend/plugins/special-recent-posts/',
+ 'link' => 'http://wordpress.org/extend/plugins/special-recent-posts/',
'text' => __( 'A sidebar widget that shows your most recent blog posts and their thumbs.', 'pagelines' ),
'btn-text' => 'Get On WordPress.org'
),
'disqus' => array(
'title' => __( 'Disqus Comments', 'pagelines' ),
- 'link' => 'http://wordpress.org/extend/plugins/disqus-comment-system/',
+ 'link' => 'http://wordpress.org/extend/plugins/disqus-comment-system/',
'text' => __( 'Improve your commenting system.', 'pagelines' ),
'btn-text' => 'Get On WordPress.org'
),
'cforms' => array(
'title' => __( 'CForms', 'pagelines' ),
- 'link' => 'http://www.deliciousdays.com/cforms-plugin/',
+ 'link' => 'http://www.deliciousdays.com/cforms-plugin/',
'text' => __( 'Advanced contact forms that can be used for creating mailing lists, etc.', 'pagelines' ),
'btn-text' => 'Get On DeliciousDays.com'
),
'wp125' => array(
'title' => __( 'WP125', 'pagelines' ),
- 'link' => 'http://wordpress.org/extend/plugins/wp125/',
+ 'link' => 'http://wordpress.org/extend/plugins/wp125/',
'text' => __( 'Used to show 125px by 125px ads or images in your sidebar(Widget).', 'pagelines' ),
'btn-text' => 'Get On WordPress.org'
),
'flickrrss' => array(
'title' => __( 'FlickrRSS Images', 'pagelines' ),
- 'link' => 'http://eightface.com/wordpress/flickrrss/',
+ 'link' => 'http://eightface.com/wordpress/flickrrss/',
'text' => __( 'Shows pictures from your Flickr Account (Widget & Carousel Section).', 'pagelines' ),
'btn-text' => 'Get On EightFace.com'
),
'nextgen' => array(
'title' => __( 'NextGen-Gallery', 'pagelines' ),
- 'link' => 'http://wordpress.org/extend/plugins/nextgen-gallery/',
+ 'link' => 'http://wordpress.org/extend/plugins/nextgen-gallery/',
'text' => __( 'Allows you to create image galleries with special effects (Carousel Section).', 'pagelines' ),
'btn-text' => 'Get On WordPress.org'
),
'pagenavi' => array(
'title' => __( 'Wp-PageNavi', 'pagelines' ),
- 'link' => 'http://wordpress.org/extend/plugins/wp-pagenavi/',
+ 'link' => 'http://wordpress.org/extend/plugins/wp-pagenavi/',
'text' => __( 'Creates advanced paginated post navigation.', 'pagelines' ),
'btn-text' => 'Get On WordPress.org'
)
);
-
+
return apply_filters('pagelines_welcome_plugins', $plugins);
}
-
+
}
\ No newline at end of file
diff --git a/admin/css/admin.css b/admin/css/admin.css
index 820517d0..8091dd5f 100644
--- a/admin/css/admin.css
+++ b/admin/css/admin.css
@@ -1,6 +1,6 @@
/*
admin.css
-
+
Created by PageLines on 2011-07-03.
Copyright 2012 PageLines Inc. All rights reserved.
*/
@@ -9,25 +9,25 @@
* WordPress Overrides
*/
-
-#optionstable .button,
-#optionstable .button-secondary,
-#optionstable .submit input,
-#optionstable input[type="button"],
+
+#optionstable .button,
+#optionstable .button-secondary,
+#optionstable .submit input,
+#optionstable input[type="button"],
#optionstable input[type="submit"]{
box-shadow: none;
}
-
+
#dialog{display: none;}
-.pagelines_ui .ui-dialog {
- position: absolute;
- padding: .2em;
- width: 600px;
- overflow: hidden;
+.pagelines_ui .ui-dialog {
+ position: absolute;
+ padding: .2em;
+ width: 600px;
+ overflow: hidden;
}
.pl_ajax_dialog.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
-.pl_ajax_dialog.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
+.pl_ajax_dialog.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
.pl_ajax_dialog.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
.pl_ajax_dialog.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
.pl_ajax_dialog.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
@@ -53,7 +53,7 @@
width: 100%;
height: 100%;
}
-
+
.pl_ajax_dialog .ui-icon {
display: block;
text-indent: -99999px;
@@ -62,12 +62,12 @@
}
.pl_ajax_dialog.ui-draggable .ui-dialog-titlebar { cursor: move; }
.pl_ajax_dialog.ui-dialog.ui-widget { font-size: 1.1em; }
-.pl_ajax_dialog.ui-dialog.ui-widget-content {
-
- color: #eee;
+.pl_ajax_dialog.ui-dialog.ui-widget-content {
+
+ color: #eee;
border-right: 1px solid #ccc;
border-bottom: 1px solid #ccc;
- background: rgba(0,0,0,.6);
+ background: rgba(0,0,0,.6);
text-shadow: #000 0 -1px 0;
-mozbox-shadow: inset 0px 0px 7px #000;
-webkit-box-shadow: inset 0px 0px 7px #000;
@@ -85,7 +85,7 @@
.pl_ajax_dialog.ui-dialog.ui-widget-content a { color: #333333; }
.pl_ajax_dialog.ui-dialog .ui-dialog-titlebar { display: none; color: #777; font-weight: bold; text-align: center; }
.pl_ajax_dialog.ui-dialog .ui-dialog-titlebar a { color: #777; }
-.pl_ajax_dialog.ui-dialog .ui-helper-clearfix:after{content:".";display:block;height:0;clear:both;visibility:hidden;} .ui-helper-clearfix{display:inline-block;}
+.pl_ajax_dialog.ui-dialog .ui-helper-clearfix:after{content:".";display:block;height:0;clear:both;visibility:hidden;} .ui-helper-clearfix{display:inline-block;}
* html .ui-helper-clearfix{height:1%;} .ui-helper-clearfix{display:block;}
/* @ Ajax Saving Popup */
@@ -96,10 +96,10 @@
text-align: center;
font-weight: bold;
background: transparent url('../images/bg_option_confirm.png') repeat 0 0;
- color: #eee;
+ color: #eee;
border-right: 1px solid #ccc;
border-bottom: 1px solid #ccc;
- background: rgba(0,0,0,.6);
+ background: rgba(0,0,0,.6);
text-shadow: #000 0 -1px 0;
-mozbox-shadow: inset 0px 0px 7px #000;
-webkit-box-shadow: inset 0px 0px 7px #000;
@@ -108,7 +108,7 @@
-moz-border-radius: 20px;
-webkit-border-radius: 20px;
border-radius: 20px;
-
+
}
.ajax-saved-pad{ padding: 50px 50px 45px; }
@@ -117,8 +117,8 @@
line-height: 50px;
background: transparent url('../images/confirm-check.png') no-repeat top center;
}
-
-
+
+
.success-text, .uploading-text{display:none;}
.ajax-saved.success .success-text{display: inline;}
.ajax-saved.uploading .uploading-text{display: inline;}
@@ -129,8 +129,8 @@
*/
.plpanel {
- min-height: 350px;
-
+ min-height: 350px;
+
}
.plpanel p {line-height: 1.65em;}
.oinputs p{ font-size: 1em; }
@@ -144,10 +144,10 @@
}
/* @ Labels */
.lbl {
- font-weight: bold;
+ font-weight: bold;
font-size: .92em;
line-height: 1.3em;
-
+
display: block;
}
.lbl.context{ margin: 15px 0 2px 0; }
@@ -172,7 +172,7 @@
background: #eee;
margin: 4px 0;
}
-
+
/* @ Interface */
.ui-tabs .ui-tabs-hide { display: none; }
#interfacetitle{background: #ddd; padding: 8px;}
@@ -187,26 +187,26 @@
#optionstable td {
font-family: helvetica, arial;
}
-
+
#optionstable input:focus, .oinputs-pad textarea:focus{border: 1px solid #888;}
-
+
.pagelines_panel{
position: relative;
z-index: 0;
}
-
+
#pagelines-settings-form{
position:relative;
}
-
+
.message_area { height: 35px; }
-
+
.confirmation.c_ajax{display: none;}
-
+
.confirmation {
background: #ddd;
border: 1px solid #aaa;
@@ -219,7 +219,7 @@
}
.confirmation .confirmation-pad{
background: transparent url(../images/icons/tick.png) no-repeat 8px 7px;
-
+
padding: 7px 10px 7px 34px;
}
.confirmation.reset .confirmation-pad{
@@ -231,35 +231,35 @@
.confirmation.plerror .confirmation-pad{
background: transparent url(../images/icons/error.png) no-repeat 8px 7px;
}
-
+
.confirmation.settings-import .confirmation-pad{
background: transparent url(../images/icons/import.png) no-repeat 8px 7px;
}
-
+
.confirmation .confirmation-subtext{font-weight: normal;}
-
+
.config-error{
- text-align:left;
+ text-align:left;
padding: 50px 20px 60px 65px;
background: #eee;
-
+
border: 1px solid #ddd;
border-left: 1px solid #e1e1e1;
border-top: 1px solid #e1e1e1;
width: 700px;
margin: 1.5em auto;
}
-
-
-
+
+
+
.plwrap .updated, .plwrap .error {
margin:0;
margin-bottom: 8px;
}
-
+
#tabs, #optionsheader, #optionsfooter, .picker_panel, .tgraph-controls, .template_layout .sbank-area, .the_template_builder{
-
+
-moz-box-shadow: 0 1px 4px #DDD;
-webkit-box-shadow: 0 1px 4px #DDD;
box-shadow: 0 1px 4px #CCC;
@@ -273,7 +273,7 @@
background: #eee;
}
.tabtitle {
-
+
font-size: 1.3em;
font-weight: bold;
color: #000;
@@ -282,10 +282,10 @@
.tabtitle-pad{
padding: 16px 0 16px 35px;
}
-
+
.tabtitle.tt-size-large{font-size: 2.5em}
.tabtitle.tt-size-large .tabtitle-pad{padding: 18px 0 18px 39px;}
-
+
#tabsnav {
float: left;
width: 170px;
@@ -307,7 +307,7 @@
border-left: 1px solid #fff;
background: url(../images/tabsnav-item.png) repeat-x left bottom;
}
-
+
#tabsnav li span.graphic.top{
border-top:1px solid #fff;
background: none;
@@ -320,10 +320,10 @@
height: 0;
padding:0;
}
-
+
#tabsnav li a:hover{
background:#f7f7f7;
-
+
border-top: 1px solid #fff;
border-left: 1px solid #fff;
border-right: none;
@@ -340,48 +340,48 @@
padding-left: 25px;
display: block;
}
-
+
#tabsnav li a.pro_tab span{
opacity: .3;
}
-
+
#tabsnav li.listsave {
padding: 10px 30px;
border-top: 1px solid #ddd;
margin-top: 2em;
text-align: center;
}
-
+
#tabsnav .error{margin-bottom: 0}
/* @ Tab Navigation Icons */
-
+
/* Default Case */
.tabnav-element span.icn{background: transparent url(../images/icons/wrench.png) no-repeat 0 0;}
.tabtitle{background: transparent url(../images/icons/wrench.png) no-repeat 10px 16px;}
-
+
.update_available {background: #ddd; }
#tabsnav a.update_available {border-top: 1px solid #f7f7f7; border-bottom: 1px solid #ccc }
-
+
.update_available span{background: transparent url(../images/icons/download.png) no-repeat 0px 0px;}
#update_available .tabtitle{background: transparent url(../images/icons/download.png) no-repeat 10px 16px;}
-
+
#thetabs {
margin-left: 170px;
min-width: 753px;
background: #f7f7f7;
border-left: 1px solid #ccc;
}
-
+
.no_tabs #thetabs{margin-left: 0; border-left: none;}
.no_tabs #thetabs .optin{
-
+
-webkit-box-shadow: inset 2px 2px 3px #fff;
-moz-box-shadow: inset 2px 2px 3px #fff;
box-shadow: inset 2px 2px 3px #fff;
-
+
}
-
+
.tabinfo {
float: left;
width: 100%;
@@ -390,14 +390,14 @@
background:#fff;
}
.htabs-interface .htab-content{background:#f7f7f7; min-height: 350px}
-
+
.optionrow {
-
+
width: 100%;
}
-
+
/* @ Horizontal Navigation */
-
+
#htabs {margin-top: 10px; }
.horizontal-tabs{border-bottom: 1px solid #bbb;}
.horizontal-tabs li a{
@@ -411,13 +411,13 @@
border: 1px solid #ccc;
border-right: 1px solid #bbb;
border-bottom: none;
-
+
}
- .horizontal-tabs .ui-tabs-selected a,
- .horizontal-tabs .ui-tabs-selected a:hover,
+ .horizontal-tabs .ui-tabs-selected a,
+ .horizontal-tabs .ui-tabs-selected a:hover,
.htabs-menu .horizontal-tabs .ht-special.ui-tabs-selected a,
- .horizontal-tabs .ui-state-active a,
- .horizontal-tabs .ui-state-active a:hover,
+ .horizontal-tabs .ui-state-active a,
+ .horizontal-tabs .ui-state-active a:hover,
.htabs-menu .horizontal-tabs .ht-special.ui-state-active a{
color: #222;
background: #F7F7F7;
@@ -429,18 +429,18 @@
}
.horizontal-tabs a:hover{color:#000}
- .horizontal-tabs a:active{
- background: #d1d1d1;
+ .horizontal-tabs a:active{
+ background: #d1d1d1;
color:#000;
border: 1px solid #bbb;
border-right: 1px solid #aaa;
border-bottom: none;
}
-
+
.subtabs.horizontal-tabs{
border-bottom: none;
margin-bottom: 0 !important;
-
+
}
.subtabs-menu .htab-sub{
background:#f1f1f1;
@@ -460,7 +460,7 @@
.subtabs-menu .subtabs :first-child a, .subtabs-menu .subtabs :first-child a:hover{
border-left: 1px solid #ccc;
}
-
+
.subtabs-menu .subtabs .ui-tabs-selected a,
.subtabs-menu .subtabs .ui-tabs-selected a:hover,
.subtabs-menu .subtabs .ui-state-active a,
@@ -475,12 +475,12 @@
border-left: 1px solid #eee;
}
.subtabs-menu .subtabs a:hover{
- border: none;
+ border: none;
border-top: 1px solid #ccc;
border-bottom: 1px solid #bbb;
- background:#e3e3e3 url(../images/sprite-subtabs.png) repeat-x 0 -100px;
+ background:#e3e3e3 url(../images/sprite-subtabs.png) repeat-x 0 -100px;
}
-
+
.subtabs a .st-pad{
border-right: 1px solid #ccc;
border-top: 1px solid #fafafa;
@@ -491,10 +491,10 @@
.htab-content-pad {padding: 15px 20px;}
.htab-content .htab-title{margin: .5em 0 1em; color:#ccc}
-
+
.htabs-menu .horizontal-tabs li.ht-left{margin-left: 12px}
.horizontal-tabs li.ht-right{float: right;margin-right: 12px}
-
+
.htabs-menu .horizontal-tabs .ht-special a{
background: #82a2ca url(../images/superlink-sprite-blue.png) 0 0 repeat-x;
color: #fff;
@@ -502,23 +502,23 @@
border: 1px solid #2d4a79;
border-right: 1px solid #2d4a79;
border-bottom: none;
-
+
}
-
+
/* @ Horizontal List - Used in Posts Control */
.plist-nav{
padding: 0;
- border-top: 1px solid #fff;
+ border-top: 1px solid #fff;
}
.posts_tab_content{
background:#f7f7f7;
}
-
+
.posts_tab_content .metatab_title{
border-top: 1px solid #fff;
position:relative;
}
-
+
.plist-nav ul.plist {
background:#eaeaea;
border-bottom: 1px solid #ccc;
@@ -534,7 +534,7 @@
text-align: center;
padding: 7px 10px 5px;
}
-
+
.plist-nav .plist li{
margin: 0 5px 5px;
text-align: left;
@@ -553,7 +553,7 @@
color:#444;
}
.plist li a.inactive-tab{
-
+
background: #f1f1f1;
color:#AAA;
border: 1px solid #ccc;
@@ -571,7 +571,7 @@
color:#000;
background:#fff;
}
- .plist li a:active,
+ .plist li a:active,
.plist li.ui-tabs-selected a,
.plist li.ui-state-active a{
color:#000;
@@ -579,7 +579,7 @@
border:1px solid #aaa;
border-right: 1px solid #f7f7f7;
border-bottom:1px solid #f7f7f7;
-
+
}
.plist li a:active .metatab_pad,
.plist li.ui-tabs-selected a .metatab_pad,
@@ -598,9 +598,9 @@
margin-left: 5px;
font-size: .9em;
}
-
-
+
+
/* @ Option Title Area */
.optiontitle {
line-height: 1.4em;
@@ -617,7 +617,7 @@
.optiontitle small {
font-size: 11px;
}
-
+
.optiontitle .protag{
vertical-align: top;
padding: 2px 5px;
@@ -629,18 +629,18 @@
color:rgba(0,0,0,.3);
border-radius:3px;
}
-
+
.vidlink{float: right; background:#fff; box-shadow: 0 1px 3px #aaa;}
.vidlink:hover{box-shadow: 0 1px 5px #888;}
.vidlink img{display: block;}
-
+
.insidebox.context{
margin: 5px;
padding: 10px;
background: #eee;
}
.context .button-secondary, .context .button-primary {margin-right: 10px;}
-
+
/*
@@ -661,10 +661,10 @@
width: 62%;
float: left;
text-align: left;
-
+
}
.oinputs-pad { padding: 20px 40px 30px; }
-
+
.oexp {
width: 38%;
float:left;
@@ -677,13 +677,13 @@
.oexp h5{ font-size:1em; margin: 0 0 .5em; }
.oexp p{ margin: 5px 0; line-height: 1.6em;}
-
+
.oexp .pro_note{
padding: 10px;
background: #eee;
margin: 10px 0;
}
-
+
.wideinputs .oexp, .interface .oexp{
border-left: none;
margin: 0;
@@ -707,14 +707,14 @@
cursor: pointer;
}
.more_exp:hover{background: #e1e1e1;}
-
+
.wideinputs .oexp ul, .interface .oexp ul{
padding-left: 30px;
font-size: .9em;
list-style-type:disc;
}
-
-
+
+
.wideinputs .oexp .theexample {
margin-top: -27px;
margin-left: 8px;
@@ -724,23 +724,23 @@
padding: 10px ;
border: 1px solid #ddd;
background: #e5e5e5;
-
+
}
-
+
.wideinputs .multi_option .oinputs-pad{
padding: 0;
margin:0;
}
-
-
+
+
/* Different Layout Modes */
-
+
.fullinput {
width: 98%;
margin: 0 2%;
float: left;
}
-
+
.wideinputs .oinputs-pad {
margin:0 0 1em;
padding: 15px 30px;
@@ -752,19 +752,19 @@
padding: 0;
}
.interface .optiontitle{margin-bottom: 0}
-
+
.interface .oinputs-pad, .wideinputs.optionrow {padding:0}
.interface .oinputs, .wideinputs .oinputs{
width: 100%;
}
-
-
+
+
/* @ Options Panel Header & Footer */
#optionsheader{
border: 1px solid #ccc;
border-bottom: 1px solid #bbb;
}
-
+
#optionsfooter{
background: #eee;
border: 1px solid #bbb;
@@ -774,12 +774,12 @@
.ohead{
background: #eaeaea url(../images/bg-optionheader.png) repeat-x;
}
- .ohead-pad{
+ .ohead-pad{
padding: 6px 8px 4px 15px;
border-top: 1px solid #f7f7f7;
border-bottom: 1px solid #ccc;
}
-
+
.ohead-title{
float:left;
font-size: 1.7em;
@@ -796,14 +796,14 @@
/* @ The Amazing Superlink! */
.superlink-wrap{
- border: 1px solid #aaa;
+ border: 1px solid #aaa;
border-right: 1px solid #fff;
border-bottom: 1px solid #fff;
padding:0;
-moz-border-radius: 4px;
-khtml-border-radius: 4px;
-webkit-border-radius: 4px;
- border-radius: 4px;
+ border-radius: 4px;
float:left;
margin-right: 10px;
}
@@ -812,10 +812,10 @@
float: none;
margin-right: 0;
margin-left: 0;
- }
+ }
.superlink-wrap .superlink {
-
+
display: block;
text-decoration: none;
margin:0;
@@ -832,24 +832,24 @@
box-sizing: content-box;
cursor: pointer;
}
-
+
.extend_button.discrete, .superlink-wrap .superlink{
color:#666;
text-shadow: #fff 0 1px 0;
-
+
border: 1px solid #999;
border-top: 1px solid #f7f7f7;
border-left: 1px solid #f7f7f7;
background: #ddd url(../images/superlink-sprite-grey.png) 0 0 repeat-x;
}
-
+
.extend_button.discrete:hover, .superlink:hover, .superlink.supersave:hover{
color:#666;
background: #82a2ca url(../images/superlink-sprite-grey.png) 0 -35px repeat-x;
border: 1px solid #aaa;
border-top: 1px solid #fff;
border-left: 1px solid #fff;
-
+
}
.extend_button.discrete{
border-top: 1px solid #bbb;
@@ -861,7 +861,7 @@
}
.extend_button.discrete:active, .superlink:active, superlink.supersave:active{background: #82a2ca url(../images/superlink-sprite-grey.png) 0 -70px repeat-x;border: 1px solid #666;color: #000}
.superlink-pad, .supersave, .superlink-pagelines, .ohead .osave {padding: 5px 12px;height: 15px;display: block}
-
+
.sl-black .superlink{
color: #fff;
border: 1px solid #333;
@@ -870,8 +870,8 @@
}
.sl-black .superlink:hover{background: #82a2ca url(../images/superlink-sprite-black.png) 0 -35px repeat-x;border: 1px solid #555;}
.sl-black .superlink:active{background: #82a2ca url(../images/superlink-sprite-black.png) 0 -70px repeat-x;border: 1px solid #000;color: #ddd}
-
-
+
+
.sl-blue.superlink-wrap{border-top: 1px solid #999;border-left: 1px solid #999;}
.extend_button, .sl-blue .superlink, .ohead .superlink.osave, .admin-blue {
background: #82a2ca url(../images/superlink-sprite-blue.png) 0 0 repeat-x;
@@ -889,10 +889,10 @@
border-bottom: 1px solid #2d4a79;
}
.extend_button:active, .sl-blue .superlink:active, .ohead .osave:active, .admin-blue:active{
- background: #82a2ca url(../images/superlink-sprite-blue.png) 0 -70px repeat-x;
+ background: #82a2ca url(../images/superlink-sprite-blue.png) 0 -70px repeat-x;
color: #eee;
}
-
+
.sl-red.superlink-wrap{border-top: 1px solid #999;border-left: 1px solid #999;}
.sl-red .superlink{
color: #fff;
@@ -902,16 +902,16 @@
}
.sl-red .superlink:hover{background: #ff0000 url(../images/superlink-sprite-red.png) 0 -35px repeat-x;border: 1px solid #555;}
.sl-red .superlink:active{background: #ff0000 url(../images/superlink-sprite-red.png) 0 -70px repeat-x;border: 1px solid #000;color: #ddd}
-
+
.superlink-right-wrap{float:right; margin-left: 10px;}
-
+
/* PageLines Superlink Link */
.superlink-pagelines{background: url(../images/superlink-pagelines.png) no-repeat 8px 1px; display: block; height: 16px; padding-right: 15px;padding-left: 15px; }
.superlink-pagelines .slpl{padding-left: 14px;display: none;white-space: nowrap;}
-
+
/* Superlinks group */
.superlinks{
-
+
float:right;
overflow: auto;
clear: both;
@@ -938,21 +938,21 @@
}
.blue-button{
-
+
}
-
+
/* @ Below Footer Controls */
.optionrestore {
padding: 20px;
color: #999;
font-size: .9em;
-}
+}
.ortext{
padding-top: 5px;
}
-/* @ ChangeLog and Updating */
+/* @ ChangeLog and Updating */
.thelog {
background: #f1f1f1;
@@ -966,16 +966,16 @@
text-decoration: none;
font-size: .9em;
}
-
+
.thelog .button-secondary {color:#888; }
.emph {font-size: 1.4em; line-height: 2em; font-weight: bold}
.emph.subtle{color: #BBB}
-
+
/* @ Import-Export */
.upload_form .superlink-wrap{
margin: .7em 0 1.4em 0;
}
-
+
/* @ PageLines Account Integration */
.pl_form{
margin: 15px;
@@ -987,7 +987,7 @@
-moz-box-shadow: 1px 1px 3px #ddd;
-webkit-box-shadow: 1px 1px 3px #ddd;
box-shadow: 1px 1px 3px #ddd;
-}
+}
.pl_account_info_pad{
border-top: 1px solid #fff;
border-left: 1px solid #fff;
@@ -1008,10 +1008,10 @@
padding: 15px;
text-align: center;
font-weight: bold;
-
+
}
.plform_title{margin-left: -15px;}
-
+
.pl_account_info .superlink-wrap{
margin: 1em 0;
}
@@ -1021,17 +1021,17 @@
}
/* Image Upload Text Field */
.uploaded_url{margin-bottom: 1em}
-
-
+
+
/* @ Typography Option */
-
+
.button.active_button {
- color:#fff;
- background:#666;
- border: 1px solid #333;
- border-right: 1px solid #555;
- border-bottom: 1px solid #555;
- text-shadow: #000 0 -1px 0;
+ color:#fff;
+ background:#666;
+ border: 1px solid #333;
+ border-right: 1px solid #555;
+ border-bottom: 1px solid #555;
+ text-shadow: #000 0 -1px 0;
}
.type_inputs {
padding: 10px 5px;
@@ -1053,12 +1053,12 @@
width: 100%;
text-shadow: none;
color: #444;
-
+
text-shadow: #fff 0 1px 0;
border-right: 1px solid #fff;
border-bottom: 1px solid #fff;
background: #fff;
-
+
}
#tabs .oinputs .font_preview_pad {
height: auto;
@@ -1075,7 +1075,7 @@
-webkit-box-shadow:inset 0 0 5px #eee;
box-shadow:inset 0 0 5px #eee;
}
-
+
#tabs .type_advanced textarea {
height: 75px;
}
@@ -1109,9 +1109,9 @@
color:#AAA;
font-size: 13px;
}
-
+
.admin_theme_screenshot{
-
+
padding: 8px;
background: #fff;
float: right;
@@ -1137,8 +1137,8 @@
.admin_feature_list li strong{
color:#000;
}
-
-
+
+
.welcomef{
width: 48.5%;
float: left;
@@ -1152,7 +1152,7 @@
.welcomef.rlast{
float:right;
}
-
+
.welcomef-pad{
height: 95px;
padding: 20px 20px;
@@ -1165,7 +1165,7 @@
margin: 0;padding: 0;
}
.welcome_feature_list p{margin: 0 0 1em 0;}
-
+
.welcome_feature_list li .feature_icon, .admin_feature_list li .feature_icon, .admin_billboard_content .feature_icon{
float:left;
margin-left: -55px;
@@ -1173,7 +1173,7 @@
width: 40px;
}
.admin_billboard_content .feature_icon{margin-top: 8px;}
-
+
.feature_firstrule .feature_icon{
background: url(../images/icons/sprite-admin-features.png) no-repeat 0px 0px;
}
@@ -1195,8 +1195,8 @@
.feature_meta .feature_icon{
background: url(../images/icons/sprite-admin-features.png) no-repeat 0px -240px;
}
-
-
+
+
.welcome_plugin_list{
font-weight: bold;
}
@@ -1212,7 +1212,7 @@
border-left: 1px solid #fff;
border-top: 1px solid #fff;
}
-
+
.finally {
background:#e5e5e5;
padding: 20px;
@@ -1220,26 +1220,26 @@
font-size: 1.3em;
margin-bottom: 1em;
}
-
+
/* @ PageLines Dashboard
- ******************************/
+ ******************************/
.pl-dashboards .pl-dashboard-story .img-frame{
max-width: 50px;
background:#fff;
padding: 2px;
box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
-
+
.pl-dash{
margin: 0 0 1.5em;
background: #fefefe;
-
+
position: relative;
z-index: 5;
}
.pl-dash a{text-decoration: none;}
.pl-dash a:hover{text-decoration: underline;}
-
+
.pl-dash-half{
width: 49%;
float:left;
@@ -1265,10 +1265,10 @@
z-index: 2;
content: "";
}
-
+
.pl-dash .dash-title{
margin: 0;
- background:-webkit-linear-gradient(top,#fff 0%,#f7f7f7 100%);
+ background:-webkit-linear-gradient(top,#fff 0%,#f7f7f7 100%);
border: 1px solid #ddd;
box-shadow: inset 1px 1px 0 rgba(255,255,255,.8);
padding: 7px 10px;
@@ -1278,7 +1278,7 @@
z-index: 3;
}
.pl-dash .dash-title img{vertical-align: top; margin-right: 3px;}
-
+
.pl-dash .dash-foot {
font-size:.9em;
text-align: center;
@@ -1291,7 +1291,7 @@
margin-bottom: 0
}
.pl-dash p {
- margin: 0;
+ margin: 0;
color: #999;
}
@@ -1301,21 +1301,21 @@
.pl-dashboard-story.alt-story{
background:#fcfcfc;
border-top: 1px solid #fff;
-
+
}
.pl-dashboard-story .dashpane-pad, .dash-foot .dash-foot-pad{
position: relative;
z-index: 100;
}
-
+
.news-dash .dashpane-pad{
overflow: hidden;
}
-
+
.dashpane-pad{
padding: 10px 18px;
}
-
+
.dashpane .dashpane-pad ul{
color: rgba(0,0,0,.4);
margin: 4px 0 4px 20px;
@@ -1323,17 +1323,17 @@
list-style-type: disc;
list-style-position: outside;
font-size: .9em;
- }
+ }
.dashpane .dashpane-pad ul li{
margin: 0;
padding: 0;
}
-
-/* Live Iframe */
+
+/* Live Iframe */
.live_chat_wrap {
box-shadow: inset 0 0 8px rgba(0,0,0,.35);
@@ -1395,8 +1395,8 @@
color: #333;
margin-left: 5px;
}
-
-
+
+
/* @ Text Content Options */
.pl_help{
font-size: 12px;
@@ -1416,8 +1416,8 @@
padding: 10px;
background:#e2e2e2;
}
-
- .just_checkbox_option{
+
+ .just_checkbox_option{
padding: 0;
}
.just_checkbox_option .lbl.inln{
@@ -1433,20 +1433,20 @@
.vpro-billboard{
background: #eee;
-
+
border-bottom:1px solid #bbb;
-
-
+
+
font-size: 11px;
}
.vpro-billboard-pad{
padding: 13px;
-
+
border: 1px solid #f1f1f1;
box-shadow: inset 1px 1px 15px #ccc;
}
.vpro-billboard .vpro_billboard_height{
-
+
height: 95px;
margin-bottom: .5em;
}
@@ -1454,7 +1454,7 @@
float: left;
width: 600px;
}
-
+
.vpro-billboard .vpro_thumb {
display: block;
float:right;
@@ -1481,20 +1481,20 @@
margin: 1.5em 0 0;
padding: 10px 20px 20px 35px;
display:none;
-
- }
+
+ }
.whatsmissing p.mod{
font-size: 10px;
margin: .5em;
}
/* PAGE OPTIONS */
-
+
.pagelines_pagepost_options{
border:1px solid #e1e1e1;
border-left:1px solid #ddd;
border-bottom: none;
-
+
text-shadow: #fff 0 1px 0;
background: #f7f7f7 url(../images/admin-metaoption-column.png) repeat-y 0 0;
}
@@ -1524,7 +1524,7 @@
width: 50%;
line-height: 1.8em;
}
-
+
.page_option p{
margin: 7px 0;
}
@@ -1540,7 +1540,7 @@
margin:4px 0;
font-size: 10px;
}
-
+
.page_option .meta-text_small {
width: 100px;
}
@@ -1559,7 +1559,7 @@
.sc_gap{
width: 45%;
- float:left;
+ float:left;
margin: 20px 0 20px 3%;
background:#eee;
border: 1px solid #d1d1d1;
@@ -1580,7 +1580,7 @@
padding: 10px;
}
.sc_area{
-
+
border-bottom: 1px solid #ddd;
border-top: 1px solid #fff;
}
@@ -1632,7 +1632,7 @@ font-weight: bold;
border-left: 1px solid #eee;
}
.sc_label{
-
+
display: block;
border-left: 1px solid #bbb;
margin-left: 25px;
@@ -1648,11 +1648,11 @@ font-weight: bold;
padding: 7px 5px 5px;
float:left;
}
-
-
+
+
/* @ PageLines MetaPanel Type Options */
.pl_mp{
- margin: 20px 10px;
+ margin: 20px 10px;
min-width: 650px;
-moz-box-shadow: 0 1px 4px #bbb;
-webkit-box-shadow:0 1px 4px #bbb;
@@ -1674,7 +1674,7 @@ font-weight: bold;
.pagelines_metapanel #tabsnav {
float: left;
- width: 28%;
+ width: 28%;
margin: 15px -28% 0 0;
border-top: 1px solid #ddd;
border-bottom: 1px solid #fafafa;
@@ -1698,22 +1698,22 @@ font-weight: bold;
border-top: 1px solid #bbb;
border-bottom: 1px solid transparent;
}
-
+
.metatab_icon{
padding-left: 22px;
}
-
-
+
+
#plpanel li a.inactive-tab{ color: #999 }
#plpanel li a.inactive-tab .tab_inactive{
- float:right;
+ float:right;
color:#AAA;
- font-size:.85em;
- font-weight: normal;
+ font-size:.85em;
+ font-weight: normal;
padding-left: 0;
}
.metatab_title .tab_inactive{float:right;color:#bbb}
-
+
.mp_panel{
margin-left: 28%;
width: 72%;
@@ -1723,16 +1723,16 @@ font-weight: bold;
.mp_panel.hide_tabs{width: 100%; margin-left: 0%}
.mp_panel.hide_tabs .mp_panel_pad{border-left: none;}
.mp_panel.hide_tabs .optiontitle-pad {border-left: none;}
-
- .mp_panel_pad{
+
+ .mp_panel_pad{
border-left: 1px solid #d5d5d5;
min-height: 400px;
}
.pagelines_metapanel .hide_tabs .pagelines_metapanel_options{width: 100%; border-left: none;margin-left: 0;}
.pagelines_metapanel .hide_tabs .pagelines_metapanel_options_pad{border-left: none;}
-
-
+
+
.metatab_title{
font-size: 1.4em;
padding: 14px 15px 15px 33px;
@@ -1741,7 +1741,7 @@ font-weight: bold;
.metatab_title .superlink-wrap{
margin-top:-4px;
}
-
+
.metapanel_option_title{
background: #ececec;
padding: 15px 15px 15px 20px;
@@ -1751,7 +1751,7 @@ font-weight: bold;
.metatab_option_subheader{font-size: .9em;color: #666;line-height: 1.4em;}
.metapanel_option_input_pad{padding: 15px 10px 15px 30px;}
-
+
.metapanel_option_input.input_with_exp, .hide_tabs .metapanel_option_input{
float:left;
width: 80%;
@@ -1769,22 +1769,22 @@ font-weight: bold;
margin-left: -1px;
}
.metapanel_option_exp_pad{padding: 15px;border-left: 1px solid #fff;}
-
+
.mp_title{ float: left;}
.mp_title .mp_title_text{ font-size: 23px; line-height: 1.32em; font-weight: bold; color: #BBB; text-shadow: #fff 0 1px 0;}
.mp_title .btag, .ohead-title .btag {margin-top: 5px;margin-left: 10px;}
-
+
.mp_bar .superlink-wrap{float: right;}
.mp_bar .sl-pagelines{float: left;}
.mp_bar{border: 1px solid #ccc;}
- .mp_head{border-bottom: none}
+ .mp_head{border-bottom: none}
.mp_footer{ border-top: 1px solid #fff; border-bottom: 1px solid #bbb; }
.mp_bar_pad{ padding: 5px 10px; }
-
+
/* @ Layout Builder */
.layouteditor { display: none; }
.layouteditor.selectededitor{ display: block; }
-
+
.layout-selections, .layout-main-content{
margin: 18px auto;
}
@@ -1805,7 +1805,7 @@ font-weight: bold;
}
.locontent { background: #fff; }
- .loelement-pad{
+ .loelement-pad{
overflow: hidden;
text-align: center;
padding: 5px;
@@ -1829,7 +1829,7 @@ font-weight: bold;
background: #E5E5E5 url(../images/bg-indent-tall.png) repeat-x 0 0;
color: #777;
overflow:hidden;
-
+
}
.sidebar-dual{
@@ -1844,8 +1844,8 @@ font-weight: bold;
background: #f7f7f7;
}
-
- .pagelines-resizer-east,
+
+ .pagelines-resizer-east,
.pagelines-resizer-west,
.gutter-west-open,
.gutter-east-open{
@@ -1854,13 +1854,13 @@ font-weight: bold;
background: #CBE3FF;
cursor: col-resize !important;
}
- .pagelines-resizer-east:hover,
+ .pagelines-resizer-east:hover,
.pagelines-resizer-west:hover,
.gutter-west-open:hover,
.gutter-east-open:hover{
background: #b2d5ff;
}
-
+
.layoutinputs, .sel_layout_exp{
font-size: 11px;
background: #eee;
@@ -1868,7 +1868,7 @@ font-weight: bold;
margin: 18px auto;
}
.sel_layout_exp_pad{ padding: 1.5em; }
-
+
.layoutinputs .lbl-layout input[readonly]{
width: 70px;
text-align: center;
@@ -1891,9 +1891,9 @@ font-weight: bold;
display: block;
margin-top: 4px;
}
-
-
+
+
/* Layout Selector */
.layoutinput, .graphic_select_input{display:none;}
@@ -1905,13 +1905,13 @@ font-weight: bold;
border-right: 1px solid #c1c1c1;
}
.layout-selections-pad {
-
+
padding: 1em 85px 1.6em 85px;
border:1px solid #eee;
border-left: 1px solid #fff;
border-top: 1px solid #fff;
}
-
+
.layout-overview {
font-size: 11px;
color: #777;
@@ -1946,7 +1946,7 @@ font-weight: bold;
height: 50px;
text-indent: -3333em;
}
-
+
.layout-image.fullwidth{
background: url(../images/sprite-layouts.png) no-repeat 0 0;
}
@@ -1966,12 +1966,12 @@ font-weight: bold;
background: url(../images/sprite-layouts.png) no-repeat 0 -250px;
}
-/* @ Graphic Selector */
+/* @ Graphic Selector */
.graphic_selector_wrap{
padding: 20px 20px;
}
- .graphic_selector{
-
+ .graphic_selector{
+
background: #EFEFF0 url(../images/bg-indent.png) repeat-x left bottom;
border: 1px solid #ccc;
border-bottom: 1px solid #c1c1c1;
@@ -1993,7 +1993,7 @@ font-weight: bold;
display: block;
}
.layout-selections{
- width: 700px;
+ width: 700px;
}
.graphic_select_item{
display: inline-block;
@@ -2047,8 +2047,8 @@ font-weight: bold;
border-right: 1px solid #d1d1d1;
border-bottom: 1px solid #d1d1d1;
}
-
-
+
+
.graphic_select_border:hover {
border: 1px solid #aaa;
border-right: 1px solid #777;
@@ -2070,15 +2070,15 @@ font-weight: bold;
cursor: default;
box-shadow: none;
}
-
+
.enabled_option .graphic_fill{
text-indent: -3333em;
}
-
+
.graphic_select_image, .graphic_fill{
display: block;
}
-
+
.disabled_option .graphic_fill{
text-transform: uppercase;
background: rgba(255, 255, 255, .8);
@@ -2086,9 +2086,9 @@ font-weight: bold;
color: rgba(0, 0, 0, .3);
font-size: 1.2em;
}
-
-
-/* @ Template Option */
+
+
+/* @ Template Option */
.tselect_label{
font-size: .8em;
display:block;
@@ -2097,7 +2097,7 @@ font-weight: bold;
/* @ Template Selector */
#wpcontent #thetabs .template_select{
-
+
color: #333;
padding: 5px;
font-size: 1.2em;
@@ -2111,7 +2111,7 @@ font-weight: bold;
margin: 2px;
margin-right: 10px;
}
-
+
.template_select optgroup {
font-style:normal;
color: #aaa;
@@ -2120,17 +2120,17 @@ font-weight: bold;
font-size: .8em;
}
.template_select optgroup option {color: #000; margin-left: 10px;}
-
+
option.disabled_option{color: #AAA;font-style: italic;}
#tselect option small{font-size: .85em;}
-
-
+
+
.tbuilder{
margin: 30px;
- }
+ }
.template-selector{
- width: 100%;
-
+ width: 100%;
+
background: #e9e9e9;
border: 1px solid #ccc;
border-right: 1px solid #fff;
@@ -2141,8 +2141,8 @@ font-weight: bold;
border-right: 1px solid #ddd;
padding: 8px 0 20px;
}
-
-
+
+
.template-selector{
-moz-box-shadow: inset 2px 2px 2px #e5e5e5;
-webkit-box-shadow:inset 2px 2px 2px #e5e5e5;
@@ -2153,7 +2153,7 @@ font-weight: bold;
-webkit-box-shadow:inset 0 1px 3px #ccc;
box-shadow: inset 0 1px 3px #ccc;
}
-
+
.tgraph-controls{
-moz-border-radius: 8px;
-khtml-border-radius: 8px;
@@ -2163,7 +2163,7 @@ font-weight: bold;
border-right: 1px solid #aaa;
border-bottom: 1px solid #aaa;
background: #fff url(../images/section-hover.png) repeat-x left bottom;
-
+
}
.tgraph-controls-pad{
-moz-border-radius: 8px;
@@ -2174,15 +2174,15 @@ font-weight: bold;
padding: 15px;
}
.tgraph {float: left; width: 50%;font-size: .85em}
-
+
.tgraph-pad{padding: 0px 65px;}
-
+
.tgraph-templates .tgraph-pad{ padding: 0 90px; }
.no_tabs .tgraph-content .tgraph-pad{ padding-top: 24px; }
-
+
.no_tabs .tgraph-pad{padding: 0px 95px;}
.no_tabs .tgraph-templates .tgraph-pad{ padding: 0 130px; }
-
+
.tgraph .tg-format{
text-align: center;
color: #666;
@@ -2201,7 +2201,7 @@ font-weight: bold;
.tg-format.pro-area .protag{
color:#aaa;
}
-
+
.tgraph .tg-format:hover{
cursor:pointer;
background:#fff url(../images/section-hover.png) repeat-x left bottom;
@@ -2221,7 +2221,7 @@ font-weight: bold;
border-top: 1px solid #fff;
border-left: 1px solid #fff;
}
-
+
.tgraph .tg-format.builder_selected_area{
background: #8FCBFD url(../images/sprite-navigation.png) repeat-x left bottom;
border: 1px solid #196BCE;
@@ -2234,11 +2234,11 @@ font-weight: bold;
border-top: 1px solid #8FCBFD;
border-left: 1px solid #8FCBFD;
}
-
+
.tgraph-templates .tgraph .tg-format, .tgraph-content .tgc{width: 100%;}
-
+
.tgraph .tg-templates .tg-pad { height: 50px; line-height: 50px; }
-
+
.tgraph .tg-pad{
border-top: 1px solid #fff;
border-left: 1px solid #fff;
@@ -2246,7 +2246,7 @@ font-weight: bold;
height: 13px;
line-height: 13px;
}
-
+
.tgraph .tg-content-area .tg-pad{ height: 81px; line-height: 81px; }
.tgraph .tg-rm{margin-right: 3px}
.tgraph .tg-mmr{margin-right: 2px}
@@ -2254,11 +2254,11 @@ font-weight: bold;
.tgraph .tg-sidebar1 .tg-pad, .tgraph .tg-sidebar2 .tg-pad{ height: 52px; }
.tgraph .tg-content-area{ width: 57%; float: left; }
.tgraph .tg-wrap{ width: 43%; float: left; }
-
+
.tgraph .tg-sidebar1, .tgraph .tg-sidebar2{ width: 50%;float: left; }
-
-
-
+
+
+
.template-selector h4, .sub-template-selector h4{
text-align: center;
margin: .5em 0 1em;
@@ -2268,9 +2268,9 @@ font-weight: bold;
color:#BBB;
text-align: center;
margin: 15px 0 0;
-
+
}
-
+
.tbuilder .sub-template-selector{
border: 1px solid #ccc;
border-top: 1px solid #bbb;
@@ -2323,13 +2323,13 @@ font-weight: bold;
border-top: 1px solid transparent;
border-left: 1px solid transparent;
}
-
-
+
+
/* @ Section Layout */
#template_data{display: none;}
-
+
#template_setup .oinputs-pad{position: relative; }
-
+
.the_template_builder {
min-height: 300px;
border: 1px solid #ddd;
@@ -2351,12 +2351,12 @@ font-weight: bold;
.confirm_save.ajax-saving{
background: transparent url(../images/ajax-loader-f7f7f7.gif) no-repeat 50% 50%;
}
-
-
+
+
.template-edit-panel {border-top: 1px solid #fff}
-
+
#template_data.selected_builder{ display: block; }
-
+
.sbank{ float:left; }
.sbank.template_layout{
width: 45%;
@@ -2366,22 +2366,22 @@ font-weight: bold;
border: 1px solid #ccc;
border-right: 1px solid #bbb;
border-bottom: 1px solid #bbb;
-
+
}
.sbank.template_layout .sbank-pad{
border-top: 1px solid #fff;
border-left: 1px solid #fff;
-
+
}
-
+
.sbank .sbank-area, .sbank .sbank-pad{
-moz-border-radius: 6px;
-khtml-border-radius: 6px;
-webkit-border-radius: 6px;
border-radius: 6px;
}
-
+
.sbank.available_sections{ width: 55%; }
.sbank.template_layout .sbank-area{margin-right: 5px;}
.sbank-area{
@@ -2390,10 +2390,10 @@ font-weight: bold;
border-left: 1px solid #c1c1c1;
border-top: 1px solid #c1c1c1;
margin: 25px;
-
+
}
.sbank.template_layout .sbank-wrap{
-
+
background:#eee url(../images/bottom-sheen-eee.png) repeat-x left bottom;
border-right: 1px solid #fff;
border-bottom: 1px solid #fff;
@@ -2405,7 +2405,7 @@ font-weight: bold;
border-bottom: 1px solid #ddd;
}
.sbank-pad{ padding: 15px; }
-
+
.sbank .sortcolumn{
width: 50%;
float: left;
@@ -2414,22 +2414,22 @@ font-weight: bold;
min-height: 50px;
padding: 10px 0;
}
-
+
.sbank ul.nosections {
background: url(../images/sections-none.png) no-repeat center center;
border: 5px dashed #ccc;
height: 150px;
width:auto;
-
+
}
.sbank .nosections.sortcolumn{
float: none;
}
.sbank .nosections.colnum2{display: none;}
-
+
.sbank li{ margin: 5px; }
.sbank li .section-bar{
-
+
border: 1px solid #ccc;
border-right: 1px solid #aaa;
border-bottom: 1px solid #aaa;
@@ -2442,7 +2442,7 @@ font-weight: bold;
box-shadow: 0 0 2px #d1d1d1;
background: #F3F3F4 url(../images/section-up.png) repeat-x left bottom;
}
-
+
.sbank li.ui-sortable-helper .section-bar{
background: #F3F3F4 url(../images/section-hover.png) repeat-x left bottom;
-moz-box-shadow: 0 0 6px #BBB;
@@ -2453,8 +2453,8 @@ font-weight: bold;
background: #F3F3F4 url(../images/section-hover.png) repeat-x left bottom;
color:#AAA;
}
-
- .hidden-section .section-controls-toggle{
+
+ .hidden-section .section-controls-toggle{
border: 1px solid #ccc;
color: #AAA;
}
@@ -2467,7 +2467,7 @@ font-weight: bold;
border-top: 1px solid #eee;
border-left: 1px solid #eee;
}
-
+
/* @ Cloning */
.clone_button{
font-weight: bold;
@@ -2501,7 +2501,7 @@ font-weight: bold;
-webkit-border-radius: 4px;
border-radius: 4px;
}
-
+
.clone_button:hover{
background: #f7f7f7;
}
@@ -2512,11 +2512,11 @@ font-weight: bold;
border-left: 1px solid #999;
border-top: 1px solid #999;
}
-
+
.section-bar .the_clone_id{
color:#888;
}
-
+
.sbank li .section-bar-pad{
border-top: 1px solid #fff;
border-left: 1px solid #fff;
@@ -2530,15 +2530,15 @@ font-weight: bold;
.sbank li .section-bar:hover{
cursor: move;
}
-
+
.sbank h4 { margin: 2px 0 0px 0; }
.sbank .s-description {display: block; padding: 2px 0; color: #444; font-size: .9em}
-
+
li.required-section .section-moreinfo-toggle{ color: #555; }
li.required-section .section-moreinfo-toggle:hover{ color: #222; }
-
+
.section-controls-toggle{
-
+
border: 1px solid #bbb;
color: #999;
float: right;
@@ -2556,22 +2556,22 @@ font-weight: bold;
border-radius: 4px;
border-top: 1px solid #f7f7f7;
border-left: 1px solid #f7f7f7;
- padding: 1px 6px 1px 5px;
+ padding: 1px 6px 1px 5px;
}
-
-
+
+
.section-controls-toggle:hover{
color: #333;
cursor: pointer;
background:#ddd;
}
-
+
.section-controls{
- display: none;
+ display: none;
background: #e6e6e6;
border-right: 1px solid #fff;
border-bottom: 1px solid #fff;
-
+
margin: 8px 0;
-moz-border-radius: 4px;
-khtml-border-radius: 4px;
@@ -2584,11 +2584,11 @@ font-weight: bold;
-khtml-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
- padding: 8px;
+ padding: 8px;
}
.section-controls-pad .moreinfolist{margin: 0 0 8px 0px; cursor: text;}
.section-controls-pad .moreinfolist span{margin: 0 0 0 4px; font-style: italic; display: block;}
-
+
.section-options{
font-size: 10px;
padding: 5px 10px 2px;
@@ -2605,13 +2605,13 @@ font-weight: bold;
.section-options label:hover{
color: #000;
}
-
+
#nested_sortable{
background: #bbb;
padding: 15px;
margin: 1em;
}
-
+
.bank_title{
padding: 0 0 8px 0;
color: #aaa;
@@ -2620,25 +2620,25 @@ font-weight: bold;
font-size: 1.1em;
}
.sbank.template_layout .bank_title{color: #aaa}
-
-
+
+
#template_data .editingtemplate{
border-bottom: 1px solid #ccc;
border-top: 1px solid #f7f7f7;
background: #e1e1e1 url(../images/icons/pencil.png) no-repeat 8px 11px;
}
-
+
#template_data .edit_template_title{
- padding: 12px 12px 12px 32px;
- font-size: 1.3em;
+ padding: 12px 12px 12px 32px;
+ font-size: 1.3em;
font-weight: bold;
display: block;
float: left;
width: 370px;
}
-
+
#template_data .edit_template_title span{ color: #999; }
-
+
.section_layout_description{
height: 25px;
line-height: 25px;
@@ -2647,18 +2647,18 @@ font-weight: bold;
border-bottom: 1px solid #bbb;
background: #e1e1e1;
}
-
+
.config_title{ font-weight: bold; }
-
- .section_layout_description .config_title{
+
+ .section_layout_description .config_title{
width: 200px;
float: left;
}
- .section_layout_description .config_title span{
+ .section_layout_description .config_title span{
color: #aaa;
}
.section_setup_controls{ margin: .2em 0 1.5em; padding: 0 24px; }
- .section_setup_controls .setup_control{
+ .section_setup_controls .setup_control{
cursor:pointer;
color: #AAA;
font-weight: bold;
@@ -2667,22 +2667,22 @@ font-weight: bold;
text-decoration:none;
border: 1px solid #ddd;
}
- .section_setup_controls .setup_control span{
+ .section_setup_controls .setup_control span{
display: block;
padding: 4px 7px;
font-size: .9em;
- border-top: 1px solid #f7f7f7;
+ border-top: 1px solid #f7f7f7;
border-left: 1px solid #f7f7f7;
}
.section_setup_controls .setup_control:hover{
background: #f7f7f7;
- }
+ }
.section_setup_controls .setup_control:active{
background: #ddd;
}
- .section_setup_controls .setup_control:active span{
- border-top: 1px solid transparent;
- border-left: 1px solid transparent;
+ .section_setup_controls .setup_control:active span{
+ border-top: 1px solid transparent;
+ border-left: 1px solid transparent;
}
.layout-type-frame{
font-weight: bold;
@@ -2698,7 +2698,7 @@ font-weight: bold;
float: left;
margin-right: 15px;
}
-
+
.layout-type-templates .layout-type-thumb{
background: url(../images/sprite-template.png) no-repeat 0 0;
}
@@ -2727,7 +2727,7 @@ font-weight: bold;
/* Free Version */
.vpro_sections_call {
margin: .5em;
-
+
background: #ddd;
padding: 5px 12px;
}
@@ -2736,18 +2736,18 @@ font-weight: bold;
color: #777;
}
.vpro_sections_call p, .vpro_sections_call li{font-size: .85em;line-height: 1.6em;}
-
+
/* @ Color Picker */
.the_picker{
-
+
float: left;
margin-bottom: 18px;
}
-
+
.picker_row_3{ width: 32%; margin-right: 2% }
.picker_row_4{ width: 23%; margin-right: 2.6666666% }
.the_picker.p_end{margin-right: 0;}
-
+
.picker_panel{
background:#eee;
border: 1px solid #ddd;
@@ -2757,19 +2757,19 @@ font-weight: bold;
.pick_contain .colorSelector{display: inline-block; float: none}
input.colorpickerclass, input[type="text"].colorpickerclass{
width: 80px;
- border-top: 1px solid #ccc;
+ border-top: 1px solid #ccc;
text-shadow: #fff 0 1px 0;
letter-spacing: .1em;
padding: 4px;
color:#444;
- border-left: 1px solid #ccc;
- background: #fafafa;
- font-size: 1.05em;
+ border-left: 1px solid #ccc;
+ background: #fafafa;
+ font-size: 1.05em;
font-family: courier, arial, sans-serif;
display: inline-block;
vertical-align: top;
}
-
+
.the_picker .lbl.context{
margin: 0;
line-height: 1.5em;
@@ -2781,17 +2781,17 @@ font-weight: bold;
padding: 5px 10px 5px;
font-size: 1em;
text-align: center;
-
+
}
-
+
.pick_contain{
border-top: 1px solid #fff;
border-left: 1px solid #fff;
padding: 15px;
text-align: center;
}
-
-
+
+
.picker_generated{
background: #f7f7f7;
margin-top: 1em;
@@ -2806,7 +2806,7 @@ font-weight: bold;
.the_email_response{
margin: .5em 0;
background:#eee;
- padding: 10px;
+ padding: 10px;
font-size: .9em;
font-weight: bold;
color:#999;
@@ -2827,7 +2827,7 @@ font-weight: bold;
float: none;
display: inline-block;
}
-
+
.divor{
font-weight: bold;
font-size: 1.15em;
@@ -2851,7 +2851,7 @@ font-weight: bold;
.install_response p:last-child {color: #225E9B;font-size:1.3em}
.install_response h2,.install_response .icon32{display: none}
-
+
.plpanes {
list-style-type: none;
font-size: 1em;
@@ -2868,7 +2868,7 @@ font-weight: bold;
.plpanes-wrap{
}
.plpane{
- margin: 0;
+ margin: 0;
padding:0;
list-style-type: none;
border-top: 1px solid #f7f7f7;
@@ -2903,19 +2903,19 @@ font-weight: bold;
font-size: .95em;
line-height: 1.6em;
padding-top: .2em;
-
+
}
.pane-text{
padding: 0 0 .5em 0;
}
- .pane-dets{
+ .pane-dets{
font-size: .9em;
}
.pane-dets-pad{
padding: .5em 0;
}
-
+
.pane-dets a{
text-decoration: none;
@@ -2935,25 +2935,25 @@ font-weight: bold;
}
.plpane .superlink-wrap{float:right; margin-right: 0}
-
- h3{
- margin: 0;
- font-size: 1.34em;
+
+ h3{
+ margin: 0;
+ font-size: 1.34em;
margin-top: 4px;
}
-
+
.pipe{
color:#bbb;
text-shadow: 1px 0 0 #f7f7f7;
}
-
+
.pane-buttons{
margin: .2em 0;
}
.graphic_pane .pane-buttons{
margin: 1em 0 1.7em;
}
-
+
.pane-sub {color: #999;font-size: .9em; font-weight: bold;}
.extend_button{
@@ -2981,11 +2981,11 @@ font-weight: bold;
.prc{
color:#dce7f4;
}
-
+
.user-banner{
margin: 2em;
}
-
+
.install-control, .user-banner{
border: 4px dashed #DDD;
background:url(../images/extendleaf.png) no-repeat 50% 50px;
@@ -2998,7 +2998,7 @@ font-weight: bold;
font-size: 1.45em;
line-height: 1.7em;
}
-
+
.graphic_panes{
}
@@ -3006,7 +3006,7 @@ font-weight: bold;
padding: 25px;
}
.graphic_pane h4{ font-size: 1.6em; margin: 0 0 1em 0; color: #CCC;}
-
+
.graphic_pane.active{
border-bottom: 1px solid #c1c1c1;
border-top: 1px solid #fff;
@@ -3018,7 +3018,7 @@ font-weight: bold;
.graphic_pane .img {margin-right: 30px;}
.theme-screen {
float:left;
-
+
}
.graphic_pane .theme-screen img {
display: block;
@@ -3034,7 +3034,7 @@ font-weight: bold;
font-weight: bold;
text-align: center;
}
-
+
/* @ Upload Form */
.pagelines_upload_form {
background:#eaeaea;
@@ -3044,7 +3044,7 @@ font-weight: bold;
margin: 0;
font-size: 1.15em;
}
-
+
/* @ Restore/Import/Export */
.download-button{ float: left; display: block; }
@@ -3055,9 +3055,9 @@ font-weight: bold;
.framework_loading {margin: 15px 0;background: none;}
.framework_loading a {color:#aaa;text-decoration: none}
.framework_loading .framework_loading_gif {
- background: url(../images/ajax-loader.gif) no-repeat 0 0;
+ background: url(../images/ajax-loader.gif) no-repeat 0 0;
display: block;
- width: 32px;
+ width: 32px;
height: 32px;
margin: 0px auto;
}
@@ -3070,7 +3070,7 @@ font-weight: bold;
border-radius: 6px;
}
-/* CodeMirror */
+/* CodeMirror */
.CodeMirror{
background: #fff;
box-shadow: inset 2px 2px 4px #eee;
@@ -3108,7 +3108,7 @@ font-weight: bold;
padding: 3px 6px;
}
#plpanel select {font-size: 1.1em;}
-
+
#tabs .admin_checkbox {
display: block;
float: left;
@@ -3116,7 +3116,7 @@ font-weight: bold;
}
#tabs .regular-text, #plpanel .regular-text, .metatext-big, .metatext-reg{width: 90%;}
#tabs .tiny-text, #plpanel .tiny-text, .metatext-small{width: 100px;}
-
+
.pagelines_image_preview{
background: #fff url(../images/stripe.png) repeat 0 0;
padding: 7px;
@@ -3129,7 +3129,7 @@ font-weight: bold;
.default-image-preview{
opacity: .5;
}
-
+
.plprint{
font-family: arial, helvetica;
font-size: .85em;
@@ -3143,7 +3143,7 @@ font-weight: bold;
.filewarning {
color: #555555;
font-weight: bold;
- padding: 10px 15px;
+ padding: 10px 15px;
}
#imgPreviewWithStyles {
background: #222;
@@ -3152,20 +3152,20 @@ font-weight: bold;
padding: 15px;
z-index: 999;
border: none;
- }
-
+ }
+
.button{white-space: nowrap;}
-
+
.pl-store-rss ul {
list-style-type:disc;
padding: 5px 15px 0;
}
.pl-store-rss ul li {
line-height: 0.5em;
-
+
}
-
-
+
+
/*
objects.css
PageLines Objects - CSS Framework
@@ -3176,7 +3176,7 @@ font-weight: bold;
- /*
+ /*
* @ Lists
**********************************************************************/
@@ -3186,14 +3186,14 @@ font-weight: bold;
/* @ Tabbed List - Horizontal floated list, tab and navigation effects */
ul.tabbed-list {
- list-style-type: none;
+ list-style-type: none;
margin:0;
width: 100%; /* clear IE 7 */
}
ul.tabbed-list li, ul.tabbed-list lh {margin: 0; padding: 0; float: left;}
ul.tabbed-list li a, ul.tabbed-list lh a{display: block; }
- /*
+ /*
* @ Media / Image Format
**********************************************************************/
.media { overflow:hidden;overflow: visible; zoom: 1; }
@@ -3205,7 +3205,7 @@ font-weight: bold;
.media .img.rtimg{float:right; margin-left: 15px;}
/*
- * @ PageLines Proto CSS Grid
+ * @ PageLines Proto CSS Grid
***********************************/
.pprow { width: 100%; margin: 0 auto; }
@@ -3232,8 +3232,8 @@ font-weight: bold;
- @media screen and (max-width:650px) {
- .responsive #site .pp2, .responsive #site .pp3{
+ @media screen and (max-width:650px) {
+ .responsive #site .pp2, .responsive #site .pp3{
width: 100%;
margin-right: 0;
}
@@ -3246,17 +3246,17 @@ font-weight: bold;
padding: 15px !important;
}
}
- @media screen and (max-width:700px) {
- .responsive #site .pp4, #site .pp5, #site .pp6, #site .pp4{
+ @media screen and (max-width:700px) {
+ .responsive #site .pp4, #site .pp5, #site .pp6, #site .pp4{
width: 100%;
margin-right: 0;
}
}
.pp2, .pp3, .pp4, .pp5, .pp6 {
- transition:all .2s linear;
- -o-transition:all .2s linear;
- -moz-transition:all .2s linear;
+ transition:all .2s linear;
+ -o-transition:all .2s linear;
+ -moz-transition:all .2s linear;
-webkit-transition:all .2s linear;
}
@@ -3332,7 +3332,7 @@ font-weight: bold;
.bl-align-right{float:right; margin: 2px 0 2px 5px;}
- /* Tag Button */
+ /* Tag Button */
.btag, .boxtags a{
font-family: helvetica, arial, sans-serif;
text-shadow: #315f9b 0 -1px 0;
@@ -3372,22 +3372,22 @@ font-weight: bold;
text-shadow: 0 1px 0 rgba(255,255,255, .7);
color:#AAA;
background:#ddd;
- background:-moz-linear-gradient(top, #eee 0%, #ccc 100%);
- background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#eee),color-stop(100%,#ccc));
- background:-webkit-linear-gradient(top,#eee 0%,#ccc 100%);
- background:-o-linear-gradient(top,#eee 0%,#ccc 100%);
- background:-ms-linear-gradient(top,#eee 0%,#ccc 100%);
+ background:-moz-linear-gradient(top, #eee 0%, #ccc 100%);
+ background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#eee),color-stop(100%,#ccc));
+ background:-webkit-linear-gradient(top,#eee 0%,#ccc 100%);
+ background:-o-linear-gradient(top,#eee 0%,#ccc 100%);
+ background:-ms-linear-gradient(top,#eee 0%,#ccc 100%);
background:linear-gradient(top,#eee 0%,#ccc 100%);
}
- /* @ Grid */
+ /* @ Grid */
.media_overview{ margin-bottom: 12px; }
.grid-img-frame{
max-width: 100%;
}
.grid-img-pad{
width: 100%;
- float:left;
+ float:left;
}
.vignette{position: relative;}
@@ -3413,8 +3413,8 @@ font-weight: bold;
line-height: 1em;
}
.hovercard {
- position: absolute;
- bottom: 20px;
+ position: absolute;
+ bottom: 20px;
background: rgba(0,0,0, .6);
text-shadow: none;
color:#fff;
diff --git a/admin/init.admin.php b/admin/init.admin.php
index 10acb3d8..f580a685 100644
--- a/admin/init.admin.php
+++ b/admin/init.admin.php
@@ -2,7 +2,7 @@
/**
* Admin main init.
*
- *
+ *
* @author PageLines
*
* @since 2.0.b21
@@ -82,7 +82,7 @@
/**
* Load admin actions
*/
-require_once (PL_ADMIN.'/actions.admin.php');
+require_once (PL_ADMIN.'/actions.admin.php');
/**
* Load option actions
diff --git a/admin/js/codemirror/xml/xml.js b/admin/js/codemirror/xml/xml.js
index 7b11fd67..d985e30b 100644
--- a/admin/js/codemirror/xml/xml.js
+++ b/admin/js/codemirror/xml/xml.js
@@ -84,7 +84,7 @@ CodeMirror.defineMode("xml", function(config, parserConfig) {
var ok;
if (stream.eat("#")) {
if (stream.eat("x")) {
- ok = stream.eatWhile(/[a-fA-F\d]/) && stream.eat(";");
+ ok = stream.eatWhile(/[a-fA-F\d]/) && stream.eat(";");
} else {
ok = stream.eatWhile(/[\d]/) && stream.eat(";");
}
diff --git a/admin/js/colorbox/colorbox.css b/admin/js/colorbox/colorbox.css
index e49aa7cc..9b4584f0 100755
--- a/admin/js/colorbox/colorbox.css
+++ b/admin/js/colorbox/colorbox.css
@@ -13,7 +13,7 @@
.cboxPhoto{float:left; margin:auto; border:0; display:block;}
.cboxIframe{width:100%; height:100%; display:block; border:0;}
-/*
+/*
User Style:
Change the following styles to modify the appearance of ColorBox. They are
ordered & tabbed in a way that represents the nesting of the generated HTML.
diff --git a/admin/js/colorpicker/css/layout.css b/admin/js/colorpicker/css/layout.css
index 8b3f00ff..b59b8339 100755
--- a/admin/js/colorpicker/css/layout.css
+++ b/admin/js/colorpicker/css/layout.css
@@ -1,4 +1,4 @@
-body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td {
+body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td {
margin:0;
padding:0;
}
@@ -6,7 +6,7 @@ table {
border-collapse:collapse;
border-spacing:0;
}
-fieldset,img {
+fieldset,img {
border:0;
}
address,caption,cite,code,dfn,em,strong,th,var {
diff --git a/admin/js/colorpicker/js/colorpicker.js b/admin/js/colorpicker/js/colorpicker.js
index 0a781554..a165f152 100755
--- a/admin/js/colorpicker/js/colorpicker.js
+++ b/admin/js/colorpicker/js/colorpicker.js
@@ -2,9 +2,9 @@
*
* Color picker
* Author: Stefan Petre www.eyecon.ro
- *
+ *
* Dual licensed under the MIT and GPL licenses
- *
+ *
*/
(function ($) {
var plColorPicker = function () {
@@ -112,7 +112,7 @@
y: ev.pageY,
field: field,
val: parseInt(field.val(), 10),
- preview: $(this).parent().parent().data('colorpicker').livePreview
+ preview: $(this).parent().parent().data('colorpicker').livePreview
};
$(document).bind('mouseup', current, upIncrement);
$(document).bind('mousemove', current, moveIncrement);
@@ -263,7 +263,7 @@
s: Math.min(100, Math.max(0, hsb.s)),
b: Math.min(100, Math.max(0, hsb.b))
};
- },
+ },
fixRGB = function (rgb) {
return {
r: Math.min(255, Math.max(0, rgb.r)),
@@ -282,7 +282,7 @@
hex = o.join('');
}
return hex;
- },
+ },
HexToRGB = function (hex) {
var hex = parseInt(((hex.indexOf('#') > -1) ? hex.substring(1) : hex), 16);
return {r: hex >> 16, g: (hex & 0x00FF00) >> 8, b: (hex & 0x0000FF)};
@@ -301,7 +301,7 @@
var delta = max - min;
hsb.b = max;
if (max != 0) {
-
+
}
hsb.s = max != 0 ? 255 * delta / max : 0;
if (hsb.s != 0) {
diff --git a/admin/js/colorpicker/js/eye.js b/admin/js/colorpicker/js/eye.js
index ea70e643..521582c4 100755
--- a/admin/js/colorpicker/js/eye.js
+++ b/admin/js/colorpicker/js/eye.js
@@ -2,7 +2,7 @@
*
* Zoomimage
* Author: Stefan Petre www.eyecon.ro
- *
+ *
*/
(function($){
var EYE = window.EYE = function() {
diff --git a/admin/js/colorpicker/js/layout.js b/admin/js/colorpicker/js/layout.js
index e0dfb8f3..c7a0aab2 100755
--- a/admin/js/colorpicker/js/layout.js
+++ b/admin/js/colorpicker/js/layout.js
@@ -49,7 +49,7 @@
}
});
};
-
+
var showTab = function(e) {
var tabIndex = $('ul.navigationTabs a')
.removeClass('active')
@@ -62,6 +62,6 @@
.eq(tabIndex)
.show();
};
-
+
EYE.register(initLayout, 'init');
})(jQuery)
\ No newline at end of file
diff --git a/admin/js/colorpicker/js/utils.js b/admin/js/colorpicker/js/utils.js
index cc7ce14e..144abd49 100755
--- a/admin/js/colorpicker/js/utils.js
+++ b/admin/js/colorpicker/js/utils.js
@@ -2,7 +2,7 @@
*
* Utilities
* Author: Stefan Petre www.eyecon.ro
- *
+ *
*/
(function($) {
EYE.extend({
@@ -41,7 +41,7 @@ EYE.extend({
y -= document.body.offsetTop;
}
el = e.parentNode;
- while (el && el.tagName.toUpperCase() != 'BODY' && el.tagName.toUpperCase() != 'HTML')
+ while (el && el.tagName.toUpperCase() != 'BODY' && el.tagName.toUpperCase() != 'HTML')
{
if (jQuery.curCSS(el, 'display') != 'inline') {
x -= el.scrollLeft;
@@ -248,5 +248,5 @@ if (!$.easing.easeout) {
return -delta * ((n=n/duration-1)*n*n*n - 1) + firstNum;
};
}
-
+
})(jQuery);
\ No newline at end of file
diff --git a/admin/js/jquery.ajaxupload.js b/admin/js/jquery.ajaxupload.js
index a61f5ea6..4a7b55d0 100644
--- a/admin/js/jquery.ajaxupload.js
+++ b/admin/js/jquery.ajaxupload.js
@@ -1,22 +1,22 @@
/**
- * AJAX Upload ( http://valums.com/ajax-upload/ )
+ * AJAX Upload ( http://valums.com/ajax-upload/ )
* Copyright (c) Andris Valums
* Licensed under the MIT license ( http://valums.com/mit-license/ )
- * Thanks to Gary Haran, David Mark, Corey Burns and others for contributions.
+ * Thanks to Gary Haran, David Mark, Corey Burns and others for contributions.
*/
(function () {
/* global window */
/* jslint browser: true, devel: true, undef: true, nomen: true, bitwise: true, regexp: true, newcap: true, immed: true */
-
+
/**
* Wrapper for FireBug's console.log
*/
function log(){
- if (typeof(console) != 'undefined' && typeof(console.log) == 'function'){
+ if (typeof(console) != 'undefined' && typeof(console.log) == 'function'){
Array.prototype.unshift.call(arguments, '[Ajax Upload]');
console.log( Array.prototype.join.call(arguments, ' '));
}
- }
+ }
/**
* Attaches event to a dom element.
@@ -34,30 +34,30 @@
} else {
throw new Error('not supported or DOM not loaded');
}
- }
-
+ }
+
/**
* Attaches resize event to a window, limiting
* number of event fired. Fires only when encounteres
* delay of 100 after series of events.
- *
+ *
* Some browsers fire event multiple times when resizing
* http://www.quirksmode.org/dom/events/resize.html
- *
+ *
* @param fn callback This refers to the passed element
*/
function addResizeEvent(fn){
var timeout;
-
+
addEvent(window, 'resize', function(){
if (timeout){
clearTimeout(timeout);
}
- timeout = setTimeout(fn, 100);
+ timeout = setTimeout(fn, 100);
});
- }
-
- // Needs more testing, will be rewriten for next version
+ }
+
+ // Needs more testing, will be rewriten for next version
// getOffset function copied from jQuery lib (http://jquery.com/)
if (document.documentElement.getBoundingClientRect){
// Get Offset using getBoundingClientRect
@@ -66,32 +66,32 @@
var box = el.getBoundingClientRect();
var doc = el.ownerDocument;
var body = doc.body;
- var docElem = doc.documentElement; // for ie
+ var docElem = doc.documentElement; // for ie
var clientTop = docElem.clientTop || body.clientTop || 0;
var clientLeft = docElem.clientLeft || body.clientLeft || 0;
-
+
// In Internet Explorer 7 getBoundingClientRect property is treated as physical,
- // while others are logical. Make all logical, like in IE8.
- var zoom = 1;
+ // while others are logical. Make all logical, like in IE8.
+ var zoom = 1;
if (body.getBoundingClientRect) {
var bound = body.getBoundingClientRect();
zoom = (bound.right - bound.left) / body.clientWidth;
}
-
+
if (zoom > 1) {
clientTop = 0;
clientLeft = 0;
}
-
+
var top = box.top / zoom + (window.pageYOffset || docElem && docElem.scrollTop / zoom || body.scrollTop / zoom) - clientTop, left = box.left / zoom + (window.pageXOffset || docElem && docElem.scrollLeft / zoom || body.scrollLeft / zoom) - clientLeft;
-
+
return {
top: top,
left: left
};
- };
+ };
} else {
- // Get offset adding all offsets
+ // Get offset adding all offsets
var getOffset = function(el){
var top = 0, left = 0;
do {
@@ -99,14 +99,14 @@
left += el.offsetLeft || 0;
el = el.offsetParent;
} while (el);
-
+
return {
left: left,
top: top
};
};
}
-
+
/**
* Returns left, top, right and bottom properties describing the border-box,
* in pixels, with the top-left relative to the body
@@ -118,10 +118,10 @@
var offset = getOffset(el);
left = offset.left;
top = offset.top;
-
+
right = left + el.offsetWidth;
bottom = top + el.offsetHeight;
-
+
return {
left: left,
right: right,
@@ -129,7 +129,7 @@
bottom: bottom
};
}
-
+
/**
* Helper that takes object literal
* and add all properties to element.style
@@ -143,24 +143,24 @@
}
}
}
-
+
/**
* Function places an absolutely positioned
* element on top of the specified element
* copying position and dimentions.
* @param {Element} from
* @param {Element} to
- */
+ */
function copyLayout(from, to){
var box = getBox(from);
-
+
addStyles(to, {
- position: 'absolute',
+ position: 'absolute',
left : box.left + 'px',
top : box.top + 'px',
width : from.offsetWidth + 'px',
height : from.offsetHeight + 'px'
- });
+ });
}
/**
@@ -175,50 +175,50 @@
return div.removeChild(el);
};
})();
-
+
/**
* Function generates unique id
- * @return unique id
+ * @return unique id
*/
var getUID = (function(){
var id = 0;
return function(){
return 'ValumsAjaxUpload' + id++;
};
- })();
-
+ })();
+
/**
* Get file name from path
* @param {String} file path to file
* @return filename
- */
+ */
function fileFromPath(file){
return file.replace(/.*(\/|\\)/, "");
}
-
+
/**
* Get file extension lowercase
* @param {String} file name
* @return file extenstion
- */
+ */
function getExt(file){
return (-1 !== file.indexOf('.')) ? file.replace(/.*[.]/, '') : '';
}
- function hasClass(el, name){
- var re = new RegExp('\\b' + name + '\\b');
+ function hasClass(el, name){
+ var re = new RegExp('\\b' + name + '\\b');
return re.test(el.className);
- }
+ }
function addClass(el, name){
- if ( ! hasClass(el, name)){
+ if ( ! hasClass(el, name)){
el.className += ' ' + name;
}
- }
+ }
function removeClass(el, name){
- var re = new RegExp('\\b' + name + '\\b');
- el.className = el.className.replace(re, '');
+ var re = new RegExp('\\b' + name + '\\b');
+ el.className = el.className.replace(re, '');
}
-
+
function removeNode(el){
el.parentNode.removeChild(el);
}
@@ -226,7 +226,7 @@
/**
* Easy styling and uploading
* @constructor
- * @param button An element you want convert to
+ * @param button An element you want convert to
* upload button. Tested dimentions up to 500x500px
* @param {Object} options See defaults below.
*/
@@ -243,16 +243,16 @@
// The type of data that you're expecting back from the server.
// html and xml are detected automatically.
// Only useful when you are using json data as a response.
- // Set to "json" in that case.
+ // Set to "json" in that case.
responseType: false,
// Class applied to button when mouse is hovered
hoverClass: 'hover',
// Class applied to button when button is focused
focusClass: 'focus',
// Class applied to button when AU is disabled
- disabledClass: 'disabled',
+ disabledClass: 'disabled',
// When user selects a file, useful with autoSubmit disabled
- // You can return false to cancel upload
+ // You can return false to cancel upload
onChange: function(file, extension){
},
// Callback to fire before file is uploaded
@@ -264,33 +264,33 @@
onComplete: function(file, response){
}
};
-
+
// Merge the users options with our defaults
for (var i in options) {
if (options.hasOwnProperty(i)){
this._settings[i] = options[i];
}
}
-
+
// button isn't necessary a dom element
if (button.jquery){
// jQuery object was passed
button = button[0];
} else if (typeof button == "string") {
if (/^#.*/.test(button)){
- // If jQuery user passes #elementId don't break it
- button = button.slice(1);
+ // If jQuery user passes #elementId don't break it
+ button = button.slice(1);
}
-
+
button = document.getElementById(button);
}
-
+
if ( ! button || button.nodeType !== 1){
- throw new Error("Please make sure that you're passing a valid element");
+ throw new Error("Please make sure that you're passing a valid element");
}
-
+
if ( button.nodeName.toUpperCase() == 'A'){
- // disable link
+ // disable link
addEvent(button, 'click', function(e){
if (e && e.preventDefault){
e.preventDefault();
@@ -299,40 +299,40 @@
}
});
}
-
+
+ // DOM element
+ this._button = button;
// DOM element
- this._button = button;
- // DOM element
this._input = null;
// If disabled clicking on button won't do anything
this._disabled = false;
-
+
// if the button was disabled before refresh if will remain
// disabled in FireFox, let's fix it
- this.enable();
-
+ this.enable();
+
this._rerouteClicks();
};
-
+
// assigning methods to our class
AjaxUpload.prototype = {
setData: function(data){
this._settings.data = data;
},
- disable: function(){
+ disable: function(){
addClass(this._button, this._settings.disabledClass);
this._disabled = true;
-
- var nodeName = this._button.nodeName.toUpperCase();
+
+ var nodeName = this._button.nodeName.toUpperCase();
if (nodeName == 'INPUT' || nodeName == 'BUTTON'){
this._button.setAttribute('disabled', 'disabled');
- }
-
+ }
+
// hide input
if (this._input){
// We use visibility instead of display to fix problem with Safari 4
- // The problem is that the value of input doesn't change if it
- // has display none when user selects a file
+ // The problem is that the value of input doesn't change if it
+ // has display none when user selects a file
this._input.parentNode.style.visibility = 'hidden';
}
},
@@ -340,20 +340,20 @@
removeClass(this._button, this._settings.disabledClass);
this._button.removeAttribute('disabled');
this._disabled = false;
-
+
},
/**
- * Creates invisible file input
+ * Creates invisible file input
* that will hover above the button
*
*/
- _createInput: function(){
+ _createInput: function(){
var self = this;
-
+
var input = document.createElement("input");
input.setAttribute('type', 'file');
input.setAttribute('name', this._settings.name);
-
+
addStyles(input, {
'position' : 'absolute',
// in Opera only 'browse' button
@@ -367,15 +367,15 @@
// 'inherit' the input doesn't work
'fontFamily' : 'sans-serif',
'cursor' : 'pointer'
- });
+ });
- var div = document.createElement("div");
+ var div = document.createElement("div");
addStyles(div, {
'display' : 'block',
'position' : 'absolute',
'overflow' : 'hidden',
'margin' : 0,
- 'padding' : 0,
+ 'padding' : 0,
'opacity' : 0,
// Make sure browse button is in the right side
// in Internet Explorer
@@ -383,77 +383,77 @@
//Max zIndex supported by Opera 9.0-9.2
'zIndex': 2147483583
});
-
+
// Make sure that element opacity exists.
- // Otherwise use IE filter
+ // Otherwise use IE filter
if ( div.style.opacity !== "0") {
if (typeof(div.filters) == 'undefined'){
throw new Error('Opacity not supported by the browser');
}
div.style.filter = "alpha(opacity=0)";
- }
-
+ }
+
addEvent(input, 'change', function(){
-
- if ( ! input || input.value === ''){
- return;
+
+ if ( ! input || input.value === ''){
+ return;
}
-
- // Get filename from input, required
- // as some browsers have path instead of it
+
+ // Get filename from input, required
+ // as some browsers have path instead of it
var file = fileFromPath(input.value);
-
+
if (false === self._settings.onChange.call(self, file, getExt(file))){
- self._clearInput();
+ self._clearInput();
return;
}
-
+
// Submit form when value is changed
if (self._settings.autoSubmit) {
self.submit();
}
- });
+ });
addEvent(input, 'mouseover', function(){
addClass(self._button, self._settings.hoverClass);
});
-
+
addEvent(input, 'mouseout', function(){
removeClass(self._button, self._settings.hoverClass);
removeClass(self._button, self._settings.focusClass);
-
+
// We use visibility instead of display to fix problem with Safari 4
- // The problem is that the value of input doesn't change if it
- // has display none when user selects a file
+ // The problem is that the value of input doesn't change if it
+ // has display none when user selects a file
// input.parentNode.css('background', 'blue')
if(input.parentNode)
input.parentNode.style.visibility = 'hidden';
- });
-
+ });
+
addEvent(input, 'focus', function(){
addClass(self._button, self._settings.focusClass);
});
-
+
addEvent(input, 'blur', function(){
removeClass(self._button, self._settings.focusClass);
});
-
+
div.appendChild(input);
document.body.appendChild(div);
-
+
this._input = input;
},
_clearInput : function(){
if (!this._input){
return;
- }
-
- // this._input.value = ''; Doesn't work in IE6
+ }
+
+ // this._input.value = ''; Doesn't work in IE6
removeNode(this._input.parentNode);
- this._input = null;
+ this._input = null;
this._createInput();
-
+
removeClass(this._button, this._settings.hoverClass);
removeClass(this._button, this._settings.focusClass);
},
@@ -463,7 +463,7 @@
*/
_rerouteClicks: function(){
var self = this;
-
+
// IE will later display 'access denied' error
// if you use using self._input.click()
// other browsers just ignore click()
@@ -472,21 +472,21 @@
if (self._disabled){
return;
}
-
+
if ( ! self._input){
self._createInput();
}
-
- var div = self._input.parentNode;
+
+ var div = self._input.parentNode;
copyLayout(self._button, div);
div.style.visibility = 'visible';
-
+
});
-
-
+
+
// commented because we now hide input on mouseleave
/**
- * When the window is resized the elements
+ * When the window is resized the elements
* can be misaligned if button position depends
* on window size
*/
@@ -494,8 +494,8 @@
// if (self._input){
// copyLayout(self._button, self._input.parentNode);
// }
- //});
-
+ //});
+
},
/**
* Creates iframe with unique name
@@ -504,24 +504,24 @@
_createIframe: function(){
// We can't use getTime, because it sometimes return
// same value in safari :(
- var id = getUID();
-
+ var id = getUID();
+
// We can't use following code as the name attribute
// won't be properly registered in IE6, and new window
// on form submit will open
// var iframe = document.createElement('iframe');
- // iframe.setAttribute('name', id);
-
+ // iframe.setAttribute('name', id);
+
var iframe = toElement('');
// src="javascript:false; was added
- // because it possibly removes ie6 prompt
+ // because it possibly removes ie6 prompt
// "This page contains both secure and nonsecure items"
- // Anyway, it doesn't do any harm.
+ // Anyway, it doesn't do any harm.
iframe.setAttribute('id', id);
-
+
iframe.style.display = 'none';
document.body.appendChild(iframe);
-
+
return iframe;
},
/**
@@ -531,19 +531,19 @@
*/
_createForm: function(iframe){
var settings = this._settings;
-
+
// We can't use the following code in IE6
// var form = document.createElement('form');
// form.setAttribute('method', 'post');
// form.setAttribute('enctype', 'multipart/form-data');
- // Because in this case file won't be attached to request
+ // Because in this case file won't be attached to request
var form = toElement('');
-
+
form.setAttribute('action', settings.action);
- form.setAttribute('target', iframe.name);
+ form.setAttribute('target', iframe.name);
form.style.display = 'none';
document.body.appendChild(form);
-
+
// Create hidden input element for each data key
for (var prop in settings.data) {
if (settings.data.hasOwnProperty(prop)){
@@ -559,34 +559,34 @@
/**
* Gets response from iframe and fires onComplete event when ready
* @param iframe
- * @param file Filename to use in onComplete callback
+ * @param file Filename to use in onComplete callback
*/
- _getResponse : function(iframe, file){
+ _getResponse : function(iframe, file){
// getting response
- var toDeleteFlag = false, self = this, settings = this._settings;
-
- addEvent(iframe, 'load', function(){
-
- if (// For Safari
+ var toDeleteFlag = false, self = this, settings = this._settings;
+
+ addEvent(iframe, 'load', function(){
+
+ if (// For Safari
iframe.src == "javascript:'%3Chtml%3E%3C/html%3E';" ||
// For FF, IE
- iframe.src == "javascript:'';"){
+ iframe.src == "javascript:'';"){
// First time around, do not delete.
// We reload to blank page, so that reloading main page
// does not re-submit the post.
-
+
if (toDeleteFlag) {
// Fix busy state in FF3
setTimeout(function(){
removeNode(iframe);
}, 0);
}
-
+
return;
}
-
+
var doc = iframe.contentDocument ? iframe.contentDocument : window.frames[iframe.id].document;
-
+
// fixing Opera 9.26,10.00
if (doc.readyState && doc.readyState != 'complete') {
// Opera fires load event multiple times
@@ -594,24 +594,24 @@
// this fix should not affect other browsers
return;
}
-
+
// fixing Opera 9.64
if (doc.body && doc.body.innerHTML == "false") {
// In Opera 9.64 event was fired second time
- // when body.innerHTML changed from false
+ // when body.innerHTML changed from false
// to server response approx. after 1 sec
return;
}
-
+
var response;
-
+
if (doc.XMLDocument) {
// response is a xml document Internet Explorer property
response = doc.XMLDocument;
} else if (doc.body){
// response is html document or plain text
response = doc.body.innerHTML;
-
+
if (settings.responseType && settings.responseType.toLowerCase() == 'json') {
// If the document was sent as 'application/javascript' or
// 'text/javascript', then the browser wraps the text in a
@@ -623,7 +623,7 @@
doc.normalize();
response = doc.body.firstChild.firstChild.nodeValue;
}
-
+
if (response) {
response = eval("(" + response + ")");
} else {
@@ -634,59 +634,59 @@
// response is a xml document
response = doc;
}
-
+
settings.onComplete.call(self, file, response);
-
+
// Reload blank page, so that reloading main page
// does not re-submit the post. Also, remember to
// delete the frame
toDeleteFlag = true;
-
+
// Fix IE mixed content issue
iframe.src = "javascript:'';";
- });
- },
+ });
+ },
/**
* Upload file contained in this._input
*/
- submit: function(){
+ submit: function(){
var self = this, settings = this._settings;
-
- if ( ! this._input || this._input.value === ''){
- return;
+
+ if ( ! this._input || this._input.value === ''){
+ return;
}
-
+
var file = fileFromPath(this._input.value);
-
+
// user returned false to cancel upload
if (false === settings.onSubmit.call(this, file, getExt(file))){
- this._clearInput();
+ this._clearInput();
return;
}
-
- // sending request
+
+ // sending request
var iframe = this._createIframe();
var form = this._createForm(iframe);
-
+
// assuming following structure
// div -> input type='file'
- removeNode(this._input.parentNode);
+ removeNode(this._input.parentNode);
removeClass(self._button, self._settings.hoverClass);
removeClass(self._button, self._settings.focusClass);
-
+
form.appendChild(this._input);
-
+
form.submit();
- // request set, clean up
- removeNode(form); form = null;
- removeNode(this._input); this._input = null;
-
+ // request set, clean up
+ removeNode(form); form = null;
+ removeNode(this._input); this._input = null;
+
// Get response from iframe and fire onComplete event when ready
- this._getResponse(iframe, file);
+ this._getResponse(iframe, file);
- // get ready for next request
+ // get ready for next request
this._createInput();
}
};
-})();
+})();
diff --git a/admin/js/jquery.effects.js b/admin/js/jquery.effects.js
index ebb33e0c..6816aca7 100644
--- a/admin/js/jquery.effects.js
+++ b/admin/js/jquery.effects.js
@@ -1306,7 +1306,7 @@ $.effects.effect.highlight = function( o, done ) {
}
$.effects.save( elem, props );
-
+
elem
.show()
.css({
diff --git a/admin/js/jquery.ui.draggable.js b/admin/js/jquery.ui.draggable.js
index b693dcca..a12fcc39 100755
--- a/admin/js/jquery.ui.draggable.js
+++ b/admin/js/jquery.ui.draggable.js
@@ -73,7 +73,7 @@ $.widget("ui.draggable", $.ui.mouse, {
this.handle = this._getHandle(event);
if (!this.handle)
return false;
-
+
$(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() {
$('
')
.css({
@@ -157,12 +157,12 @@ $.widget("ui.draggable", $.ui.mouse, {
if ($.ui.ddmanager && !o.dropBehaviour)
$.ui.ddmanager.prepareOffsets(this, event);
-
+
this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
-
+
//If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003)
if ( $.ui.ddmanager ) $.ui.ddmanager.dragStart(this, event);
-
+
return true;
},
@@ -201,7 +201,7 @@ $.widget("ui.draggable", $.ui.mouse, {
dropped = this.dropped;
this.dropped = false;
}
-
+
//if the original element is no longer in the DOM don't bother to continue (see #8269)
var element = this.element[0], elementInDom = false;
while ( element && (element = element.parentNode) ) {
@@ -227,30 +227,30 @@ $.widget("ui.draggable", $.ui.mouse, {
return false;
},
-
+
_mouseUp: function(event) {
if (this.options.iframeFix === true) {
- $("div.ui-draggable-iframeFix").each(function() {
- this.parentNode.removeChild(this);
+ $("div.ui-draggable-iframeFix").each(function() {
+ this.parentNode.removeChild(this);
}); //Remove frame helpers
}
-
+
//If the ddmanager is used for droppables, inform the manager that dragging has stopped (see #5003)
if( $.ui.ddmanager ) $.ui.ddmanager.dragStop(this, event);
-
+
return $.ui.mouse.prototype._mouseUp.call(this, event);
},
-
+
cancel: function() {
-
+
if(this.helper.is(".ui-draggable-dragging")) {
this._mouseUp({});
} else {
this._clear();
}
-
+
return this;
-
+
},
_getHandle: function(event) {
@@ -571,12 +571,12 @@ $.ui.plugin.add("draggable", "connectToSortable", {
};
$.each(inst.sortables, function(i) {
-
+
//Copy over some variables to allow calling the sortable's native _intersectsWith
this.instance.positionAbs = inst.positionAbs;
this.instance.helperProportions = inst.helperProportions;
this.instance.offset.click = inst.offset.click;
-
+
if(this.instance._intersectsWith(this.instance.containerCache)) {
//If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once
@@ -619,13 +619,13 @@ $.ui.plugin.add("draggable", "connectToSortable", {
this.instance.isOver = 0;
this.instance.cancelHelperRemoval = true;
-
+
//Prevent reverting on this forced stop
this.instance.options.revert = false;
-
+
// The out event needs to be triggered independently
this.instance._trigger('out', event, this.instance._uiHash(this.instance));
-
+
this.instance._mouseStop(event, true);
this.instance.options.helper = this.instance.options._helper;
@@ -795,7 +795,7 @@ $.ui.plugin.add("draggable", "stack", {
return (parseInt($(a).css("zIndex"),10) || 0) - (parseInt($(b).css("zIndex"),10) || 0);
});
if (!group.length) { return; }
-
+
var min = parseInt(group[0].style.zIndex) || 0;
$(group).each(function(i) {
this.style.zIndex = min + i;
diff --git a/admin/js/jquery.ui.effect-highlight.js b/admin/js/jquery.ui.effect-highlight.js
index 2ae5729d..54a32772 100755
--- a/admin/js/jquery.ui.effect-highlight.js
+++ b/admin/js/jquery.ui.effect-highlight.js
@@ -26,7 +26,7 @@ $.effects.effect.highlight = function( o, done ) {
}
$.effects.save( elem, props );
-
+
elem
.show()
.css({
diff --git a/admin/js/jquery.ui.mouse.js b/admin/js/jquery.ui.mouse.js
index a08566b9..53b76c46 100755
--- a/admin/js/jquery.ui.mouse.js
+++ b/admin/js/jquery.ui.mouse.js
@@ -104,7 +104,7 @@ $.widget("ui.mouse", {
.bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
event.preventDefault();
-
+
mouseHandled = true;
return true;
},
diff --git a/admin/js/jquery.ui.resizable.js b/admin/js/jquery.ui.resizable.js
index 584f3a23..fe708fa2 100755
--- a/admin/js/jquery.ui.resizable.js
+++ b/admin/js/jquery.ui.resizable.js
@@ -575,7 +575,7 @@ $.ui.plugin.add("resizable", "alsoResize", {
_alsoResize = function (exp, c) {
$(exp).each(function() {
- var el = $(this), start = $(this).data("resizable-alsoresize"), style = {},
+ var el = $(this), start = $(this).data("resizable-alsoresize"), style = {},
css = c && c.length ? c : el.parents(ui.originalElement[0]).length ? ['width', 'height'] : ['width', 'height', 'top', 'left'];
$.each(css, function (i, prop) {
diff --git a/admin/js/script.common.js b/admin/js/script.common.js
index bf0d8d30..283e98fc 100644
--- a/admin/js/script.common.js
+++ b/admin/js/script.common.js
@@ -12,8 +12,8 @@
*
*/
jQuery(document).ready(function(){
-
- jQuery('.sc_save_check').click( function(){
+
+ jQuery('.sc_save_check').click( function(){
var sectionBar = jQuery(this).parents('li').find('div.section-bar').each( function() {
if( jQuery(this).hasClass('hidden-section') ) {
jQuery(this).removeClass('hidden-section');
@@ -21,31 +21,31 @@ jQuery(document).ready(function(){
jQuery(this).addClass('hidden-section');
}
});
-
+
formData = jQuery("#pagelines-settings-form");
serializedData = jQuery(formData).serialize();
-
+
jQuery.ajax({
type: 'POST',
url: 'options.php',
data: serializedData,
- beforeSend: function(){
+ beforeSend: function(){
TemplateSetupStartSave();
},
success: function(response) {
TemplateSetupDoneSaving( 'Section Options Saved!' );
}
});
-
+
return true;
- });
-
+ });
+
/**
* Hide Error messages after 5 seconds
*/
jQuery('#message.slideup_message').delay(5000).slideUp('fast');
-
-
+
+
/**
* Textarea CODE
*/
@@ -57,13 +57,13 @@ jQuery(document).ready(function(){
if(jQuery("#pagelines-settings-two_headerscripts").length){
var editor2 = CodeMirror.fromTextArea(jQuery("#pagelines-settings-two_headerscripts").get(0), cm_headers);
}
-
-
+
+
jQuery('.graphic_selector .graphic_select_border').click(function(){
GraphicSelect(this);
});
-
-
+
+
/**
* AJAX Image Uploading
*/
@@ -80,27 +80,27 @@ jQuery(document).ready(function(){
data: { // Additional data to send
action: 'pagelines_ajax_post_action',
type: 'upload',
- oid: clickedID,
+ oid: clickedID,
setting: settingID
},
autoSubmit: true, // Submit file after selection
responseType: false,
onChange: function(file, extension){},
onSubmit: function(file, extension){
- clickedObject.text('Uploading'); // change button text, when user selects file
+ clickedObject.text('Uploading'); // change button text, when user selects file
this.disable(); // If you want to allow uploading only 1 file at time, you can disable upload button
interval = window.setInterval(function(){
var text = clickedObject.text();
if (text.length < 13){ clickedObject.text(text + '.'); }
- else { clickedObject.text('Uploading'); }
+ else { clickedObject.text('Uploading'); }
}, 200);
},
onComplete: function(file, response) {
//alert(response); // Debugging
window.clearInterval(interval);
- clickedObject.text('Upload Image');
+ clickedObject.text('Upload Image');
this.enable(); // enable upload button
-
+
// If there was an error
if(response.search('Upload Error') > -1){
var buildReturn = '' + response + ' ';
@@ -111,19 +111,19 @@ jQuery(document).ready(function(){
else{
var previewSize = clickedObject.parent().find('.image_preview_size').attr('value');
-
+
var preSelector = 'pre_' + clickedObject.parent().find('.uploaded_url').attr('id');
-
+
var buildReturn = ' ';
clickedObject.parent().find('.uploaded_url').val(response);
jQuery(".upload-error").remove();
- jQuery("#image_" + clickedID).remove();
+ jQuery("#image_" + clickedID).remove();
clickedObject.parent().after( buildReturn );
jQuery('img#image_' + clickedID).fadeIn();
clickedObject.next('span').fadeIn();
-
+
}
}
});
@@ -136,9 +136,9 @@ jQuery(document).ready(function(){
jQuery('.image_reset_button').click(function(){
var clickedObject = jQuery(this);
- var theID = jQuery(this).attr('title');
+ var theID = jQuery(this).attr('title');
var settingID = jQuery(this).attr('id');
-
+
var actionURL = jQuery(this).parent().find('.ajax_action_url').val();
var ajax_url = actionURL;
@@ -146,7 +146,7 @@ jQuery(document).ready(function(){
var data = {
action: 'pagelines_ajax_post_action',
type: 'image_reset',
- oid: theID,
+ oid: theID,
setting: settingID
};
@@ -155,10 +155,10 @@ jQuery(document).ready(function(){
var button_to_hide = jQuery('.reset_' + theID);
image_to_remove.fadeOut(500,function(){ jQuery(this).remove(); });
button_to_hide.fadeOut();
- clickedObject.parent().find('.uploaded_url').val('');
+ clickedObject.parent().find('.uploaded_url').val('');
});
- return false;
+ return false;
});
@@ -181,7 +181,7 @@ function TemplateSetupStartSave(){
*
*/
function TemplateSetupDoneSaving( text ){
- jQuery('.selected_builder .ttitle').effect("highlight", {color: "#ddd"}, 2000);
+ jQuery('.selected_builder .ttitle').effect("highlight", {color: "#ddd"}, 2000);
jQuery('.selected_builder .confirm_save').removeClass('ajax-saving');
jQuery('.selected_builder .confirm_save_pad').text( text ).show().delay(1500).fadeOut(700);
}
@@ -191,31 +191,31 @@ function TemplateSetupDoneSaving( text ){
* Creates a preview of a font in admin
*/
function PageLinesStyleFont(element, property){
-
+
var currentSelect = jQuery(element).attr("id");
-
+
var selectedOption = '#'+currentSelect +' option:selected';
if(jQuery(element).hasClass("fontselector")) {
-
+
var previewProp = jQuery(selectedOption).attr("id");
-
+
var gFontKey = jQuery('#'+currentSelect +' option:selected').attr("title");
var gFontBase = 'http://fonts.googleapis.com/css?family=';
-
+
var stylesheetId = '#' + currentSelect + '_style';
-
+
jQuery(stylesheetId).attr("href", gFontBase + gFontKey);
} else {
-
+
var previewProp = jQuery(selectedOption).val();
-
+
}
-
+
jQuery(element).parent().parent().parent().find('.font_preview_pad').css(property, previewProp);
-
-
+
+
}
/**
@@ -223,13 +223,13 @@ function PageLinesStyleFont(element, property){
* Changes input val based on image click....
*/
function GraphicSelect ( ClickedLayout ){
-
+
if( !jQuery(ClickedLayout).hasClass('disabled_option') ){
-
+
jQuery(ClickedLayout).parent().parent().find('.graphic_select_border').removeClass('selectedgraphic');
jQuery(ClickedLayout).addClass('selectedgraphic');
jQuery(ClickedLayout).parent().find('.graphic_select_input').attr("checked", "checked");
-
+
}
}
@@ -241,9 +241,9 @@ function GraphicSelect ( ClickedLayout ){
* ###########################
*/
function setColorPicker(optionid, color){
-
- jQuery('#'+optionid+'_picker').children('div').css('backgroundColor', color);
-
+
+ jQuery('#'+optionid+'_picker').children('div').css('backgroundColor', color);
+
jQuery('#'+optionid+'_picker').plColorPicker({
color: color,
onShow: function (colpkr) {
@@ -258,9 +258,9 @@ function setColorPicker(optionid, color){
jQuery('#'+optionid+'_picker').children('div').css('backgroundColor', '#'+hex);
jQuery('#'+optionid+'_picker').next('input').attr('value', '#'+hex);
},
-
+
});
-
+
jQuery('#'+optionid).plColorPicker({
color: color,
onSubmit: function(hsb, hex, rgb, el) {
@@ -274,7 +274,7 @@ function setColorPicker(optionid, color){
onChange: function (hsb, hex, rgb) {
jQuery( '#'+optionid ).attr('value', '#'+hex);
jQuery(this).parent().find('#'+optionid+'_picker').children('div').css('backgroundColor', '#'+hex);
-
+
},
})
.bind('keyup', function(){
@@ -284,7 +284,7 @@ function setColorPicker(optionid, color){
}
jQuery(this).ColorPickerSetColor( str );
});
-
+
}
@@ -294,19 +294,19 @@ function setColorPicker(optionid, color){
*
*/
function PageLinesSimpleToggle(showElement, hideElement){
-
+
jQuery(hideElement).hide();
jQuery(hideElement+'_button').removeClass('active_button');
-
+
if( jQuery(showElement).is(':visible')) {
jQuery(showElement).fadeOut();
jQuery(showElement+'_button').removeClass('active_button');
} else {
jQuery(showElement+'_button').addClass('active_button');
jQuery(showElement).fadeIn();
-
+
}
-
+
}
@@ -327,31 +327,31 @@ function animate_pl_button(){
*
*/
function PageLinesSlideToggle(toggle_element, toggle_input, text_element, show_text, hide_text, option){
- var opt_value;
+ var opt_value;
var input_flag;
-
+
if(jQuery(toggle_input).val() == 'show'){
input_flag = 'hide';
jQuery(toggle_input).val(input_flag);
jQuery(toggle_element).fadeOut();
-
+
opt_value = input_flag;
-
+
jQuery(text_element).html(hide_text);
-
+
jQuery(toggle_element).css('display', 'none');
} else {
input_flag = 'show';
-
+
jQuery(toggle_input).val(input_flag);
jQuery(toggle_element).fadeIn();
-
+
opt_value = input_flag;
jQuery(text_element).html(show_text);
-
+
jQuery(toggle_element).css('display', 'block');
}
-
+
var data = {
action: 'pagelines_ajax_save_option',
option_name: option,
@@ -360,7 +360,7 @@ function PageLinesSlideToggle(toggle_element, toggle_input, text_element, show_t
// since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
jQuery.post(ajaxurl, data, function(response) { });
-
+
}
/*
@@ -377,7 +377,7 @@ function PageLinesSlideToggle(toggle_element, toggle_input, text_element, show_t
*/
function sendEmailToMothership( email, input_id ){
// validate that shit
-
+
jQuery('.the_email_response').html('');
jQuery(".the_email_response").hide();
var hasError = false;
@@ -387,21 +387,21 @@ function sendEmailToMothership( email, input_id ){
jQuery(".the_email_response").html('You\'re silly... The email field is blank! ').show().delay(2000).slideUp();
hasError = true;
}
-
+
else if(!emailReg.test(email)) {
jQuery(".the_email_response").html('Hmm... doesn\'t seem like a valid email! ').show().delay(2000).slideUp();
hasError = true;
}
-
+
if(hasError == true) { return false; }
-
+
var data = {
email: email
};
-
-
+
+
var option_name = 'pagelines_email_sent';
-
+
jQuery.ajax({
type: 'GET',
url: "http://api.pagelines.com/subscribe/index.php?",
@@ -410,7 +410,7 @@ function sendEmailToMothership( email, input_id ){
success: function(response) {
if(response == 1){
jQuery(".the_email_response").html('Email Sent!').show().delay(2000).slideUp();
-
+
var data = {
action: 'pagelines_ajax_save_option',
option_name: option_name,
@@ -425,17 +425,17 @@ function sendEmailToMothership( email, input_id ){
success: function(response) {
}
});
-
+
} else if(response == 0){
jQuery(".the_email_response").html('Email Already Submitted!').show().delay(2000).slideUp();
}else if(response == -1){
jQuery(".the_email_response").html('There was an error on our side. Sorry about that...').show().delay(2000).slideUp();
- }
-
-
+ }
+
+
}
});
-
+
}
@@ -446,7 +446,7 @@ function sendEmailToMothership( email, input_id ){
*/
jQuery.fn.center = function ( relative_element ) {
-
+
this.css("position","absolute");
this.css("top", ( jQuery(window).height() - this.height() ) / 4+jQuery(window).scrollTop() + "px");
this.css("left", ( jQuery(relative_element).width() - this.width() ) / 2+jQuery(relative_element).scrollLeft() + "px");
diff --git a/admin/js/script.settings.js b/admin/js/script.settings.js
index 97193b7d..0ff23613 100644
--- a/admin/js/script.settings.js
+++ b/admin/js/script.settings.js
@@ -4,47 +4,47 @@
* ###########################
*/
function setSortable( selected_builder ){
-
+
setEmpty(".selected_builder #sortable_template");
setEmpty(".selected_builder #sortable_sections.sortcolumn");
-
- jQuery(".selected_builder #sortable_template").sortable({
+
+ jQuery(".selected_builder #sortable_template").sortable({
connectWith: '.connectedSortable',
cancel: '.required-section',
-
+
items: 'li:not(.bank_title)',
receive: function(event, ui) {
-
+
jQuery(this).find('.section-controls-toggle:hidden').fadeIn();
-
+
var sectionID = jQuery(ui.item).attr("id");
-
+
handlePlace(selected_builder, sectionID);
-
+
},
update: function(event, ui) {
-
-
- saveSectionOrder( selected_builder );
- }
+
+
+ saveSectionOrder( selected_builder );
+ }
}
);
-
- jQuery(".selected_builder #sortable_sections").sortable({
+
+ jQuery(".selected_builder #sortable_sections").sortable({
connectWith: '.connectedSortable',
cancel: '.required-section',
-
+
items: 'li:not(.bank_title)',
-
- update: function() {
- setEmpty(".selected_builder #sortable_sections");
- }
+
+ update: function() {
+ setEmpty(".selected_builder #sortable_sections");
+ }
});
-
- jQuery(".selected_builder #sortable_template, .selected_builder #sortable_sections").disableSelection();
+
+ jQuery(".selected_builder #sortable_template, .selected_builder #sortable_sections").disableSelection();
}
-
-
+
+
/**
*
@@ -52,15 +52,15 @@
*
*/
function setEmpty( sortablelist ){
-
+
if( !jQuery(sortablelist).has('.section-bar').length ){
jQuery(sortablelist).addClass('nosections');
} else {
jQuery(sortablelist).removeClass('nosections');
}
-
+
}
-
+
/**
*
@@ -68,39 +68,39 @@
*
*/
function handlePlace( selected_builder, sectionID ){
-
+
var prefix = '.selected_builder #';
var newID;
-
+
var bArea = selected_builder.split('-');
var sArea = bArea[0];
var sTemplate = bArea[1];
-
+
var exp = sectionID.split('ID');
var section = exp[0];
if(sArea != 'main' && sArea != 'templates')
return;
-
+
var oArea = (sArea == 'main') ? 'templates' : 'main';
-
+
var interface_prefix = '.the_template_builder .'+oArea+'-'+sTemplate+' .template_layout #';
-
+
$unique_id = false;
$set_new_id = false;
-
+
$i = 2;
-
+
while( !$unique_id ){
-
+
if( !jQuery( interface_prefix + section ).exists() ){
-
+
$unique_id = true;
-
+
} else if( !jQuery( interface_prefix + section + 'ID' + $i ).exists() ){
-
+
$set_new_id = true;
-
+
$unique_id = true;
} else {
@@ -110,21 +110,21 @@
}
}
-
+
if($set_new_id == true){
-
+
newID = section+ 'ID' + $i;
-
+
jQuery( prefix+sectionID ).attr( 'id', newID );
jQuery( prefix+newID ).find( '.the_clone_id' ).html( '#'+$i );
-
+
}
-
-
-
+
+
+
}
-
+
/**
@@ -133,46 +133,46 @@
*
*/
function cloneSection( sectionId ){
-
+
var selected_builder = jQuery( '.selected_builder .template-slug' ).attr('id');
var prefix = '.selected_builder #';
var interface_prefix = '.the_template_builder #';
-
+
var exp = sectionId.split('ID');
var section = exp[0];
-
+
$new_clone_id = false;
$i = 2;
-
+
while( !$new_clone_id ){
-
+
if( !jQuery( interface_prefix + section + 'ID' + $i ).exists() ){
-
+
$new_clone_id = true;
-
+
} else {
-
+
$i++;
-
+
}
-
+
}
var newID = section+ 'ID' + $i;
-
+
jQuery( prefix+sectionId ).clone().hide().insertAfter( prefix+sectionId ).attr( 'id', newID );
-
+
jQuery( prefix+newID ).find( '.the_clone_id' ).html( '#'+$i );
-
+
jQuery( prefix+newID ).find( '.section-controls' ).hide();
jQuery( prefix+newID ).find( '.clone_remove' ).show();
-
+
jQuery( prefix+newID ).slideDown();
-
- saveSectionOrder( selected_builder );
-
+
+ saveSectionOrder( selected_builder );
+
}
-
+
/**
*
@@ -180,18 +180,18 @@
*
*/
function deleteSection( clicked ){
-
+
var selected_builder = jQuery( '.selected_builder .template-slug' ).attr('id');
var element = jQuery(clicked).parent().parent().parent().parent();
-
+
element.slideUp('fast').attr('id', '');
-
-
- saveSectionOrder( selected_builder );
-
+
+
+ saveSectionOrder( selected_builder );
+
}
-
+
/**
*
@@ -200,16 +200,16 @@
*/
function saveSectionOrder( selected_builder ){
var saveText = jQuery( '.selected_builder .confirm_save_pad' );
-
+
setEmpty( ".selected_builder #sortable_template" );
setEmpty(".selected_builder #sortable_sections");
-
+
var order = jQuery('.selected_builder #sortable_template').sortable('serialize');
-
+
var data = {
action: 'pagelines_save_sortable',
orderdata: order,
- template: selected_builder,
+ template: selected_builder,
field: 'sections'
};
@@ -218,7 +218,7 @@
type: 'GET',
url: ajaxurl,
data: data,
- beforeSend: function(){
+ beforeSend: function(){
TemplateSetupStartSave();
},
success: function(response) {
@@ -235,89 +235,89 @@
*/
jQuery(document).ready(function(){
-
- // Set up Default State
+
+ // Set up Default State
var subTemplateCookie = jQuery.cookie('subTemplateCookie');
var buildAreaCookie = jQuery.cookie('buildAreaCookie');
-
+
var defaultTemplate = (subTemplateCookie == null) ? 'templates-default' : subTemplateCookie;
var buildArea = (buildAreaCookie == null) ? 'ta-header' : buildAreaCookie;
//alert(subTemplateCookie);
jQuery('.sub-template-selector #'+defaultTemplate).addClass('sss-selected');
-
+
if( buildArea == 'ta-templates' )
doTemplatesSelect( defaultTemplate, 'sel-templates-sub');
else if( buildArea == 'ta-content' )
doTemplatesSelect( defaultTemplate, 'sel-content-sub');
else
doAreaSelect( buildArea );
-
+
jQuery('#'+buildArea).addClass('builder_selected_area');
-
-
-
+
+
+
// when a user clicks, highlight the area; slide up the sub selector panels (if they're open)
jQuery('.tg-format').click(function() {
-
+
if(!jQuery(this).hasClass('pro-area')) {
-
+
// For select interface selection
jQuery('.builder_selected_area').removeClass('builder_selected_area');
-
+
jQuery(this).addClass('builder_selected_area');
-
- if(!jQuery(this).hasClass('tg-templates'))
+
+ if(!jQuery(this).hasClass('tg-templates'))
jQuery('.sel-templates-sub.sub-template-selector').slideUp();
-
- if(!jQuery(this).hasClass('tg-content-templates'))
+
+ if(!jQuery(this).hasClass('tg-content-templates'))
jQuery('.sel-content-sub.sub-template-selector').slideUp();
-
+
var stemplate_id = jQuery(this).attr('id');
-
+
jQuery.cookie('buildAreaCookie', stemplate_id);
-
+
}
});
-
+
jQuery('.sss-button').click(function() {
// For select interface selection
jQuery('.sss-selected').removeClass('sss-selected');
jQuery(this).addClass('sss-selected');
-
+
var stemplate = jQuery(this).attr('id');
-
+
jQuery.cookie('subTemplateCookie', stemplate);
-
+
viewAndSort(stemplate);
});
-
+
// Load the ID of the element if it has a load build class on it
jQuery('.load-build').click(function() {
-
+
if(!jQuery(this).hasClass('pro-area')) {
var stemplate_id = jQuery(this).attr('id');
doAreaSelect(stemplate_id);
}
});
-
+
jQuery('.tg-templates').click(function() {
var selectedButton = jQuery('.sub-template-selector .sss-selected').attr('id');
-
+
var exp = selectedButton.split('-');
var stemplate = 'templates-'+exp[1];
jQuery.cookie('subTemplateCookie', stemplate);
doTemplatesSelect( stemplate, 'sel-templates-sub');
});
-
+
jQuery('.tg-content-templates').click(function() {
var selectedButton = jQuery('.sub-template-selector .sss-selected').attr('id');
-
+
var exp = selectedButton.split('-');
var stemplate = 'main-'+exp[1];
jQuery.cookie('subTemplateCookie', stemplate);
doTemplatesSelect( stemplate, 'sel-content-sub');
-
+
});
});
@@ -363,7 +363,7 @@ function viewAndSort( stemplate ){
*/
function toggleControls(button){
jQuery(button).parent().parent().next('.section-controls').slideToggle('fast');
-
+
}
/*
@@ -404,18 +404,18 @@ function toggleControls(button){
*
*/
function updateDimensions( LayoutMode, Source ) {
-
+
var contentwidth = jQuery("."+LayoutMode+" #contentwidth").width() * 2 - 24
, builderwidth = jQuery(".layout-main-content").width() * 2
, contentpercent = (contentwidth / builderwidth) * 100
, innereastwidth = jQuery("."+LayoutMode+" .innereast").width() * 2
, innerwestwidth = jQuery("."+LayoutMode+" .innerwest").width() * 2
, gutterwidth = (jQuery("."+LayoutMode+" #innerlayout .gutter").width()+2) * 2;
-
-
+
+
// Don't trigger if content is 0px wide. This means the function was triggered in error or by a browser quirk. (e.g. dragging a tab in Firefox)
if( contentwidth > 0 ){
-
+
if(LayoutMode == 'one-sidebar-right' || LayoutMode == 'one-sidebar-left'){var ngutters = 1;}
else if (LayoutMode == 'two-sidebar-right' || LayoutMode == 'two-sidebar-left' || LayoutMode == 'two-sidebar-center'){var ngutters = 2;}
else if (LayoutMode == 'fullwidth'){var ngutters = 0;gutterwidth = 0}
@@ -430,7 +430,7 @@ function toggleControls(button){
var primarysidebar = jQuery("."+LayoutMode+" #layout-sidebar-1 .loelement-pad .width span").html();
var maincontent = jQuery("."+LayoutMode+" #layout-main-content .loelement-pad .width span").html();
var wcontent = jQuery("."+LayoutMode+" #contentwidth .loelement-pad span").html();
-
+
jQuery(".layout_controls #input-content-width").val(wcontent);
jQuery(".layout_controls #input-responsive-width").val(contentpercent);
@@ -438,55 +438,55 @@ function toggleControls(button){
jQuery("."+LayoutMode+" #input-primarysidebar-width").val(primarysidebar);
jQuery("."+LayoutMode+" #input-maincolumn-width").val(maincontent);
-
-
-
+
+
+
if(Source == 'margin-resize'){
var theLayoutModes = new Array(
- 'fullwidth',
- 'one-sidebar-right',
- 'one-sidebar-left',
- 'two-sidebar-right',
- 'two-sidebar-left',
+ 'fullwidth',
+ 'one-sidebar-right',
+ 'one-sidebar-left',
+ 'two-sidebar-right',
+ 'two-sidebar-left',
'two-sidebar-center'
);
-
+
for( var i = 0; i < theLayoutModes.length; i++){
-
+
if(theLayoutModes[i] != LayoutMode){
-
+
if(theLayoutModes[i] == 'two-sidebar-right' || theLayoutModes[i] == 'two-sidebar-left' || theLayoutModes[i] == 'two-sidebar-center'){
-
+
var modeContent = jQuery("."+theLayoutModes[i]+" #layout-main-content .loelement-pad .width span").html();
var modeSB = jQuery("."+theLayoutModes[i]+" #layout-sidebar-1 .loelement-pad .width span").html();
var modeSB2 = jQuery("."+theLayoutModes[i]+" #layout-sidebar-2 .loelement-pad .width span").html();
-
+
jQuery("."+theLayoutModes[i]+" #input-maincolumn-width").val(wcontent - modeSB - modeSB2 );
-
+
} else if(theLayoutModes[i] == 'one-sidebar-right' || theLayoutModes[i] == 'one-sidebar-left'){
-
+
var modeContent = jQuery("."+theLayoutModes[i]+" #layout-main-content .loelement-pad .width span").html();
var modeSB = jQuery("."+theLayoutModes[i]+" #layout-sidebar-1 .loelement-pad .width span").html();
-
+
jQuery("."+theLayoutModes[i]+" #input-maincolumn-width").val(wcontent - modeSB);
-
-
+
+
} else if (theLayoutModes[i] == 'fullwidth'){
-
+
jQuery("."+theLayoutModes[i]+" #input-maincolumn-width").val(wcontent);
-
+
}
-
-
+
+
}
}
-
+
}
-
-
- }
-
+
+
+ }
+
}
@@ -495,17 +495,17 @@ function toggleControls(button){
///// LAYOUT BUILDER //////
function setLayoutBuilder(LayoutMode, margin, innereast, innerwest, gutter){
-
+
var MainLayoutBuilder
, InnerLayoutBuilder;
-
- window['OuterLayout'] = jQuery("."+LayoutMode+" .layout-main-content").layout({
+
+ window['OuterLayout'] = jQuery("."+LayoutMode+" .layout-main-content").layout({
center__paneSelector: ".layout-inner-content"
, east__paneSelector: ".margin-east"
, west__paneSelector: ".margin-west"
, closable: false // pane can open & close
- , resizable: true // when open, pane can be resized
+ , resizable: true // when open, pane can be resized
, slidable: true
, resizeWhileDragging: true
, west__resizable: true // Set to TRUE to activate dynamic margin
@@ -520,22 +520,22 @@ function toggleControls(button){
var width = paneState.innerWidth
, realwidth = width * 2
, currentElement = jQuery("."+LayoutMode+" .margin-east");
-
+
// This will fire in Firefox in strange times, make sure it's visible before doing anything
if(currentElement.is(':visible')){
currentElement.width(width);
var position = jQuery("."+LayoutMode+" .pagelines-resizer-west").position();
jQuery("."+LayoutMode+" .pagelines-resizer-east").css('right', position.left);
updateDimensions(LayoutMode, 'margin-resize');
-
+
}
-
- }
+
+ }
, east__onresize: function (pane, $Pane, paneState) {
var width = paneState.innerWidth;
var realwidth = width * 2;
var currentElement = jQuery("."+LayoutMode+" .margin-west");
-
+
// This will fire in Firefox in strange times, make sure it's visible before doing anything
if(currentElement.is(':visible')){
currentElement.width(width);
@@ -545,13 +545,13 @@ function toggleControls(button){
}
}
});
-
- window['InnerLayout'] = jQuery("."+LayoutMode+" .layout-inner-content").layout({
- closable: true
- , togglerLength_open: 0
+ window['InnerLayout'] = jQuery("."+LayoutMode+" .layout-inner-content").layout({
+
+ closable: true
+ , togglerLength_open: 0
, resizable: true
- , slidable: false
+ , slidable: false
, north__resizable: false
, south__resizable: false
, resizeWhileDragging: true
@@ -566,9 +566,9 @@ function toggleControls(button){
, west__spacing_open: gutter
, east__size: innereast
, west__size: innerwest
- , west__onresize: function (pane, $Pane, paneState) { updateDimensions(LayoutMode, 'Inner West'); }
+ , west__onresize: function (pane, $Pane, paneState) { updateDimensions(LayoutMode, 'Inner West'); }
, east__onresize: function (pane, $Pane, paneState) { updateDimensions(LayoutMode, 'Inner East'); }
});
-
+
updateDimensions(LayoutMode, 'Layout Builder');
}
\ No newline at end of file
diff --git a/admin/library.data.php b/admin/library.data.php
index c9f95978..bdcf0500 100644
--- a/admin/library.data.php
+++ b/admin/library.data.php
@@ -96,7 +96,7 @@ function pl_strip_js($text) {
*
*/
function pl_strip_only($str, $tags, $stripContent = false) {
-
+
$content = '';
if (!is_array($tags)) {
$tags = (strpos($str, '>') !== false ? explode('>', str_replace('<', '', $tags)) : array($tags));
diff --git a/admin/library.extension.php b/admin/library.extension.php
index 7d64c1b8..b53902dc 100644
--- a/admin/library.extension.php
+++ b/admin/library.extension.php
@@ -2,7 +2,7 @@
/**
* Upgrader skin and other functions.
*
- *
+ *
* @author PageLines
*
* @since 2.0.b10
@@ -18,7 +18,7 @@ class PageLines_Upgrader_Skin extends WP_Upgrader_Skin {
function __construct( $args = array() ) {
parent::__construct($args);
}
-
+
/**
*
@@ -26,7 +26,7 @@ function __construct( $args = array() ) {
*
*/
function header() { }
-
+
/**
*
@@ -34,7 +34,7 @@ function header() { }
*
*/
function footer(){ }
-
+
/**
*
@@ -42,18 +42,18 @@ function footer(){ }
*
*/
function feedback($string) {
-
+
$string = str_replace( 'downloading_package', '', $string );
$string = str_replace( 'unpack_package', '', $string );
$string = str_replace( 'installing_package', '', $string );
- $string = str_replace( 'process_failed', '', $string );
+ $string = str_replace( 'process_failed', '', $string );
$string = str_replace( 'process_success', '', $string );
$string = str_replace( 'parent_theme_search', '', $string );
$string = str_replace( 'parent_theme_currently_installed', '', $string );
-
+
// if anything left, must be a fatal error!
-
- if ( $string ) {
+
+ if ( $string ) {
if ( strstr( $string, 'Download failed' ) ) {
_e( "Could not connect to download.Reload Page ", 'pagelines' );
exit();
@@ -61,17 +61,17 @@ function feedback($string) {
if ( strstr( $string, 'Destination folder already exists' ) ) {
$string = str_replace( 'Destination folder already exists.', '', $string );
printf( __('Destination folder already exists %s', 'pagelines' ), $string );
- exit;
+ exit;
}
if ( strstr( $string, 'Could not' ) ) {
printf( __('Permissions Error %s', 'pagelines' ), $string );
- exit;
+ exit;
}
// fatal error?
wp_die( sprintf( 'Fatal error! %s ', $string ) );
}
}
-
+
/**
*
@@ -90,7 +90,7 @@ function before() {}
}
class PageLines_Section_Installer extends Plugin_Upgrader {
-
+
/**
*
@@ -100,7 +100,7 @@ class PageLines_Section_Installer extends Plugin_Upgrader {
function __construct( $args = array() ) {
parent::__construct($args);
}
-
+
/**
*
diff --git a/admin/library.help.php b/admin/library.help.php
index 2398d929..84d533b6 100644
--- a/admin/library.help.php
+++ b/admin/library.help.php
@@ -17,12 +17,12 @@ class PageLines_Inline_Help {
*
*/
function __construct() {
-
+
global $wp_version;
- if ( true == ( version_compare( $wp_version, '3.3-beta1', '>=' ) ) )
+ if ( true == ( version_compare( $wp_version, '3.3-beta1', '>=' ) ) )
add_filter( 'contextual_help_list', array( &$this, 'get_help' ) ,9999);
}
-
+
/**
*
@@ -30,20 +30,20 @@ function __construct() {
*
*/
function get_help() {
-
- global $current_screen;
+
+ global $current_screen;
$this->screen = $current_screen;
switch( $this->screen->id ) {
-
+
case 'pagelines_page_pagelines_extend':
$this->extend_help( array(
'pagelines-store' => __( 'PageLines Store', 'pagelines' ),
- 'integrations' => __( 'Integrations', 'pagelines' ),
+ 'integrations' => __( 'Integrations', 'pagelines' ),
));
break;
-
-
+
+
case 'pagelines_page_pagelines_special':
$this->extend_help( array(
'site-defaults' => __( 'About Site Defaults', 'pagelines' ),
@@ -57,13 +57,13 @@ function get_help() {
'special-404' => __( '404 Page', 'pagelines' )
));
break;
-
+
case 'pagelines_page_pagelines_templates':
$this->extend_help( array(
- 'templates' => __( 'Drag & Drop', 'pagelines' )
+ 'templates' => __( 'Drag & Drop', 'pagelines' )
));
break;
-
+
case 'toplevel_page_pagelines':
$this->extend_help( array(
'welcome' => __( 'Welcome', 'pagelines' ),
@@ -83,13 +83,13 @@ function get_help() {
$this->extend_help( array(
'your_account' => __( 'Your Account', 'pagelines' ),
'import' => __( 'Import-Export', 'pagelines' ),
- ));
+ ));
default:
break;
}
}
-
+
/**
*
@@ -97,20 +97,20 @@ function get_help() {
*
*/
function extend_help( $helps ) {
-
+
foreach( $helps as $id => $help ) {
-
+
$this->screen->add_help_tab( array(
'id' => $id,
'title' => $help,
'content' => $this->help_markup( $id ),
- ));
+ ));
$this->screen->set_help_sidebar(
'' . __( 'For more information:', 'pagelines' ) . '
' .
'' . sprintf( '%s ', __( 'Documentation', 'pagelines' ) ) . '
' .
'' . sprintf( '%s ', __( 'Support Forums', 'pagelines' ) ) . '
'
);
- }
+ }
}
@@ -120,43 +120,43 @@ function extend_help( $helps ) {
*
*/
function help_markup( $help ) {
-
+
$markup = array(
-
+
'welcome' => __( 'Welcome to the PageLines Help Section! Here you can find a brief overview of each tab, as well as a link to a more detailed help doc.
', 'pagelines' ),
-
+
'website_setup' => __( "Website Setup is generally the first thing people configure when they activate PageLines. These are the options that get your logo, brand name, and other custom elements up on your site. For more information, click on How to Use the Website Setup Settings
", 'pagelines' ),
-
+
'layout' => __( "The Layout Editor is what changes the layout of your site. You can change the dimensions of your content, the number & location of your sidebar(s), etc... For more information, click on How to Use the Layout Editor Settings
", 'pagelines' ),
-
+
'color' => __( "Color Control lets you choose the main colors that will be displayed on your website. It will then decide the best colors for your site's secondary and tertiary elements. You can always edit these manually by using CSS but Color Control chooses the best complementary colors to your site design. For more information, click on How to Use the Color Control Settings
", 'pagelines' ),
-
+
'typography' => __( "Typography allows you to change the fonts that appear on your website. No need for html or css to make changes to the most common place that you might want to change your fonts. For more information, click on How to Use the Typography Settings
", 'pagelines' ),
-
+
'header-footer' => __( "The Header & Footer settings provide flexibility and ease in setting up important site content such as Dropdown Navigation, Search capability, Social links, and Copyright statements. For more information, click on How to Use the Header and Footer Settings
", 'pagelines' ),
-
+
'blog-posts' => __( "The Blog And Posts settings is where you can set up the general structure and appearance of your blog post content. For more information, click on How to Use the Blog and Posts Settings
", 'pagelines' ),
-
+
'advanced' => __( "The Advanced settings contain some additional options that can be useful to solve some specific issues when developing your site. These include notorious browser compatibility issues with JS, server issues with Ajax and some useful other options for helping troubleshoot your site or connect with the affiliate program. For more information, click on How to Use the Advanced Settings
", 'pagelines' ),
-
+
'custom' => __( "The Custom Code setting is where you can insert your Custom CSS styling. If you have any Header, Footer, or Google Analytics script, all of that goes there as well. For more information, click on How to Use the Custom Code Settings
", 'pagelines' ),
-
+
'templates' => __( "The Drag & Drop Settings are one of PageLine's most powerful features. Using drag and drop technology, you can easily place your sections wherever you want on your site. For more information, click on How to Use the Template Setup
", 'pagelines' ),
-
+
'pagelines-store' => __( "The PageLines Store is your one stop online market place for everything you need to truely customize your website. Built by fellow members of the PageLines community, the Store offers the following types of components:
Sections - Drag and Drop pieces of web design that you can control on page templatesThemes - The overall appearance and structure of the site; its visual presentation.Plugins - Extend the functionality of your website. For more information, click on How to Use the PageLines Store Interested in developing your own Sections/Themes/Plugins for the PageLines Store? Click on Getting Started as a Developer for more information.", 'pagelines' ),
-
-
+
+
'integrations' => __( "If you purchased a PageLines Developer license, you have access to PageLines Integrations. This allows you to use non-WordPress software on your website such as Vanilla forums & MediaWiki, and completely integrate it with the PageLines Framework. For more information, click on How to Use Integrations
", 'pagelines' ),
-
- 'your_account' => __( 'To be able to receive PageLines updates and purchase & download items from the Store, you must setup your account credentials.
', 'pagelines' ),
-
+
+ 'your_account' => __( 'To be able to receive PageLines updates and purchase & download items from the Store, you must setup your account credentials.
', 'pagelines' ),
+
'import' => __( "You can easily transfer your PageLines 2.0 settings to another PageLines 2.0 site by using the Import-Export feature. Remember that this will only transfer your PageLines Settings. If you want to transfer your posts, pages, comments, custom fields, categories, and tags, you must use the WordPress Import-Export feature. This is located under 'Tools' inside your WordPress Administration Menu. For more information, click on How to Migrate PageLines from Another Site
", 'pagelines' ),
-
+
'site-defaults' => __( "Site Defaults can be set for all active Sections on your site. They contain the exact same Section Settings found in a post or a page. Once you set a Site Default for a section, that setting will apply to the same section on any post or page that does not have the same meta setting set. . For more information, click on How to Use Site Defaults
", 'pagelines' ),
-
-
+
+
'special-about' => __( "Special Pages refer to the WordPress pages which dynamically display data from your site. For example, your Blog is a Special Page, because it takes all of your individually entered posts and displays them on one page. Each type of Special Page has the same settings. Click on each tab to find out more on each page type. For more information, click on How to Use the Special Pages
", 'pagelines' ),
-
+
'special-blog' => __( 'This page contains of all the blog posts on your site.
', 'pagelines' ),
'special-archive' => __( 'This page displays all blog posts created in a particular month. Users can select the month via the Archives Widget in the Sidebar.
', 'pagelines' ),
'special-category' => __( 'If a blog post is assigned to a certain category, a user can click on that category and arrive at this page. It will contain all the other posts in that same category.
', 'pagelines' ),
@@ -166,8 +166,8 @@ function help_markup( $help ) {
'special-404' => __( "If a user tries to go to a page on your site that doesn't exist, he will arrive at this page.
", 'pagelines' ),
'navbar' => __( "The NavBar settings allow you to control the fixed navigation bar including themes, logo and menus. For more information, click on How to Use the NavBar
", 'pagelines' )
);
-
- return ( isset( $markup[$help] ) ) ? $markup[ $help ] : __( 'No help for this tab yet!', 'pagelines' );
+
+ return ( isset( $markup[$help] ) ) ? $markup[ $help ] : __( 'No help for this tab yet!', 'pagelines' );
}
-
+
} //end class
\ No newline at end of file
diff --git a/admin/paths.admin.php b/admin/paths.admin.php
index fec841e1..b916efec 100644
--- a/admin/paths.admin.php
+++ b/admin/paths.admin.php
@@ -2,19 +2,19 @@
-/*
- * Admin Paths
+/*
+ * Admin Paths
*/
class PLAdminPaths {
-
-
-
+
+
+
static function account($vars = '', $hash = '#Your_Account'){
-
+
return self::make_url('admin.php?page='.PL_MAIN_DASH, $vars, $hash);
-
+
}
-
+
/**
*
@@ -22,8 +22,8 @@ static function account($vars = '', $hash = '#Your_Account'){
*
*/
function make_url( $string = '', $vars = '', $hash = '' ){
-
+
return admin_url( $string.$vars.$hash );
-
- }
+
+ }
}
\ No newline at end of file
diff --git a/admin/t.dashboard.php b/admin/t.dashboard.php
index 22a995e3..433cbb1b 100644
--- a/admin/t.dashboard.php
+++ b/admin/t.dashboard.php
@@ -2,166 +2,166 @@
class PageLinesDashboard {
-
-
+
+
function __contruct(){}
-
+
function draw(){
-
+
// Updates Dashboard
-
+
$dashboards = '';
-
- $updates = $this->get_updates();
-
+
+ $updates = $this->get_updates();
+
$args = array(
'title' => __( 'Your Available Updates', 'pagelines' ),
- 'data' => $updates,
+ 'data' => $updates,
'icon' => PL_ADMIN_ICONS . '/download.png',
'excerpt-trim' => 0
- );
-
+ );
+
if ( ! EXTEND_NETWORK && !pl_has_editor())
- $dashboards = $this->dashboard_pane('updates', $args);
-
+ $dashboards = $this->dashboard_pane('updates', $args);
+
// PageLines Blog Dashboard
-
+
$args = array(
'title' => __( 'News from the PageLines Blog', 'pagelines' ),
- 'data' => PageLines_RSS::get_dash_rss( array( 'feed' => 'http://www.pagelines.com/feed/' ) ),
- 'classes' => 'news-dash pl-dash-half pl-dash-space',
- 'icon' => PL_ADMIN_ICONS . '/welcome.png',
+ 'data' => PageLines_RSS::get_dash_rss( array( 'feed' => 'http://www.pagelines.com/feed/' ) ),
+ 'classes' => 'news-dash pl-dash-half pl-dash-space',
+ 'icon' => PL_ADMIN_ICONS . '/welcome.png',
'footer' => sprintf('Visit PageLines Blog ', 'http://www.pagelines.com/blog')
- );
-
+ );
+
$dashboards .= $this->dashboard_pane('news', $args);
-
+
// Latest from the Community
$args = array(
'title' => __( 'From the Community', 'pagelines' ),
'data' => PageLines_RSS::get_dash_rss( array( 'feed' => 'http://www.pagelines.com/type/link/feed/', 'community' => true ) ),
- 'classes' => 'news-dash pl-dash-half',
- 'icon' => PL_ADMIN_ICONS . '/users.png',
+ 'classes' => 'news-dash pl-dash-half',
+ 'icon' => PL_ADMIN_ICONS . '/users.png',
'footer' => sprintf('Submit a community article', 'mailto:hello@pagelines.com')
- );
-
+ );
+
$dashboards .= $this->dashboard_pane('community', $args);
-
+
// PageLines Store Latest Dash
-
+
$args = array(
'title' => __( 'Updates on PageLines Store', 'pagelines' ),
- 'data' => PageLines_RSS::get_dash_rss(),
- 'classes' => 'news-dash pl-dash-half pl-dash-space',
- 'icon' => PL_ADMIN_ICONS . '/store.png',
+ 'data' => PageLines_RSS::get_dash_rss(),
+ 'classes' => 'news-dash pl-dash-half pl-dash-space',
+ 'icon' => PL_ADMIN_ICONS . '/store.png',
'footer' => sprintf('Visit PageLines Store ', 'http://www.pagelines.com/store/')
- );
-
+ );
+
$dashboards .= $this->dashboard_pane('store', $args);
-
+
// PageLines Plus
$args = array(
'title' => __( 'Latest Extensions', 'pagelines' ),
- 'data' => PageLines_RSS::get_dash_rss( array( 'feed' => 'http://api.pagelines.com/rss/plus.php' ) ),
- 'classes' => 'news-dash pl-dash-half',
- 'icon' => PL_ADMIN_ICONS . '/plusbtn.png',
+ 'data' => PageLines_RSS::get_dash_rss( array( 'feed' => 'http://api.pagelines.com/rss/plus.php' ) ),
+ 'classes' => 'news-dash pl-dash-half',
+ 'icon' => PL_ADMIN_ICONS . '/plusbtn.png',
'footer' => sprintf('Visit Plus Overview ', 'http://www.pagelines.com/plus/')
- );
-
+ );
+
$dashboards .= $this->dashboard_pane('extensions', $args);
-
-
- return $this->dashboard_wrap($dashboards);
-
+
+
+ return $this->dashboard_wrap($dashboards);
+
}
-
+
function dashboard_wrap( $dashboards ){
-
+
return sprintf('%s
', $dashboards);
-
+
}
-
+
function wrap_dashboard_pane($id, $args = array()){
return sprintf('%s
', $this->dashboard_pane( $id, $args ));
}
-
-
+
+
function dashboard_pane( $id, $args = array() ){
-
+
$defaults = array(
'title' => __( 'Dashboard', 'pagelines' ),
- 'icon' => PL_ADMIN_ICONS.'/pin.png',
- 'classes' => '',
- 'data' => array(),
- 'data-format' => 'array',
- 'excerpt-trim' => 10,
+ 'icon' => PL_ADMIN_ICONS.'/pin.png',
+ 'classes' => '',
+ 'data' => array(),
+ 'data-format' => 'array',
+ 'excerpt-trim' => 10,
'footer' => false
);
-
- $a = wp_parse_args($args, $defaults);
-
+
+ $a = wp_parse_args($args, $defaults);
+
ob_start()
?>
%s', $a['icon'], $a['title']); ?>
- dashboard_stories( $a );
+ dashboard_stories( $a );
echo $this->dashboard_footer( $a );
?>
- stories_array_format($args);
-
-
+ return $this->stories_array_format($args);
+
+
}
-
+
function dashboard_footer( $args = array() ){
-
+
if($args['footer'])
printf('', $args['footer']);
-
+
}
function stories_array_format($args){
-
- $btn_text = (isset($args['btn-text'])) ? $args['btn-text'] : false;
- $align_class = (isset($args['align']) && $args['align'] == 'right') ? 'rtimg' : '';
- $target = (isset($args['target']) && $args['target'] == 'new') ? 'target="_blank"' : '';
-
- $format = (isset($args['format']) && $args['format'] == 'plus-extensions') ? 'plus' : 'standard';
-
+
+ $btn_text = (isset($args['btn-text'])) ? $args['btn-text'] : false;
+ $align_class = (isset($args['align']) && $args['align'] == 'right') ? 'rtimg' : '';
+ $target = (isset($args['target']) && $args['target'] == 'new') ? 'target="_blank"' : '';
+
+ $format = (isset($args['format']) && $args['format'] == 'plus-extensions') ? 'plus' : 'standard';
+
ob_start();
-
+
$count = 1;
foreach($args['data'] as $id => $story){
-
- $image = (isset($story['img'])) ? $story['img'] : false;
- $tag = (isset($story['tag'])) ? $story['tag'] : false;
- $link = (isset($story['link'])) ? $story['link'] : false;
-
- $btn_text = (isset($story['btn-text'])) ? $story['btn-text'] : $btn_text;
-
- $tag_class = (isset($story['tag-class'])) ? $story['tag-class'] : '';
+
+ $image = (isset($story['img'])) ? $story['img'] : false;
+ $tag = (isset($story['tag'])) ? $story['tag'] : false;
+ $link = (isset($story['link'])) ? $story['link'] : false;
+
+ $btn_text = (isset($story['btn-text'])) ? $story['btn-text'] : $btn_text;
+
+ $tag_class = (isset($story['tag-class'])) ? $story['tag-class'] : '';
$alt = ($count % 2 == 0) ? 'alt-story' : '';
-
+
$excerpt = ( isset( $story['text'] ) ) ? $story['text'] : '';
-
+
$title = ( isset( $story['link'] ) ) ? sprintf( '%s ', $story['link'], $story['title'] ) : $story['title'];
-
-
+
+
if ( $excerpt )
$excerpt = (!$args['excerpt-trim']) ? $story['text'] : custom_trim_excerpt($story['text'], $args['excerpt-trim']);
?>
@@ -169,69 +169,69 @@ function stories_array_format($args){
get_upgrade_button( $story['data'] );
printf('
%s
', $align_class, $button );
-
-
-
+
+
+
} elseif($btn_text){
-
+
printf('
', $align_class, $link, $target, $btn_text);
-
+
} elseif($image)
printf('
', $align_class, $image);
-
+
?>
- special_buttons($args, $story);
-
+
?>
-
+
-
+
%s →', pl_get_plus_link(), __( 'Get PageLines Plus', 'pagelines' ) );
- endif;
-
+ endif;
+
if(!pagelines_check_credentials()):
printf( '%s → ', admin_url( PL_ACCOUNT_URL ), __( 'Have Plus? Login', 'pagelines' ) );
- endif;
-
+ endif;
+
if( pagelines_check_credentials( 'plus' ) ):
echo $this->get_upgrade_button( $story, 'install_rss' );
-
+
endif;
-
-
+
+
}
-
-
+
+
function get_upgrade_button( $data, $mode = 'upgrade' ) {
-
+
global $extension_control;
- $button = '';
+ $button = '';
if ( 'install_rss' === $mode && ! EXTEND_NETWORK ):
// we need to convert a rss url into hardcore API data
@@ -239,13 +239,13 @@ function get_upgrade_button( $data, $mode = 'upgrade' ) {
$type = basename( str_replace( $slug, '', $data['link'] ) );
$data = $extension_control->get_latest_cached( $type );
-
+
$data = $data->$slug;
-
+
$type = rtrim( $type, 's' );
-
+
$file = ( 'section' === $type ) ? $data->class : $slug;
-
+
// if section or plugin, convert to array for is_installed().
if( 'section' === $type || 'plugin' === $type )
$ext = json_decode(json_encode($data), true);
@@ -253,7 +253,7 @@ function get_upgrade_button( $data, $mode = 'upgrade' ) {
$ext = $data;
if ( $extension_control->is_installed( $type, $slug, $ext, 'dash_rss' ) )
- $o = array(
+ $o = array(
'mode' => 'installed',
'condition' => true,
'text' => __( 'Installed', 'pagelines' )
@@ -276,9 +276,9 @@ function get_upgrade_button( $data, $mode = 'upgrade' ) {
if ( 'upgrade' === $mode ) :
$type = rtrim( $data->type, 's' );
-
+
$file = ( 'section' === $type ) ? $data->class : $data->slug;
-
+
$o = array(
'mode' => 'upgrade',
'case' => sprintf( '%s_upgrade', $type ),
@@ -293,45 +293,45 @@ function get_upgrade_button( $data, $mode = 'upgrade' ) {
$button = $extension_control->ui->extend_button( $data->slug, $o);
endif;
-
+
return $button;
}
-
+
function stories_remote_url_format(){
-
+
}
-
+
function get_updates() {
-
+
$default['story0'] = array(
'title' => __( "No new updates available.", 'pagelines' ),
'text' => false
);
-
+
if ( EXTEND_NETWORK )
return $default;
-
+
$updates = json_decode( get_theme_mod( 'pending_updates' ) );
-
+
if( !is_object( $updates ) )
return $default;
-
+
$data = array();
$a = 0;
foreach( $updates as $key => $update ) {
-
+
$data["story$a"] = array(
-
+
'title' => $update->name,
'text' => $update->changelog,
'tag' => $update->type,
'data' => $update
-
- );
- $a++;
+
+ );
+ $a++;
}
if( empty( $data ) )
return $default;
return $data;
- }
+ }
}
\ No newline at end of file
diff --git a/admin/t.extensions.php b/admin/t.extensions.php
index 1132df42..4c6cc45e 100644
--- a/admin/t.extensions.php
+++ b/admin/t.extensions.php
@@ -7,27 +7,27 @@ class PageLinesCoreExtensions {
* PHP5 Constructor
*/
function __contruct(){ }
-
+
function draw(){
$dash = new PageLinesDashboard;
-
+
// PageLines Plus
$args = array(
'title' => __( 'Available Plus Extensions', 'pagelines' ),
- 'data' => PageLines_RSS::get_dash_rss( array( 'feed' => 'http://api.pagelines.com/rss/plus.php', 'items' => 50 ) ),
- 'icon' => PL_ADMIN_ICONS . '/plusbtn.png',
- 'excerpt-trim' => false,
+ 'data' => PageLines_RSS::get_dash_rss( array( 'feed' => 'http://api.pagelines.com/rss/plus.php', 'items' => 50 ) ),
+ 'icon' => PL_ADMIN_ICONS . '/plusbtn.png',
+ 'excerpt-trim' => false,
'format' => 'plus-extensions'
- );
-
+ );
+
$view = $this->get_welcome_billboard();
$view .= $dash->wrap_dashboard_pane('tips', $args);
-
+
return $view;
}
-
+
/**
* Get Welcome Billboard
*
@@ -39,10 +39,10 @@ function draw(){
* @return mixed|void
*/
function get_welcome_billboard(){
-
+
ob_start();
?>
-
+
@@ -51,11 +51,11 @@ function get_welcome_billboard(){
- get_welcome_billboard();
// PageLines Plus
$args = array(
- 'title' => __( 'PageLines Support', 'pagelines' ),
- 'data' => $this->support_array(),
- 'icon' => PL_ADMIN_ICONS . '/balloon-white.png',
+ 'title' => __( 'PageLines Support', 'pagelines' ),
+ 'data' => $this->support_array(),
+ 'icon' => PL_ADMIN_ICONS . '/balloon-white.png',
'excerpt-trim' => false,
'format' => 'button-links'
);
-
+
$view .= $dash->wrap_dashboard_pane('tips', $args);
-
+
// PageLines Plus
$args = array(
- 'title' => __( 'Other PageLines Resources', 'pagelines' ),
- 'data' => $this->resources_array(),
- 'icon' => PL_ADMIN_ICONS . '/toolbox.png',
+ 'title' => __( 'Other PageLines Resources', 'pagelines' ),
+ 'data' => $this->resources_array(),
+ 'icon' => PL_ADMIN_ICONS . '/toolbox.png',
'excerpt-trim' => false,
'format' => 'button-links'
);
-
+
$view .= $dash->wrap_dashboard_pane('tips', $args);
-
+
return $view;
}
-
+
function get_welcome_billboard(){
-
+
ob_start();
?>
-
+
@@ -56,82 +56,82 @@ function get_welcome_billboard(){
- array(
'title' => __( 'PageLines Live - Technical Community Chat (Plus Only)', 'pagelines' ),
- 'text' => __( 'Talk to others in the PageLines community and get instant help from Live Moderators.', 'pagelines' ),
- 'img' => PL_ADMIN_ICONS . '/dash-live.png',
- 'link' => 'http://www.pagelines.com/live/',
+ 'text' => __( 'Talk to others in the PageLines community and get instant help from Live Moderators.', 'pagelines' ),
+ 'img' => PL_ADMIN_ICONS . '/dash-live.png',
+ 'link' => 'http://www.pagelines.com/live/',
),
'story4' => array(
- 'title' => __( 'PageLines Documentation', 'pagelines' ),
- 'text' => __( 'Docs for everything you want to do with PageLines.', 'pagelines' ),
- 'img' => PL_ADMIN_ICONS . '/dash-docs.png',
- 'link' => 'http://www.pagelines.com/wiki/',
+ 'title' => __( 'PageLines Documentation', 'pagelines' ),
+ 'text' => __( 'Docs for everything you want to do with PageLines.', 'pagelines' ),
+ 'img' => PL_ADMIN_ICONS . '/dash-docs.png',
+ 'link' => 'http://www.pagelines.com/wiki/',
),
'story1' => array(
- 'title' => __( 'PageLines Forum', 'pagelines' ),
- 'text' => __( 'Find answers to common technical issues. Post questions and get responses from PageLines experts.', 'pagelines' ),
- 'img' => PL_ADMIN_ICONS . '/dash-forum.png',
- 'link' => 'http://www.pagelines.com/forum/',
+ 'title' => __( 'PageLines Forum', 'pagelines' ),
+ 'text' => __( 'Find answers to common technical issues. Post questions and get responses from PageLines experts.', 'pagelines' ),
+ 'img' => PL_ADMIN_ICONS . '/dash-forum.png',
+ 'link' => 'http://www.pagelines.com/forum/',
),
'vids' => array(
- 'title' => __( 'PageLines Videos and Training', 'pagelines' ),
- 'text' => __( 'Check out the latest videos on how to use PageLines fast and effectively via YouTube.', 'pagelines' ),
- 'img' => PL_ADMIN_ICONS . '/dash-video.png',
- 'link' => 'http://www.youtube.com/user/pagelines/videos?view=1',
+ 'title' => __( 'PageLines Videos and Training', 'pagelines' ),
+ 'text' => __( 'Check out the latest videos on how to use PageLines fast and effectively via YouTube.', 'pagelines' ),
+ 'img' => PL_ADMIN_ICONS . '/dash-video.png',
+ 'link' => 'http://www.youtube.com/user/pagelines/videos?view=1',
)
);
-
+
return $data;
-
+
}
function resources_array(){
-
+
$data = array(
'aff' => array(
- 'title' => __( 'Affiliate Program', 'pagelines' ),
- 'text' => __( 'Earn up to $130 (33%) on each referral to PageLines! Get started in 5 minutes.', 'pagelines' ),
- 'img' => PL_ADMIN_ICONS . '/dash-aff.png',
- 'link' => 'http://www.pagelines.com/partners',
+ 'title' => __( 'Affiliate Program', 'pagelines' ),
+ 'text' => __( 'Earn up to $130 (33%) on each referral to PageLines! Get started in 5 minutes.', 'pagelines' ),
+ 'img' => PL_ADMIN_ICONS . '/dash-aff.png',
+ 'link' => 'http://www.pagelines.com/partners',
),
'pros' => array(
- 'title' => __( 'PageLines Pros', 'pagelines' ),
- 'text' => __( 'The Pros are PageLines experts who you can pay to help customize your website.', 'pagelines' ),
- 'img' => PL_ADMIN_ICONS . '/dash-pros.png',
- 'link' => 'http://www.pagelines.com/pros',
+ 'title' => __( 'PageLines Pros', 'pagelines' ),
+ 'text' => __( 'The Pros are PageLines experts who you can pay to help customize your website.', 'pagelines' ),
+ 'img' => PL_ADMIN_ICONS . '/dash-pros.png',
+ 'link' => 'http://www.pagelines.com/pros',
),
'dev' => array(
- 'title' => __( 'Developer Center', 'pagelines' ),
- 'text' => __( 'Resources for professionals and developers using PageLines. Access to Beta releases and more.', 'pagelines' ),
- 'img' => PL_ADMIN_ICONS . '/dash-dev.png',
- 'link' => 'http://developer.pagelines.com',
+ 'title' => __( 'Developer Center', 'pagelines' ),
+ 'text' => __( 'Resources for professionals and developers using PageLines. Access to Beta releases and more.', 'pagelines' ),
+ 'img' => PL_ADMIN_ICONS . '/dash-dev.png',
+ 'link' => 'http://developer.pagelines.com',
),
'trans' => array(
- 'title' => __( 'Translation Center', 'pagelines' ),
- 'text' => __( 'Get PageLines in your language or collaborate on a translation.', 'pagelines' ),
- 'img' => PL_ADMIN_ICONS . '/dash-trans.png',
- 'link' => 'http://www.pagelines.com/translate/',
+ 'title' => __( 'Translation Center', 'pagelines' ),
+ 'text' => __( 'Get PageLines in your language or collaborate on a translation.', 'pagelines' ),
+ 'img' => PL_ADMIN_ICONS . '/dash-trans.png',
+ 'link' => 'http://www.pagelines.com/translate/',
),
-
+
);
-
+
return $data;
-
+
}
-
-
-
+
+
+
}
\ No newline at end of file
diff --git a/changelog.txt b/changelog.txt
index fbe10b14..7dc132c4 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -1,6 +1,6 @@
********************************************************
- PageLines Framework Release Notes:
+ PageLines Framework Release Notes:
********************************************************
@@ -66,7 +66,7 @@ Version 2.3
- NEW - Added alt tag option to Quickslider images
- CORE - Upgraded to latest bootstrap.
- CORE - Upgraded to latest LESS compiler.
- - CORE - Child themes can now override core less files.
+ - CORE - Child themes can now override core less files.
- Bugs - Boxes, open in new window if selected.
- Bugs - Stop banner images overflowing.
- Bugs - Make (edit) translatable.
@@ -139,7 +139,7 @@ Version 2.2
- NEW - New section! Navbar - Brand new navigation system with themes!
- NEW - New section! Hero - Quickly give a beautiful overview.
- NEW - Integration of Twitter Bootstrap (http://twitter.github.com/bootstrap/)
- - NEW - New shortcode system - Modals, Buttons, Etc..
+ - NEW - New shortcode system - Modals, Buttons, Etc..
- NEW - Performance enhancements & cleaner source markup.. Oh! and unicorn dust.
- NEW - Quickslider text options
- NEW - Fixed navigation bar with four color schemes.
@@ -155,7 +155,7 @@ Version 2.2
- NEW - Dashboard shows latest community posts, store updates and blog RSS feeds.
- NEW - Special thanks to the PageLines Beta Testing group, along with Mikey Z, Nigel, Danny, Posey, Jamie, Ian, David, and the rest of the unicorns in the Upper East side (no Unicorns were harmed in the making of this version).
- CORE - Added [post_authors] shortcode for metabar.
- - CORE - New Quickslider default images.
+ - CORE - New Quickslider default images.
- CORE - Added [post_type] shortcode for metabar.
- CORE - Added title/alt to watermark.
- CORE - Store layout tweaks.
@@ -183,7 +183,7 @@ Version 2.1.7
- CORE - Add three new google fonts to typography.
Version 2.1.6
-
+
- CORE - Responsive fixes.
- CORE - Page titles default to ON.
- CORE - Fix untranslated strings banners/carousel/boxes.
@@ -228,7 +228,7 @@ Version 2.1.2
- Bugs - Change action time for sidebar loading
- Bugs - Fix HTML5 validation
- Bugs - Re-add youtube link
- - Bugs - Escape JS in feature titles
+ - Bugs - Escape JS in feature titles
Version 2.1.1
- Bugs - IE8 css
@@ -265,7 +265,7 @@ Version 2.1
Version 2.0.2
- CORE - Template Name Convention Change
- CORE - Modifications for free version
--------------------------------------
+-------------------------------------
Version 2.0.1
- Feature Section
@@ -281,7 +281,7 @@ Version 2.0.1
------------------------------------- Date: 12-22-2011
Version 2.0.0
-
+
Official Release 2.0.0!
- Special Thanks to
- Chris Johnston (Awesome New Documentation)
@@ -295,33 +295,33 @@ Version 2.0.0
- Bugs - Screenshot url fix.
- Fix sandbox urls.
- MU - multisite fixes and css tweaks.
-
+
Release Candidate Three
- Localization - Translation fixes.
- Bugs - Layout bug fixed.
- Docs - Inline help added (chris).
- Bugs - Screenshot url fix.
- Bugs - base_url fix.
-
+
Release Candidate Two
- Welcome Screen Changes
- Fixed Layout Management Bug
- Add class to feature link
- Misc improvements
-
+
Release Candidate One
- Integrations - Special Settings fixed.
- Section - Refined Carousel
- Bugs - Fixed special option handling
- Store - New interface
-
+
BETA - 32
- Store - Error Fix
-
+
BETA - 31
- Integrations Special Settings.
- IE Handling.
-
+
BETA - 30
- Extension - Added new footer hooks.
@@ -344,12 +344,12 @@ Version 2.0.0
- Refined the 'store'
- Bug fixes
- Integrations.
-
+
BETA - 24
- LESS CSS - New Color Api for Section Extension (lessphp.org)
- Integrations - Add Vanilla Theme.
- Integrations - Add MediaWiki Theme.
-
+
BETA - 23
- Bug Fix - wamp has curl disabled by default props Chris.
- Bug Fix - various.
@@ -359,7 +359,7 @@ Version 2.0.0
- New Child Theming Refinements
- Bug Fixes and Refinements
- Child Theme panel hiding functions added.
-
+
BETA - 21
- Huge memory savings.
- New theming options.
@@ -375,10 +375,10 @@ Version 2.0.0
BETA - 19
- Add support for profiles section.
- Add plugins sandboxing.
-
+
BETA - 18
- Bug Fix - Meta not saving.
-
+
BETA - 17
- Bug Fix - Sections all had same ID.
- Bug Fix - Windows sections all had same icon.
@@ -439,6 +439,6 @@ Version 2.0.0
- Admin Rewrite
- Responsive Design
- Advanced Template Selector
- - Improved Graphics
+ - Improved Graphics
- Updated JS Libs
- Rewrote Option Engine
diff --git a/comments.php b/comments.php
index d3708ba9..4b0586b1 100644
--- a/comments.php
+++ b/comments.php
@@ -19,13 +19,11 @@
if(!have_comments() && !comments_open())
return;
-
?>
-
', __( 'This post is password protected. Enter the password to view any comments.', 'pagelines' ) );
return;
-
}
-
+
if ( have_comments() ) : ?>
-
-
\ No newline at end of file
diff --git a/editor/_todo.text b/editor/_todo.text
index 849875be..1cdd69af 100644
--- a/editor/_todo.text
+++ b/editor/_todo.text
@@ -2,7 +2,7 @@
* Store in Header DOM
* Make icons in store better looking
-* Sidebars are going to be deprecated?
+* Sidebars are going to be deprecated?
* AJAX Image Uploaders
* Color Pickers
* Typographic Options
diff --git a/editor/editor.actions.php b/editor/editor.actions.php
index af855358..ad985a03 100644
--- a/editor/editor.actions.php
+++ b/editor/editor.actions.php
@@ -3,10 +3,10 @@
-add_action('wp_ajax_pl_editor_actions', 'pl_editor_actions');
+add_action('wp_ajax_pl_editor_actions', 'pl_editor_actions');
function pl_editor_actions(){
-
- $post = $_POST;
+
+ $post = $_POST;
$response = array();
$response['post'] = $post;
$mode = $post['mode'];
@@ -15,7 +15,7 @@ function pl_editor_actions(){
$typeID = $post['typeID'];
if($mode == 'save'){
-
+
$draft = new EditorDraft;
$tpl = new EditorTemplates;
$map = $post['map_object'] = new EditorMap( $tpl, $draft );
@@ -23,71 +23,71 @@ function pl_editor_actions(){
if( $run == 'draft' ){
$draft->save_draft( $pageID, $typeID, $post['pageData'] );
-
-
+
+
} elseif ( $run == 'publish' ) {
-
+
$draft->save_draft( $pageID, $typeID, $post['pageData'] );
-
+
pl_publish_settings( $pageID, $typeID );
-
+
} elseif ( $run == 'revert' ){
-
+
$draft->revert( $post, $map );
} elseif ( $run == 'map' ){
$response['changes'] = $map->save_map_draft( $pageID, $post['map'] );
- }
-
+ }
+
$response['state'] = $draft->get_state( $pageID, $typeID, $map );
-
-
+
+
} elseif( $mode == 'sections'){
-
+
if( $run == 'reload'){
-
+
global $load_sections;
$available = $load_sections->pagelines_register_sections( true, false );
$response['result'] = $available;
}
-
-
+
+
} elseif( $mode == 'themes'){
-
+
$theme = new EditorThemeHandler;
-
+
if( $run == 'activate' ){
$response = $theme->activate( $response );
pl_flush_draft_caches();
}
-
-
+
+
} elseif ( $mode == 'templates' ){
-
+
$tpl = new EditorTemplates;
if ( $run == 'load' ){
-
+
$response['loaded'] = $tpl->set_new_local_template( $pageID, $post['key'] );
-
+
} elseif ( $run == 'update'){
-
+
$key = ( isset($post['key']) ) ? $post['key'] : false;
$template_map = $post['map']['template'];
$tpl->update_template( $key, $template_map );
-
+
} elseif ( $run == 'delete'){
-
+
$key = ( isset($post['key']) ) ? $post['key'] : false;
$tpl->delete_template( $key );
-
+
} elseif ( $run == 'save' ){
-
+
$template_map = $post['map']['template'];
$name = (isset($post['template-name'])) ? $post['template-name'] : false;
@@ -95,24 +95,24 @@ function pl_editor_actions(){
if( $name )
$tpl->create_template($name, $desc, $template_map);
-
+
} elseif( $run == 'set_type' ){
$storage = new PageLinesData;
$field = $post['field'];
$value = $post['value'];
-
+
$previous_val = $storage->meta( $typeID, $field );
-
+
if( $previous_val == $value ){
$storage->meta_update( $typeID, $field, false );
} else {
$storage->meta_update( $typeID, $field, $value );
}
-
+
$response['result'] = $storage->meta( $typeID, $field );
-
+
} elseif( $run == 'set_global' ){
@@ -120,25 +120,25 @@ function pl_editor_actions(){
$storage = new PageLinesData;
$field = $post['field'];
$value = $post['value'];
-
+
$previous_val = $storage->opt( $field );
-
+
if($previous_val == $value){
$storage->opt_update( $field, false );
} else {
$storage->opt_update( $field, $value );
}
-
+
$response['result'] = $storage->opt( $field );
-
+
}
-
+
} elseif ( $mode == 'settings' ){
-
+
$plpg = new PageLinesPage( array( 'mode' => 'ajax', 'pageID' => $pageID, 'typeID' => $typeID ) );
$draft = new EditorDraft;
$settings = new PageLinesOpts( $plpg, $draft );
-
+
if ($run == 'reset_global'){
$settings->reset_global();
@@ -148,13 +148,13 @@ function pl_editor_actions(){
$settings->reset_local( $pageID );
}
-
+
}
-
+
// RESPONSE
echo json_encode( pl_arrays_to_objects( $response ) );
-
+
die(); // don't forget this, always returns 0 w/o
}
diff --git a/editor/editor.areas.php b/editor/editor.areas.php
index bd742430..7d214257 100644
--- a/editor/editor.areas.php
+++ b/editor/editor.areas.php
@@ -1,37 +1,37 @@
-url = PL_PARENT_URL . '/editor';
}
-
+
function scripts(){
wp_enqueue_script( 'pl-js-areas', $this->url . '/js/pl.areas.js', array( 'jquery' ), PL_CORE_VERSION, true );
}
-
+
function toolbar( $toolbar ){
-
+
$toolbar[ $this->settings_panel ] = array(
'name' => 'Area Settings',
'icon' => 'icon-paste',
'type' => 'hidden',
'flag' => 'area-opts',
'pos' => 1000,
- 'panel' => $this->options_panel()
+ 'panel' => $this->options_panel()
);
-
+
return $toolbar;
}
-
+
function options_panel(){
global $plpg;
@@ -43,12 +43,12 @@ function options_panel(){
return $tabs;
}
-
+
function settings(){
- $settings = array();
-
+ $settings = array();
+
$settings[ $this->settings_panel ] = array(
- 'name' => 'Area Settings',
+ 'name' => 'Area Settings',
'icon' => 'icon-reorder',
'opts' => array(
array(
@@ -65,14 +65,14 @@ function settings(){
)
)
);
-
-
+
+
return $settings;
}
-
-
+
+
function area_controls($a){
-
+
ob_start();
?>
@@ -89,28 +89,28 @@ function area_controls($a){
return ob_get_clean();
}
-
-
+
+
function area_start($a){
$name = (isset($a['name'])) ? $a['name'] : '';
$class = (isset($a['class'])) ? $a['class'] : '';
$id = (isset($a['id']) && $a['id'] != '') ? $a['id'] : 'area_'.uniqid();
$styles = (isset($a['styles'])) ? $a['styles'] : '';
-
+
printf(
'%s
%s',
$id,
$name,
- $class,
- $class,
+ $class,
+ $class,
$a['area_number'],
$this->area_controls($a),
$this->area_sortable_buffer()
);
}
-
+
function area_end(){
printf('%s
', $this->area_sortable_buffer());
}
@@ -123,8 +123,8 @@ function area_sortable_buffer(){
return ( pl_draft_mode() ) ? sprintf('
') : '';
}
-
-
-
+
+
+
}
\ No newline at end of file
diff --git a/editor/editor.color.php b/editor/editor.color.php
index d87da4cf..01f2032a 100644
--- a/editor/editor.color.php
+++ b/editor/editor.color.php
@@ -20,8 +20,8 @@ function __construct( ){
function add_less_vars( $vars ){
$bg = pl_setting('bodybg');
- $base = ( $bg && $bg != '' ) ? $bg : $this->default_base;
-
+ $base = ( $bg && $bg != '' ) ? $bg : $this->default_base;
+
$text = ( pl_setting('text_primary') ) ? pl_setting('text_primary') : $this->default_text;
$link = ( pl_setting('linkcolor') ) ? pl_setting('linkcolor') : $this->default_link;
@@ -45,14 +45,14 @@ function background( $bg_color ){
$pos_x = pl_setting('page_background_image_pos_hor');
$pos_y = pl_setting('page_background_image_pos_vert');
$attach = pl_setting('page_background_image_attach');
-
- $repeat = ($repeat) ? $repeat : 'no-repeat';
- $pos_x = ($pos_x) ? $pos_x.'%' : '50%';
- $pos_y = ($pos_y) ? $pos_y.'%' : '0%';
- $attach = ($attach) ? $attach : 'fixed';
-
+
+ $repeat = ($repeat) ? $repeat : 'no-repeat';
+ $pos_x = ($pos_x) ? $pos_x.'%' : '50%';
+ $pos_y = ($pos_y) ? $pos_y.'%' : '0%';
+ $attach = ($attach) ? $attach : 'fixed';
+
$background = sprintf('%s url("%s") %s %s %s %s', $bg_color, $image, $repeat, $pos_x, $pos_y, $attach);
-
+
} else
$background = $bg_color;
@@ -180,7 +180,7 @@ function options(){
'type' => 'count_select',
'label' => __( 'Vertical Background Position in Percent', 'pagelines' ),
'default' => '0',
- 'count_start' => 0,
+ 'count_start' => 0,
'count_number' => 100,
'suffix' => '%',
'compile' => true,
@@ -191,7 +191,7 @@ function options(){
'type' => 'count_select',
'label' => __( 'Horizontal Background Position in Percent', 'pagelines' ),
'default' => '50',
- 'count_start' => 0,
+ 'count_start' => 0,
'count_number' => 100,
'suffix' => '%',
'compile' => true,
@@ -203,7 +203,7 @@ function options(){
'label' => __( 'Set Background Attachment', 'pagelines' ),
'default' => 'scroll',
'opts' => array(
- 'scroll' => array('name' => __( 'Scroll', 'pagelines' )),
+ 'scroll' => array('name' => __( 'Scroll', 'pagelines' )),
'fixed' => array('name' => __( 'Fixed', 'pagelines' )),
),
'compile' => true,
diff --git a/editor/editor.draft.php b/editor/editor.draft.php
index 42615e8c..e973dcce 100644
--- a/editor/editor.draft.php
+++ b/editor/editor.draft.php
@@ -109,7 +109,7 @@ function get_state( $pageID, $typeID, $map ){
$settings['type'] = pl_meta( $typeID, PL_SETTINGS );
$settings['global'] = pl_opt( PL_SETTINGS );
-
+
$settings['map-local'] = $map->map_local( $pageID );
$settings['map-global'] = $map->map_global();
@@ -124,10 +124,10 @@ function get_state( $pageID, $typeID, $map ){
}
}
-
+
if( count($state) > 1 )
$state[] = 'multi';
-
+
return $state;
}
@@ -136,9 +136,9 @@ function get_state( $pageID, $typeID, $map ){
}
function pl_draft_mode(){
-
+
$draft = new EditorDraft;
-
+
return ($draft->mode == 'draft') ? true : false;
-
+
}
\ No newline at end of file
diff --git a/editor/editor.functions.php b/editor/editor.functions.php
index d3e0b4e2..3b751225 100644
--- a/editor/editor.functions.php
+++ b/editor/editor.functions.php
@@ -1,68 +1,68 @@
- $o){
-
+
if($o['type'] == 'multi_option' || $o['type'] == 'text_multi'){
-
+
$sub_options = array();
foreach($o['selectvalues'] as $sub_key => $sub_o){
- $sub_options[ ] = process_old_opt($sub_key, $sub_o, $o);
+ $sub_options[ ] = process_old_opt($sub_key, $sub_o, $o);
}
$new_options[ ] = array(
- 'type' => 'multi',
+ 'type' => 'multi',
'title' => $o['title'],
'opts' => $sub_options
);
} else {
- $new_options[ ] = process_old_opt($key, $o);
+ $new_options[ ] = process_old_opt($key, $o);
}
-
+
}
-
+
return $new_options;
}
function process_old_opt( $key, $old, $otop = array()){
-
+
if(isset($otop['type']) && $otop['type'] == 'text_multi')
- $old['type'] = 'text';
-
+ $old['type'] = 'text';
+
$defaults = array(
'type' => 'check',
'title' => '',
- 'inputlabel' => '',
- 'exp' => '',
+ 'inputlabel' => '',
+ 'exp' => '',
'shortexp' => '',
'count_start' => 0,
'count_number' => '',
@@ -71,52 +71,52 @@ function process_old_opt( $key, $old, $otop = array()){
'post_type' => '',
'span' => 1
);
-
+
$old = wp_parse_args($old, $defaults);
-
+
$exp = ($old['exp'] == '' && $old['shortexp'] != '') ? $old['shortexp'] : $old['exp'];
-
+
if($old['type'] == 'text_small'){
- $type = 'text';
- } else
+ $type = 'text';
+ } else
$type = $old['type'];
-
+
$new = array(
- 'key' => $key,
+ 'key' => $key,
'title' => $old['title'],
- 'label' => $old['inputlabel'],
- 'type' => $type,
- 'help' => $exp,
+ 'label' => $old['inputlabel'],
+ 'type' => $type,
+ 'help' => $exp,
'opts' => $old['selectvalues'],
'span' => $old['span']
- );
-
+ );
+
if($old['type'] == 'count_select'){
$new['count_start'] = $old['count_start'];
$new['count_number'] = $old['count_number'];
}
-
+
if($old['taxonomy_id'] != '')
$new['taxonomy_id'] = $old['taxonomy_id'];
-
+
if($old['post_type'] != '')
$new['post_type'] = $old['post_type'];
-
+
return $new;
}
function pl_create_id( $string ){
-
- $string = str_replace( ' ', '_', trim( strtolower( $string ) ) );
+
+ $string = str_replace( ' ', '_', trim( strtolower( $string ) ) );
$string = preg_replace('/[^A-Za-z0-9\-]/', '', $string);
-
+
return $string;
}
-/*
+/*
* Lets document utility functions
- */
+ */
function pl_add_query_arg( $args ) {
global $wp;
@@ -124,24 +124,24 @@ function pl_add_query_arg( $args ) {
return add_query_arg( $args, $current_url );
}
-/*
+/*
* This function recursively converts an multi dimensional array into a multi layer object
* Needed for json conversion in < php 5.2
- */
+ */
function pl_arrays_to_objects( array $array ) {
$objects = new stdClass;
-
+
if( is_array($array) ){
foreach ( $array as $key => $val ) {
-
+
if($key === ''){
$key = 0;
}
-
+
if ( is_array( $val ) && !empty( $val )) {
-
+
$objects->{$key} = pl_arrays_to_objects( $val );
} else {
@@ -150,14 +150,14 @@ function pl_arrays_to_objects( array $array ) {
}
}
-
+
}
-
+
return $objects;
}
function pl_icon_array(){
-
+
$icons = array(
'glass',
'music',
@@ -407,35 +407,35 @@ function pl_icon_array(){
'reply',
'github-alt',
'folder-close-alt',
- 'folder-open-alt',
+ 'folder-open-alt',
);
-
+
return $icons;
}
function get_sidebar_select(){
- global $wp_registered_sidebars;
+ global $wp_registered_sidebars;
$allsidebars = $wp_registered_sidebars;
ksort($allsidebars);
-
- $sidebar_select = array();
+
+ $sidebar_select = array();
foreach($allsidebars as $key => $sb){
-
- $sidebar_select[ $sb['id'] ] = array( 'name' => $sb['name'] );
+
+ $sidebar_select[ $sb['id'] ] = array( 'name' => $sb['name'] );
}
-
+
return $sidebar_select;
}
function pl_count_sidebar_widgets( $sidebar_id ){
-
+
$total_widgets = wp_get_sidebars_widgets();
-
+
if(isset($total_widgets[ $sidebar_id ]))
return count( $total_widgets[ $sidebar_id ] );
- else
+ else
return false;
}
diff --git a/editor/editor.handler.php b/editor/editor.handler.php
index c8b77485..83a80515 100644
--- a/editor/editor.handler.php
+++ b/editor/editor.handler.php
@@ -1,6 +1,6 @@
factory = $pl_section_factory->sections;
-
+ global $pl_section_factory;
+
+ $this->factory = $pl_section_factory->sections;
+
// Dependancy Injection (^^)
$this->editor = $interface;
$this->areas = $areas;
@@ -48,31 +48,31 @@ function __construct(
$this->optset = $opts;
$this->layout = $layout;
$this->extensions = $extensions;
-
-
+
+
$this->map = $map->get_map( $this->page );
$this->parse_config();
-
+
$this->opts_config = $this->get_options_config();
-
+
$this->setup_processing();
-
+
if( $this->draft->show_editor() ){
add_action( 'wp_footer', array( &$this, 'json_blob' ) );
}
-
-
-
-
+
+
+
+
}
-
+
function json_blob(){
?>
query_string, '', home_url( $wp->request ) );
-
+
return $current_url;
}
-
+
function edit_post_link(){
if($this->page->is_special())
$url = admin_url( 'edit.php' );
- else
+ else
$url = get_edit_post_link( $this->page->id );
-
+
return $url;
}
-
+
function get_wp_menus(){
$menus = wp_get_nav_menus( array('orderby' => 'name') );
return $menus;
}
-
+
function meta_defaults($key){
-
+
$p = splice_section_slug($key);
-
+
$defaults = array(
'id' => $key,
'object' => $key,
'offset' => 0,
- 'clone' => 0,
+ 'clone' => 0,
'content' => array(),
'span' => 12,
'newrow' => 'false',
'set' => $this->optset->set
);
-
+
return $defaults;
}
-
+
function get_user_id(){
$current_user = wp_get_current_user();
return $current_user->ID;
}
-
+
function parse_config(){
foreach($this->map as $group => &$g){
-
+
if( !isset($g) || !is_array($g) )
continue;
-
+
foreach($g as $area => &$a){
-
+
if( isset( $a['object'] ) && $a['object'] ){
-
+
$this->section_list[ ] = $a;
$this->section_list_unique[ $a['object'] ] = $a;
-
+
}
-
+
if( !isset($a['content']) || !is_array($a['content']) )
continue;
-
+
foreach($a['content'] as $key => &$meta){
-
+
$meta = wp_parse_args($meta, $this->meta_defaults($key));
-
+
if(!empty($meta['content'])){
foreach($meta['content'] as $subkey => &$sub_meta){
$sub_meta = wp_parse_args($sub_meta, $this->meta_defaults($subkey));
@@ -197,24 +197,24 @@ function parse_config(){
$this->section_list_unique[$sub_meta['object']] = $sub_meta;
}
unset($sub_meta); // set by reference
-
+
$this->section_list[ ] = $meta;
$this->section_list_unique[ $meta['object'] ] = $meta;
} else {
$this->section_list[ ] = $meta;
$this->section_list_unique[ $meta['object'] ] = $meta;
}
-
+
}
unset($meta); // set by reference
}
unset($a); // set by reference
}
-
-
+
+
// add passive sections (not in drag drop but added through options/hooks)
global $passive_sections;
-
+
if(is_array($passive_sections) && !empty($passive_sections)){
foreach($passive_sections as $key){
$meta = wp_parse_args(array(), $this->meta_defaults($key));
@@ -223,161 +223,161 @@ function parse_config(){
}
}
}
-
+
function setup_processing(){
-
+
global $pl_section_factory;
-
+
foreach($this->section_list as $key => &$meta){
-
+
// $meta['set'] = $this->load_section_settings( $meta );
-
+
if( $this->in_factory( $meta['object'] ) ){
$this->factory[ $meta['object'] ]->meta = $meta;
-
+
}else
unset($this->section_list[$key]);
-
+
}
unset($meta);
-
-
+
+
}
-
+
function load_section_settings( $meta ){
-
- $settings = array();
-
- $sid = $meta['sid'];
+
+ $settings = array();
+
+ $sid = $meta['sid'];
$clone = $meta['clone'];
-
+
foreach( $this->opts_config[ $sid ]['opts'] as $index => $o ){
-
+
if( $o['type'] == 'multi' ){
-
+
foreach( $o['opts'] as $sub_index => $sub_o ){
$settings[ $sub_o['key'] ] = ( isset($sub_o['val'][$clone]) ) ? $sub_o['val'][$clone] : '';
}
-
+
} else {
$settings[ $o['key'] ] = ( isset($o['val'][$clone]) ) ? $o['val'][$clone] : '';
}
-
+
}
-
-
+
+
return $settings;
}
-
+
function get_options_config(){
-
+
$opts_config = array();
-
-
+
+
// BACKWARDS COMPATIBILITY
add_action('override_metatab_register', array(&$this, 'get_opts_from_optionator'), 10, 2);
-
+
foreach($this->section_list_unique as $key => $meta){
if($this->in_factory( $meta['object'] )) {
$s = $this->factory[ $meta['object'] ];
-
+
$opts_config[ $s->id ] = array(
'name' => $s->name
);
-
+
$opts = array();
-
+
// Grab the options
- $opts = $s->section_opts();
-
-
- // Deal with special case flags...
+ $opts = $s->section_opts();
+
+
+ // Deal with special case flags...
if(is_array($opts)){
foreach($opts as $index => $opt){
if(isset($opt['case'])){
// Special Page Only Option (e.g. used in post loop)
if($opt['case'] == 'special' && !$this->page->is_special())
unset($opts[$index]);
-
+
if($opt['case'] == 'page' && !is_page())
unset($opts[$index]);
-
+
if($opt['case'] == 'post' && !is_post())
unset($opts[$index]);
}
}
}
-
-
+
+
// For backwards compatibility with the older optionator format
// It works by using a hook to hijack the 'register_metapanel' function
// The hook then sets an attribute of this class to the array of options from the section
if(!$opts || empty($opts)){
-
+
$this->current_option_array = array();
-
+
// backwards comp
$s->section_optionator( array() );
-
+
if(isset( $this->current_option_array ))
- $opts = process_to_new_option_format( $this->current_option_array );
-
-
+ $opts = process_to_new_option_format( $this->current_option_array );
+
+
}
-
+
// deals with legacy special stuff
if(!empty($opts)){
foreach($opts as $okey => &$o){
-
-
+
+
if($o['type'] == 'multi'){
if(isset($o['opts']) && is_array($o['opts'])){
foreach($o['opts'] as $okeysub => &$osub){
if(!isset($osub['key']))
$osub['key'] = $okeysub;
- $this->opts_list[] = $osub['key'];
+ $this->opts_list[] = $osub['key'];
}
unset($osub); // set by reference
}
-
+
} else {
-
+
if(!isset($o['key']))
$o['key'] = $okey;
-
- $this->opts_list[] = $o['key'];
+
+ $this->opts_list[] = $o['key'];
}
}
unset($o); // set by reference
}
-
- $opts_config[ $s->id ][ 'opts' ] = $opts;
-
+
+ $opts_config[ $s->id ][ 'opts' ] = $opts;
+
}
-
-
+
+
}
remove_action('override_metatab_register', array(&$this, 'get_opts_from_optionator'), 10, 2);
-
-
+
+
foreach($opts_config as $item => &$i){
$i['opts'] = $this->opts_add_values( $i['opts'] );
}
unset($i);
-
-
+
+
return $opts_config;
}
-
-
-
+
+
+
function opts_add_values( $opts ){
-
+
if( is_array($opts) ){
foreach($opts as $index => &$o){
@@ -387,7 +387,7 @@ function opts_add_values( $opts ){
if($o['type'] == 'select_taxonomy'){
- $terms_array = get_terms( $o['taxonomy_id']);
+ $terms_array = get_terms( $o['taxonomy_id']);
if($o['taxonomy_id'] == 'category')
$o['opts'][] = array('name' => '*Show All*');
@@ -398,7 +398,7 @@ function opts_add_values( $opts ){
}
- //$o['type'] = 'select';
+ //$o['type'] = 'select';
}
@@ -410,28 +410,28 @@ function opts_add_values( $opts ){
}
unset($o);
}
-
-
+
+
return $opts;
}
-
-
+
+
function get_opts_from_optionator( $array ){
-
+
$this->current_option_array = $array;
-
- }
-
-
-
+
+ }
+
+
+
function current_page_data( $scope = 'local' ){
$d = array();
-
+
if($scope == 'local'){
-
+
$d = pl_settings( $this->draft->mode, $this->page->id );
-
+
// ** Backwards Compatible Stuff ** //
if(!is_pagelines_special()){
foreach($this->opts_list as $key => $opt){
@@ -442,11 +442,11 @@ function current_page_data( $scope = 'local' ){
$d[$opt] = array( pl_html($val) );
}
}
-
+
} elseif($scope == 'type'){
-
+
$d = pl_settings( $this->draft->mode, $this->page->typeid );
-
+
// ** Backwards Compatible Stuff **
$old_special = get_option('pagelines-special');
@@ -454,44 +454,44 @@ function current_page_data( $scope = 'local' ){
foreach($this->opts_list as $key => $opt){
if( !isset($d[ $opt ]) && isset($old_special[ $this->page->type ][ $opt ]) && !empty($old_special[ $this->page->type ][ $opt ]) )
- $d[$opt] = array( pl_html($old_special[ $this->page->type ][ $opt ]));
+ $d[$opt] = array( pl_html($old_special[ $this->page->type ][ $opt ]));
}
}
-
+
} else {
-
+
$d = pl_settings( $this->draft->mode );
-
+
// ** Backwards Compatible Stuff **
$old_special = get_option('pagelines-special');
-
+
if( isset( $old_special[ 'default' ] ) ){
foreach($this->opts_list as $key => $opt){
if(!isset($d[ $opt ]) && isset($old_special[ 'default' ][ $opt ]) && !empty($old_special[ 'default' ][ $opt ]) )
- $d[ $opt ] = array( pl_html($old_special[ 'default' ][ $opt ]) );
+ $d[ $opt ] = array( pl_html($old_special[ 'default' ][ $opt ]) );
}
}
-
+
}
-
-
+
+
return ($d) ? $d : array();
}
-
-
-
-
+
+
+
+
function process_styles(){
-
-
-
+
+
+
/*
TODO add !has_action('override_pagelines_css_output')
*/
@@ -500,11 +500,11 @@ function process_styles(){
if($this->in_factory( $meta['object'] )) {
$s = $this->factory[ $meta['object'] ];
-
+
$s->meta = $meta;
-
+
$s->section_styles();
-
+
// Auto load style.css for simplicity if its there.
if( is_file( $s->base_dir . '/style.css' ) ){
@@ -512,69 +512,69 @@ function process_styles(){
wp_enqueue_style( $s->id );
}
- }
+ }
}
}
-
+
function process_head(){
-
-
+
+
foreach($this->section_list as $key => $meta){
-
+
if( $this->in_factory( $meta['object'] ) ){
$s = $this->factory[ $meta['object'] ];
-
+
$s->meta = $meta;
-
+
$s->setup_oset( $meta['clone'] ); // refactor
ob_start();
- $s->section_head( $meta['clone'] );
+ $s->section_head( $meta['clone'] );
$head = ob_get_clean();
if($head != '')
echo pl_source_comment($s->name.' | Section Head') . $head;
-
- }
+
+ }
}
}
-
+
function process_region( $region = 'template' ){
-
+
if(!isset($this->map[ $region ]))
return;
-
+
if(pl_draft_mode())
$this->editor->region_start( $region, $this->area_number++ );
-
-
+
+
if( is_array( $this->map[ $region ] ) ){
-
+
$area_count = 0;
$area_total = count( $this->map[ $region ] );
-
+
foreach( $this->map[ $region ] as $area => $a ){
-
+
if( isset($a['object']) && !empty($a['object']) ){
-
+
$area_count++;
- $this->render_section( $a, $area_count, $area_total, 0 );
-
+ $this->render_section( $a, $area_count, $area_total, 0 );
+
} else {
-
+
// deprecated - this isnt used i dont think
- $a['area_number'] = $this->area_number++;
+ $a['area_number'] = $this->area_number++;
$this->areas->area_start($a);
if( isset($a['content']) && !empty($a['content'])){
$section_count = 0;
- $sections_total = count($a['content']);
+ $sections_total = count($a['content']);
foreach($a['content'] as $key => $meta){
@@ -586,118 +586,118 @@ function process_region( $region = 'template' ){
}
$this->areas->area_end($a);
-
+
}
-
+
}
}
-
+
}
-
-
+
+
function render_section( $meta, $count = false, $total = false, $level = 1 ){
-
+
if( $this->in_factory( $meta['object'] ) ){
-
+
$s = $this->factory[ $meta['object'] ];
$s->meta = $meta;
$s->level = $level;
$s->setup_oset( $meta['clone'] ); // refactor
-
+
ob_start();
$this->section_template_load( $s ); // Check if in child theme, if not load section_template
$output = ob_get_clean(); // Load in buffer, so we can check if empty
-
-
+
+
$render = (!isset($output) || $output == '') ? false : true;
-
+
if( $level >= 1 )
$this->grid_row_start( $s, $count, $total, $render, $level );
-
+
if( $render ){
-
+
$s->before_section_template( );
-
+
$this->before_section( $s );
echo $output;
$this->after_section( $s );
-
+
$s->after_section_template( );
}
-
+
if( $level >= 1 )
$this->grid_row_stop( $s, $count, $total, $render, $level );
-
-
-
+
+
+
wp_reset_postdata(); // Reset $post data
wp_reset_query(); // Reset wp_query
-
+
}
-
+
}
-
+
function grid_row_start( $s, $count, $total, $render = true, $level = 1 ){
-
+
if( $this->draft->show_editor() )
return;
-
+
if( !isset($this->row_width[ $level ]) ){
$this->row_width[ $level ] = 0;
}
-
-
+
+
if( $count == 1 ){
-
+
$this->row_width[ $level ] = 0;
printf('');
}
-
+
if( $render ){
-
- $section_width = $s->meta['span'] + $s->meta['offset'];
-
+
+ $section_width = $s->meta['span'] + $s->meta['offset'];
+
$this->row_width[ $level ] += $section_width;
-
+
if( $this->row_width[ $level ] > 12 || $s->meta['newrow'] == 'true' ){
-
+
$this->row_width[ $level ] = $section_width;
-
+
printf('
%s', "\n\n");
}
-
- }
-
-
+
+ }
+
+
}
-
+
function grid_row_stop( $s, $count, $total, $render, $level = 1 ){
-
+
if($this->draft->show_editor())
return;
-
+
if( $count == $total ){
$this->row_width[ $level ] = 0;
printf('
');
- }
+ }
}
-
+
function before_section( $s ){
-
- echo pl_source_comment($s->name . ' | Section Template', 2); // Add Comment
-
+
+ echo pl_source_comment($s->name . ' | Section Template', 2); // Add Comment
+
pagelines_register_hook('pagelines_before_'.$s->id, $s->id); // hook
-
+
// Rename to prevent conflicts
// TODO remove this or check to remove this strange non-algorhythmic code
if ( 'comments' == $s->id )
@@ -706,11 +706,11 @@ function before_section( $s ){
$sid = 'content-area';
else
$sid = $s->id;
-
+
$clone = $s->meta['clone'];
-
+
if($s->level == 0){
- $class[] = 'pl-area pl-area-sortable area-tag';
+ $class[] = 'pl-area pl-area-sortable area-tag';
$controls = $this->areas->area_controls( $s );
$pad_class = 'pl-area-pad';
} else {
@@ -725,57 +725,57 @@ function before_section( $s ){
$controls = $this->editor->section_controls( $s );
$pad_class = 'pl-section-pad';
}
-
-
-
- $class = array_merge($class, $s->wrapper_classes);
-
+
+
+
+ $class = array_merge($class, $s->wrapper_classes);
+
printf(
- '%s',
- $s->id.$clone,
+ '
%s',
+ $s->id.$clone,
$s->class_name,
- $s->id,
- $clone,
- implode(" ", $class),
+ $s->id,
+ $clone,
+ implode(" ", $class),
$sid,
$controls,
$pad_class
);
pagelines_register_hook('pagelines_outer_'.$s->id, $s->id); // hook
- pagelines_register_hook('pagelines_inside_top_'.$s->id, $s->id); // hook
-
+ pagelines_register_hook('pagelines_inside_top_'.$s->id, $s->id); // hook
+
}
function after_section( $s ){
-
+
pagelines_register_hook('pagelines_inside_bottom_'.$s->id, $s->id);
-
+
printf('
');
pagelines_register_hook('pagelines_after_'.$s->id, $s->id);
}
function section_template_load( $s ) {
-
+
// Variables for override
$override_template = 'template.' . $s->id .'.php';
$override = ( '' != locate_template(array( $override_template), false, false)) ? locate_template(array( $override_template )) : false;
- if( $override != false)
+ if( $override != false)
require( $override );
else
$s->section_template();
-
+
}
-
+
/**
* Tests if the section is in the factory singleton
*/
- function in_factory( $section ){
+ function in_factory( $section ){
return ( isset($this->factory[ $section ]) && is_object($this->factory[ $section ]) ) ? true : false;
- }
-
+ }
+
}
diff --git a/editor/editor.init.php b/editor/editor.init.php
index 617af274..aa6a58ae 100644
--- a/editor/editor.init.php
+++ b/editor/editor.init.php
@@ -6,8 +6,8 @@
* @since 3.0.0
*
*/
-
-
+
+
$pagelines_editor = new PageLinesEditor;
class PageLinesEditor {
@@ -76,10 +76,10 @@ function installer_scripts() {
}
function load_libs(){
-
+
if(!pl_use_editor())
- return;
-
+ return;
+
global $plpg;
global $pldraft;
global $plopts;
diff --git a/editor/editor.interface.php b/editor/editor.interface.php
index 22b003f9..436bbb08 100644
--- a/editor/editor.interface.php
+++ b/editor/editor.interface.php
@@ -26,7 +26,7 @@ function __construct( PageLinesPage $pg, EditorSettings $siteset, EditorDraft $d
global $is_chrome;
if ( $this->draft->show_editor() && $is_chrome){
-
+
add_action( 'wp_footer', array( &$this, 'pagelines_toolbox' ) );
add_action( 'wp_enqueue_scripts', array(&$this, 'pl_editor_scripts' ) );
@@ -46,10 +46,10 @@ function pl_editor_scripts(){
// UTILITIES ----------------------------
// --------------------------------------
-
+
// Sprintf
wp_enqueue_script( 'js-sprintf', $this->url . '/js/utils.sprintf.js', array( 'jquery' ), PL_CORE_VERSION, true );
-
+
// Forms handling
wp_enqueue_script( 'form-params', $this->url . '/js/form.params.js', array('jquery'), PL_CORE_VERSION, true );
wp_enqueue_script( 'form-store', $this->url . '/js/form.store.js', array('jquery'), PL_CORE_VERSION, true );
@@ -61,15 +61,15 @@ function pl_editor_scripts(){
wp_enqueue_script( 'imagesloaded', $this->url . '/js/utils.imagesloaded.js', array('jquery'), PL_CORE_VERSION, true);
// PAGELINES CODE -----------------------
- // --------------------------------------
+ // --------------------------------------
wp_enqueue_script( 'pl-editor-js', $this->url . '/js/pl.editor.js', array( 'jquery' ), PL_CORE_VERSION , true);
wp_enqueue_script( 'pl-toolbox-js', $this->url . '/js/pl.toolbox.js', array('pagelines-bootstrap-all' ), PL_CORE_VERSION, true );
wp_enqueue_script( 'pl-optpanel', $this->url . '/js/pl.optpanel.js', array( 'jquery' ), PL_CORE_VERSION, true );
wp_enqueue_script( 'pl-ajax', $this->url . '/js/pl.ajax.js', array( 'jquery' ), PL_CORE_VERSION, true );
wp_enqueue_script( 'pl-library', $this->url . '/js/pl.library.js', array( 'jquery' ), PL_CORE_VERSION, true );
wp_enqueue_script( 'pl-layout', $this->url . '/js/pl.layout.js', array( 'jquery' ), PL_CORE_VERSION, true );
-
- // Action in to scripts here...
+
+ // Action in to scripts here...
pagelines_register_hook('pagelines_editor_scripts'); // Hook
@@ -97,7 +97,7 @@ function pl_editor_scripts(){
wp_enqueue_script( 'jquery-mousewheel', $this->url . '/js/utils.mousewheel.js', array('jquery'), PL_CORE_VERSION, true );
-
+
// Global AjaxURL variable --> http://www.garyc40.com/2010/03/5-tips-for-using-ajax-in-wordpress/
wp_localize_script( 'pl-editor-js', 'ajaxurl', array( admin_url( 'admin-ajax.php' ) ) );
@@ -111,13 +111,13 @@ function region_start( $region, $area_number ){
$region_name = strtoupper($region);
if($region == 'header' || $region == 'footer'){
-
- $region_title = sprintf(__('Global Scope Region', 'pagelines'), $region_name);
-
+
+ $region_title = sprintf(__('Global Scope Region', 'pagelines'), $region_name);
+
$region_name .= '
';
} else {
- $region_title = sprintf(__('Local Scope Region', 'pagelines'), $region_name);
-
+ $region_title = sprintf(__('Local Scope Region', 'pagelines'), $region_name);
+
$region_name .= '
';
}
@@ -133,7 +133,7 @@ function region_start( $region, $area_number ){
function toolbar_config(){
-
+
// actions show up in a dropup
$actions = apply_filters('pl_toolbar_actions', array());
@@ -143,7 +143,7 @@ function toolbar_config(){
'type' => 'btn',
'pos' => 1
),
-
+
'pl-actions' => array(
'name' => '',
'icon' => '',
@@ -157,64 +157,64 @@ function toolbar_config(){
'type' => 'btn',
'pos' => 199
),
-
+
);
return $data;
}
-
-
+
+
function get_toolbar_config( ){
-
-
+
+
$toolbar_config = apply_filters('pl_toolbar_config', $this->toolbar_config());
-
+
$default = array(
'pos' => 100
);
-
-
+
+
foreach( $toolbar_config as $key => &$info ){
- $info = wp_parse_args( $info, $default );
+ $info = wp_parse_args( $info, $default );
}
unset($info); // set by reference ^^
-
+
uasort( $toolbar_config, array(&$this, "cmp_by_position") );
return apply_filters( 'pl_sorted_toolbar_config', $toolbar_config );
}
-
+
function cmp_by_position($a, $b) {
-
+
return $a["pos"] - $b["pos"];
-
+
}
-
-
-
-
-
+
+
+
+
+
function pagelines_editor_activate(){
global $wp;
- global $is_chrome;
+ global $is_chrome;
if($is_chrome){
$activate_url = pl_add_query_arg( array( 'edtr' => 'on' ) );
-
+
$text = 'Activate PageLines Editor';
-
+
$target = "";
} else {
$target = "target='_blank'";
$activate_url = 'http://www.google.com/chrome';
$text = 'Chrome is required to use PageLines Editor';
-
+
}
?>
>
@@ -302,13 +302,13 @@ function pagelines_toolbox(){
draft->get_state( $this->page->id, $this->page->typeid, $this->map );
-
+
$state_class = '';
foreach($state as $st){
$state_class .= ' '.$st;
}
-
-
+
+
?>
@@ -341,12 +341,12 @@ function pagelines_toolbox(){
get_toolbar_config() as $key => $tab){
-
+
if(isset($tab['panel']) && !empty($tab['panel']))
$this->panel($key, $tab['panel']);
else
printf('
', $key);
-
+
}
?>
@@ -441,7 +441,7 @@ function panel($key, $panel){
}
$clip = ( isset($t['clip']) ) ? sprintf('%s ', $t['clip']) : '';
-
+
$tools = ( isset($t['tools']) ) ? sprintf('%s ', $t['tools']) : '';
@@ -501,8 +501,8 @@ function section_controls( $s ){
return ob_get_clean();
}
-
-
+
+
}
diff --git a/editor/editor.layout.php b/editor/editor.layout.php
index 3fbaffd3..fd6a298f 100644
--- a/editor/editor.layout.php
+++ b/editor/editor.layout.php
@@ -4,36 +4,36 @@ class EditorLayout {
function __construct( ){
-
- add_filter('pless_vars', array(&$this, 'add_less_vars'));
-
+
+ add_filter('pless_vars', array(&$this, 'add_less_vars'));
+
}
-
+
function add_less_vars( $less_vars ){
-
+
// if pixel mode assign pixel option
-
+
if( pl_setting( 'layout_mode' ) == 'percent' )
- $value = (pl_setting( 'content_width_percent' )) ? pl_setting( 'content_width_percent' ) : '80%';
- else
- $value = (pl_setting( 'content_width_px' )) ? pl_setting( 'content_width_px' ) : '980px';
-
+ $value = (pl_setting( 'content_width_percent' )) ? pl_setting( 'content_width_percent' ) : '80%';
+ else
+ $value = (pl_setting( 'content_width_px' )) ? pl_setting( 'content_width_px' ) : '980px';
+
// if percent mode assign percent option
-
+
$less_vars['plContentWidth'] = $value;
-
+
return $less_vars;
-
+
}
-
+
function get_layout_mode(){
-
+
$value = (pl_setting( 'layout_mode' )) ? pl_setting( 'layout_mode' ) : 'pixel';
-
- return $value;
-
+
+ return $value;
+
}
-
-
+
+
}
\ No newline at end of file
diff --git a/editor/editor.legacy.php b/editor/editor.legacy.php
index ac0cd796..62380ca1 100644
--- a/editor/editor.legacy.php
+++ b/editor/editor.legacy.php
@@ -1,13 +1,13 @@
is_draft() && defined( 'PL_LESS_DEV' ) && true == PL_LESS_DEV ){
-
+
$raw_cached = pl_cache_get( 'draft_core_raw', array( &$this, 'draft_core_data' ) );
// check if a cache exists. If not dont bother carrying on.
@@ -192,9 +192,9 @@ function compare_less() {
if( $raw_cached['sections'] != $raw['sections'] )
$flush = true;
}
-
+
}
-
+
if( true == $flush )
pl_flush_draft_caches();
diff --git a/editor/editor.map.php b/editor/editor.map.php
index 26e98c6f..bbc3ee19 100644
--- a/editor/editor.map.php
+++ b/editor/editor.map.php
@@ -1,155 +1,155 @@
array(),
'draft' => array()
);
-
+
function __construct( EditorTemplates $tpl, EditorDraft $draft ){
-
+
$this->tpl = $tpl;
$this->draft = $draft;
}
-
+
function get_map( PageLinesPage $page ){
-
- $map_global = $this->map_global( );
+
+ $map_global = $this->map_global( );
$map_local = $this->map_local( $page->id );
-
- $map['header'] = $this->get_header( $map_global[ $this->draft->mode ] );
- $map['footer'] = $this->get_footer( $map_global[ $this->draft->mode ] );
- $map['template'] = $this->get_template( $map_local[ $this->draft->mode ] );
-
+
+ $map['header'] = $this->get_header( $map_global[ $this->draft->mode ] );
+ $map['footer'] = $this->get_footer( $map_global[ $this->draft->mode ] );
+ $map['template'] = $this->get_template( $map_local[ $this->draft->mode ] );
+
return $map;
-
+
}
-
+
function map_global(){
- return pl_opt( $this->map_option_slug, pl_settings_default(), true );
+ return pl_opt( $this->map_option_slug, pl_settings_default(), true );
}
-
+
function map_local( $pageID ){
return pl_meta( $pageID, $this->map_option_slug, pl_settings_default() );
}
-
+
function get_header( $map ){
-
+
if( $map && isset($map['header']))
- return $map['header'];
- else
+ return $map['header'];
+ else
return $this->tpl->default_header();
-
+
}
-
+
function get_footer( $map ){
-
+
if( $map && isset($map['footer']))
- return $map['footer'];
- else
+ return $map['footer'];
+ else
return $this->tpl->default_footer();
}
-
+
function get_template( $map ){
-
+
if( $map && isset($map['template']) && is_array($map['template']) ){
- return $map['template'];
- } else
- return $this->tpl->load_template( $map );
-
+ return $map['template'];
+ } else
+ return $this->tpl->load_template( $map );
+
}
-
-
-
+
+
+
function publish_map( $pageID ){
-
+
$global_map = pl_opt( $this->map_option_slug, pl_settings_default(), true );
-
- $global_map['live'] = $global_map['draft'];
-
+
+ $global_map['live'] = $global_map['draft'];
+
pl_opt_update( $this->map_option_slug, $global_map );
-
- $local_map = pl_meta( $pageID, $this->map_option_slug, pl_settings_default());
-
- $local_map['live'] = $local_map['draft'];
-
+
+ $local_map = pl_meta( $pageID, $this->map_option_slug, pl_settings_default());
+
+ $local_map['live'] = $local_map['draft'];
+
pl_meta_update( $pageID, $this->map_option_slug, $local_map );
-
+
}
-
+
function revert_local( $pageID ){
-
- $local_map = pl_meta( $pageID, $this->map_option_slug, pl_settings_default());
-
- $local_map['draft'] = $local_map['live'];
-
+
+ $local_map = pl_meta( $pageID, $this->map_option_slug, pl_settings_default());
+
+ $local_map['draft'] = $local_map['live'];
+
pl_meta_update( $pageID, $this->map_option_slug, $local_map );
-
+
}
-
+
function revert_global(){
-
-
+
+
$global_map = pl_opt( $this->map_option_slug, pl_settings_default(), true );
-
- $global_map['draft'] = $global_map['live'];
-
+
+ $global_map['draft'] = $global_map['live'];
+
pl_opt_update( $this->map_option_slug, $global_map );
}
-
-
-
+
+
+
function save_map_draft( $pageID, $the_map ){
$pageID = $pageID;
$map = $the_map;
-
+
// global
$global_map = pl_opt( $this->map_option_slug, pl_settings_default(), true );
-
+
$global_map['draft'] = array(
'header' => $map['header'],
'footer' => $map['footer']
);
-
+
pl_opt_update( $this->map_option_slug, $global_map );
-
- $local_map = pl_meta( $pageID, $this->map_option_slug, pl_settings_default());
-
+
+ $local_map = pl_meta( $pageID, $this->map_option_slug, pl_settings_default());
+
$new_map = $local_map;
-
+
$new_map['draft'] = array(
'template' => $map['template']
);
-
+
if($new_map != $local_map){
$this->save_local_map( $pageID, $new_map );
$local = 1;
- } else
+ } else
$local = 0;
-
+
return array('local' => $local);
}
function save_local_map( $pageID, $map ){
-
+
pl_meta_update( $pageID, $this->map_option_slug, $map );
}
-
+
}
diff --git a/editor/editor.mapping.php b/editor/editor.mapping.php
index a89f9576..4b89c4c9 100644
--- a/editor/editor.mapping.php
+++ b/editor/editor.mapping.php
@@ -1,21 +1,21 @@
-url = PL_PARENT_URL . '/editor';
}
-
+
function scripts(){
wp_enqueue_script( 'pl-js-mapping', $this->url . '/js/pl.mapping.js', array('jquery'), PL_CORE_VERSION, true);
-
+
}
-
-
+
+
}
\ No newline at end of file
diff --git a/editor/editor.page.php b/editor/editor.page.php
index 3e81f455..706a2b7a 100644
--- a/editor/editor.page.php
+++ b/editor/editor.page.php
@@ -1,6 +1,6 @@
defaults());
-
+
$mode = $args['mode'];
-
+
if( $mode == 'ajax' ){
-
+
$this->id = $args['pageID'];
$this->typeid = $args['typeID'];
-
+
} else {
-
+
$this->id = $this->id();
$this->type = $this->type();
$this->typeid = $this->special_id();
- $this->type_name = ucwords( str_replace('_', ' ', $this->type()) );
-
+ $this->type_name = ucwords( str_replace('_', ' ', $this->type()) );
+
}
}
-
+
function defaults(){
$d = array(
'mode' => 'standard',
- 'pageID' => '',
+ 'pageID' => '',
'typeID' => ''
- );
+ );
return $d;
}
-
+
function id(){
global $post;
if(!$this->is_special() && isset($post) && is_object($post))
return $post->ID;
else
return $this->special_id();
-
+
}
-
+
function special_id(){
-
+
$index = $this->special_index_lookup();
-
- $id = $this->special_base + $index;
-
+
+ $id = $this->special_base + $index;
+
return $id;
-
+
}
function special_index_lookup(){
-
+
$lookup_array = pl_opt( $this->opt_special_lookup );
-
+
if( !$lookup_array ){
-
+
$lookup_array = array(
'blog',
'category',
- 'search',
+ 'search',
'tag',
'author',
'archive',
@@ -83,87 +83,87 @@ function special_index_lookup(){
'post',
'404_page'
);
-
+
pl_opt_update( $this->opt_special_lookup, $lookup_array );
}
-
+
$index = array_search( $this->type(), $lookup_array );
-
+
if( !$index ){
-
+
$lookup_array[] = $this->type();
-
+
$index = array_search( $this->type(), $lookup_array );
-
+
pl_opt_update( $this->opt_special_lookup, $lookup_array );
-
+
}
-
+
return $index;
-
+
}
function type(){
if( is_404() )
$type = '404_page';
-
+
elseif( pl_is_cpt('archive') )
$type = get_post_type_plural();
-
+
elseif( is_tag() )
$type = 'tag';
-
+
elseif( is_search() )
$type = 'search';
-
+
elseif( is_category() )
$type = 'category';
-
+
elseif( is_author() )
$type = 'author';
-
+
elseif( is_archive() )
$type = 'archive';
-
+
elseif( is_home() )
$type = 'blog';
-
- // ID is now set...
+
+ // ID is now set...
elseif( pl_is_cpt() )
$type = get_post_type();
-
+
elseif( is_page() )
$type = 'page';
-
+
elseif( is_single() )
$type = 'post';
-
+
else
$type = 'other';
-
+
return $type;
}
-
+
function is_special(){
-
- if ( is_404() || is_home() || is_search() || is_archive() )
+
+ if ( is_404() || is_home() || is_search() || is_archive() )
return true;
- else
+ else
return false;
-
+
}
-
+
function is_posts_page(){
-
- if ( is_home() || is_search() || is_archive() || is_category() )
+
+ if ( is_home() || is_search() || is_archive() || is_category() )
return true;
- else
+ else
return false;
-
+
}
-
+
}
diff --git a/editor/editor.settings.config.php b/editor/editor.settings.config.php
index e21b638b..f517c2d5 100644
--- a/editor/editor.settings.config.php
+++ b/editor/editor.settings.config.php
@@ -1,13 +1,13 @@
settings['basic_settings'] = array(
- 'name' => 'Site Images',
+ 'name' => 'Site Images',
'icon' => 'icon-picture',
'pos' => 1,
'opts' => $this->basic()
);
-
+
$this->settings['layout'] = array(
- 'name' => 'Layout Handling',
- 'icon' => 'icon-fullscreen',
+ 'name' => 'Layout Handling',
+ 'icon' => 'icon-fullscreen',
'pos' => 2,
'opts' => $this->layout()
);
-
+
$this->settings['social_media'] = array(
- 'name' => 'Social Media',
+ 'name' => 'Social Media',
'icon' => 'icon-comments',
'pos' => 5,
'opts' => $this->social()
- );
-
+ );
+
$this->settings['advanced'] = array(
- 'name' => 'Advanced',
+ 'name' => 'Advanced',
'icon' => 'icon-wrench',
'pos' => 50,
'opts' => $this->advanced()
);
-
+
$this->settings['resets'] = array(
- 'name' => 'Resets',
+ 'name' => 'Resets',
'icon' => 'icon-undo',
'pos' => 55,
'opts' => $this->resets()
);
}
-
+
function get_set( ){
-
+
$settings = apply_filters('pl_settings_array', $this->settings);
-
+
$default = array(
'icon' => 'icon-edit',
'pos' => 100
);
-
+
foreach($settings as $key => &$info){
- $info = wp_parse_args( $info, $default );
+ $info = wp_parse_args( $info, $default );
}
unset($info);
-
+
uasort($settings, array(&$this, "cmp_by_position") );
return apply_filters('pl_sorted_settings_array', $settings);
}
-
+
function cmp_by_position($a, $b) {
if( isset( $a['pos'] ) && is_int( $a['pos'] ) && isset( $b['pos'] ) && is_int( $b['pos'] ) )
@@ -79,22 +79,22 @@ function cmp_by_position($a, $b) {
else
return 0;
}
-
+
function basic(){
-
+
$settings = array(
-
+
array(
'key' => 'pagelines_favicon',
'label' => 'Upload Favicon (32px by 32px)',
'type' => 'image_upload',
'imgsize' => '16',
- 'title' => __( 'Favicon Image', 'pagelines' ),
+ 'title' => __( 'Favicon Image', 'pagelines' ),
'help' => __( 'Enter the full URL location of your custom favicon which is visible in browser favorites and tabs. Must be .png or .ico file - 32px by 32px .', 'pagelines' ),
'default' => PL_EDITOR_URL . '/images/default-favicon.png'
- ),
-
-
+ ),
+
+
array(
'key' => 'pl_login_image',
'type' => 'image_upload',
@@ -102,63 +102,63 @@ function basic(){
'imgsize' => '80',
'sizemode' => 'height',
'title' => __( 'Login Page Image', 'pagelines' ),
- 'default' => PL_EDITOR_URL . '/images/default-login-image.png',
+ 'default' => PL_EDITOR_URL . '/images/default-login-image.png',
'help' => __( 'This image will be used on the login page to your admin. Use an image that is approximately 80px in height.', 'pagelines' )
),
-
+
array(
'key' => 'pagelines_touchicon',
'label' => 'Upload Touch Image (144px by 144px)',
'type' => 'image_upload',
'imgsize' => '72',
- 'title' => __( 'Mobile Touch Image', 'pagelines' ),
+ 'title' => __( 'Mobile Touch Image', 'pagelines' ),
'default' => PL_EDITOR_URL . '/images/default-touch-icon.png',
'help' => __( 'Enter the full URL location of your Apple Touch Icon which is visible when your users set your site as a webclip in Apple Iphone and Touch Products. It is an image approximately 57px by 57px in either .jpg, .gif or .png format.', 'pagelines' )
- ),
-
+ ),
+
array(
'type' => 'multi',
- 'title' => __( 'Website Watermark', 'pagelines' ),
+ 'title' => __( 'Website Watermark', 'pagelines' ),
'help' => __( 'The website watermark is a small version of your logo for your footer. Recommended width/height is 90px.', 'pagelines' ),
-
+
'opts' => array(
array(
'key' => 'watermark_image',
- 'type' => 'image_upload',
- 'label' => 'Watermark Image',
+ 'type' => 'image_upload',
+ 'label' => 'Watermark Image',
'default' => PL_EDITOR_URL . '/images/default-watermark.png',
'imgsize' => '44'
- ),
+ ),
array(
'key' => 'watermark_link',
- 'type' => 'text',
- 'label' => 'Watermark Link (Blank for None)',
+ 'type' => 'text',
+ 'label' => 'Watermark Link (Blank for None)',
'default' => 'http://www.pagelines.com'
),
array(
'key' => 'watermark_alt',
- 'type' => 'text',
- 'label' => 'Watermark Link alt text',
- 'default' => 'Build a website with PageLines'
+ 'type' => 'text',
+ 'label' => 'Watermark Link alt text',
+ 'default' => 'Build a website with PageLines'
),
array(
'key' => 'watermark_hide',
- 'type' => 'check',
+ 'type' => 'check',
'label' => "Hide Watermark"
)
),
-
+
),
);
-
+
return $settings;
-
+
}
-
+
function layout(){
-
-
-
+
+
+
$settings = array(
array(
'key' => 'disable_responsive',
@@ -182,19 +182,19 @@ function layout(){
);
-
-
+
+
return $settings;
-
+
}
-
+
function social(){
-
-
-
+
+
+
$settings = array(
array(
- 'key' => 'twittername',
+ 'key' => 'twittername',
'type' => 'text',
'label' => __( 'Your Twitter Username', 'pagelines' ),
'title' => __( 'Twitter Integration', 'pagelines' ),
@@ -210,18 +210,18 @@ function social(){
);
-
-
+
+
return $settings;
-
+
}
-
-
-
-
-
+
+
+
+
+
function advanced(){
-
+
$settings = array(
array(
'key' => 'load_prettify_libs',
@@ -244,12 +244,12 @@ function advanced(){
'title' => __( 'Current Install Class', 'pagelines' ),
'help' => __( "Use this option to add a class to the >body< element of the website. This can be useful when using the same child theme on several installations or sub domains and can be used to control CSS customizations.", 'pagelines' )
)
- );
+ );
return $settings;
}
-
+
function resets(){
-
+
$settings = array(
array(
'key' => 'reset_global',
@@ -267,7 +267,7 @@ function resets(){
'title' => __( 'Reset Current Page Settings', 'pagelines' ),
'help' => __( "Use this button to reset all settings on the current page back to their default state. Note: Once you've completed this action, you may want to publish these changes to your live site.", 'pagelines' )
),
- );
+ );
return $settings;
}
diff --git a/editor/editor.settings.php b/editor/editor.settings.php
index 1f761bbf..b15d0557 100644
--- a/editor/editor.settings.php
+++ b/editor/editor.settings.php
@@ -1,51 +1,51 @@
array(), 'live' => array() );
+ return array( 'draft' => array(), 'live' => array() );
}
function pl_setting( $key, $args = array() ){
global $plopts;
-
+
if(!is_object($plopts)){
$plpg = new PageLinesPage;
$pldraft = new EditorDraft;
$plopts = new PageLinesOpts( $plpg, $pldraft );
}
-
- $setting = $plopts->get_setting( $key, $args );
-
+
+ $setting = $plopts->get_setting( $key, $args );
+
return $setting;
-
+
}
function pl_setting_update( $args_or_key, $value = false, $mode = 'draft', $scope = 'global' ){
$settings_handler = new PageLinesSettings;
-
+
if( is_array($args_or_key) ){
- $args = $args_or_key;
+ $args = $args_or_key;
} else {
-
+
$args = array(
'key' => $args_or_key,
'val' => $value,
'mode' => $mode,
'scope' => $scope
- );
-
+ );
+
}
-
- $settings_handler->update_setting( $args );
-
+
+ $settings_handler->update_setting( $args );
+
}
function pl_meta($id, $key, $default = false){
-
+
$data = new PageLinesData;
return $data->meta($id, $key, $default);
-
+
}
@@ -53,16 +53,16 @@ function pl_meta_update($id, $key, $value){
$data = new PageLinesData;
return $data->meta_update($id, $key, $value);
-
+
}
/*
* This class contains all methods for interacting with WordPress' data system
* It has no dependancy so it can be used as a substitute for WordPress native functions
* The options system inherits from it.
- */
+ */
class PageLinesData {
-
+
function meta($id, $key, $default = false){
$val = get_post_meta($id, $key, true);
@@ -80,17 +80,17 @@ function meta($id, $key, $default = false){
return $val;
}
-
+
function meta_update($id, $key, $value){
update_post_meta($id, $key, $value);
}
-
+
function opt( $key, $default = false, $parse = false ){
-
- $val = get_option($key);
+
+ $val = get_option($key);
if( !$val ){
@@ -103,17 +103,17 @@ function opt( $key, $default = false, $parse = false ){
}
return $val;
-
+
}
-
+
function opt_update( $key, $value ){
update_option($key, $value);
}
-
+
function user( $user_id, $key, $default = false ){
-
+
$val = get_user_meta($user_id, $key, true);
if( !$val ){
@@ -127,15 +127,15 @@ function user( $user_id, $key, $default = false ){
}
return $val;
-
+
}
-
+
function user_update( $user_id, $key, $value ){
- update_user_meta( $user_id, $key, $value );
+ update_user_meta( $user_id, $key, $value );
}
-
-
-
+
+
+
}
/*
@@ -144,77 +144,77 @@ function user_update( $user_id, $key, $value ){
class PageLinesSettings extends PageLinesData {
var $pl_settings = PL_SETTINGS;
- var $default = array( 'draft' => array(), 'live' => array() );
+ var $default = array( 'draft' => array(), 'live' => array() );
function global_settings(){
-
+
$set = $this->opt( $this->pl_settings );
// Have to move this to an action because ploption calls pl_setting before all settings are loaded
if( !$set || empty($set['draft']) || empty($set['live']) )
- add_action('pl_after_settings_load', array(&$this, 'set_default_settings'));
-
- return $this->get_by_mode($set);
-
+ add_action('pl_after_settings_load', array(&$this, 'set_default_settings'));
+
+ return $this->get_by_mode($set);
+
}
/*
* Resets global options to an empty set
*/
function reset_global( ){
-
- $set = $this->opt( PL_SETTINGS, $this->default );
-
- $set['draft'] = $this->default['draft'];
+
+ $set = $this->opt( PL_SETTINGS, $this->default );
+
+ $set['draft'] = $this->default['draft'];
$this->opt_update( PL_SETTINGS, $set );
-
+
}
-
+
/*
* Resets local options to an empty set based on ID (works for type ID)
*/
function reset_local( $metaID ){
-
- $set = $this->meta( $metaID, PL_SETTINGS, $this->default );
-
- $set['draft'] = $this->default['draft'];
+
+ $set = $this->meta( $metaID, PL_SETTINGS, $this->default );
+
+ $set['draft'] = $this->default['draft'];
$this->meta_update( $metaID, PL_SETTINGS, $set );
-
+
}
-
+
/*
* Sets default values for global settings
*/
function set_default_settings(){
-
+
$set = $this->opt( $this->pl_settings );
-
+
$settings_defaults = $this->get_default_settings();
-
+
if( !$set )
$set = $this->default;
-
+
if(empty($set['draft']))
$set['draft'] = $settings_defaults;
-
+
if(empty($set['live']))
$set['live'] = $settings_defaults;
-
+
$this->opt_update( $this->pl_settings, $set);
-
+
}
-
+
/*
* Grabs global settings engine array, and default values (set in array)
*/
function get_default_settings(){
$settings_object = new EditorSettings;
-
+
$settings = $settings_object->get_set();
-
-
+
+
$defaults = array();
foreach($settings as $tab => $tab_settings){
foreach($tab_settings['opts'] as $index => $opt){
@@ -230,116 +230,116 @@ function get_default_settings(){
}
}
}
-
+
return $defaults;
}
-
-
+
+
/*
* Update a PageLines setting using arguments
*/
function update_setting( $args = array() ){
-
+
$defaults = array(
'key' => '',
'val' => '',
'mode' => 'draft',
'scope' => 'global'
);
-
+
$a = wp_parse_args( $args, $defaults );
-
- $scope = $a['scope'];
- $mode = $a['mode'];
- $key = $a['key'];
- $val = $a['val'];
-
+
+ $scope = $a['scope'];
+ $mode = $a['mode'];
+ $key = $a['key'];
+ $val = $a['val'];
+
// Allow for an array of key/value pairs
$set = ( !is_array($val) && $key != '' ) ? array( $key => $value ) : $val;
-
+
if( $scope == 'global'){
-
- $settings = $this->opt( $this->pl_settings, $this->default );
+
+ $settings = $this->opt( $this->pl_settings, $this->default );
if( isset($settings[ $mode ]) ){
-
- $settings[ $mode ] = wp_parse_args($set, $settings[ $mode ]);
+
+ $settings[ $mode ] = wp_parse_args($set, $settings[ $mode ]);
pl_opt_update( PL_SETTINGS, $option_set );
-
+
}
-
-
+
+
}
}
-
-
+
+
/*
* Parse settings taking the top values over the bottom
* Deep parsing: Parses arguments on nested arrays then deals with overriding
* Checkboxes: Handles checkboxes by using 'flip' value settings to toggle the value
*/
function parse_settings( $top, $bottom ){
-
-
+
+
if(!is_array( $bottom ))
return $top;
-
+
// Parse Args Deep
foreach($bottom as $key => $set){
-
+
if( !isset($top[$key]) )
$top[$key] = $set;
-
+
elseif(is_array($set)){
foreach($set as $clone => $value){
if( !isset($top[$key][$clone]) )
$top[$key][$clone] = $value;
}
}
-
+
}
-
+
$parsed_args = $top;
-
+
foreach($parsed_args as $key => &$set){
-
+
if( is_array($set) ){
foreach($set as $clone => &$value){
-
- if(
- ( !isset($value) || $value == '' || !$value )
- && isset( $bottom[$key][$clone] )
+
+ if(
+ ( !isset($value) || $value == '' || !$value )
+ && isset( $bottom[$key][$clone] )
)
$value = $bottom[$key][$clone];
-
+
$flipkey = $key.'-flip';
-
+
// flipping checkboxes
if( isset($parsed_args[$flipkey]) && isset($parsed_args[$flipkey][$clone]) && isset($bottom[$key][$clone]) ){
-
-
-
+
+
+
$flip_val = $parsed_args[$flipkey][$clone];
$bottom_val = $bottom[$key][$clone];
if( $flip_val && $bottom_val ){
$value = '';
}
-
-
+
+
}
-
-
-
+
+
+
}
}
-
+
}
- unset($set);
- unset($value);
-
+ unset($set);
+ unset($value);
+
return $parsed_args;
}
@@ -354,76 +354,76 @@ function parse_settings( $top, $bottom ){
class PageLinesOpts extends PageLinesSettings {
function __construct( PageLinesPage $page, EditorDraft $draft ){
-
- $this->page = $page;
+
+ $this->page = $page;
$this->draft = $draft;
-
+
$this->local = $this->local_settings();
$this->type = $this->type_settings();
$this->global = $this->global_settings();
$this->set = $this->page_settings();
}
-
-
+
+
function page_settings(){
-
+
$set = $this->parse_settings( $this->local, $this->parse_settings($this->type, $this->global));
return $set;
-
+
}
-
+
function setting( $key ){
-
+
if( isset( $this->local[$key] ) )
return $this->local[$key];
-
+
elseif( isset( $this->type[$key] ) )
return $this->type[$key];
-
+
elseif( isset( $this->global[$key] ) )
return $this->global[$key];
-
+
else
return false;
-
+
}
-
+
function local_settings(){
-
+
$set = $this->meta( $this->page->id, $this->pl_settings );
-
- return $this->get_by_mode($set);
-
+
+ return $this->get_by_mode($set);
+
}
-
+
function type_settings(){
-
+
$set = $this->meta( $this->page->typeid, $this->pl_settings );
-
- return $this->get_by_mode($set);
-
+
+ return $this->get_by_mode($set);
+
}
-
+
function get_setting( $key, $args = array() ){
-
+
$not_set = (isset($args['default'])) ? $args['default'] : false;
-
- return ( isset( $this->set[ $key ][0] ) ) ? $this->set[ $key ][0] : $not_set;
-
+
+ return ( isset( $this->set[ $key ][0] ) ) ? $this->set[ $key ][0] : $not_set;
+
}
-
+
function get_by_mode( $set ){
-
+
$set = wp_parse_args( $set, $this->default );
-
- return $set[ $this->draft->mode ];
+
+ return $set[ $this->draft->mode ];
}
-
-
+
+
}
@@ -460,32 +460,32 @@ function get_by_mode( $set ){
////////////////////////////////////////////////////////////////////
-//
-// TODO rewrite all this to use the ^^ above classes methods...
+//
+// TODO rewrite all this to use the ^^ above classes methods...
//
////////////////////////////////////////////////////////////////////
function pl_opt( $key, $default = false, $parse = false ){
-
- $val = get_option($key);
-
+
+ $val = get_option($key);
+
if( !$val ){
-
+
$val = $default;
} elseif( $parse && is_array($val) && is_array($default)) {
-
+
$val = wp_parse_args( $val, $default );
-
+
}
-
+
return $val;
-
+
}
function pl_opt_update( $key, $value ){
-
+
update_option($key, $value);
-
+
}
@@ -496,160 +496,160 @@ function pl_opt_update( $key, $value ){
function pl_meta_setting( $key, $metaID ){
-
+
global $pldrft;
-
+
$mode = $pldrft->mode;
-
+
$set = pl_meta( $metaID, PL_SETTINGS );
-
+
$settings = ( isset($set[ $mode ]) ) ? $set[ $mode ] : array();
-
+
return ( isset( $settings[ $key ] ) ) ? $settings[ $key ] : false;
-
+
}
function pl_global_setting( $key ){
-
+
global $pldrft;
-
+
$mode = $pldrft->mode;
-
- $set = pl_opt( PL_SETTINGS );
-
+
+ $set = pl_opt( PL_SETTINGS );
+
$settings = ( isset($set[ $mode ]) ) ? $set[ $mode ] : array();
-
+
return ( isset( $settings[ $key ] ) ) ? $settings[ $key ] : false;
}
/*
*
- * Local Option
+ * Local Option
*
*/
function pl_settings( $mode = 'draft', $metaID = false ){
$default = array( 'draft' => array(), 'live' => array() );
-
+
if( $metaID ){
-
+
$set = pl_meta( $metaID, PL_SETTINGS, $default );
-
+
} else {
- $set = pl_opt(PL_SETTINGS, $default);
-
+ $set = pl_opt(PL_SETTINGS, $default);
+
}
-
+
$settings = ( isset($set[ $mode ]) ) ? $set[ $mode ] : $default;
-
+
return $settings;
-
+
}
function pl_settings_update( $new_settings, $mode = 'draft', $metaID = false ){
-
+
$default = array( 'draft' => array(), 'live' => array() );
-
-
+
+
if( $metaID )
$settings = pl_meta( $metaID, PL_SETTINGS );
- else
+ else
$settings = pl_opt(PL_SETTINGS);
-
+
$settings = wp_parse_args($settings, pl_settings_default());
- $settings[ $mode ] = wp_parse_args( $new_settings, $settings[ $mode ] );
+ $settings[ $mode ] = wp_parse_args( $new_settings, $settings[ $mode ] );
if( $metaID )
pl_meta_update( $metaID, PL_SETTINGS, $settings );
else
pl_opt_update( PL_SETTINGS, $settings );
-
+
return $settings;
}
function pl_revert_settings( $metaID = false ){
-
+
if( $metaID ){
$set = pl_meta( $metaID, PL_SETTINGS, pl_settings_default() );
-
+
} else {
- $set = pl_opt(PL_SETTINGS, pl_settings_default());
+ $set = pl_opt(PL_SETTINGS, pl_settings_default());
}
-
- $set['draft'] = $set['live'];
-
+
+ $set['draft'] = $set['live'];
+
if( $metaID )
pl_meta_update( $metaID, PL_SETTINGS, $set );
else
pl_opt_update( PL_SETTINGS, $set );
-
+
}
function pl_publish_settings( $pageID, $typeID ){
-
- $settings = array();
-
+
+ $settings = array();
+
$settings['local'] = pl_meta( $pageID, PL_SETTINGS );
$settings['type'] = pl_meta( $typeID, PL_SETTINGS );
$settings['global'] = pl_opt( PL_SETTINGS );
$settings['local-map'] = pl_meta( $pageID, 'pl-template-map' );
$settings['global-map'] = pl_opt( 'pl-template-map' );
-
-
+
+
foreach($settings as $scope => $set){
-
+
$set = wp_parse_args($set, array('live'=> array(), 'draft' => array()));
-
+
$set['live'] = $set['draft'];
-
+
$settings[ $scope ] = $set;
-
+
}
-
+
pl_meta_update( $pageID, PL_SETTINGS, $settings['local'] );
pl_meta_update( $typeID, PL_SETTINGS, $settings['type'] );
pl_opt_update( PL_SETTINGS, $settings['global'] );
-
+
pl_meta_update( $pageID, 'pl-template-map', $settings['local-map'] );
pl_opt_update( 'pl-template-map', $settings['global-map'] );
-
+
// Flush less
do_action( 'extend_flush' );
-
+
}
/*
*
- * Type Option
+ * Type Option
*
*/
/*
*
- * Global Option
+ * Global Option
*
*/
function pl_opt_global( $mode = 'draft' ){
$default = array( 'draft' => array(), 'live' => array() );
-
- $option_set = pl_opt(PL_SETTINGS, $default);
-
- return $option_set[ $mode ];
+
+ $option_set = pl_opt(PL_SETTINGS, $default);
+
+ return $option_set[ $mode ];
}
function pl_opt_update_global( $set, $mode = 'draft'){
-
+
$default = array( 'draft' => array(), 'live' => array() );
-
- $option_set = pl_opt(PL_SETTINGS, $default);
-
+
+ $option_set = pl_opt(PL_SETTINGS, $default);
+
if($mode == 'draft'){
- $option_set['draft'] = wp_parse_args($set, $option_set['draft']);
+ $option_set['draft'] = wp_parse_args($set, $option_set['draft']);
}
-
- pl_opt_update( PL_SETTINGS, $option_set );
-
+
+ pl_opt_update( PL_SETTINGS, $option_set );
+
}
diff --git a/editor/editor.typography.php b/editor/editor.typography.php
index 696f3c70..efa30991 100644
--- a/editor/editor.typography.php
+++ b/editor/editor.typography.php
@@ -2,89 +2,89 @@
class EditorTypography{
-
+
var $default_font = '"Helvetica", Arial, serif';
var $import_fonts = array();
-
+
function __construct( PageLinesFoundry $foundry ){
-
+
$this->foundry = $foundry;
-
+
add_filter('pl_settings_array', array(&$this, 'add_settings'));
add_filter('pless_vars', array(&$this, 'add_less_vars'));
add_action('wp_head', array(&$this, 'add_google_imports'));
}
-
+
function add_less_vars( $vars ){
-
- $vars['plFontSize'] = (pl_setting('base_font_size')) ? sprintf( '%spx', pl_setting('base_font_size' ) ) : '14px';
-
+
+ $vars['plFontSize'] = (pl_setting('base_font_size')) ? sprintf( '%spx', pl_setting('base_font_size' ) ) : '14px';
+
// Base Font
$primary = $this->import_fonts[] = (pl_setting('font_primary')) ? pl_setting('font_primary') : $this->default_font;
$alt = $this->import_fonts[] = (pl_setting('font_secondary')) ? pl_setting('font_secondary') : $this->default_font;
$hdr = $this->import_fonts[] = (pl_setting('font_headers')) ? pl_setting('font_headers') : $this->default_font;
-
- $vars['plBaseFont'] = $this->foundry->get_stack( $primary );
- $vars['plAltFont'] = $this->foundry->get_stack( $alt );
- $vars['plHeaderFont'] = $this->foundry->get_stack( $hdr );
-
-
- $vars['plBaseWeight'] = ( pl_setting('font_primary_weight') ) ? pl_setting('font_primary_weight') : 'normal';
- $vars['plAltWeight'] = ( pl_setting('font_secondary_weight') ) ? pl_setting('font_secondary_weight') : 'normal';
- $vars['plHeaderWeight'] = ( pl_setting('font_headers_weight') ) ? pl_setting('font_headers_weight') : 'bold';
-
+
+ $vars['plBaseFont'] = $this->foundry->get_stack( $primary );
+ $vars['plAltFont'] = $this->foundry->get_stack( $alt );
+ $vars['plHeaderFont'] = $this->foundry->get_stack( $hdr );
+
+
+ $vars['plBaseWeight'] = ( pl_setting('font_primary_weight') ) ? pl_setting('font_primary_weight') : 'normal';
+ $vars['plAltWeight'] = ( pl_setting('font_secondary_weight') ) ? pl_setting('font_secondary_weight') : 'normal';
+ $vars['plHeaderWeight'] = ( pl_setting('font_headers_weight') ) ? pl_setting('font_headers_weight') : 'bold';
+
return $vars;
}
-
+
function add_google_imports(){
-
- $import = $this->foundry->google_import( $this->import_fonts );
-
+
+ $import = $this->foundry->google_import( $this->import_fonts );
+
printf('%2$s', $import, "\n");
}
-
+
function add_settings( $settings ){
-
+
$settings['typography'] = array(
- 'name' => 'Typography',
+ 'name' => 'Typography',
'icon' => 'icon-font',
'pos' => 3,
'opts' => $this->options()
);
-
+
return $settings;
}
-
+
function options(){
-
+
$settings = array(
array(
'key' => 'base_font_size',
'type' => 'count_select',
'compile' => true,
- 'count_start' => 10,
+ 'count_start' => 10,
'count_number' => 50,
'suffix' => 'px',
'title' => __( 'Base Font Size', 'pagelines' ),
'help' => __( 'Select the base font size in pixels that all typographical elements will be based on.', 'pagelines' ),
- 'default' => 14
+ 'default' => 14
),
array(
'type' => 'multi',
- 'title' => __( 'Primary Text', 'pagelines' ),
+ 'title' => __( 'Primary Text', 'pagelines' ),
'opts' => array(
array(
'key' => 'font_primary',
- 'type' => 'type',
- 'label' => 'Header Font',
+ 'type' => 'type',
+ 'label' => 'Header Font',
'default' => 'helvetica',
'help' => __( 'Configure the typography for the text headers across your site. The base font size is a reference that will be scaled and used throughout the site.', 'pagelines' ),
- ),
+ ),
array(
'key' => 'font_primary_weight',
- 'type' => 'select',
+ 'type' => 'select',
'classes' => 'font-weight',
- 'label' => 'Font Weight',
+ 'label' => 'Font Weight',
'opts' => array(
'400' => array('name' => 'Normal (400)'),
'600' => array('name' => 'Semi-Bold (600)'),
@@ -95,8 +95,8 @@ function options(){
),
array(
'key' => 'font_primary_style',
- 'type' => 'select',
- 'label' => 'Font Style',
+ 'type' => 'select',
+ 'label' => 'Font Style',
'classes' => 'font-style',
'opts' => array(
'normal' => array('name' => 'Normal'),
@@ -108,26 +108,26 @@ function options(){
'compile' => true,
),
),
-
+
),
array(
'type' => 'multi',
- 'title' => __( 'Header Elements', 'pagelines' ),
-
+ 'title' => __( 'Header Elements', 'pagelines' ),
+
'opts' => array(
array(
'key' => 'font_headers',
- 'type' => 'type',
- 'label' => 'Header Font',
+ 'type' => 'type',
+ 'label' => 'Header Font',
'default' => 'helvetica',
'help' => __( 'Configure the typography for the text headers across your site. The base font size is a reference for <H6> that all text headers will use as a basis.', 'pagelines' ),
-
- ),
+
+ ),
array(
'key' => 'font_headers_weight',
- 'type' => 'select',
+ 'type' => 'select',
'classes' => 'font-weight',
- 'label' => 'Font Weight',
+ 'label' => 'Font Weight',
'opts' => array(
'400' => array('name' => 'Normal (400)'),
'600' => array('name' => 'Semi-Bold (600)'),
@@ -138,8 +138,8 @@ function options(){
),
array(
'key' => 'font_headers_style',
- 'type' => 'select',
- 'label' => 'Font Style',
+ 'type' => 'select',
+ 'label' => 'Font Style',
'classes' => 'font-style',
'opts' => array(
'normal' => array('name' => 'Normal'),
@@ -151,25 +151,25 @@ function options(){
'compile' => true,
),
),
-
+
),
-
+
array(
'type' => 'multi',
- 'title' => __( 'Secondary Text', 'pagelines' ),
-
+ 'title' => __( 'Secondary Text', 'pagelines' ),
+
'opts' => array(
array(
'key' => 'font_secondary',
- 'type' => 'type',
- 'label' => 'Header Font',
+ 'type' => 'type',
+ 'label' => 'Header Font',
'default' => 'helvetica',
'help' => __( 'Configure the typography for secondary text throughout your site. This font may be used in sub headers, or other various elements to add contrast.', 'pagelines' ),
- ),
+ ),
array(
'key' => 'font_secondary_weight',
- 'type' => 'select',
- 'label' => 'Font Weight',
+ 'type' => 'select',
+ 'label' => 'Font Weight',
'classes' => 'font-weight',
'opts' => array(
'400' => array('name' => 'Normal (400)'),
@@ -181,8 +181,8 @@ function options(){
),
array(
'key' => 'font_secondary_style',
- 'type' => 'select',
- 'label' => 'Font Style',
+ 'type' => 'select',
+ 'label' => 'Font Style',
'classes' => 'font-style',
'opts' => array(
'normal' => array('name' => 'Normal'),
@@ -194,16 +194,16 @@ function options(){
'compile' => true,
),
),
-
+
),
-
+
);
-
-
+
+
return $settings;
-
+
}
-
+
}
diff --git a/editor/editor.xlist.php b/editor/editor.xlist.php
index ce0e72b6..11f71731 100644
--- a/editor/editor.xlist.php
+++ b/editor/editor.xlist.php
@@ -1,25 +1,25 @@
-url = PL_PARENT_URL . '/editor';
}
-
+
function scripts(){
-
+
// Isotope
wp_enqueue_script( 'isotope', $this->url . '/js/utils.isotope.js', array('jquery'), PL_CORE_VERSION, true);
-
+
wp_enqueue_script( 'pl-js-xlist', $this->url . '/js/pl.xlist.js', array('jquery'), PL_CORE_VERSION, true);
-
+
}
-
+
function defaults(){
$d = array(
'id' => '',
@@ -27,18 +27,18 @@ function defaults(){
'data_array' => array(),
'thumb' => '',
'splash' => '',
- 'name' => 'No Name',
+ 'name' => 'No Name',
'sub' => false,
'actions' => '',
'format' => 'touchable',
'icon' => ''
);
-
+
return $d;
}
-
+
function get_x_list_item( $args ){
-
+
$args = wp_parse_args($args, $this->defaults());
$classes = join(' ', $args['class_array']);
@@ -51,16 +51,16 @@ function get_x_list_item( $args ){
foreach($args['data_array'] as $field => $val){
$datas .= sprintf("data-%s='%s' ", $field, $val);
}
-
- $sub = ($args['sub']) ? sprintf('%s
', $args['sub']) : '';
+
+ $sub = ($args['sub']) ? sprintf('%s
', $args['sub']) : '';
$thumb = ($args['thumb'] != '') ? sprintf("", $img) : '';
$icon = ($args['format'] == 'media' && $args['icon'] != '') ? sprintf("
", $args['icon']) : '';
$pad_class = ($args['format'] == 'media') ? 'media fix' : '';
-
- $xID = ($args['id'] != '') ? sprintf("data-extend-id='%s'", $args['id']) : '';
+
+ $xID = ($args['id'] != '') ? sprintf("data-extend-id='%s'", $args['id']) : '';
$list_item = sprintf(
"
@@ -70,9 +70,9 @@ function get_x_list_item( $args ){
%s
%s
- %s
+ %s
-
+
%s
@@ -87,42 +87,42 @@ function get_x_list_item( $args ){
$thumb,
$icon,
$args['name'],
- $sub,
-
+ $sub,
+
$args['actions']
);
return $list_item;
}
-
+
function get_action_out( $actions ){
-
+
if(!empty($actions)){
-
+
foreach($actions as $action){
-
+
$action = wp_parse_args($action, $this->defaults());
-
+
$action_classes = join(' ', $action['class_array']);
-
+
$action_datas = '';
foreach($action['data_array'] as $field => $val){
$action_datas .= sprintf("data-%s='%s' ", $field, $val);
}
-
+
$action_name = $action['name'];
-
- $action_output .= sprintf('%s ', $action_classes, $action_datas, $action_name);
-
+
+ $action_output .= sprintf('%s ', $action_classes, $action_datas, $action_name);
+
}
return sprintf('%s
', $action_output);
-
+
} else
return '';
-
-
-
+
+
+
}
-
+
}
\ No newline at end of file
diff --git a/editor/js/colorpicker/colorpicker.css b/editor/js/colorpicker/colorpicker.css
index 705e1477..4ca49281 100755
--- a/editor/js/colorpicker/colorpicker.css
+++ b/editor/js/colorpicker/colorpicker.css
@@ -2,11 +2,11 @@
input.color.alphaHex {
width: 5.25em;
}
-.color.selected,
+.color.selected,
.color.selected:focus {
border-color: rgba(0,0,0,.4);
box-shadow:inset 0 0 4px rgba(0,0,0,.4);
-
+
}
.color.error {
box-shadow: 0 0 3px 3px #d00;
diff --git a/editor/js/fineuploader/jquery.fineuploader-3.2.js b/editor/js/fineuploader/jquery.fineuploader-3.2.js
index 8fe3edd0..68971a4e 100644
--- a/editor/js/fineuploader/jquery.fineuploader-3.2.js
+++ b/editor/js/fineuploader/jquery.fineuploader-3.2.js
@@ -2522,7 +2522,7 @@ qq.UploadHandlerForm = function(o, uploadCompleteCallback, logCallback) {
/*globals qq, File, XMLHttpRequest, FormData*/
qq.UploadHandlerXhr = function(o, uploadCompleteCallback, logCallback) {
"use strict";
-
+
var options = o,
uploadComplete = uploadCompleteCallback,
log = logCallback,
diff --git a/editor/js/pl.ajax.js b/editor/js/pl.ajax.js
index 6f8fafce..42bb5a99 100644
--- a/editor/js/pl.ajax.js
+++ b/editor/js/pl.ajax.js
@@ -1,14 +1,14 @@
!function ($) {
-
-
+
+
/*
* AJAX Actions
*/
$.plAJAX = {
-
+
// Generalized AJAX Function
run: function( args ){
-
+
var that = this
, theData = {
action: 'pl_editor_actions'
@@ -25,114 +25,114 @@
, toolboxOpen: $.toolbox('open')
, beforeSend: ''
, postSuccess: ''
-
+
}
-
- // merge args into theData, overwriting theData w/ args
+
+ // merge args into theData, overwriting theData w/ args
$.extend(theData, args)
-
+
if( theData.confirm ){
-
+
if( theData.toolboxOpen && ( theData.refresh || theData.confirm ) )
$.toolbox('hide')
-
+
bootbox.confirm( theData.confirmText, function( result ){
-
+
if(result == true){
that.runAction( theData )
} else {
-
+
if( theData.toolboxOpen && ( theData.refresh || theData.confirm ) )
$('body').toolbox('show')
}
-
+
})
-
+
} else {
-
+
that.runAction( theData )
-
+
}
-
-
+
+
return ''
}
-
+
, runAction: function( theData ){
-
+
var that = this
$.ajax( {
type: 'POST'
, url: ajaxurl
- , data: theData
+ , data: theData
, beforeSend: function(){
-
+
$('.btn-saving').addClass('active')
if ( $.isFunction( theData.beforeSend ) )
theData.beforeSend.call( this )
if( theData.refresh ){
-
+
$.toolbox('hide')
$.pl.flags.refreshing = true
bootbox.dialog( that.dialogText( theData.savingText ), [ ], {animate: false})
}
-
-
+
+
}
, success: function( response ){
-
+
console.debug(response)
-
+
that.runSuccess( theData, response )
if( theData.refresh ){
-
+
// reopen toolbox after load if it was shown
if( theData.toolboxOpen )
store.set('toolboxShown', true)
-
+
bootbox.dialog( that.dialogText( theData.refreshText ), [ ], {animate: false})
location.reload()
-
+
} else {
-
+
if( theData.toolboxOpen && theData.confirm && !$.pl.flags.refreshing )
$('body').toolbox('show')
-
+
}
-
+
}
- })
+ })
}
-
+
, runSuccess: function( theData, response ){
if(log == 'true')
console.log(response)
-
+
var that = this
, rsp = $.parseJSON( response )
, log = (rsp.post) ? rsp.post.log || false : ''
-
+
if(log == 'true')
console.log(rsp)
-
+
if ( $.isFunction( theData.postSuccess ) )
theData.postSuccess.call( this, rsp )
-
+
that.ajaxSuccess(rsp)
}
-
+
, init: function(){
-
-
+
+
this.bindUIActions()
-
+
}
-
+
, saveData: function( opts ){
-
+
var args = {
mode: 'save'
, savingText: 'Saving Settings'
@@ -143,69 +143,69 @@
, run: 'draft'
, map: $.pl.map
}
-
+
$.extend( args, opts )
var response = $.plAJAX.run( args )
-
-
+
+
}
-
-
-
+
+
+
, toggleEditor: function(){
-
+
var that = this
, theData = {
action: 'pl_editor_mode'
, userID: $.pl.config.userID
}
-
+
confirmText = sprintf("Turn Off PageLines Editor? (Note: Draft mode is disabled when editor is off.)
")
bootbox.confirm( confirmText, function( result ){
if(result == true){
$.ajax( {
type: 'POST'
, url: ajaxurl
- , data: theData
+ , data: theData
, beforeSend: function(){
bootbox.dialog( that.dialogText('Deactivating...'), [], {animate: false})
}
, success: function( response ){
-
-
+
+
bootbox.dialog( that.dialogText('Editor deactivated! Reloading page.'), [], {animate: false})
-
+
window.location = $.pl.config.currentURL
}
})
}
})
-
+
}
-
+
, bindUIActions: function(){
-
+
var that = this
-
-
-
+
+
+
$( '.btn-save' ).on('click.saveButton', function(){
-
+
var btn = $(this)
, run = (btn.data('mode')) ? btn.data('mode') : ''
-
+
console.log(run)
$.plAJAX.saveData( { run: run, refresh: true } )
-
-
+
+
})
-
+
$('.btn-revert').on('click.revertbutton', function(e){
e.preventDefault()
-
+
var revert = $(this).data('revert')
, args = {
mode: 'save'
@@ -220,47 +220,47 @@
}
var response = $.plAJAX.run( args )
-
-
+
+
})
-
-
-
-
+
+
+
+
}
-
-
+
+
, ajaxSuccess: function( response ){
-
+
var state = response.state || false
-
+
$('.btn-saving').removeClass('active')
-
-
+
+
$('#stateTool')
.removeClass()
.addClass('dropup')
-
+
$.each(state, function(index, el){
console.log(el)
$('#stateTool').addClass(el)
})
-
+
}
-
-
+
+
, dialogText: function( text ){
-
+
var icon = ' '
, theHTML = sprintf('', icon, text)
-
+
return theHTML
-
-
+
+
}
}
-
-
-
+
+
+
}(window.jQuery);
\ No newline at end of file
diff --git a/editor/js/pl.areas.js b/editor/js/pl.areas.js
index 1110dd67..51273a81 100644
--- a/editor/js/pl.areas.js
+++ b/editor/js/pl.areas.js
@@ -1,55 +1,55 @@
!function ($) {
$.areaControl = {
-
+
toggle: function(btn) {
-
+
if(!jQuery.areaControl.isActive){
-
+
$('body')
.addClass('area-controls')
.find('area-tag')
.effect('highlight')
-
+
btn.addClass('active')
-
+
jQuery.areaControl.isActive = true
-
+
jQuery.areaControl.listen()
-
+
} else {
btn.removeClass('active')
jQuery.areaControl.isActive = false
$('body').removeClass('area-controls')
-
+
}
-
+
}
, listen: function() {
$('.btn-region').tooltip({placement: 'right'})
-
+
$('.area-control').on('click.areaControl', function(e){
e.preventDefault()
-
+
var action = $(this).data('area-action')
-
+
if(action == 'down' ){
$.areaControl.move($(this), 'down')
} else if (action == 'up' ){
$.areaControl.move($(this), 'up')
} else if (action == 'settings' ){
$.areaControl.areaSettings($(this))
-
+
}else if (action == 'delete' ){
$.areaControl.deleteArea($(this))
}
})
-
-
- }
-
+
+
+ }
+
, update: function() {
$('.area-tag').each( function(index) {
@@ -60,24 +60,24 @@
.attr('data-area-number', num)
})
-
+
$.pageBuilder.storeMap()
}
-
+
, areaSettings: function( btn ){
-
+
var that = this
, theArea = btn.closest('.pl-area')
, theID = theArea.attr('id')
, object = theArea.data('object') || false
-
+
if( object ){
var config = {
sid: theArea.data('sid')
, sobj: theArea.data('object')
, clone: theArea.data('clone')
}
-
+
$('body').toolbox({
action: 'show'
, panel: 'section-options'
@@ -87,7 +87,7 @@
}
})
-
+
} else {
$('body').toolbox({
action: 'show'
@@ -97,15 +97,15 @@
}
})
}
-
-
-
-
-
+
+
+
+
+
}
-
+
, areaPanelRender: function( theID ){
-
+
var theID = theID || store.get('lastAreaConfig')
, config = {
mode: 'object'
@@ -113,33 +113,33 @@
, settings: $.pl.config.areaSettings
, objectID: theID
}
-
+
$.optPanel.render( config )
-
+
}
-
+
, deleteArea: function( btn ){
-
+
var currentArea = btn.closest('.pl-area')
, confirmText = 'Are you sure? This action will delete this area and all its elements from this page.
'
-
+
bootbox.confirm( confirmText, function( result ){
if(result == true){
-
+
currentArea.slideUp(500, function(){
$(this).remove()
$.areaControl.update()
})
-
+
}
})
-
-
-
+
+
+
}
-
+
, move: function( button, direction ){
@@ -182,6 +182,6 @@
$.areaControl.update()
}
-
+
}
}(window.jQuery);
\ No newline at end of file
diff --git a/editor/js/pl.code.js b/editor/js/pl.code.js
index 21382932..0081e6e3 100644
--- a/editor/js/pl.code.js
+++ b/editor/js/pl.code.js
@@ -1,74 +1,74 @@
!function ($) {
$.plCode = {
-
+
activateLESS: function( ){
-
+
var lessText = $(".custom-less")
, scriptsText = $(".custom-scripts")
-
-
+
+
if( !lessText.hasClass('mirrored') ){
-
+
var editor = CodeMirror.fromTextArea( lessText.addClass('mirrored').get(0), {
lineNumbers: true
, mode: 'text/x-less'
, lineWrapping: true
, onKeyEvent: function(instance, e){
-
+
lessText.val( instance.getValue() )
var theCode = lessText.parent().formParams()
-
+
$.pl.data.global = $.extend(true, $.pl.data.global, theCode)
-
+
// Keyboard shortcut for live LESS previewing
if(e.type == 'keydown' && e.which == 13 && (e.metaKey || e.ctrlKey) ){
$('#pl-custom-less').text(instance.getValue())
-
+
}
-
+
}
})
-
+
editor.on('blur', function(instance, changeObj){
-
+
$.plAJAX.saveData( )
})
-
-
+
+
}
-
-
+
+
}
-
+
, activateScripts: function(){
-
+
var lessText = $(".custom-less")
, scriptsText = $(".custom-scripts")
-
+
if( !scriptsText.hasClass('mirrored') ){
-
+
var editor2 = CodeMirror.fromTextArea( scriptsText.addClass('mirrored').get(0), {
lineNumbers: true
, mode: 'htmlmixed'
, lineWrapping: true
, onKeyEvent: function(instance, e){
-
+
scriptsText.val( instance.getValue() )
var theCode = scriptsText.parent().formParams()
-
+
$.pl.data.global = $.extend(true, $.pl.data.global, theCode)
-
+
}
-
+
})
editor2.on('blur', function(instance, changeObj){
$.plAJAX.saveData( )
})
-
+
}
}
diff --git a/editor/js/pl.editor.js b/editor/js/pl.editor.js
index efc8b480..33ba2691 100644
--- a/editor/js/pl.editor.js
+++ b/editor/js/pl.editor.js
@@ -1,8 +1,8 @@
// PageLines Editor - Copyright 2013
!function ($) {
-
- // --> Initialize
+
+ // --> Initialize
$(document).ready(function() {
$('.pl-sortable-area .pl-section').addClass('pl-sortable')
@@ -10,39 +10,39 @@
$.pageTools.startUp()
})
-
+
// Event Listening
$.pageTools = {
-
+
startUp: function(){
-
+
$.pageBuilder.reloadConfig( 'start' )
this.theToolBox = $('body').toolbox()
-
- $.pageBuilder.showEditingTools()
-
- $.plAJAX.init()
-
+
+ $.pageBuilder.showEditingTools()
+
+ $.plAJAX.init()
+
$.plTemplates.init()
-
+
this.bindUIActions()
-
+
}
-
+
, bindUIActions: function() {
-
+
that = this
-
+
// Click event listener
$(".btn-toolbox").on("click.toolboxHandle", function(e) {
-
+
e.preventDefault()
-
-
+
+
var btn = $(this)
, btnAction = btn.data('action')
-
+
if( btnAction == 'drag-drop' )
$.pageBuilder.showEditingTools()
else if( btn.hasClass('btn-panel') )
@@ -50,27 +50,27 @@
else if( btn.hasClass('btn-toggle-grid') )
that.toggleGrid( btn )
})
-
+
$(".btn-action").on("click.actionButton", function(e) {
-
+
e.preventDefault()
-
+
var btn = $(this)
, btnAction = btn.data('action')
-
+
if( btnAction == 'pl-toggle' )
$.plAJAX.toggleEditor( btnAction )
if( btnAction == 'toggle_grid' )
that.toggleGrid()
-
+
})
-
-
+
+
}
, toggleGrid: function( btn ){
-
+
if($('body').hasClass('drag-drop-editing')){
btn.addClass('active-tab')
$('body').removeClass('drag-drop-editing width-resize')
@@ -78,165 +78,165 @@
btn.removeClass('active-tab')
$('body').addClass('drag-drop-editing width-resize')
}
-
+
}
-
+
, showPanel: function( key ){
-
+
var selectedPanel = $('.panel-'+key)
, selectedTab = $('[data-action="'+key+'"]')
, allPanels = $('.tabbed-set')
-
+
$('body')
.toolbox('show')
-
+
store.set('toolboxPanel', key)
-
+
if(selectedPanel.hasClass('current-panel'))
return
-
+
$('.btn-toolbox:not(.btn-toggle-grid)').removeClass('active-tab')
-
+
allPanels
.removeClass( 'current-panel' )
.hide()
-
+
$('.ui-tabs').tabs('destroy')
-
+
selectedPanel.tabs({
create: function(event, ui){
-
+
selectedPanel.find('.tabs-nav li').on('click.panelTab', function(){
var theIsotope = selectedPanel.find('.isotope')
, removeItems = $('.x-remove')
-
+
if( $(this).data('filter') ){
theIsotope
.isotope({ filter: $(this).data('filter') })
.isotope('remove', removeItems)
.removeClass('x-pane-mode')
}
-
-
+
+
})
}
, activate: function(e, ui){
-
+
var theTab = ui.newTab
, tabAction = theTab.attr('data-tab-action') || ''
, tabPanel = $("[data-panel='"+tabAction+"']")
, tabFlag = theTab.attr('data-flag') || ''
-
+
if (tabFlag == 'custom-scripts'){
-
-
+
+
$.plCode.activateScripts()
-
+
} else if ( tabFlag == 'link-storefront' ){
-
+
e.preventDefault()
-
+
$('.btn-pl-extend')
.trigger('click')
-
+
}
-
+
}
})
-
+
selectedPanel
.addClass('current-panel')
.show()
-
-
+
+
// Has to be after shown
if( key == 'settings'){
-
+
var config = {
mode: 'settings'
, sid: 'settings'
, settings: $.pl.config.settings
}
-
+
$.optPanel.render( config )
-
+
}
else if( key == 'area_settings'){
areaID = store.get('lastAreaConfig')
-
+
if(areaID != ''){
$.areaControl.areaPanelRender(areaID)
} else {
$('body')
.toolbox('hide')
}
-
-
-
-
+
+
+
+
}
else if( key == 'live'){
-
+
var liveFrame = '
'
selectedPanel
.find('.panel-tab-content')
.html(liveFrame)
-
+
}
-
+
else if (key == 'pl-design'){
$.plCode.activateLESS()
-
+
} else if (key == 'section-options'){
-
+
$('body').toolbox({
action: 'show'
, panel: key
, info: function(){
-
+
$.optPanel.render( config )
-
+
}
})
-
- }
-
+
+ }
+
selectedTab.addClass('active-tab')
-
+
$.xList.listStop()
-
+
$.xList.listStart(selectedPanel, key)
-
+
}
-
+
, stateInit: function( key, call_on_true, call_on_false, toggle ){
-
+
var localState = ( localStorage.getItem( key ) )
, theState = (localState == 'true') ? true : false
-
-
+
+
if( toggle ){
theState = (theState) ? false : true;
localStorage.setItem( key, theState )
}
-
+
if (!theState){
-
- $('[data-action="'+key+'"]').removeClass('active-tab')
-
+
+ $('[data-action="'+key+'"]').removeClass('active-tab')
+
if($.isFunction(call_on_false))
call_on_false.call( key )
}
-
+
if (theState){
-
+
$('[data-action="'+key+'"]').addClass('active-tab')
-
+
if($.isFunction(call_on_true))
call_on_true.call( key )
}
-
+
}
}
@@ -245,66 +245,66 @@
$.pageBuilder = {
toggle: function( ){
-
+
var localState = ( localStorage.getItem( 'drag-drop' ) )
, theState = (localState == 'true') ? true : false
-
+
if( !theState ){
-
- theState = true
-
+
+ theState = true
+
$.pageBuilder.showEditingTools()
-
+
} else {
-
+
theState = false
-
+
$.pageBuilder.hide()
-
+
}
-
+
localStorage.setItem( 'drag-drop', theState )
-
+
}
-
+
, showEditingTools: function() {
-
+
// Graphical Flare
$('[data-action="drag-drop"]').addClass('active')
-
+
// Enable CSS
$('body').addClass('drag-drop-editing')
-
+
// JS
$.pageBuilder.startDroppable()
-
+
$.pageBuilder.sectionControls()
-
+
$.areaControl.toggle($(this))
-
+
$.widthResize.startUp()
-
-
-
+
+
+
}
-
+
, hide: function() {
-
+
$('body').removeClass('drag-drop-editing')
-
+
$('[data-action="drag-drop"]').removeClass('active')
-
+
$('.s-control')
.off('click.sectionControls')
-
+
$.areaControl.toggle($(this))
-
+
$.widthResize.shutDown()
-
+
}
-
+
, handleCloneData: function( cloned ){
-
+
var config = {
sid: cloned.data('sid')
, sobj: cloned.data('object')
@@ -348,15 +348,15 @@
// save settings data
$.plAJAX.saveData( )
-
+
}
-
+
, sectionControls: function() {
-
+
$('.s-control').on('click.sectionControls', function(e){
-
+
e.preventDefault()
-
+
var btn = $(this)
, section = btn.closest(".pl-sortable")
, config = {
@@ -364,62 +364,62 @@
, sobj: section.data('object')
, clone: section.data('clone')
}
-
+
if(btn.hasClass('section-edit')){
-
+
// TODO Open up and load options panel
-
+
$('body').toolbox({
action: 'show'
, panel: 'section-options'
, info: function(){
-
+
$.optPanel.render( config )
-
+
}
})
-
+
} else if (btn.hasClass('section-delete')){
-
+
var answer = confirm ("Press OK to delete section or Cancel");
if (answer) {
-
+
section.remove();
section.addClass('empty-column')
store.remove('toolboxShown')
-
+
}
-
+
} else if (btn.hasClass('section-clone')){
-
+
var cloned = section.clone( true )
-
+
cloned
.insertAfter(section)
.hide()
.fadeIn()
-
+
$.pageBuilder.handleCloneData( cloned )
-
-
+
+
} else if (btn.hasClass('column-popup')){
-
+
// Pop to top level
-
+
var answer = confirm ("Press OK to pop (move) section to the top level or cancel.")
-
+
if (answer)
section.appendTo('.pl_main_sortable') //insertBefore('.wpb_main_sortable div.wpb_clear:last');
-
-
+
+
} else if ( btn.hasClass('section-increase')){
-
+
var sizes = $.plMapping.getColumnSize(section)
if ( sizes[1] )
section.removeClass( sizes[0] ).addClass( sizes[1] )
-
+
} else if ( btn.hasClass('section-decrease')){
var sizes = $.plMapping.getColumnSize( section )
@@ -429,12 +429,12 @@
} else if ( btn.hasClass('section-offset-increase')){
-
+
var sizes = $.plMapping.getOffsetSize( section )
if (sizes[1])
section.removeClass(sizes[0]).addClass(sizes[1])
-
+
} else if ( btn.hasClass('section-offset-reduce')){
@@ -442,37 +442,37 @@
if (sizes[1])
section.removeClass(sizes[0]).addClass(sizes[2])
-
+
} else if ( btn.hasClass('section-start-row') ){
-
+
section.toggleClass('force-start-row')
-
+
}
-
+
$.pageBuilder.reloadConfig( 'section-control' )
-
+
})
-
+
}
-
-
+
+
, reloadConfig: function( source ) {
-
+
console.log(source)
-
+
$('.editor-row').each(function () {
$.pageBuilder.alignGrid( this )
})
-
+
if( source !== 'start' )
$.pageBuilder.storeMap()
-
+
}
, alignGrid: function( area ) {
-
+
var that = this
, total_width = 0
, width = 0
@@ -480,64 +480,64 @@
, avail_offset = 0
, sort_area = $(area)
, len = sort_area.children(".pl-sortable").length
-
+
that.isAreaEmpty( sort_area )
sort_area.children(".pl-sortable:not(.pl-sortable-buffer)").each( function ( index ) {
-
+
var section = $(this)
, col_size = $.plMapping.getColumnSize( section )
, off_size = $.plMapping.getOffsetSize( section )
-
-
+
+
if(sort_area.hasClass('pl-sortable-column')){
-
+
if(section.hasClass('level1')){
section
.removeClass('level1')
.removeClass(col_size[0])
.removeClass(off_size[0])
.addClass('span12 offset0 level2')
-
+
col_size = $.plMapping.getColumnSize( section, true )
off_size = $.plMapping.getOffsetSize( section, true )
} else {
section
.addClass('level2')
}
-
+
} else {
-
+
section
.removeClass("level2")
.addClass("level1")
-
+
}
-
+
// First/last spacing
section
.removeClass("sortable-first sortable-last")
-
+
if ( index == 0 )
section.addClass("sortable-first")
- else if ( index === len - 1 )
+ else if ( index === len - 1 )
section.addClass("sortable-last")
-
-
+
+
// Deal with width and offset
width = col_size[4] + off_size[3]
-
+
total_width += width
-
+
avail_offset = 12 - col_size[4];
-
+
if( avail_offset == 0 )
section.addClass('cant-offset')
- else
+ else
section.removeClass('cant-offset')
-
+
if(width > 12){
- avail_offset = 12 - col_size[4];
+ avail_offset = 12 - col_size[4];
section.removeClass( off_size[0] ).addClass( 'offset'+avail_offset )
off_size = $.plMapping.getOffsetSize( section )
}
@@ -545,78 +545,78 @@
// Set Numbers
section.find(".section-size:first").html( col_size[3] )
section.find(".offset-size:first").html( off_size[3] )
-
+
if (total_width > 12 || section.hasClass('force-start-row')) {
-
+
section
.addClass('sortable-first')
.prev('.pl-sortable')
.addClass("sortable-last")
-
+
total_width = width
- }
+ }
})
}
-
+
, storeMap: function( interrupt ) {
-
+
var that = this
, interrupt = interrupt || false
, map = $.plMapping.getCurrentMap()
-
+
$.pl.map = map
-
- $.plAJAX.saveData( {
- run: 'map'
+
+ $.plAJAX.saveData( {
+ run: 'map'
, postSuccess: function( rsp ){
-
+
if(!rsp)
- return
-
+ return
+
console.log(rsp)
-
+
if(rsp.changes && rsp.changes.local == 1){
console.log(rsp.changes.local)
-
+
$('.x-item-actions')
.removeClass('active-template')
-
- }
-
-
+
+ }
+
+
}
} )
-
+
return map
-
-
+
+
}
-
-
+
+
, isAreaEmpty: function(area){
var addTo = (area.hasClass('pl-sortable-column')) ? area.parent() : area
-
+
if(!area.children(".pl-sortable").not('.ui-sortable-helper').length)
addTo.addClass('empty-area')
- else
+ else
addTo.removeClass('empty-area')
-
+
}
-
+
, startDroppable: function(){
-
+
var that = this
, sortableArgs = {}
-
-
-
+
+
+
$( '.section-plcolumn' ).on('mousedown', function(e){
$('.section-plcolumn .pl-sortable-area').sortable( "disable" )
$( '.section-plcolumn .pl-section' ).removeClass('pl-sortable')
@@ -624,20 +624,20 @@
$('.section-plcolumn .pl-sortable-area').sortable( "enable" )
$( '.section-plcolumn .pl-section' ).addClass('pl-sortable')
})
-
- $( '.pl-sortable-area' ).sortable( that.sortableArguments( 'section' ) )
-
-
+
+ $( '.pl-sortable-area' ).sortable( that.sortableArguments( 'section' ) )
+
+
// AREA drag and drop
$( '.pl-area-container' ).sortable( that.sortableArguments( 'area' ) )
-
-
-
+
+
+
}
-
+
, sortableArguments: function( type ){
-
+
var that = this
, type = type || 'section'
, sortableSettings = {}
@@ -645,7 +645,7 @@
, container = ( type == 'section' ) ? '.pl-sortable-area' : '.pl-area-container'
, placeholder = ( type == 'section' ) ? 'pl-placeholder' : 'pl-area-placeholder'
, handle = ( type == 'section' ) ? false : '.area-reorder'
-
+
sortableSettings = {
items: items
, connectWith: container
@@ -660,7 +660,7 @@
, delay: 100
, handle: handle
, start: function(event, ui){
-
+
$('body')
.addClass('pl-dragging')
.toolbox('hide')
@@ -669,11 +669,11 @@
$.plSections.switchOnAdd(ui.item)
// allows us to change sizes when dragging starts, while keeping good dragging
- $( this ).sortable( "refreshPositions" )
+ $( this ).sortable( "refreshPositions" )
+
-
- // Prevents double nesting columns and other recursion bugs.
- // Remove all drag and drop elements and disable sortable areas within columns if
+ // Prevents double nesting columns and other recursion bugs.
+ // Remove all drag and drop elements and disable sortable areas within columns if
// the user is dragging a column
if( ui.item.hasClass('section-plcolumn') ){
@@ -683,8 +683,8 @@
$( '.ui-sortable' ).sortable( 'refresh' )
}
-
- }
+
+ }
, stop: function(event, ui){
$('body')
@@ -720,21 +720,21 @@
that.reloadConfig( 'update-sortable' )
}
}
-
+
return sortableSettings
}
-
-
-
-
-
-
-
+
+
+
+
+
+
+
}
-
-
-
-
+
+
+
+
}(window.jQuery);
diff --git a/editor/js/pl.layout.js b/editor/js/pl.layout.js
index df5a54e2..24aa409f 100644
--- a/editor/js/pl.layout.js
+++ b/editor/js/pl.layout.js
@@ -1,75 +1,75 @@
!function ($) {
$.widthResize = {
-
+
checkWindowEdges: function( widthSel ){
-
+
if(widthSel.width() >= ($(window).width() - 10))
$('body').addClass('width-resize-edge')
- else
+ else
$('body').removeClass('width-resize-edge')
}
-
+
, startUp: function(){
-
+
var widthSel = $('.pl-content')
-
+
$('body').addClass('width-resize')
$.widthResize.checkWindowEdges(widthSel)
- widthSel.resizable({
+ widthSel.resizable({
handles: "e, w",
minWidth: 400,
-
+
start: function(event, ui){
$('body').addClass('width-resizing')
-
+
$('.btn-layout-resize').addClass('active')
}
-
+
, stop: function(event, ui){
$('body').removeClass('width-resizing')
$('.btn-layout-resize').removeClass('active')
-
+
$.plAJAX.saveData( )
}
-
- , resize: function(event, ui) {
-
+
+ , resize: function(event, ui) {
+
var resizeWidth = ui.size.width
, resizeOrigWidth = ui.originalSize.width
, resizeNewWidth = resizeOrigWidth + ((resizeWidth - resizeOrigWidth) * 2)
, windowWidth = $(window).width()
, layoutMode = $.pl.flags.layoutMode
-
+
resizeNewWidth = (resizeNewWidth < 480) ? 480 : resizeNewWidth
resizeNewWidth = ( resizeNewWidth >= windowWidth ) ? windowWidth : resizeNewWidth
-
+
var percentWidth = Math.round( ( resizeNewWidth / windowWidth ) * 100 ) + '%'
, pixelWidth = resizeNewWidth+'px'
, theSetWidth = (layoutMode == 'percent') ? percentWidth : pixelWidth
-
-
+
+
widthSel
.css('left', 'auto')
.css('height', 'auto')
.width( 'auto' )
.css('max-width', theSetWidth)
-
+
$.widthResize.checkWindowEdges(widthSel)
// always set options w/ arrays
$.pl.data.global.content_width_px = [pixelWidth]
$.pl.data.global.content_width_percent = [percentWidth]
-
+
$('.resize-px').html(pixelWidth)
$('.resize-percent').html(percentWidth)
-
+
}
})
-
+
$('.ui-resizable-handle')
.hover(
function () {
@@ -79,20 +79,20 @@ $.widthResize = {
$('body').removeClass("resize-hover")
}
)
-
+
}
, shutDown: function(){
-
+
var widthSel = $('.pl-content')
-
+
$('body').removeClass('width-resize')
-
+
$(".ui-resizable-handle").unbind('mouseenter mouseleave')
-
+
widthSel.resizable( "destroy" )
-
-
-
+
+
+
}
}
diff --git a/editor/js/pl.library.js b/editor/js/pl.library.js
index e41255a6..b6c48bf2 100644
--- a/editor/js/pl.library.js
+++ b/editor/js/pl.library.js
@@ -2,10 +2,10 @@
function plIsset(variable){
if(typeof(variable) != "undefined" && variable !== null)
return true
- else
+ else
return false
}
-
+
/* Data cleanup and handling
* ============================================= */
function pl_html_input( text ) {
diff --git a/editor/js/pl.mapping.js b/editor/js/pl.mapping.js
index a555b3cb..08e6572c 100644
--- a/editor/js/pl.mapping.js
+++ b/editor/js/pl.mapping.js
@@ -1,9 +1,9 @@
!function ($) {
$.plMapping = {
-
+
getCurrentMap: function() {
-
+
var that = this
, map = {}
@@ -22,15 +22,15 @@
var section = $(this)
, sectionsTemplate = section.data('template') || ''
-
+
if( sectionsTemplate != "" ){
-
+
$.merge( areaContent, sectionsTemplate )
-
+
} else {
set = that.sectionConfig( section )
areaContent.push( set )
-
+
}
})
@@ -52,39 +52,39 @@
map[region] = areaConfig
})
-
+
return map
-
+
}
-
+
, sectionConfig: function( section ){
-
+
var that = this
, set = {}
set.object = section.data('object')
set.clone = section.data('clone')
set.sid = section.data('sid')
-
+
set.span = that.getColumnSize( section )[ 4 ]
set.offset = $.plMapping.getOffsetSize( section )[ 3 ]
set.newrow = (section.hasClass('force-start-row')) ? 'true' : 'false'
set.content = []
-
-
+
+
// Recursion
section.find( '.pl-section.level2' ).each( function() {
-
+
set.content.push( that.sectionConfig( $(this) ) )
-
+
})
-
+
return set
-
+
}
-
+
, getOffsetSize: function( column, defaultValue ) {
-
+
var that = this
, max = 12
, sizes = that.getColumnSize( column )
@@ -95,7 +95,7 @@
next = ( i == avail ) ? 0 : i+1
- prev = ( i == 0 ) ? avail : i-1
+ prev = ( i == 0 ) ? avail : i-1
if(column.hasClass("offset"+i))
data = new Array("offset"+i, "offset"+next, "offset"+prev, i)
@@ -108,7 +108,7 @@
return data
}
-
+
, getColumnSize: function(column, defaultValue) {
@@ -117,7 +117,7 @@
else if (column.hasClass("span11")) //five-sixth
return new Array("span11", "span12", "span10", "11/12", 11)
-
+
else if (column.hasClass("span10")) //five-sixth
return new Array("span10", "span11", "span9", "10/12", 10)
@@ -126,16 +126,16 @@
else if (column.hasClass("span8")) //two-third
return new Array("span8", "span9", "span7", "8/12", 8)
-
- else if (column.hasClass("span7"))
+
+ else if (column.hasClass("span7"))
return new Array("span7", "span8", "span6", "7/12", 7)
else if (column.hasClass("span6")) //one-half
return new Array("span6", "span7", "span5", "6/12", 6)
- else if (column.hasClass("span5"))
+ else if (column.hasClass("span5"))
return new Array("span5", "span6", "span4", "5/12", 5)
-
+
else if (column.hasClass("span4")) // one-third
return new Array("span4", "span5", "span3", "4/12", 4)
@@ -149,7 +149,7 @@
return false
}
-
+
}
-
+
}(window.jQuery);
\ No newline at end of file
diff --git a/editor/js/pl.optpanel.js b/editor/js/pl.optpanel.js
index 890a55ed..692b4c64 100644
--- a/editor/js/pl.optpanel.js
+++ b/editor/js/pl.optpanel.js
@@ -1,7 +1,7 @@
!function ($) {
-
+
$.optPanel = {
-
+
defaults: {
mode: 'section-options'
, sid: ''
@@ -11,77 +11,77 @@
, settings: {}
, objectID: ''
}
-
+
, cascade: ['local', 'type', 'global']
-
+
, render: function( config ) {
-
+
var that = this
, opts
, config = config || store.get('lastSectionConfig')
-
+
that.config = $.extend({}, that.defaults, typeof config == 'object' && config)
-
+
var mode = that.config.mode
, panel = (that.config.panel != '') ? that.config.panel : mode
-
+
store.set('lastSectionConfig', config)
-
+
if(mode == 'object')
store.set('lastAreaConfig', that.config.objectID)
-
+
that.sobj = that.config.sobj
that.sid = that.config.sid
that.clone = that.config.clone
that.optConfig = $.pl.config.opts
that.data = $.pl.data
-
+
that.panel = $('.panel-'+panel)
-
-
-
+
+
+
if( mode == 'section-options' )
that.sectionOptionRender()
else if ( mode == 'settings' || mode == 'object' )
that.settingsRender( that.config.settings )
-
+
that.onceOffScripts()
-
+
that.setPanel()
-
+
that.setBinding()
-
+
$('.ui-tabs li').on('click.options-tab', $.proxy(that.setPanel, that))
-
+
}
-
+
, settingsRender: function( settings ) {
var that = this
-
+
$.each( settings , function(index, o) {
-
+
tab = $("[data-panel='"+index+"']")
-
+
opts = that.runEngine( o.opts, index )
tab.find('.panel-tab-content').html( opts )
-
+
that.runScriptEngine( index, o.opts )
-
+
})
-
-
-
+
+
+
}
-
+
, sectionOptionRender: function() {
-
+
var that = this
, cascade = ['local', 'type', 'global']
, sid = that.config.sid
, clone_text = (that.config.clone != 0) ? sprintf(' Clone %s', that.config.clone) : sprintf(' Original')
, clone_desc = sprintf(' → %s ', clone_text)
-
+
if( that.optConfig[sid] && !$.isEmptyObject( that.optConfig[sid].opts ) )
opt_array = that.optConfig[sid].opts
else{
@@ -91,12 +91,12 @@
, label: "No Options"
, title: "No Options"
, type: "help"
-
+
}]
- }
-
+ }
+
$.each( cascade , function(index, o) {
-
+
tab = $("[data-panel='"+o+"']")
opts = that.runEngine( opt_array, o )
@@ -105,34 +105,34 @@
tab.find('legend').html( that.optConfig[ sid ].name + clone_desc)
tab.find('.panel-tab-content').html( opts )
-
+
that.runScriptEngine( index, opt_array )
-
+
})
-
+
}
-
+
, checkboxDisplay: function( checkgroup ){
-
+
var globalSet = ( $('.scope-global.checkgroup-'+checkgroup).find('.check-standard .checkbox-input').is(':checked') ) ? true : false
, typeSet = ( $('.scope-type.checkgroup-'+checkgroup).find('.check-standard .checkbox-input').is(':checked') ) ? true : false
, typeFlipSet = ( $('.scope-type.checkgroup-'+checkgroup).find('.check-flip .checkbox-input').is(':checked') ) ? true : false
-
+
$.each( this.cascade , function(index, currentScope) {
-
+
var showFlip = false
-
+
if( currentScope != 'global' && globalSet )
showFlip = true
-
+
if( !showFlip && currentScope == 'local' && typeSet )
showFlip = true
if( currentScope == 'local' && showFlip && typeFlipSet && globalSet )
showFlip = false
-
- var theSelector = sprintf('.scope-%s.checkgroup-%s ', currentScope, checkgroup)
-
+
+ var theSelector = sprintf('.scope-%s.checkgroup-%s ', currentScope, checkgroup)
+
if(showFlip){
$( theSelector + '.check-flip').show()
$( theSelector + '.check-standard').hide()
@@ -140,40 +140,40 @@
$( theSelector + '.check-flip').hide()
$( theSelector + '.check-standard').show()
}
-
-
+
+
})
-
+
}
-
+
, setBinding: function(){
var that = this
-
+
$('.lstn').on('keypress blur change', function( e ){
-
+
var theInput = $(this)
-
+
if( that.config.mode == 'object' ){
-
+
var theObject = $( '#'+that.config.objectID )
, theValue = theInput.val()
-
+
if( theInput.attr('id') == 'area_class' ){
theObject.attr('data-class', theValue).data('class', theValue)
theObject.removeClass().addClass('pl-area area-tag '+theValue)
}
-
+
if( theInput.attr('id') == 'area_name' ){
theObject.attr('data-name', theValue).data('name',theValue)
}
-
+
if(e.type == 'change' || e.type == 'blur'){
$.pageBuilder.storeMap()
}
-
-
+
+
} else {
-
+
var scope = (that.config.mode == 'section-options') ? that.activeForm.data('scope') : 'global'
if($(this).hasClass('checkbox-input')){
@@ -181,7 +181,7 @@
var checkToggle = $(this).prev()
, checkGroup = $(this).closest('.checkbox-group').data('checkgroup')
- if ($(this).is(':checked'))
+ if ($(this).is(':checked'))
checkToggle.val(1)
else
checkToggle.val(0)
@@ -200,27 +200,27 @@
if(e.type == 'change' || e.type == 'blur'){
$.plAJAX.saveData( )
}
-
+
}
-
-
+
+
})
}
-
+
, setPanel: function(){
var that = this
-
+
$('.opt-form.isotope').isotope( 'destroy' )
-
- that.panel.find('.tab-panel').each(function(){
-
+
+ that.panel.find('.tab-panel').each(function(){
+
if($(this).is(":visible")){
-
+
that.activeForm = $(this).find('.opt-form')
-
+
that.optScope = that.activeForm.data('scope')
that.optSID = that.activeForm.data('sid')
-
+
that.activeForm.imagesLoaded( function(){
that.activeForm.isotope({
itemSelector : '.opt'
@@ -233,62 +233,62 @@
}
})
})
-
+
}
-
+
})
}
-
+
, setTabData: function(){
var that = this
-
+
$tab = that.panel
.find('.tabs-nav li')
.attr('data-sid', that.sid)
.attr('data-clone', that.clone)
-
-
+
+
}
-
- , runEngine: function( opts, tabKey ){
-
+
+ , runEngine: function( opts, tabKey ){
+
var that = this
, optionHTML
- , out = ''
-
+ , out = ''
+
$.each( opts , function(index, o) {
-
+
var specialClass = ''
, number = index
-
+
if(o.span)
specialClass += 'opt-span-'+o.span
-
+
optionHTML = that.optEngine( tabKey, o )
-
- out += sprintf( '', o.key, specialClass, number, o.title, optionHTML )
+
+ out += sprintf( '', o.key, specialClass, number, o.title, optionHTML )
})
-
-
+
+
return sprintf('', that.sid, tabKey, out)
-
+
}
-
+
, optValue: function( scope, key ){
- var that = this
-
+ var that = this
+
if(that.config.mode == 'object'){
-
+
var theObject = $( '#'+that.config.objectID )
-
+
if(key == 'area_name'){
return theObject.data('name') || ''
} else if (key == 'area_class'){
return theObject.data('class') || ''
}
-
+
} else {
var that = this
, pageData = $.pl.data
@@ -300,97 +300,97 @@
// Set option value
if( pageData[ scope ] && pageData[ scope ][ key ] && pageData[ scope ][ key ][that.clone])
return pl_html_input( pageData[ scope ][ key ][that.clone] )
- else
+ else
return ''
}
-
-
+
+
}
-
+
, optName: function( scope, key, type ){
-
+
if(o.type == 'check'){
-
+
} else {
return sprintf('%s[%s]', key, that.clone)
}
-
+
}
-
+
, optEngine: function( tabIndex, o ) {
var that = this
, oHTML = ''
, scope = (that.config.mode == 'settings') ? 'global' : tabIndex
-
-
+
+
o.classes = o.classes || ''
o.label = o.label || o.title
- o.value = that.optValue( tabIndex, o.key )
-
+ o.value = that.optValue( tabIndex, o.key )
+
o.name = sprintf('%s[%s]', o.key, that.clone)
-
-
-
-
+
+
+
+
if( o.type == 'multi' ){
if(o.opts){
$.each( o.opts , function(index, osub) {
-
+
oHTML += that.optEngine(tabIndex, osub) // recursive
-
+
})
}
-
+
}
-
+
else if( o.type == 'disabled' ){ }
-
+
else if( o.type == 'color' ){
-
+
var prepend = ' ';
oHTML += sprintf('%s ', o.key, o.label )
oHTML += sprintf('%4$s
', o.key, o.value, o.name, prepend )
-
+
}
-
+
else if( o.type == 'image_upload' ){
-
- var size = o.imgsize+'px' || '100%'
+
+ var size = o.imgsize+'px' || '100%'
, sizeMode = o.sizemode || 'width'
, remove = 'Remove '
, thm = (o.value != '') ? sprintf('', o.value, sizeMode, size) : ''
-
+
oHTML += sprintf('%s
', o.key, sizeMode, size, thm);
-
+
oHTML += sprintf('%s ', o.key, o.label )
-
+
oHTML += sprintf(' ', o.key, o.name, o.value )
-
+
oHTML += sprintf('
', o.key)
-
-
-
+
+
+
}
// Text Options
else if( o.type == 'text' ){
-
+
oHTML += sprintf('%s ', o.key, o.label )
oHTML += sprintf(' ', o.key, o.name, o.value, o.classes)
-
- }
-
+
+ }
+
else if( o.type == 'textarea' ){
-
+
oHTML += sprintf('%s ', o.key, o.label )
oHTML += sprintf('', o.key, o.name, o.classes, o.value )
-
+
}
-
+
else if( o.type == 'select_menu' ){
-
+
var select_opts = ''
, menus = $.pl.config.menus
, configure = $.pl.config.urls.menus
@@ -408,186 +408,186 @@
oHTML += sprintf(' %s ', configure, 'Configure Menus' )
}
-
+
else if( o.type == 'action_button' ){
-
+
oHTML += sprintf('%s ', o.key, o.classes, o.label )
-
+
}
-
+
else if( o.type == 'edit_post' ){
var editLink = $.pl.config.urls.editPost
-
+
oHTML += sprintf('%s ', editLink, o.classes, o.label )
-
+
}
-
+
else if( o.type == 'link' ){
-
+
oHTML += sprintf('%s ', o.url, o.classes, o.label )
-
+
}
-
-
+
+
// Checkbox Options
else if ( o.type == 'check' ) {
-
+
var checked = (!o.value || o.value == 0 || o.value == '') ? '' : 'checked'
, toggleValue = (checked == 'checked') ? 1 : 0
- , aux = sprintf(' ', o.name, toggleValue )
+ , aux = sprintf(' ', o.name, toggleValue )
, keyFlip = o.key +'-flip'
- , valFlip = that.optValue( tabIndex, keyFlip)
+ , valFlip = that.optValue( tabIndex, keyFlip)
, checkedFlip = (!valFlip || valFlip == 0 || valFlip == '') ? '' : 'checked'
, toggleValueFlip = (checkedFlip == 'checked') ? 1 : 0
, nameFlip = sprintf('%s[%s]', keyFlip, that.clone)
, labelFlip = (o.fliplabel) ? o.fliplabel : '( reverse ) ' + o.label
- , auxFlip = sprintf(' ', nameFlip, toggleValueFlip )
+ , auxFlip = sprintf(' ', nameFlip, toggleValueFlip )
, showFlip = false
- , globalVal = (that.optValue( 'global', o.key ) == 1) ? true : false
- , typeVal = (that.optValue( 'type', o.key ) == 1) ? true : false
- , typeFlipVal = (that.optValue( 'type', keyFlip ) == 1) ? true : false
-
-
+ , globalVal = (that.optValue( 'global', o.key ) == 1) ? true : false
+ , typeVal = (that.optValue( 'type', o.key ) == 1) ? true : false
+ , typeFlipVal = (that.optValue( 'type', keyFlip ) == 1) ? true : false
+
+
var stdCheck = sprintf('%s %s ', aux, o.key, checked, o.label )
, flipCheck = (scope != 'global') ? sprintf('%s %s ', auxFlip, keyFlip , checkedFlip, labelFlip ) : ''
-
-
+
+
oHTML += sprintf('%s %s
', scope, o.key, o.key, stdCheck, flipCheck )
-
- }
-
+
+ }
+
// Select Options
- else if (
- o.type == 'select'
- || o.type == 'count_select'
- || o.type == 'select_same'
+ else if (
+ o.type == 'select'
+ || o.type == 'count_select'
+ || o.type == 'select_same'
|| o.type == 'select_taxonomy'
|| o.type == 'select_icon'
){
-
+
var select_opts = '— Select — '
-
+
if(o.type == 'count_select'){
-
+
var cnt_start = (o.count_start) ? o.count_start : 0
, cnt_num = (o.count_number) ? o.count_number : 10
, suffix = (o.suffix) ? o.suffix : ''
-
+
o.opts = {}
for(i = cnt_start; i <= cnt_num; i++)
o.opts[i] = {name: i+suffix}
-
-
- }
-
+
+
+ }
+
if(o.type == 'select_icon'){
-
+
var icons = $.pl.config.icons
-
+
o.opts = {}
$.each(icons, function(key, s){
o.opts[ s ] = {name: s}
})
-
-
+
+
}
-
+
if(o.opts){
-
+
$.each(o.opts, function(key, s){
-
+
var optValue = (o.type == 'select_same') ? s : key
, optName = (o.type == 'select_same') ? s : s.name
, selected = (o.value == optValue) ? 'selected' : ''
-
+
select_opts += sprintf('%s ', optValue, selected, optName)
-
+
})
}
-
-
-
-
+
+
+
+
oHTML += sprintf('%s ', o.key, o.label )
oHTML += sprintf('%s ', o.key, o.name, o.classes, o.type, select_opts)
-
+
if(o.type == 'select_taxonomy' && o.post_type)
oHTML += sprintf(
- '',
- $.pl.config.urls.adminURL,
+ '',
+ $.pl.config.urls.adminURL,
o.post_type
)
-
+
}
-
+
else if( o.type == 'type' || o.type == 'fonts' ){
-
+
var select_opts = ''
-
+
if($.pl.config.fonts){
$.each($.pl.config.fonts, function(skey, s){
var google = (s.google) ? ' G' : ''
, webSafe = (s.web_safe) ? ' *' : ''
, uri = (s.google) ? s.gfont_uri : ''
, selected = (o.value == skey) ? 'selected' : ''
-
+
select_opts += sprintf('%s%s%s ', s.family, uri, skey, selected, s.name, google, webSafe)
})
}
-
+
oHTML += sprintf('%s ', o.key, o.label )
oHTML += sprintf('— Select Font — %s ', o.key, o.name, select_opts)
-
+
oHTML += sprintf('Font Preview ', o.key)
oHTML += sprintf('', o.key)
}
-
+
else if( o.type == 'help' ){
-
+
} else {
oHTML += sprintf('%s Type Still Needed
', o.type)
}
-
+
// Add help block
if ( o.help )
oHTML += sprintf('%s
', o.help)
-
+
// Add help block
if ( o.ref )
oHTML += sprintf('', o.ref)
-
+
return oHTML
}
-
+
, runScriptEngine: function ( tabIndex, opts ) {
-
+
var that = this
-
+
$.each(opts, function(index, o){
that.scriptEngine(tabIndex, o)
})
-
+
}
-
+
, onceOffScripts: function() {
-
+
var that = this
-
+
// Settings Actions
$(".settings-action").on("click.settingsAction", function(e) {
-
+
e.preventDefault()
-
+
var btn = $(this)
, theAction = btn.data('action')
-
+
if( theAction == 'reset_global' || theAction == 'reset_local'){
-
+
var context = (theAction == 'reset_global') ? "global site options" : "local page options"
-
+
, confirmText = sprintf("Are you sure? This will reset %s to their defaults. (Once reset, this will still need to be published live.)
", context)
-
+
var args = {
mode: 'settings'
, run: theAction
@@ -600,11 +600,11 @@
}
var response = $.plAJAX.run( args )
-
+
}
-
+
})
-
+
// Color picker buttons
$('.trigger-color').on('click', function(){
$(this)
@@ -612,46 +612,46 @@
.find('input')
.focus()
})
-
+
// Font previewing
$('.font-selector, .font-weight').on('change', function(){
var selector = $(this).closest('.opt').find('.font-selector')
that.loadFontPreview( selector )
-
+
})
$('.font-selector, .font-style').on('change', function(){
var selector = $(this).closest('.opt').find('.font-selector')
that.loadFontPreview( selector )
-
+
})
-
+
// Image Uploader
$('.upload-input').on('change', function(){
-
+
var val = $(this).val()
, closestOpt = $(this).closest('.opt')
-
+
if(val){
closestOpt.find('.rmv-upload').fadeIn()
} else {
// closestOpt.find('.upload-thumb').fadeOut()
closestOpt.find('.rmv-upload').fadeOut()
}
-
+
})
-
+
$('.rmv-upload').on('click', function(){
$(this).closest('.opt').find('.upload-input').val('').trigger('change')
$(this).closest('.opt').find('.upload-thumb').fadeOut()
})
-
- // Reference Help Toggle
+
+ // Reference Help Toggle
$('.btn-ref').on('click.ref', function(){
var closestRef = $(this).closest('.opt-ref')
, closestHelp = closestRef.find('.help-block')
-
+
if(closestRef.hasClass('ref-open')){
closestRef.removeClass('ref-open')
closestHelp.hide()
@@ -659,14 +659,14 @@
closestRef.addClass('ref-open')
closestHelp.show()
}
-
+
closestRef.closest('.isotope').isotope( 'reLayout' )
-
+
})
}
-
+
, loadFontPreview: function( selector ) {
-
+
var key = selector.attr('id')
, selectOpt = selector.find('option:selected')
, fam = selectOpt.data('family')
@@ -677,11 +677,11 @@
, weight = (weight) ? weight : 'normal'
, style = selector.closest('.opt').find('.font-style').val()
, style = (style) ? style : ''
-
+
if(ggl){
if( $('#'+loader).length != 0 )
$('#'+loader).attr('href', uri)
- else
+ else
$('head').append( sprintf(' ', loader, uri) )
} else {
$('#'+loader).remove()
@@ -693,12 +693,12 @@
.css('font-family', fam)
.css('font-weight', weight)
}
-
+
, scriptEngine: function( tabIndex, o ) {
-
+
var that = this
-
+
// Multiple Options
if( o.type == 'multi' ){
if(o.opts){
@@ -712,37 +712,37 @@
}
else if( o.type == 'color' ){
-
+
$( '.color-'+o.key ).colorpicker({
-
+
beforeShow: function(input, inst){
-
+
}
, onClose: function(color, inst){
-
+
$(this).change() // fire to set page data
}
})
-
+
}
-
+
else if( o.type == 'check' ){
-
+
that.checkboxDisplay( o.key )
-
+
}
-
+
else if( o.type == 'type' || o.type == 'fonts' ){
-
-
+
+
that.loadFontPreview( $( sprintf('#%s.font-selector', o.key) ) )
-
+
}
-
+
else if( o.type == 'image_upload' ){
var val = o.value
, sizeLimit = o.sizelimit || 512000 // 500 kB
-
+
$('.fineupload.upload-'+o.key).fineUploader({
request: {
endpoint: ajaxurl
@@ -751,7 +751,7 @@
, scope: 'global'
}
}
-
+
, multiple: false
, validation: {
allowedExtensions: ['jpeg', 'jpg', 'gif', 'png'],
@@ -769,29 +769,29 @@
''
}).on('complete', function(event, id, fileName, response) {
-
+
var optBox = $(this).closest('.opt-box')
-
+
if (response.success) {
var theThumb = optBox.find('.upload-thumb')
, imgStyle = theThumb.data('imgstyle')
-
-
+
+
theThumb.fadeIn().html( sprintf('', response.url, imgStyle ))
optBox.find('.text-input').val(response.url).change()
optBox.imagesLoaded( function(){
optBox.closest('.isotope').isotope( 'reLayout' )
})
-
+
}
})
-
+
}
-
+
}
-
+
}
-
-
-
+
+
+
}(window.jQuery);
\ No newline at end of file
diff --git a/editor/js/pl.sections.js b/editor/js/pl.sections.js
index 532fe389..f5cbef9c 100644
--- a/editor/js/pl.sections.js
+++ b/editor/js/pl.sections.js
@@ -1,16 +1,16 @@
!function ($) {
$.plSections = {
-
+
init: function(){
this.bindActions()
this.makeDraggable()
}
, bindActions: function(){
var that = this
-
+
$('.btn-reload-sections').on('click', function(e){
-
+
e.preventDefault()
var args = {
@@ -22,123 +22,123 @@ $.plSections = {
, refresh: true
, log: true
}
-
+
var response = $.plAJAX.run( args )
-
+
})
-
+
}
, makeDraggable: function( ){
-
+
var that = this
-
+
$('.panel-add-new').find( '.x-item.pl-sortable:not(.x-disable)' ).draggable({
appendTo: "body"
, helper: "clone"
- , cursor: "move"
+ , cursor: "move"
, connectToSortable: ".pl-sortable-area"
, zIndex: 10000
, distance: 20
, start: function(event, ui){
-
+
that.switchOnAdd( ui.helper )
-
+
ui.helper
.css('max-width', '300px')
.css('height', 'auto')
-
-
+
+
}
})
-
+
$('.panel-add-new').find( '.x-item.pl-area-sortable' ).draggable({
appendTo: "body"
, helper: "clone"
- , cursor: "move"
+ , cursor: "move"
, connectToSortable: ".pl-area-container"
, zIndex: 10000
, distance: 20
, start: function(event, ui){
-
+
that.switchOnAdd( ui.helper )
-
+
ui.helper
.css('width', '100%')
.css('height', 'auto')
-
-
+
+
}
})
-
-
+
+
}
, switchOnAdd: function( element ){
-
-
+
+
var name = element.data('name')
, image = element.data('image')
, imageHTML = sprintf('', image )
, theHTML = sprintf('', imageHTML )
-
-
+
+
element
.removeAttr("style")
.html(theHTML)
-
+
if( !element.hasClass('ui-draggable-dragging') )
element.hide()
-
+
}
, switchOnStop: function( element ){
-
+
var type = (element.hasClass('pl-area-sortable')) ? 'area' : 'section'
, name = element.data('name')
, classToAdd = (type == 'section') ? 'pl-section' : 'pl-area'
, controlType = (type == 'section') ? '.pl-section-controls' : '.pl-area-controls'
, controls = $( controlType ).first().clone()
, btns = sprintf('')
-
+
// Set controls name from new
controls
.find('.ctitle')
.html(name)
-
+
// Remove controls that only work once section fully loaded
controls
.find('.s-loaded')
.hide()
-
+
element
.removeClass('x-item isotope-item x-add-new x-extension')
.addClass( classToAdd )
.prepend( controls )
.find('.banner-content')
.append( btns )
-
+
$.pageBuilder.handleCloneData( element )
-
+
if(!element.hasClass('ui-draggable-dragging'))
element.show()
-
+
// reload events
$('.s-control')
.off('click.sectionControls')
-
+
$.pageBuilder.sectionControls()
-
+
$('.area-control')
.off('click.areaControl')
-
+
$.areaControl.listen()
-
+
$('.banner-refresh')
.off()
- .on('click', function(e){
+ .on('click', function(e){
e.preventDefault()
- location.reload()
+ location.reload()
})
-
+
// Store new page config
$.pageBuilder.storeMap()
}
diff --git a/editor/js/pl.settings.js b/editor/js/pl.settings.js
index a7cd1497..5fce4c62 100644
--- a/editor/js/pl.settings.js
+++ b/editor/js/pl.settings.js
@@ -1,9 +1,9 @@
!function ($) {
$.plSettings = {
-
-
-
+
+
+
}
-
+
}(window.jQuery);
\ No newline at end of file
diff --git a/editor/js/pl.templates.js b/editor/js/pl.templates.js
index 9a9c8315..71d26dc3 100644
--- a/editor/js/pl.templates.js
+++ b/editor/js/pl.templates.js
@@ -1,27 +1,27 @@
!function ($) {
$.plTemplates = {
-
+
init: function(){
this.bindUIActions()
}
-
+
, bindUIActions: function(){
var that = this
-
+
// fix issue with drop down falling behind
$('.actions-toggle').on('click', function(){
- $('.x-templates').css('z-index', 7);
+ $('.x-templates').css('z-index', 7);
$(this).closest('.x-templates').css('z-index', 8)
})
-
+
$('.tpl-tag').tooltip({placement: 'top'})
-
-
+
+
$(".load-template").on("click.loadTemplate", function(e) {
e.preventDefault()
-
+
var args = {
mode: 'templates'
, run: 'load'
@@ -33,16 +33,16 @@ $.plTemplates = {
, log: true
, key: $(this).closest('.x-item').data('key')
}
-
+
var response = $.plAJAX.run( args )
-
+
})
$(".delete-template").on("click.deleteTemplate", function(e) {
e.preventDefault()
-
+
var key = $(this).closest('.x-item').data('key')
, theIsotope = $(this).closest('.isotope')
, args = {
@@ -55,11 +55,11 @@ $.plTemplates = {
, log: true
, key: key
, beforeSend: function(){
- $( '.template_key_'+key ).fadeOut(300, function() {
+ $( '.template_key_'+key ).fadeOut(300, function() {
$(this).remove()
-
+
})
-
+
}
, postSuccess: function(){
theIsotope.isotope( 'reLayout' )
@@ -87,7 +87,7 @@ $.plTemplates = {
, map: $.plMapping.getCurrentMap()
}
, args = $.extend({}, args, form) // add form fields to post
-
+
var response = $.plAJAX.run( args )
@@ -98,7 +98,7 @@ $.plTemplates = {
$(".update-template").on("click", function(e) {
e.preventDefault()
-
+
var key = $(this).closest('.x-item').data('key')
, args = {
mode: 'templates'
@@ -115,11 +115,11 @@ $.plTemplates = {
}
var response = $.plAJAX.run( args )
-
+
})
-
+
$(".set-tpl").on("click.defaultTemplate", function(e) {
@@ -137,52 +137,52 @@ $.plTemplates = {
, field: $(this).data('field')
, value: value
, postSuccess: function( response ){
-
+
// console.log("caller is " + arguments.callee.caller.toString());
-
-
+
+
// $.Ajax parses argument values and calles this thing, probably supposed to do that a different way
if(!response)
- return
-
+ return
+
var theList = $(that).closest('.x-list')
-
+
theList
.find('.set-tpl[data-run="'+run+'"]')
.removeClass('active')
-
+
theList
.find('.active-'+run)
.removeClass('active-'+run)
-
-
+
+
if(response.result && response.result != false){
-
+
$(that)
.addClass('active')
.closest('.x-item-actions')
.addClass('active-'+run)
-
+
}else {
console.log('Response was false.')
console.log( response )
}
-
-
-
+
+
+
}
}
-
+
var response = $.plAJAX.run( args )
})
-
-
-
-
-
+
+
+
+
+
}
diff --git a/editor/js/pl.themes.js b/editor/js/pl.themes.js
index 80364bda..afd98731 100644
--- a/editor/js/pl.themes.js
+++ b/editor/js/pl.themes.js
@@ -1,10 +1,10 @@
!function ($) {
$.plThemes = {
-
+
btnActions: function(){
-
+
$('.btn-theme-activate').on('click.paneAction', function(){
var args = {
mode: 'themes'
@@ -17,10 +17,10 @@ $.plThemes = {
, log: true
, stylesheet: $(this).data('stylesheet')
}
-
+
var response = $.plAJAX.run( args )
})
-
+
$('.btn-theme-preview').on('click.paneAction', function(){
var args = {
mode: 'themes'
@@ -33,23 +33,23 @@ $.plThemes = {
, log: true
, stylesheet: $(this).data('stylesheet')
}
-
+
var response = $.plAJAX.run( args )
})
-
+
}
, actionButtons: function( data ){
var buttons = ''
, theme = sprintf('data-stylesheet="%s"', data.stylesheet)
-
+
buttons += sprintf(' Activate ', theme)
-
-
+
+
// Can't get this to work because of a PHP loading issue
// Must move to a plugin that loads before the 'stylesheet' is set for a child theme.
- //
+ //
// buttons += sprintf(' Preview ', theme)
-
+
return buttons
}
}
diff --git a/editor/js/pl.toolbox.js b/editor/js/pl.toolbox.js
index 138e2596..3aa8dce6 100644
--- a/editor/js/pl.toolbox.js
+++ b/editor/js/pl.toolbox.js
@@ -12,16 +12,16 @@
* ====================== */
var ToolBox = function (element, options) {
-
+
this.options = options
-
+
this.$element = $(element)
-
+
this.$panel = this.$element.find('.toolbox-panel').on('click', function(e){e.stopPropagation()})
-
+
this.$pusher = $('.pl-toolbox-pusher')
this.$tabnav = $('.tabs-nav')
-
+
this.resizer = $('.resizer-handle')
this.closer = $('.btn-closer')
this.offBtn = $('.btn-pl-toggle')
@@ -29,11 +29,11 @@
this.resizePanel()
this.scrollPanel()
-
+
this.closer.on('click.toolbox.toggler', $.proxy(this.hide, this))
-
-
-
+
+
+
}
ToolBox.prototype = {
@@ -50,17 +50,17 @@
var that = this
, e = $.Event('show')
- if (this.isShown || e.isDefaultPrevented())
+ if (this.isShown || e.isDefaultPrevented())
return that // chaining
$('body').addClass('toolbox-open')
-
-
+
+
this.isShown = true
store.set('toolboxShown', true)
-
- this.keyboard()
+
+ this.keyboard()
that.setHeight()
@@ -69,160 +69,160 @@
.css('margin-bottom', 0)
.addClass('in')
.focus()
-
+
that.$pusher
.show()
-
+
this.resizer
.show()
-
+
this.offBtn
.hide()
-
+
this.closer
.fadeIn()
-
-
-
+
+
+
return that // chaining
}
, hide: function (e) {
-
+
var that = this
, e = $.Event('hide')
, ht = this.$panel.height()
-
+
//if (!this.isShown || e.isDefaultPrevented()) return
this.isShown = false
store.set('toolboxShown', false)
$('body')
.removeClass('toolbox-open')
-
-
-
+
+
+
this.keyboard()
-
+
this.$panel
.removeClass('in')
.css('margin-bottom', ht * -1)
-
+
$('.btn-panel').removeClass('active-tab')
-
+
this.resizer
.hide()
-
+
this.closer
.hide()
-
+
this.offBtn
.fadeIn()
-
+
that.$pusher
.height(that.handleHeight)
-
+
}
, showPanel: function( key ){
-
+
$.pageTools.showPanel(key)
-
-
+
+
}
, setHeight: function( newHeight ) {
-
+
var obj = this
, originalHeight = 440
, savedHeight = Number( localStorage.getItem('toolboxHeight') )
, handleHeight = obj.handleHeight
-
+
if( newHeight !== undefined ){
-
+
obj.$panel.height( newHeight )
obj.$pusher.height( newHeight + handleHeight )
obj.$tabnav.css('max-height', newHeight)
-
+
localStorage.setItem('toolboxHeight', newHeight)
-
+
} else {
-
+
if( !savedHeight ){
-
+
obj.$panel.height( originalHeight )
obj.$pusher.height( originalHeight + handleHeight)
obj.$tabnav.css('max-height', originalHeight)
-
+
localStorage.setItem('toolboxHeight', originalHeight)
-
+
} else {
-
+
obj.$panel.height( savedHeight )
obj.$pusher.height( savedHeight + handleHeight)
obj.$tabnav.css('max-height', savedHeight)
localStorage.setItem('toolboxHeight', savedHeight)
}
-
-
+
+
}
-
+
}
, resizePanel: function() {
-
+
var obj = this
-
+
this.resizer.on('mousedown', function(evnt) {
-
+
evnt.stopPropagation()
-
+
var startY = evnt.pageY
, startHeight = obj.$panel.outerHeight()
-
+
obj.resizer.addClass('resizing')
-
+
$('body').addClass('disable-select')
$(document).on('mousemove.resizehandle', function(e) {
-
+
var newY = e.pageY
, newHeight = Math.max(0, startHeight + startY - newY)
-
+
if(e.pageY > 50 && newHeight > 50){
obj.setHeight(newHeight)
}
})
-
-
-
+
+
+
})
-
+
$(document).mouseup(function(event) {
$(document).off('mousemove.resizehandle')
obj.resizer.removeClass('resizing')
$('body').removeClass('disable-select')
})
-
+
$(window).resize(function() {
var fromTop = $('.pl-toolbox').position().top
, startHeight = obj.$panel.outerHeight()
, minHeight = 80
-
+
if( fromTop < minHeight ){
var adjust = startHeight - (minHeight - fromTop)
-
+
if(adjust > minHeight)
obj.setHeight(adjust)
}
-
+
})
-
+
}
, scrollPanel: function() {
-
+
var obj = this;
-
+
obj.$panel.find('.tabs-nav').hover(
function () {
$(this).addClass("hover");
@@ -231,16 +231,16 @@
$(this).removeClass("hover");
}
)
-
+
obj.$panel.bind('mousewheel', function(e, d) {
-
+
if($(this).find('.tabs-nav').hasClass('hover')){
var nav = $('.current-panel .tabs-nav')
, height = nav.height()
, scrollHeight = nav[0].scrollHeight
, fromTop = nav.scrollTop()
-
-
+
+
} else {
var height = obj.$panel.height()
, scrollHeight = obj.$panel[0].scrollHeight
@@ -251,17 +251,17 @@
if((fromTop === (scrollHeight - height) && d < 0) || (fromTop === 0 && d > 0)) {
e.preventDefault()
}
-
+
})
-
+
}
-
+
, keyboard: function () {
var that = this
-
+
// Escape key
if ( this.isShown ) {
-
+
$('body').on('keyup.dismiss.toolbox', function ( e ) {
e.which == 27 && that.hide()
})
@@ -270,7 +270,7 @@
}
}
-
+
}
@@ -279,15 +279,15 @@
* ======================= */
$.toolbox = function( option ){
-
+
if(typeof option == 'string' && option == 'open')
return ( $('body').hasClass('toolbox-open') ) ? true : false
else
return $('body').toolbox( option )
-
-
+
+
}
-
+
$.fn.toolbox = function ( option ) {
return this.each( function() {
@@ -295,28 +295,28 @@
, toolBoxObject = tbSelector.data('toolbox')
, options = $.extend({}, $.fn.toolbox.defaults, tbSelector.data(), typeof option == 'object' && option)
- if ( !toolBoxObject )
+ if ( !toolBoxObject )
tbSelector.data( 'toolbox', ( toolBoxObject = new ToolBox( tbSelector, options ) ) )
// Action
- if ( typeof option == 'string' )
+ if ( typeof option == 'string' )
toolBoxObject[option]()
else if ( $.isFunction( options.action ) )
options.action.call( this )
- else if ( options.action == 'show' )
+ else if ( options.action == 'show' )
toolBoxObject.show().showPanel( options.panel )
else if ( this.isShown = store.get('toolboxShown') )
toolBoxObject.show().showPanel( store.get('toolboxPanel') )
else
toolBoxObject.hide()
-
-
+
+
// Panel Load
-
+
if ( $.isFunction( options.info ) )
options.info.call( this )
-
+
})
}
diff --git a/editor/js/pl.xlist.js b/editor/js/pl.xlist.js
index 6050120d..a500ed1d 100644
--- a/editor/js/pl.xlist.js
+++ b/editor/js/pl.xlist.js
@@ -1,29 +1,29 @@
!function ($) {
$.xList = {
-
+
renderList: function( panel, list ){
var items = ''
-
+
// console.log(list)
// return
$.each( list , function(index, l) {
-
+
items += sprintf('', l.class, l.thumb)
})
-
+
output = sprintf('%s
', items)
-
+
panel.find('.panel-tab-content').html( output )
-
-
+
+
}
-
+
, listStart: function( panel, key ){
-
+
var that = this
- , layout = (key == 'pl-extend') ? 'masonry' : 'fitRows';
-
+ , layout = (key == 'pl-extend') ? 'masonry' : 'fitRows';
+
panel.imagesLoaded( function(){
panel.find('.x-list').isotope({
itemSelector : '.x-item'
@@ -37,24 +37,24 @@
}
})
})
-
+
//this.listPopOverStart()
-
+
if(key == 'add-new'){
$.plSections.init()
}
-
-
-
+
+
+
this.extensionActions()
-
-
-
+
+
+
}
-
+
, loadButtons: function( panel, data ){
var buttons = ''
-
+
if(panel == 'x-store'){
buttons += $.plExtend.actionButtons( data )
} else if ( panel == 'x-themes' ){
@@ -62,26 +62,26 @@
} else if ( panel == 'x-sections' ){
buttons += sprintf(' Drag Thumb to Page ')
}
-
-
+
+
return buttons
}
-
+
, loadPaneActions: function(panel){
-
+
if(panel == 'x-store'){
$.plExtend.btnActions()
} else if ( panel == 'x-themes' ){
$.plThemes.btnActions()
- }
-
+ }
+
$('.x-close').on('click.paneAction ', function(e){
-
+
e.preventDefault
var theIsotope = $(this).parent()
, removeItems = $('.x-remove')
-
+
removeItems
.off('click')
@@ -95,7 +95,7 @@
}
, extensionActions: function(){
-
+
var that = this
$('.x-extension').on('click.extensionItem', function(){
var theExtension = $(this)
@@ -108,7 +108,7 @@
console.log('before condition')
if(!theIsotope.hasClass('x-pane-mode') && ext){
console.log('after condition')
-
+
var splash = sprintf('', ext.splash)
, btnClose = sprintf('', filterID)
, btns = sprintf('%s
', that.loadButtons( panel, theExtension.data() ))
@@ -117,27 +117,27 @@
if( panel == 'x-sections' ){
var prep = sprintf(' Drag This ', filterID)
-
+
theIsotope.find('.pl-sortable').append(prep)
}
-
-
+
+
theIsotope
.isotope('insert', extPane)
.isotope({filter: filterClass})
.addClass('x-pane-mode')
- }
-
+ }
+
// load actions after elements added to DOM
that.loadPaneActions( panel )
-
-
+
+
})
-
-
-
-
-
+
+
+
+
+
}
, listPopOverStart: function(){
@@ -148,37 +148,37 @@
, container: $('.pl-toolbox')
, placement: 'top'
})
-
+
}
-
+
, listPopOverStop: function(){
$('.x-item').popover('destroy')
-
-
+
+
}
-
-
+
+
, listStop: function(){
-
+
var removeItems = $('.x-remove')
-
+
removeItems
.off('click')
-
+
$('.x-extension')
.off('click.extensionItem')
-
+
$('.x-list.isotope')
.removeClass('x-pane-mode')
.isotope( 'remove', removeItems)
.isotope( { filter: '*' })
.isotope( 'destroy' )
-
+
//this.listPopOverStop()
}
-
-
-
+
+
+
}
}(window.jQuery);
\ No newline at end of file
diff --git a/editor/js/utils.mousewheel.js b/editor/js/utils.mousewheel.js
index f1d5f72f..bf766be6 100644
--- a/editor/js/utils.mousewheel.js
+++ b/editor/js/utils.mousewheel.js
@@ -6,7 +6,7 @@
* Thanks to: Seamus Leahy for adding deltaX and deltaY
*
* Version: 3.0.6
- *
+ *
* Requires: 1.2.2+
*/
@@ -30,7 +30,7 @@ $.event.special.mousewheel = {
this.onmousewheel = handler;
}
},
-
+
teardown: function() {
if ( this.removeEventListener ) {
for ( var i=types.length; i; ) {
@@ -46,7 +46,7 @@ $.fn.extend({
mousewheel: function(fn) {
return fn ? this.bind("mousewheel", fn) : this.trigger("mousewheel");
},
-
+
unmousewheel: function(fn) {
return this.unbind("mousewheel", fn);
}
@@ -57,27 +57,27 @@ function handler(event) {
var orgEvent = event || window.event, args = [].slice.call( arguments, 1 ), delta = 0, returnValue = true, deltaX = 0, deltaY = 0;
event = $.event.fix(orgEvent);
event.type = "mousewheel";
-
+
// Old school scrollwheel delta
if ( orgEvent.wheelDelta ) { delta = orgEvent.wheelDelta/120; }
if ( orgEvent.detail ) { delta = -orgEvent.detail/3; }
-
+
// New school multidimensional scroll (touchpads) deltas
deltaY = delta;
-
+
// Gecko
if ( orgEvent.axis !== undefined && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
deltaY = 0;
deltaX = -1*delta;
}
-
+
// Webkit
if ( orgEvent.wheelDeltaY !== undefined ) { deltaY = orgEvent.wheelDeltaY/120; }
if ( orgEvent.wheelDeltaX !== undefined ) { deltaX = -1*orgEvent.wheelDeltaX/120; }
-
+
// Add event and delta to the front of the arguments
args.unshift(event, delta, deltaX, deltaY);
-
+
return ($.event.dispatch || $.event.handle).apply(this, args);
}
diff --git a/editor/panel.code.php b/editor/panel.code.php
index 82a958f6..bf067605 100644
--- a/editor/panel.code.php
+++ b/editor/panel.code.php
@@ -1,26 +1,26 @@
-url = PL_PARENT_URL . '/editor';
}
-
+
function scripts(){
-
+
// Codemirror Styles
wp_enqueue_style( 'codemirror', PL_ADMIN_JS . '/codemirror/codemirror.css' );
wp_enqueue_style( 'css3colorpicker', $this->url . '/js/colorpicker/colorpicker.css');
-
+
// CodeMirror Syntax Highlighting
wp_enqueue_script( 'codemirror', PL_ADMIN_JS . '/codemirror/codemirror.js', array( 'jquery' ), PL_CORE_VERSION, true );
wp_enqueue_script( 'codemirror-css', PL_ADMIN_JS . '/codemirror/css/css.js', array( 'jquery', 'codemirror' ), PL_CORE_VERSION, true );
@@ -28,11 +28,11 @@ function scripts(){
wp_enqueue_script( 'codemirror-js', PL_ADMIN_JS . '/codemirror/javascript/javascript.js', array( 'jquery', 'codemirror' ), PL_CORE_VERSION, true );
wp_enqueue_script( 'codemirror-xml', PL_ADMIN_JS . '/codemirror/xml/xml.js', array( 'jquery', 'codemirror' ), PL_CORE_VERSION, true );
wp_enqueue_script( 'codemirror-html', PL_ADMIN_JS . '/codemirror/htmlmixed/htmlmixed.js', array( 'jquery', 'codemirror' ), PL_CORE_VERSION, true );
-
+
// PageLines Specific JS @Code Stuff
wp_enqueue_script( 'pl-js-code', $this->url . '/js/pl.code.js', array( 'jquery', 'codemirror' ), PL_CORE_VERSION, true );
}
-
+
function toolbar( $toolbar ){
$toolbar['pl-design'] = array(
'name' => 'Custom',
@@ -55,21 +55,21 @@ function toolbar( $toolbar ){
),
)
);
-
+
return $toolbar;
}
-
+
function draw_custom_styles(){
-
+
if( true == ( $css = pl_setting( 'custom_less') ) )
- printf('', $css );
+ printf('', $css );
}
-
+
function draw_custom_scripts(){
printf( pl_setting('custom_scripts') );
}
-
-
+
+
function custom_less(){
?>
@@ -104,6 +104,6 @@ function custom_scripts(){
url = PL_PARENT_URL . '/editor';
}
-
+
function scripts(){
wp_enqueue_script( 'pl-js-extend', $this->url . '/js/pl.extend.js', array( 'jquery' ), PL_CORE_VERSION, true );
}
-
+
function toolbar( $toolbar ){
$toolbar['pl-extend'] = array(
'name' => 'Extend',
@@ -40,7 +40,7 @@ function toolbar( $toolbar ){
'featured' => array(
'name' => 'Featured',
'href' => '#store',
- 'filter'=> '.featured',
+ 'filter'=> '.featured',
'icon' => 'icon-star'
),
'sections' => array(
@@ -74,10 +74,10 @@ function toolbar( $toolbar ){
),
)
);
-
+
return $toolbar;
}
-
+
function upload_callback(){
?>
@@ -92,14 +92,14 @@ function upload_callback(){
@@ -39,20 +39,20 @@
-