['before_widget'] . $style_wrapper; $args['after_widget'] = '' . $args['after_widget']; } if ( !empty($the_widget) && is_a($the_widget, 'WP_Widget') ) { $the_widget->widget($args , $instance ); } else { // This gives themes a chance to display some sort of placeholder for missing widgets echo apply_filters('siteorigin_panels_missing_widget', $args['before_widget'] . $args['after_widget'], $widget, $args , $instance); } } /** * Add the Edit Home Page item to the admin bar. * * @param WP_Admin_Bar $admin_bar * @return WP_Admin_Bar */ function siteorigin_panels_admin_bar_menu($admin_bar){ // Ignore this unless the theme is using the home page feature. if( !siteorigin_panels_setting('home-page') ) return $admin_bar; if( !current_user_can('edit_theme_options') ) return $admin_bar; if( is_home() || is_front_page() ) { if( ( is_page() && get_post_meta( get_the_ID(), 'panels_data', true ) !== '' ) || !is_page() ) { $admin_bar->add_node( array( 'id' => 'edit-home-page', 'title' => __('Edit Home Page', 'siteorigin-panels'), 'href' => admin_url('themes.php?page=so_panels_home_page') ) ); if( is_page() ) { // Remove the standard edit button $admin_bar->remove_node('edit'); } } } return $admin_bar; } add_action('admin_bar_menu', 'siteorigin_panels_admin_bar_menu', 100); /** * Is this a preview. * * @return bool */ function siteorigin_panels_is_preview(){ global $siteorigin_panels_is_preview; return (bool) $siteorigin_panels_is_preview; } /** * Add all the necessary body classes. * * @param $classes * @return array */ function siteorigin_panels_body_class($classes){ if( siteorigin_panels_is_panel() ) $classes[] = 'siteorigin-panels'; if( siteorigin_panels_is_home() ) $classes[] = 'siteorigin-panels-home'; return $classes; } add_filter('body_class', 'siteorigin_panels_body_class'); /** * Enqueue the required styles */ function siteorigin_panels_enqueue_styles(){ // Register the style to support possible lazy loading wp_register_style('siteorigin-panels-front', plugin_dir_url(__FILE__) . 'css/front.css', array(), SITEORIGIN_PANELS_VERSION ); if( is_singular() && get_post_meta( get_the_ID(), true ) != '' ) { wp_enqueue_style('siteorigin-panels-front'); // Enqueue the general layout CSS global $siteorigin_panels_inline_css; if( empty($siteorigin_panels_inline_css) ) $siteorigin_panels_inline_css = array(); $siteorigin_panels_inline_css[ get_the_ID() ] = siteorigin_panels_generate_css( get_the_ID() ); } } add_action('wp_enqueue_scripts', 'siteorigin_panels_enqueue_styles', 1); /** * Render a widget form with all the Page Builder specific fields * * @param string $widget The class of the widget * @param array $instance Widget values * @param bool $raw * @param string $widget_number * @return mixed|string The form */ function siteorigin_panels_render_form($widget, $instance = array(), $raw = false, $widget_number = '{$id}' ){ global $wp_widget_factory; // This is a chance for plugins to replace missing widgets $the_widget = !empty($wp_widget_factory->widgets[$widget]) ? $wp_widget_factory->widgets[$widget] : false; $the_widget = apply_filters( 'siteorigin_panels_widget_object', $the_widget, $widget ); if ( empty($the_widget) || !is_a( $the_widget, 'WP_Widget' ) ) { $widgets = siteorigin_panels_get_widgets(); if( !empty($widgets[$widget]) && !empty( $widgets[$widget]['plugin'] ) ) { // We know about this widget, show a form about installing it. $install_url = siteorigin_panels_plugin_activation_install_url($widgets[$widget]['plugin']['slug'], $widgets[$widget]['plugin']['name']); $form = '
' . '

' . preg_replace( array( '/1\{ *(.*?) *\}/', '/2\{ *(.*?) *\}/', ), array( '$1', '$1' ), sprintf( __('You need to install 1{%1$s} to use the widget 2{%2$s}.', 'siteorigin-panels') , $widgets[$widget]['plugin']['name'], $widget ) ). '

' . '

' . __("Save and reload this page to start using the widget after you've installed it.", 'siteorigin-panels') . '

' . '
'; } else { // This widget is missing, so show a missing widgets form. $form = '

' . preg_replace( array( '/1\{ *(.*?) *\}/', '/2\{ *(.*?) *\}/', ), array( '$1', '$1' ), sprintf( __('The widget 1{%1$s} is not available. Please try locate and install the missing plugin. Post on the 2{support forums} if you need help.', 'siteorigin-panels'), esc_html($widget) ) ). '

'; } // Allow other themes and plugins to change the missing widget form return apply_filters('siteorigin_panels_missing_widget_form', $form, $widget, $instance); } if( $raw ) $instance = $the_widget->update($instance, $instance); $the_widget->id = 'temp'; $the_widget->number = $widget_number; ob_start(); $return = $the_widget->form($instance); do_action_ref_array( 'in_widget_form', array( &$the_widget, &$return, $instance ) ); $form = ob_get_clean(); // Convert the widget field naming into ones that Page Builder uses $exp = preg_quote( $the_widget->get_field_name('____') ); $exp = str_replace('____', '(.*?)', $exp); $form = preg_replace( '/'.$exp.'/', 'widgets[' . preg_replace('/\$(\d)/', '\\\$$1', $widget_number) . '][$1]', $form ); $form = apply_filters('siteorigin_panels_widget_form', $form, $widget, $instance); // Add all the information fields return $form; } /** * Add action links to the plugin list for Page Builder. * * @param $links * @return array */ function siteorigin_panels_plugin_action_links($links) { unset( $links['edit'] ); $links[] = '' . __('Support', 'siteorigin-panels') . ''; $links[] = '' . __('Newsletter', 'siteorigin-panels') . ''; if( siteorigin_panels_display_premium_teaser() ) { $links[] = '' . __('Addons', 'siteorigin-panels') . ''; } return $links; } add_action('plugin_action_links_' . plugin_basename(__FILE__), 'siteorigin_panels_plugin_action_links'); function siteorigin_panels_live_edit_link( $wp_admin_bar ){ // Add a Live Edit link if this is a Page Builder page that the user can edit if( siteorigin_panels_setting( 'live-editor-quick-link' ) && is_singular() && current_user_can( 'edit_post', get_the_ID() ) && get_post_meta( get_the_ID(), 'panels_data', true ) ) { $wp_admin_bar->add_node( array( 'id' => 'so_live_editor', 'title' => __( 'Live Editor', 'siteorigin-panels' ), 'href' => add_query_arg( 'so_live_editor', 1, get_edit_post_link( get_the_ID() ) ), 'meta' => array( 'class' => 'live-edit-page' ) ) ); } } add_action( 'admin_bar_menu', 'siteorigin_panels_live_edit_link', 100 ); function siteorigin_panels_live_edit_link_style(){ if( is_singular() && current_user_can( 'edit_post', get_the_ID() ) && get_post_meta( get_the_ID(), 'panels_data', true ) ) { // Add the style for the eye icon before the Live Editor link $css = '#wpadminbar #wp-admin-bar-so_live_editor > .ab-item:before { content: "\f177"; top: 2px; }'; wp_add_inline_style( 'siteorigin-panels-front', $css ); } } add_action( 'wp_enqueue_scripts', 'siteorigin_panels_live_edit_link_style' ); function siteorigin_panels_live_editor_preview_url(){ global $post, $wp_post_types; if( empty( $post ) || empty( $wp_post_types ) || empty( $wp_post_types[ $post->post_type ] ) || !$wp_post_types[ $post->post_type ]->public ) { $preview_url = add_query_arg( 'siteorigin_panels_live_editor', 'true', admin_url( 'admin-ajax.php?action=so_panels_live_editor_preview' ) ); $preview_url = wp_nonce_url( $preview_url, 'live-editor-preview', '_panelsnonce' ); } else { $preview_url = add_query_arg( 'siteorigin_panels_live_editor', 'true', set_url_scheme( get_permalink() ) ); } return $preview_url; } /** * Process panels data to make sure everything is properly formatted * * @param array $panels_data * * @return array */ function siteorigin_panels_process_panels_data( $panels_data ){ // Process all widgets to make sure that panels_info is properly represented if( !empty($panels_data['widgets']) && is_array($panels_data['widgets']) ) { $last_gi = 0; $last_ci = 0; $last_wi = 0; foreach( $panels_data['widgets'] as &$widget ) { // Transfer legacy content if( empty($widget['panels_info']) && !empty($widget['info']) ) { $widget['panels_info'] = $widget['info']; unset( $widget['info'] ); } // Filter the widgets to add indexes if ( $widget['panels_info']['grid'] != $last_gi ) { $last_gi = $widget['panels_info']['grid']; $last_ci = 0; $last_wi = 0; } elseif ( $widget['panels_info']['cell'] != $last_ci ) { $last_ci = $widget['panels_info']['cell']; $last_wi = 0; } $widget['panels_info']['cell_index'] = $last_wi++; } foreach( $panels_data['grids'] as &$grid ) { if( !empty( $grid['style'] ) && is_string( $grid['style'] ) ) { $grid['style'] = array( ); } } } // Process the IDs of the grids. Make sure that each is unique. if( !empty($panels_data['grids']) && is_array($panels_data['grids']) ) { $unique_grid_ids = array(); foreach( $panels_data['grids'] as &$grid ) { // Make sure that the row ID is unique and non-numeric if( !empty( $grid['style']['id'] ) ) { if( is_numeric($grid['style']['id']) ) { // Numeric IDs will cause problems, so we'll ignore them $grid['style']['id'] = false; } else if( isset( $unique_grid_ids[ $grid['style']['id'] ] ) ) { // This ID already exists, so add a suffix to make sure it's unique $original_id = $grid['style']['id']; $i = 1; do { $grid['style']['id'] = $original_id . '-' . (++$i); } while( isset( $unique_grid_ids[ $grid['style']['id'] ] ) ); } if( !empty( $grid['style']['id'] ) ) { $unique_grid_ids[ $grid['style']['id'] ] = true; } } } } return $panels_data; } add_filter( 'siteorigin_panels_data', 'siteorigin_panels_process_panels_data', 5 ); /** * Should we display premium addon messages * * @return bool */ function siteorigin_panels_display_premium_teaser(){ return siteorigin_panels_setting( 'display-teaser' ) && apply_filters( 'siteorigin_premium_upgrade_teaser', true ) && ! defined( 'SITEORIGIN_PREMIUM_VERSION' ); } function siteorigin_panels_premium_url() { $ref = apply_filters( 'siteorigin_premium_affiliate_id', '' ); $url = 'https://siteorigin.com/downloads/premium/?featured_plugin=siteorigin-panels'; if( $ref ) { $url = add_query_arg( 'ref', urlencode( $ref ), $url ); } return $url; } // Include the live editor file if we're in live editor mode. if( !empty($_GET['siteorigin_panels_live_editor']) ) require_once plugin_dir_path(__FILE__) . 'inc/live-editor.php'; titulo|s:48:"RedMonkey - Sistema de Gerenciamento de Conte˙do";rodape|s:95:"Redmonkey v2.0 | www.redmonkey.com.br";db_pst|s:6:"pastas";db_doc|s:10:"documentos";db_ban|s:7:"banners";db_fot|s:5:"album";db_alb_fot|s:11:"album_fotos";db_usu|s:8:"usuarios";db_arq|s:8:"arquivos";db_mai|s:7:"mailing";db_adm|s:12:"usuarios_adm";db_con|s:6:"config";db_enq|s:8:"enquetes";db_enq_res|s:18:"enquetes_respostas";db_ban_ace|s:14:"banners_acesso";db_host|s:16:"10.10.10.29:3306";db_user|s:9:"CD_46_ecc";db_pass|s:8:"*vkb08T3";db_base|s:12:"CD_46885_ecc";DBTime|a:3:{s:3:"now";d:1483054626.971499919891357421875;s:4:"diff";i:0;s:4:"last";d:1483054626.971499919891357421875;}portal|a:1:{s:3:"cfg";i:1;}