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( '
%s
', $save_text); if( !empty( $confirms ) ){ foreach ( $confirms as $c ){ - + $class = ( isset($c['class'] ) ) ? $c['class'] : null; - + printf( '
%s
', $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( - '
%s%s
', - $list['active'], + '
%s%s
', + $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( - '
%s%s
', - $list['active'], + '
%s%s
', + $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( 'Thumb', $e['image'] ); - + if ( 'integration' != $e['type'] ) $title = sprintf('

%s

', $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( - '
%s
%s
%s%s
%s
%s
', - $style, + '
%s
%s
%s%s
%s
%s
', + $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( 'Thumb', $e['image'] ); - + if ( 'internal' != $e['tab'] && 'child' != $e['tab'] ) $title = sprintf('

%s

', $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( - '
%s
%s
%s%s
%s
%s
', - $style, + '
%s
%s
%s%s
%s
%s
', + $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( '
thumb
', $s['image'] ); $title = sprintf( - '

%s

%s
', - $s['name'], + '

%s

%s
', + $s['name'], $this->get_extend_buttons( $e ) ); $body = sprintf( - '
%s
%s
', - $s['desc'], + '
%s
%s
', + $s['desc'], join($details, ' | ') ); $out = sprintf( - '
%s %s %s
', + '
%s %s %s
', $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
', $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
', $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 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'); ?> - +
- +
- + - + 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(); + ?> - +
@@ -81,20 +81,20 @@ function build_header(){?>
- %s', $this->set['title'], $title_tag ); - - echo apply_filters( 'pagelines_settings_main_title', $panel_title ); - - ?> + + echo apply_filters( 'pagelines_settings_main_title', $panel_title ); + + ?>
@@ -108,7 +108,7 @@ function build_header(){?>
*/ function fullform_head(){ ?>
- set['settings']); // namespace for options important! + settings_fields($this->set['settings']); // namespace for options important! echo OptEngine::input_hidden('input-full-submit', 'input-full-submit', 0); // submit the form fully, page refresh needed } - + /** * @@ -140,7 +140,7 @@ function fullform_foot(){ ?>
* */ 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']); - + if($this->set['reset_cb']) echo OptEngine::input_hidden('reset_callback', 'reset_callback', $this->set['reset_cb']); - + echo OptEngine::superlink( sprintf( __('Restore %s To Default', 'pagelines'), strip_tags( $this->set['title'] ) ), 'grey', 'reset-options', 'submit', 'onClick="return ConfirmRestore();"', 'pl_reset_settings' ); - + pl_action_confirm('ConfirmRestore', __( 'Are you sure? This will restore these settings to default.', 'pagelines' ) ); ?> - +
- +
set['settings'] ); - global $pl_section_factory; - + global $pl_section_factory; + $tabs = ($this->set['tabs']) ? true : false; ?> -
- +
+

%s', $thebutton ); - - } else + + } else $button = ''; - + // The banner return sprintf('
%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(){ <?php echo VPRO_NAME;?>
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 @@ - +
- content->width; $name = get_pagelines_option_name('layout', 'content_width'); - + // Output $input = OptEngine::input_text($id, $name, $value, 'small-text', 'text', 'readonly'); echo OptEngine::input_label_inline($id, $input, 'Global Content Width (px)', 'lbl-layout'); - + // Main Column $id = 'input-maincolumn-width'; $value = $buildlayout->main_content->width; $name = get_pagelines_option_name('layout', $layout, 'maincolumn_width'); - + // Output - + $input = OptEngine::input_text($id, $name, $value, 'small-text', 'text', 'readonly'); echo OptEngine::input_label_inline($id, $input, 'Main Column Width (px)', 'lbl-layout'); - + // Sidebar 1 $id = 'input-primarysidebar-width'; $value = $buildlayout->sidebar1->width; $name = get_pagelines_option_name('layout', $layout, 'primarysidebar_width'); - + // Output - + $input = OptEngine::input_text($id, $name, $value, 'small-text', 'text', 'readonly'); echo OptEngine::input_label_inline($id, $input, 'Sidebar1 Width (px)', 'lbl-layout'); - + // Responsive $id = 'input-responsive-width'; $value = ($buildlayout->content->width / $buildlayout->builder->width) * 100; $name = get_pagelines_option_name('layout', 'responsive_width'); - + // Output $input = OptEngine::input_text($id, $name, $value, 'small-text', 'text', 'readonly'); echo OptEngine::input_label_inline($id, $input, 'Content Percent (%)', 'lbl-layout'); - - + + ?>
@@ -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('
%s
', join( '-', array($type, $template) ), $name); - + } - + } - + // Output printf('

%s

%s
', $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()){
- Editing → + Editing →
 

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++; @@ -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('
    Options
    ', (!$a['controls']) ? 'style="display:none;"' : ''); + + printf('
    Options
    ', (!$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('
    %s
    ', $clone_class, $clone_js, $clone_text ); - + $remove_clone = sprintf('
    Remove
    ', ($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('', $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; ?> - +
    -
    - +
    @@ -612,13 +612,13 @@ function section_control_interface($oid, $o){
    - +
    -
    %s %s
    ', ui_key( $editing ), __( 'Integration', 'pagelines' ) ); else - $this->sc_inputs($template_slug, $this->template->templates, $o ); + $this->sc_inputs($template_slug, $this->template->templates, $o ); ?>
    @@ -638,10 +638,10 @@ function section_control_interface($oid, $o){
    - +
    -
    - +
    @@ -667,14 +667,14 @@ 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){
    -
    '; - + } - + /** * @@ -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){
    */ - _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('
    ' 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( '
    %s
    %s
    ', o.key, specialClass, number, o.title, optionHTML ) + + out += sprintf( '
    %s
    %s
    ', o.key, specialClass, number, o.title, optionHTML ) }) - - + + return sprintf('
    %3$s
    ', 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('', 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('', 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('', o.key, o.label ) oHTML += sprintf('', o.key, o.name, o.value, o.classes) - - } - + + } + else if( o.type == 'textarea' ){ - + oHTML += sprintf('', 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('', aux, o.key, checked, o.label ) , flipCheck = (scope != 'global') ? sprintf('', 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 = '' - + 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('', optValue, selected, optName) - + }) } - - - - + + + + oHTML += sprintf('', o.key, o.label ) oHTML += sprintf('', o.key, o.name, o.classes, o.type, select_opts) - + if(o.type == 'select_taxonomy' && o.post_type) oHTML += sprintf( - '
    Edit Sets
    ', - $.pl.config.urls.adminURL, + '
    Edit Sets
    ', + $.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.family, uri, skey, selected, s.name, google, webSafe) }) } - + oHTML += sprintf('', o.key, o.label ) oHTML += sprintf('', o.key, o.name, select_opts) - + oHTML += sprintf('', 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('
    More Info
    %s
    ', 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(){
    Search the PageLines store for extensions. - + @@ -108,14 +108,14 @@ function search_callback(){ xlist = new EditorXList; - + $this->xlist = new EditorXList; + $list = ''; - + global $storeapi; $mixed_array = $storeapi->get_latest(); //plprint($mixed_array); @@ -148,6 +148,6 @@ function the_store_callback(){ printf('
    %s
    ', $list); } - - + + } \ No newline at end of file diff --git a/editor/panel.live.php b/editor/panel.live.php index eb494158..d546babd 100644 --- a/editor/panel.live.php +++ b/editor/panel.live.php @@ -1,25 +1,25 @@ -url = PL_PARENT_URL . '/editor'; - + $this->chat_frame_url = 'http://pagelines.campfirenow.com/6cd04'; } - + function scripts(){ - + } - + function toolbar( $toolbar ){ - $toolbar['live'] = array( + $toolbar['live'] = array( 'name' => 'Live', 'icon' => 'icon-comments', 'pos' => 70, @@ -31,9 +31,9 @@ function toolbar( $toolbar ){ ), ) ); - + return $toolbar; } - + } \ No newline at end of file diff --git a/editor/panel.sections.php b/editor/panel.sections.php index e00f3520..52df3ffd 100644 --- a/editor/panel.sections.php +++ b/editor/panel.sections.php @@ -1,21 +1,21 @@ -url = PL_PARENT_URL . '/editor'; } - + function scripts(){ wp_enqueue_script( 'pl-js-sections', $this->url . '/js/pl.sections.js', array( 'jquery' ), PL_CORE_VERSION, true ); } - + function toolbar( $toolbar ){ $toolbar['add-new'] = array( 'name' => 'Add New', @@ -100,17 +100,17 @@ function toolbar( $toolbar ){ ), ) ); - + return $toolbar; } - + function add_new_callback(){ - $this->xlist = new EditorXList; + $this->xlist = new EditorXList; $this->extensions = new EditorExtensions; $this->page = new PageLinesPage; $sections = $this->extensions->get_available_sections(); - + $list = ''; $count = 1; foreach($sections as $key => $s){ @@ -127,15 +127,15 @@ function add_new_callback(){ if($s->filter == 'deprecated') continue; - - + + if( $s->filter == 'full-width' ){ - $section_classes = 'pl-area-sortable area-tag'; + $section_classes = 'pl-area-sortable area-tag'; } else { - $section_classes = 'pl-sortable span12 sortable-first sortable-last'; + $section_classes = 'pl-sortable span12 sortable-first sortable-last'; } - - + + $class = array('x-add-new', $section_classes, $special_class, $s->filter); $number = $count++; @@ -149,13 +149,13 @@ function add_new_callback(){ $disable = false; } } - + if( $disable ) { $class[] = 'x-disable'; $number += 100; } - - + + } $args = array( @@ -186,5 +186,5 @@ function add_new_callback(){ } - + } \ No newline at end of file diff --git a/editor/panel.settings.php b/editor/panel.settings.php index e1100a92..eaf7a784 100644 --- a/editor/panel.settings.php +++ b/editor/panel.settings.php @@ -1,48 +1,48 @@ -url = PL_PARENT_URL . '/editor'; } - + function scripts(){ // Colorpicker wp_enqueue_script( 'css3colorpicker', $this->url . '/js/colorpicker/colorpicker.js', array('jquery'), '1.3.1', true ); // Image Uploader wp_enqueue_script( 'fineupload', $this->url . '/js/fineuploader/jquery.fineuploader-3.2.min.js', array('jquery'), PL_CORE_VERSION, true ); - + wp_enqueue_script( 'pl-js-settings', $this->url . '/js/pl.settings.js', array( 'jquery' ), PL_CORE_VERSION, true ); } - + function toolbar( $toolbar ){ - + $toolbar[ 'settings' ] = array( 'name' => 'Settings', 'icon' => 'icon-cog', 'pos' => 60, 'panel' => $this->get_settings_tabs() ); - + $toolbar[ 'section-options' ] = array( 'name' => 'Section Options', 'icon' => 'icon-paste', 'type' => 'hidden', 'flag' => 'section-opts', 'pos' => 1000, - 'panel' => $this->section_options_panel() + 'panel' => $this->section_options_panel() ); - + return $toolbar; } - + function get_settings_tabs( $panel = 'site' ){ $settings_object = new EditorSettings; @@ -60,30 +60,30 @@ function get_settings_tabs( $panel = 'site' ){ ); } - + return $tabs; } - + function section_options_panel(){ global $plpg; - + $current_page = ($plpg->is_special()) ? $plpg->type_name : $plpg->id; $tabs = array(); $tabs['heading'] = "Section Options"; $tabs['local'] = array( 'name' => 'Current Page '.$current_page.'' ); - + if( !$plpg->is_special() ) $tabs['type'] = array( 'name' => 'Post Type '.$plpg->type_name.'' ); - + $tabs['global'] = array( 'name' => 'Sitewide Defaults' ); - + return $tabs; } - - + + } \ No newline at end of file diff --git a/editor/panel.templates.php b/editor/panel.templates.php index 0866d8ea..3f4adb02 100644 --- a/editor/panel.templates.php +++ b/editor/panel.templates.php @@ -1,80 +1,80 @@ data = new PageLinesData; - + $this->data = new PageLinesData; + global $plpg; - + $this->page = $plpg; - - + + $this->default_type_tpl = ($plpg && $plpg != '') ? $this->data->meta( $plpg->typeid, $this->default_template_slug ) : false; - + $this->default_global_tpl = $this->data->opt( $this->default_template_slug ); - + $this->default_tpl = ($this->default_type_tpl) ? $this->default_type_tpl : $this->default_global_tpl; - + $this->url = PL_PARENT_URL . '/editor'; - + add_filter('pl_toolbar_config', array(&$this, 'toolbar')); add_filter('pagelines_editor_scripts', array(&$this, 'scripts')); - + add_action( 'admin_init', array(&$this, 'admin_page_meta_box')); add_action( 'post_updated', array(&$this, 'save_meta_options') ); - + } - + function admin_page_meta_box(){ remove_meta_box( 'pageparentdiv', 'page', 'side' ); add_meta_box('specialpagelines', __('Page Setup'), array(&$this, 'page_attributes_meta_box'), 'page', 'side'); - + } - + function save_meta_options( $postID ){ $post = $_POST; if((isset($post['update']) || isset($post['save']) || isset($post['publish']))){ - - + + $user_template = (isset($post['pagelines_template'])) ? $post['pagelines_template'] : ''; - + if($user_template != ''){ - + pl_meta_update($postID, $this->map_option_slug, array('live' => $user_template, 'draft' => $user_template)); } - - + + } } function page_attributes_meta_box( $post ){ $post_type_object = get_post_type_object($post->post_type); - ///// CUSTOM PAGE TEMPLATE STUFF ///// + ///// CUSTOM PAGE TEMPLATE STUFF ///// - $options = ''; + $options = ''; $loaded_user_template = pl_meta($post->ID, $this->map_option_slug, pl_settings_default()); - + foreach($this->get_user_templates() as $index => $t){ $sel = ''; - - $options .= sprintf('', $index, $sel, $t['name']); + + $options .= sprintf('', $index, $sel, $t['name']); } - + printf('

    %1$s

    ', __('Load PageLines Template', 'pagelines')); printf('', $options); - ///// END TEMPLATE STUFF ///// + ///// END TEMPLATE STUFF ///// + - if ( $post_type_object->hierarchical ) { $dropdown_args = array( 'post_type' => $post->post_type, @@ -92,17 +92,17 @@ function page_attributes_meta_box( $post ){ printf('

    %1$s

    ', __('Parent Page')); echo $pages; } - } + } printf('

    %1$s

    ', __('Page Order')); printf('

    ', esc_attr($post->menu_order) ); } - + function scripts(){ wp_enqueue_script( 'pl-js-templates', $this->url . '/js/pl.templates.js', array( 'jquery' ), PL_CORE_VERSION, true ); } - + function toolbar( $toolbar ){ $toolbar['page-setup'] = array( 'name' => 'Templates', @@ -124,31 +124,31 @@ function toolbar( $toolbar ){ ) ); - + return $toolbar; } - + function user_templates(){ $slug = $this->default_template_slug; - $this->xlist = new EditorXList; + $this->xlist = new EditorXList; $templates = ''; $list = ''; $tpls = pl_meta( $this->page->id, $this->map_option_slug, pl_settings_default()); - + foreach( $this->get_user_templates() as $index => $template){ - - - $classes = array('x-templates'); - $classes[] = sprintf('template_key_%s', $index); - - $active_class = ($index === $tpls['draft']) ? 'active-template' : ''; - + + + $classes = array('x-templates'); + $classes[] = sprintf('template_key_%s', $index); + + $active_class = ($index === $tpls['draft']) ? 'active-template' : ''; + $global_class = ($index === $this->default_global_tpl) ? 'active-global' : ''; $type_class = ($index === $this->default_type_tpl && !$this->page->is_special()) ? 'active-type' : ''; - - - ob_start(); - + + + ob_start(); + ?> - - - $classes, 'data_array' => array( @@ -202,46 +202,46 @@ function user_templates(){ ); $list .= $this->xlist->get_x_list_item( $args ); - - - + + + } - + printf('
    %s
    ', $list); - + } - + function save_templates(){ - + ?> - +
    Fill out this form and the current template configuration will be saved for use throughout your site. - +
    - - template_slug, $this->default_user_templates() ); - + return $templates; - + } - + function get_map_from_template_key( $key ){ - + $templates = $this->get_user_templates(); //var_dump($key); if( isset($templates[ $key ]) && isset($templates[ $key ]['map'] ) ) @@ -249,70 +249,70 @@ function get_map_from_template_key( $key ){ else return false; } - + function set_new_local_template( $pageID, $tpl_id ){ - + $user_map = pl_meta( $pageID, $this->map_option_slug, pl_settings_default()); - + $user_map['draft'] = $tpl_id; pl_meta_update($pageID, $this->map_option_slug, $user_map); - + return $user_map; - + } - - + + function create_template( $name, $desc, $map ){ - + $templates = $this->get_user_templates(); - + $templates[ pl_create_id( $name ) ] = array( 'name' => $name, - 'desc' => $desc, + 'desc' => $desc, 'map' => $map ); - + pl_opt_update( $this->template_slug, $templates ); - + } - + function update_template( $key, $template_map ){ - + $templates = $this->get_user_templates(); - + $templates[$key]['map'] = $template_map; - + pl_opt_update( $this->template_slug, $templates ); - + } - + function delete_template( $key ){ - + $templates = $this->get_user_templates(); - + unset( $templates[$key] ); - + pl_opt_update( $this->template_slug, $templates ); - + } - + function load_template( $tpl ){ - - + + // if load user template $tpl = ( isset( $tpl ) && !is_array( $tpl )) ? $tpl : $this->default_tpl; - + $d = $this->get_map_from_template_key( $tpl ); - + if(!$d || $d == '' || !is_array($d)){ $d = array( $this->default_template() ); } - - + + return $d; } - + function default_template(){ $t = array( 'name' => 'Content Area', @@ -321,7 +321,7 @@ function default_template(){ array( 'object' => 'PLColumn', 'span' => 8, - 'content' => array( + 'content' => array( array( 'object' => 'PageLinesPostLoop' ), @@ -333,7 +333,7 @@ function default_template(){ array( 'object' => 'PLColumn', 'span' => 4, - 'content' => array( + 'content' => array( array( 'object' => 'PrimarySidebar' ), @@ -341,12 +341,12 @@ function default_template(){ ), ) ); - + return $t; - + } - - + + function default_header(){ $d = array( array( @@ -362,10 +362,10 @@ function default_header(){ ) ); - + return $d; } - + function default_footer(){ $d = array( array( @@ -378,25 +378,25 @@ function default_footer(){ ) ); - + return $d; } function default_user_templates(){ - + $t = array(); - + $t[ 'default' ] = array( - 'name' => 'Default Template', - 'desc' => 'Standard page configuration with right aligned sidebar and content area.', + 'name' => 'Default Template', + 'desc' => 'Standard page configuration with right aligned sidebar and content area.', 'map' => array( 'template' => $this->default_template() ) ); - + $t[ 'feature' ] = array( - 'name' => 'Feature Template', - 'desc' => 'Standard page configuration with right aligned sidebar and content area.', + 'name' => 'Feature Template', + 'desc' => 'Standard page configuration with right aligned sidebar and content area.', 'map' => array( 'template' => array( 'area' => 'TemplateAreaID', @@ -406,20 +406,20 @@ function default_user_templates(){ ), array( 'object' => 'PageLinesBoxes', - + ), array( 'object' => 'PageLinesPostLoop', - + ), ) ) ) - ); + ); $t[ 'landing' ] = array( - 'name' => 'Landing Page', - 'desc' => 'Standard page configuration with right aligned sidebar and content area.', + 'name' => 'Landing Page', + 'desc' => 'Standard page configuration with right aligned sidebar and content area.', 'map' => array( 'template' => array( 'area' => 'TemplateAreaID', @@ -429,14 +429,14 @@ function default_user_templates(){ ), array( 'object' => 'PageLinesPostLoop', - + ), - + ) ) ) ); - + return $t; } diff --git a/editor/panel.themes.php b/editor/panel.themes.php index f7c0310b..f207e8da 100644 --- a/editor/panel.themes.php +++ b/editor/panel.themes.php @@ -3,21 +3,21 @@ class EditorThemeHandler { - + var $preview_slug = 'pl-theme-preview'; - + function __construct( ){ - + add_action('pagelines_editor_scripts', array(&$this, 'scripts')); add_filter('pl_toolbar_config', array(&$this, 'toolbar')); - + $this->url = PL_PARENT_URL . '/editor'; } - + function scripts(){ wp_enqueue_script( 'pl-js-themes', $this->url . '/js/pl.themes.js', array( 'jquery' ), PL_CORE_VERSION, true ); } - + function toolbar( $toolbar ){ $toolbar['theme'] = array( 'name' => 'Theme', @@ -33,18 +33,18 @@ function toolbar( $toolbar ){ 'more_themes' => array( 'name' => 'Get More Themes', 'flag' => 'link-storefront', - 'icon' => 'icon-download' + 'icon' => 'icon-download' ) ) ); - + return $toolbar; } - + function themes_dashboard(){ - $this->xlist = new EditorXList; - + $this->xlist = new EditorXList; + $themes = wp_get_themes(); $active_theme = wp_get_theme(); @@ -67,12 +67,12 @@ function themes_dashboard(){ $active = ''; $number = $count++; } - + if( is_file( sprintf( '%s/splash.png', $t->get_stylesheet_directory() ) ) ) $splash = sprintf( '%s/splash.png', $t->get_stylesheet_directory_uri() ); - else + else $splash = $t->get_stylesheet(); - + $class[] = 'x-item-size-10'; $args = array( @@ -97,80 +97,80 @@ function themes_dashboard(){ printf('
    %s
    ', $list); } - - // AJAX ACTIONS - + + // AJAX ACTIONS + function activate( $response ){ - + $new = $response['post']['stylesheet']; - + $theme = wp_get_theme( $new ); - + if ( !$new || !$theme->exists() || !$theme->is_allowed() ){ $response['error'] = 'Theme does not exist or is not allowed'; return $response; } - - + + switch_theme( $theme->get_stylesheet() ); - + $response['success'] = 'Theme Switched!'; $response['new'] = $new; - + return $response; } - + function set_preview(){ - + $new = $response['post']['stylesheet']; - + $theme = wp_get_theme( $new ); - + if ( !$new || !$theme->exists() || !$theme->is_allowed() ){ $response['error'] = 'Theme does not exist or is not allowed'; return $response; } else { echo 'here'; pl_update_setting($this->preview_slug, $new); - + return $response; - + } - + } function maybe_load_preview( $active_stylesheet ){ - + $preview_theme = $this->determine_theme( $active_stylesheet ); - + if ( $preview_theme ){ - - $preview_theme_object = wp_get_theme( $preview_theme ); - - add_action('before_toolbox_panel', array(&$this, 'add_preview_banner')); - - return $preview_theme_object->get_stylesheet(); - + + $preview_theme_object = wp_get_theme( $preview_theme ); + + add_action('before_toolbox_panel', array(&$this, 'add_preview_banner')); + + return $preview_theme_object->get_stylesheet(); + } else return $active_stylesheet; - - - + + + } - + function determine_theme( $active_stylesheet ){ - $preview_stylesheet = pl_setting( $this->preview_slug ); - + $preview_stylesheet = pl_setting( $this->preview_slug ); + if( $preview_stylesheet && $preview_stylesheet != $active_stylesheet ) - return $preview_stylesheet; - else + return $preview_stylesheet; + else return false; } - + function add_preview_banner(){ - - echo ' this is the end of the world.... >> '; + + echo ' this is the end of the world.... >> '; } - - + + } \ No newline at end of file diff --git a/footer.php b/footer.php index 60931d1f..b816e47b 100644 --- a/footer.php +++ b/footer.php @@ -1,4 +1,4 @@ -
    -
    @@ -39,20 +39,20 @@ - \ No newline at end of file diff --git a/header.php b/header.php index 30b4f801..d050a63a 100644 --- a/header.php +++ b/header.php @@ -1,4 +1,4 @@ - > - -> HTML Body', 1); ?> > -
    - +
    - +
    - +
    @@ -65,8 +65,8 @@
    -
    - +id = $id; - + $this->base_hex = str_replace('#', '', $hex); - + $this->base_rgb = $this->hex_to_rgb( $this->base_hex ); - + $this->base_hsl = $this->rgb_to_hsl( $this->base_rgb ); - + } @@ -47,13 +47,13 @@ function __construct( $hex, $id = '' ) { * @return string - returns HSL value */ function get_hsl( $hex, $type ){ - + $hex = str_replace('#', '', $hex); $rgb = $this->hex_to_rgb( $hex ); $hsl = $this->rgb_to_hsl( $rgb ); - + return $hsl[$type]; } @@ -73,58 +73,58 @@ function get_hsl( $hex, $type ){ * @return mixed|string */ function get_color( $mode = null, $difference = '10%', $alt = null, $id = null){ - + $alt = str_replace('#', '', $alt); - + if(is_string($difference)){ $dp = (int) str_replace('%', '', $difference); $diff = $dp/100; - } else + } else $diff = $difference; - - + + if($mode == 'lighter') - $color = $this->adjust($diff); + $color = $this->adjust($diff); elseif($mode == 'darker') $color = $this->adjust(-$diff); elseif($mode == 'light-contrast'){ - + if($this->base_hsl['lightness'] > .92) $color = $this->adjust(-$diff); else { - + $diff = $this->darkadjust($diff); - + $color = $this->adjust($diff); } - - + + } elseif($mode == 'contrast'){ - + if( $this->base_hsl['lightness'] < .4 || ($this->base_hsl['lightness'] < .7 && $this->base_hsl['hue'] > .6) || ($this->base_hsl['saturation'] > .8 && $this->base_hsl['lightness'] < .4)){ - + $diff = $this->darkadjust($diff); - - + + $color = $this->adjust($diff); }else $color = $this->adjust(-$diff); - - + + }elseif( $mode == 'mix' ){ - + $color = $this->mix_colors($this->base_hex, $alt, $diff); - + }elseif( $mode == 'shadow' ){ - + $color = $this->adjust($diff, 'lightness', $alt); - + } else { $color = $this->base_hex; } - - - return $color; + + + return $color; } @@ -142,7 +142,7 @@ function darkadjust( $diff ){ $diff = 2*$diff; elseif($this->base_hsl['lightness'] < .2) $diff = 1.5*$diff; - + return $diff; } @@ -155,15 +155,15 @@ function darkadjust( $diff ){ * @param $difference */ function loadcolor( $base, $type, $difference ){ - + $base = str_replace('#', '', $base); - + if(is_string($difference)){ $dp = (int) str_replace('%', '', $difference); $diff = $dp/100; - } else + } else $diff = $difference; - + } @@ -186,56 +186,56 @@ function loadcolor( $base, $type, $difference ){ function adjust( $adjustment, $mode = 'lightness', $hex = null){ if(isset($hex)){ - + $althex = str_replace('#', '', $hex); $altrgb = $this->hex_to_rgb( $althex ); $althsl = $this->rgb_to_hsl( $altrgb ); - + $h = $althsl['hue']; $s = $althsl['saturation']; $l = $althsl['lightness']; - + }else{ $h = $this->base_hsl['hue']; $s = $this->base_hsl['saturation']; $l = $this->base_hsl['lightness']; } - + if( is_array($adjustment) ){ - - $l = $l + $adjustment['lightness']; - + + $l = $l + $adjustment['lightness']; + $h = $h + $adjustment['hue']; - - $s = $s + $adjustment['saturation']; - - + + $s = $s + $adjustment['saturation']; + + } else { - + if($mode == 'hue') - $h = $h + $adjustment; + $h = $h + $adjustment; elseif($mode == 'saturation') - $s = $s + $adjustment; - else - $l = $l + $adjustment; + $s = $s + $adjustment; + else + $l = $l + $adjustment; } - - + + // Adjust for hue 180* scale if ($h > 1) $h -= 1; if ($s > 1) $s = 1; if ($l > 1) $l = 1; - + if ($h < 0) $h += 1; if ($s < 0) $s = 0; if ($l < 0) $l = 0; - - + + $new_hsl = array( 'hue' => $h, 'saturation' => $s, 'lightness' => $l ); - + return $this->hsl_to_hex( $new_hsl ); } @@ -249,7 +249,7 @@ function adjust( $adjustment, $mode = 'lightness', $hex = null){ * @return array - individual Red, Greeb, and Blue values */ function hex_to_rgb( $hexcode ){ - + $redhex = substr( $hexcode, 0, 2 ); $greenhex = substr( $hexcode, 2, 2 ); $bluehex = substr( $hexcode, 4, 2 ); @@ -259,9 +259,9 @@ function hex_to_rgb( $hexcode ){ $r = hexdec($redhex); $g = hexdec($greenhex); $b = hexdec($bluehex); - + return array( 'red' => $r, 'green' => $g, 'blue' => $b ); - + } @@ -274,16 +274,16 @@ function hex_to_rgb( $hexcode ){ * @return array - individual Hue, Saturation, and Lightness values */ function rgb_to_hsl( $rgb ){ - - + + $clrR = $rgb['red']; $clrG = $rgb['green']; $clrB = $rgb['blue']; - + $clrMin = min($clrR, $clrG, $clrB); $clrMax = max($clrR, $clrG, $clrB); $deltaMax = $clrMax - $clrMin; - + $L = ($clrMax + $clrMin) / 510; if (0 == $deltaMax){ @@ -291,10 +291,10 @@ function rgb_to_hsl( $rgb ){ $S = 0; }else{ if (0.5 > $L) - $S = $deltaMax / ($clrMax + $clrMin); + $S = $deltaMax / ($clrMax + $clrMin); else $S = $deltaMax / (510 - $clrMax - $clrMin); - + if ($clrMax == $clrR) $H = ($clrG - $clrB) / (6.0 * $deltaMax); elseif ($clrMax == $clrG) @@ -304,10 +304,10 @@ function rgb_to_hsl( $rgb ){ if (0 > $H) $H += 1; if (1 < $H) $H -= 1; - + } - - + + return array( 'hue' => $H, 'saturation' => $S, 'lightness' => $L ); } @@ -325,11 +325,11 @@ function rgb_to_hsl( $rgb ){ * @return string - hex color value */ function hsl_to_hex( $hsl ){ - + $rgb = $this->hsl_to_rgb($hsl); $hex = $this->rgb_to_hex($rgb); - + return $hex; } @@ -361,16 +361,16 @@ function hsl_to_rgb( $hsl ){ $var_2 = $l * (1 + $s); else $var_2 = ($l + $s) - ($s * $l); - + $var_1 = 2 * $l - $var_2; $r = 255 * $this->_hue_to_rgb( $var_1, $var_2, $h + (1 / 3) ); $g = 255 * $this->_hue_to_rgb( $var_1, $var_2, $h ); $b = 255 * $this->_hue_to_rgb( $var_1, $var_2, $h - (1 / 3) ); }; - + return array( 'red' => $r, 'green' => $g, 'blue' => $b ); - + } @@ -384,7 +384,7 @@ function hsl_to_rgb( $hsl ){ * @return */ function _hue_to_rgb( $v1, $v2, $vh ) { - + if ($vh < 0) { $vh += 1; }; @@ -419,19 +419,19 @@ function _hue_to_rgb( $v1, $v2, $vh ) { * @return string */ function rgb_to_hex($rgb){ - + $r = $rgb['red']; $g = $rgb['green']; $b = $rgb['blue']; - + $rhex = sprintf( '%02X', round($r) ); $ghex = sprintf( '%02X', round($g) ); $bhex = sprintf( '%02X', round($b) ); $hex = $rhex.$ghex.$bhex; - + return $hex; - + } @@ -450,22 +450,22 @@ function rgb_to_hex($rgb){ * @return string */ function mix_colors($c1, $c2, $ratio = .5){ - + $r1 = $ratio * 2; $r2 = 2 - $r1; $c1_rgb = $this->hex_to_rgb($c1); $c2_rgb = $this->hex_to_rgb($c2); - - + + $rmix = ( ( $c1_rgb['red'] * $r1 ) + ( $c2_rgb['red'] * $r2 ) ) / 2; $gmix = ( ( $c1_rgb['green'] * $r1 ) + ( $c2_rgb['green'] * $r2 ) ) / 2; $bmix = ( ( $c1_rgb['blue'] * $r1 ) + ( $c2_rgb['blue'] * $r2 ) ) / 2; - + $new_rgb = array('red' => $rmix, 'green' => $gmix, 'blue' => $bmix); return $this->rgb_to_hex( $new_rgb ); - + } @@ -484,11 +484,11 @@ function mix_colors($c1, $c2, $ratio = .5){ * @return string - HEX color value */ function c($mode = 'null', $difference = '10%', $alt = null, $id = null ){ - + $color = $this->get_color($mode, $difference, $alt, $id ); - + return '#'.$color; - + } @@ -505,9 +505,9 @@ function c($mode = 'null', $difference = '10%', $alt = null, $id = null ){ * @uses c */ function ce($mode = 'null', $difference = '10%', $alt = null, $id = null ){ - + echo $this->c($mode, $difference, $alt, $id ); - + } @@ -530,27 +530,27 @@ function ce($mode = 'null', $difference = '10%', $alt = null, $id = null ){ function shadow( $mix, $type = 'text', $diff = null, $echo = true ){ if( $type == 'text'){ - + if( ploption('disable_text_shadow') ) return; - + $difference = ( $this->get_hsl($mix, 'lightness') - $this->base_hsl['lightness'] ); $difference = ($difference > 0 ) ? .1 : -.2; - + $prop = ( $difference < 0 ) ? 'text-shadow: 0 -1px 0 %s;' : 'text-shadow: 0 1px 0 %s;'; - + } elseif( $type == 'box' ){ - + $difference = -.3; - + $prop = '%s'; - - + + } - + $rule = sprintf( $prop, $this->c( 'shadow', $difference, $mix ) ); - + if($echo) echo $rule; else @@ -575,10 +575,10 @@ function shadow( $mix, $type = 'text', $diff = null, $echo = true ){ */ function gradient( $mode = null, $diff = '10%', $direction = 'top', $echo = true ){ - $hex = (isset($mode)) ? $this->c( $mode, $diff ) : $this->c(); + $hex = (isset($mode)) ? $this->c( $mode, $diff ) : $this->c(); $hex = str_replace('#', '', $hex); - + $lighter = '#'.$this->adjust( .03, 'lightness', $hex); $darker = '#'.$this->adjust( -.03, 'lightness', $hex); @@ -596,10 +596,10 @@ function gradient( $mode = null, $diff = '10%', $direction = 'top', $echo = true background:-moz-linear-gradient(%4$s, %2$s, %3$s); -pie-background:linear-gradient(%4$s, %2$s, %3$s); background:linear-gradient(%4$s, %2$s, %3$s);', - $hex, - $lighter, + $hex, + $lighter, $darker, - $dir, + $dir, $op_dir ); @@ -608,7 +608,7 @@ function gradient( $mode = null, $diff = '10%', $direction = 'top', $echo = true else return $rule; } - + } //-------- END OF CLASS --------// @@ -639,20 +639,20 @@ function do_color_math($oid, $o, $val, $format = 'css'){ $default = (isset($o['default'])) ? $o['default'] : $val; $output = ''; - + $id = (isset($o['id'])) ? $o['id'] : null; - + $math_array = ( isset($o['math']) ) ? $o['math'] : array(); - + $math_array = apply_filters('pl_math_array', $math_array, $oid, $o); - + if( !empty($math_array) ){ - - + + // Set the base. // If no option value, use the depends cascade foreach( $o['math'] as $key => $k ){ - + if(!$val){ if(isset($k['depends'])){ foreach($k['depends'] as $d){ @@ -662,22 +662,22 @@ function do_color_math($oid, $o, $val, $format = 'css'){ break; } } - } + } - } else + } else $base = str_replace('#', '', $val); - + } - - // Set the base color - $base = (isset($base)) ? $base : $default; - + + // Set the base color + $base = (isset($base)) ? $base : $default; + if(isset($id)) store_set_color($id, $base); - + // Set up the base color for editing $math = new PageLinesColor( $base, $id); - + // Process math array foreach( $o['math'] as $key => $k ){ @@ -686,51 +686,51 @@ function do_color_math($oid, $o, $val, $format = 'css'){ $difference = isset($k['diff']) ? $k['diff'] : '10%'; if($k['mode'] == 'mix' || $k['mode'] == 'shadow'){ - + if( isset($k['mixwith']) && is_array($k['mixwith']) ){ - + foreach($k['mixwith'] as $mkey => $m){ - + if( isset($m) && !empty($m)){ $mix_color = $m; break; - } else + } else $mix_color = $base; - + } - + } elseif( isset($k['mixwith']) ) $mix_color = $k['mixwith']; - + if($k['mode'] == 'shadow'){ - + //if( ploption('disable_text_shadow') ) /** commented out return as part of if statement */ // return; - + $difference = ($math->get_hsl($mix_color, 'lightness') - $math->base_hsl['lightness']); - + $difference = ($difference > 0 ) ? .1 : -.2; - + $k['css_prop'] = ( $difference < 0) ? array('text-shadow-top') : array('text-shadow'); - + } - + $color = $math->get_color($k['mode'], $difference, $mix_color, $id); - - } else + + } else $color = $math->get_color($k['mode'], $difference, null, $id); $css = new PageLinesCSS; if(isset($o['selectors']) && $o['selectors'] != ''){ - + $output .= $css->load_the_props( $k['css_prop'], '#'.$color ); - + } else { - + // If using cssgroups - + $cssgroup = $k['cssgroup']; @@ -739,20 +739,20 @@ function do_color_math($oid, $o, $val, $format = 'css'){ $css->set_factory_key($cgroup, $css->load_the_props( $k['css_prop'], '#'.$color )); else $css->set_factory_key($cssgroup, $css->load_the_props( $k['css_prop'], '#'.$color )); - - + + } - - - + + + // Recursion if( isset($k['math']) ) do_color_math($key, $k, $color, $format); - - + + } } - + return $output; } @@ -765,13 +765,13 @@ function do_color_math($oid, $o, $val, $format = 'css'){ * @param $color */ function store_set_color($id, $color){ - + global $set_colors; - + $color = str_replace('#', '', $color); - + $set_colors[ $id ] = $color; - + } /** @@ -782,14 +782,14 @@ function store_set_color($id, $color){ * @return string|bool - value of set_color[id] or false when no value has been established */ function get_set_color( $id ){ - + global $set_colors; - + if(isset($set_colors[ $id ])) return $set_colors[ $id ]; else return false; - + } @@ -801,9 +801,9 @@ function get_set_color( $id ){ * @return \PageLinesColor (class) */ function loadmath( $color ){ - + return new PageLinesColor( $color ); - + } /** @@ -822,16 +822,16 @@ function loadmath( $color ){ * @return \PageLinesColor (class) */ function setmath($type, $option = null, $oset = array()){ - + if( $type == 'txt' ) - $backup = pl_text_color(); + $backup = pl_text_color(); elseif( $type == 'lnk' ) $backup = pl_link_color(); else $backup = pl_base_color(); - + $color = ( isset($option) && ploption($option, $oset) ) ? ploption($option, $oset) : $backup; - + return loadmath( $color ); - + } \ No newline at end of file diff --git a/includes/class.css.php b/includes/class.css.php index 883e8766..e9ae9ee8 100644 --- a/includes/class.css.php +++ b/includes/class.css.php @@ -1,6 +1,6 @@ typography(); $this->layout(); $this->options(); - + } - + /** * @@ -33,11 +33,11 @@ function create( $format = 'inline') { * */ function typography(){ - + $foundry = new PageLinesFoundry; $this->css .= $foundry->render_css(); } - + /** * @@ -48,7 +48,7 @@ function layout(){ global $pagelines_layout; $this->css .= $pagelines_layout->get_layout_inline(); } - + /** * @@ -56,89 +56,89 @@ function layout(){ * */ function options(){ - + $this->css .= $this->render_css(); - + } - - + + /** * CSS Rendering In */ function render_css(){ global $pagelines_ID; - + $css = ''; - + if(has_action('override_pagelines_css_output')) return; - + foreach ( get_option_array() as $menu){ - foreach($menu as $oid => $o){ - + foreach($menu as $oid => $o){ + if ( ! is_array( $o ) ) $o = array(); $oset = array( 'post_id' => $pagelines_ID ); $o['val'] = ploption($oid, $oset); - + if(!empty($o['selectvalues']) && is_array($o['selectvalues'])){ foreach( $o['selectvalues'] as $sid => $s) $o['selectvalues'][$sid]['val'] = ploption( $sid, $oset); } - + if( !ploption('supersize_bg', $oset) && isset( $o['type'] ) && $o['type'] == 'background_image' && ploption($oid.'_url', $oset)){ - + $bg_repeat = (ploption($oid.'_repeat', $oset)) ? ploption($oid.'_repeat', $oset) : 'no-repeat'; $bg_attach = (ploption($oid.'_attach', $oset)) ? ploption($oid.'_attach', $oset): 'scroll'; $bg_pos_vert = (ploption($oid.'_pos_vert', $oset) || ploption($oid.'_pos_vert', $oset) == 0 ) ? (int) ploption($oid.'_pos_vert', $oset) : '0'; $bg_pos_hor = (ploption($oid.'_pos_hor', $oset) || ploption($oid.'_pos_hor', $oset) == 0 ) ? (int) ploption($oid.'_pos_hor', $oset) : '50'; $bg_selector = (ploption($oid.'_selector', $oset)) ? ploption($oid.'_selector', $oset) : $o['selectors']; $bg_url = ploption($oid.'_url', $oset); - + $css .= sprintf('%s{ background-image:url(%s);}', $bg_selector, $bg_url); $css .= sprintf('%s{ background-repeat: %s;}', $bg_selector, $bg_repeat); $css .= sprintf('%s{ background-attachment: %s;}', $bg_selector, $bg_attach); $css .= sprintf('%s{ background-position: %s%% %s%%;}', $bg_selector, $bg_pos_hor, $bg_pos_vert); - - - } - + + + } + elseif( isset( $o['type'] ) && $o['type'] == 'colorpicker' && isset($o['cssgroup']) && isset($o['css_prop'])) $this->render_css_colors($oid, $o['cssgroup'], $o['css_prop']); - + elseif( isset( $o['type'] ) && $o['type'] == 'color_multi'){ - - foreach($o['selectvalues'] as $mid => $m){ - + + foreach($o['selectvalues'] as $mid => $m){ + $cprop = (isset($m['css_prop'])) ? $m['css_prop'] : 'color'; - + if( $m['val'] != '' && isset($m['selectors']) && $m['selectors'] != ''){ - + $rules = $this->load_the_props( $cprop, $m['val'] ); - + $rules .= do_color_math($mid, $m, $m['val']); - + $css .= sprintf('%s %s{%s} /* %s */ %s %s', "\n", $m['selectors'], $rules, $mid, "\n", "\n" ); - + } else { - + $cgroup = (isset($m['cssgroup'])) ? $m['cssgroup'] : null; $cprop = (isset($m['css_prop'])) ? $m['css_prop'] : null; $this->render_css_colors($mid, $m, $cgroup, $cprop ); - + } } } - - } + + } } $css .= $this->parse_css_factory(); return $css; } - + /** * @@ -146,21 +146,21 @@ function render_css(){ * */ function render_css_colors( $oid, $o, $cssgroup = null, $css_prop = null ){ - + $v = $o['val']; if( !$v && isset($o['flag'])) $v = ($o['flag'] == 'blank_default' ) ? false : $o['default'] = false; - + do_color_math($oid, $o, $v, 'css'); - + if( $v && isset($css_prop) ) $this->set_factory_key($cssgroup, $this->load_the_props( $css_prop, $v )); elseif( $v ) $this->set_factory_key($cssgroup, $this->get_the_rule( 'color', $v )); - + } - + /** * @@ -168,21 +168,21 @@ function render_css_colors( $oid, $o, $cssgroup = null, $css_prop = null ){ * */ function load_the_props( $props, $val ){ - + $output = ''; - + if( is_array($props) ){ - + foreach( $props as $p => $s ) $output .= ( gettype($p) == 'string' ) ? $this->get_the_rule( $p, $val ) : $this->get_the_rule( $s, $val ); - + } else $output .= $this->get_the_rule( $props, $val); - + return $output; - + } - + /** * @@ -191,16 +191,16 @@ function load_the_props( $props, $val ){ */ function get_the_rule( $prop, $val ){ - if( $prop == 'text-shadow' ) - $rule = sprintf('%s:%s;', 'text-shadow', $val.' 0 1px 0'); + if( $prop == 'text-shadow' ) + $rule = sprintf('%s:%s;', 'text-shadow', $val.' 0 1px 0'); elseif( $prop == 'text-shadow-top' ) $rule = sprintf('%s:%s;', 'text-shadow', $val.' 0 -1px 0'); else $rule = sprintf('%s:%s;', $prop, $val); - + return $rule; - } - + } + /** * @@ -208,14 +208,14 @@ function get_the_rule( $prop, $val ){ * */ function set_factory_key($cssgroup, $props){ - + global $css_factory; - + if(isset($css_factory[ $cssgroup ])) $css_factory[ $cssgroup ] .= $props; - else + else $css_factory[ $cssgroup ] = $props; - + } @@ -225,17 +225,17 @@ function set_factory_key($cssgroup, $props){ * */ function parse_css_factory(){ - + global $css_factory; - + $output = ''; foreach( $css_factory as $cssgroup => $props){ - + $selectors = cssgroup($cssgroup); - + if($selectors != '') $output .= sprintf('%s{%s}', $selectors, $props); - + } return $output; } diff --git a/includes/class.integration.php b/includes/class.integration.php index 7d0be4af..c1be1785 100644 --- a/includes/class.integration.php +++ b/includes/class.integration.php @@ -1,4 +1,4 @@ -integration = $integration; - + global $pl_integration; $pl_integration = $this->integration; - + add_filter('pagelines_lesscode', array(&$this, 'load_less')); - + } - + public function add_less( $path){ - + if(is_file($path)) - $this->lesscode .= pl_file_get_contents($path); + $this->lesscode .= pl_file_get_contents($path); } - + /** * @@ -41,13 +41,13 @@ public function add_less( $path){ * */ function load_less( $lesscode ){ - + return $lesscode . $this->lesscode; - + } - + public function parse_header(){ - + ob_start(); get_header(); $raw = ob_get_clean(); @@ -55,25 +55,25 @@ public function parse_header(){ $css = $this->regex_parse( array( 'buffer' => $raw, 'type' => 'css' ) ); $js = $this->regex_parse( array( 'buffer' => $raw, 'type' => 'js' ) ); $divs = $this->regex_parse( array( 'buffer' => $raw, 'type' => 'divs' ) ); - + return array('css' => $css, 'js' => $js, 'divs' => $divs); - + } - + public function parse_footer(){ - + ob_start(); get_footer(); // wp_footer(); // wp_print_scripts(); $raw = ob_get_clean(); - + return array('raw' => $raw); - + } - + public function regex_parse( $args ){ - + $defaults = array( 'buffer'=> '', @@ -123,5 +123,5 @@ public function regex_parse( $args ){ } - } + } } \ No newline at end of file diff --git a/includes/class.layout.php b/includes/class.layout.php index 565bd84c..e8961f1a 100644 --- a/includes/class.layout.php +++ b/includes/class.layout.php @@ -19,8 +19,8 @@ class PageLinesLayout { * */ function __construct($layout_mode = null) { - - $this->builder = new stdClass; + + $this->builder = new stdClass; $this->clip = new stdClass; $this->sidebar_wrap = new stdClass; $this->column_wrap = new stdClass; @@ -31,27 +31,27 @@ function __construct($layout_mode = null) { $this->sidebar1 = new stdClass; $this->sidebar2 = new stdClass; $this->main_content = new stdClass; - $this->hidden = new stdClass; + $this->hidden = new stdClass; $this->builder->width = 1400; /* Get the layout map from DB, or use default */ $this->get_layout_map(); - + /* If layout mode isn't set, then use the saved default mode. */ if( isset($layout_mode) ) $this->layout_mode = $layout_mode; elseif ( isset($this->layout_map['saved_layout']) && !empty($this->layout_map['saved_layout']) ) - $layout_mode = $this->layout_map['saved_layout']; + $layout_mode = $this->layout_map['saved_layout']; else $layout_mode = ( ploption( 'layout_default' ) ) ? ploption( 'layout_default' ) : 'one-sidebar-right'; - + $this->build_layout($layout_mode); } - + /** * @@ -59,35 +59,35 @@ function __construct($layout_mode = null) { * */ function build_layout($layout_mode){ - + /* Set the current pages layout */ $this->layout_mode = $layout_mode; - + /* Get number of columns */ $this->set_columns(); - + /* Set layout dimensions */ $this->set_layout_data(); - + /* Set wrap dimensions for use on page */ $this->set_wrap_dimensions(); - + /* Set scaled dimensions and convert for use in the JS builder */ $this->set_builder_dimensions(); - - + + } - + /** * @@ -99,10 +99,10 @@ function set_columns(){ $this->num_columns = 3; elseif($this->layout_mode == 'one-sidebar-left' || $this->layout_mode == 'one-sidebar-right') $this->num_columns = 2; - else + else $this->num_columns = 1; } - + /** @@ -111,17 +111,17 @@ function set_columns(){ * */ function get_layout_map(){ - + $db_layout_map = ploption('layout'); - + $this->layout_map = ( $db_layout_map && is_array($db_layout_map) ) ? $db_layout_map : $this->default_layout_setup(); - - - + + + } - - + + /** * @@ -129,62 +129,62 @@ function get_layout_map(){ * */ function default_layout_setup(){ - + $this->content->width = 1100; $this->content->percent = $this->get_content_percent($this->content->width); - + $this->gutter->width = 20; - + $def_main_two = 780; $def_sb_two = 320; - + $def_main_three = 620; $def_sb_three = 240; - + $default_map = array( 'saved_layout' => 'one-sidebar-right', 'last_edit' => 'one-sidebar-right', 'content_width' => $this->content->width, 'responsive_width' => $this->content->percent, - 'one-sidebar-right' => array( + 'one-sidebar-right' => array( 'maincolumn_width' => $def_main_two, 'primarysidebar_width' => $def_sb_two, - 'gutter_width' => $this->gutter->width, + 'gutter_width' => $this->gutter->width, 'content_width' => $this->content->width - ), - 'one-sidebar-left' => array( + ), + 'one-sidebar-left' => array( 'maincolumn_width' => $def_main_two, 'primarysidebar_width' => $def_sb_two, - 'gutter_width' => $this->gutter->width, + 'gutter_width' => $this->gutter->width, 'content_width' => $this->content->width ), - 'two-sidebar-right' => array( + 'two-sidebar-right' => array( 'maincolumn_width' => $def_main_three, 'primarysidebar_width' => $def_sb_three, - 'gutter_width' => $this->gutter->width, - 'content_width' => $this->content->width + 'gutter_width' => $this->gutter->width, + 'content_width' => $this->content->width ), - 'two-sidebar-left' => array( + 'two-sidebar-left' => array( 'maincolumn_width' => $def_main_three, 'primarysidebar_width' => $def_sb_three, - 'gutter_width' => $this->gutter->width, + 'gutter_width' => $this->gutter->width, 'content_width' => $this->content->width ), - 'two-sidebar-center' => array( + 'two-sidebar-center' => array( 'maincolumn_width' => $def_main_three, 'primarysidebar_width' => $def_sb_three, - 'gutter_width' => $this->gutter->width, + 'gutter_width' => $this->gutter->width, 'content_width' => $this->content->width ), - 'fullwidth' => array( + 'fullwidth' => array( 'maincolumn_width' => $this->content->width, - 'primarysidebar_width' => 0, - 'gutter_width' => 0, + 'primarysidebar_width' => 0, + 'gutter_width' => 0, 'content_width' => 0 ) ); - - + + return $default_map; } @@ -198,7 +198,7 @@ function get_content_percent( $content_width ){ return ( $content_width / $this->builder->width ) * 100; } - + /** * @@ -206,7 +206,7 @@ function get_content_percent( $content_width ){ * */ function set_layout_data(){ - + // Text & IDs $this->hidden->text = ''; $this->hidden->id = 'hidden'; @@ -219,46 +219,46 @@ function set_layout_data(){ $this->sidebar2->text = 'SB2'; $this->sidebar2->id = 'layout-sidebar-2'; - + $this->gutter->width = 30; - + $this->fudgefactor = 24; - + $this->hidden->width = 0; - + $this->content->width = $this->layout_map['content_width']; $this->content->percent = $this->get_content_percent( $this->layout_map['content_width'] ); - + foreach($this->layout_map as $layoutmode => $settings){ if($this->layout_mode == $layoutmode && ($layoutmode == 'one-sidebar-right' || $layoutmode == 'one-sidebar-left')){ - + //Account for javascript saving of other layout type $this->main_content->width = $settings['maincolumn_width']; $this->sidebar1->width = $this->content->width - $settings['maincolumn_width']; - + } elseif($this->layout_mode == $layoutmode && ($layoutmode == 'fullwidth')){ - + //Account for javascript saving of other layout type $this->main_content->width = $this->content->width; $this->sidebar1->width = 0; - + }elseif($this->layout_mode == $layoutmode) { - + $this->main_content->width = $settings['maincolumn_width']; $this->sidebar1->width = $settings['primarysidebar_width']; - + } } - + $this->margin->width = ($this->builder->width - $this->content->width)/2 - ($this->fudgefactor - 1); - + $this->sidebar2->width = $this->content->width - $this->main_content->width - $this->sidebar1->width; - + $this->dynamic_grid->width = $this->content->width/12; - + } - - + + /** * @@ -269,19 +269,19 @@ function set_wrap_dimensions(){ if($this->layout_mode == 'two-sidebar-center'){ $this->column_wrap->width = $this->main_content->width + $this->sidebar1->width; $this->sidebar_wrap->width = $this->sidebar2->width; - + $this->clip->width = ($this->main_content->width - (3 * $this->gutter->width))/2 ; - + }elseif($this->layout_mode == 'two-sidebar-right' || $this->layout_mode == 'two-sidebar-left'){ - + $this->column_wrap->width = $this->main_content->width; $this->sidebar_wrap->width = $this->sidebar1->width + $this->sidebar2->width; $this->clip->width = ($this->main_content->width - (2 * $this->gutter->width))/2 ; - + }elseif($this->layout_mode == 'one-sidebar-right' || $this->layout_mode == 'one-sidebar-left'){ $this->column_wrap->width = $this->main_content->width; $this->sidebar_wrap->width = $this->sidebar1->width; - + $this->clip->width = ($this->main_content->width - (2 * $this->gutter->width))/2 ; }else{ $this->sidebar_wrap->width = 0; @@ -289,7 +289,7 @@ function set_wrap_dimensions(){ $this->clip->width = ($this->main_content->width - (1 * $this->gutter->width))/2 ; } } - + /** * @@ -297,7 +297,7 @@ function set_wrap_dimensions(){ * */ function set_builder_dimensions(){ - + $this->builder->bwidth = $this->downscale($this->builder->width); $this->content->bwidth = $this->downscale($this->content->width); $this->gutter->bwidth = $this->downscale($this->gutter->width); @@ -305,9 +305,9 @@ function set_builder_dimensions(){ $this->main_content->bwidth = $this->downscale($this->main_content->width); $this->sidebar1->bwidth = $this->downscale($this->sidebar1->width); $this->sidebar2->bwidth = $this->downscale($this->sidebar2->width); - + $this->hidden->bwidth = 0; - + /* Convert builder dimensions to dimensions the plugin understands */ @@ -322,7 +322,7 @@ function set_builder_dimensions(){ */ function builder_inner_directions(){ if($this->layout_mode == 'two-sidebar-right'){ - + $this->west = $this->main_content; $this->center = $this->sidebar1; $this->east = $this->sidebar2; @@ -353,7 +353,7 @@ function builder_inner_directions(){ echo 'There was an issue setting layout. Please reset your settings.'; } } - + /** * @@ -372,40 +372,40 @@ function downscale($actual_pixels, $ratio = 2){ * */ function get_layout_inline(){ - + $l = $this->calculate_dimensions($this->layout_mode); $mode = '.'.$this->layout_mode.' '; $css = ''; $c = $this->content->width; $p = $this->content->percent; - - // Selectors - + + // Selectors + // Setup Page Width $page_width_array = apply_filters( 'pl_page_width', array('body.fixed_width #page', 'body.fixed_width #footer', 'body.canvas .page-canvas') ); $page_width_sel = join(',', $page_width_array); - + // Setup Content Width $content_width_array = apply_filters( 'pl_content_width', array('#site .content', '#footer .content') ); $content_width_sel = join(',', $content_width_array); - - - // Options + + + // Options $layout_handling = ploption('layout_handling'); $design_mode = ploption('site_design_mode'); - + $contained = ($design_mode == 'fixed_width' && !pl_is_disabled('color_control')) ? true : false; - - + + // Set CSS for content and page width if( $layout_handling == 'percent'){ - + if($contained){ $css .= sprintf($page_width_sel . '{ width: %s%%;}', $p); $css .= sprintf($content_width_sel . '{ width: %s%%; }', '100'); - } else + } else $css .= sprintf($content_width_sel . '{ width: %s%%; }', $p); - + } elseif( $layout_handling == 'pixels' ){ $css .= sprintf($page_width_sel . '{ max-width:%spx; }', $c); $css .= sprintf($content_width_sel . '{ width: 100%%; max-width:%spx;}', $c); @@ -413,29 +413,29 @@ function get_layout_inline(){ $css .= sprintf($page_width_sel . '{ max-width:%spx; }', $c); $css .= sprintf($content_width_sel . '{ width:%spx;}', $c); } - + // Set CSS for inner elements based on mode $content_id = apply_filters('pl_content_id', '#pagelines_content'); - + $main_col_id = apply_filters('pl_main_id', '#column-main'); - + foreach(get_the_layouts() as $mode){ - + $l = $this->calculate_dimensions($mode); - + $mode_selector = '.'.$mode; - + $css .= sprintf('%1$s %3$s %4$s{ %2$s }', $mode_selector, $l['main'], $content_id, $main_col_id); $css .= sprintf('%1$s %3$s #sidebar1{ %2$s }', $mode_selector, $l['sb1'], $content_id); $css .= sprintf('%1$s %3$s #sidebar2{ %2$s }', $mode_selector, $l['sb2'], $content_id); $css .= sprintf('%1$s %3$s #column-wrap{ %2$s }', $mode_selector, $l['colwrap'], $content_id); $css .= sprintf('%1$s %3$s #sidebar-wrap{ %2$s }', $mode_selector, $l['sbwrap'], $content_id); - + } - + return $css; } - + /** * @@ -443,16 +443,16 @@ function get_layout_inline(){ * */ function calculate_dimensions( $layout_mode ){ - + $save_mode = $this->layout_mode; - + $this->build_layout($layout_mode); - + $l = array(); /* (target / context)*100 = percent-result */ - - $l['colwrap'] = $this->get_width( $this->column_wrap->width, $this->content->width ); + + $l['colwrap'] = $this->get_width( $this->column_wrap->width, $this->content->width ); $l['sbwrap'] = $this->get_width( $this->sidebar_wrap->width, $this->content->width ); $l['main'] = $this->get_width( $this->main_content->width, $this->column_wrap->width ); @@ -460,17 +460,17 @@ function calculate_dimensions( $layout_mode ){ $l['sb2'] = $this->get_width( $this->sidebar2->width, $this->sidebar_wrap->width ); if($layout_mode == 'two-sidebar-center') - $l['sb1'] = $this->get_width( $this->sidebar1->width, $this->column_wrap->width ); + $l['sb1'] = $this->get_width( $this->sidebar1->width, $this->column_wrap->width ); else $l['sb1'] = $this->get_width( $this->sidebar1->width, $this->sidebar_wrap->width ); - $this->layout_mode = $save_mode; + $this->layout_mode = $save_mode; $this->build_layout($save_mode); return $l; } - + /** * @@ -488,27 +488,27 @@ function get_width($target, $context){ /** - * PageLines Layout Object + * PageLines Layout Object * @global object $pagelines_template * @since 1.0.0 */ -function build_pagelines_layout(){ - +function build_pagelines_layout(){ + global $pagelines_layout; global $post; - + $post_id = (isset($post->ID)) ? $post->ID : null; - + $oset = array( 'post_id' => $post_id ); $page_layout = (ploption( '_pagelines_layout_mode', $oset)) ? ploption( '_pagelines_layout_mode', $oset) : null; - + $pagelines_layout = new PageLinesLayout( $page_layout ); } /** - * + * * Sets Content Width for Large images when adding media * * @package PageLines Framework @@ -523,9 +523,9 @@ function pagelines_current_page_content_width() { global $post; $mode = pagelines_layout_mode(); - + $c_width = $pagelines_layout->layout_map[$mode]['maincolumn_width']; - + if ( !isset( $content_width ) ) $content_width = $c_width - 45; } @@ -546,7 +546,7 @@ function pagelines_layout_mode() { global $pagelines_layout; return $pagelines_layout->layout_mode; - + } /** @@ -561,17 +561,17 @@ function get_layout_mode(){ return $layout_mode; } - + /* The main content layouts available in this theme */ function get_the_layouts(){ return 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' ); } @@ -584,7 +584,7 @@ function get_the_layouts(){ function reset_layout_to_default(){ $dlayout = new PageLinesLayout; - + $layout_map = $dlayout->default_layout_setup(); pagelines_update_option('layout', $layout_map); diff --git a/includes/class.objects.php b/includes/class.objects.php index d755b3ab..4933c8a1 100644 --- a/includes/class.objects.php +++ b/includes/class.objects.php @@ -1,6 +1,6 @@ 'normal', - 'align' => 'left', + 'align' => 'left', 'display' => null, 'style' => '', 'action' => '', - 'pid' => 0, - 'class' => null, + 'pid' => 0, + 'class' => null, 'clear' => false, ); - + $a = wp_parse_args( $args, $defaults ); $color_class = 'bl-'.$color; @@ -46,13 +46,13 @@ function button( $text = ' ', $type = 'button', $color = 'grey', $args ){ $position = 'bl-align-'.$a['align']; $classes = join(' ', array( $color_class, $size_class, $position, $a['class'] ) ); - + $display = (isset($a['display'])) ? 'display: '.$a['display'] : ''; - + $post_link = get_edit_post_link( $a['pid']); if($type == 'edit_post'){ - + $element = 'a'; $classes .= ' post-edit-link'; $action = sprintf('href="%s"', $post_link ); @@ -63,11 +63,11 @@ function button( $text = ' ', $type = 'button', $color = 'grey', $args ){ $element = 'span'; $action = ''; } - + $clear = ($a['clear']) ? '
    ' : ''; $clear_end = ($a['clear']) ? '
    ' : ''; - - + + $button = sprintf( '<%1$s class="blink" %3$s>%2$s', $element, $text, $action); $output = sprintf('%s%s', $clear, $classes, $display, $button, $clear_end); @@ -77,7 +77,7 @@ function button( $text = ' ', $type = 'button', $color = 'grey', $args ){ return ''; else return apply_filters('pagelines_button', $output, $a); - + } } @@ -97,12 +97,12 @@ function blink($text = ' ', $type = 'button', $color = 'grey', $args){ * */ function blink_edit( $post_id = '', $color = 'grey', $args = array()){ - + if($post_id == ''){ - global $post; + global $post; $post_id = $post->ID; } - + $args['pid'] = $post_id; $args['align'] = (isset($args['align'])) ? $args['align'] : 'right'; @@ -115,42 +115,42 @@ function blink_edit( $post_id = '', $color = 'grey', $args = array()){ * */ function pledit( $id = '', $type = 'post' ){ - + if($type == 'user'){ - + $the_uid = $id; - + global $current_user; - + if($current_user == $the_uid) $link = admin_url( 'profile.php' ); elseif(current_user_can('edit_users')) $link = admin_url( sprintf('user-edit.php?user_id=%s', $the_uid) ); - else + else $link = false; } else { - + if($id == ''){ - global $post; + global $post; $id = $post->ID; } - + if ( false == ( $p = get_post( $id ) ) ) return ''; - + $post_type_object = get_post_type_object( $p->post_type ); - + if ( !$post_type_object ) return ''; if ( !current_user_can( $post_type_object->cap->edit_post, $p->ID ) ) return ''; - + $link = get_edit_post_link( $p->ID ); - + } - + if( $link ){ $format = apply_filters( 'pagelines_pledit_filter', '(%s)' ); $button = sprintf("
    {$format} ", @@ -159,6 +159,6 @@ function pledit( $id = '', $type = 'post' ){ ); return $button; - } else - return ''; + } else + return ''; } \ No newline at end of file diff --git a/includes/class.posts.php b/includes/class.posts.php index acd3de75..8248781b 100644 --- a/includes/class.posts.php +++ b/includes/class.posts.php @@ -8,17 +8,17 @@ */ class PageLinesPosts { - var $tabs = array(); - + var $tabs = array(); + /** PHP5 constructor */ function __construct( PageLinesPostLoop $section ) { - - global $pagelines_layout; + + global $pagelines_layout; global $post; global $wp_query; - + $this->section = $section; - + $this->count = 1; // Used to get the number of the post as we loop through them. $this->clipcount = 2; // The number of clips in a row @@ -28,12 +28,12 @@ function __construct( PageLinesPostLoop $section ) { $this->thumb_space = get_option('thumbnail_size_w') + 33; // Space for thumb with padding $this->continue_reading = apply_filters('continue_reading_link_text', load_pagelines_option('continue_reading_text', __('[Continue Reading...]', 'pagelines'))); - + add_filter('pagelines_post_metabar', 'do_shortcode', 20); - + if( has_action( 'add_social_under_meta' ) || ploption( 'share_under_meta' ) ) add_filter( 'pagelines_post_metabar', array( &$this,'add_social_share' ), 10, 2 ); - + if( has_action( 'add_social_under_excerpt' ) ) add_filter( 'pagelines_post_header', array( &$this,'add_social' ), 10, 2 ); @@ -54,14 +54,14 @@ function __construct( PageLinesPostLoop $section ) { * @return string */ function add_social_share( $input, $format ){ - + if ( ! class_exists( 'PageLinesShareBar' ) || $format == 'clip' ) return $input; global $post; - + $share = PageLinesShareBar::get_shares(); $meta_share = sprintf( '
    %s
    ', $share ); - + return $input.$meta_share; } @@ -80,20 +80,20 @@ function add_social_share( $input, $format ){ * @return string */ function add_social($input, $format){ - + if ( ! class_exists( 'PageLinesShareBar' ) || $format == 'clip' ) return $input; global $post; - + $args = array( 'permalink' => get_permalink( $post->ID ), 'width'=>'50', 'title' => wp_strip_all_tags( get_the_title( $post->ID ) ) ); $share = PageLinesShareBar::facebook( $args ); $share .= PageLinesShareBar::twitter( $args ); $meta_share = sprintf( '
    %s
    ', $share ); - + return $input.$meta_share; } - - + + /** * Load Loop * @@ -105,14 +105,14 @@ function add_social($input, $format){ * @since 2.0.0 */ function load_loop(){ - + if( have_posts() ) while ( have_posts() ) : the_post(); $this->get_article(); endwhile; - else + else $this->posts_404(); - + } - + /** * Get Article @@ -129,67 +129,67 @@ function load_loop(){ function get_article(){ global $wp_query; global $post; - + /* clip handling */ $clip = ( $this->pagelines_show_clip( $this->count, $this->paged ) ) ? true : false; - + $format = ( $clip ) ? 'clip' : 'feature'; $clip_row_start = ( $this->clipcount % 2 == 0 ) ? true : false; $clip_right = ( ( $this->clipcount+1 ) % 2 == 0 ) ? true : false; $clip_row_end = ( $clip_right || $this->count == $this->post_count ) ? true : false; - + $post_type_class = ( $clip ) ? ( $clip_right ? 'clip clip-right' : 'clip' ) : 'fpost'; - + $pagelines_post_classes = apply_filters( 'pagelines_get_article_post_classes', sprintf( '%s post-number-%s', $post_type_class, $this->count ) ); - + $post_classes = join( ' ', get_post_class( $pagelines_post_classes ) ); - + $wrap_start = ( $clip && $clip_row_start ) ? sprintf( '
    ' ) : ''; $wrap_end = ( $clip && $clip_row_end ) ? sprintf( '
    ' ) : ''; - - - + + + $post_args = array( - 'header' => $this->post_header( $format ), - 'entry' => $this->post_entry(), + 'header' => $this->post_header( $format ), + 'entry' => $this->post_entry(), 'classes' => $post_classes, 'pad-class' => ( $clip ) ? 'hentry-pad blocks' : 'hentry-pad', - 'wrap-start' => $wrap_start, - 'wrap-end' => $wrap_end, + 'wrap-start' => $wrap_start, + 'wrap-end' => $wrap_end, 'format' => $format, 'count' => $this->count - ); - + ); + $post_args['markup-start'] = sprintf( '%s
    ', - $post_args['wrap-start'], - $post_args['classes'], + $post_args['wrap-start'], + $post_args['classes'], $post->ID, $post_args['pad-class'] ); - + $post_args['markup-end'] = sprintf( '
    %s', $post_args['wrap-end'] ); - + $original = join(array( - $post_args['markup-start'], - $post_args['header'], - $post_args['entry'], + $post_args['markup-start'], + $post_args['header'], + $post_args['entry'], $post_args['markup-end'] )); - + echo apply_filters( 'pagelines_get_article_output', $original, $post, $post_args ); - + // Count the clips - if( $clip ) + if( $clip ) $this->clipcount++; - + // Count the posts $this->count++; } - + /** * Post Entry @@ -199,28 +199,28 @@ function get_article(){ * * @return mixed|string|void */ - function post_entry(){ - + function post_entry(){ + $id = get_the_ID(); - + if( $this->pagelines_show_content( $id ) ){ - - $excerpt_mode = $this->section->opt( 'excerpt_mode_full' ); - - + + $excerpt_mode = $this->section->opt( 'excerpt_mode_full' ); + + if( ( $excerpt_mode == 'left-excerpt' || $excerpt_mode == 'right-excerpt' ) && is_single() && $this->pagelines_show_thumb( $id ) ) $thumb = $this->post_thumbnail_markup( $excerpt_mode ); - else + else $thumb = ''; - + $post_entry = sprintf( '
    %s%s
    ', $thumb, $this->post_content() ); - + return apply_filters( 'pagelines_post_entry', $post_entry ); - - } else + + } else return ''; } - + /** * Post Content @@ -233,47 +233,47 @@ function post_entry(){ * @return string - the content */ function post_content(){ - + ob_start(); - + pagelines_register_hook( 'pagelines_loop_before_post_content', 'theloop' ); // Hook // global $post; - + $content = get_the_content( $this->continue_reading ); - + $content .= pledit( get_the_ID() ); - + echo apply_filters( 'the_content', $content ); - + if( is_single() || is_page() ){ - - $pgn = array( - 'before' => __( "', - 'link_before' => '', + + $pgn = array( + 'before' => __( "', + 'link_before' => '', 'link_after' => '' ); - + wp_link_pages( $pgn ); } - + if ( is_single() && get_the_tags() ) - printf( - '
    %s 
    ', - get_the_tag_list( - __( "Tagged with → ", 'pagelines' ), - ' • ', + printf( + '
    %s 
    ', + get_the_tag_list( + __( "Tagged with → ", 'pagelines' ), + ' • ', '' - ) + ) ); - - pagelines_register_hook( 'pagelines_loop_after_post_content', 'theloop' ); // Hook - + + pagelines_register_hook( 'pagelines_loop_after_post_content', 'theloop' ); // Hook + $the_content = ob_get_clean(); return $the_content; - + } @@ -283,27 +283,27 @@ function post_content(){ * Creates the post header information adding classes as required for clipped format and thumbnails images as required * */ - function post_header( $format = '' ){ - + function post_header( $format = '' ){ + if( $this->show_post_header() ){ - + global $post; - + $id = get_the_ID(); - + $excerpt_mode = ( $format == 'clip' ) ? $this->section->opt( 'excerpt_mode_clip' ) : $this->section->opt( 'excerpt_mode_full' ); $thumb = ( $this->pagelines_show_thumb( $id ) ) ? $this->post_thumbnail_markup( $excerpt_mode, $format ) : ''; - + $excerpt_thumb = ( $thumb && ( $excerpt_mode == 'left-excerpt' || $excerpt_mode == 'right-excerpt' ) ) ? '' : $thumb; - + $excerpt = ( $this->pagelines_show_excerpt( $id ) ) ? $this->post_excerpt_markup( $excerpt_mode, $excerpt_thumb ) : ''; - + $classes = 'post-meta fix '; $classes .= ( ! $this->pagelines_show_thumb( $id ) ) ? 'post-nothumb ' : ''; $classes .= ( ! $this->pagelines_show_content( $id ) ) ? 'post-nocontent ' : ''; - + $title = sprintf( '
    %s
    %s
    ', $this->pagelines_get_post_title( $format ), $this->pagelines_get_post_metabar( $format ) ); - + if( ( $excerpt_mode == 'left-excerpt' || $excerpt_mode == 'right-excerpt' ) && ! is_single() ) $post_header = sprintf( '
    %s %s%s
    ', $classes, $title, $thumb, $excerpt ); elseif( $excerpt_mode == 'top' ) @@ -312,16 +312,16 @@ function post_header( $format = '' ){ $post_header = sprintf( '
    %s
    %s %s
    ', $classes, $thumb, $title, $excerpt ); else $post_header = sprintf( '
    %s
    %s %s
    ',$classes, '', $title, $excerpt ); - + return apply_filters( 'pagelines_post_header', $post_header, $format ); - - } else + + } else return ''; } - - - + + + /** * Determines if the post title area should be shown * @@ -330,14 +330,14 @@ function post_header( $format = '' ){ * @return bool True if the title area should be shown */ function show_post_header( ) { - + if( !is_page() || (is_page() && pl_setting('pagetitles')) ) return true; else return false; - + } - + /** * Get post excerpt and markup * @@ -346,26 +346,26 @@ function show_post_header( ) { * @return string the excerpt markup */ function post_excerpt_markup( $mode = '', $thumbnail = '' ) { - + ob_start(); - + pagelines_register_hook( 'pagelines_loop_before_excerpt', 'theloop' ); // Hook - + if($mode == 'left-excerpt' || $mode == 'right-excerpt') printf( '', $thumbnail, get_the_excerpt() ); else printf( '', get_the_excerpt() ); - - + + if(pagelines_is_posts_page() && !$this->pagelines_show_content( get_the_ID() )) // 'Continue Reading' link echo $this->get_continue_reading_link( get_the_ID() ); - - pagelines_register_hook( 'pagelines_loop_after_excerpt', 'theloop' ); // Hook - + + pagelines_register_hook( 'pagelines_loop_after_excerpt', 'theloop' ); // Hook + $pagelines_excerpt = ob_get_clean(); - + return apply_filters('pagelines_excerpt', $pagelines_excerpt); - + } @@ -386,15 +386,15 @@ function post_excerpt_markup( $mode = '', $thumbnail = '' ) { * @todo review if top displayed image should be centered above post, or remain left aligned */ function post_thumbnail_markup( $mode = '', $format = '', $frame = '' ) { - + $thumb_width = get_option( 'thumbnail_size_w' ); - + $classes = 'post-thumb img fix'; - + $percent_width = ( $mode == 'top' ) ? 100 : 25; - + $style = ( 'top' == $mode ) ? 'width: 100%' : sprintf( 'width: %s%%; max-width: %spx', apply_filters( 'pagelines_thumb_width', $percent_width ), $thumb_width ); - + if ( $mode == 'left-excerpt' ) $classes .= ' alignleft'; elseif ( $mode == 'right-excerpt' ) @@ -402,21 +402,21 @@ function post_thumbnail_markup( $mode = '', $format = '', $frame = '' ) { /** By default image will left align, explicitly adding this class for 'top' == $mode is not needed at this time. * elseif ( $mode == 'top' ) $classes .= ' left'; */ - + global $post; - + $img = ( $mode == 'top' ) ? get_the_post_thumbnail( null, 'large' ) : get_the_post_thumbnail( null, 'thumbnail' ); - + $the_image = sprintf( '%s', $img ); - + $thumb_link = sprintf( '%s', $classes, get_permalink( $post ), __( 'Link To', 'pagelines' ), the_title_attribute( array( 'echo' => false ) ), $style, $the_image ); $output = ( 'top' == $mode ) ? sprintf( '
    %s
    ', $thumb_link ) : $thumb_link; - + return apply_filters( 'pagelines_thumb_markup', $output, $mode, $format ); - + } - + /** * Adds the metabar or byline under the post title * @@ -431,14 +431,14 @@ function pagelines_get_post_metabar( $format = '' ) { return; // don't do post-info on pages if( $format == 'clip'){ - - $metabar = ( $this->section->opt( 'metabar_clip' ) ) + + $metabar = ( $this->section->opt( 'metabar_clip' ) ) ? $before . $this->section->opt( 'metabar_clip' ) . $after : sprintf( '%s%s [post_date] %s [post_author_posts_link] [post_edit]%s', $before, __('On','pagelines'), __('By','pagelines'), $after ); } else { - $metabar = ( $this->section->opt( 'metabar_standard' ) ) + $metabar = ( $this->section->opt( 'metabar_standard' ) ) ? $before . $this->section->opt( 'metabar_standard' ) . $after : sprintf( '%s%s [post_author_posts_link] %s [post_date] · [post_comments] · %s [post_categories] [post_edit]%s', $before, __('By','pagelines'), __('On','pagelines'), __('In','pagelines'), $after); @@ -467,17 +467,17 @@ function pagelines_get_post_metabar( $format = '' ) { * * @return string - (new) Post $title */ - function pagelines_get_post_title( $format = '' ){ - + function pagelines_get_post_title( $format = '' ){ + global $post; global $pagelines_ID; /** Check if page and show page title option is set to true */ if( is_page() && pl_setting('pagetitles') && ! has_filter( "pagelines_no_page_title_{$pagelines_ID}" ) ) { - $title = sprintf( '

    %s

    ', apply_filters( 'pagelines_post_title_text', get_the_title() ) ); + $title = sprintf( '

    %s

    ', apply_filters( 'pagelines_post_title_text', get_the_title() ) ); } elseif(!is_page()) { - if ( is_singular() ) + if ( is_singular() ) $title = sprintf( '

    %s

    ', apply_filters( 'pagelines_post_title_text', get_the_title() ) ); elseif( $format == 'clip') $title = sprintf( '

    %s

    ', get_permalink( $post ), the_title_attribute('echo=0'), apply_filters( 'pagelines_post_title_text', get_the_title() ) ); @@ -494,7 +494,7 @@ function pagelines_get_post_title( $format = '' ){ /** - * + * * Gets the continue reading link after excerpts * * @package PageLines Framework @@ -505,16 +505,16 @@ function pagelines_get_post_title( $format = '' ){ function get_continue_reading_link($post_id){ $link = sprintf( - '%s', - get_permalink(), - __("View", 'pagelines'), - the_title_attribute(array('echo'=> 0)), - $this->continue_reading + '%s', + get_permalink(), + __("View", 'pagelines'), + the_title_attribute(array('echo'=> 0)), + $this->continue_reading ); return apply_filters('continue_reading_link', $link); } - + /** * @@ -526,16 +526,16 @@ function pagelines_show_thumb($post = null, $location = null){ if( function_exists('the_post_thumbnail') && has_post_thumbnail($post) ){ if( pl_has_editor() ){ - + if( is_page() || is_single() ) return false; - + if($this->section->opt('hide_thumb')) return false; else return true; } else{ - + if( $location == 'clip' && ploption('thumb_clip') ) return true; if( !isset($location) ){ @@ -565,19 +565,19 @@ function pagelines_show_thumb($post = null, $location = null){ else return false; } - - - } else + + + } else return false; - - + + } - - } else + + } else return false; } - + /** * @@ -590,37 +590,37 @@ function pagelines_show_excerpt( $post = null ){ return false; if( pl_has_editor() ){ - + if( $this->section->opt('hide_excerpt')) return false; - else + else return true; - + } else { - + // Thumb Page - if( is_single() && ploption('excerpt_single') ) + if( is_single() && ploption('excerpt_single') ) return true; // Blog Page - elseif( is_home() && ploption('excerpt_blog') ) + elseif( is_home() && ploption('excerpt_blog') ) return true; // Search Page - elseif( is_search() && ploption('excerpt_search') ) + elseif( is_search() && ploption('excerpt_search') ) return true; // Category Page elseif( is_category() && ! is_date() && ploption('excerpt_category') ) return true; - + // Archive Page - elseif( ! is_category() && is_archive() && ploption('excerpt_archive') ) + elseif( ! is_category() && is_archive() && ploption('excerpt_archive') ) return true; - - else + + else return false; - + } } @@ -632,33 +632,33 @@ function pagelines_show_excerpt( $post = null ){ */ function pagelines_show_content($post = null){ // For Hook Parsing - if( is_admin() ) + if( is_admin() ) return true; // show on single post pages only - if( is_page() || is_single() ) + if( is_page() || is_single() ) return true; elseif(pl_has_editor() && $this->section->opt('show_content')) return true; - + // Blog Page - elseif( is_home() && ploption('content_blog') ) + elseif( is_home() && ploption('content_blog') ) return true; // Search Page - elseif( is_search() && ploption('content_search') ) + elseif( is_search() && ploption('content_search') ) return true; // Category Page - elseif( is_category() && ploption('content_category') ) + elseif( is_category() && ploption('content_category') ) return true; // Archive Page - elseif( ! is_category() && is_archive() && ploption('content_archive') ) + elseif( ! is_category() && is_archive() && ploption('content_archive') ) return true; - else + else return false; } @@ -667,26 +667,26 @@ function pagelines_show_content($post = null){ Show clip or full width post */ function pagelines_show_clip($count, $paged){ - - if(!VPRO) + + if(!VPRO) return false; - + $archives = apply_filters( 'pagelines_full_width_archives', false ); - + if( ( is_home() || $archives ) && $this->section->opt('blog_layout_mode') == 'magazine' && $count <= $this->section->opt('full_column_posts') && $paged == 0) return false; - elseif($this->section->opt('blog_layout_mode') != 'magazine') + elseif($this->section->opt('blog_layout_mode') != 'magazine') return false; - elseif(is_page() || is_single()) + elseif(is_page() || is_single()) return false; - else + else return true; } - - + + /** * @@ -694,17 +694,17 @@ function pagelines_show_clip($count, $paged){ * */ function posts_404(){ - + $head = ( is_search() ) ? sprintf(__('No results for "%s"', 'pagelines'), get_search_query()) : __('Nothing Found', 'pagelines'); - + $subhead = ( is_search() ) ? __('Try another search?', 'pagelines') : __("Sorry, what you are looking for isn't here.", 'pagelines'); - + $the_text = sprintf('

    %s

    %s

    ', $head, $subhead); - + printf( '
    %s
    %s
    ', apply_filters('pagelines_posts_404', $the_text), pagelines_search_form( false )); - + } - + } /* ------- END OF CLASS -------- */ diff --git a/includes/class.register.php b/includes/class.register.php index 105352cf..c64886be 100644 --- a/includes/class.register.php +++ b/includes/class.register.php @@ -1,15 +1,15 @@ -username = get_pagelines_credentials( 'user' ); $this->password = get_pagelines_credentials( 'pass' ); @@ -37,7 +37,7 @@ function __construct() { function pagelines_register_sections( $reset = null, $echo = null ){ global $pl_section_factory; - + if ( $reset === true ) delete_transient( 'pagelines_sections_cache' ); @@ -48,9 +48,9 @@ function pagelines_register_sections( $reset = null, $echo = null ){ $section_dirs = array( 'child' => PL_EXTEND_DIR, - 'parent' => PL_SECTIONS + 'parent' => PL_SECTIONS ); - + if ( is_child_theme() && is_dir( get_stylesheet_directory() . '/sections' ) ) $section_dirs = array_merge( array( 'custom' => get_stylesheet_directory() . '/sections' ), $section_dirs ); @@ -61,11 +61,11 @@ function pagelines_register_sections( $reset = null, $echo = null ){ * If not populate array and prime cache */ if ( ! $sections = get_transient( 'pagelines_sections_cache' ) ) { - + foreach ( $section_dirs as $type => $dir ) { $sections[$type] = $this->pagelines_getsections( $dir, $type ); } - + // check for deps within the main parent sections, load last if found. foreach ($sections['parent'] as $key => $section ) { @@ -78,37 +78,37 @@ function pagelines_register_sections( $reset = null, $echo = null ){ * TODO switch this to activation/deactivation interface * TODO better idea, clear cached vars on settings save. */ - set_transient( 'pagelines_sections_cache', $sections, 86400 ); + set_transient( 'pagelines_sections_cache', $sections, 86400 ); } - + if ( true === $echo ) return $sections; - + // filter main array containing child and parent and any custom sections $sections = apply_filters( 'pagelines_section_admin', $sections ); $disabled = get_option( 'pagelines_sections_disabled', array( 'child' => array(), 'parent' => array(), 'custom' => array() ) ); foreach ( $sections as $type ) { if(is_array($type)){ - + foreach( $type as $section ) { - + if ( ! isset( $section['loadme'] ) ) $section['loadme'] = false; - + if ( 'parent' == $section['type'] || ! is_multisite() ) { $section['loadme'] = true; - } + } /** * Checks to see if we are a child section, if so disable the parent * Also if a parent section and disabled, skip. */ - if ( 'parent' != $section['type'] && isset( $sections['parent'][$section['class']]) ) + if ( 'parent' != $section['type'] && isset( $sections['parent'][$section['class']]) ) $disabled['parent'][$section['class']] = true; if (isset( $disabled[$section['type']][$section['class']] ) && ! $section['persistant'] ) continue; - + // consolidate array vars $dep = ( 'parent' != $section['type'] && $section['depends'] != '') ? $section['depends'] : null; $parent_dep = (isset($sections['parent'][$section['depends']])) ? $sections['parent'][$section['depends']] : null; @@ -135,7 +135,7 @@ function pagelines_register_sections( $reset = null, $echo = null ){ if ( !class_exists( $section['class'] ) && is_file( $section['base_file'] ) ) { include( $section['base_file'] ); $pl_section_factory->register( $section['class'], $section_data ); - } + } } else { if ( !class_exists( $section['class'] ) && is_file( $section['base_file'] ) && ! isset( $disabled['parent'][$section['depends']] ) ) { include( $section['base_file'] ); @@ -146,18 +146,18 @@ function pagelines_register_sections( $reset = null, $echo = null ){ } } pagelines_register_hook('pagelines_register_sections'); // Hook - } + } /** - * - * Helper function + * + * Helper function * Returns array of section files. * @return array of php files * @author Simon Prosser **/ function pagelines_getsections( $dir, $type ) { - if ( 'parent' != $type && ! is_dir($dir) ) - return; + if ( 'parent' != $type && ! is_dir($dir) ) + return; if ( is_multisite() ) { $store_sections = $this->get_latest_cached( 'sections' ); @@ -185,21 +185,21 @@ function pagelines_getsections( $dir, $type ) { 'classes' => 'Classes', 'filter' => 'Filter' ); - + $sections = array(); - + // setup out directory iterator. // symlinks were only supported after 5.3.1 // so we need to check first ;) $it = ( strnatcmp( phpversion(), '5.3.1' ) >= 0 ) ? new RecursiveIteratorIterator( new RecursiveDirectoryIterator( $dir, FilesystemIterator::FOLLOW_SYMLINKS) , RecursiveIteratorIterator::SELF_FIRST ) : new RecursiveIteratorIterator( new RecursiveDirectoryIterator( $dir, RecursiveIteratorIterator::CHILD_FIRST ) ); - + foreach( $it as $fullFileName => $fileSPLObject ) { - + if ( basename( $fullFileName) == PL_EXTEND_SECTIONS_PLUGIN ) - continue; - + continue; + if (pathinfo($fileSPLObject->getFilename(), PATHINFO_EXTENSION ) == 'php') { - + $base_url = null; $base_dir = null; $load = true; @@ -210,29 +210,29 @@ function pagelines_getsections( $dir, $type ) { // If no pagelines class headers ignore this file. if ( !$headers['classname'] ) continue; - + preg_match( '#[\/|\-]sections[\/|\\\]([^\/|\\\]+)#', $fullFileName, $out ); - + $version = ( '' != $headers['version'] ) ? $headers['version'] : PL_CORE_VERSION; - + $folder = sprintf( '/%s', $out[1] ); $base_dir = get_template_directory() . '/sections' . $folder; if ( 'child' == $type ) { - + $base_url = PL_EXTEND_URL . $folder; $base_dir = PL_EXTEND_DIR . $folder; - + } if ( 'custom' == $type ) { - + $base_url = get_stylesheet_directory_uri() . '/sections' . $folder; $base_dir = get_stylesheet_directory() . '/sections' . $folder; - + } - + /* * Look for custom dirs. */ @@ -242,38 +242,38 @@ function pagelines_getsections( $dir, $type ) { $file = basename( $dir ); $path = plugin_dir_path( $file ); $url = plugins_url( $file ); - + $base_url = sprintf( '%s/sections%s', $url, $folder ); $base_dir = sprintf( '%ssections%s', $dir, $folder ); - + } $base_dir = ( isset( $base_dir ) ) ? $base_dir : PL_SECTIONS . $folder; $base_url = ( isset( $base_url ) ) ? $base_url : PL_SECTION_ROOT . $folder; - + // do we need to load this section? if ( 'child' == $type && is_multisite() ) { $load = false; - $slug = basename( $folder ); + $slug = basename( $folder ); $purchased = ( isset( $store_sections->$slug->purchased ) ) ? $store_sections->$slug->purchased : ''; $plus = ( isset( $store_sections->$slug->plus_product ) ) ? $store_sections->$slug->plus_product : ''; $price = ( isset( $store_sections->$slug->price ) ) ? $store_sections->$slug->price : ''; $uid = ( isset( $store_sections->$slug->uid ) ) ? $store_sections->$slug->uid : ''; - if ( 'purchased' === $purchased ) { + if ( 'purchased' === $purchased ) { $load = true; } elseif( $plus && pagelines_check_credentials( 'plus' ) ) { $load = true; } else { - + $disabled = get_option( 'pagelines_sections_disabled', array( 'child' => array(), 'parent' => array() ) ); - + if ( ! isset( $disabled['child'][$headers['classname']] ) ) $load = true; } } - + if ( $load ) $purchased = 'purchased'; - + $sections[ $headers['classname'] ] = array( 'class' => $headers['classname'], 'depends' => $headers['depends'], @@ -305,18 +305,18 @@ function pagelines_getsections( $dir, $type ) { 'purchased' => $purchased, 'uid' => $uid, 'filter' => $headers['filter'] - ); - + ); + } } return $sections; } - + function register_sidebars() { - + // This array contains the sidebars in the correct order. $sidebars = array( - + 'sb_primary' => array( 'name' => __( 'Primary Sidebar', 'pagelines' ), 'description' => __( 'The main widgetized sidebar.', 'pagelines') @@ -349,13 +349,13 @@ function register_sidebars() { pagelines_register_sidebar( pagelines_standard_sidebar( $sidebar['name'], $sidebar['description'] ) ); } } - + /** * Simple cache. * @return object */ function get_latest_cached( $type, $flush = null ) { - + $url = trailingslashit( PL_API . $type ); $options = array( 'body' => array( @@ -364,29 +364,29 @@ function get_latest_cached( $type, $flush = null ) { 'flush' => $flush ) ); - + 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, 86400 ); 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' ); return json_decode( $api ); } - + } // end class \ No newline at end of file diff --git a/includes/class.render.css.php b/includes/class.render.css.php index f095096c..ba22de3d 100644 --- a/includes/class.render.css.php +++ b/includes/class.render.css.php @@ -413,12 +413,12 @@ function check_compat() { } function check_draft() { global $pldraft; - + if( is_object($pldraft) ) $mode = $pldraft->mode; - else + else $mode = false; - + return( 'draft' == $mode ) ? true : false; } /** diff --git a/includes/class.sections.php b/includes/class.sections.php index 757f19fd..a002786e 100644 --- a/includes/class.sections.php +++ b/includes/class.sections.php @@ -18,7 +18,7 @@ class PageLinesSection { var $builder; // Show in section builder var $format; //
    format. var $classes; //
    classes. - + var $meta; /** @@ -26,7 +26,7 @@ class PageLinesSection { * @param array $settings */ function __construct( $settings = array() ) { - + /** * Assign default values for the section @@ -35,14 +35,14 @@ function __construct( $settings = array() ) { $this->defaults = array( 'markup' => null, // needs to be null for overriding 'workswith' => array('content'), - 'description' => null, + 'description' => null, 'isolate' => array(), 'required' => null, - 'version' => 'all', + 'version' => 'all', 'base_url' => PL_SECTION_ROOT, - 'dependence' => '', + 'dependence' => '', 'posttype' => '', - 'failswith' => array(), + 'failswith' => array(), 'cloning' => false, 'map' => '', 'tax_id' => '', @@ -53,15 +53,15 @@ function __construct( $settings = array() ) { ); $this->settings = wp_parse_args( $settings, $this->defaults ); - + $this->hook_get_view(); - + $this->hook_get_post_type(); $this->class_name = get_class($this); - + $this->set_section_info(); - + } /** @@ -77,10 +77,10 @@ function __construct( $settings = array() ) { * @uses PL_ADMIN_IMAGES */ function set_section_info(){ - + global $load_sections; $available = $load_sections->pagelines_register_sections( false, true ); - + $type = $this->section_install_type( $available ); global $load_sections; @@ -91,12 +91,12 @@ function set_section_info(){ $this->base_dir = $this->settings['base_dir'] = $this->sinfo['base_dir']; $this->base_file = $this->settings['base_file'] = $this->sinfo['base_file']; $this->base_url = $this->settings['base_url'] = $this->sinfo['base_url']; - + $this->images = $this->base_url . '/images'; // Reference information $this->id = $this->settings['id'] = basename( $this->base_dir ); - + $this->name = $this->settings['name'] = $this->sinfo['name']; $this->description = $this->settings['description'] = $this->sinfo['description']; $this->map = ""; @@ -124,15 +124,15 @@ function set_section_info(){ * STANDARD IMAGES */ $this->icon = $this->settings['icon'] = ( is_file( sprintf( '%s/icon.png', $this->base_dir ) ) ) ? sprintf( '%s/icon.png', $this->base_url ) : PL_ADMIN_ICONS . '/leaf.png'; - + if( is_file( sprintf( '%s/thumb.png', $this->base_dir ) ) ){ $this->screenshot = $this->settings['screenshot'] = sprintf( '%s/thumb.png', $this->base_url ); } else { $this->screenshot = $this->settings['screenshot'] = PL_IMAGES . '/thumb-missing.png'; } - + $this->thmb = $this->screenshot; - + if( is_file( sprintf( '%s/splash.png', $this->base_dir ) ) ){ $this->splash = $this->settings['splash'] = sprintf( '%s/splash.png', $this->base_url ); } else { @@ -140,67 +140,67 @@ function set_section_info(){ } $this->deprecated_setup(); - + load_plugin_textdomain($this->id, false, sprintf( 'pagelines-sections/%s/lang', $this->id ) ); - + } - + function deprecated_setup(){ - + $this->special_classes = ''; //--> deprecated in v3, used in NavBar - + $this->optionator_default = array( 'clone_id' => 1, - 'active' => true, - 'mode' => null, + 'active' => true, + 'mode' => null, 'type' => '' ); - + } - + function prefix( $clone_id = false ){ - + if( pl_has_editor() && isset($this->meta[ 'clone' ]) ) $prefix = sprintf('.section-%s[data-clone="%s"]', $this->id, $this->meta[ 'clone' ]); elseif( $clone_id && $clone_id != '') $prefix = sprintf('.section-%s.clone_%s', $this->id, $clone_id); - else + else $prefix = ''; - + return $prefix; } function opt( $key, $args = array() ){ - + $d = array( 'default' => false ); - + $a = wp_parse_args($args, $d); - - if( - property_exists($this, 'meta') + + if( + property_exists($this, 'meta') && isset($this->meta[ 'set' ]) && isset($this->meta[ 'set' ][ $key ]) && isset($this->meta[ 'set' ][ $key ][ $this->meta[ 'clone' ] ] ) && $this->meta[ 'set' ][ $key ][ $this->meta[ 'clone' ] ] != '' ) - $val = $this->meta[ 'set' ][ $key ][ $this->meta[ 'clone' ] ]; + $val = $this->meta[ 'set' ][ $key ][ $this->meta[ 'clone' ] ]; elseif(ploption( $key, $args) && !pl_deprecate_v2()) $val = ploption( $key, $args); // LEGACY else $val = $a['default']; - + return ($val == '') ? false : $val; - + } function format_classes( $classes ) { - + $classes = str_replace( ',', ' ', str_replace( ' ', '', $classes ) ); - - return $classes; + + return $classes; } /** @@ -213,23 +213,23 @@ function format_classes( $classes ) { * @return string */ function section_install_type( $available ){ - + if ( isset( $available['custom'][$this->class_name] ) ) - return 'custom'; + return 'custom'; elseif ( isset( $available['child'][$this->class_name] ) ) return 'child'; elseif ( isset( $available['parent'][$this->class_name] ) ) return 'parent'; else { - - /** + + /** * We dont know the type, could be a 3rd party plugin. */ $results = array_search_ext($available, $this->class_name, true); if ( is_array( $results ) && isset( $results[0]['keys'])) return $results[0]['keys'][0]; } - + } /** @@ -245,31 +245,31 @@ function section_install_type( $available ){ function section_template() { die('function PageLinesSection::section_template() must be over-ridden in a sub-class.'); } - + /** * Passive Section Load Template * If a section is loaded through a hook use this builder instead of the one * inside of the template class. - * + * * @since 2.1.6 */ function passive_section_template( $hook_name = false ){ - + $this->passive_hook = $hook_name; - + $location = 'passive'; - + $markup = ( isset( $this->settings['markup'] ) ) ? $this->settings['markup'] : 'content'; - + $this->before_section_template( $location ); - + $this->before_section( $markup ); $this->section_template( $location ); - + $this->after_section( $markup ); - - $this->after_section_template(); + + $this->after_section_template(); } /** @@ -306,7 +306,7 @@ function after_section_template( $clone_id = null ){} * @uses section_template */ function section_template_load( $clone_id ) { - + // Variables for override $override_template = 'template.' . $this->id .'.php'; $override = ( '' != locate_template(array( $override_template), false, false)) ? locate_template(array( $override_template )) : false; @@ -315,7 +315,7 @@ function section_template_load( $clone_id ) { else{ $this->section_template(); } - + } @@ -338,14 +338,14 @@ function section_template_load( $clone_id ) { function before_section( $markup = 'content', $clone_id = null, $classes = ''){ $classes .= ( isset($clone_id) ) ? sprintf( ' clone_%s%s', $clone_id, $this->classes ) : sprintf( ' no_clone%s', $this->classes ); - + if(isset($this->settings['markup'])) $set_markup = $this->settings['markup']; - else - $set_markup = $markup; - + else + $set_markup = $markup; + pagelines_register_hook('pagelines_before_'.$this->id, $this->id); // hook - + // Rename to prevent conflicts if ( 'comments' == $this->id ) $section_id = 'wp-comments'; @@ -353,39 +353,39 @@ function before_section( $markup = 'content', $clone_id = null, $classes = ''){ $section_id = 'content-area'; else $section_id = $this->id; - + $classes .= sprintf(" section-%s %s", $section_id, $this->special_classes); - - if( $set_markup == 'copy' ) + + if( $set_markup == 'copy' ) printf('
    ', $section_id, trim($classes)); elseif( $set_markup == 'content' ){ - + // Draw wrapper unless using 'raw' format if($this->settings['format'] != 'raw') printf('
    ', $this->id, trim($classes)); - + // Draw textured div for background texturing if($this->settings['format'] == 'textured') printf('
    '); - + pagelines_register_hook('pagelines_outer_'.$this->id, $this->id); // hook - + // Standard content width and padding divs if($this->settings['format'] == 'textured' || $this->settings['format'] == 'standard') printf('
    '); } else { - + $span = (isset($this->meta['span'])) ? 'span'.$this->meta['span'] : 'span12'; $offset = (isset($this->meta['offset'])) ? 'offset'.$this->meta['span'] : 'offset0'; - + $classes .= ' '.$span.' '.$offset; - + printf('
    ', $this->id.$clone_id, $this->id, $clone_id, trim($classes)); pagelines_register_hook('pagelines_outer_'.$this->id, $this->id); // hook } - - pagelines_register_hook('pagelines_inside_top_'.$this->id, $this->id); // hook + + pagelines_register_hook('pagelines_inside_top_'.$this->id, $this->id); // hook } @@ -405,30 +405,30 @@ function after_section( $markup = 'content' ){ if(isset($this->settings['markup'])) $set_markup = $this->settings['markup']; else - $set_markup = $markup; - + $set_markup = $markup; + pagelines_register_hook('pagelines_inside_bottom_'.$this->id, $this->id); - + if( $set_markup == 'copy' ) printf('
    '); elseif( $set_markup == 'content' ){ - + // Standard content width and padding divs if($this->settings['format'] == 'textured' || $this->settings['format'] == 'standard') printf('
    '); - + // Draw textured div for background texturing if($this->settings['format'] == 'textured') printf('
    '); - + // Draw wrapper unless using 'raw' format if($this->settings['format'] != 'raw') printf(''); - + } else { printf(''); } - + pagelines_register_hook('pagelines_after_'.$this->id, $this->id); } @@ -442,7 +442,7 @@ function after_section( $markup = 'content' ){ * @since ... */ function section_persistent(){} - + /** * Section Init @@ -452,11 +452,11 @@ function section_persistent(){} * @TODO Add section varible defaults. Used in __consruct() */ function section_init() { - + $this->format = ( $this->format ) ? $this->format : 'textured'; - $this->classes = ( $this->classes ) ? sprintf( ' %s', ltrim( $this->classes ) ) : ''; + $this->classes = ( $this->classes ) ? sprintf( ' %s', ltrim( $this->classes ) ) : ''; } - + /** * Scripts to be loaded inline after page load * @@ -470,7 +470,7 @@ function section_on_ready(){} * @TODO document */ function section_admin(){} - + /** * Section Head @@ -483,7 +483,7 @@ function section_admin(){} * @since ... */ function section_head(){} - + /** * Section Styles @@ -492,7 +492,7 @@ function section_head(){} * @TODO document */ function section_styles(){} - + /** * Section Options @@ -506,20 +506,20 @@ function section_options(){} * Section Optionator * * Handles section options - * + * */ function section_optionator( $settings ){} - - + + /** * Section Opts * * Loads section options simply - * + * * @since b3.0.0 */ function section_opts(){ return array(); } - + /** * Section Scripts @@ -556,76 +556,76 @@ function getting_started(){} * @TODO document */ function add_guide( $options ){ - - + + if( is_file( $this->base_dir . '/guide.php' ) ){ - + ob_start(); include( $this->base_dir . '/guide.php' ); $guide = ob_get_clean(); - + $key = sprintf('hide_guide_%s', $this->id); - + $opt = array( $key => array( - 'type' => 'text_content', + 'type' => 'text_content', 'title' => __( 'Getting Started', 'pagelines' ), 'shortexp' => __( 'How to use this section', 'pagelines' ), - 'exp' => $guide, + 'exp' => $guide, 'inputlabel' => __( 'Hide This Overview', 'pagelines') ) ); - - + + // Has this been hidden? - - + + $special_oset = array('setting' => PAGELINES_SPECIAL); - + $global_option = (bool) ploption( $key ); $special_option = (bool) ploption($key, $special_oset ); - + // var_dump( $special_option ); - + if( $global_option && $special_option ){ $hide = true; - + }elseif( $special_option && !$global_option){ - + plupop($key, true); - + $hide = true; - + }elseif( !$special_option && $global_option) { - + plupop($key, false); - + $hide = false; - - }else + + }else $hide = false; if( !$hide ) $options = array_merge($opt, $options); else { - + $opt = array( $key => array( 'type' => 'text_content_reverse', 'inputlabel' => __( 'Hide Section Guide', 'pagelines' ) ) ); - + $options = array_merge( $options, $opt); } - + } - + return $options; - - - } - + + + } + // Deprecated /** @@ -639,9 +639,9 @@ function add_guide( $options ){ * @TODO document */ function add_getting_started( $tab_array ){ - + return $this->add_guide($tab_array); - + } @@ -664,7 +664,7 @@ function hook_get_view(){ * @TODO document */ function get_view(){ - + if(is_single()) $view = 'single'; elseif(is_archive()) @@ -673,10 +673,10 @@ function get_view(){ $view = 'page'; else $view = 'default'; - + $this->view = $view; } - + /** * Hook Get Post Type @@ -685,10 +685,10 @@ function get_view(){ * @TODO document */ function hook_get_post_type(){ - + add_action('wp_head', array(&$this, 'get_post_type'), 10); } - + /** * Get Post Type @@ -698,9 +698,9 @@ function hook_get_post_type(){ */ function get_post_type(){ global $pagelines_template; - + $this->template_type = $pagelines_template->template_type; - + } @@ -714,10 +714,10 @@ function get_post_type(){ * @param $clone_id */ function setup_oset( $clone_id ){ - + global $pagelines_ID; - - + + // Setup common option configuration, considering clones and page ids $this->oset = array( 'post_id' => $pagelines_ID, @@ -764,14 +764,14 @@ function __contruct() { } * @TODO document */ function register($section_class, $args) { - + if(class_exists($section_class)) $this->sections[$section_class] = new $section_class( $args ); - + /** Unregisters version-controlled sections */ if(!VPRO && $this->sections[$section_class]->settings['version'] == 'pro') { - $this->unavailable_sections[] = $this->sections[$section_class]; - $this->unregister($section_class); + $this->unavailable_sections[] = $this->sections[$section_class]; + $this->unregister($section_class); } } @@ -804,10 +804,10 @@ function unregister($section_class) { */ function load_section_persistent(){ global $pl_section_factory; - + foreach($pl_section_factory->sections as $section) $section->section_persistent(); - + } @@ -825,7 +825,7 @@ function load_section_persistent(){ function load_section_admin(){ global $pl_section_factory; - + foreach($pl_section_factory->sections as $section) $section->section_admin(); @@ -840,23 +840,23 @@ function load_section_admin(){ * @TODO document */ function get_unavailable_section_areas(){ - + $unavailable_section_areas = array(); - + foreach(the_template_map() as $top_section_area){ - + if(isset($top_section_area['version']) && $top_section_area['version'] == 'pro') $unavailable_section_areas[] = $top_section_area['name']; - + if(isset($top_section_area['templates'])){ foreach ($top_section_area['templates'] as $section_area_template){ if(isset($section_area_template['version']) && $section_area_template['version'] == 'pro') $unavailable_section_areas[] = $section_area_template['name']; } } - + } - + return $unavailable_section_areas; - + } @@ -864,12 +864,12 @@ function get_unavailable_section_areas(){ * Setup Section Notify */ function setup_section_notify( $section, $text = '', $user_url = null, $ltext = null){ - - + + if(current_user_can('edit_themes')){ - + $banner_title = sprintf(' %s', $section->name); - + if(pl_has_editor()){ $url = (isset($user_url)) ? $user_url : '#'; $class = (isset($user_url)) ? '' : 's-control section-edit'; @@ -877,32 +877,32 @@ function setup_section_notify( $section, $text = '', $user_url = null, $ltext = $class = ''; $url = (isset($url)) ? $url : pl_meta_set_url( $tab ); } - - + + $link_text = (isset($ltext)) ? $ltext : sprintf(__('Configure %s ', 'pagelines'), $section->name); - + $link = sprintf('
    %s', $url, $class, $link_text); - + $text = ($text != '') ? $text : __('Configure this section'); - + return sprintf( - '
    %s
    ', - $banner_title, - $text, + '
    %s
    ', + $banner_title, + $text, $link ); } - + } /** * Splice Section Slug */ function splice_section_slug( $slug ){ - - $pieces = explode('ID', $slug); + + $pieces = explode('ID', $slug); $section = (string) $pieces[0]; $clone_id = (isset($pieces[1])) ? $pieces[1] : 1; - + return array('section' => $section, 'clone_id' => $clone_id); } \ No newline at end of file diff --git a/includes/class.shortcodes.php b/includes/class.shortcodes.php index 8b8080f9..30c18a90 100644 --- a/includes/class.shortcodes.php +++ b/includes/class.shortcodes.php @@ -54,23 +54,23 @@ */ class PageLines_ShortCodes { - - + + function __construct() { - + self::register_shortcodes( $this->shortcodes_core() ); - + // Make widgets process shortcodes - add_filter( 'widget_text', 'do_shortcode' ); + add_filter( 'widget_text', 'do_shortcode' ); // add_action( 'template_redirect', array( &$this, 'filters' ) ); add_action('wp_footer',array( &$this, 'print_carousel_js' ), 21); - + } private function shortcodes_core() { - - $core = array( - + + $core = array( + 'button' => array( 'function' => 'pagelines_button_shortcode' ), 'post_time' => array( 'function' => 'pagelines_post_time_shortcode' ), @@ -121,15 +121,15 @@ private function shortcodes_core() { 'pl_raw' => array( 'function' => 'do_raw' ), 'pl_video' => array( 'function' => 'pl_video_shortcode' ) ); - + return $core; } function do_raw() { - + global $post; $str = $post->post_content; - + $start = '[pl_raw]'; $end = '[/pl_raw]'; $stpos = strpos( $str, $start ); @@ -153,7 +153,7 @@ function bookmark_link( $atts ) { //convert the page name to a page ID $bookmark = get_bookmark( $id ); - + if( isset( $text ) ) $ltext = $text; else $ltext = $bookmark->link_name; @@ -184,7 +184,7 @@ function create_pagelink( $atts ) { // 3. Function for getting template path // USAGE: [themeurl] function get_themeurl( $atts ){ return get_template_directory_uri(); } - + // 4. GOOGLE MAPS ////////////////////////////////////////////////// // you can use the default width and height @@ -192,9 +192,9 @@ function get_themeurl( $atts ){ return get_template_directory_uri(); } // Example: // [googlemap address="san diego, ca"] // or with options - // [googlemap width="200" height="200" address="San Francisco, CA 92109"] + // [googlemap width="200" height="200" address="San Francisco, CA 92109"] function googleMaps( $atts, $content = null ) { - + extract( shortcode_atts( array( 'width' => '480', @@ -209,7 +209,7 @@ function googleMaps( $atts, $content = null ) { // 5. GOOGLE CHARTS ////////////////////////////////////////////////// // Gets Google charts - // USAGE + // USAGE // [chart data="0,12,24,26,32,64,54,24,22,20,8,2,0,0,3" bg="F7F9FA" size="200x100" type="sparkline"] // [chart data="41.52,37.79,20.67,0.03" bg="F7F9FA" labels="Reffering+sites|Search+Engines|Direct+traffic|Other" colors="058DC7,50B432,ED561B,EDEF00" size="488x200" title="Traffic Sources" type="pie"] @@ -255,8 +255,8 @@ function chart_shortcode( $atts ) { $string .= '&chf=bg,s,'.$bg.''; return ''.$title.''; - } - + } + // 6. GET POST FIELD BY OFFSET ////////////////////////////////////////////////// // Get a post based on offset from the last post published (0 for last post) // USAGE: [postfeed field="post_title" offset="0" customfield="true" ] @@ -275,7 +275,7 @@ function get_postfeed( $atts ) { } return $postfield; } - + // 7. Created a container for dynamic html layout // USAGE: [cbox width="50%" leftgutter="15px" rightgutter="0px"] html box content[/cbox] function dynamic_box( $atts, $content = null ) { @@ -284,7 +284,7 @@ function dynamic_box( $atts, $content = null ) { extract( shortcode_atts( array( 'width' => '30%', 'leftgutter' => '10px', 'rightgutter' => '0px' ), $atts ) ); $cbox = '
    '.do_shortcode( $content ).'
    '; - + return $cbox; } @@ -294,15 +294,15 @@ function dynamic_container( $atts, $content = null ) { //extract page name from the shortcode attributes extract( shortcode_atts( array( 'id' => 'container', 'class' => '' ), $atts ) ); - + $container = '
    '.do_shortcode( $content ).'
    '; return $container; } - + /** * 9. This function produces the edit post link for logged in users - * + * * @example [post_edit] is the default usage * @example [post_edit link="Edit", before="" after=""] */ @@ -325,10 +325,10 @@ function pagelines_post_edit_shortcode( $atts ) { return apply_filters( 'pagelines_post_edit_shortcode', $output, $atts ); } - + /** * 10. This function produces the category link list - * + * * @example [post_categories] is the default usage * @example [post_categories sep=", "] */ @@ -348,10 +348,10 @@ function pagelines_post_categories_shortcode( $atts ) { return apply_filters( 'pagelines_post_categories_shortcode', $output, $atts ); } - + /** * 11. This function produces the tag link list - * + * * @example [post_tags] is the default usage * @example [post_tags sep=", " before="Tags: " after="bar"] */ @@ -373,10 +373,10 @@ function pagelines_post_tags_shortcode( $atts ) { return apply_filters( 'pagelines_post_tags_shortcode', $output, $atts ); } - + /** * 12. This function produces a post type link. - * + * * @example [post_type] is the default usage * @example [post_type before="Type: " after="bar"] */ @@ -387,14 +387,14 @@ function pagelines_post_type_shortcode( $atts ) { 'after' => '' ); $atts = shortcode_atts( $defaults, $atts ); - + global $post; - + if ( $post->post_type == 'post' ) return; - + $t = get_post_type_object( $post->post_type ); - + $name = $t->labels->name; $type = sprintf( '%s%s%s', $atts['before'], $name, $atts['after'] ); @@ -404,10 +404,10 @@ function pagelines_post_type_shortcode( $atts ) { $output = sprintf( '%s ', $type ); return apply_filters( 'pagelines_post_type_shortcode', $output, $atts ); } - + /** * 13. This function produces the comment link - * + * * @example [post_comments] is the default usage * @example [post_comments zero="No Comments" one="1 Comment" more="% Comments"] */ @@ -437,20 +437,20 @@ function pagelines_post_comments_shortcode( $atts ) { return apply_filters( 'pagelines_post_comments_shortcode', $output, $atts ); } - + function get_comment_link() { - + $comment = '#wp-comments'; - + if( function_exists( 'livefyre_show_comments' ) ) $comment = '#lf_comment_stream'; - + return sprintf( '%s%s', get_permalink(), $comment ); } - + /** * 14. This function produces the author of the post (link to author archive) - * + * * @example [post_author_posts_link] is the default usage * @example [post_author_posts_link before="" after=""] */ @@ -471,10 +471,10 @@ function pagelines_post_author_posts_link_shortcode( $atts ) { return apply_filters( 'pagelines_post_author_shortcode', $output, $atts ); } - + /** * 15. This function produces the author of the post (link to author URL) - * + * * @example [post_author_link] is the default usage * @example [post_author_link before="" after=""] */ @@ -502,13 +502,13 @@ function pagelines_post_author_link_shortcode( $atts ) { return apply_filters( 'pagelines_post_author_link_shortcode', $output, $atts ); } - + /** * 16. This function produces the author of the post (display name) - * + * * @example [post_author] is the default usage * @example [post_author before="" after=""] - */ + */ function pagelines_post_author_shortcode( $atts ) { $defaults = array( @@ -529,8 +529,8 @@ function pagelines_post_author_shortcode( $atts ) { /** * 17. Post Date - * - */ + * + */ function pagelines_post_date_shortcode( $atts ) { $defaults = array( @@ -552,11 +552,11 @@ function pagelines_post_date_shortcode( $atts ) { return apply_filters( 'pagelines_post_date_shortcode', $output, $atts ); } - - + + /** * 18.Shortcode to display Pinterest button - * + * * @example [pinterest_button img=""] is the default usage * @example [pinterest_button img=""] */ @@ -566,10 +566,10 @@ function pl_pinterest_button( $atts ){ 'url' => get_permalink(), 'img' => '', 'title' => urlencode( the_title_attribute( array( 'echo' => false ) ) ), - ); + ); $atts = shortcode_atts( $defaults, $atts ); - + $out = sprintf( '', $atts['url'], $atts['img'], @@ -582,7 +582,7 @@ function pl_pinterest_button( $atts ){ /** * 1X.Shortcode to display Google Plus 1 Button - * + * * @example [google_plus] is the default usage * @example [google_plus size="" count=""] * @example available attributes for size include small, medium, and tall @@ -594,9 +594,9 @@ function pl_googleplus_button ( $atts ) { 'size' => 'medium', 'count' => 'inline', 'url' => get_permalink() - + ); - + $atts = shortcode_atts($defaults, $atts); ob_start(); @@ -618,32 +618,32 @@ function pl_googleplus_button ( $atts ) { /** * . Shortcode to display Linkedin Share Button - * + * * @example [linkedin] is the default usage * @example [linkedin count="vertical"] */ function pl_linkedinshare_button ($atts) { - + $defaults = array( - 'url' => get_permalink(), + 'url' => get_permalink(), 'count' => 'horizontal' - ); + ); $atts = wp_parse_args( $atts, $defaults ); - $out = sprintf( '', + $out = sprintf( '', $atts['url'], $atts['count'] ); - + return $out; } - + /** * 19. Shortcode to display Tweet button - * + * * @example [twitter_button type=""] is the default usage * @example [twitter_button type="follow"] */ @@ -651,46 +651,46 @@ function pl_twitter_button( $args ){ $defaults = array( 'type' => '', - 'permalink' => get_permalink(), - 'handle' => ( ploption( 'twittername' ) ) ? ploption( 'twittername' ) : 'PageLines' , + 'permalink' => get_permalink(), + 'handle' => ( ploption( 'twittername' ) ) ? ploption( 'twittername' ) : 'PageLines' , 'title' => '' - ); + ); $a = wp_parse_args( $args, $defaults ); if ($a['type'] == 'follow') { - $out = sprintf( '', + $out = sprintf( '', $a['handle'] ); } else { - $out = sprintf( '', + $out = sprintf( '', $a['type'], - $a['permalink'], + $a['permalink'], $a['title'], $a['handle'] ); } return $out; } - + /** * 20. Shortcode to display Facebook Like button - * + * * @example [like_button] is the default usage * @example [like_button] */ function pl_facebook_shortcode( $args ){ $defaults = array( - 'url' => get_permalink(), + 'url' => get_permalink(), 'width' => '80', - ); + ); $a = wp_parse_args( $args, $defaults ); - + ob_start(); // Facebook ?> @@ -703,17 +703,17 @@ function pl_facebook_shortcode( $args ){ }(document, 'script', 'facebook-jssdk'));
    ', - $a['url'], + $a['url'], $a['width'] ); return ob_get_clean(); } - + /** * 21. This function/shortcode will show all authors on a post - * + * * @example [show_authors] is the default usage * @example [show_authors] */ @@ -739,13 +739,13 @@ function show_multiple_authors() { /** * 22.Bootstrap Code Shortcode - * + * * @example [pl_codebox]...[/pl_codebox] is the default usage * @example [pl_codebox scrollable="yes"].box{margin:0 auto;}[/pl_codebox] for lots of code */ function pl_codebox_shortcode ( $atts, $content = null ) { - + extract( shortcode_atts( array( 'scrollable' => 'no', 'linenums' => 'yes', @@ -758,7 +758,7 @@ function pl_codebox_shortcode ( $atts, $content = null ) { // Grab Shortcodes $pattern = array( - + '#([a-z]+\=[\'|"][^\'|"]*[\'|"])#m', '#(\[[^]]*])#m', @@ -782,13 +782,13 @@ function pl_codebox_shortcode ( $atts, $content = null ) { /** * 23. Bootstrap Labels Shortcode - * + * * @example [pl_label type=""]My Label[/pl_label] is the default usage * @example [pl_label type="info"]label[/pl_label] * @example Available types include info, success, warning, error */ function pl_label_shortcode( $atts, $content = null ) { - + $defaults = array( 'type' => 'info', ); @@ -805,17 +805,17 @@ function pl_label_shortcode( $atts, $content = null ) { /** * 24. Bootstrap Badges Shortcode - * + * * @example [pl_badge type="info"]My badge[/pl_badge] is the default usage * @example [pl_badge type="info"]badge[/pl_badge] * @example Available types include info, success, warning, error */ function pl_badge_shortcode( $atts, $content = null ) { - + $defaults = array( 'type' => 'info', ); - + $atts = shortcode_atts( $defaults, $atts ); $out = sprintf( '%s', @@ -826,10 +826,10 @@ function pl_badge_shortcode( $atts, $content = null ) { return $out; } - + /** * 25. Bootstrap Alertbox Shortcode - * + * * @example [pl_alertbox type="info"]My alert[/pl_alertbox] is the default usage * @example [pl_alertbox type="info" closable="yes"]My alert[/pl_alertbox] makes an alert that can be toggled away with a close button * @example [pl_alertbox type="info"]

    Heading

    My alert[/pl_alertbox]
    @@ -851,10 +851,10 @@ function pl_alertbox_shortcode( $atts, $content = null ) { do_shortcode( $content ) ); - if ( $atts['closable'] === 'yes' ) { - + if ( $atts['closable'] === 'yes' ) { + return $closed; - + } $out = sprintf( '
    %2$s
    ', @@ -864,22 +864,22 @@ function pl_alertbox_shortcode( $atts, $content = null ) { return $out; } - + /** * 26. Bootstrap Blockquote Shortcode - * + * * @example [pl_blockquote pull="" cite=""]My quote[/pl_blockquote] is the default usage * @example [pl_blockquote pull="right" cite="Someone Famous"]My quote pulled right with source[/pl_blockquote] */ function pl_blockquote_shortcode( $atts, $content = null) { $defaults = array( - 'pull' => '', + 'pull' => '', 'cite' => '' - ); + ); $atts = shortcode_atts( $defaults, $atts ); - + $out = sprintf( '

    %3$s%2$s

    ', $atts['pull'], $atts['cite'], @@ -889,10 +889,10 @@ function pl_blockquote_shortcode( $atts, $content = null) { return $out; } - + /** * 27. Bootstrap Button Shortcode - * + * * @example [pl_button type="" size="" link="" target=""]...[/pl_button] is the default usage * @example [pl_button type="info" size="small" link="#" target="blank"]My Button[/pl_button] * @example Available types include info, success, warning, danger, inverse @@ -911,7 +911,7 @@ function pl_button_shortcode( $atts, $content = null, $target = null ) { $target = ( $target == 'blank' ) ? '_blank' : ''; - $out = sprintf( '%5$s', + $out = sprintf( '%5$s', $atts['link'], $atts['target'], $atts['type'], @@ -925,7 +925,7 @@ function pl_button_shortcode( $atts, $content = null, $target = null ) { /** * 28. Bootstrap Button Group Shortcode - Builds a group of buttons as a menu - * + * * @example [pl_buttongroup]...[/pl_buttongroup] is the default usage * @example [pl_buttongroup][/pl_button] * @example Available types include info, success, warning, danger, inverse @@ -938,10 +938,10 @@ function pl_buttongroup_shortcode( $atts, $content = null ) { } - + /** * 29. Bootstrap Dropdown Button Shortcode - Builds a button with contained dropdown menu - * + * * @example [pl_buttondropdown size="" type="" label=""]
  • ...
  • [/pl_buttondropdown]
    is the default usage * @example [pl_buttondropdown size="large" type="info" label="button"]
  • [/pl_buttondropdown]
    * @example Available types include info, success, warning, danger, inverse @@ -962,20 +962,20 @@ function pl_buttondropdown_shortcode( $atts, $content = null ) { $atts['label'], do_shortcode( $content ) ); - + return $out; } /** * 30. Bootstrap Split Button Dropdown - Builds a button with split button dropdown caret - * + * * @example [pl_splitbuttondropdown size="" type="" label=""]
  • ...
  • [/pl_splitbuttondropdown]
    is the default usage * @example [pl_splitbuttondropdown size="large" type="info" label="button"]
  • [/pl_splitbuttondropdown]
    * @example Available types include info, success, warning, danger, inverse */ function pl_splitbuttondropdown_shortcode( $atts, $content = null ) { - + $defaults = array( 'size' => '', 'type' => '', @@ -990,13 +990,13 @@ function pl_splitbuttondropdown_shortcode( $atts, $content = null ) { $atts['label'], do_shortcode( $content ) ); - + return $out; } /** * 31. Bootstrap Tooltips - * + * * @example [pl_tooltip tip=""]...[/pl_tooltip] is the default usage * @example This is a [pl_tooltip tip="Cool"]tooltip[/pl_tooltip] example. */ @@ -1010,7 +1010,7 @@ function pl_tooltip_shortcode( $atts, $content = null ) { $atts = shortcode_atts( $defaults, $atts ); ob_start(); - + ?>
    %5$s', $title, $type, @@ -1336,20 +1336,20 @@ function pl_modal_shortcode( $atts, $content = null ) { $hash, __( 'Close', 'pagelines' ) ); - + return ob_get_clean(); - + } - + /** * 37. This function produces the time of post publication - * + * * @example [post_time] is the default usage * @example [post_time format="g:i a" before="" after=""] - */ + */ function pagelines_post_time_shortcode( $atts ) { - $defaults = array( + $defaults = array( 'format' => get_option( 'time_format' ), 'before' => '', 'after' => '', @@ -1368,24 +1368,24 @@ function pagelines_post_time_shortcode( $atts ) { return apply_filters( 'pagelines_post_time_shortcode', $output, $atts ); } - + /** * 38. Used to create general buttons and button links - * + * * @example [button] is the default usage * @example [button format="edit_post" before="" after=""] */ function pagelines_button_shortcode( $atts ) { $defaults = array( - 'color' => 'grey', + 'color' => 'grey', 'size' => 'normal', - 'align' => 'right', + 'align' => 'right', 'style' => '', - 'type' => 'button', + 'type' => 'button', 'text' => ' ', - 'pid' => 0, - 'class' => null, + 'pid' => 0, + 'class' => null, ); $atts = shortcode_atts( $defaults, $atts ); @@ -1399,12 +1399,12 @@ function pagelines_button_shortcode( $atts ) { /** * XX. Responsive Videos - * + * * @example [pl_video] is the default usage * @example [pl_video type="youtube" url="urltovideo"] */ function pl_video_shortcode ($atts) { - + extract( shortcode_atts( array( 'type' =>'', 'id' =>'', @@ -1440,7 +1440,7 @@ function filters() { * Prevent AUTOP inside of shortcodes (breaking shortcodes - removed) */ remove_filter( 'the_content', 'wpautop' ); - add_filter( 'the_content', 'wpautop' , 12); + add_filter( 'the_content', 'wpautop' , 12); remove_filter( 'the_content', 'wptexturize' ); add_filter( 'the_content', 'wptexturize' , 12); } @@ -1449,9 +1449,9 @@ private function register_shortcodes( $shortcodes ) { foreach ( $shortcodes as $shortcode => $data ) { add_shortcode( $shortcode, array( &$this, $data['function']) ); - } + } } -// +// } // end of class // new PageLines_ShortCodes; diff --git a/includes/class.template.php b/includes/class.template.php index 6491052f..5c96b618 100644 --- a/includes/class.template.php +++ b/includes/class.template.php @@ -1,6 +1,6 @@ factory = $pl_section_factory->sections; - + // All section control settings - + $sc_set = (is_pagelines_special()) ? PAGELINES_SPECIAL : PAGELINES_TEMPLATES; - + $this->scontrol = ploption('section-control', array('setting' => $sc_set)); - + $this->sc_default = ploption('section-control', array('setting' => PAGELINES_TEMPLATES)); - + $this->map = $this->get_map(); - + // Add passive sections $this->passive_sections = $passive_sections; - + /** * Template Type * This is how we decide which sections belong on the page */ if( $template_type != false ) $this->template_type = $template_type; - + else{ if(is_admin()) $this->template_type = $this->admin_page_type_breaker(); @@ -72,13 +72,13 @@ function __construct( $template_type = false ) { if(!is_admin()) $this->template_name = $this->page_type_name(); - - + + // DEPRECATE AFTER THIS FOR V2 (for now) if(pl_deprecate_v2()) return; - - + + add_action('admin_head', array(&$this, 'load_section_optionator')); add_action('pagelines_before_html', array(&$this, 'run_before_page')); @@ -86,10 +86,10 @@ function __construct( $template_type = false ) { add_action('pagelines_head', array(&$this, 'hook_and_print_sections')); add_action('wp_footer', array(&$this, 'print_template_section_scripts')); - - + + $this->load_sections_on_hook_names(); - + } @@ -99,7 +99,7 @@ function __construct( $template_type = false ) { * */ function adjust_template_type($type){ - $this->template_type = $type; + $this->template_type = $type; $this->load_sections_on_hook_names(); } @@ -147,12 +147,12 @@ public static function page_type_breaker(){ $type = 'single'; else $type = 'default'; - + $post_type_breaker = $type; return apply_filters('pagelines_page_type', $post_type_breaker, $post); } - - + + /** * Page Type Name @@ -161,23 +161,23 @@ public static function page_type_breaker(){ * @todo Finish documentation */ function page_type_name(){ - + if(isset($this->map['templates']['templates'][$this->template_type]['name'])) return $this->map['templates']['templates'][$this->template_type]['name']; else return ui_key( $this->template_type ); } - + /** * Returns template type based on elements in WP admin */ public static function admin_page_type_breaker(){ global $post; - - - if ( !is_object( $post ) ) + + + if ( !is_object( $post ) ) return 'default'; - + if( isset($post) && $post->post_type == 'post' ) return 'single'; elseif( isset($_GET['page']) && $_GET['page'] == 'pagelines' ) @@ -192,31 +192,31 @@ public static function admin_page_type_breaker(){ return $template_name; } elseif( isset($post) && isset($post->post_type) ) return $post->post_type; - else + else return 'default'; - + } - - + + /** * Get current post type, set as GET on 'add new' pages */ public static function current_admin_post_type(){ global $pagenow; global $post; - - $current_post_type = ( !isset($post) && isset($_GET['post_type']) ) - ? $_GET['post_type'] - : ( isset($post) && isset($post->post_type) ? $post->post_type : - ($pagenow == 'post-new.php' ? 'post' : null)); - + + $current_post_type = ( !isset($post) && isset($_GET['post_type']) ) + ? $_GET['post_type'] + : ( isset($post) && isset($post->post_type) ? $post->post_type : + ($pagenow == 'post-new.php' ? 'post' : null)); + return $current_post_type; - + } - - - + + + /** * * Load sections on to class attributes the correspond w/ hook args @@ -225,37 +225,37 @@ public static function current_admin_post_type(){ * */ function load_sections_on_hook_names(){ - + foreach( $this->map as $hook => $h ){ - + $tsections = $this->sections_at_hook( $hook, $h ); - + // Set All Sections As Defined By the Map // This is before removal by section control - if( is_array($tsections) ) + if( is_array($tsections) ) $this->default_allsections = array_merge($this->default_allsections, $tsections); - + // Remove sections deactivated by Section Control if(!is_admin()) $tsections = $this->unset_hidden_sections($tsections, $hook); - + // Set Property after Template Hook Args $this->$hook = $tsections; - - // Create an array with all sections used on current page - - if(is_array($this->$hook)) + + // Create an array with all sections used on current page - + if(is_array($this->$hook)) $this->allsections = array_merge($this->allsections, $this->$hook); - + if( is_array($this->$hook) && ($hook == 'header' || $hook == 'footer' || $hook == 'morefoot') ) $this->non_template_sections = array_merge($this->non_template_sections, $this->$hook); - - + + } - + // add passive sections (not in drag drop but added through options/hooks) if(is_array($this->passive_sections) && !empty($this->passive_sections)) $this->allsections = array_merge($this->allsections, $this->passive_sections); - + } @@ -272,22 +272,22 @@ function load_sections_on_hook_names(){ * @return array|mixed|void */ function sections_at_hook( $hook, $h ){ - + /* Load in sections at hook in map, for this template type, allow for overriding */ if( $hook == 'main' || $hook == 'templates' ){ - + $sections = $this->section_cascade( $hook, $h ); - + return apply_filters( 'pl_template_sections', $sections, $this->template_type, $hook ); - + } - + elseif(isset($h['sections'])) return $h['sections']; // Get Sections assigned in map else return array(); - + } /** @@ -295,37 +295,37 @@ function sections_at_hook( $hook, $h ){ * if default doesn't load, load a blank array */ function section_cascade( $hook, $h ){ - + if( isset($h['templates'][$this->template_type]['sections']) ) return $h['templates'][$this->template_type]['sections']; - + elseif( isset($h['templates']['default']['sections']) ) return $h['templates']['default']['sections']; - + else return array(); - + } - + /** * Unset sections based on section */ function unset_hidden_sections($ta_sections, $hook_id){ - + global $post; - + if(is_array($ta_sections)){ foreach($ta_sections as $key => $sid){ - - $template_slug = $this->get_template_slug( $hook_id ); - + + $template_slug = $this->get_template_slug( $hook_id ); + $sc = $this->sc_settings( $this->scontrol, $template_slug, $sid ); $dsc = $this->sc_settings( $this->sc_default, $template_slug, $sid ); - + if($this->unset_section($sid, $template_slug, $sc, $dsc)) unset($ta_sections[$key]); - - + + // do not show section if post/page is passworded. if( post_password_required() ) { if( 'main' === $hook_id && 'PageLinesPostLoop' !== $sid ) @@ -333,20 +333,20 @@ function unset_hidden_sections($ta_sections, $hook_id){ } } } - + return $ta_sections; - + } - + /** * Get Section Control Settings for Section */ function sc_settings( $set, $tid, $sid ){ - + return (isset($set[$tid][$sid])) ? $set[$tid][$sid] : null; } - + /** * @@ -354,7 +354,7 @@ function sc_settings( $set, $tid, $sid ){ * */ function get_template_slug( $hook_id ){ - + // Get template slug if($hook_id == 'templates') $template_slug = $hook_id.'-'.$this->template_type; @@ -362,62 +362,62 @@ function get_template_slug( $hook_id ){ $template_slug = $hook_id.'-'.$this->template_type; else $template_slug = $hook_id; - + return $template_slug; } - + /** * Unset section based on Section Control */ function unset_section( $sid, $template_slug, $sc, $dsc){ global $post; - + $post_id = ( isset($post) ) ? $post->ID : null; - + $oset = array('post_id' => $post_id); - + // Global Section Control Array $general_hide = (isset($dsc['hide'])) ? true : false; - + // Meta Controls if(is_pagelines_special()){ $special_type = $this->template_type; - + $meta_reverse = ( isset($sc[$special_type]['show']) && $sc[$special_type]['show'] ) ? true : false; $meta_hide = ( isset($sc[$special_type]['hide']) && $sc[$special_type]['hide'] ) ? true : false; } else { - + $meta_reverse = ( plmeta( meta_option_name( array('show', $template_slug, $sid) ) , $oset ) ) ? true : false; $meta_hide = ( plmeta( meta_option_name( array('hide', $template_slug, $sid) ), $oset ) ) ? true : false; } - + return ( ($general_hide && !$meta_reverse) || (!$general_hide && $meta_hide) ) ? true : false; - - + + } - + /** * Hook up sections to hooks throughout the theme * Specifically, the hooks should link w/ template map slugs */ function hook_and_print_sections(){ - + foreach( $this->map as $hook_id => $h ){ if( isset($h['hook']) ) add_action( $h['hook'], array(&$this, 'print_section_html') ); - } - + } + } /** * Print section HTML from hooks. */ function print_section_html( $hook ){ - - global $plbuffer; + + global $plbuffer; /** * Sections assigned to array already in get_loaded_sections */ @@ -429,20 +429,20 @@ function print_section_html( $hook ){ * Parse through sections assigned to this hook */ foreach( $this->$hook as $key => $sid ){ - + /** * This goes through and buffers sections so we can add classes to sections that 'tell the future' * proved to be extremely hard to implement, and harder to work w/ all wp plugins (get_sidebars conflict) - * Leaving here for now, enabled by action. + * Leaving here for now, enabled by action. * Original idea was for themers to use classes based on adjacent sections to style, instead, recommend using section hooks + options - * + * */ if( has_action('buffer_sections') ){ - + /** * Check for buffered version, use if that exists; then unset. */ - if(isset($plbuffer[$sid])){ + if(isset($plbuffer[$sid])){ $render = $plbuffer[$sid]; unset($plbuffer[$sid]); }else @@ -453,7 +453,7 @@ function print_section_html( $hook ){ //$this->render_template($render, $sid, $markup_type); - // PREVIOUS // + // PREVIOUS // $last_sid = $this->get_last_rendered($hook); // NEXT // @@ -466,50 +466,50 @@ function print_section_html( $hook ){ $this->last_rendered = array('sid' => $sid, 'hook' => $hook); } - - + + } else { - + $render = $this->buffer_template( $sid ); - + if($render) $this->render_template($render, $sid, $markup_type); - + } - } - - + } + + } } - + /** * Renders the HTML template and adds surrounding 'standardized' markup and hooks */ function render_template($template, $sid, $markup, $next = '', $prev = ''){ - + $classes = $prev.' '.$next; $p = splice_section_slug($sid); $section = $p['section']; $clone_id = $p['clone_id']; - + $s = $this->factory[ $section ]; - + echo pl_source_comment($s->name . ' | Section Template', 2); - + $s->before_section_template( $clone_id ); - + $s->before_section( $markup, $clone_id, $classes); echo $template; - + $s->after_section( $markup ); - + $s->after_section_template( $clone_id ); - + } - + /** * Runs template in an output buffer and returns the output */ @@ -518,50 +518,50 @@ function buffer_template( $sid ){ global $wp_query; $save_query = $wp_query; $save_post = $post; - + /** * If this is a cloned element, remove the clone flag before instantiation here. */ $p = splice_section_slug($sid); $section = $p['section']; $clone_id = $p['clone_id']; - + if( $this->in_factory( $section ) ){ - + $s = $this->factory[ $section ]; - + $s->setup_oset( $clone_id ); - + /** * Load Template - * Get Template in Buffer + * Get Template in Buffer *****************************/ - + ob_start(); - + // If in child theme get that, if not load the class template function $s->section_template_load( $clone_id ); - + $template_output = ob_get_clean(); - + /** END BUFFER *****************************/ } - + // RESET // $wp_query = $save_query; $post = $save_post; - + return (isset($template_output) && $template_output != '') ? $template_output : false; - + } - + function get_last_rendered($hook){ - + $order = array('header', 'templates', 'morefoot', 'footer'); - + $k = array_search($hook, $order); - - + + if($k && isset($this->last_rendered)){ return $this->last_rendered['sid']; } elseif(isset($this->last_rendered) && ($hook == $this->last_rendered['hook'])){ @@ -569,29 +569,29 @@ function get_last_rendered($hook){ } else { return 'top'; } - + } /** * Concatenation used in classes */ function conc($sid, $adjacent_sid, $mode = 'next'){ - + if($mode == 'previous'){ - + $adjacent_slug = ($adjacent_sid == 'top') ? 'top' : $this->get_section_slug($adjacent_sid); - + $conc = sprintf('%s-%s', $adjacent_slug, $this->get_section_slug($sid)); - + }else{ $adjacent_slug = ($adjacent_sid == 'bottom') ? 'bottom' : $this->get_section_slug($adjacent_sid); - + $conc = sprintf('%s-%s', $this->get_section_slug($sid), $adjacent_slug); } - + return $conc; - + } - + /** * Get the section slug from the unique section ID */ @@ -599,205 +599,205 @@ function get_section_slug($sid){ $p = splice_section_slug($sid); $section = $p['section']; $clone_id = $p['clone_id']; - + if(isset($this->factory[ $section ])) return $this->factory[ $section ]->id; else return false; } - + /** * Recursive function for buffering following sections. - * Needed for use in concatenating sections so themers can + * Needed for use in concatenating sections so themers can * design based on user configuration of sections */ function buffer_next_section($hook, $key, $sid = ''){ - + global $plbuffer; - + $next = $this->next_section($hook, $key); - + if($next['sid'] == 'end') return 'bottom'; else $plbuffer[$next['sid']] = $this->buffer_template($next['sid']); - + if(!$plbuffer[$next['sid']]){ - + // Recursion return $this->buffer_next_section($next['hook'], $next['key'], $next['sid']); - + }else return $next['sid']; - + } - + /** * Finds the next section that is output by the framework */ function next_section($hook, $key){ - + if(property_exists($this, $hook)){ $in_area = $this->$hook; - + } - + if(isset($in_area[$key+1])){ $data = array( - 'sid' => $in_area[$key+1], - 'hook' => $hook, + 'sid' => $in_area[$key+1], + 'hook' => $hook, 'key' => $key+1 ); } else { - + $data = $this->area_next_section($hook); } - - + + return $data; } - + /** * Used if section is at the end of the template area */ function area_next_section($hook){ - + $order = array( - 'header', - 'templates', - 'morefoot', + 'header', + 'templates', + 'morefoot', 'footer' ); // Current Area $k = array_search($hook, $order); - + if(!isset($k) || $k === false){ - + // probl return array('sid'=>'end', 'hook' => false, 'key' => false); } $i = 1; foreach($order as $a) { - + $area = (isset($order[ $k+$i ])) ? $order[ $k+$i ] : false; if( $area && is_array($this->$area) && !empty($this->$area) ){ - + $karr = $this->$area; - + $data = array( - 'sid' => $karr[0], - 'hook' => $area, + 'sid' => $karr[0], + 'hook' => $area, 'key' => 0 ); - - return $data; - - } - + + return $data; + + } + $i++; } return array('sid'=>'end', 'hook' => false, 'key' => false); - - } - - + + } + + /** * Tests if the section is in the factory singleton * @since 1.0.0 */ - function in_factory( $section ){ + function in_factory( $section ){ return ( isset($this->factory[ $section ]) && is_object($this->factory[ $section ]) ) ? true : false; } - + /** * Gets template map, sets option if not present * @since 1.0.0 */ function get_map(){ - + // Get Section / Layout Map if(get_option( PAGELINES_TEMPLATE_MAP ) && is_array(get_option( PAGELINES_TEMPLATE_MAP ))){ $map = get_option( PAGELINES_TEMPLATE_MAP ); return $this->update_template_config($map); - + }else{ - + $config = $this->update_template_config( the_template_map() ); update_option( PAGELINES_TEMPLATE_MAP, $config ); return $config; } } - + /** * When the default map is updated, we need to pull in the additional w/o the option val * This will also be used for post types, that are added to add them to the map * * @since 1.0.0 - * + * */ function update_template_config( $map ){ - + $map_setup = the_template_map(); - + // Use the map config array, and parse against the option value foreach( $map_setup as $hook_id => $hook_info ){ - + if( !isset( $map[$hook_id] ) || !is_array( $map[$hook_id] ) ) $map[$hook_id] = $hook_info; - + // Use the names from the config instead $map[$hook_id]['name'] = $hook_info['name']; $map[$hook_id]['hook'] = $hook_info['hook']; $map[$hook_id]['markup'] = $hook_info['markup']; - + // Go through the sub-templates as well if(isset($hook_info['templates'])){ - + foreach($hook_info['templates'] as $sub_template => $stemplate){ - + if( !isset( $map[$hook_id]['templates'][$sub_template] ) ) $map[$hook_id]['templates'][$sub_template] = $stemplate; - + $map[$hook_id]['templates'][$sub_template]['name'] = $stemplate['name']; - + if(isset($stemplate['page_type'])) $map[$hook_id]['templates'][$sub_template]['page_type'] = $stemplate['page_type']; $map[$hook_id]['templates'][$sub_template]['version'] = ( isset($stemplate['version']) && $stemplate['version'] != '' ) ? $stemplate['version'] : null; - + } - + } } - + foreach( $map['templates']['templates'] as $hook => $h ){ - + if(!isset($map_setup['templates']['templates'][$hook])) unset($map['templates']['templates'][$hook]); - + if(!isset($map_setup['main']['templates'][$hook])) unset($map['main']['templates'][$hook]); - + } - + return $map; - + } - + /** * Callback for resetting the options to default */ function reset_templates_to_default(){ - + update_option(PAGELINES_TEMPLATES, array()); update_option(PAGELINES_TEMPLATE_MAP, the_template_map()); - + } @@ -809,69 +809,69 @@ function reset_templates_to_default(){ function run_before_page(){ } - + function print_on_ready_scripts() { - + foreach( (array) $this->allsections as $sid){ - + /** * If this is a cloned element, remove the clone flag before instantiation here. */ $p = splice_section_slug($sid); $section = $p['section']; $clone_id = $p['clone_id']; - + if( $this->in_factory( $section ) ){ - + $s = $this->factory[$section]; $s->setup_oset( $clone_id ); - + ob_start(); - - $s->section_on_ready( $clone_id ); - + + $s->section_on_ready( $clone_id ); + $scripts = ob_get_clean(); - + if($scripts != ''){ echo sprintf("\n/* %s Script */\n", $this->factory[$section]->name); echo $scripts; } - - } + + } } } - + function print_template_section_head() { - + foreach( (array) $this->allsections as $sid){ - + /** * If this is a cloned element, remove the clone flag before instantiation here. */ $p = splice_section_slug($sid); $section = $p['section']; $clone_id = $p['clone_id']; - + if( $this->in_factory( $section ) ){ - + $s = $this->factory[$section]; $s->setup_oset( $clone_id ); - + ob_start(); - - $s->section_head( $clone_id ); - + + $s->section_head( $clone_id ); + $section_head = ob_get_clean(); - + if($section_head != ''){ echo pl_source_comment($this->factory[$section]->name.' | Section Head'); echo $section_head; } - - } + + } } } - + /** * Runs the options w/ cloning * @@ -880,7 +880,7 @@ function print_template_section_head() { * @since 2.0.b3 */ function load_section_optionator( $mode = 'meta', $type = '' ){ - + // Which sections to load and parse if($mode == 'integration') $parsed_sections = $this->non_template_sections; @@ -888,90 +888,90 @@ function load_section_optionator( $mode = 'meta', $type = '' ){ $parsed_sections = $this->factory; else $parsed_sections = $this->default_allsections; - - // Parse active sections and load tab + + // Parse active sections and load tab foreach( $parsed_sections as $key => $sid ){ - + if($mode == 'default'){ - + $section = $key; $clone_id = 1; - + } else { - + $p = splice_section_slug($sid); $section = $p['section']; $clone_id = $p['clone_id']; - + } - + if(isset($this->factory[$section])){ - + $s = $this->factory[$section]; - + $s->setup_oset( $clone_id ); - + $s->section_optionator( array( 'clone_id' => $clone_id, 'type' => $type ) ); - + } - + } // Load inactive sections last for meta stuff if($mode == 'meta' || $mode == ''){ - + // Get inactive foreach( $this->factory as $key => $section ){ - + $inactive = ( !in_array( $key, $this->default_allsections) ) ? true : false; - + if($inactive) $section->section_optionator( array('clone_id' => 0, 'active' => false, 'type' => $type) ); } - + } - - + + } - - + + /** * Print Section Styles (Hooked to wp_print_styles) * */ function print_template_section_styles(){ - - - + + + if(is_array($this->allsections) && !has_action('override_pagelines_css_output') ){ foreach($this->allsections as $section_slug){ - + $p = splice_section_slug( $section_slug ); - + if($this->in_factory( $p['section'] )) { - + $s = $this->factory[$p['section']]; - + $s->section_styles(); // Auto load style.css for simplicity if its there. if( is_file( $s->base_dir . '/style.css' ) ){ - + wp_register_style( $s->id, $s->base_url . '/style.css', array(), $s->settings['p_ver'], 'screen'); wp_enqueue_style( $s->id ); - + } - - - - } + + + + } } - - + + } - + } - + /** @@ -987,14 +987,14 @@ function print_template_section_scripts(){ $p = splice_section_slug( $section ); if($this->in_factory( $p['section'] )){ - + $section_scripts = $this->factory[$p['section']]->section_scripts(); - - + + if(is_array( $section_scripts )){ - + foreach( $section_scripts as $js_id => $js_atts){ - + $defaults = array( 'version' => '1.0', 'dependancy' => null, @@ -1002,7 +1002,7 @@ function print_template_section_scripts(){ ); $parsed_js_atts = wp_parse_args($js_atts, $defaults); - + wp_register_script($js_id, $parsed_js_atts['file'], $parsed_js_atts['dependancy'], $parsed_js_atts['version'], true); wp_print_scripts($js_id); @@ -1018,12 +1018,12 @@ function print_template_section_scripts(){ /** - * PageLines Template Object + * PageLines Template Object * @global object $pagelines_template * @since 1.0.0 */ -function build_pagelines_template(){ - $GLOBALS['pagelines_template'] = new PageLinesTemplate; +function build_pagelines_template(){ + $GLOBALS['pagelines_template'] = new PageLinesTemplate; } /** @@ -1031,7 +1031,7 @@ function build_pagelines_template(){ * * @since 1.0.0 */ -function save_template_map($templatemap){ +function save_template_map($templatemap){ update_option( PAGELINES_TEMPLATE_MAP, $templatemap); } @@ -1047,7 +1047,7 @@ function pagelines_ob_section_template($section){ Start Output Buffering */ ob_start(); - + /* Run The Section Template */ @@ -1058,7 +1058,7 @@ function pagelines_ob_section_template($section){ */ ob_end_clean(); - + } /** @@ -1066,7 +1066,7 @@ function pagelines_ob_section_template($section){ * @TODO do * */ -function reset_templates_to_default(){ +function reset_templates_to_default(){ PageLinesTemplate::reset_templates_to_default(); } @@ -1079,8 +1079,8 @@ function reset_templates_to_default(){ * * @since 1.0.0 */ -function workaround_pagelines_template_styles(){ - global $pagelines_template; +function workaround_pagelines_template_styles(){ + global $pagelines_template; if(is_object($pagelines_template)){ $pagelines_template->print_template_section_styles(); } @@ -1089,77 +1089,77 @@ function workaround_pagelines_template_styles(){ /* TEMPLATE MAP - + This array controls the default template map of section in the theme - Each top level needs a hook; and the top-level template needs to be included + Each top level needs a hook; and the top-level template needs to be included as an arg in said hook... */ function the_template_map() { - + $template_map = array(); - + $page_templates = the_sub_templates('templates'); $content_templates = the_sub_templates('main'); - + $template_map['header'] = array( - 'hook' => 'pagelines_header', + 'hook' => 'pagelines_header', 'name' => __( 'Site Header', 'pagelines' ), - 'markup' => 'content', + 'markup' => 'content', 'sections' => array( 'PageLinesBranding','PLNavBar','PageLinesSecondNav' ) ); - + $template_map['footer'] = array( - 'hook' => 'pagelines_footer', - 'name' => __( 'Site Footer', 'pagelines' ), - 'markup' => 'content', + 'hook' => 'pagelines_footer', + 'name' => __( 'Site Footer', 'pagelines' ), + 'markup' => 'content', 'sections' => array('SimpleNav') ); - + $template_map['templates'] = array( - 'hook' => 'pagelines_template', - 'name' => __( 'Page Templates', 'pagelines' ), - 'markup' => 'content', + 'hook' => 'pagelines_template', + 'name' => __( 'Page Templates', 'pagelines' ), + 'markup' => 'content', 'templates' => $page_templates, ); - + $template_map['main'] = array( - 'hook' => 'pagelines_main', + 'hook' => 'pagelines_main', 'name' => __( 'Text Content Area', 'pagelines' ), - 'markup' => 'copy', + 'markup' => 'copy', 'templates' => $content_templates, ); - + $template_map['morefoot'] = array( 'name' => __( 'Morefoot Area', 'pagelines' ), 'hook' => 'pagelines_morefoot', - 'markup' => 'content', + 'markup' => 'content', 'version' => 'pro', 'sections' => array() ); - + $template_map['sidebar1'] = array( 'name' => __( 'Sidebar 1', 'pagelines' ), 'hook' => 'pagelines_sidebar1', - 'markup' => 'copy', + 'markup' => 'copy', 'sections' => array('PrimarySidebar') ); - + $template_map['sidebar2'] = array( 'name' => __( 'Sidebar 2', 'pagelines' ), 'hook' => 'pagelines_sidebar2', - 'markup' => 'copy', + 'markup' => 'copy', 'sections' => array('SecondarySidebar') ); - + $template_map['sidebar_wrap'] = array( 'name' => __( 'Sidebar Wrap', 'pagelines' ), 'hook' => 'pagelines_sidebar_wrap', - 'markup' => 'copy', + 'markup' => 'copy', 'version' => 'pro', 'sections' => array() ); - - return apply_filters( PAGELINES_TEMPLATE_MAP, $template_map); + + return apply_filters( PAGELINES_TEMPLATE_MAP, $template_map); } @@ -1169,7 +1169,7 @@ function the_template_map() { * */ function the_sub_templates( $t = 'templates' ){ - + $map = array( 'default' => array( 'name' => __( 'Default', 'pagelines' ), @@ -1247,37 +1247,37 @@ function the_sub_templates( $t = 'templates' ){ 'version' => 'pro', 'page_type' => 'special' ), - - + + ); - + $pt = custom_post_type_handler( $t ); $map = array_merge($map, $pt); return apply_filters('the_sub_templates', $map, $t); - + } /** * Builds a sections for use outside of drag drop setup */ function build_passive_section( $args = array() ){ - + global $passive_sections; - - if(!isset($passive_sections)) + + if(!isset($passive_sections)) $passive_sections = array(); - + $defaults = array( 'sid' => '' ); - + $s = wp_parse_args($args, $defaults); - + $new = array($s['sid']); - + $passive_sections = array_merge($new, $passive_sections); } @@ -1287,48 +1287,48 @@ function build_passive_section( $args = array() ){ */ function custom_post_type_handler( $area = 'main' ){ global $post; - + // Get all 'public' post types $pts = get_post_types( array( 'publicly_queryable' => true ) ); - + if(isset($pts['page'])) unset($pts['page']); - + if(isset($pts['post'])) unset($pts['post']); - + if(isset($pts['attachment'])) unset($pts['attachment']); - + $post_type_array = array(); - + foreach( $pts as $public_post_type ){ - + $dragdrop = apply_filters('pl_cpt_dragdrop', true, $public_post_type, $area); - + if( $dragdrop ){ - + $post_type_data = get_post_type_object( $public_post_type ); $sections = ( $area == 'templates' ) ? 'PageLinesContent' : 'PageLinesPostLoop'; - + $sections_array = apply_filters( 'pl_default_sections', array( $sections ), $area, $public_post_type ); - + $cpt_plural = strtolower(get_post_type_plural( $public_post_type )); - + $post_type_array[ $cpt_plural ] = array( - 'name' => ui_key($cpt_plural), + 'name' => ui_key($cpt_plural), 'sections' => $sections_array ); - + $cpt_single = strtolower($public_post_type); $post_type_array[ $cpt_single ] = array( - 'name' => ui_key($cpt_single), + 'name' => ui_key($cpt_single), 'sections' => $sections_array - ); - } + ); + } } return $post_type_array; } diff --git a/includes/class.themesupport.php b/includes/class.themesupport.php index d360821f..8d856bc8 100644 --- a/includes/class.themesupport.php +++ b/includes/class.themesupport.php @@ -1,4 +1,4 @@ -base_color = $hex; - + $pagelines_base_color = $this->base_color; - + } - + public static function BaseColor( ){ global $pagelines_base_color; - + return (isset($pagelines_base_color)) ? $pagelines_base_color : false; - + } - + public function DisableCoreColor(){ - + $this->Disable( array( 'panel' => 'color_control', 'keep' => false ) ); - + } - + public function DisableCoreType(){ - + $this->Disable( array( 'panel' => 'typography', 'keep' => false ) ); - + } - + public function Disable( $args ){ - + global $disabled_settings; $defaults = array( 'option_id' => false, - 'panel' => '', + 'panel' => '', 'keep' => false ); - + $args = wp_parse_args( $args, $defaults ); - + $disabled_settings[ $args['panel'] ] = $args; - + } - + } /** @@ -72,9 +72,9 @@ public function Disable( $args ){ * */ function pl_is_disabled( $what ){ - + global $disabled_settings; - + if(isset($disabled_settings[$what])) return true; else diff --git a/includes/class.types.php b/includes/class.types.php index 1f566b9e..02788534 100644 --- a/includes/class.types.php +++ b/includes/class.types.php @@ -1,6 +1,6 @@ id = $id; $this->taxonomies = $taxonomies; $this->columns = $columns; $this->columns_display_function = $column_display_function; - + $defaults = array( 'label' => 'Posts', 'singular_label' => 'Post', 'description' => null, - 'public' => false, - 'show_ui' => true, - 'capability_type' => 'post', - 'hierarchical' => false, - 'rewrite' => false, - 'supports' => array( 'title', 'editor', 'thumbnail', 'revisions' ), - 'menu_icon' => PL_ADMIN_IMAGES . '/favicon-pagelines.ico', + 'public' => false, + 'show_ui' => true, + 'capability_type' => 'post', + 'hierarchical' => false, + 'rewrite' => false, + 'supports' => array( 'title', 'editor', 'thumbnail', 'revisions' ), + 'menu_icon' => PL_ADMIN_IMAGES . '/favicon-pagelines.ico', 'taxonomies' => array(), - 'menu_position' => 20, - 'featured_image' => false, - 'has_archive' => false, + 'menu_position' => 20, + 'featured_image' => false, + 'has_archive' => false, 'map_meta_cap' => false, - 'dragdrop' => true, + 'dragdrop' => true, 'load_sections' => false, 'query_var' => true ); - + $this->settings = wp_parse_args($settings, $defaults); // settings for post type $this->register_post_type(); @@ -55,7 +55,7 @@ function __construct($id, $settings, $taxonomies = array(), $columns = array(), $this->register_columns(); $this->featured_image(); $this->section_loading(); - + } /** @@ -64,7 +64,7 @@ function __construct($id, $settings, $taxonomies = array(), $columns = array(), function register_post_type(){ add_action( 'init', array(&$this,'init_register_post_type') ); } - + /** * @@ -72,31 +72,31 @@ function register_post_type(){ * */ function init_register_post_type(){ - + $capability = (ploption('hide_controls_cpt')) ? ploption('hide_controls_cpt') : 'moderate_comments'; - - register_post_type( $this->id , array( + + register_post_type( $this->id , array( 'labels' => array( 'name' => $this->settings['label'], 'singular_name' => $this->settings['singular_label'], - 'add_new' => __('Add New ', 'pagelines') . $this->settings['singular_label'], - 'add_new_item' => __('Add New ', 'pagelines') . $this->settings['singular_label'], + 'add_new' => __('Add New ', 'pagelines') . $this->settings['singular_label'], + 'add_new_item' => __('Add New ', 'pagelines') . $this->settings['singular_label'], 'edit' => __('Edit ', 'pagelines') . $this->settings['singular_label'], - 'edit_item' => __('Edit ', 'pagelines') . $this->settings['singular_label'], + 'edit_item' => __('Edit ', 'pagelines') . $this->settings['singular_label'], 'view' => __('View ', 'pagelines') . $this->settings['singular_label'], 'view_item' => __('View ', 'pagelines') . $this->settings['singular_label'], ), - - 'label' => $this->settings['label'], + + 'label' => $this->settings['label'], 'singular_label' => $this->settings['singular_label'], 'description' => $this->settings['description'], - 'public' => $this->settings['public'], - 'show_ui' => $this->settings['show_ui'], - 'capability_type' => $this->settings['capability_type'], - 'hierarchical' => $this->settings['hierarchical'], - 'rewrite' => $this->settings['rewrite'], - 'supports' => $this->settings['supports'], - 'menu_icon' => $this->settings['menu_icon'], + 'public' => $this->settings['public'], + 'show_ui' => $this->settings['show_ui'], + 'capability_type' => $this->settings['capability_type'], + 'hierarchical' => $this->settings['hierarchical'], + 'rewrite' => $this->settings['rewrite'], + 'supports' => $this->settings['supports'], + 'menu_icon' => $this->settings['menu_icon'], 'taxonomies' => $this->settings['taxonomies'], 'menu_position' => $this->settings['menu_position'], 'has_archive' => $this->settings['has_archive'], @@ -113,11 +113,11 @@ function init_register_post_type(){ 'delete_post' => $capability, 'read_post' => $capability, ), - + )); - + } - + /** * @@ -125,27 +125,27 @@ function init_register_post_type(){ * */ function register_taxonomies(){ - + if( !empty($this->taxonomies) ){ - + foreach($this->taxonomies as $tax_id => $tax_settings){ - + $defaults = array( - 'hierarchical' => true, - 'label' => '', - 'singular_label' => '', + 'hierarchical' => true, + 'label' => '', + 'singular_label' => '', 'rewrite' => true ); - + $a = wp_parse_args($tax_settings, $defaults); - + register_taxonomy( $tax_id, array($this->id), $a ); } - + } - + } - + /** * @@ -157,18 +157,18 @@ function register_columns(){ add_filter( "manage_edit-{$this->id}_columns", array( &$this, 'set_columns' ) ); add_action( "manage_{$this->id}_posts_custom_column", array( &$this, 'set_column_values' ) ); } - + /** * * @TODO document * */ - function set_columns( $columns ){ - - return $this->columns; + function set_columns( $columns ){ + + return $this->columns; } - + /** * @@ -176,11 +176,11 @@ function set_columns( $columns ){ * */ function set_column_values( $wp_column ){ - + call_user_func( $this->columns_display_function, $wp_column ); - + } - + /** * @@ -188,7 +188,7 @@ function set_column_values( $wp_column ){ * */ function set_default_posts( $callback, $object = false){ - + if(!get_posts('post_type='.$this->id)){ if($object) @@ -196,11 +196,11 @@ function set_default_posts( $callback, $object = false){ else call_user_func($callback, $this->id); } - + } - - - + + + /** * @@ -208,15 +208,15 @@ function set_default_posts( $callback, $object = false){ * */ function section_loading(){ - + if( ! $this->settings['dragdrop'] ) add_filter('pl_cpt_dragdrop', array(&$this, 'remove_dragdrop'), 10, 2); - + if ( true === $this->settings['load_sections'] || is_array( $this->settings['load_sections'] ) ) add_filter('pl_template_sections', array(&$this, 'load_sections_for_type'), 10, 3); - + } - + /** * @@ -224,14 +224,14 @@ function section_loading(){ * */ function load_sections_for_type( $sections, $template_type, $hook ){ - + if( $template_type == $this->id || $template_type == get_post_type_plural( $this->id ) ) return $this->settings['load_sections']; else return $sections; - + } - + /** * @@ -245,17 +245,17 @@ function remove_dragdrop( $bool, $post_type ){ return $bool; } - + /** * Is the WP featured image supported */ - function featured_image(){ - + function featured_image(){ + if( $this->settings['featured_image'] ) add_filter('pl_support_featured_image', array(&$this, 'add_featured_image')); } - + /** * @@ -263,10 +263,10 @@ function featured_image(){ * */ function add_featured_image( $support_array ){ - + $support_array[] = $this->id; return $support_array; - + } } @@ -277,14 +277,14 @@ function add_featured_image( $support_array ){ * */ function pl_is_cpt( $type = 'single' ){ - + if( false == ( $currenttype = get_post_type() ) ) return false; - + $std_pt = ( 'post' == $currenttype || 'page' == $currenttype || 'attachment' == $currenttype ) ? true : false; - + $is_type = ( ( $type == 'archive' && is_archive() ) || $type == 'single' ) ? true : false; - + return ( $is_type && !$std_pt ? true : false ); } @@ -295,9 +295,9 @@ function pl_is_cpt( $type = 'single' ){ * */ function get_post_type_plural( $id = null ){ - + if(isset($id)) return $id.'_archive'; else - return get_post_type().'_archive'; + return get_post_type().'_archive'; } diff --git a/includes/class.typography.php b/includes/class.typography.php index f6cf1bd8..c5ecb2ce 100644 --- a/includes/class.typography.php +++ b/includes/class.typography.php @@ -1,4 +1,4 @@ -gfont_base_uri ), '/' ); - // strip http:// and https:// and prepend url with // so ssl works properly + // strip http:// and https:// and prepend url with // so ssl works properly $this->gfont_base_uri = sprintf( '//%s', str_replace( array( 'http://','https://' ), '', $gurl ) ); $this->foundry = $this->get_type_foundry(); } function get_foundry(){ - + foreach($this->foundry as $key => $f){ if($f['google']){ - $gfont = $this->gfont_key($key); + $gfont = $this->gfont_key($key); $this->foundry[$key]['gfont'] = $gfont; $this->foundry[$key]['gfont_uri'] = $this->gfont_base_uri . $gfont; } } return $this->foundry; } - + /** * * @TODO document * */ function get_type_foundry(){ - + $thefoundry = array( 'anton' => array( 'name' => 'Anton', @@ -55,7 +55,7 @@ function get_type_foundry(){ 'family' => 'Arial, "Helvetica Neue", Helvetica, sans-serif', 'web_safe' => true, 'google' => false, - 'monospace' => false, + 'monospace' => false, 'free' => true ), 'arial_black' => array( @@ -98,7 +98,7 @@ function get_type_foundry(){ 'family' => 'Courier, Verdana, sans-serif', 'web_safe' => true, 'google' => false, - 'monospace' => true, + 'monospace' => true, 'free' => true ), 'crimson_text' => array( @@ -134,10 +134,10 @@ function get_type_foundry(){ 'family' => '"Droid Sans", "Lucida Grande", Tahoma, sans-serif', 'web_safe' => true, 'google' => array('regular', 'bold'), - 'monospace' => false, + 'monospace' => false, 'free' => true ), - + 'droid_mono' => array( 'name' => 'Droid Sans Mono', 'family' => '"Droid Sans Mono", Consolas, Monaco, Courier, sans-serif', @@ -157,7 +157,7 @@ function get_type_foundry(){ 'family' => 'Georgia, "Times New Roman", Times, serif', 'web_safe' => true, 'google' => false, - 'monospace' => false, + 'monospace' => false, 'free' => true ), 'happy_monkey' => array( @@ -165,7 +165,7 @@ function get_type_foundry(){ 'family' => '"Happy Monkey", serif', 'web_safe' => true, 'google' => '400', - 'monospace' => false, + 'monospace' => false, ), 'im_fell_dw_pica' => array( 'name' => 'IM Fell DW Pica', @@ -200,7 +200,7 @@ function get_type_foundry(){ 'family' => '"Josefin Sans", "Century Gothic", Verdana, sans-serif', 'web_safe' => true, 'google' => true, - 'monospace' => false, + 'monospace' => false, ), 'kreon' => array( 'name' => 'Kreon', @@ -221,7 +221,7 @@ function get_type_foundry(){ 'family' => 'Lobster, Arial, sans-serif', 'web_safe' => true, 'google' => true, - 'monospace' => false, + 'monospace' => false, 'free' => true ), 'lora' => array( @@ -236,7 +236,7 @@ function get_type_foundry(){ 'family' => 'Merriweather, georgia, times, serif', 'web_safe' => true, 'google' => true, - 'monospace' => false, + 'monospace' => false, 'free' => true ), 'molengo' => array( @@ -272,7 +272,7 @@ function get_type_foundry(){ 'family' => '"Source Sans Pro", "Lucida Grande", Tahoma, sans-serif', 'web_safe' => true, 'google' => array('400','600','700','900','400italic'), - 'monospace' => false, + 'monospace' => false, 'free' => true ), 'reenie_beanie' => array( @@ -294,7 +294,7 @@ function get_type_foundry(){ 'family' => '"Times New Roman", Times, Georgia, serif', 'web_safe' => true, 'google' => false, - 'monospace' => false, + 'monospace' => false, 'free' => true ), 'trebuchet_ms' => array( @@ -302,7 +302,7 @@ function get_type_foundry(){ 'family' => '"Trebuchet MS", "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Arial, sans-serif', 'web_safe' => true, 'google' => false, - 'monospace' => false, + 'monospace' => false, 'free' => true ), 'verdana' => array( @@ -310,7 +310,7 @@ function get_type_foundry(){ 'family' => 'Verdana, sans-serif', 'web_safe' => true, 'google' => false, - 'monospace' => false, + 'monospace' => false, 'free' => true ), 'vollkorn' => array( @@ -360,7 +360,7 @@ function get_type_foundry(){ 'family' => 'Calibri, "Helvetica Neue", Helvetica, Arial, Verdana, sans-serif', 'web_safe' => false, 'google' => false, - 'monospace' => false, + 'monospace' => false, 'free' => true ), 'cambria' => array( @@ -382,7 +382,7 @@ function get_type_foundry(){ 'family' => '"Century Gothic", "Apple Gothic", Verdana, sans-serif', 'web_safe' => false, 'google' => false, - 'monospace' => false, + 'monospace' => false, 'free' => true ), 'century_schoolbook' => array( @@ -390,7 +390,7 @@ function get_type_foundry(){ 'family' => '"Century Schoolbook", Georgia, "Times New Roman", Times, serif', 'web_safe' => false, 'google' => false, - 'monospace' => false, + 'monospace' => false, 'free' => true ), 'consolas' => array( @@ -405,7 +405,7 @@ function get_type_foundry(){ 'family' => 'Constantia, Georgia, "Times New Roman", Times, serif', 'web_safe' => false, 'google' => false, - 'monospace' => false, + 'monospace' => false, 'free' => true ), 'corbel' => array( @@ -427,7 +427,7 @@ function get_type_foundry(){ 'family' => 'Garamond, "Hoefler Text", "Times New Roman", Times, serif', 'web_safe' => false, 'google' => false, - 'monospace' => false, + 'monospace' => false, 'free' => true ), 'gill_sans' => array( @@ -435,14 +435,14 @@ function get_type_foundry(){ 'family' => '"Gill Sans MT", "Gill Sans", Calibri, "Trebuchet MS", sans-serif', 'web_safe' => false, 'google' => false, - 'monospace' => false, + 'monospace' => false, ), 'helvetica' => array( 'name' => 'Helvetica', 'family' => '"Helvetica Neue", Helvetica, Arial, sans-serif', 'web_safe' => false, 'google' => false, - 'monospace' => false, + 'monospace' => false, 'free' => true ), 'hoefler' => array( @@ -486,19 +486,19 @@ function get_type_foundry(){ 'family' => 'Tahoma, Geneva, Verdana, sans-serif', 'web_safe' => false, 'google' => false, - 'monospace' => false, + 'monospace' => false, 'free' => true ) ); - - ksort($thefoundry); + + ksort($thefoundry); return apply_filters('pagelines_foundry', $thefoundry); } - + function needs_import( $font_id ){ return ( isset($this->foundry[$font_id]) && $this->foundry[$font_id]['google'] ) ? true : false; } - + /** * Creates the import URL for google fonts * @@ -506,23 +506,23 @@ function needs_import( $font_id ){ function google_import( $gfonts ) { $family = array(); if( is_array($gfonts) && !empty($gfonts) ){ - + foreach( array_unique($gfonts) as $id ){ if( isset($this->foundry[$id]) && $this->foundry[$id]['google'] ){ - - $faces = ( is_array($this->foundry[$id]['google']) ) ? sprintf( ':%s', implode(',', $this->foundry[$id]['google']) ) : ''; - + + $faces = ( is_array($this->foundry[$id]['google']) ) ? sprintf( ':%s', implode(',', $this->foundry[$id]['google']) ) : ''; + $family[] = urlencode( $this->foundry[$id]['name'] ) . $faces; } } } - - + + if(is_array($family) && !empty($family)){ - + $this->gfont_key = implode('|', $family); $this->gfont_uri = $this->gfont_base_uri . $this->gfont_key; @@ -530,12 +530,12 @@ function google_import( $gfonts ) { $this->gfont_import = sprintf('@import url(%s);%s', $this->gfont_uri, "\n"); return $this->gfont_import; - + } else return false; - + } - + /** * @@ -543,17 +543,17 @@ function google_import( $gfonts ) { * */ function get_the_import( $font ){ - + $family[] = urlencode($this->foundry[$font]['name']) . (is_array($this->foundry[$font]['google']) ? ':' . implode(',', $this->foundry[$font]['google']) : ''); - + $this->gfont_key = implode('|', $family); $this->gfont_uri = $this->gfont_base_uri . $this->gfont_key; $this->gfont_import = sprintf('@import url(%s);', $this->gfont_uri); - + return $this->gfont_import; - + } - + /** * @@ -566,10 +566,10 @@ function gfont_key($font_id){ return implode('|', $gfont_key_array); } else return ''; - - + + } - + /** * @@ -587,7 +587,7 @@ function setup_google_loaders(){ endforeach; endforeach; } - + /** * @@ -600,7 +600,7 @@ function get_stack($font_id){ return $this->foundry[$font_id]['family']; } - + /** * @@ -609,13 +609,13 @@ function get_stack($font_id){ */ function get_type_css($typesettings){ $defaults = array( - 'font' => null, + 'font' => null, 'kern' => '0.00em', - 'transform' => 'none', - 'weight' => 'normal', + 'transform' => 'none', + 'weight' => 'normal', 'variant' => 'normal', - 'style' => 'normal', - 'selectors' => null, + 'style' => 'normal', + 'selectors' => null, 'prepend' => null ); $type_css = ''; @@ -623,27 +623,27 @@ function get_type_css($typesettings){ if(isset($t['font']) && !empty($t['font'])) { $pre = (!empty($t['prepend'])) ? trim(trim($t['prepend']), ',') . ',' : ''; - $type_css = 'font-family:' . $pre . $this->get_stack($t['font']) .';'; + $type_css = 'font-family:' . $pre . $this->get_stack($t['font']) .';'; } - - if( '0.00em' != (string) $t['kern'] ) + + if( '0.00em' != (string) $t['kern'] ) $type_css .= 'letter-spacing:'. $t['kern'] .';'; - if( $t['transform'] != 'none' ) + if( $t['transform'] != 'none' ) $type_css .= 'text-transform:'. $t['transform'] .';'; - if( $t['weight'] != 'normal' ) + if( $t['weight'] != 'normal' ) $type_css .= 'font-weight:'. $t['weight'] .';'; - if( $t['variant'] != 'normal' ) + if( $t['variant'] != 'normal' ) $type_css .= 'font-variant:'. $t['variant'] .';'; - if( $t['style'] != 'normal' ) + if( $t['style'] != 'normal' ) $type_css .= 'font-style:'. $t['style'] .';'; - + return ( isset( $type_css ) ) ? $type_css : ''; } - + /** * @@ -653,53 +653,53 @@ function get_type_css($typesettings){ function render_css(){ $css = ''; foreach (get_option_array() as $mid){ - - foreach($mid as $oid => $o){ - + + foreach($mid as $oid => $o){ + if( isset( $o['type'] ) && $o['type'] == 'typography'){ - + $type = ploption($oid); - + $font_id = $type['font']; - + // Don't render if font isn't set. if(isset($font_id) && isset($this->foundry[$font_id]) ){ - + if($this->foundry[$font_id]['google']) $google_fonts[] = $font_id; - $type_selectors = $o['selectors']; + $type_selectors = $o['selectors']; if( isset($type['selectors']) && !empty($type['selectors']) ) $type_selectors .= ',' . trim(trim($type['selectors']), ','); $type_css = $this->get_type_css($type); - - + + $type_css_keys[] = $type_selectors . '{'.$type_css.'}'; } - + } - + } } - + if(isset($google_fonts) && is_array($google_fonts )){ - + $css .= $this->google_import($google_fonts); - + } - - + + // Render the font CSS if(isset($type_css_keys) && is_array($type_css_keys)){ foreach($type_css_keys as $typeface) $css .= $typeface; - + } - + return $css; - + } } @@ -707,28 +707,28 @@ function render_css(){ function pl_type_el($type_key, $element){ $type = ploption($type_key); - + if(!$type) $type = array(); - + $defaults = array( - 'font' => 'helvetica', + 'font' => 'helvetica', 'kern' => '0.00em', - 'transform' => 'none', - 'weight' => 'normal', + 'transform' => 'none', + 'weight' => 'normal', 'variant' => 'normal', 'style' => 'normal' ); $t = wp_parse_args($type, $defaults); - + if( $element == 'stack' ) $value = get_font_stack($t['font']); else $value = $t[$element]; - + return $value; - + } /** @@ -737,13 +737,13 @@ function pl_type_el($type_key, $element){ * */ function get_font_stack($font_slug){ - + $foundry = new PageLinesFoundry; - + if ( '' == $font_slug || ! array_key_exists( $font_slug, $foundry->foundry ) ) $font_slug = 'helvetica'; - - return $foundry->foundry[$font_slug]['family']; + + return $foundry->foundry[$font_slug]['family']; } /** @@ -752,24 +752,24 @@ function get_font_stack($font_slug){ * */ function load_custom_font($font, $selectors){ - - + + if( $font ){ - + $foundry = new PageLinesFoundry; - + if ( !isset($foundry->foundry[$font]) ) return ''; - + $rule = sprintf('%s{font-family: %s;}', $selectors, $foundry->foundry[$font]['family']); - + $import = ($foundry->foundry[$font]['google']) ? $foundry->get_the_import($font) : ''; - + return sprintf('', $import, $rule); - - }else + + }else return ''; - + } /** @@ -783,11 +783,11 @@ function load_custom_font($font, $selectors){ * @return float - calculated value; default: 24px */ function page_line_height($fontsize, $line_width){ - + $golden = 1.618; - + $lh = $golden - ( 1 / (2*$golden) ) * ( 1 - $line_width/pow(($fontsize*$golden), 2) ); - + return round($lh*$fontsize); - + } diff --git a/includes/class.users.php b/includes/class.users.php index aea621f2..07f7ce0e 100644 --- a/includes/class.users.php +++ b/includes/class.users.php @@ -1,6 +1,6 @@ - true, 'order_field' => 'pl_profile_priority' - + ); $this->args = wp_parse_args($args, $additional_defaults); @@ -39,7 +39,7 @@ function get_users( $args ){ if($this->args['meta_order']) uasort($users, array(&$this, 'order')); - + return $users; } @@ -58,7 +58,7 @@ function order($a, $b){ return 0; return ($ap < $bp) ? -1 : 1; - + } @@ -71,10 +71,10 @@ function order($a, $b){ * */ function pagelines_get_users( $args ){ - + $users = new UserEngine(); $u = $users->get_users($args); - + return $u; } \ No newline at end of file diff --git a/includes/config.selectors.php b/includes/config.selectors.php index 4a4c8580..1ec929fa 100644 --- a/includes/config.selectors.php +++ b/includes/config.selectors.php @@ -1,8 +1,8 @@ $s){ - + if($group == $s['group']) $sel .= ','.$s['sel']; - + } } - + return $sel; - + } - + /** * @@ -54,11 +54,11 @@ function extend_selectors($sel, $group){ * */ function get_groups(){ - + $s = array(); if(!pl_has_editor()){ - + $s['bodybg'] = 'body, body.fixed_width'; $s['pagebg'] = 'body #page .page-canvas'; $s['contentbg'] = '.canvas .page-canvas, .thepage .content, .sf-menu li, #primary-nav ul.sf-menu a:focus, .sf-menu a:hover, .sf-menu a:active, .commentlist ul.children .even'; @@ -69,22 +69,22 @@ function get_groups(){ $s['type_primary'] = 'body, .font1, .font-primary, .commentlist'; $s['type_secondary'] = '.font-sub, ul.main-nav, #secondnav, .metabar, .post-nav, .subtext, .subhead, .widget-title, .reply a, .editpage, #page .wp-pagenavi, .post-edit-link, #wp-calendar caption, #wp-calendar thead th, .soapbox-links a, .fancybox, .standard-form .admin-links, .pagelines-blink, .ftitle small'; $s['type_inputs'] = 'input[type="text"], input[type="password"], textarea, #dsq-content textarea'; - + } - - - + + + return $s; - + } - public function get_css_group( $group ){ - + public function get_css_group( $group ){ + if( is_array($group) ){ - + $sel = ''; - + foreach($group as $g) $sel .= $this->return_group( $g ); @@ -92,9 +92,9 @@ public function get_css_group( $group ){ } else return $this->return_group( $group ); - + } - + /** * @@ -102,14 +102,14 @@ public function get_css_group( $group ){ * */ function return_group( $g ){ - + if( isset( $this->s[ $g ] ) ) return apply_filters('pagelines_css_group', $this->s[ $g ], $g); - else + else return apply_filters('pagelines_css_group_'.$g, ''); - + } - + } /** @@ -118,14 +118,14 @@ function return_group( $g ){ * */ function cssgroup( $group ){ - + global $css_groups; if(!isset($css_groups)) $GLOBALS['css_groups'] = new PageLinesCSSGroups(); $get = $css_groups->get_css_group( $group ); - + return $get; } @@ -138,6 +138,6 @@ function cssgroup( $group ){ function pl_add_selectors( $group, $selectors ){ global $add_selectors; - - $add_selectors[] = array( 'group' => $group, 'sel' => $selectors); + + $add_selectors[] = array( 'group' => $group, 'sel' => $selectors); } \ No newline at end of file diff --git a/includes/config.widgets.php b/includes/config.widgets.php index bc9fdcb3..15ac21e8 100644 --- a/includes/config.widgets.php +++ b/includes/config.widgets.php @@ -8,15 +8,15 @@ // Grand Child Navigation class PageLines_GrandChild extends WP_Widget { - + function PageLines_GrandChild() { $widget_ops = array('description' => __( 'Creates a third tier navigation (Grandchild). Shows on pages when there are three levels; based on page heirarchy.', 'pagelines' ) ); - parent::WP_Widget(false, $name = __('PageLines Pro - Grandchild Nav', 'pagelines'), $widget_ops); + parent::WP_Widget(false, $name = __('PageLines Pro - Grandchild Nav', 'pagelines'), $widget_ops); } - - function widget($args, $instance) { + + function widget($args, $instance) { extract( $args ); - + // THE TEMPLATE global $post; if( isset($post) && property_exists($post, 'ancestors') ) $ancestors_array = $post->ancestors; @@ -25,11 +25,11 @@ function widget($args, $instance) { if( isset($post) && !is_search() && ($post->post_parent && wp_list_pages("title_li=&child_of=".$post->ID."&echo=0")) || count($ancestors_array) >= 2):?>
    -
    +

    - ID); + $subnavpost = get_post($post->ID); $children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0&sort_column=menu_order'); }else{ $reverse_ancestors = array_reverse($ancestors_array); @@ -48,19 +48,19 @@ function widget($args, $instance) {

    ' . __('There are no options for this widget.','pagelines') . '

    '; } - - } - - + + } + + register_widget('PageLines_GrandChild'); } \ No newline at end of file diff --git a/includes/deprecated.php b/includes/deprecated.php index 02cc80aa..82c0253f 100644 --- a/includes/deprecated.php +++ b/includes/deprecated.php @@ -31,17 +31,17 @@ function cmath( $color ) { } function pl_get_theme_data( $stylesheet = null, $header = 'Version') { - + if ( function_exists( 'wp_get_theme' ) ) { return wp_get_theme( basename( $stylesheet ) )->get( $header ); } else { - $data = get_theme_data( sprintf( '%s/themes/%s/style.css', WP_CONTENT_DIR, basename( $stylesheet ) ) ); + $data = get_theme_data( sprintf( '%s/themes/%s/style.css', WP_CONTENT_DIR, basename( $stylesheet ) ) ); return $data[ $header ]; } } function pl_get_themes() { - + if ( ! class_exists( 'WP_Theme' ) ) return get_themes(); @@ -68,7 +68,7 @@ function pl_get_themes() { ); } - return $theme_data; + return $theme_data; } /** * Deprecated constants, removing after a couple of revision, this will ensure store products get time to update. diff --git a/includes/init.globals.php b/includes/init.globals.php index b578244a..37b7cf9d 100644 --- a/includes/init.globals.php +++ b/includes/init.globals.php @@ -1,5 +1,5 @@ - always load require_once( PL_EDITOR . '/editor.functions.php' ); /** - * Load Options Functions + * Load Options Functions */ require_once( PL_INCLUDES . '/library.options.php' ); @@ -124,7 +124,7 @@ /** * Posts Handling - */ + */ require_once( PL_INCLUDES . '/class.posts.php' ); @@ -132,15 +132,15 @@ * Load layout class and setup layout singleton * @global object $pagelines_layout */ -require_once( PL_INCLUDES . '/class.layout.php' ); +require_once( PL_INCLUDES . '/class.layout.php' ); -require_once( PL_INCLUDES . '/library.layout.php' ); +require_once( PL_INCLUDES . '/library.layout.php' ); /** * Users Handling - */ + */ require_once( PL_INCLUDES . '/class.users.php' ); - + /** * Load sections handling class */ @@ -148,7 +148,7 @@ /** * Load template handling class - */ + */ require_once( PL_INCLUDES . '/class.template.php' ); /** @@ -184,14 +184,14 @@ /** * Load Profile Handling - */ + */ require_once( PL_ADMIN . '/class.profiles.php' ); include( PL_INCLUDES . '/library.upgrades.php' ); /** * Load Singleton Globals - */ + */ require_once( PL_INCLUDES . '/init.singleton.php' ); @@ -239,15 +239,15 @@ load_section_persistent(); // Load persistent section functions (e.g. custom post types) -if(is_admin()) +if(is_admin()) load_section_admin(); // Load admin only functions from sections do_global_meta_options(); // Load the global meta settings tab - + /** * Build Version - */ + */ require_once( PL_INCLUDES . '/version.php' ); require_once( PL_INCLUDES . '/class.render.css.php' ); @@ -269,7 +269,7 @@ if ( is_admin() ) include( PL_ADMIN . '/init.admin.php' ); - + /** * Load updater class */ diff --git a/includes/init.singleton.php b/includes/init.singleton.php index df8ec1dc..182d7c3f 100644 --- a/includes/init.singleton.php +++ b/includes/init.singleton.php @@ -9,13 +9,13 @@ * Sets default global settings -- NOTE only fires first time */ if(!get_option(PAGELINES_SETTINGS)) - add_option( PAGELINES_SETTINGS, pagelines_settings_defaults() ); + add_option( PAGELINES_SETTINGS, pagelines_settings_defaults() ); /** * Set options globals, cache? */ -$GLOBALS['global_pagelines_settings'] = get_option( PAGELINES_SETTINGS ); -$GLOBALS['pagelines_special_meta'] = get_option( PAGELINES_SPECIAL ); +$GLOBALS['global_pagelines_settings'] = get_option( PAGELINES_SETTINGS ); +$GLOBALS['pagelines_special_meta'] = get_option( PAGELINES_SPECIAL ); /** * Singleton >> Integrations Handling diff --git a/includes/less.functions.php b/includes/less.functions.php index fe3e2b02..e39b48b8 100644 --- a/includes/less.functions.php +++ b/includes/less.functions.php @@ -9,7 +9,7 @@ * */ class PageLinesLess { - + private $lparser = null; public $constants = ''; @@ -20,15 +20,15 @@ class PageLinesLess { * @uses page_line_height - calculates a line height relevant to font-size and content width */ function __construct() { - + global $less_vars; - + $this->base_color = pl_hashify( pl_base_color() ); - + /* Type */ $fontsize = 15; $content_width = 600; - + // PageLines Variables $constants = array( 'plRoot' => sprintf( "\"%s\"", PL_PARENT_URL ), @@ -36,29 +36,29 @@ function __construct() { 'plPluginsRoot' => sprintf( "\"%s\"", WP_PLUGIN_URL ), 'plChildRoot' => sprintf( "\"%s\"", PL_CHILD_URL ), 'plExtendRoot' => sprintf( "\"%s\"", PL_EXTEND_URL ), - 'pl-base' => $this->base_color, - 'pl-text' => pl_hashify( pl_text_color() ), + 'pl-base' => $this->base_color, + 'pl-text' => pl_hashify( pl_text_color() ), 'pl-link' => pl_hashify( pl_link_color() ), 'pl-header' => pl_hashify( pl_header_color() ), 'pl-footer' => pl_hashify( pl_footer_color() ), 'pl-min-height' => '400px', 'invert-dark' => $this->invert(), 'invert-light' => $this->invert( 'light' ), - 'font-size' => $fontsize . 'px', + 'font-size' => $fontsize . 'px', 'line-height' => page_line_height( $fontsize, $content_width ) . 'px', 'pl-page-width' => pl_page_width() . 'px', 'pl-content-width' => pl_content_width() . 'px', 'pl-responsive-width' => round( pl_responsive_width(), 2 ) . '%', 'pl-sidebar-width' => pl_sidebar_width() . 'px', 'pl-secondary-width' => pl_secondary_sidebar_width() . 'px' - ); - + ); + if(is_array($less_vars)) $constants = array_merge($less_vars, $constants); - + $constants = array_merge($this->type_vars(), $constants); - - $this->constants = apply_filters('pless_vars', $constants); + + $this->constants = apply_filters('pless_vars', $constants); } /** @@ -68,72 +68,72 @@ function __construct() { * @param $lesscode */ public function type_vars( ){ - + global $disabled_settings; $alt = ( is_array( $disabled_settings ) && !empty( $disabled_settings['typography'] ) ) ? true : false; - + $default_font = '"Helvetica", Arial, serif'; - - $vars = array(); - + + $vars = array(); + if(pl_has_editor() ) - $vars['plBaseFont'] = array(); - - + $vars['plBaseFont'] = array(); + + $vars = array( - 'plBaseFont' => pl_type_el('type_primary', 'stack'), - 'plBaseWeight' => pl_type_el('type_primary', 'weight'), - 'plAltFont' => pl_type_el('type_secondary', 'stack'), - 'plAltWeight' => pl_type_el('type_secondary', 'weight'), - 'plHeaderFont' => pl_type_el('type_headers', 'stack'), + 'plBaseFont' => pl_type_el('type_primary', 'stack'), + 'plBaseWeight' => pl_type_el('type_primary', 'weight'), + 'plAltFont' => pl_type_el('type_secondary', 'stack'), + 'plAltWeight' => pl_type_el('type_secondary', 'weight'), + 'plHeaderFont' => pl_type_el('type_headers', 'stack'), 'plHeaderWeight' => pl_type_el('type_headers', 'weight'), ); - + if($alt){ $vars['plBaseFont'] = $default_font; $vars['plAltFont'] = $default_font; $vars['plHeaderFont'] = $default_font; } - + return $vars; - + } - - public function raw_less( $lesscode, $type = 'core' ) { + + public function raw_less( $lesscode, $type = 'core' ) { return $this->raw_parse($lesscode, $type); } private function raw_parse( $pless, $type ) { - if( ! class_exists( 'lessc' ) ) + if( ! class_exists( 'lessc' ) ) require_once( PL_INCLUDES . '/less.plugin.php' ); if( ! $this->lparser ) $this->lparser = new lessc(); $pless = $this->add_constants( '' ) . $this->add_bootstrap() . $pless; - - try { + + try { $css = $this->lparser->compile( $pless ); - } catch ( Exception $e) { + } catch ( Exception $e) { plupop( "pl_less_error_{$type}", $e->getMessage() ); return sprintf( "/* LESS PARSE ERROR in your %s CSS: %s */\r\n", ucfirst( $type ), $e->getMessage() ); } - + // were good! plupop( "pl_less_error_{$type}", false ); - return $css; + return $css; } function add_bootstrap( ) { $less = ''; - + $less .= $this->load_less_file( 'variables' ); $less .= $this->load_less_file( 'colors' ); $less .= $this->load_less_file( 'mixins' ); - + return $less; } @@ -153,28 +153,28 @@ function load_less_file( $file ) { private function add_core_less($pless){ - + global $disabled_settings; - + $add_color = (isset($disabled_settings['color_control'])) ? false : true; - $color = ($add_color) ? pl_get_core_less() : ''; - return $pless . $color; + $color = ($add_color) ? pl_get_core_less() : ''; + return $pless . $color; } function add_constants( $pless ) { - + $prepend = ''; - + foreach($this->constants as $key => $value) $prepend .= sprintf('@%s:%s;%s', $key, $value, "\n"); - - return $prepend . $pless; + + return $prepend . $pless; } - + private function invert( $mode = 'dark', $delta = 5 ){ - + if($mode == 'light'){ - + if($this->color_detect() == -2) return 2*$delta; elseif($this->color_detect() == -1) @@ -183,7 +183,7 @@ private function invert( $mode = 'dark', $delta = 5 ){ return -1.7*$delta; else return $delta; - + }else{ if($this->color_detect() == -2) return -(2*$delta); @@ -202,18 +202,18 @@ private function invert( $mode = 'dark', $delta = 5 ){ * @return bool|int - a numeric value used in invert() */ function color_detect(){ - - $hex = str_replace('#', '', $this->base_color); + + $hex = str_replace('#', '', $this->base_color); $r = hexdec(substr($hex,0,2)); $g = hexdec(substr($hex,2,2)); $b = hexdec(substr($hex,4,2)); - + if($r + $g + $b > 750){ - + // Light return 1; - + }elseif($r + $g + $b < 120){ // Really Dark @@ -221,42 +221,42 @@ function color_detect(){ } elseif($r + $g + $b < 300){ - + // Dark return -1; - + }else{ - + // Meh return false; - + } } } -/* +/* * Add Less Variables - * + * * Must be added before header. **************************/ function pagelines_less_var( $name, $value ){ - + global $less_vars; - + $less_vars[$name] = $value; - + } -/* +/* * Color Fetch **************************/ function pl_base_color( $mode = '', $difference = '10%'){ - + $base_color = PageLinesThemeSupport::BaseColor(); if( !$base_color ){ - + if( pl_check_color_hash( ploption('contentbg' ) ) ) $base = pl_hash_strip( ploption('contentbg') ); elseif( pl_check_color_hash( ploption('pagebg' ) ) ) @@ -265,19 +265,19 @@ function pl_base_color( $mode = '', $difference = '10%'){ $base = pl_hash_strip( ploption('bodybg') ); else $base = 'FFFFFF'; - + } else $base = $base_color; - - + + if($mode != ''){ - + $adjust_base = new PageLinesColor($base); - + $adjusted = $adjust_base->c($mode, $difference); - + return $adjusted; - + } else return $base; } @@ -291,11 +291,11 @@ function pl_base_color( $mode = '', $difference = '10%'){ * @return bool|string - background color value */ function pl_bg_color(){ - + if( pl_check_color_hash( get_set_color( 'the_bg' ) ) ) return get_set_color( 'the_bg' ); - else - return 'FFFFFF'; + else + return 'FFFFFF'; } /** @@ -306,7 +306,7 @@ function pl_bg_color(){ * @return mixed|string - text color value */ function pl_text_color(){ - + $color = ( pl_check_color_hash( ploption( 'text_primary' ) ) ) ? pl_hash_strip( ploption( 'text_primary' ) ) : '000000'; return $color; @@ -320,10 +320,10 @@ function pl_text_color(){ * @return mixed|string - link color */ function pl_link_color(){ - + $color = ( pl_check_color_hash( ploption( 'linkcolor' ) ) ) ? pl_hash_strip( ploption( 'linkcolor' ) ) : '225E9B'; - - return $color; + + return $color; } /** @@ -334,10 +334,10 @@ function pl_link_color(){ * @return mixed|string - header color */ function pl_header_color(){ - + $color = ( pl_check_color_hash( ploption( 'headercolor' ) ) ) ? pl_hash_strip( ploption( 'headercolor' ) ) : '000000'; - - return $color; + + return $color; } /** @@ -348,23 +348,23 @@ function pl_header_color(){ * @return mixed|string */ function pl_footer_color(){ - + $color = ( pl_check_color_hash( ploption( 'footer_text' ) ) ) ? pl_hash_strip( ploption( 'footer_text' ) ) : '999999'; - + return $color; } -/* +/* * Helpers **************************/ function pl_hash_strip( $color ){ - + return str_replace('#', '', $color); } function pl_check_color_hash( $color ) { - - if ( preg_match( '/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/', $color ) ) + + if ( preg_match( '/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/', $color ) ) return true; else return false; @@ -380,8 +380,8 @@ function pl_check_color_hash( $color ) { * @return string */ function pl_hashify( $color ){ - + $clean_hex = str_replace('#', '', $color); - + return sprintf('#%s', $clean_hex); } \ No newline at end of file diff --git a/includes/library.extend.php b/includes/library.extend.php index a0f4d150..c71090c0 100644 --- a/includes/library.extend.php +++ b/includes/library.extend.php @@ -1,13 +1,13 @@ 'Template Name' ) ); if ( is_array( $data ) ) pagelines_add_page( $match[1], $data['name'] ); - } + } } } } @@ -97,23 +97,23 @@ function base_check_templates() { * */ function pagelines_try_api( $url, $args ) { - - $defaults = array( + + $defaults = array( 'sslverify' => false, 'timeout' => 5, 'body' => array() ); - - $options = wp_parse_args( $args, $defaults ); + + $options = wp_parse_args( $args, $defaults ); $prot = array( 'https://', 'http://' ); - - foreach( $prot as $type ) { + + foreach( $prot as $type ) { // sometimes wamp does not have curl! if ( $type === 'https://' && !function_exists( 'curl_init' ) ) continue; $r = wp_remote_post( $type . $url, $options ); if ( !is_wp_error($r) && is_array( $r ) ) { - return $r; + return $r; } } return false; @@ -139,7 +139,7 @@ function pagelines_store_object_sort( $object ) { $object->$name = (object) $value; } } - return $object; + return $object; } else { return FALSE; diff --git a/includes/library.functions.php b/includes/library.functions.php index b888b321..7ecc8f96 100644 --- a/includes/library.functions.php +++ b/includes/library.functions.php @@ -11,7 +11,7 @@ */ function pl_is_integration(){ global $pl_integration; - + return (isset($pl_integration) && $pl_integration) ? true : false; } @@ -22,7 +22,7 @@ function pl_is_integration(){ */ function pl_get_integration(){ global $pl_integration; - + return (isset($pl_integration) && $pl_integration) ? sprintf('%s', $pl_integration) : false; } @@ -31,8 +31,8 @@ function pl_get_integration(){ * * @since 2.0.0 */ -function pagelines_is_posts_page(){ - if(is_home() || is_search() || is_archive() || is_category() || is_tag()) return true; +function pagelines_is_posts_page(){ + if(is_home() || is_search() || is_archive() || is_category() || is_tag()) return true; else return false; } @@ -43,7 +43,7 @@ function pagelines_is_posts_page(){ * */ function pagelines_non_meta_data_page(){ - if(pagelines_is_posts_page() || is_404()) return true; + if(pagelines_is_posts_page() || is_404()) return true; else return false; } @@ -53,10 +53,10 @@ function pagelines_non_meta_data_page(){ * * A few conditional functions that were being used were unnecessary * (is_author, is_category, & is_tag) as these are all covered by is_archive - * + * * $special_types should be a filterable array to allow ploption to be used for extended special option values, * or anytime the passed $args['type'] would be used/compared (in admin) - * + * * Filterable return value - could be used for example to return false for the blog home, * letting the page meta values take precedence instead of the special. Just a thought. * @@ -65,16 +65,16 @@ function is_pagelines_special( $args = array() ) { $special_types = apply_filters( 'pagelines_special_types', array('posts','archive','category','search','tag','author','404_page') ); - if ( is_404() || is_home() || is_search() || is_archive() ) + if ( is_404() || is_home() || is_search() || is_archive() ) $special = true; - elseif ( isset( $args['type'] ) && in_array( $args['type'], $special_types ) ) + elseif ( isset( $args['type'] ) && in_array( $args['type'], $special_types ) ) $special = true; elseif ( pl_is_integration() ) $special = true; - else + else $special = false; return apply_filters( 'is_pagelines_special', $special, $args ); @@ -98,19 +98,19 @@ function pagelines_special_pages(){ * */ function pl_meta_set_url( $tab = null ){ - - global $post; - + + global $post; + $tab = (isset($tab)) ? '#'.$tab : ''; - + $url = (is_pagelines_special()) ? admin_url(PL_SPECIAL_OPTS_URL) : get_edit_post_link( $post->ID ); - + return $url.$tab; } /** * PageLines Body Classes - * + * * Sets up classes for controlling design and layout and is used on the body tag * * @package PageLines Framework @@ -126,32 +126,32 @@ function pl_meta_set_url( $tab = null ){ * @return string $body_classes - PageLines default body classes */ function pagelines_body_classes(){ - + global $pagelines_template; - + $special_body_class = (ploption('special_body_class')) ? ploption('special_body_class') : ''; - + $canvas_shadow = (ploption('canvas_shadow')) ? 'content-shadow' : ''; - + $responsive = (ploption('layout_handling') == 'pixels' || ploption('layout_handling') == 'percent') ? 'responsive' : 'static'; - + $design_mode = (ploption('site_design_mode') && !pl_is_disabled('color_control')) ? ploption('site_design_mode') : 'full_width'; $body_classes = sprintf( - 'custom %s %s %s %s %s %s', - $canvas_shadow, - $responsive, - strtolower( PL_CHILDTHEMENAME ), - $pagelines_template->template_type, - $design_mode, + 'custom %s %s %s %s %s %s', + $canvas_shadow, + $responsive, + strtolower( PL_CHILDTHEMENAME ), + $pagelines_template->template_type, + $design_mode, $special_body_class ); - + global $pagelines_addclasses; - + if ( isset( $pagelines_addclasses ) ) - $body_classes .= sprintf( ' %s', $pagelines_addclasses ); - + $body_classes .= sprintf( ' %s', $pagelines_addclasses ); + return $body_classes; } @@ -162,19 +162,19 @@ function pagelines_body_classes(){ * */ function pagelines_add_bodyclass( $class ) { - + global $pagelines_addclasses; - + if ( !isset( $pagelines_addclasses ) ) $pagelines_addclasses = ''; - + if ( isset( $class ) ) - $pagelines_addclasses .= sprintf( ' %s', $class ); - + $pagelines_addclasses .= sprintf( ' %s', $class ); + } /** - * + * * Sets up global post ID and $post global for handling, reference and consistency * * @package PageLines Framework @@ -189,13 +189,13 @@ function pagelines_id_setup(){ if(isset($post) && is_object($post)){ $pagelines_ID = $post->ID; - $pagelines_post = $post; + $pagelines_post = $post; } else { $pagelines_post = ''; $pagelines_ID = ''; } - + } /** @@ -217,7 +217,7 @@ function pagelines_register_hook( $hook_name, $hook_area_id = null){ /** Do The Hook */ do_action( $hook_name, $hook_name, $hook_area_id); - + } /** @@ -316,8 +316,8 @@ function pagelines_shorturl( $url, $timeout = 86400 ) { // Check the body from the api is actually a url and not a 400 error // If its OK we will cache it and return it, othwise return original url - - $out = ( $response['response']['code'] == 200 ) ? $response['body'] : false; + + $out = ( $response['response']['code'] == 200 ) ? $response['body'] : false; if ( !is_object( $out = json_decode( $out ) ) ) return pagelines_format_tweet( get_the_title(), $url ); if ( $cache == false ) { @@ -357,20 +357,20 @@ function pagelines_format_tweet( $title, $url ) { * @return mixed|void */ function pl_background_cascade(){ - + $cascade = array( ploption('contentbg'), ploption('pagebg'), ploption('bodybg'), '#ffffff' ); - + return apply_filters('background_cascade', $cascade); } /** * PageLines Body Background - * + * * Body Background - default: White * * @uses ploption @@ -381,9 +381,9 @@ function pl_background_cascade(){ * @return mixed|void */ function pl_body_bg(){ - + $cascade = array( ploption('bodybg'), '#ffffff' ); - + return apply_filters('body_bg', $cascade); } @@ -398,8 +398,8 @@ function pl_body_bg(){ * @param string $t - input string * @return mixed */ -function plstrip( $t ){ - +function plstrip( $t ){ + if( is_pl_debug() ) return $t; @@ -465,10 +465,10 @@ function show_query_analysis(){ * @return string - concatenated with an ellipsis */ function custom_trim_excerpt($text, $length) { - + $text = strip_shortcodes( $text ); // optional $text = strip_tags($text); - + $words = explode(' ', $text, $length + 1); if ( count($words) > $length) { array_pop($words); @@ -476,7 +476,7 @@ function custom_trim_excerpt($text, $length) { } return $text.' […]'; } - + @@ -488,14 +488,14 @@ function custom_trim_excerpt($text, $length) { */ function pagelines_add_page($file, $name){ global $pagelines_user_pages; - + $pagelines_user_pages[$file] = array('name' => $name); - + } /** * Used for Callback calls, returns nothing - * + * * @since 1.0.0 */ function pagelines_setup_menu() { @@ -506,7 +506,7 @@ function pagelines_setup_menu() { * Setup PageLines Template * * Includes the loading template that sets up all PageLines templates - * + * * @since 1.1.0 * * @link http://www.pagelines.com/wiki/Setup_pagelines_template @@ -514,16 +514,16 @@ function pagelines_setup_menu() { * @uses pagelines_template_area */ function setup_pagelines_template() { - - + + // if not true, then a non pagelines template is being rendered (wrap with .content) $GLOBALS['pagelines_render'] = true; - + get_header(); if(!has_action('override_pagelines_body_output')) pagelines_template_area('pagelines_template', 'templates'); - + get_footer(); } @@ -542,19 +542,19 @@ function setup_pagelines_template() { */ function pagelines_add_page_callback( $page_array, $template_area ){ global $pagelines_user_pages; - + if( is_array($pagelines_user_pages) ){ foreach($pagelines_user_pages as $file => $pageinfo){ $page_array[$file] = array('name'=>$pageinfo['name']); } } - + return $page_array; } /** * Overrides default excerpt handling so we have more control - * + * * @since 1.2.4 */ remove_filter('get_the_excerpt', 'wp_trim_excerpt'); @@ -566,9 +566,9 @@ function pagelines_add_page_callback( $page_array, $template_area ){ * */ function improved_trim_excerpt($text) { - + // Group options at top :) - + if(pl_has_editor()){ $allowed_tags = (pl_setting('excerpt_tags')) ? pl_setting('excerpt_tags') : ''; $excerpt_len = (pl_setting('excerpt_len')) ? pl_setting('excerpt_len') : 55; @@ -576,8 +576,8 @@ function improved_trim_excerpt($text) { $allowed_tags = (ploption('excerpt_tags')) ? ploption('excerpt_tags') : ''; $excerpt_len = (ploption('excerpt_len')) ? ploption('excerpt_len') : 55; } - - + + $raw_excerpt = $text; if ( '' == $text ) { $text = get_the_content(''); @@ -586,26 +586,26 @@ function improved_trim_excerpt($text) { $text = apply_filters('the_content', $text); - + $text = preg_replace('@]*?>.*?@si', '', $text); // PageLines - Strip JS - + $text = str_replace(']]>', ']]>', $text); - + $text = strip_tags($text, $allowed_tags); // PageLines - allow more tags - + $excerpt_length = apply_filters('excerpt_length', $excerpt_len ); $excerpt_more = apply_filters('excerpt_more', ' ' . '[...]'); - + $words = preg_split('/[\n\r\t ]+/', $text, $excerpt_length + 1, PREG_SPLIT_NO_EMPTY); - + if ( count($words) > $excerpt_length ) { array_pop($words); $text = implode(' ', $words); $text = $text . $excerpt_more; } else $text = implode(' ', $words); - + } return apply_filters('wp_trim_excerpt', $text, $raw_excerpt); } @@ -616,7 +616,7 @@ function improved_trim_excerpt($text) { * @param int|object $post_or_id can be the post ID, or the actual $post object itself * @param int $words the amount of words to allow * @param string $excerpt_more the text that is applied to the end of the excerpt if we algorithically snip it - * @return string the snipped excerpt or the manual excerpt if it exists + * @return string the snipped excerpt or the manual excerpt if it exists */ function pl_short_excerpt($post_or_id, $words = 10, $excerpt_more = ' [...]') { @@ -652,7 +652,7 @@ function pl_short_excerpt($post_or_id, $words = 10, $excerpt_more = ' [...]') { /** * PageLines Nav Classes - * + * * Returns nav menu class `sf-menu` which will allow the "superfish" JavaScript to work * * @package PageLines Framework @@ -664,18 +664,18 @@ function pl_short_excerpt($post_or_id, $words = 10, $excerpt_more = ' [...]') { * * @return string - CSS classes */ -function pagelines_nav_classes(){ - +function pagelines_nav_classes(){ + $additional_menu_classes = ''; - + if(ploption('enable_drop_down')) $additional_menu_classes .= ' sf-menu'; - + return $additional_menu_classes; } /** - * + * * Loads Special PageLines CSS Files, Optimized * * @package PageLines Framework @@ -683,13 +683,13 @@ function pagelines_nav_classes(){ * @since 1.2.0 * */ -function pagelines_draw_css( $css_url, $id = '', $enqueue = false){ +function pagelines_draw_css( $css_url, $id = '', $enqueue = false){ echo ''."\n"; } /** - * + * * Abstracts the Enqueue of Stylesheets, fixes bbPress issues with dropping hooks * * @package PageLines Framework @@ -697,7 +697,7 @@ function pagelines_draw_css( $css_url, $id = '', $enqueue = false){ * */ function pagelines_load_css( $css_url, $id, $hash = PL_CORE_VERSION, $enqueue = true){ - + if(pagelines_bbpress_forum()){ printf('%s', $id, $css_url, $hash, "\n"); } else { @@ -708,7 +708,7 @@ function pagelines_load_css( $css_url, $id, $hash = PL_CORE_VERSION, $enqueue = } /** - * + * * Loading CSS using relative path to theme root. This allows dynamic versioning, overriding in child theme * * @package PageLines Framework @@ -716,28 +716,28 @@ function pagelines_load_css( $css_url, $id, $hash = PL_CORE_VERSION, $enqueue = * */ function pagelines_load_css_relative( $relative_style_url, $id){ - + $rurl = '/' . $relative_style_url; - + if( is_file(get_stylesheet_directory() . $rurl ) ){ - + $cache_ver = pl_cache_version( get_stylesheet_directory() . $rurl ); - + pagelines_load_css( PL_CHILD_URL . $rurl , $id, $cache_ver); - + } elseif(is_file(get_template_directory() . $rurl) ){ - - $cache_ver = pl_cache_version( get_template_directory() . $rurl ); - + + $cache_ver = pl_cache_version( get_template_directory() . $rurl ); + pagelines_load_css( PL_PARENT_URL . $rurl , $id, $cache_ver); - - } - + + } + } /** - * + * * Get cache version number * * @@ -745,12 +745,12 @@ function pagelines_load_css_relative( $relative_style_url, $id){ function pl_cache_version( $path, $version = PL_CORE_VERSION ){ $date_modified = filemtime( $path ); $cache_ver = str_replace('.', '', $version) . '-' . date('mdGis', $date_modified); - + return $cache_ver; } /** - * + * * Get Stylesheet Version * * @package PageLines Framework @@ -758,11 +758,11 @@ function pl_cache_version( $path, $version = PL_CORE_VERSION ){ * */ function pagelines_get_style_ver( $tpath = false ){ - + // Get cache number that accounts for edits to base.css or style.css if( is_file(get_stylesheet_directory() .'/base.css') && !$tpath ){ $date_modified = filemtime( get_stylesheet_directory() .'/base.css' ); - $cache_ver = str_replace('.', '', PL_CHILD_VERSION) . '-' . date('mdGis', $date_modified); + $cache_ver = str_replace('.', '', PL_CHILD_VERSION) . '-' . date('mdGis', $date_modified); } elseif(is_file(get_stylesheet_directory() .'/style.css') && !$tpath ){ $date_modified = filemtime( get_stylesheet_directory() .'/style.css' ); $cache_ver = str_replace('.', '', PL_CORE_VERSION) .'-'.date('mdGis', $date_modified); @@ -772,8 +772,8 @@ function pagelines_get_style_ver( $tpath = false ){ } else { $cache_ver = PL_CORE_VERSION; } - - + + return $cache_ver; } @@ -781,27 +781,27 @@ function pagelines_get_style_ver( $tpath = false ){ /** * Debugging, prints nice array. * Sends to the footer in all cases. - * + * * @since 1.5.0 */ function plprint( $data, $title = false, $echo = false) { - + if ( ! is_pl_debug() || ! current_user_can('manage_options') ) return; - + ob_start(); - + echo '
    ';
    - 
    +
     		if ( $title )
     			printf('

    %s

    ', $title); - + echo esc_html( print_r( $data, true ) ); - + echo '
    '; - + $data = ob_get_clean(); - + if ( $echo ) echo $data; elseif ( false === $echo ) @@ -811,17 +811,17 @@ function plprint( $data, $title = false, $echo = false) { } function plcomment( $data, $title = 'DEBUG', $type = 'html' ) { - - + + if( is_pl_debug() ){ $open = ( 'html' == $type ) ? "\n\n" : "*/\n"; - + $close = ( 'html' == $type ) ? " -->\n" : "*/\n"; + $pre = sprintf( '%s START %s %s', $open, $title, $close ); $post = sprintf( '%s END %s %s', $open, $title, $close ); - + return $pre . $data . $post; - + } else { return $data; } @@ -860,7 +860,7 @@ function pagelines_make_uploads($txt = 'Load'){ * Since 2.0 */ function pagelines_register_plugins() { - + $pagelines_plugins = array(); $plugins = get_option('active_plugins'); if ( $plugins ) { @@ -878,7 +878,7 @@ function pagelines_register_plugins() { /** * * Return sorted array based on supplied key - * + * * @since 2.0 * @return sorted array */ @@ -900,12 +900,12 @@ function pagelines_array_sort( $a, $subkey, $pre = null, $dec = null ) { /** * * Polishes a Key for UI presentation - * + * * @since 2.0 * @return String */ function ui_key($key){ - + return ucwords( str_replace( '_', ' ', str_replace( 'pl_', ' ', $key) ) ); } @@ -913,17 +913,17 @@ function ui_key($key){ * * Return latest tweet as (array) or single tweet text. * Tweets are stored in the db - * + * * @since 2.0b13 * @return array */ function pagelines_get_tweets( $username, $latest = null) { - + // Fetch the tweets from the db // Set the array into a transient for easy reuse // If we get an error store it. - + if ( false === ( $tweets = get_transient( 'section-twitter-' . $username ) ) ) { $params = array( 'screen_name'=>$username, // Twitter account name @@ -961,22 +961,22 @@ function pagelines_get_tweets( $username, $latest = null) { // We should have a list of tweets for $username or an error code to return. if ( 'error' != $tweets ) { // Tweets are good, return the array or a single if asked for ($latest) - + if ( $latest && is_array( $tweets ) && isset( $tweets[0]['text'] ) ) return $tweets[0]['text']; elseif ( is_array( $latest ) ) - return $latest; + return $latest; } else { - + // We couldnt get the tweets so lets cycle through the possible errors. - - $error = get_transient( 'section-twitter-response-code-' . $username ); + + $error = get_transient( 'section-twitter-response-code-' . $username ); switch( $error ) { case 401: $text = wp_kses( sprintf( __( "Error: Please make sure the Twitter account is public.", 'pagelines' ), 'http://support.twitter.com/forums/10711/entries/14016' ), array( 'a' => array( 'href' => true ) ) ); break; - + case 403: $text = __( 'Error 403: Your IP is being rate limited by Twitter.', 'pagelines' ); break; @@ -997,8 +997,8 @@ function pagelines_get_tweets( $username, $latest = null) { $text = __( 'Unknown Twitter error.', 'pagelines' ); break; } - return $text; - } + return $text; + } } @@ -1018,9 +1018,9 @@ function pagelines_tweet_clickable( $tweet ) { $regex = '/\#([a-zA-Z0-9_]*)/'; $link_pattern = '#$1'; $tweet = preg_replace($regex,$link_pattern,$tweet); - + return $tweet; - + } @@ -1031,9 +1031,9 @@ function pagelines_tweet_clickable( $tweet ) { */ function pl_admin_is_page(){ global $post; - + if( (isset($_GET['post_type']) && $_GET['post_type'] == 'page') || (isset($post) && $post->post_type == 'page') ) - return true; + return true; else return false; @@ -1048,7 +1048,7 @@ function pl_admin_is_page(){ function pl_file_get_contents( $filename ) { if ( is_file( $filename ) ) { - + $file = file( $filename, FILE_SKIP_EMPTY_LINES ); $out = ''; if( is_array( $file ) ) @@ -1058,7 +1058,7 @@ function pl_file_get_contents( $filename ) { if( $out ) return $out; else - return false; + return false; } } @@ -1069,20 +1069,20 @@ function pl_file_get_contents( $filename ) { * */ function pl_detect_ie( $version = false ) { - + global $is_IE; if ( ! $version && $is_IE ) { - + return round( substr($_SERVER['HTTP_USER_AGENT'], strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') + 5, 3) ); } - + if ( $is_IE && is_int( $version ) && stristr( $_SERVER['HTTP_USER_AGENT'], sprintf( 'msie %s', $version ) ) ) return true; else return false; } -/** +/** * Search in an array, return full info. */ function array_search_ext($arr, $search, $exact = true, $trav_keys = null) @@ -1117,7 +1117,7 @@ function pagelines_register_sidebar( $args, $priorty = null ) { register_sidebar( $args ); } -/** +/** * Insert into array at a position. * * @param $orig array Original array. @@ -1126,7 +1126,7 @@ function pagelines_register_sidebar( $args, $priorty = null ) { * @return array */ function pl_insert_into_array( $orig, $new, $offset ) { - + $newArray = array_slice($orig, 0, $offset, true) + $new + array_slice($orig, $offset, NULL, true); @@ -1134,7 +1134,7 @@ function pl_insert_into_array( $orig, $new, $offset ) { } -/** +/** * Insert into array before or after a key. * * @param $array array Original array. @@ -1166,98 +1166,98 @@ function pl_array_insert( $array, $key, $insert_array, $before = FALSE ) { return $new_array; } -/** +/** * Display a banner if suppoerted plugin is detected during template_redirect. * */ function pl_check_integrations() { - + $integrations = array( - + 'bbpress' => array( - + 'function' => 'is_bbpress', 'plugin' => 'pagelines-bbpress', 'url' => 'http://www.pagelines.com/store/plugins/pagelines-bbpress/', 'name' => 'bbPress', 'class' => 'PageLinesBBPress' - + ), 'jigoshop' => array( - + 'function' => 'is_jigoshop', 'plugin' => 'pagelines-jigoshop', 'url' => 'http://www.pagelines.com/store/plugins/pagelines-jigoshop/', 'name' => 'Jigoshop', - 'class' => 'PageLinesJigoShop' - ), + 'class' => 'PageLinesJigoShop' + ), ); - + foreach( $integrations as $i => $data ) { - + if( function_exists( $data['function'] ) ) { - + if( $data['function']() && ! class_exists( $data['class'] ) ) pl_check_integrations_banner( $data ); - } + } } } function pl_check_integrations_banner( $data ) { - + if( current_user_can('edit_themes') ){ - + $banner_title = sprintf( '', $data['name'] ); - + $text = 'Looks like your running a supported plugin but your not using our integrations whatsit.'; - + $link_text = 'Get it from the store now!'; - + $link = sprintf('%s', $data['url'], $link_text . ' →'); - + echo sprintf('', $banner_title, $text, $link); - - - } + + + } } -/** +/** * Return the raw URI * * @param $full bool Show full or just request. * @return string */ function pl_get_uri( $full = true ) { - + if ( $full ) return $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]; else - return $_SERVER["REQUEST_URI"]; + return $_SERVER["REQUEST_URI"]; } -/** +/** * Is framework in debug mode? * * @return bool */ function is_pl_debug() { - + if ( defined( 'PL_DEV' ) && PL_DEV ) return true; if ( ploption( 'enable_debug' ) ) return true; } -/** +/** * Show debug info in footer ( wrapped in tags ) * */ function pl_debug( $text = '', $before = "\n/*", $after = '*/' ) { - + if ( ! is_pl_debug() ) return; - - $out = sprintf( 'echo "%s %s %s";', $before, $text, $after ); + + $out = sprintf( 'echo "%s %s %s";', $before, $text, $after ); add_action( 'shutdown', create_function( '', $out ), 9999 ); } @@ -1269,17 +1269,17 @@ function pl_debug( $text = '', $before = "\n/*", $after = '*/' ) { */ function inline_css_markup($id, $css, $echo = true){ $mark = sprintf('%2$s%2$s', $css, "\n", $id); - - if($echo) + + if($echo) echo $mark; else - return $mark; + return $mark; } function pl_get_plus_link() { - + if( VDEV ) return ADD_PLUS_DEV; else - return ADD_PLUS_PRO; + return ADD_PLUS_PRO; } \ No newline at end of file diff --git a/includes/library.layout.php b/includes/library.layout.php index 27a4728d..2cdf1737 100644 --- a/includes/library.layout.php +++ b/includes/library.layout.php @@ -14,8 +14,8 @@ * @return string */ function pl_layout_mode() { - - $layout = pagelines_layout_library_data(); + + $layout = pagelines_layout_library_data(); return $layout->layout_mode; } @@ -25,8 +25,8 @@ function pl_layout_mode() { * @return int */ function pl_page_width() { - - $layout = pagelines_layout_library_data(); + + $layout = pagelines_layout_library_data(); return $layout->layout_map['content_width']; } @@ -36,8 +36,8 @@ function pl_page_width() { * @return int */ function pl_responsive_width() { - - $layout = pagelines_layout_library_data(); + + $layout = pagelines_layout_library_data(); return $layout->layout_map['responsive_width']; } @@ -47,10 +47,10 @@ function pl_responsive_width() { * @return int */ function pl_content_width() { - + $mode = pl_layout_mode(); - - $layout = pagelines_layout_library_data(); + + $layout = pagelines_layout_library_data(); return $layout->layout_map[ $mode ][ 'maincolumn_width' ]; } @@ -60,10 +60,10 @@ function pl_content_width() { * @return int */ function pl_sidebar_width() { - + $mode = pl_layout_mode(); - - $layout = pagelines_layout_library_data(); + + $layout = pagelines_layout_library_data(); return $layout->layout_map[ $mode ][ 'primarysidebar_width' ]; } @@ -75,7 +75,7 @@ function pl_sidebar_width() { function pl_secondary_sidebar_width() { $width = pl_page_width() - pl_sidebar_width() - pl_content_width(); - + return $width; } @@ -85,13 +85,13 @@ function pl_secondary_sidebar_width() { * @return array */ function pagelines_layout_library_data() { - + global $pagelines_layout; if ( !is_object( $pagelines_layout ) ) build_pagelines_layout(); - - return $pagelines_layout; + + return $pagelines_layout; } /** @@ -109,33 +109,33 @@ function pagelines_layout_library_data() { * @param string $layout Layout type. * @param string $icon URI for page icon. * @param int $postion Position to insert into main menu. - * @return array $optionarray + * @return array $optionarray */ function pl_add_options_page( $args ) { - + if( pl_has_editor() ){ - + global $pagelines_add_settings_panel; - + $args['opts'] = (!isset($args['opts']) && isset($args['array'])) ? $args['array'] : array(); $args['pos'] = (!isset($args['pos']) && isset($args['position'])) ? $args['position'] : array(); - + $d = array( - 'name' => 'No Name', + 'name' => 'No Name', 'icon' => 'icon-edit', 'pos' => 10, 'opts' => array() ); - + $a = wp_parse_args( $args, $d ); - + // make sure its not set elsewhere. Navbar was already set, and we were writing twice if( !isset( $pagelines_add_settings_panel[ $a['name'] ]) && !isset( $pagelines_add_settings_panel[ strtolower( $a['name'] ) ]) ) $pagelines_add_settings_panel[ strtolower($a['name']) ] = $a; - } - - - // Version 2 + } + + + // Version 2 // Deprecated as of v3 $defaults = array( @@ -156,8 +156,8 @@ function pl_add_options_page( $args ) { if ( isset( $args['name'] ) && ! isset( $pagelines_add_options_page[ $args['name'] ] ) ) $pagelines_add_options_page[ $args['name'] ] = $args; - - + + } /** @@ -169,25 +169,25 @@ function pl_add_options_page( $args ) { function pl_add_settings_panel( $settings ){ global $pagelines_add_settings_panel; - + if ( !isset( $pagelines_add_settings_panel ) || !is_array( $pagelines_add_settings_panel ) ) return $settings; - + foreach( $pagelines_add_settings_panel as $panel => $setup ) { - + if(strpos($setup['icon'], "http://") !== false) $setup['icon'] = 'icon-circle'; - + $setup['opts'] = process_to_new_option_format( $setup['opts'] ); - + if(!isset($settings[ $panel ])) $settings[ $panel ] = $setup; - - + + } - + return $settings; - + } /** @@ -200,21 +200,21 @@ function pl_add_settings_panel( $settings ){ function pl_add_options_page_filter( $optionarray ){ global $pagelines_add_options_page; - + if ( ! isset( $pagelines_add_options_page ) || !is_array( $pagelines_add_options_page ) ) return $optionarray; - + foreach( $pagelines_add_options_page as $page => $data ) { - + $content = ( $data['path'] ) ? $data['path']() : $data['raw']; if( is_array( $data['array'])) { - + // Merge in icon to option array $data_array = array_merge(array('icon'=>$data['icon']), $data['array']); - + $out[$page] = $data_array; - + } else { $out[$page] = array( @@ -222,11 +222,11 @@ function pl_add_options_page_filter( $optionarray ){ 'icon' => $data['icon'], $page => array( - + 'type' => $data['type'], 'shortexp' => $content, 'title' => $data['title'], - 'layout' => $data['layout'] + 'layout' => $data['layout'] ) ); } @@ -256,23 +256,23 @@ function pl_add_options_page_filter( $optionarray ){ * @internal param string $option string If before or after, where? */ function pl_global_option( $args ) { - + $defaults = array( - + 'menu' => 'custom_options', 'options' => null, 'location' => 'bottom', 'option' => false ); - + $args = wp_parse_args( $args, $defaults ); - - + + global $pagelines_add_global_option; if ( isset( $args['menu'] ) && isset( $args['options'] ) && is_array( $args['options'] ) ) $pagelines_add_global_option[] = array( - + 'menu' => $args['menu'], 'options' => $args['options'], 'location' => $args['location'], @@ -284,28 +284,28 @@ function pl_global_option( $args ) { function pl_add_global_options_filter( $optionarray ){ global $pagelines_add_global_option; - + if ( ! isset( $pagelines_add_global_option ) || !is_array( $pagelines_add_global_option ) ) return $optionarray; - + foreach( $pagelines_add_global_option as $key => $data ) { - + if ( ! $data['menu'] ) return $optionarray; - + if ( $data['menu'] == 'custom_options' && !isset( $optionarray[$data['menu']] ) ) $optionarray[$data['menu']] = array(); - + if ( $data['location'] == 'before' || $data['location'] == 'after' && $data['option'] ) { - + $optionarray[$data['menu']] = pl_array_insert( $optionarray[$data['menu']], $data['option'], $data['options'], ( $data['location'] == 'before' ) ? true : false ); } - + if ( $data['location'] == 'top' ) { $optionarray[$data['menu']] = pl_insert_into_array( $optionarray[$data['menu']], $data['options'], 0); } - - if ( $data['location'] == 'bottom' ) { + + if ( $data['location'] == 'bottom' ) { $optionarray[$data['menu']] = pl_insert_into_array( $optionarray[$data['menu']], $data['options'], 9999); } } diff --git a/includes/library.layouts.php b/includes/library.layouts.php index f9c44008..a542970e 100644 --- a/includes/library.layouts.php +++ b/includes/library.layouts.php @@ -1,7 +1,7 @@ 'query', - 'per_row' => 3, - 'format' => 'img_grid', - 'paged' => false, + 'per_row' => 3, + 'format' => 'img_grid', + 'paged' => false, 'has_img' => true, 'image_field' => false, - 'img_default' => null, - 'img_width' => '100%', + 'img_default' => null, + 'img_width' => '100%', 'title' => '', 'title_link' => '', - 'class' => 'pagelines-grid', - 'row_class' => 'gridrow', - 'content_len' => 10, + 'class' => 'pagelines-grid', + 'row_class' => 'gridrow', + 'content_len' => 10, 'callback' => false, - 'margin' => true, + 'margin' => true, 'hovercard' => false ); - + $a = wp_parse_args($args, $defaults); - + if( $a['data'] == 'users' || $a['data'] == 'array_callback'){ - + $posts = $data; - + }else{ // The Query - global $wp_query; - + global $wp_query; + $wp_query = $data; - + $posts = $data->posts; - + if( !is_array( $posts ) ) return; - + } - + // Standard Variables $out = ''; $total = count($posts); $count = 1; $default_img = ( isset($a['img_default']) ) ? sprintf('%s', $a['img_default'], __('No Image', 'pagelines')) : ''; - + $margin_class = ($a['margin']) ? '' : 'ppfull'; - - + + if($a['hovercard']) $out .= pl_js_wrap(sprintf('jQuery(".vignette").hover(function(){jQuery(this).find(".hovercard").fadeIn();}, function(){jQuery(this).find(".hovercard").fadeOut();});')); // Grid loop foreach($posts as $pid => $p){ - + // Grid Stuff $start = (grid_row_start( $count, $total, $a['per_row'])) ? sprintf('
    ', $margin_class) : ''; $end = (grid_row_end( $count, $total, $a['per_row'])) ? '
    ' : ''; $last_class = (grid_row_end( $count, $total, $a['per_row'])) ? 'pplast' : ''; - - // Content + + // Content $content = ''; - + if($a['callback']) $content = call_user_func( $a['callback'], $p, $a ); else { - - setup_postdata($p); - + + setup_postdata($p); + $oset = array('post_id' => $p->ID); - + // The Image if( $a['image_field'] && ploption($a['image_field'], $oset) ) $thumb = sprintf('thumb', ploption($a['image_field'], $oset) ); @@ -91,66 +91,66 @@ function grid( $data, $args = array() ){ $thumb = get_the_post_thumbnail( $p->ID ); else $thumb = $default_img; - + $hovercard = ($a['hovercard']) ? sprintf('
    %s
    ', $p->post_title) : ''; - - $image = sprintf( + + $image = sprintf( '
    %s%s
    ', - get_permalink($p->ID), - $a['img_width'], - $thumb, + get_permalink($p->ID), + $a['img_width'], + $thumb, $hovercard ); - + $content .= $image; - + // Text - + if($a['format'] == 'media'){ - + $content .= sprintf( - '

    %s

    %s %s %s

    ', - get_permalink($p->ID), - $p->post_title, - custom_trim_excerpt($p->post_content, $a['content_len']), + '

    %s

    %s %s %s

    ', + get_permalink($p->ID), + $p->post_title, + custom_trim_excerpt($p->post_content, $a['content_len']), sprintf('More →', get_permalink($p->ID)), pledit( $p->ID ) - + ); - + } - + } - + // Column Box Wrapper $out .= sprintf( - '%s
    %s
    %s', - $start, - $a['per_row'], - $a['format'], - $last_class, - $content, + '%s
    %s
    %s', + $start, + $a['per_row'], + $a['format'], + $last_class, + $content, $end ); - + $count++; } - + if( $a['paged'] ){ ob_start(); pagelines_pagination(); $pages = ob_get_clean(); } else $pages = ''; - + $title_link = ($a['title_link'] != '') ? sprintf('See All', $a['title_link']) : ''; - + $title = ($a['title'] != '') ? sprintf('

    %s

    %s
    ', $a['title'], $title_link) : ''; - + $wrap = sprintf('
    %s%s%s
    ', $a['class'], $title, $out, $pages); return $wrap; - + } @@ -160,9 +160,9 @@ function grid( $data, $args = array() ){ function grid_row_start( $count, $total_count, $perline){ $row_count = $count + ( $perline - 1 ); - + $grid_row_start = ( $row_count % $perline == 0 ) ? true : false; - + return $grid_row_start; } @@ -172,10 +172,10 @@ function grid_row_start( $count, $total_count, $perline){ **/ function grid_row_end( $count, $total_count, $perline){ - + $row_count = $count + ( $perline - 1 ); - + $box_row_end = ( ( $row_count + 1 ) % $perline == 0 || $count == $total_count ) ? true : false; - + return $box_row_end; } \ No newline at end of file diff --git a/includes/library.multisite.php b/includes/library.multisite.php index 1a11ba86..4b68ebf8 100644 --- a/includes/library.multisite.php +++ b/includes/library.multisite.php @@ -1,4 +1,4 @@ - null, // Used as option key in special handling + 'subkey' => null, // Used as option key in special handling 'post_id' => null, // Used for page/page/panel control 'setting' => null, // Different types of serialized settings 'clone_id' => null, @@ -34,49 +34,49 @@ function ploption( $key, $args = array() ){ 'translate' => false, 'key' => $key ); - + $o = wp_parse_args($args, $d); if ( has_filter( "ploption_{$key}" ) ) return apply_filters( "ploption_{$key}", $key, $o ); - + if( class_exists('PageLinesTemplateHandler') && pl_setting($key, $o)) return pagelines_magic_parse( pl_setting($key, $o), $o ); - + elseif(is_pagelines_special($o) && plspecial($key, $o)) return pagelines_magic_parse( plspecial($key, $o), $o ); elseif( isset( $o['post_id'] ) && plmeta( $key, $args ) ) return pagelines_magic_parse( plmeta( $key, $o ), $o ); - elseif( pldefault( $key, $o ) ) + elseif( pldefault( $key, $o ) ) return pldefault( $key, $o ); elseif( get_ploption($key, $o) ) - return pagelines_magic_parse( get_ploption( $key, $o ), $o ); - + return pagelines_magic_parse( get_ploption( $key, $o ), $o ); + elseif( get_ploption($key, $o) === null ) if ( $newkey = plnewkey( $key ) ) - return $newkey; - + return $newkey; + else return false; } /** * Locates a meta option if it exists - * + * * @param string $key the key of the option */ function plmeta( $key, $args ){ - + $d = array( - 'subkey' => null, - 'post_id' => null, - 'setting' => null, + 'subkey' => null, + 'post_id' => null, + 'setting' => null, 'clone_id' => null, ); - + $o = wp_parse_args($args, $d); $pid = $o['post_id']; @@ -85,7 +85,7 @@ function plmeta( $key, $args ){ return false; $meta_global = "pl_meta_$pid"; - + global ${$meta_global}; $meta_opts = ${$meta_global}; if( ! is_array( $meta_opts ) ) { @@ -93,29 +93,29 @@ function plmeta( $key, $args ){ ${$meta_global} = $meta_opts; } - // Deal with cloning options + // Deal with cloning options if( isset($args['clone_id']) && $args['clone_id'] != 1 && $args['clone_id'] != 0) - $id_key = $key.'_'.$args['clone_id']; - else + $id_key = $key.'_'.$args['clone_id']; + else $id_key = $key; // Deal w/ default checkbox/boolean stuff // If default is set, return if reversed - + if( isset($o['post_id']) && !empty($o['post_id']) ) { - + $default_value = ( isset( $meta_opts[ $id_key ][0] ) ) ? $meta_opts[ $id_key ][0] : false; - + $reverse = ( pldefault($key, $args, 'val') && isset( $meta_opts[ $key.'_reverse' ][0] ) ) ? $meta_opts[ $key.'_reverse' ][0] : false; if( (bool) $default_value && (bool) $reverse) return false; else return $default_value; - + } else return false; - + } @@ -127,49 +127,49 @@ function plmeta( $key, $args ){ function plspecial($key, $args){ global $pagelines_special_meta; - + // Type of page is needed for special handling - // Use the argument 'type' if available because of settings panels, etc. + // Use the argument 'type' if available because of settings panels, etc. if(isset($args['type']) && $args['type'] != '') $type = $args['type']; else $type = PageLinesTemplate::page_type_breaker(); - - + + if( isset($args['clone_id']) && $args['clone_id'] != 1 ) $id_key = $key.'_'.$args['clone_id']; else $id_key = $key; - - + + if(isset($pagelines_special_meta[$type]) && is_array($pagelines_special_meta[$type]) && isset($pagelines_special_meta[$type][$id_key])) return $pagelines_special_meta[$type][$id_key]; - else + else return false; } /** * Grab from global defaults panel - * + * * @param 'key' the id of the option - * + * **/ function pldefault( $key, $args = array(), $mode = '') { - + global $pagelines_special_meta; - $sp = $pagelines_special_meta; + $sp = $pagelines_special_meta; $slug = 'default'; $reverse_key = $key.'_reverse'; - + $default_value = ( isset( $sp[$slug] ) && is_array( $sp[$slug] ) && isset( $sp[$slug][$key] ) ) ? $sp[$slug][$key] : false; // check if on default option is reversed by meta $reverse_value = ( $mode != 'val' && (plmeta($reverse_key, $args) || plspecial( $reverse_key, $args )) ) ? true : false; - + if( !$reverse_value ) - return $default_value; + return $default_value; else return false; @@ -179,12 +179,12 @@ function pldefault( $key, $args = array(), $mode = '') { /** * Attempt to set default value if not found with ploption() - * + * * @param 'key' the id of the option - * + * **/ function plnewkey( $key ) { - + if ( !is_admin() ) return false; $settings = get_option_array(); @@ -194,7 +194,7 @@ function plnewkey( $key ) { if ($name == $key && isset( $setting['default'] ) ) { plupop( $key, $setting['default'] ); return $setting['default']; - } + } return false; } @@ -206,15 +206,15 @@ function plnewkey( $key ) { * */ function plupop($key, $val, $oset = array()){ - + $d = array( 'parent' => null, - 'subkey' => null, + 'subkey' => null, 'setting' => PAGELINES_SETTINGS, ); - + $o = wp_parse_args($oset, $d); - + $the_set = get_option($o['setting']); $new = array( $key => $val ); @@ -224,17 +224,17 @@ function plupop($key, $val, $oset = array()){ $child_option = ( isset($parent) && isset($the_set[$parent]) && is_array($the_set[$parent]) ) ? true : false; - + $parse_set = ( $child_option ) ? $the_set[ $parent ] : $the_set; - + $new_set = wp_parse_args($new, $parse_set); - - + + if($child_option) $the_set[ $parent ] = $new_set; else $the_set = $new_set; - + update_option( $o['setting'], $the_set ); } @@ -245,50 +245,50 @@ function plupop($key, $val, $oset = array()){ * */ function get_ploption( $key, $args = array() ){ - + $d = array( - 'subkey' => null, - 'post_id' => null, - 'setting' => null, + 'subkey' => null, + 'post_id' => null, + 'setting' => null, 'clone_id' => null, 'special' => null ); - + $o = wp_parse_args($args, $d); - + // get setting $setting = ( isset($o['setting']) && !empty($o['setting'])) ? $o['setting'] : PAGELINES_SETTINGS; if(!isset($setting) || $setting == PAGELINES_SETTINGS){ - + global $global_pagelines_settings; - + if( is_array($global_pagelines_settings) && isset($global_pagelines_settings[$key]) ) return $global_pagelines_settings[$key]; - + else return false; - + } elseif ( isset($setting) ){ - + $setting_options = get_option($setting); - + if( isset($o['subkey']) ){ - + if(isset($setting_options[$key]) && is_array($setting_options[$key]) && isset($setting_options[$key][$o['subkey']])) return $setting_options[$key][$o['subkey']]; else return false; - + }elseif( isset($setting_options[$key]) ) return $setting_options[$key]; - + else return false; - - } else + + } else return false; - + } /** @@ -300,7 +300,7 @@ function pagelines_magic_parse( $string, $o ) { * wpml check. */ if ( true == $o['translate'] ) { - + if( ! function_exists('icl_register_string') ) return $string; @@ -308,12 +308,12 @@ function pagelines_magic_parse( $string, $o ) { $group = sprintf( 'pagelines_%s', $o['group'] ); icl_register_string( $group, $key, $string); - return icl_t( $group, $key, $string ); + return icl_t( $group, $key, $string ); } - + /** * Always return original string if all else fails. - */ + */ return $string; } @@ -323,22 +323,22 @@ function pagelines_magic_parse( $string, $o ) { * */ function plname($key, $a = array()){ - + $set = (!isset($a['setting']) || empty($a['setting']) || $a['setting'] == PAGELINES_SETTINGS) ? PAGELINES_SETTINGS : $a['setting']; - + $subkey = (isset($a['subkey'])) ? $a['subkey'] : false; - + $grandkey = (isset($a['subkey']) && is_array($a['subkey']) && isset($a['subkey']['grandkey'])) ? $a['subkey']['grandkey'] : false; - + if( $grandkey ) - $output = $set . '['.$key.']['.$subkey.']['.$grandkey.']'; + $output = $set . '['.$key.']['.$subkey.']['.$grandkey.']'; elseif( $subkey ) $output = $set . '['.$key.']['.$subkey.']'; - else + else $output = $set .'['.$key.']'; - + return $output; - + } @@ -348,11 +348,11 @@ function plname($key, $a = array()){ * */ function plid($key, $a){ - + $set = (!isset($a['setting']) || empty($a['setting']) || $a['setting'] == PAGELINES_SETTINGS) ? PAGELINES_SETTINGS : $a['setting']; $subkey = (isset($a['subkey'])) ? $a['subkey'] : false; - + $grandkey = (isset($a['subkey']) && is_array($a['subkey']) && isset($a['subkey']['grandkey'])) ? $a['subkey']['grandkey'] : false; $clone_id = (isset($a['clone_id']) && $a['clone_id'] != 1) ? '_'.$a['clone_id'] : ''; @@ -361,9 +361,9 @@ function plid($key, $a){ $output = array($set, $key, $subkey, $grandkey); elseif( $subkey ) $output = array($set, $key, $subkey); - else + else $output = array($set, $key); - + return join('_', $output) . $clone_id; } @@ -374,21 +374,21 @@ function plid($key, $a){ * */ function pl_um($key, $args = null){ - + if(is_array($args)){ - + $d = array( 'user_id' => null ); $o = wp_parse_args($args, $d); } else { - + $o['user_id'] = $args; - + } - + return get_user_meta( $o['user_id'], $key, true ); } @@ -398,13 +398,13 @@ function pl_um($key, $args = null){ * **/ function pl_getset_option($key, $default = false) { - + global $global_pagelines_settings; - + if( is_array($global_pagelines_settings) && isset($global_pagelines_settings[$key]) ) return $global_pagelines_settings[$key]; - else{ + else{ plupop( $key, $default ); return $default; } @@ -426,16 +426,16 @@ function pagelines_option_name( $oid, $sub_oid = null, $grand_oid = null, $setti * */ function get_pagelines_option_name( $oid, $sub_oid = null, $grand_oid = null, $setting = PAGELINES_SETTINGS ){ - + $set = (!isset($setting) || $setting == PAGELINES_SETTINGS) ? PAGELINES_SETTINGS : $setting; - + if( isset($grand_oid) ) - $name = $set . '['.$oid.']' . '['.$sub_oid.']' . '['.$grand_oid.']'; + $name = $set . '['.$oid.']' . '['.$sub_oid.']' . '['.$grand_oid.']'; elseif( isset($sub_oid) ) $name = $set . '['.$oid.']' . '['.$sub_oid.']'; - else + else $name = $set .'['.$oid.']'; - + return $name; } @@ -446,11 +446,11 @@ function get_pagelines_option_name( $oid, $sub_oid = null, $grand_oid = null, $s * */ function meta_option_name( $array, $hidden = true ){ - + $prefix = ($hidden) ? '_' : ''; - + return $prefix.join('_', $array); - + } @@ -477,15 +477,15 @@ function get_pagelines_option_id( $oid, $sub_oid = null, $grand_oid = null, $nam $a = array($nm, $oid, $sub_oid, $grand_oid); elseif( isset($sub_oid) ) $a = array($nm, $oid, $sub_oid); - else + else $a = array($nm, $oid); - + return join('_', $a); } /** * Sanitize user input - * + * **/ function pagelines_settings_callback( $input ) { @@ -493,7 +493,7 @@ function pagelines_settings_callback( $input ) { $whitelist = array( 'excerpt_tags', 'headerscripts', 'footerscripts', 'asynch_analytics', 'typekit_script', 'footer_terms', 'footer_more' ); if(is_array($input)){ - + // We run through the $input array, if it is not in the whitelist we run it through the wp filters. foreach ($input as $name => $value){ if ( !is_array( $value ) && !in_array( $name, apply_filters( 'pagelines_settings_whitelist', $whitelist ) ) ) @@ -502,7 +502,7 @@ function pagelines_settings_callback( $input ) { else $input[$name] = wp_filter_nohtml_kses( $value ); } - + } // Return our safe $input array. return $input; @@ -518,12 +518,12 @@ function get_pagelines_option($key, $setting = null, $default = null) { $setting = $setting ? $setting : PAGELINES_SETTINGS; if(!isset($setting) || $setting == PAGELINES_SETTINGS){ - + global $global_pagelines_settings; - + if( is_array($global_pagelines_settings) && isset($global_pagelines_settings[$key]) ) return $global_pagelines_settings[$key]; - + else if ( $default ) { plupop( $key, $default ); @@ -542,16 +542,16 @@ function get_pagelines_option($key, $setting = null, $default = null) { * */ function pagelines_option( $key, $post_id = null, $setting = null){ - + if(isset($post_id) && get_post_meta($post_id, $key, true)) return get_post_meta($post_id, $key, true); //if option is set for a page/post - - elseif( get_pagelines_option($key, $setting) ) + + elseif( get_pagelines_option($key, $setting) ) return get_pagelines_option($key, $setting); - - else + + else return false; - + } @@ -561,12 +561,12 @@ function pagelines_option( $key, $post_id = null, $setting = null){ * */ function pagelines_sub_option( $key, $subkey, $post_id = '', $setting = null){ - + $primary_option = pagelines_option($key, $post_id, $setting); - + if(is_array($primary_option) && isset($primary_option[$subkey])) return $primary_option[$subkey]; - else + else return false; } @@ -578,7 +578,7 @@ function pagelines_sub_option( $key, $subkey, $post_id = '', $setting = null){ * @TODO do * */ -function pagelines( $key, $post_id = null, $setting = null ){ +function pagelines( $key, $post_id = null, $setting = null ){ return pagelines_option($key, $post_id, $setting); } @@ -601,9 +601,9 @@ function e_pagelines($key, $alt = null, $post_id = null, $setting = null){ */ function pagelines_pro($key, $post_id = null, $setting = null){ - if(VPRO) + if(VPRO) return pagelines_option($key, $post_id, $setting); - else + else return false; } @@ -614,9 +614,9 @@ function pagelines_pro($key, $post_id = null, $setting = null){ * */ function print_pagelines_option($key, $alt = null, $post_id = null, $setting = null) { - + echo load_pagelines_option($key, $alt, $post_id, $setting); - + } @@ -626,20 +626,20 @@ function print_pagelines_option($key, $alt = null, $post_id = null, $setting = n * */ function load_pagelines_option($key, $alt = null, $post_id = null, $setting = null) { - + if($post_id && get_post_meta($post_id, $key, true) && !is_home()){ - + //if option is set for a page/post return get_post_meta($post_id, $key, true); - + }elseif(pagelines_option($key, $post_id, $setting)){ - + return pagelines_option($key, $post_id, $setting); - + }else{ return $alt; } - + } @@ -649,7 +649,7 @@ function load_pagelines_option($key, $alt = null, $post_id = null, $setting = nu * */ function pagelines_update_option($optionid, $optionval){ - + $theme_options = get_option(PAGELINES_SETTINGS); $new_options = array( $optionid => $optionval @@ -688,7 +688,7 @@ function m_pagelines($option, $post){ */ function em_pagelines($option, $post, $alt = ''){ $post_meta = m_pagelines($option, $post); - + if(isset($post_meta)){ echo $post_meta; }else{ @@ -707,14 +707,14 @@ function pagelines_merge_addon_options( $optionarray ) { $options = get_option( 'pagelines_addons_options' ); $plugins = pagelines_register_plugins(); if ( is_array( $options ) ) { - + $build_options = array(); - + foreach( $options as $optionname => $option ) if ( in_array( $optionname, $plugins ) ) $build_options[$optionname] = $option; - + return array_merge( $optionarray, $build_options ); - + } else return $optionarray; } @@ -746,35 +746,35 @@ function pagelines_remove_addon_options( $addon_name ) { update_option( 'pagelines_addons_options', $options ); } } - + /** * This function registers the default values for pagelines theme settings */ function pagelines_settings_defaults() { $default_options = array(); - + foreach(get_option_array( true ) as $menuitem => $options ){ - + foreach($options as $oid => $o ){ if( isset( $o['type'] ) && 'layout' == $o['type'] ){ - + $dlayout = new PageLinesLayout; $default_options['layout'] = $dlayout->default_layout_setup(); - + }elseif( pagelines_is_multi_option($oid, $o) ){ - + foreach($o['selectvalues'] as $multi_optionid => $multi_o) if(isset($multi_o['default'])) $default_options[$multi_optionid] = $multi_o['default']; - - }else{ - if(!VPRO && isset($o['version_set_default']) && $o['version_set_default'] == 'pro') + + }else{ + if(!VPRO && isset($o['version_set_default']) && $o['version_set_default'] == 'pro') $default_options[$oid] = null; - elseif(!VPRO && isset($o['default_free'])) + elseif(!VPRO && isset($o['default_free'])) $default_options[$oid] = $o['default_free']; - elseif(isset($o['default'])) + elseif(isset($o['default'])) $default_options[$oid] = $o['default']; } @@ -799,15 +799,15 @@ function pagelines_process_reset_options( $option_array = null ) { if(isset($_POST['pl_reset_settings']) && current_user_can('edit_themes')){ do_action( 'extend_flush' ); - + if(isset($_POST['the_pl_setting']) && !isset($_POST['reset_callback'])) update_option($_POST['the_pl_setting'], array()); - + if(isset($_POST['reset_callback'])) - call_user_func( $_POST['reset_callback'] ); + call_user_func( $_POST['reset_callback'] ); } - + $option_array = (isset($option_array)) ? $option_array : get_option_array(); foreach($option_array as $menuitem => $options ){ @@ -815,10 +815,10 @@ function pagelines_process_reset_options( $option_array = null ) { if( isset( $o['type'] ) && $o['type'] == 'reset' && ploption($oid) ){ call_user_func($o['callback']); - - // Set the 'reset' option back to not set !important + + // Set the 'reset' option back to not set !important pagelines_update_option($oid, null); - + wp_redirect( admin_url( PL_SETTINGS_URL.'&reset=true&opt_id='.$oid ) ); exit; @@ -836,12 +836,12 @@ function pagelines_process_reset_options( $option_array = null ) { * */ function pagelines_is_multi_option( $oid, $o ){ - + if ( ! isset( $o['type'] ) ) return false; - - if( $o['type'] == 'text_multi' - || $o['type'] == 'check_multi' + + if( $o['type'] == 'text_multi' + || $o['type'] == 'check_multi' || $o['type'] == 'color_multi' || $o['type'] == 'image_upload_multi' || $o['type'] == 'multi_option' @@ -858,15 +858,15 @@ function pagelines_is_multi_option( $oid, $o ){ * */ function pagelines_is_boolean_option($oid, $o){ - + if( - $o['type'] == 'check' - || $o['type'] == 'check_multi' + $o['type'] == 'check' + || $o['type'] == 'check_multi' ){ return true; } else return false; - + } @@ -893,62 +893,62 @@ function pagelines_import_export(){ if ( isset($options) && is_array( $options) ) { - + header('Cache-Control: public, must-revalidate'); header('Pragma: hack'); header('Content-Type: text/plain'); - header( 'Content-Disposition: attachment; filename="' . PL_THEMENAME . '-Settings-' . date('Ymd') . '.dat"' ); + header( 'Content-Disposition: attachment; filename="' . PL_THEMENAME . '-Settings-' . date('Ymd') . '.dat"' ); echo json_encode( $options ); exit(); - } + } } - if ( isset($_POST['form_submitted']) && $_POST['form_submitted'] == 'import_settings_form') { + if ( isset($_POST['form_submitted']) && $_POST['form_submitted'] == 'import_settings_form') { if (strpos($_FILES['file']['name'], 'Settings') === false && strpos($_FILES['file']['name'], 'settings') === false){ - wp_redirect( admin_url(PL_IMPORT_EXPORT_URL.'&pageaction=import&error=wrongfile') ); + wp_redirect( admin_url(PL_IMPORT_EXPORT_URL.'&pageaction=import&error=wrongfile') ); } elseif ($_FILES['file']['error'] > 0){ $error_type = $_FILES['file']['error']; wp_redirect( admin_url(PL_IMPORT_EXPORT_URL.'&pageaction=import&error=file&'.$error_type) ); } else { $raw_options = pl_file_get_contents( $_FILES['file']['tmp_name'] ); $all_options = json_decode(json_encode(json_decode($raw_options)), true); - + if ( !isset( $_POST['pagelines_layout'] ) && is_array( $all_options) && isset( $all_options['pagelines_settings'] ) && is_array( $all_options['pagelines_settings'] ) ) unset( $all_options['pagelines_settings']['layout'] ); - + if ( isset( $_POST['pagelines_settings'] ) && is_array( $all_options) && isset( $all_options['pagelines_settings'] ) && is_array( $all_options['pagelines_settings'] ) ) { update_option( PAGELINES_SETTINGS, array_merge( get_option( PAGELINES_SETTINGS ), $all_options['pagelines_settings'] ) ); $done = 1; } - + if ( isset( $_POST['pagelines_special'] ) && is_array( $all_options) && isset( $all_options['pagelines_special'] ) && is_array( $all_options['pagelines_special'] ) ) { $special = ( array ) get_option( PAGELINES_SPECIAL ); update_option( PAGELINES_SPECIAL, array_merge( $special, $all_options['pagelines_special'] ) ); $done = 1; } - + if ( isset( $_POST['pagelines_templates'] ) && is_array( $all_options) && isset( $all_options['pagelines_template_map'] ) && is_array( $all_options['pagelines_template_map'] ) ) { $template_map = ( array ) get_option( PAGELINES_TEMPLATE_MAP ); $template_settings = ( array ) get_option( PAGELINES_TEMPLATES ); - + $template_settings_new = ( isset( $all_options['pagelines_templates'] ) && is_array( $all_options['pagelines_templates'] ) ) ? $all_options['pagelines_templates'] : array(); $template_map_new = ( isset( $all_options['pagelines_template_map'] ) && is_array( $all_options['pagelines_template_map'] ) ) ? $all_options['pagelines_template_map'] : array(); - + update_option( PAGELINES_TEMPLATE_MAP, array_merge( $template_map, $template_map_new ) ); update_option( PAGELINES_TEMPLATES, array_merge( $template_settings, $template_settings_new ) ); $done = 1; - } - if (function_exists('wp_cache_clean_cache')) { + } + if (function_exists('wp_cache_clean_cache')) { global $file_prefix; - wp_cache_clean_cache($file_prefix); + wp_cache_clean_cache($file_prefix); } if ( isset($done) ) { - wp_redirect( admin_url( PL_IMPORT_EXPORT_URL.'&pageaction=import&imported=true' ) ); + wp_redirect( admin_url( PL_IMPORT_EXPORT_URL.'&pageaction=import&imported=true' ) ); } else { wp_redirect( admin_url( PL_IMPORT_EXPORT_URL.'&pageaction=import&error=wrongfile') ); } - } + } } } @@ -957,21 +957,21 @@ function pagelines_import_export(){ * */ function set_pagelines_credentials( $user, $pass ) { - + if ( !empty( $user ) && !empty( $pass ) ) update_option( 'pagelines_extend_creds', array( 'user' => $user, 'pass' => md5( $pass ) ) ); } /* - * Add persistant licence info + * Add persistant licence info * */ function update_pagelines_licence( $licence ) { - + $creds = get_option( 'pagelines_extend_creds' ); - + $creds['licence'] = $licence; - + update_option( 'pagelines_extend_creds', $creds ); } @@ -981,11 +981,11 @@ function update_pagelines_licence( $licence ) { * */ function get_pagelines_credentials( $t ) { - + $creds = get_option( 'pagelines_extend_creds', array( 'user' => '', 'pass' => '' ) ); switch( $t ) { - + case 'user': return ( isset( $creds['user'] ) ) ? $creds['user'] : null; break; @@ -993,7 +993,7 @@ function get_pagelines_credentials( $t ) { case 'pass': return ( isset( $creds['pass'] ) ) ? $creds['pass'] : false; break; - + case 'licence': return ( isset( $creds['licence'] ) ) ? $creds['licence'] : 'not logged in'; break; @@ -1006,35 +1006,35 @@ function get_pagelines_credentials( $t ) { * */ function pagelines_check_credentials( $type = 'setup' ) { - + switch( $type ) { - + case 'setup': if ( is_array( $a = get_transient( EXTEND_UPDATE ) ) && isset($a['credentials']) && $a['credentials'] === 'true' ) return true; else - return false; + return false; break; - + case 'licence': if ( is_array( $a = get_transient( EXTEND_UPDATE ) ) && isset($a['licence']) ) return $a['licence']; break; - + case 'error': if ( is_array( $a = get_transient( EXTEND_UPDATE ) ) && isset($a['api_error']) ) return $a['api_error']; break; - + case 'ssl': if ( is_array( $a = get_transient( EXTEND_UPDATE ) ) && isset($a['ssl']) ) return true; break; - + case 'echo': return get_transient( EXTEND_UPDATE ); break; - + case 'plus': if ( is_array( $a = get_transient( EXTEND_UPDATE ) ) && isset($a['plus']) ) return $a['plus']; diff --git a/includes/library.plugins.php b/includes/library.plugins.php index bd8a8f6b..344281c9 100644 --- a/includes/library.plugins.php +++ b/includes/library.plugins.php @@ -10,20 +10,20 @@ * @since 2.0.2 */ if( function_exists('wp125_write_ads') ){ - - - - // add_filter('pagelines_lesscode', 'frame_colors'); - // + + + + // add_filter('pagelines_lesscode', 'frame_colors'); + // // function wp125_colors( $less ){ - // + // // $less .= "#wp125adwrap_2c .wp125ad a{ background: lighten( @pl-base, @invert-light + 2 ); }"; - // - // + // + // // return $less; - // + // // } - + } /** diff --git a/includes/library.templates.php b/includes/library.templates.php index 769974e7..9cea3c85 100644 --- a/includes/library.templates.php +++ b/includes/library.templates.php @@ -10,7 +10,7 @@ /** * Special content wrap is for plugins that operate outside of pagelines * We started doing things manually, so there are legacy extensions still using manual methodology - * + * * @uses $pagelines_render // this is set in the main pagelines setup_pagelines_template(); function **/ function do_special_content_wrap(){ @@ -21,8 +21,8 @@ function do_special_content_wrap(){ || function_exists('vanilla_dcss') // || (function_exists('is_jigoshop') && is_jigoshop() && class_exists('PageLinesJigoShop')) ) - return false; - else + return false; + else return true; } @@ -32,22 +32,22 @@ function pagelines_special_content_wrap_top(){ add_action('pagelines_after_sidebar_wrap', 'pagelines_special_content_wrap_finish_after_sidebar'); add_action('pagelines_before_sidebar_wrap', 'pagelines_special_content_wrap_finish_before_sidebar'); add_action('pagelines_start_footer', 'pagelines_special_content_wrap_finish_after_content'); - ?> + ?>
    - +
    @@ -64,20 +64,20 @@ function pagelines_special_content_wrap_finish_before_sidebar_left() { /** * If the extension runs the sidebar, close down some markup before - * + * **/ function pagelines_special_content_wrap_finish_before_sidebar(){ ?>
    -
    +
    @@ -93,7 +93,7 @@ function pagelines_special_content_wrap_finish_after_sidebar(){ */ function pagelines_special_content_wrap_finish_after_content(){ global $sidebar_was_run; - + if(!isset($sidebar_was_run)):?>
    @@ -128,12 +128,12 @@ function pagelines_special_content_wrap_finish_after_content(){ * @uses pagelines_default_widget */ function pagelines_draw_sidebar($id, $name = '', $default = null, $element = 'ul'){ - + printf('<%s id="%s" class="sidebar_widgets fix">', $element, 'list_'.$id); - + if ( !dynamic_sidebar($id) ) - pagelines_default_widget( $id, $default); - + pagelines_default_widget( $id, $default); + printf('', $element); } @@ -153,29 +153,29 @@ function pagelines_draw_sidebar($id, $name = '', $default = null, $element = 'ul * @todo Finish paramater definitions */ function pagelines_default_widget($id, $default){ - - global $wp_registered_sidebars; + + global $wp_registered_sidebars; if( isset($wp_registered_sidebars[ $id ]) && isset($wp_registered_sidebars[ $id ]['name']) ) $name = $wp_registered_sidebars[ $id ]['name']; - else + else $name = 'Widgetized Area'; - + if(isset($default) && !pagelines('sidebar_no_default')): - - get_template_part( $default ); - + + get_template_part( $default ); + elseif( current_user_can('edit_themes') ): - ?> + ?>
  • Add Widgets ()

    -

    This is your but it needs some widgets!
    Easy! Just add some content to it in your widgets panel. +

    This is your but it needs some widgets!
    Easy! Just add some content to it in your widgets panel.

    - +
  • @@ -217,9 +217,9 @@ function pagelines_standard_sidebar($name, $description){ * @param string $name Function name, to be used in the input * @param string $text The text of the confirmation */ -function pl_action_confirm($name, $text){ +function pl_action_confirm($name, $text){ ?> - - $pagelines_ID); - + // Meta Images if(ploption('pagelines_favicon') && VPRO) printf('%s', ploption('pagelines_favicon'), "\n"); - + if(ploption('pagelines_touchicon')) printf('%s', ploption('pagelines_touchicon'), "\n"); @@ -369,12 +369,12 @@ function pagelines_meta_tags(){ // Removes viewport scaling on Phones, Tablets, etc. if(!ploption('disable_mobile_view', $oset) && !apply_filters( 'disable_mobile_view', '' )) echo ''; - + } function pagelines_source_attribution() { - - echo "\n\n\n"; @@ -385,7 +385,7 @@ function pl_source_comment( $text, $spacing = 1 ) { $newline = ($spacing) ? "\n" : ''; $double = ($spacing == 2) ? "\n\n" : $newline; - + return sprintf( '%s%s', $double, $text, $newline); } @@ -405,14 +405,14 @@ function pagelines_facebook_header() { return; global $pagelines_ID; - + if ( ! $pagelines_ID ) return; $fb_img = apply_filters('pl_opengraph_image', pl_the_thumbnail_url( $pagelines_ID, 'full' ) ); - - echo pl_source_comment('Facebook Open Graph'); - + + echo pl_source_comment('Facebook Open Graph'); + printf( "\n", get_the_title($pagelines_ID)); printf( "\n", get_permalink($pagelines_ID)); printf( "\n", get_bloginfo( 'name' )); @@ -430,16 +430,16 @@ function pagelines_facebook_header() { * */ function pagelines_supersize_bg(){ - + global $pagelines_ID; $oset = array('post_id' => $pagelines_ID); $url = ploption('page_background_image_url', $oset); - if(ploption('supersize_bg') && $url && !pl_is_disabled('color_control')){ - - wp_enqueue_script('pagelines-supersize' ); + if(ploption('supersize_bg') && $url && !pl_is_disabled('color_control')){ + + wp_enqueue_script('pagelines-supersize' ); add_action('wp_head', 'pagelines_runtime_supersize', 20); - } + } } /** @@ -451,23 +451,23 @@ function pagelines_runtime_supersize(){ if ( has_action( 'pl_no_supersize' ) ) return; - + global $pagelines_ID; $oset = array('post_id' => $pagelines_ID); $url = ploption('page_background_image_url', $oset); ?> - + - + = 2 || $page >= 2 ) ? ' | ' . sprintf( __( 'Page %s', 'pagelines' ), max( $paged, $page ) ) : ''; } else $title = trim( wp_title( '', false ) ); - + // Print the title. echo apply_filters( 'pagelines_meta_title', $title ); - + echo ""; } @@ -522,9 +522,9 @@ function pagelines_filter_wp_title( $title ) { $new_title .= $sep . ' ' . $bloginfo_description; } elseif ( is_category() ) { $new_title .= $sep . ' ' . single_cat_title( '', false ); - } elseif ( is_single() || is_page() ) { + } elseif ( is_single() || is_page() ) { $new_title .= $sep . ' ' . single_post_title( '', false ); - } elseif ( is_search() ) { + } elseif ( is_search() ) { $new_title .= $sep . ' ' . sprintf( __( 'Search Results: %s','pagelines' ), esc_html( $s ) ); } else $new_title .= $sep . ' ' . $title; @@ -534,9 +534,9 @@ function pagelines_filter_wp_title( $title ) { return apply_filters( 'pagelines_meta_title', $new_title ); } add_filter( 'wp_title', 'pagelines_filter_wp_title' ); - + /** - * + * * Fix IE to the extent possible * * @package PageLines Framework @@ -545,7 +545,7 @@ function pagelines_filter_wp_title( $title ) { * */ function pagelines_fix_ie( ){ - + $ie_ver = pl_detect_ie(); if( ploption('google_ie') && ( $ie_ver < 9 ) ) { $compat = sprintf( '//ie7-js.googlecode.com/svn/version/2.1(beta4)/IE%1$s.js', $ie_ver +1 ); @@ -557,10 +557,10 @@ function pagelines_fix_ie( ){ // If IE7 add the Internet Explorer 7 specific stylesheet if ( $ie_ver == 7 ) wp_enqueue_style('ie7-style', PL_CSS . '/ie7.css', array(), PL_CORE_VERSION); -} +} /** - * + * * Cufon Font Replacement * * @package PageLines Framework @@ -569,18 +569,18 @@ function pagelines_fix_ie( ){ * */ function pagelines_font_replacement( $default_font = ''){ - + if(ploption('typekit_script')){ echo pagelines_option('typekit_script'); } - + if(ploption('fontreplacement')){ global $cufon_font_path; - + if(ploption('font_file')) $cufon_font_path = ploption('font_file'); elseif($default_font) $cufon_font_path = PL_JS.'/'.$default_font; else $cufon_font_path = null; - + // =============================== // = Hook JS Libraries to Footer = // =============================== @@ -592,19 +592,19 @@ function pagelines_font_replacement( $default_font = ''){ * */ function font_replacement_scripts(){ - + global $cufon_font_path; wp_register_script('cufon', PL_ADMIN_JS.'/type.cufon.js', 'jquery', '1.09i', true); wp_print_scripts('cufon'); - + if(isset($cufon_font_path)){ wp_register_script('cufon_font', $cufon_font_path, 'cufon'); wp_print_scripts('cufon_font'); } - + } - + add_action('wp_head', 'cufon_inline_script'); /** @@ -613,9 +613,9 @@ function font_replacement_scripts(){ * */ function cufon_inline_script(){ - ?> '', - ); + 'before' => '', + ); wp_pagenavi( $args ); - + elseif (show_posts_nav()) : ?> ", 'pagelines' ), admin_url('nav-menus.php') ); } /** - * + * * Returns child pages for subnav, setup in hierarchy * * @package PageLines Framework @@ -714,14 +714,14 @@ function blank_nav_fallback() { * @since 1.1.0 * */ -function pagelines_page_subnav(){ - global $post; +function pagelines_page_subnav(){ + global $post; if(!is_404() && isset($post) && is_object($post) && !pagelines_option('hide_sub_header') && ($post->post_parent || wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0'))):?>
      - ancestors)>=2){ $reverse_ancestors = array_reverse($post->ancestors); - $children = wp_list_pages('title_li=&depth=1&child_of='.$reverse_ancestors[0].'&echo=0&sort_column=menu_order'); + $children = wp_list_pages('title_li=&depth=1&child_of='.$reverse_ancestors[0].'&echo=0&sort_column=menu_order'); }elseif($post->post_parent){ $children = wp_list_pages('title_li=&depth=1&child_of='.$post->post_parent.'&echo=0&sort_column=menu_order'); }else{ $children = wp_list_pages('title_li=&depth=1&child_of='.$post->ID.'&echo=0&sort_column=menu_order');} @@ -748,54 +748,54 @@ function pagelines_page_subnav(){ * @uses (filters) pagelines_logo_url, pagelines_site_logo, pagelines_custom_logo_url, pagelines_site_title * */ -function pagelines_main_logo( $location = null ){ - - global $pagelines_ID; - +function pagelines_main_logo( $location = null ){ + + global $pagelines_ID; + if ( is_pagelines_special() ) $pagelines_ID = false; - + $oset = array( 'post_id' => $pagelines_ID ); - + if(ploption('pagelines_custom_logo', $oset) || apply_filters('pagelines_site_logo', '') || apply_filters('pagelines_logo_url', '')){ - + $logo = apply_filters('pagelines_logo_url', esc_url(ploption('pagelines_custom_logo', $oset) ), $location); $logo_url = ( esc_url(ploption('pagelines_custom_logo_url', $oset) ) ) ? esc_url(ploption('pagelines_custom_logo_url', $oset) ) : home_url(); - - $site_logo = sprintf( - '%s', - $logo_url, + + $site_logo = sprintf( + '%s', + $logo_url, get_bloginfo('name'), - $logo, + $logo, get_bloginfo('name') ); - + echo apply_filters('pagelines_site_logo', $site_logo, $location); - + } else { - + $site_title = sprintf( '
      %s
      %s
      ', esc_url(home_url()), __('Home','pagelines'), get_bloginfo('name'), get_bloginfo('description')); - - echo apply_filters('pagelines_site_title', $site_title, $location); - } + + echo apply_filters('pagelines_site_title', $site_title, $location); + } } /** - * + * * Wraps in standard js on ready format * * @since 2.0.0 */ function pl_js_wrap( $js ){ - + return sprintf('', $js); - + } /** - * + * * Adds PageLines to Admin Bar * * @package PageLines Framework @@ -803,12 +803,12 @@ function pl_js_wrap( $js ){ * @since 1.3.0 * */ -function pagelines_settings_menu_link( ){ +function pagelines_settings_menu_link( ){ global $wp_admin_bar; - + global $pagelines_template; - + if ( !current_user_can('edit_theme_options') || pl_deprecate_v2()) return; @@ -825,9 +825,9 @@ function pagelines_settings_menu_link( ){ $page_type = __('Template: ', 'pagelines') . ucfirst($template_name ); $wp_admin_bar->add_menu( array( 'id' => 'template_type', 'title' => $page_type, 'href' => admin_url( PL_TEMPLATE_SETUP_URL ) ) ); } - + $spurl = pl_special_url( $template_name ); - + if( $template_name && is_pagelines_special() && $spurl){ $wp_admin_bar->add_menu( array( 'id' => 'special_settings', 'title' => __('Edit Meta', 'pagelines'), 'href' => $spurl ) ); } @@ -874,9 +874,9 @@ function get_pl_reset_less_url() { * */ function pl_special_url( $t ){ - + $t = strtolower( trim($t) ); - + if($t == 'blog') $slug = 'blog_page'; elseif($t == 'category') @@ -891,7 +891,7 @@ function pl_special_url( $t ){ $slug = '404_page'; elseif($t == 'author') $slug = 'author_posts'; - else + else return false; $rurl = sprintf(PL_SPECIAL_OPTS_URL.'%s', '#'.$slug); @@ -901,7 +901,7 @@ function pl_special_url( $t ){ } /** - * + * * PageLines Attribution * * @package PageLines Framework @@ -913,22 +913,22 @@ function pagelines_cred(){ if ( VPRO && ploption( 'watermark_hide' ) && ! has_action( 'show_pagelines_leaf' ) ) return; - + $image = (VPRO && ploption('watermark_image')) ? ploption('watermark_image') : PL_IMAGES.'/pagelines.png'; - + $alt = (VPRO) ? ploption( 'watermark_alt' ) : 'Build a website with PageLines'; - + $url = ploption('watermark_link'); if ( ! VPRO ) $url = 'http://www.pagelines.com'; - + $img = sprintf('%s', $image, $alt); - + $link = ( '' != $url && ! apply_filters('no_leaf_link', '') ) ? sprintf('%s', $url, $alt, $img ) : $img; - + $cred = sprintf('
      %s
      ', $link); - + echo apply_filters('pagelines_leaf', $cred); } @@ -943,7 +943,7 @@ function pagelines_get_childcss() { } function pl_social_button( $type = 'facebook', $args) { - + if($type == 'twitter') PageLinesShareBar::twitter( $args ); else diff --git a/includes/library.theming.php b/includes/library.theming.php index 819aa13a..62881d6f 100644 --- a/includes/library.theming.php +++ b/includes/library.theming.php @@ -1,19 +1,19 @@ false, - 'panel' => '', + 'panel' => '', 'keep' => false ); $args = wp_parse_args( $args, $defaults ); @@ -37,51 +37,51 @@ function pagelines_disable_settings( $args ){ /** * Support a specific section in a child theme - * + * * @param 'key' the class name of the section * @param 'args' controls on how the section will be supported. - * + * **/ function pl_support_section( $args ){ global $supported_elements; $defaults = array( - + 'class_name' => '', 'disable_color' => false, 'slug' => '', - 'supported' => true + 'supported' => true ); - + $args = wp_parse_args( $args, $defaults ); - + $supported_elements['sections'][ $args['class_name'] ] = $args; } /** * Support a specific plugin in a child theme - * + * * @param 'key' the slug of the plugin * @param 'args' controls on how the plugin will be supported. - * + * **/ function pl_support_plugin( $args ){ global $supported_elements; $defaults = array( - + 'slug' => '', 'supported' => true, 'url' => null, 'desc' => null, 'name' => null ); - + $args = wp_parse_args( $args, $defaults ); - + if ( isset( $args['name'] ) ) $supported_elements['plugins'][ $args['name'] ] = $args; else @@ -96,26 +96,26 @@ function pl_support_plugin( $args ){ * */ function pl_default_setting( $args ){ - + if(pagelines_activate_or_reset()){ - + global $new_default_settings; - + $default = array( - 'key' => '', - 'value' => '', + 'key' => '', + 'value' => '', 'parent' => null, - 'subkey' => null, + 'subkey' => null, 'setting' => PAGELINES_SETTINGS, - ); - + ); + $set = wp_parse_args($args, $default); - + $new_default_settings[] = $set; - + } - + } @@ -125,18 +125,18 @@ function pl_default_setting( $args ){ * */ function pagelines_activate_or_reset(){ - + $activated = ( isset($_GET['activated']) && $_GET['activated'] ) ? true : false; $reset = ( isset($_GET['reset']) && $_GET['reset'] ) ? true : false; - + if( $activated || $reset ){ - + if( $activated ) return 'activated'; elseif( $reset ) return 'reset'; - - }else + + }else return false; } @@ -147,14 +147,14 @@ function pagelines_activate_or_reset(){ * */ function pl_welcome_plugins( $args ){ - + global $pl_welcome_plugins; - + $default = array( - 'name' => '', - 'url' => '', + 'name' => '', + 'url' => '', 'desc' => '', - ); + ); $plugin = wp_parse_args($args, $default); diff --git a/includes/library.upgrades.php b/includes/library.upgrades.php index 2bd5bd32..7c1459c2 100644 --- a/includes/library.upgrades.php +++ b/includes/library.upgrades.php @@ -1,7 +1,7 @@ rebuild_sidebars( $pagelines ); - + // were done. return; } - + if ( is_array( $platform ) ) { - - $this->upgrade( $platform ); + + $this->upgrade( $platform ); } } function rebuild_sidebars( $pagelines ) { - + if ( ! VPRO ) return; $version = ( isset( $pagelines['pagelines_version'] ) ) ? $pagelines['pagelines_version'] : ''; - + // possible 'reset options' if ( ! $version ) { plupop( 'pagelines_version', PL_CORE_VERSION ); return; } - + // if on version 2.2 in settings - if ( version_compare( $version, '2.2-b1' ) >= 0 || version_compare( get_theme_mod( 'pagelines_version' ), '2.2-b1' ) >= 0 ) + if ( version_compare( $version, '2.2-b1' ) >= 0 || version_compare( get_theme_mod( 'pagelines_version' ), '2.2-b1' ) >= 0 ) return; - + if ( isset( $pagelines['enable_sidebar_reorder'] ) && $pagelines['enable_sidebar_reorder'] ) { - + // no need to do this... plupop( 'pagelines_version', PL_CORE_VERSION ); return; } $sidebars = get_option( 'sidebars_widgets' ); - + $new_sidebars = array( - + 'wp_inactive_widgets' => $sidebars['wp_inactive_widgets'], 'sidebar-1' => $sidebars['sidebar-7'], 'sidebar-2' => $sidebars['sidebar-8'], @@ -106,11 +106,11 @@ function rebuild_sidebars( $pagelines ) { 'sidebar-9' => $sidebars['sidebar-4'], 'sidebar-10'=> $sidebars['sidebar-1'], 'array_version' => $sidebars['array_version'] - + ); update_option( 'sidebars_widgets', $new_sidebars ); plupop( 'pagelines_version', PL_CORE_VERSION ); - return; + return; } @@ -121,11 +121,11 @@ function rebuild_sidebars( $pagelines ) { */ function upgrade( $settings ) { - + // beta versions will all be using the old array... if ( isset( $settings['pl_login_image']) ) $this->beta_upgrade( $settings ); - else + else $this->full_upgrade( $settings ); } @@ -135,20 +135,20 @@ function upgrade( $settings ) { * */ function full_upgrade( $settings ) { - + // here we go, 1st were gonna set the defaults add_option( PAGELINES_SETTINGS, pagelines_settings_defaults() ); add_option( PAGELINES_TEMPLATE_MAP, get_option( PAGELINES_TEMPLATE_MAP_LEGACY ) ); - + $defaults = get_option( PAGELINES_SETTINGS ); // copy the template-maps update_option( PAGELINES_TEMPLATE_MAP, get_option( PAGELINES_TEMPLATE_MAP_LEGACY ) ); // now were gonna merge... - + foreach( $settings as $key => $data ) { - + if ( isset( $defaults[$key]) ) { if ( !empty( $data ) ) plupop( $key, $data ); @@ -163,10 +163,10 @@ function full_upgrade( $settings ) { * */ function beta_upgrade( $settings ) { - + update_option( PAGELINES_SETTINGS, $settings ); - update_option( PAGELINES_TEMPLATE_MAP, get_option( PAGELINES_TEMPLATE_MAP_LEGACY ) ); - } + update_option( PAGELINES_TEMPLATE_MAP, get_option( PAGELINES_TEMPLATE_MAP_LEGACY ) ); + } } new PageLinesUpgradePaths; \ No newline at end of file diff --git a/includes/library.wordpress.php b/includes/library.wordpress.php index 9dc425e4..85c383dc 100644 --- a/includes/library.wordpress.php +++ b/includes/library.wordpress.php @@ -4,7 +4,7 @@ * Gets Comments Link based on ID */ function pl_get_comments_link( $post_id ){ - + $num_comments = get_comments_number($post_id); if ( comments_open() ){ if($num_comments == 0){ @@ -19,7 +19,7 @@ function pl_get_comments_link( $post_id ){ $write_comments = ''. $comments.''; } else{$write_comments = '';} - + return $write_comments; } @@ -28,15 +28,15 @@ function pl_get_comments_link( $post_id ){ * Get just the WordPress thumbnail URL - False if not there. */ function pl_the_thumbnail_url( $post_id, $size = false ){ - + if( has_post_thumbnail($post_id) ){ - + $img_data = wp_get_attachment_image_src( get_post_thumbnail_id( $post_id ), $size, false); $a['img'] = ($img_data[0] != '') ? $img_data[0] : ''; return $a['img']; - + } else return false; } @@ -51,12 +51,12 @@ function pl_the_thumbnail_url( $post_id, $size = false ){ * @TODO document * */ -function pl_theme_support( ){ - +function pl_theme_support( ){ + add_theme_support( 'post-thumbnails' ); add_theme_support( 'menus' ); add_theme_support( 'automatic-feed-links' ); - + } /** @@ -69,7 +69,7 @@ function pl_theme_support( ){ * @TODO document * */ -function fix_wp_login_imageurl( $url ){ +function fix_wp_login_imageurl( $url ){ return home_url(); } @@ -83,7 +83,7 @@ function fix_wp_login_imageurl( $url ){ * @TODO document * */ -function fix_wp_login_imagetitle( $url ){ +function fix_wp_login_imagetitle( $url ){ return get_bloginfo('name'); } @@ -98,12 +98,12 @@ function fix_wp_login_imagetitle( $url ){ * @TODO document * */ -function pl_fix_login_image( ){ - +function pl_fix_login_image( ){ + $image_url = (ploption('pl_login_image')) ? ploption('pl_login_image') : PL_ADMIN_IMAGES . '/login-pl.png'; - + $css = sprintf('body #login h1 a{background: url(%s) no-repeat top center;height: 80px;background-size:auto; background-size: auto 80px;}', $image_url); - + inline_css_markup('pagelines-login-css', $css); } @@ -117,11 +117,11 @@ function pl_fix_login_image( ){ * @TODO document * */ -function pl_fix_admin_favicon( ){ - +function pl_fix_admin_favicon( ){ + $image_url = (ploption('pagelines_favicon')) ? ploption('pagelines_favicon') : PL_ADMIN_IMAGES . '/favicon-pagelines.png'; - + $css = sprintf('#wphead #header-logo{background: url(%s) no-repeat scroll center center;}', $image_url); - + inline_css_markup('pagelines-wphead-img', $css); } \ No newline at end of file diff --git a/includes/version.php b/includes/version.php index efdbd368..3dd0fe13 100644 --- a/includes/version.php +++ b/includes/version.php @@ -1,4 +1,4 @@ -

      - - + +
    diff --git a/js/pl.common.js b/js/pl.common.js index fb888d39..8260bc4e 100644 --- a/js/pl.common.js +++ b/js/pl.common.js @@ -1,37 +1,37 @@ !function ($) { - // --> Initialize + // --> Initialize $(document).ready(function() { $.plCommon.init() }) - + $.plFixed = { - + update: function(){ - + } } - + $.plCommon = { init: function(){ var that = this that.setHeight() - + $.resize.delay = 100 // resize throttle - + $('.pl-fixed-top').on('resize', function(){ that.setHeight() }) - + } - + , setHeight: function(){ - + var height = $('.pl-fixed-top').height() - + $('.fixed-top-pusher').height(height) - + } } diff --git a/js/script.resize.js b/js/script.resize.js index c6788831..013cc162 100644 --- a/js/script.resize.js +++ b/js/script.resize.js @@ -1,7 +1,7 @@ /* * jQuery resize event - v1.1 - 3/14/2010 * http://benalman.com/projects/jquery-resize-plugin/ - * + * * Copyright (c) 2010 "Cowboy" Ben Alman * Dual licensed under the MIT and GPL licenses. * http://benalman.com/about/license/ diff --git a/js/script.supersize.js b/js/script.supersize.js index b932d86f..376ad7ec 100644 --- a/js/script.supersize.js +++ b/js/script.supersize.js @@ -3,11 +3,11 @@ Supersized - Fullscreen Slideshow jQuery Plugin Version : Core 3.2.1 Site : www.buildinternet.com/project/supersized - + Author : Sam Dunn Company : One Mighty Roar (www.onemightyroar.com) License : MIT License / GPL License - + */ (function(a){a(document).ready(function(){a("body").append('
    ')});a.supersized=function(b){var c="#supersized",d=this;d.$el=a(c);d.el=c;vars=a.supersized.vars;d.$el.data("supersized",d);api=d.$el.data("supersized");d.init=function(){a.supersized.vars.options=a.extend({},a.supersized.defaultOptions,b);d.options=a.supersized.vars.options;d._build()};d._build=function(){d._start()};d._start=function(){if(d.options.start_slide){vars.current_slide=d.options.start_slide-1}else{vars.current_slide=Math.floor(Math.random()*d.options.slides.length)}var f=d.options.new_window?' target="_blank"':"";imageLink=(api.getField("url"))?"href='"+api.getField("url")+"'":"";var e=a('');e.appendTo(d.el).wrap('").css("visibility","hidden");e.load(function(){d._origDim(a(this));d.resizeNow();d.launch()});d.$el.css("visibility","hidden")};d.launch=function(){d.$el.css("visibility","visible");a("#supersized-loader").hide();a(window).resize(function(){d.resizeNow()})};d.resizeNow=function(){return d.$el.each(function(){a("img",d.el).each(function(){thisSlide=a(this);var f=(thisSlide.data("origHeight")/thisSlide.data("origWidth")).toFixed(2);var e=d.$el.width(),h=d.$el.height(),i;if(d.options.fit_always){if((h/e)>f){g()}else{j()}}else{if((h<=d.options.min_height)&&(e<=d.options.min_width)){if((h/e)>f){d.options.fit_landscape&&f<1?g(true):j(true)}else{d.options.fit_portrait&&f>=1?j(true):g(true)}}else{if(e<=d.options.min_width){if((h/e)>f){d.options.fit_landscape&&f<1?g(true):j()}else{d.options.fit_portrait&&f>=1?j():g(true)}}else{if(h<=d.options.min_height){if((h/e)>f){d.options.fit_landscape&&f<1?g():j(true)}else{d.options.fit_portrait&&f>=1?j(true):g()}}else{if((h/e)>f){d.options.fit_landscape&&f<1?g():j()}else{d.options.fit_portrait&&f>=1?j():g()}}}}}function g(k){if(k){if(thisSlide.width()=d.options.min_height){thisSlide.width(d.options.min_width);thisSlide.height(thisSlide.width()*f)}else{j()}}}else{if(d.options.min_height>=h&&!d.options.fit_landscape){if(e*f>=d.options.min_height||(e*f>=d.options.min_height&&f<=1)){thisSlide.width(e);thisSlide.height(e*f)}else{if(f>1){thisSlide.height(d.options.min_height);thisSlide.width(thisSlide.height()/f)}else{if(thisSlide.width()=d.options.min_width){thisSlide.height(d.options.min_height);thisSlide.width(thisSlide.height()/f)}else{g(true)}}}else{if(d.options.min_width>=e){if(h/f>=d.options.min_width||f>1){thisSlide.height(h);thisSlide.width(h/f)}else{if(f<=1){thisSlide.width(d.options.min_width);thisSlide.height(thisSlide.width()*f)}}}else{thisSlide.height(h);thisSlide.width(h/f)}}}if(thisSlide.parent().hasClass("image-loading")){a(".image-loading").removeClass("image-loading")}if(d.options.horizontal_center){a(this).css("left",(e-a(this).width())/2)}if(d.options.vertical_center){a(this).css("top",(h-a(this).height())/2)}});if(d.options.image_protect){a("img",d.el).bind("contextmenu mousedown",function(){return false})}return false})};d._origDim=function(e){e.data("origWidth",e.width()).data("origHeight",e.height()).css("visibility","visible")};d.getField=function(e){return d.options.slides[vars.current_slide][e]};d.init()};a.supersized.vars={current_slide:0,options:{}};a.supersized.defaultOptions={start_slide:1,new_window:1,image_protect:1,min_width:0,min_height:0,vertical_center:1,horizontal_center:1,fit_always:0,fit_portrait:1,fit_landscape:0};a.fn.supersized=function(b){return this.each(function(){(new a.supersized(b))})}})(jQuery); \ No newline at end of file diff --git a/js/script.viewport.js b/js/script.viewport.js index 9c126bc1..b6c7fd79 100644 --- a/js/script.viewport.js +++ b/js/script.viewport.js @@ -11,7 +11,7 @@ * */ (function($) { - + $.belowthefold = function(element, settings) { var fold = $(window).height() + $(window).scrollTop(); return fold <= $(element).offset().top - settings.threshold; @@ -21,21 +21,21 @@ var top = $(window).scrollTop(); return top >= $(element).offset().top + $(element).height() - settings.threshold; }; - + $.rightofscreen = function(element, settings) { var fold = $(window).width() + $(window).scrollLeft(); return fold <= $(element).offset().left - settings.threshold; }; - + $.leftofscreen = function(element, settings) { var left = $(window).scrollLeft(); return left >= $(element).offset().left + $(element).width() - settings.threshold; }; - + $.inviewport = function(element, settings) { return !$.rightofscreen(element, settings) && !$.leftofscreen(element, settings) && !$.belowthefold(element, settings) && !$.abovethetop(element, settings); }; - + $.extend($.expr[':'], { "below-the-fold": function(a, i, m) { return $.belowthefold(a, {threshold : 0}); @@ -54,5 +54,5 @@ } }); - + })(jQuery); \ No newline at end of file diff --git a/language/readme.txt b/language/readme.txt index acc188de..268c14d9 100644 --- a/language/readme.txt +++ b/language/readme.txt @@ -3,7 +3,7 @@ PageLines I18n pagelines.pot is rendered by the api on the fly - - You will find it + + You will find it ******************************************************** \ No newline at end of file diff --git a/less/accordion.less b/less/accordion.less index 2b3959b0..903b7ee1 100644 --- a/less/accordion.less +++ b/less/accordion.less @@ -10,7 +10,7 @@ .accordion-group { background:darken(@pl-base,2); margin-bottom: 2px; - border: 1px solid darken(@pl-base, 6); + border: 1px solid darken(@pl-base, 6); .border-radius(4px); } .accordion-heading { diff --git a/less/alerts.less b/less/alerts.less index c45c78e9..f8d752e6 100644 --- a/less/alerts.less +++ b/less/alerts.less @@ -20,7 +20,7 @@ h2.alert-heading, h3.alert-heading, h4.alert-heading, h5.alert-heading, h6.alert-heading { margin:0 auto 0.25em; } - + // Adjust close link position .alert .close { position: relative; @@ -34,7 +34,7 @@ .alert-success { background-color: @successBackground; - border-color: @successBorder; + border-color: @successBorder; color: @successText; } .alert-important, diff --git a/less/blockquotes.less b/less/blockquotes.less index 993ca0cf..3e368d9b 100644 --- a/less/blockquotes.less +++ b/less/blockquotes.less @@ -1,8 +1,8 @@ blockquote { - + padding: 0 0 0 15px; margin: 0 0 18px; - + p {color: fadeout(@pl-text, 40%);} small {color: fadeout(@pl-text, 70%);display: block;line-height: 18px;} small:before {content: '\2014 \00A0';} @@ -30,7 +30,7 @@ blockquote.pull-right { } } -.comment blockquote{ +.comment blockquote{ background-color: lighten(@dark-base, 1.6); border: none; padding-right: 10px; diff --git a/less/buttons.less b/less/buttons.less index 13118e9a..a839cee2 100755 --- a/less/buttons.less +++ b/less/buttons.less @@ -204,7 +204,7 @@ input[type="submit"].btn { position: relative; display: inline-block; .ie7-inline-block(); - + vertical-align: middle; // match .btn alignment given font-size hack above white-space: nowrap; // prevent buttons from wrapping when in tight spaces (e.g., the table on the tests page) .ie7-restore-left-whitespace(); diff --git a/less/deprecated.less b/less/deprecated.less index e901413c..40b0b915 100644 --- a/less/deprecated.less +++ b/less/deprecated.less @@ -1,6 +1,6 @@ /* DEPRECATED CSS - All CSS that is deprecated but still used belongs here. + All CSS that is deprecated but still used belongs here. Fully document the replacements and current known usages. */ @@ -10,7 +10,7 @@ /* * Old School Buttons * @Replaced by: Bootstrap - * @Used In? + * @Used In? ***********************************/ /* @ Buttons */ .blink-wrap{ @@ -20,7 +20,7 @@ font-family: helvetica, arial, sans-serif; } body #page .blink-wrap .blink{ - + display: block; text-decoration: none; margin:0; @@ -41,24 +41,24 @@ body #page .blink-wrap .blink{ border: 1px solid transparent; border-top: 1px solid #f7f7f7; border-left: 1px solid #f7f7f7;} - + body #page .blink-wrap .blink:hover{ background: #82a2ca url(@{plRoot}/images/blink-sprite-grey.png) 0 -35px repeat-x; border: 1px solid #aaa; border-top: 1px solid #fff; border-left: 1px solid #fff; - + } body #page .blink-wrap .blink:active{background: #82a2ca url(@{plRoot}/images/blink-sprite-grey.png) 0 -70px repeat-x;border: 1px solid #666;color: #fff; text-shadow: #000 0 -1px 0} body #page .blink-wrap .blink:active .blink-pad{border: 1px solid transparent;} - + .bl-align-right{float:right; margin: 2px 0 2px 5px;} /* * Old School Tags * @Replaced by: Bootstrap - * @Used In? + * @Used In? ***********************************/ .btag, .boxtags a{ font-family: helvetica, arial, sans-serif; @@ -90,7 +90,7 @@ body #page .blink-wrap .blink{ border-right: 1px solid #bbb; } a.btag.grey:hover, .boxtags a:hover{ background: #ccc; color: #000; } - + .btag.grdnt{ box-shadow: inset 1px 1px 0 rgba(255,255,255,.5), 1px 1px 0 rgba(255,255,255,.5); border:1px solid #ccc; @@ -99,11 +99,11 @@ body #page .blink-wrap .blink{ 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%); } @@ -111,7 +111,7 @@ body #page .blink-wrap .blink{ /* * CSS Shortcuts * @Replaced by: Better methodology - * @Used In? + * @Used In? ***********************************/ body .ntb{border-top: none} body .nbb{border-bottom: none} @@ -126,9 +126,9 @@ body .nbb{border-bottom: none} position: absolute; width: 54px; height: 54px; - top: 50%; + top: 50%; left: 50%; - margin-left: -27px; + margin-left: -27px; margin-top: -27px; display: inline-block; @@ -144,7 +144,7 @@ body .nbb{border-bottom: none} -webkit-border-radius: 50px; } - .bar1 {-webkit-transform:rotate(0deg) translate(0, -142%); -webkit-animation-delay: 0s;} + .bar1 {-webkit-transform:rotate(0deg) translate(0, -142%); -webkit-animation-delay: 0s;} .bar2 {-webkit-transform:rotate(30deg) translate(0, -142%); -webkit-animation-delay: -0.9167s;} .bar3 {-webkit-transform:rotate(60deg) translate(0, -142%); -webkit-animation-delay: -0.833s;} .bar4 {-webkit-transform:rotate(90deg) translate(0, -142%); -webkit-animation-delay: -0.75s;} @@ -157,7 +157,7 @@ body .nbb{border-bottom: none} .bar11 {-webkit-transform:rotate(300deg) translate(0, -142%); -webkit-animation-delay: -0.1667s;} .bar12 {-webkit-transform:rotate(330deg) translate(0, -142%); -webkit-animation-delay: -0.0833s;} -} +} @-webkit-keyframes fade { from {opacity: 1;} diff --git a/less/dropdowns.less b/less/dropdowns.less index 3fd9f6e4..8a877c17 100644 --- a/less/dropdowns.less +++ b/less/dropdowns.less @@ -88,7 +88,7 @@ body .dropdown-menu { // ----------- .dropdown-menu li > a:hover, .dropdown-menu li > a:focus, -.dropdown-submenu:hover > a, +.dropdown-submenu:hover > a, .dropdown-menu li.current-menu-item > a { text-decoration: none; text-shadow: 0 -1px 0 rgba(0,0,0,.5); diff --git a/less/forms.less b/less/forms.less index 4ff2129c..39e78252 100644 --- a/less/forms.less +++ b/less/forms.less @@ -92,11 +92,11 @@ input[type="color"], // Declare width for legacy (can't be on input[type=*] selectors or it's too specific) input, textarea, -.uneditable-input, +.uneditable-input, .add-on { .box-sizing(border-box); } -input{ +input{ width: 220px; } // Reset height since textareas have rows @@ -658,9 +658,9 @@ legend + .control-group { // PageLines Styles // --------------------------------------------------------------- -/* Placeholder */ -.placeholder(); - +/* Placeholder */ +.placeholder(); + /* @ Search Form */ .searchform { position: relative; @@ -694,19 +694,19 @@ legend + .control-group { padding-left: 28px; background-color:#fff; color:#000; - width: 150px; + width: 150px; } } } -.billboard .searchfield, +.billboard .searchfield, .boomboard .searchfield{ float: none; } - -.navigation_wrap .searchform { + +.navigation_wrap .searchform { position: absolute; right: 3px; bottom: 2px; @@ -717,41 +717,41 @@ legend + .control-group { // BUTTON INPUTS // ------------------- input[type="submit"], -.submit, -input[type="button"], -.button, -input[type="reset"], +.submit, +input[type="button"], +.button, +input[type="reset"], .reset{ padding: 4px 9px; cursor: pointer; text-decoration: none; .box-sizing(content-box); .border-radius(4px); - color:#000000; - text-shadow:0 1px 0 rgba(255,255,255,0.5); - border:1px solid #bbbbbb; + color:#000000; + text-shadow:0 1px 0 rgba(255,255,255,0.5); + border:1px solid #bbbbbb; #gradient > .vertical(#ffffff, #dcdcdc); box-shadow: inset 1px 1px 0px #FFF; - font-family: @buttonFontFamily; - + font-family: @buttonFontFamily; + &:hover{ - color:#000000; + color:#000000; text-decoration: none; - text-shadow:0 1px 0 rgba(255,255,255,0.5); - border:1px solid #aeaeae; + text-shadow:0 1px 0 rgba(255,255,255,0.5); + border:1px solid #aeaeae; #gradient > .vertical(#f3f3f3, #cfcfcf); } &:active{ - color:#000000; - text-shadow:0 1px 0 rgba(255,255,255,0.5); - border:1px solid #8e8e8e; + color:#000000; + text-shadow:0 1px 0 rgba(255,255,255,0.5); + border:1px solid #8e8e8e; #gradient > .vertical(#afafaf, #d3d3d3); box-shadow: none; } -} +} input[type="image"]{ - box-shadow: none; + box-shadow: none; } diff --git a/less/icons.less b/less/icons.less index f58d7c43..52c8e6e9 100644 --- a/less/icons.less +++ b/less/icons.less @@ -5,9 +5,9 @@ License ------------------------------------------------------- - A special PageLines-Only GPL licensed version of Font Awesome was approved by the - author via email. - + A special PageLines-Only GPL licensed version of Font Awesome was approved by the + author via email. + Contact ------------------------------------------------------- Email: dave@davegandy.com diff --git a/less/mixins.less b/less/mixins.less index 83ef81f6..ba51ece7 100755 --- a/less/mixins.less +++ b/less/mixins.less @@ -395,12 +395,12 @@ // Common Highlight .highlightMe( @bg: @btnPrimaryBackground, @hl: @btnPrimaryBackgroundHighlight){ .buttonBackground(@bg, @hl); - color: #fff; + color: #fff; text-shadow: 0 -1px 0 rgba(0,0,0,.7); border-color: @bg; box-shadow: inset 1px 1px 0 rgba(255,255,255,.2); - a{ - color:#fff; + a{ + color:#fff; text-shadow: 0 -1px 0 rgba(0,0,0,.7); } } @@ -514,7 +514,7 @@ transparent 50%, @alt 50%, @alt 75%, transparent 75%, transparent); } - + } // Reset filters for IE @@ -650,7 +650,7 @@ .span (@columns) { width: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)); } - + .offsetX (@index) when (@index > 0) { (~".offset@{index}") { .offset(@index); } .offsetX(@index - 1); @@ -659,15 +659,15 @@ .offset (@columns) { @offsetMargin: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns + 1)); - &.sortable-first, + &.sortable-first, &:first-child{ margin-left: @offsetMargin - @fluidGridGutterWidth; } margin-left: @offsetMargin; } - .row, - .row-fluid, + .row, + .row-fluid, .editor-row { width: 100%; .clearfix(); @@ -675,10 +675,10 @@ float: left; margin-left: @fluidGridGutterWidth; margin-bottom:@gridRowSpace; - - + + } - > [class*="span"]:first-child, + > [class*="span"]:first-child, .sortable-first { margin-left: 0; clear: both; diff --git a/less/pagination.less b/less/pagination.less index 39e2dfc5..610d9b9f 100644 --- a/less/pagination.less +++ b/less/pagination.less @@ -5,7 +5,7 @@ .pagination { height: @baseLineHeight * 2; margin: @baseLineHeight 0; - + .wp-pagenavi{ // Reset span.pages{ @@ -21,21 +21,21 @@ font-weight: normal; } a, span.current{ - .box-shadow(0 1px 2px rgba(0,0,0,.05)); + .box-shadow(0 1px 2px rgba(0,0,0,.05)); } } ul{ - .box-shadow(0 1px 2px rgba(0,0,0,.05)); + .box-shadow(0 1px 2px rgba(0,0,0,.05)); .border-radius(3px); } ul, &.pagenavi { display: inline-block; .ie7-inline-block(); margin: 0; - > a span.pg, - > span.pg, - .wp-pagenavi a, - .wp-pagenavi span.current, + > a span.pg, + > span.pg, + .wp-pagenavi a, + .wp-pagenavi span.current, .wp-pagenavi span.extend{ float: left; padding: 0 14px; @@ -46,9 +46,9 @@ border-left-width: 0; color: @textColorSubtle; } - > span.pg, - > a:hover span.pg, - .wp-pagenavi a:hover, + > span.pg, + > a:hover span.pg, + .wp-pagenavi a:hover, .wp-pagenavi span.current{ box-shadow: inset 1px 1px 0 @baseLighterMore; background-color: @baseContrastSlight; @@ -57,7 +57,7 @@ } > li{ display: inline; - > a, + > a, > span{ float: left; padding: 0 14px; @@ -68,8 +68,8 @@ border-left-width: 0; color: @textColorAlt; } - &.active > a, - &.active > span, + &.active > a, + &.active > span, > a:hover{ background-color: @baseContrast; text-decoration: none; @@ -81,19 +81,19 @@ cursor: default; } > li:first-child > a, - li:first-child > span, + li:first-child > span, > a:first-child > span, - > span:first-child, - .wp-pagenavi > span.pages + a, + > span:first-child, + .wp-pagenavi > span.pages + a, .wp-pagenavi > span.pages + span.current{ border-left-width: 1px; .border-radius(3px 0 0 3px); } > li:last-child > a, - li:last-child > span, - > a:last-child > span, - > span:last-child, - .wp-pagenavi a:last-child, + li:last-child > span, + > a:last-child > span, + > span:last-child, + .wp-pagenavi a:last-child, .wp-pagenavi span:last-child{ .border-radius(0 3px 3px 0); } @@ -105,10 +105,10 @@ cursor: default; } } - .desc, .wp-pagenavi span.pages { + .desc, .wp-pagenavi span.pages { .noteText(); line-height: (@baseLineHeight * 1.5) - 2; - + @media (max-width: 767px) { display: none;} } } diff --git a/less/pl-core.less b/less/pl-core.less index a07ef6b8..69ff302c 100644 --- a/less/pl-core.less +++ b/less/pl-core.less @@ -1,29 +1,29 @@ // PageLines Theme Styles & Defaults // ------------------------------------ -.site-wrap { - position:relative; - .page-wrap, - .template-region-wrap { - min-height: @pl-min-height; +.site-wrap { + position:relative; + .page-wrap, + .template-region-wrap { + min-height: @pl-min-height; zoom:1; - .page-canvas{ + .page-canvas{ margin: 0 auto; } } -} +} .fixed_width{ - #page, + #page, #footer{ - width: 100%; - margin: 0 auto; + width: 100%; + margin: 0 auto; position: relative; } } -.content { - width: 100%; +.content { + width: 100%; margin: 0 auto; position: relative; .content-pad{ @@ -32,7 +32,7 @@ } #content .content-pad{ - padding-top: 10px; + padding-top: 10px; } /* @ Footer */ @@ -41,16 +41,16 @@ text-align: left; position: relative; color: fadeout(@pl-footer, 40%); - li.link-list a, + li.link-list a, .widget-title{ color: fadeout(@pl-footer, 40%); } - a, + a, li h5 a{ color: @pl-footer; } } - + section.container{ margin: 0; } @@ -60,11 +60,11 @@ section.copy{ margin: 1.6em 0; } -.mcolumn-pad, -.copy-pad, -.scolumn-pad, -.sidebar_widgets, -.entry_content, +.mcolumn-pad, +.copy-pad, +.scolumn-pad, +.sidebar_widgets, +.entry_content, .post-excerpt{ > :first-child{ margin-top: 0; @@ -74,13 +74,13 @@ section.copy{ } } -#nav, +#nav, #secondnav{ .content-pad{ padding-top: 5px; padding-bottom: 5px; } -} +} #column-wrap { float: left; @@ -89,9 +89,9 @@ section.copy{ float:right; } -.two-sidebar-left, +.two-sidebar-left, .one-sidebar-left{ - #column-wrap{ + #column-wrap{ float: right; } #sidebar-wrap{ @@ -101,34 +101,34 @@ section.copy{ float: right; } } -#column-main { - float: left; - display: inline; +#column-main { + float: left; + display: inline; } -.two-sidebar-center #column-main { +.two-sidebar-center #column-main { float: right; - .mcolumn-pad{ - padding-right: 20px; + .mcolumn-pad{ + padding-right: 20px; padding-left: 20px; } } -.one-sidebar-right, +.one-sidebar-right, .two-sidebar-right{ #column-main .mcolumn-pad{ padding: 14px 30px 0 15px; } } -.one-sidebar-left, +.one-sidebar-left, .two-sidebar-left{ #column-main .mcolumn-pad{ padding: 14px 15px 0 30px; } } -.fullwidth #column-main { - float: none; - .mcolumn-pad{ - padding-right: 15px; +.fullwidth #column-main { + float: none; + .mcolumn-pad{ + padding-right: 15px; padding-left: 15px; } } @@ -139,9 +139,9 @@ section.copy{ /* Don't confuse with .full_width design mode added to 'body'.. */ -#sidebar1, -#sidebar2{ - float: left; +#sidebar1, +#sidebar2{ + float: left; overflow:hidden; } @@ -157,14 +157,14 @@ body.fixed_width{ &.content-shadow .page-canvas{ box-shadow: 0 1px 5px rgba(0,0,0, .8); } - #footer{ - background: transparent; - margin: 0 auto; + #footer{ + background: transparent; + margin: 0 auto; } - .section-morefoot .dcol-pad { + .section-morefoot .dcol-pad { padding: 15px; } - .section-branding .content-pad{ + .section-branding .content-pad{ padding: 25px; } #header .searchform { @@ -175,21 +175,21 @@ body.fixed_width{ } } -/* @ #header */ +/* @ #header */ #header .outline{ position: relative; zoom: 1; z-index:15; /* ie drop-down fix */ } -.widget-title, -#footer li h5 a, -.main_nav, -.author-details, -.post-nav, -.current_posts_info, -#secondnav{ - font-size: 86%; +.widget-title, +#footer li h5 a, +.main_nav, +.author-details, +.post-nav, +.current_posts_info, +#secondnav{ + font-size: 86%; } @@ -197,10 +197,10 @@ body.fixed_width{ a.site-title{ display: block; margin: .3em 0 .15em; - font-size: 2.6em; + font-size: 2.6em; line-height: 1.1em; } -.site-description { +.site-description { margin-left: .2em; font-size: 86%; color: @textColorAlt; @@ -217,8 +217,8 @@ a.site-title{ float: left; margin-right: -230px; } - - .main_nav { + + .main_nav { margin-right: 230px; text-align: left; margin-top: 0px; @@ -230,7 +230,7 @@ a.site-title{ // Both Nav and Brandnav .main_nav{ - font-size: 86%; + font-size: 86%; ul{ list-style: none; display: block; @@ -243,13 +243,13 @@ a.site-title{ padding: 0px; float: left; text-align: right; - a{ + a{ line-height: 1em; padding: 10px 15px; text-decoration: none; display: block; border: 1px solid transparent; - border-bottom:none; + border-bottom:none; } } ul { @@ -278,69 +278,69 @@ a.site-title{ } /* No search adjustment */ -.main_nav_container.nosearch, -.nosearch .main_nav{ - margin-right: 0; +.main_nav_container.nosearch, +.nosearch .main_nav{ + margin-right: 0; } - + /* @ Posts */ .fpost{ .post-excerpt .post-thumb.img { margin-right: 13px } - .post-thumb.img { + .post-thumb.img { margin-right: 20px; } - .textcontent { - margin: 20px 10px 0 0; + .textcontent { + margin: 20px 10px 0 0; } .media .img img{ - max-width: 100%; - height: auto; + max-width: 100%; + height: auto; margin: 0 auto; } - .post-title h2 a:hover{ + .post-title h2 a:hover{ text-decoration: underline; } - .post-excerpt { - margin: .6em 0; + .post-excerpt { + margin: .6em 0; } &.post .entry{ margin-bottom: 1em; padding: 1em 0; } } - + .full_img { margin-bottom: .8em; } -// Belongs under postloop +// Belongs under postloop // Hentry format/sizing needs to be moved to be conextual // Henry is going to represent all long form text styling -.post-meta .c_img, -.hentry .c_img{ - display: block; - border: 1px solid transparent; - padding: 4px; +.post-meta .c_img, +.hentry .c_img{ + display: block; + border: 1px solid transparent; + padding: 4px; max-width: 98%; - line-height:1em; + line-height:1em; } -.post-meta { - margin-bottom: 1.71em; +.post-meta { + margin-bottom: 1.71em; &.post-nocontent{ margin-bottom: 0; } .post-title-section{ padding-bottom: 6px; } - .metabar{ + .metabar{ font-size: 80%; - line-height: 1.6em; + line-height: 1.6em; em{ font-style: normal; color: @textColorAlt; @@ -361,8 +361,8 @@ a.site-title{ .hentry-pad{ padding: 0 0 25px; } - .entry-title{ - margin:0; + .entry-title{ + margin:0; } ul ul, ol ol { margin: 0 0 0 1.7em; @@ -370,30 +370,30 @@ a.site-title{ } -.entry_content img { +.entry_content img { max-width: 100%; } .fpost .post-excerpt { - font-size: 1.03em; + font-size: 1.03em; line-height: 1.55em; } - + .tags { font-size: 86%; color: @textColorAlt; .note{ .noteText(); } -} - +} + .pledit{ opacity: .7; &:hover{ opacity: 1; } -} - +} + // Clips - Only used in blog listing // ------------------------------------ .clip_box{ @@ -404,16 +404,16 @@ a.site-title{ width:47%; clear: none; float: left; - .hentry{ + .hentry{ margin: 0; } &.clip-right{ - float: right; + float: right; } - .post-meta .c_img { + .post-meta .c_img { padding: 2px; } - .clip-header { + .clip-header { padding: 4px 0 4px 0; display: table-cell; width: 10000px; @@ -426,7 +426,7 @@ a.site-title{ img{ padding: 2px; display:block; - margin:0 0 0.4em; + margin:0 0 0.4em; } } .post-excerpt{ @@ -437,9 +437,9 @@ a.site-title{ .post-thumb.img { margin-right: 10px } - } - - .entry-title, + } + + .entry-title, .metabar{ padding: 0; } @@ -448,7 +448,7 @@ a.site-title{ /* @ Post Navigation */ -.post-nav, +.post-nav, .current_posts_info { clear: both; padding:5px 10px; @@ -459,7 +459,7 @@ a.site-title{ color: @textColorSubtle; &:hover{ color: @textColor; - + } } .previous a { @@ -481,57 +481,57 @@ a.site-title{ background-size: 16px 16px; } } - + } -/* Blows up text huge */ -.boomboard{ - padding: 100px; - min-height: 350px; - h2.hugetext { +/* Blows up text huge */ +.boomboard{ + padding: 100px; + min-height: 350px; + h2.hugetext { font-size: 8em; } } -.billboard { - padding: 60px 15px; - margin: 0 0 2.5em 0; +.billboard { + padding: 60px 15px; + margin: 0 0 2.5em 0; } -/* @ Previewing Alert */ -h2.notavail{ - margin-bottom: 1.5em; -} +/* @ Previewing Alert */ +h2.notavail{ + margin-bottom: 1.5em; +} /* secondary text */ -hr, -.fpost, -.navigation_wrap, -.setup_area, -.fpost .post-thumb img, -.clip .clip-thumb img, +hr, +.fpost, +.navigation_wrap, +.setup_area, +.fpost .post-thumb img, +.clip .clip-thumb img, .author-thumb img{ border-color: @dark-base; } - .item-avatar a, + .item-avatar a, ins{ background-color: lighten(@dark-base, 1.6); } -/* - * Text Colors +/* + * Text Colors ***********************************/ -h1, -h2, -h3, -h4, -h5, -h6, -a.site-title, +h1, +h2, +h3, +h4, +h5, +h6, +a.site-title, .entry-title a{ > a{ color: @pl-header; @@ -542,27 +542,27 @@ a.site-title, #page{ color: @pl-text; } - + a{ color: @pl-link; &:hover{ color: fadeout(@pl-link, 20%); } -} +} .subhead{ color: @textColorAlt; - font-size: 86%; + font-size: 86%; } - -/* - * Thumbs and other images + +/* + * Thumbs and other images ***********************************/ -.post-meta .c_img{ - background: @light-base; - border: 1px solid lighten(@light-base, 4); +.post-meta .c_img{ + background: @light-base; + border: 1px solid lighten(@light-base, 4); box-shadow: 0 1px 2px rgba(0,0,0, .4); img{ box-shadow: 0 1px 2px lighten(@light-base, 8); @@ -571,24 +571,24 @@ a{ /* @ PageLines Leaf */ -#cred { +#cred { text-align: center; - padding: 15px; - - a.plimage { + padding: 15px; + + a.plimage { text-align: center; - + } } -/* +/* * Responsive Design ****************************************/ body{ .content img { - max-width: 100%; - height: auto; + max-width: 100%; + height: auto; width: auto\9; /* ie8 */ } .entry_content{ @@ -601,13 +601,13 @@ body{ } @media screen and (max-width:800px){ - + .responsive{ - #site .content, #footer .content, + #site .content, #footer .content, &.fixed_width #page{ width: 97%; } - #page #pagelines_content #column-wrap, + #page #pagelines_content #column-wrap, #page #pagelines_content #sidebar-wrap, &.fixed_width #site .content{ width: 100%; @@ -615,16 +615,16 @@ body{ form { margin-left: 0; } - .one-sidebar-right #column-main .mcolumn-pad, + .one-sidebar-right #column-main .mcolumn-pad, .two-sidebar-right #column-main .mcolumn-pad { padding:15px; } } } - -@media screen and (max-width:600px) { - + +@media screen and (max-width:600px) { + .responsive{ .navigation_wrap{ text-align: center; @@ -653,18 +653,18 @@ body{ } */ } - + .scale_text{ font-size: .85em; } - + } - -@media screen and ( max-width : @resPhoneLandscape ) { - html { - -webkit-text-size-adjust: none; + +@media screen and ( max-width : @resPhoneLandscape ) { + html { + -webkit-text-size-adjust: none; } - + .responsive{ #page { #pagelines_content .clip { @@ -672,12 +672,12 @@ body{ } #brandnav .mainlogo-link { float: none - } - - .main_nav .main-nav, + } + + .main_nav .main-nav, #brandnav .brandnav-nav{ - margin-top: 10px; - width: 100%; + margin-top: 10px; + width: 100%; float: none; } .main_nav{ @@ -701,16 +701,16 @@ body{ display:inline-block; float: none; } - } + } } -#column-wrap, -#sidebar-wrap, -.clip, -#column-main, -#sidebar1, -.content, -#page{ +#column-wrap, +#sidebar-wrap, +.clip, +#column-main, +#sidebar1, +.content, +#page{ .transition(all .2s linear); } diff --git a/less/pl-editor.less b/less/pl-editor.less index a98a4dd0..68fa6bf6 100644 --- a/less/pl-editor.less +++ b/less/pl-editor.less @@ -8,22 +8,22 @@ @editorText: #038196; .pl-editor{ - - + + .pl-content{ position: relative; max-width: @plContentWidth; margin: 0 auto; - + } .section-plcolumn{ margin-bottom: 0; } - + #footer section:last-child{ margin-bottom: 0; } - + } // Drag and Drop Editing @@ -34,36 +34,36 @@ .user-select(none); } -.pl-section-controls, -.pl-region-bar, +.pl-section-controls, +.pl-region-bar, .pl-area-controls, .pl-column-forcer, .pl-sortable-buffer{ display: none; } -.btn-region, +.btn-region, .pl-section-controls{ font-family: @defaultFont; } .drag-drop-editing{ - + // Area Controls // -------------------------------------------------- - + .pl-region{ position: relative; - + &.header{ margin-top: 13px; } } .pl-region-bar{ display: block; - position: absolute; + position: absolute; top: -13px; - line-height: 12px; + line-height: 12px; z-index: @zindexEditor; #gradient > .vertical(rgba(182, 242, 253, .14), rgba(125, 233, 253, .14)); width: 100%; @@ -72,7 +72,7 @@ cursor: help; color: @editorText; text-shadow: 0 1px 0 rgba(255,255,255,.4); - box-shadow: inset 2px 1px 0 rgba(255,255,255,.5); + box-shadow: inset 2px 1px 0 rgba(255,255,255,.5); outline: 1px dashed @editorBorder; #gradient > .vertical(rgba(182, 242, 253, .5), rgba(125, 233, 253, .5)); @@ -83,16 +83,16 @@ .border-radius(0); } } - + .pl-area-container{ min-height: 20px; } .pl-area-placeholder{ - max-height: 400px; + max-height: 400px; border-top: 1px dashed @editorBorder; #gradient > .vertical(rgba(182, 242, 253, .06), rgba(125, 233, 253, .06)); } - + .pl-area{ position: relative; border-top: 1px dashed @editorBorder; @@ -106,14 +106,14 @@ .transition(all 0.15s ease-in-out); display: block; z-index: @zindexEditor; - position: absolute; - left: 0; + position: absolute; + left: 0; top: 0px; text-align: left; width: 61px; line-height: 1em; font-size: 9px; - + #gradient > .vertical(rgba(182, 242, 253, .8), rgba(125, 233, 253, .8)); margin-left: -41px; @@ -132,15 +132,15 @@ right: -50px; z-index: -100; } - - + + .area-control{ display: inline-block; font-size: 11px; font-weight: bold; color: #038196; text-shadow: 0 1px 0 #fff; //rgba(255,255,255,.4); - height: 20px; + height: 20px; width: 20px; line-height: 20px; text-align: center; @@ -163,18 +163,18 @@ } } } - - - - - + + + + + .pl-section{ .box-sizing(border-box); position: relative; .transition(all 0.1s linear); - &:hover, - &.ui-sortable-helper { - + &:hover, + &.ui-sortable-helper { + cursor: move; background: fadeout(@baseContrast, 50%); > .pl-section-controls{ @@ -184,22 +184,22 @@ &.ui-sortable-helper{ .transition(none); } - - + + &.section-plcolumn{ &:hover{background: transparent;} margin-bottom: 20px; outline: 1px dashed #35eafd; - + &.empty-area .pl-sortable-column{ min-height: 70px; .pl-column-forcer{ display: block; - width: 0; + width: 0; height: 0; } - - } + + } &.force-start-row > .pl-section-controls:first-child a.s-control.section-start-row{ background:@editorBorder; } @@ -209,11 +209,11 @@ &:hover{ #gradient > .vertical(rgba(182, 242, 253, .9), rgba(125, 233, 253, .9)); } - box-shadow: inset 1px 1px 0 rgba(255,255,255,.5); + box-shadow: inset 1px 1px 0 rgba(255,255,255,.5); outline: 1px dashed @editorBorder; color: @editorText; text-shadow: 0 1px 0 rgba(255,255,255,.4); - + a.s-control{ color: @editorText; background: rgba(196, 235, 242, .4); @@ -226,19 +226,19 @@ color:#222; } } - + } - + } // Section Controls .pl-section-controls{ position: absolute; top: 0; - left: 0; + left: 0; width: 100%; z-index: @zindexEditor; background: @interfaceBG; - text-shadow: 0 -1px 0 @interfaceBG; + text-shadow: 0 -1px 0 @interfaceBG; text-align: center; color: #fff; font-weight: bold; @@ -249,7 +249,7 @@ cursor: move; } .controls-title, - .controls-right, + .controls-right, .controls-left{ display: inline; clear: none; @@ -267,7 +267,7 @@ } .s-control{ line-height: 16px; - + font-size: 11px; display: inline-block; text-align: center; @@ -276,12 +276,12 @@ letter-spacing: .1em; } a.s-control{ - - width: 16px; + + width: 16px; height: 16px; - + padding: 0 1px; - + .border-radius(3px); background: rgba(0,0,0,.3); &:hover{ @@ -309,13 +309,13 @@ } - .pl-sortable-area, + .pl-sortable-area, .pl-sortable-column{ min-height: 35px; .transition(.5s); } &.pl-dragging{ - + .pl-sortable-column{ padding-top: 0px; } @@ -324,9 +324,9 @@ outline: 1px dashed #35eafd; } .ui-sortable-helper{ - border: 1px solid rgba(255,255,255,.4); + border: 1px solid rgba(255,255,255,.4); box-shadow: 0 1px 4px rgba(0,0,0,.5); - max-height: 350px; + max-height: 350px; overflow:hidden; opacity: .5; } @@ -335,20 +335,20 @@ margin: 5px 0; display: block; } - &:hover, + &:hover, &.ui-sortable-helper, - .section-plcolumn { + .section-plcolumn { .pl-section-controls{ display: none !important; } } } - - + + // Area for dropping elements on drag .pl-placeholder { - max-height: 400px; + max-height: 400px; display: inline; float: left; clear: none; @@ -373,9 +373,9 @@ - .cant-offset .section-offset-increase, - .cant-offset .section-offset-reduce, - .cant-offset .offset-size, + .cant-offset .section-offset-increase, + .cant-offset .section-offset-reduce, + .cant-offset .offset-size, .sortable-first .section-start-row{ .opacity(50); } @@ -387,8 +387,8 @@ } - - + + } @@ -398,73 +398,73 @@ .width-resize{ // Resizing .ui-resizable-handle { - &.ui-resizable-e, + &.ui-resizable-e, &.ui-resizable-w{ cursor: move; position: absolute; font-size: 0.1px; display: block; } - + } - + &.resize-hover .ui-resizable-handle{ background: rgba(182, 242, 253, .2); - + } &.width-resizing .ui-resizable-handle{ background: rgba(182, 242, 253, .4); } - - - + + + .ui-resizable-e{ cursor: e-resize; border-left: 1px dashed @editorBorder; width: 5px; right: -6px; top: 0; - height: 100%; + height: 100%; } - + .ui-resizable-w{ cursor: w-resize; border-right: 1px dashed @editorBorder; width: 5px; left: -6px; top: 0; - height: 100%; + height: 100%; } - + &.width-resize-edge{ .ui-resizable-e{ - + border-left: 1px dashed @editorBorder; - - right: 0; + + right: 0; } .ui-resizable-w{ - + border-right: 1px dashed @editorBorder; - + left: 0; - + } } - + .footer .pl-content{ border-bottom: 1px dashed @editorBorder; } - + } // Need to refresh the page banner // -------------------------------------------------- .pl-refresh-banner{ - display: block; + display: block; padding: 20px; text-align: center; font-weight: bold; @@ -473,7 +473,7 @@ .banner-content{ width: 130px; margin: 0 auto; - .btn, + .btn, .banner-frame{ box-shadow: inset 1px 1px 0 rgba(255,255,255.2), 1px 1px 0 rgba(255,255,255.4); border:1px solid rgba(0,0,0,.3); @@ -487,14 +487,14 @@ } } } - + } // Toolbox/Toolbar // -------------------------------------------------- #toolbox-activate{ - position: fixed; + position: fixed; display: block; bottom: 15px; left: 15px; @@ -509,7 +509,7 @@ .border-radius(4px); cursor: pointer; color:#000; - text-shadow: 0 1px 0 #fff; + text-shadow: 0 1px 0 #fff; &:hover{ .buttonBackground(#e1e1e1, #ccc); border-color:#999; @@ -519,20 +519,20 @@ .buttonBackground(#bbb, #ddd); border-color:#999; } - i{ + i{ color: #0083e8; } .txt{margin-left: 5px;} } #PageLinesToolbox.pl-toolbox{ - position: fixed; + position: fixed; bottom: 0; color: #000; background: #fff; font-size: 13px; line-height: 21px; width: 100%; - z-index: 10000; + z-index: 10000; min-width: 760px; font-family: @defaultFont; h1, h2, h3, h4, h5, h6{ @@ -552,9 +552,9 @@ padding: .7em; } .resizer-handle{ - position: absolute; - height: 4px; - top: -4px; + position: absolute; + height: 4px; + top: -4px; width: 100%; cursor: row-resize; &:hover, @@ -563,28 +563,28 @@ } } .toolbox-handle{ - + @media (max-width: 1164px) { .btn-toolbox .txt{ display: none; } } - + text-align: left; .buttonBackground(#eee, #ddd); box-shadow: inset 1px 1px 0 rgba(255,255,255,.8), 0 1px 3px rgba(0,0,0,.2); border-top: 1px solid #999; border-bottom: 1px solid #999; font-weight: bold; - text-shadow: 0 1px 0 #fff; + text-shadow: 0 1px 0 #fff; height: 28px; line-height: 28px; font-size: 13px; - padding: 0 20px 0 24px; - + padding: 0 20px 0 24px; + .user-select(none); - - + + ul.controls{ float: left; margin-left: 11px; @@ -595,7 +595,7 @@ border-left: 1px solid transparent; border-right: 1px solid transparent; overflow: hidden; - + width: 150px; height: 28px; > li { @@ -614,28 +614,28 @@ border-right: 1px solid transparent; padding: 0 4px; overflow: hidden; - - - } - + + + } + } } - + } - + &.send-right{ float: right; margin-right: 0; } - + > lh{ line-height: 28px; padding: 0 5px 0 25px; - color: #aaa; + color: #aaa; border-right: 1px solid #cdcdcd; i{display: block;} } - > li, + > li, > lh{ position: relative; // dropdown float: left; @@ -649,7 +649,7 @@ .icon-caret-right:before{ content: "\f0d8"; } - + } } > li { @@ -659,7 +659,7 @@ padding: 0 8px; } } - + > .btn-toolbox{ vertical-align: middle; display: block; @@ -668,9 +668,9 @@ font-size: 11px; line-height: 28px; cursor: pointer; - border-left: 1px solid #fff; + border-left: 1px solid #fff; border-right: 1px solid #AAA; - + > i{ margin-top: -4px; font-size: 1.4em; @@ -687,11 +687,11 @@ height: 28px; #gradient > .vertical(#eee, #ddd); } - + &:hover{ .buttonBackground(#eee, #ccc); - border-left: 1px solid #fff; + border-left: 1px solid #fff; border-right: 1px solid #AAA; } &:active{ @@ -701,7 +701,7 @@ &.active-tab{ .buttonBackground(#e1e1e1, #bbb); - border-left: 1px solid #fff; + border-left: 1px solid #fff; border-right: 1px solid #AAA; box-shadow: inset 0 1px 0 #fff; i{ @@ -718,10 +718,10 @@ } &.btn-closer, &.btn-pl-toggle{ - color: #999; + color: #999; border-left: 1px solid transparent; border-right: 1px solid transparent; - position: absolute; + position: absolute; left: -36px; padding: 0 7px; &:hover{ @@ -735,11 +735,11 @@ } } - - - + + + } - + .btn-state span, .update-state{ line-height: 26px; @@ -752,14 +752,14 @@ box-shadow: inset 0 0 2px rgba(0,0,0,.4); vertical-align: middle; margin: -3px 0 0 0; - + } - - + + .btn-state span { box-shadow: 0 1px 0 #fff, inset 0 0 2px rgba(0,0,0,.4); } - + .state-list{ li a{ cursor: pointer; } .li-state-clean, @@ -771,22 +771,22 @@ display: none; } } - + #stateTool, #stateTool.clean { .li-state-clean{ display: block; } } #stateTool.local{ .li-state-clean{ display: none; } .li-state-local{ display: block; } - .state-tag, + .state-tag, .state-draft.local{ background: rgba(255, 0, 5, .4); } - } + } #stateTool.global{ .li-state-clean{ display: none; } .li-state-global{ display: block; } - .state-tag, + .state-tag, .state-draft.global{ background: rgba(22, 134, 243, .5); } @@ -794,7 +794,7 @@ #stateTool.type{ .li-state-clean{ display: none; } .li-state-type{ display: block; } - .state-tag, + .state-tag, .state-draft.type{ background: rgba(255, 196, 23, .4); } @@ -802,7 +802,7 @@ #stateTool.multi{ .li-state-clean{ display: none; } .li-state-multi{ display: block; } - .state-tag, + .state-tag, .state-draft.multi{ background: rgba(139, 22, 243, .4); } @@ -810,25 +810,25 @@ #stateTool.unsaved{ .li-state-clean{ display: none; } .li-state-unsaved{ display: block; } - .state-tag, + .state-tag, .state-draft.unsaved{ background: rgba(0, 0, 0, .9); } } - - + + } .toolbox-panel-wrap{ overflow: hidden; } - + .toolbox-panel{ .transition(margin-bottom .5s); color: #000; opacity:0; - &.in { - margin-bottom: 0; + &.in { + margin-bottom: 0; opacity: 1; } margin-bottom: -20%; @@ -837,14 +837,14 @@ overflow: scroll; background:#FFF; .toolbox-content{ - background:#fff; - + background:#fff; + min-height: 300px; .error-panel { font-size: 1.6em; color: #CCC; - font-weight: bold; - text-align: center; + font-weight: bold; + text-align: center; padding: 50px 25px; } } @@ -852,7 +852,7 @@ overflow: hidden; display: none; } - + .tabs-wrap{ margin-bottom: -99999px; padding-bottom: 99999px; @@ -866,17 +866,17 @@ border-top: 1px solid #889cb4; } .tabs-nav{ - + overflow-y:scroll; font-weight: 800; font-size: 1em; - + lh{ color: #889cb4; text-shadow: 0 1px 0 rgba(255,255,255,.6); font-size: .85em; letter-spacing: .05em; - text-transform: uppercase; + text-transform: uppercase; padding: 10px 10px 5px 15px; display: block; } @@ -909,32 +909,32 @@ font-size: .8em; } } - - &.ui-state-active a{ + + &.ui-state-active a{ .buttonBackground(@btnPrimaryBackground, @btnPrimaryBackgroundHighlight); box-shadow: inset 1px 1px 0px rgba(255,255,255,.2), 0 1px 3px rgba(0,0,0,.2); border-top-color: 1px solid @btnBorder; border-bottom-color: darken(@btnBorder, 10%); - color:#fff; + color:#fff; text-shadow: 0 -1px 0 rgba(0,0,0,.7); .ltl{ - color: rgba(255,255,255,.7); + color: rgba(255,255,255,.7); } } - - + + } } .tab-panel{ display: table-cell; width: 10000px; .tab-panel-inner{ - + min-height: 300px; padding: 15px 35px 35px 235px; legend{ font-size: 15px; - line-height: 30px; + line-height: 30px; font-weight:bold; margin-bottom: 10px; .clip-desc{ @@ -948,21 +948,21 @@ float: right; } } - + } - p, - ul, + p, + ul, ol{ font-size: 1em; } - + .opt{ border: 1px solid #ccc; - background:#fcfcfc; + background:#fcfcfc; margin: 0 15px 15px 0; float: left; width: 300px; - .border-radius(5px); + .border-radius(5px); overflow: hidden; &.opt-span-2{ width: 615px; @@ -976,15 +976,15 @@ max-width: 600px; border: none; } - + &.codetext{ width: 100%; textarea{ height: 600px; } - + .codetext-label{ - float:left; + float:left; margin: 5px 0 0 0; } .codetext-help{float: right; margin: 0; background: transparent;} @@ -998,7 +998,7 @@ #gradient > .vertical(#f7f7f7, #eee); box-shadow: inset 1px 1px 0 #fff; border-bottom: 1px solid #ccc; - text-shadow: 0 1px 0 #fff; + text-shadow: 0 1px 0 #fff; padding: 2px 10px; font-size: 11px; font-weight: bold @@ -1016,30 +1016,30 @@ img{ max-width: 100%; - + } } - - + + } - + } .help-block{ font-size: 11px; line-height: 1.45em; margin: 1em 0; color: #000; - background: #f7f7f7; - text-shadow: 0 1px 0 #fff; + background: #f7f7f7; + text-shadow: 0 1px 0 #fff; padding: 7px; ul, ol{ padding-left: 16px; } } .opt-ref{ - margin-bottom: 1em; + margin-bottom: 1em; .help-block{ - + display: none; } } @@ -1049,7 +1049,7 @@ font-size: 1.2em; } } - + .x-list .x-item{ width: 120px; margin: 5px 15px 5px 5px; @@ -1068,13 +1068,13 @@ } .x-item-pad{ padding: 10px 7px 15px 15px; - .border-radius(10px); + .border-radius(10px); border:1px solid #ddd; border-right: 1px solid #BBB; - border-bottom: 1px solid #BBB; + border-bottom: 1px solid #BBB; #gradient > .vertical(#fff, #eee); - box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 rgba(255,255,255,.5); - text-shadow: 0 1px 0 #fff; + box-shadow: inset 1px 1px 0 #fff, inset -1px -1px 0 rgba(255,255,255,.5); + text-shadow: 0 1px 0 #fff; .x-item-text{ padding: 0; font-size: 13px; @@ -1082,7 +1082,7 @@ .x-name{ font-size: 16px; line-height: 1.4em; - + } .x-item-sub{ margin: 5px 0; @@ -1091,21 +1091,21 @@ } .x-item-actions{ margin-top: 5px; - button, + button, .btn-group{ margin-bottom: 5px; text-transform:capitalize; } .dropdown-menu a .badge{display: none; font-weight: normal;} - - .posttype-tag, + + .posttype-tag, .global-tag, .the-active-template{ display: none; } &.active-template{ .load-template{ - display: none; + display: none; } .the-active-template{ display: inline-block; @@ -1116,16 +1116,16 @@ .dropdown-menu a.global-link{ .badge{ display: inline; } .not-active{display: none;} - } - } + } + } &.active-type{ .posttype-tag{display: inline-block;} .dropdown-menu a.posttype-link{ .badge{ display: inline; } .not-active{display: none;} - } + } } - + } } } @@ -1133,17 +1133,17 @@ .x-item-frame{ opacity: .4; } - + &:hover{ cursor: not-allowed; } } &.x-pane{ - font-size: 14px; + font-size: 14px; line-height: 1.5em; .x-pane-pad{ padding-left: 10px; - + } - + width: 480px; .x-pane-frame{ margin-bottom: 20px; @@ -1171,11 +1171,11 @@ box-shadow: 0 1px 6px rgba(0,0,0,.6); .pl-vignette:after{ #gradient > .vertical(rgba(255,255,255,.1), rgba(0,0,0,.2)); - box-shadow: inset -1px -1px rgba(255,255,255,.2); + box-shadow: inset -1px -1px rgba(255,255,255,.2); } } &:active{ - + box-shadow: none; .pl-vignette:after{ #gradient > .vertical(rgba(0,0,0,.2), rgba(0,0,0,.1)); @@ -1183,11 +1183,11 @@ } .pl-vignette{.border-radius( 10px ); overflow: hidden;} .pl-vignette:after{ - + .border-radius( 10px ); box-shadow: inset 1px 1px 0 rgba(255,255,255,.5), inset -1px -1px 0 rgba(255,255,255,.5); #gradient > .vertical(transparent, rgba(0,0,0,.1)); - + } } .x-item-text{ @@ -1200,7 +1200,7 @@ font-weight: normal; } } - img{ + img{ max-width: 100%; } .title{ @@ -1241,18 +1241,18 @@ width: 270px; margin: 10px; } - + } - - + + .pl-vignette{ width: 100%; } .faux-img{ - width: 100%; + width: 100%; padding-bottom: 65%; #gradient > .vertical( #fff, #f7f7f7 ); - + vertical-align: top; .txt{ line-height: 100%; @@ -1261,19 +1261,19 @@ color: #444; } } - + } .ui-tabs .ui-tabs-hide{ display: none; } } - + .live-wrap { box-shadow: inset 0 0 8px rgba(0,0,0,.35); padding: 10px; background:#fff; border:1px solid #fff; - + iframe { width: 100%; height: 100%; @@ -1297,7 +1297,7 @@ } .arrow{ border-top-color: rgba(0,0,0,.2); - + } } @@ -1309,8 +1309,8 @@ font-size: 18px; margin: 9px 0; font-weight: bold; - } - + } + } .modal-footer{ padding: 7px; @@ -1402,7 +1402,7 @@ -// FOR LATER USE +// FOR LATER USE // Fine Image Upload @@ -1418,7 +1418,7 @@ width: 100%; } -.qq-upload-drop-area, +.qq-upload-drop-area, .qq-upload-extra-drop-area { position: absolute; top: 0; diff --git a/less/pl-objects.less b/less/pl-objects.less index b8bfd041..cebf2982 100644 --- a/less/pl-objects.less +++ b/less/pl-objects.less @@ -1,57 +1,57 @@ /* PAGELINES CSS OBJECTS - CSS Objects for repeated use as utilities in other objects. + CSS Objects for repeated use as utilities in other objects. Must be generalized and have wide usage capability. */ -/* +/* * @ Clearing Floats **********************************************************************/ .fix{ .clearfix(); } - -/* + +/* * @ Lists **********************************************************************/ /* @ Inline List - Horizontal non-floated navigation/menu */ -ul.inline-list { - list-style-type: none; - li { - display: inline ; - padding: 0px 3px; +ul.inline-list { + list-style-type: none; + li { + display: inline ; + padding: 0px 3px; } } /* @ 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 */ li, lh{ - margin: 0; - padding: 0; + margin: 0; + padding: 0; float: left; a{ display: block; } } } -/* +/* * @ Media / Image Format **********************************************************************/ .media{ overflow:hidden; - overflow: visible; + overflow: visible; zoom: 1; .bd{ - display:table-cell; - vertical-align: top; - width: 10000px; - *display:block; - *width:auto; + display:table-cell; + vertical-align: top; + width: 10000px; + *display:block; + *width:auto; zoom:1; } .bd > :first-child{margin-top:0;} @@ -61,17 +61,17 @@ ul.tabbed-list { margin-right: 15px; text-align: center; &.rtimg{ - float:right; + float:right; margin-left: 15px; } - + img{ - display: inline-block; + display: inline-block; vertical-align: bottom; - max-width: 100%; - height: auto; + max-width: 100%; + height: auto; width: auto\9; - + } .thumbnail{ display: inline-block; @@ -80,14 +80,14 @@ ul.tabbed-list { .border-radius(4px); .box-shadow(0 1px 3px rgba(0,0,0,.055)); .transition(all .2s ease-in-out); - + &[href]:hover{ border-color: @linkColor; .box-shadow(0 1px 4px rgba(0,105,214,.25)); } } } - + } /* @@ -116,13 +116,13 @@ ul.tabbed-list { * @ Supplemental Percentage based GRID *******************************************/ - .pprow { - width: 100%; + .pprow { + width: 100%; margin: 0 auto; } - .pp2, - .pp3, - .pp4, + .pp2, + .pp3, + .pp4, .pp5, .pp6 { margin: 0; @@ -130,13 +130,13 @@ ul.tabbed-list { margin-right: 4%; float: left; border: none; - .transition(all .2s linear); + .transition(all .2s linear); } .pp3{ margin-right: 3%; } - .pp4, - .pp5, + .pp4, + .pp5, .pp6{ margin-right: 2%; } @@ -161,7 +161,7 @@ ul.tabbed-list { .pp6 { width: 16.66666667%; } } - @media screen and (max-width:650px) { + @media screen and (max-width:650px) { .responsive #site{ .pp2, .pp3, .ppfree{ width: 100%; @@ -178,7 +178,7 @@ ul.tabbed-list { } } - @media screen and (max-width:700px) { + @media screen and (max-width:700px) { .responsive #site{ .pp4, .pp5, .pp6{ width: 100%; @@ -189,24 +189,24 @@ ul.tabbed-list { -/* +/* * @ Banners and Booming Text * TODO refactor to boomboard **********************************************************************/ -.boomboard{ - padding: 100px; - min-height: 350px; - h2.hugetext { +.boomboard{ + padding: 100px; + min-height: 350px; + h2.hugetext { font-size: 8em; } } -.billboard { - padding: 60px 15px; - margin: 0 0 2.5em 0; +.billboard { + padding: 60px 15px; + margin: 0 0 2.5em 0; } .banner_pad{ - padding: 2em; + padding: 2em; text-align: center; } .banner_title.wicon{ @@ -215,15 +215,15 @@ ul.tabbed-list { background-position: 0 4px; background-repeat: no-repeat; } - + .setup-section{ padding: 8px 0 10px; background: @baseContrastSlight; text-align: center; line-height: 1.5em; } - -/* + +/* * @ Printing Debug Information **********************************************************************/ .plprint{ @@ -238,7 +238,7 @@ ul.tabbed-list { } -/* +/* * @ Grid Formatting and Elements **********************************************************************/ .grid-element, .media_overview{ margin-bottom: 12px; } @@ -247,7 +247,7 @@ ul.tabbed-list { } .grid-img-pad{ width: 100%; - float:left; + float:left; } .vignette{position: relative;} @@ -272,13 +272,13 @@ ul.tabbed-list { padding: 3px 7px 4px; line-height: 1em; } - -/* + +/* * @ Hovercards **********************************************************************/ .hovercard { - position: absolute; - bottom: 20px; + position: absolute; + bottom: 20px; background: rgba(0,0,0, .6); text-shadow: none; color:#fff; @@ -290,28 +290,28 @@ ul.tabbed-list { bottom: 15px; } -/* +/* * @ Supersized Backgrounds **********************************************************************/ #supersized-loader { .hidden } -#supersized { - position:fixed; - left:0; - top:0; - overflow:hidden; - z-index:-999; - height:100%; +#supersized { + position:fixed; + left:0; + top:0; + overflow:hidden; + z-index:-999; + height:100%; width:100%; background-size: cover; - img{ - height:auto; - width:auto; - position:relative; - outline:none; - border:none; + img{ + height:auto; + width:auto; + position:relative; + outline:none; + border:none; -ms-interpolation-mode:bicubic; - image-rendering: optimizeQuality; + image-rendering: optimizeQuality; } } diff --git a/less/pl-plugins.less b/less/pl-plugins.less index 2f4288b7..deae768c 100644 --- a/less/pl-plugins.less +++ b/less/pl-plugins.less @@ -13,7 +13,7 @@ line-height: 1px; } } - .winner { + .winner { width:100%; } .wp125ad{ @@ -21,14 +21,14 @@ width: auto; float: left; max-width: 50%; - a{ + a{ margin: 6px; padding: 5px; margin: 2px 5px 5px 5px; display: inline-block; border: 1px solid transparent; - background: @light-base; - border: 1px solid lighten(@light-base, 4); + background: @light-base; + border: 1px solid lighten(@light-base, 4); box-shadow: 0 1px 2px rgba(0,0,0, .4); img{ width: 125px; @@ -36,9 +36,9 @@ display: block; box-shadow: 0 1px 2px lighten(@light-base, 8); } - + &:hover{ - background: lighten(@light-base, 4); + background: lighten(@light-base, 4); } } } @@ -66,36 +66,36 @@ /* FlickrRSS Widget */ .widget_flickrRSS{ &.widget{ - ul{ - margin: 7px 0px 0px 0px; + ul{ + margin: 7px 0px 0px 0px; li{display:inline-block;padding:0;margin:0;border-bottom:none;} } } a{ - display: inline-block; - margin: 8px 12px 2px 5px; + display: inline-block; + margin: 8px 12px 2px 5px; img{ display: block; font-size: 10px; border-width: 0px 1px 1px 0px; - border-style:solid; - padding: 3px; + border-style:solid; + padding: 3px; } } } -.widget_flickrRSS a img, -.srp-widget-thmblink{ - background: @light-base; - border: 1px solid lighten(@light-base, 4); +.widget_flickrRSS a img, +.srp-widget-thmblink{ + background: @light-base; + border: 1px solid lighten(@light-base, 4); box-shadow: 0 1px 2px rgba(0,0,0, .4); } .widget_flickrRSS a img:hover{ - background: lighten(@light-base, 4); + background: lighten(@light-base, 4); } -/* @ Special Posts */ +/* @ Special Posts */ .widget { div.srp-widget-singlepost{ @@ -111,8 +111,8 @@ .srp-widget-date{ color: fadeout(@pl-text, 40%); } - div.srp-thumbnail-box{ - padding-right: 15px; + div.srp-thumbnail-box{ + padding-right: 15px; } } @@ -188,8 +188,8 @@ .cf_hidden {display: none;} .success { - padding: 15px; - margin-bottom: .5em; + padding: 15px; + margin-bottom: .5em; font-size:1.4em; background-color: @dark-base; } @@ -204,7 +204,7 @@ } -/* Contact Forms 7 */ +/* Contact Forms 7 */ #page { div.wpcf7-mail-sent-ok{ @@ -213,14 +213,14 @@ } span.wpcf7-not-valid-tip{ border:1px solid @warningBorder; - background: @warningBackground; + background: @warningBackground; } div.wpcf7-validation-errors{ border: 1px solid @errorBorder; background: @errorBackground; } div.wpcf7-mail-sent-ok, - span.wpcf7-not-valid-tip, + span.wpcf7-not-valid-tip, div.wpcf7-validation-errors{ text-shadow: 0 1px 0 rgba(255,255,255,.8); text-align: center; diff --git a/less/pl-structure.less b/less/pl-structure.less index a083b910..48729183 100644 --- a/less/pl-structure.less +++ b/less/pl-structure.less @@ -2,11 +2,11 @@ * PAGELINES STRUCTURE AND RESPONSIVE ***********************************/ -body { - position:relative; +body { + position:relative; zoom:1; background: @bodyBackground; -} +} @@ -63,59 +63,59 @@ body .pl-area .pl-section{ /* * PAGELINES LEAF ***********************************/ -#cred { +#cred { text-align: center; - padding: 15px; - a.plimage img{ + padding: 15px; + a.plimage img{ max-width: 45px; } } -/* +/* * RESPONSIVE: GLOBAL ****************************************/ body{ - + // Images .pl-content img { - max-width: 100%; - height: auto; + max-width: 100%; + height: auto; width: auto\9; /* ie8 */ } .ie8 img { width: auto; height: auto; } - - // Media + + // Media .hentry{ - iframe, - video, + iframe, + video, object{ max-width: 100%; } } - + } -/* +/* * RESPONSIVE: TABLET ****************************************/ @media screen and ( max-width:@resPortraitTablet ){ - + .responsive{ - + } } -/* +/* * RESPONSIVE: PHONE ****************************************/\ -@media screen and ( max-width : @resPhoneLandscape ) { +@media screen and ( max-width : @resPhoneLandscape ) { .responsive{ - + } } diff --git a/less/pl-tables.less b/less/pl-tables.less index 55b33977..486c54fa 100644 --- a/less/pl-tables.less +++ b/less/pl-tables.less @@ -21,7 +21,7 @@ table { font-size:@baseFontSize; font-weight:bold; } - + td { color: lighten(@pl-text,10); line-height: @baseLineHeight - 3; diff --git a/less/pl-wordpress.less b/less/pl-wordpress.less index 959ad526..dd15eeb2 100644 --- a/less/pl-wordpress.less +++ b/less/pl-wordpress.less @@ -3,7 +3,7 @@ // ---------------------------------------------------------------------- /* @ Post Navigation */ -.post-nav, +.post-nav, .current_posts_info { clear: both; padding:5px 10px; @@ -14,7 +14,7 @@ color: @textColorSubtle; &:hover{ color: @textColor; - + } } .previous a { @@ -36,7 +36,7 @@ background-size: 16px 16px; } } - + } /* @ Widgets Default Formatting */ @@ -48,30 +48,30 @@ margin-bottom: 1em; background-color: @baseContrastSlight; border: 1px solid @baseContrastDark; - .wp-caption-text { - font-size: 11px; + .wp-caption-text { + font-size: 11px; line-height: 16px; - text-align: center; + text-align: center; margin:0; - padding:6px 0 2px; + padding:6px 0 2px; } - img { + img { display: inline-block; - margin: 0; + margin: 0; padding: 2px; - border: 0 none; + border: 0 none; background: rgba(255,255,255,.6); .box-sizing(border-box); - + } - .wp-caption-dd { - font-size: 11px; - line-height: 17px; - padding: 0 4px 5px; + .wp-caption-dd { + font-size: 11px; + line-height: 17px; + padding: 0 4px 5px; margin: 0; } } - + /* WordPress Calendar */ #wp-calendar{ overflow: hidden; @@ -94,9 +94,9 @@ font-weight: normal; font-weight: bold; } - thead th { + thead th { background-color: lighten(@dark-base, 1.6); - padding: 2px; + padding: 2px; font-size: .9em; } td{ @@ -111,7 +111,7 @@ // Align Search Left In Widgets .widget { margin: 0; - + .widget-title{ > a{ color: inherit; } text-align:left; @@ -138,9 +138,9 @@ &.widget_recent_comments li{ padding: 4px; } - .textwidget { - padding: 5px 2px; - + .textwidget { + padding: 5px 2px; + > p{ font-size: @fontSizeSmall; &:first-child{ @@ -151,33 +151,33 @@ } } } - ul { - margin:0 0 10px .4em; + ul { + margin:0 0 10px .4em; font-size: @fontSizeSmall; &.sub-menu{ margin:0px; } li{ - + list-style:none; display: block; padding: 0 2px; - a:hover{ - text-decoration: underline; + a:hover{ + text-decoration: underline; } - ul li{ - margin-left: .3em; + ul li{ + margin-left: .3em; } } } - + } // Not needed? .pprow .widget { margin:0; } -ul.sidebar_widgets{ +ul.sidebar_widgets{ list-style-type: none; } @@ -185,17 +185,17 @@ ul.sidebar_widgets{ /* @ Comments */ -.wp-comments{ - margin: 1em 0 0; +.wp-comments{ + margin: 1em 0 0; padding-top: 40px; margin-top: -40px; - .wp-comments-pad{ - padding: 10px 0; + .wp-comments-pad{ + padding: 10px 0; > #respond{ input[type="text"], textarea{ background: @baseContrastSlight; border: 1px solid darken(@baseContrastSlight, 10); - color: @pl-text; + color: @pl-text; } } } @@ -204,25 +204,25 @@ ul.sidebar_widgets{ #respond{ margin: 20px 0; text-align: left; - form{ + form{ margin-left: 27px; } #reply-title { padding-left: 25px; background:url(@{plRoot}/sections/comments/icon-reply@2x.png) no-repeat 0 50%; background-size: 17px; - small{ + small{ font-size: @miniFontSize; a{color: @pl-link;} } } - #commentform { - margin-top: 10px; + #commentform { + margin-top: 10px; p{ margin: 0 0 10px; } - small { - font-size: 90%; + small { + font-size: 90%; } label{ display: inline; @@ -239,9 +239,9 @@ ul.sidebar_widgets{ .required{ color: fadeout(@pl-text, 40%); } - - p.logged-in-as, - p.comment-form-comment, + + p.logged-in-as, + p.comment-form-comment, p.form-submit{ margin: .3em 0; } @@ -250,13 +250,13 @@ ul.sidebar_widgets{ } } } - + p.form-allowed-tags{ width: auto; margin-bottom: 1.6em; - font-size: .85em; + font-size: .85em; code{ - background: transparent; + background: transparent; border: none; display: block; font-size: 10px; @@ -265,57 +265,57 @@ p.form-allowed-tags{ padding: 0; } } - + .nocommentform{ - display:none; + display:none; } /* List of Comments */ -#comments-title { +#comments-title { padding-left: 22px; - background:url(@{plRoot}/sections/comments/icon-comment@2x.png) no-repeat 0 30%; + background:url(@{plRoot}/sections/comments/icon-comment@2x.png) no-repeat 0 30%; background-size: 17px 17px; } - + .commentlist { list-style-type:none; margin: 10px 0px 10px 18px; line-height: 1.6em; padding-left: 75px; - + p{ - margin: 0px 0 1em 5px; + margin: 0px 0 1em 5px; } > li { margin-bottom: 1em; } - li{ + li{ padding: 10px 20px 10px 10px; background: @baseContrastSlight; - + li.alt{ background: lighten(@baseContrastSlight, 3); } } - img.avatar { + img.avatar { box-shadow: 0 1px 2px rgba(0,0,0,.2); - background: @baseContrastSlight; - float: left; - margin: -5px 5px 5px -85px; - position: relative; + background: @baseContrastSlight; + float: left; + margin: -5px 5px 5px -85px; + position: relative; padding: 2px; .box-sizing(border-box); } - cite { - font-weight: bold; + cite { + font-weight: bold; font-style: normal; } .comment-author{ font-size: 1.1em; } .comment-awaiting-moderation{ - background: @baseContrast; + background: @baseContrast; color: @textColorSubtle; padding: 0 5px; display: inline-block; @@ -337,7 +337,7 @@ p.form-allowed-tags{ display: inline-block; font-size: 10px; line-height: 15px; - background: @baseContrast; + background: @baseContrast; color: @textColorSubtle; padding: 1px 8px; opacity: .8; @@ -345,7 +345,7 @@ p.form-allowed-tags{ opacity: 1; } &:active{ - opacity: .8; + opacity: .8; } } } @@ -355,7 +355,7 @@ p.form-allowed-tags{ .comment-body{ padding-left: 50px; } - img.avatar { + img.avatar { width: 40px; margin-top: 0; margin-left: -50px; @@ -385,8 +385,8 @@ p.form-allowed-tags{ /* Search Reader Text */ .screen-reader-text { - display:none; -} + display:none; +} #wpstats{ width:0px; height:0px; diff --git a/less/reset.less b/less/reset.less index b4e16c24..807fceec 100755 --- a/less/reset.less +++ b/less/reset.less @@ -11,7 +11,7 @@ html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abb outline:0; font-size:100%; vertical-align:baseline; - background:transparent; + background:transparent; } body{ @@ -20,7 +20,7 @@ body{ ol,ul{ list-style:none } -blockquote, q{ +blockquote, q{ quotes:none } blockquote:before,blockquote:after,q:before,q:after{ @@ -41,7 +41,7 @@ del{ table{ border-collapse:collapse; - border-spacing:0; + border-spacing:0; } diff --git a/less/responsive.less b/less/responsive.less index 22479e0f..d42119c9 100644 --- a/less/responsive.less +++ b/less/responsive.less @@ -141,7 +141,7 @@ } // Make all columns even .row > [class*="span"], - .row-grid > [class*="span"], + .row-grid > [class*="span"], .editor-row > [class*="span"]{ float: none; display: block; diff --git a/less/thumbnails.less b/less/thumbnails.less index b3d7bf73..03df9658 100644 --- a/less/thumbnails.less +++ b/less/thumbnails.less @@ -1,9 +1,9 @@ // Make wrapper ul behave like the grid -body .pl-thumbnails, +body .pl-thumbnails, body .gallery{ margin-left: -@gridGutterWidth; list-style: none; - + .clearfix(); > li{ float: left; // Explicity set the float since we don't require .span* classes @@ -34,7 +34,7 @@ body .gallery{ color: @textColorAlt; } } - + } #gallery-1 img { border: none!important; diff --git a/less/tooltip-popover.less b/less/tooltip-popover.less index 3bf941ae..4320f22a 100644 --- a/less/tooltip-popover.less +++ b/less/tooltip-popover.less @@ -72,7 +72,7 @@ border-bottom: 1px solid darken(@popoverTitleBackground, 5%); .border-radius(5px 5px 0 0); } - + } diff --git a/less/typography.less b/less/typography.less index f66e5ab1..05987fa2 100755 --- a/less/typography.less +++ b/less/typography.less @@ -6,14 +6,14 @@ // BODY TEXT // --------- body{ - font-size: @baseFontSize; + font-size: @baseFontSize; font-family: @baseFontFamily; font-weight: @baseFontWeight; - line-height: @propLineHeight; + line-height: @propLineHeight; color: @textColor; } -// PARAGRAPH +// PARAGRAPH // --------- p { margin: @propLineHeight 0; @@ -23,8 +23,8 @@ p { font-size: @baseFontSize - 2; line-height: @baseLineHeight / 2; } - - // SPECIAL FIXES + + // SPECIAL FIXES // fix for minimum paragraph widths &:before{ @@ -40,14 +40,14 @@ p { orphans: 4; } -// Links -// --------- +// Links +// --------- a{ color: @linkColor; &:hover{ color: @linkColorHover; } -} +} @@ -74,20 +74,20 @@ big { font-size: 1.3em; } -abbr, -acronym{ - border-bottom: .1em dotted; +abbr, +acronym{ + border-bottom: .1em dotted; cursor: help; } -q:before, -q:after{ +q:before, +q:after{ content: "'"; } // CODE / PRE // ---------- -code, +code, pre { padding: 0 3px 2px; font-family: @codeFont; @@ -112,14 +112,14 @@ pre { padding: 0; color: inherit; background-color: transparent; - border: 0; + border: 0; } &.pre-scrollable { max-height: 340px; overflow-y: scroll; } } - + // HEADINGS // -------- @@ -127,7 +127,7 @@ h1, h2, h3, h4, h5, h6 { margin: 0; text-rendering: optimizelegibility; // Fix the character spacing for headings font-family: @headingsFontFamily; - font-weight: @headingsFontWeight; + font-weight: @headingsFontWeight; line-height: 130%; small { font-weight: normal; @@ -141,13 +141,13 @@ h1, h2, h3, h4, h5, h6 { } .subhead{ color: @textColorAlt; - font-size: @smallerText; + font-size: @smallerText; } // HEADINGS SIZING // --------------- -h1, +h1, .fpost .entry-title { font-size: @h1Size; small { @@ -192,7 +192,7 @@ h1, h2, h3, h4, h5, h6 { } /* @ Header Special Cases */ -h1 + img, +h1 + img, h2 + img{ margin-top:1em; } @@ -231,7 +231,7 @@ ul{ // HENTRY = Standard Long Form Text Formatting // ------------------------------------------------- .hentry{ - + ul, ol{ padding: 0; // margin: 0 0 @baseLineHeight / 2 25px; @@ -249,7 +249,7 @@ ul{ ul{ list-style:disc; } - + h1, h2{ margin: 1em 0; } @@ -360,14 +360,14 @@ em { // Special Ampersand .spamp{ - font-family: 'Baskerville', Palatino, georgia; + font-family: 'Baskerville', Palatino, georgia; font-style: italic; font-weight: normal; } // Serif Style .serifize{ - font-family: georgia, times, serif; + font-family: georgia, times, serif; font-style: italic; font-weight: normal; } diff --git a/less/utilities.less b/less/utilities.less index b3d67c6a..a0ee7b69 100644 --- a/less/utilities.less +++ b/less/utilities.less @@ -3,7 +3,7 @@ // ----------- // Image Frame // ----------- -.pl-imageframe img, +.pl-imageframe img, img.pl-imageframe { padding: 4px; background: @baseLighter; @@ -31,11 +31,11 @@ img.pl-imageframe { } .zb { - border:none !important; // We have to declare importance + border:none !important; // We have to declare importance } .tac { - text-align:center !important; // We have to declare importance + text-align:center !important; // We have to declare importance } // ----------- @@ -71,19 +71,19 @@ code { padding: 2px 4px; } -code, +code, .prettyprint{ background-color: @baseContrastSlight; border: 1px solid @baseContrastDarkMore; } - + .prettify-on .prettyprint.linenums { -webkit-box-shadow: inset 40px 0 0 @dark-base, inset 41px 0 0 @baseContrastDarkMore; -moz-box-shadow: inset 40px 0 0 @dark-base, inset 41px 0 0 @baseContrastDarkMore; box-shadow: inset 40px 0 0 @dark-base, inset 41px 0 0 @baseContrastDarkMore; } - + ol.linenums li{ color: #bebec5; } @@ -134,7 +134,7 @@ pre { } position: relative; padding-bottom: 56.25%; - + height: 0; overflow: hidden; diff --git a/less/variables.less b/less/variables.less index 7abc7a9f..d80c0470 100755 --- a/less/variables.less +++ b/less/variables.less @@ -8,12 +8,12 @@ // Reference --------------- // PORTRAIT TABLET TO DEFAULT -- @media (min-width: 768px) and (max-width: 979px) { } // LARGE DESKTOP & UP -- @media (min-width: 1200px) { } -// PHONE TO NETBOOK & PORTRAIT TABLET -- @media (max-width: 767px) { } -// UP TO LANDSCAPE PHONE -- @media (max-width: 480px) { } -@resLargeDesktop: 1200px; -@resDesktop: 979px; +// PHONE TO NETBOOK & PORTRAIT TABLET -- @media (max-width: 767px) { } +// UP TO LANDSCAPE PHONE -- @media (max-width: 480px) { } +@resLargeDesktop: 1200px; +@resDesktop: 979px; @resPortraitTablet: 767px; -@resPhoneLandscape: 480px; +@resPhoneLandscape: 480px; // Scaffolding @@ -33,7 +33,7 @@ @baseFontWeight: @plBaseWeight; @altFontFamily: @plAltFont; -@altFontWeight: @plAltWeight; +@altFontWeight: @plAltWeight; @headingsFontFamily: @plHeaderFont; // empty to use BS default, @baseFontFamily @headingsFontWeight: @plHeaderWeight; // instead of browser default, bold diff --git a/rtl.css b/rtl.css index 713239bb..7871bd22 100644 --- a/rtl.css +++ b/rtl.css @@ -29,9 +29,9 @@ Description: Starter creating RTL support for Platform. Note, we don't speak or * @todo Fix graphics - 'arrow-ffffff.png', 'shadow.png', and 'more-left.png' */ -body { +body { font-smooth: always; - direction:rtl; + direction:rtl; unicode-bidi: embed; } @@ -44,12 +44,12 @@ div#item-header div#item-header-avatar { } .fpost .post-title h2 { font-size: 1.5em; line-height: 1.6em; } - + .fpost .metabar { text-transform: none; } - -.fpost .post-title h2 a:hover { text-decoration: none; } - + +.fpost .post-title h2 a:hover { text-decoration: none; } + .hentry a:hover { text-decoration: none; } #branding .content-pad { padding: 25px 0 25px 0; } @@ -254,7 +254,7 @@ margin-right:0; .section-callout .content-pad{ padding:30px 0 30px 17px;} -.section-callout .callout_text{ +.section-callout .callout_text{ float: right; } .section-callout .callout_text-pad{ @@ -270,7 +270,7 @@ letter-spacing:0; #footer .widget-title { font-size: 1.1em; } - + /* SubNav Area */ #subnav_row { display: block; diff --git a/sections/banners/section.php b/sections/banners/section.php index 4bbfd83b..c6b5328c 100644 --- a/sections/banners/section.php +++ b/sections/banners/section.php @@ -1,13 +1,13 @@ - - - - __( 'Banners', 'pagelines' ), + 'label' => __( 'Banners', 'pagelines' ), 'singular_label' => __( 'Banner', 'pagelines' ), 'description' => __( 'For creating banners in banner section layouts.', 'pagelines' ), 'menu_icon' => $this->icon ); $taxonomies = array( - $this->taxID => array( - 'label' => __( 'Banner Sets', 'pagelines' ), - 'singular_label' => __( 'Banner Set', 'pagelines' ), + $this->taxID => array( + 'label' => __( 'Banner Sets', 'pagelines' ), + 'singular_label' => __( 'Banner Set', 'pagelines' ), ) ); $columns = array( @@ -76,16 +76,16 @@ function section_persistent(){ "banner-media" => "Media", $this->taxID => "Banner Sets" ); - + $this->post_type = new PageLinesPostType( $this->ptID, $args, $taxonomies, $columns, array(&$this, 'banner_column_display') ); - - + + $this->type_meta_options(); - - + + } - + /** * @@ -101,32 +101,32 @@ function type_meta_options(){ 'selectvalues' => array( 'banner_right' => array('name' => __( 'Banner Right', 'pagelines' ) ), 'banner_left' => array('name' => __( 'Banner Left', 'pagelines' ) ) - ), - 'title' => __( 'Banner Alignment', 'pagelines' ), + ), + 'title' => __( 'Banner Alignment', 'pagelines' ), 'shortexp' => __( 'Put the media on the right or the left?', 'pagelines' ), ), 'the_banner_image' => array( - 'type' => 'image_upload', + 'type' => 'image_upload', 'title' => __( 'Banner Media', 'pagelines' ), 'shortexp' => __( 'Upload an image for the banner.', 'pagelines' ) ), 'banner_text_width' => array( - 'type' => 'count_select', + 'type' => 'count_select', 'count_start' => '1', - 'count_number' => '100', + 'count_number' => '100', 'title' => __( 'Banner Text Width (In %)', 'pagelines' ), 'shortexp' => __( 'Set the width of the text area as a percentage of full content width. The media area will fill the rest.', 'pagelines' ) ), 'the_banner_media' => array( - 'type' => 'textarea', + 'type' => 'textarea', 'title' => __( 'Banner Media', 'pagelines' ), 'shortexp' => __( 'Add HTML Media for the banner, e.g. Youtube embed code. This option is used if there is no image uploaded.', 'pagelines' ) ), 'banner_text_padding' => array( 'version' => 'pro', 'type' => 'text', - 'size' => 'small', + 'size' => 'small', 'title' => __( 'Banner Text Padding', 'pagelines' ), 'shortexp' => __( 'Configure the padding and arrangement of banner text', 'pagelines' ), 'exp' => __( '(optional) Set the padding for the text area. Use CSS shorthand, for example: 25px 30px 25px 35px for top, right, bottom, then left padding.

    Heads Up If you do not set this option, the banner will attempt to vertically align the text for you.', 'pagelines' ) @@ -134,12 +134,12 @@ function type_meta_options(){ ), ); - $post_types = array($this->id); + $post_types = array($this->id); $type_metapanel_settings = array( 'id' => 'banner-metapanel', 'name' => __( 'Banner Setup Options', 'pagelines' ), - 'posttype' => $post_types, + 'posttype' => $post_types, 'hide_tabs' => true ); @@ -163,13 +163,13 @@ function type_meta_options(){ */ function section_optionator( $settings ){ $settings = wp_parse_args($settings, $this->optionator_default); - + $metatab_array = array( - + 'banner_items' => array( 'default' => '5', 'version' => 'pro', - 'type' => 'text_small', + 'type' => 'text_small', 'title' => __( 'Max Number of Banners', 'pagelines' ), 'desc' => __( 'Select the default max number of banners.', 'pagelines' ), 'inputlabel'=> __( 'Number of Banners', 'pagelines' ), @@ -194,7 +194,7 @@ function section_optionator( $settings ){ 'id' => 'banner_page_meta', 'name' => 'Banners', 'icon' => $this->icon, - 'clone_id' => $settings['clone_id'], + 'clone_id' => $settings['clone_id'], 'active' => $settings['active'] ); @@ -204,21 +204,21 @@ function section_optionator( $settings ){ /** * Section template. */ - function section_template() { + function section_template() { // Options $set = ($this->opt('banner_set', $this->oset)) ? $this->opt('banner_set', $this->oset) : null; $limit = ($this->opt('banner_items', $this->oset)) ? $this->opt('banner_items', $this->oset) : null; - + // Actions $b = $this->load_pagelines_banners($set, $limit); - + if(empty($b)){ echo setup_section_notify($this, __( "No Banner posts matched this page's criteria", 'pagelines' ) ); return; } - - + + $this->draw_banners($b, 'banners ' . $set); } @@ -228,22 +228,22 @@ function section_template() { * @TODO document * */ - function draw_banners($b, $class = ""){ ?> + function draw_banners($b, $class = ""){ ?>