8889841cwp-content/plugins/yith-woocommerce-compare/plugin-fw/includes/class-yith-dashboard.php 0000644 00000011605 15051440104 0033320 0 ustar 00 home/clixcotz/lions.clix.co.tz ' . esc_html__( 'RSS Error:', 'yith-plugin-fw' ) . ' ' . wp_kses_post( $rss->get_error_message() ) . '
';
}
return;
}
if ( ! $rss->get_item_quantity() ) {
echo '- ' . esc_html__( 'An error has occurred, which probably means the feed is down. Try again later.', 'yith-plugin-fw' ) . '
';
$rss->__destruct();
unset( $rss );
return;
}
/**
* The feed items.
*
* @var SimplePie_Item[] $last_updates
*/
$last_updates = $rss->get_items( 0, $items );
$html_classes = 'rsswidget yith-update-feeds';
$output = '';
if ( count( $last_updates ) > 0 ) {
$output = '';
}
foreach ( $last_updates as $last_update ) {
$output .= '- ';
$date = $last_update->get_date( 'U' );
$date_i18n = ! empty( $date ) ? date_i18n( get_option( 'date_format' ), $date ) : '';
$html_date = ! empty( $date_i18n ) ? ' ' : '';
$output .= sprintf( '%s %s', $last_update->get_permalink(), $html_classes, $last_update->get_title(), $html_date );
$changelog = $last_update->get_description();
if ( ! empty( $changelog ) ) {
$output .= ' - ';
$output .= sprintf( '%s', $last_update->get_id( true ), $last_update->get_title(), _x( 'View Changelog', 'Plugin FW', 'yith-plugin-fw' ) );
$output .= sprintf( '

%s %s
%s
', $last_update->get_id( true ), yith_plugin_fw_get_default_logo(), _x( 'Latest update released on', 'Plugin FW', 'yith-plugin-fw' ), $date_i18n, $changelog );
}
$output .= ' ';
}
if ( ! empty( $output ) ) {
$output .= '
';
}
echo wp_kses_post( $output );
$rss->__destruct();
unset( $rss );
}
/**
* Blog news Widget
*/
public static function dashboard_blog_news() {
$args = array(
'show_author' => 0,
'show_date' => 1,
'show_summary' => 1,
'items' => 3,
);
$feed = static::$blog_feed;
wp_widget_rss_output( $feed, $args );
}
/**
* Enqueue Styles and Scripts for View Last Changelog widget
*/
public static function enqueue_scripts() {
if ( function_exists( 'get_current_screen' ) && get_current_screen() && 'dashboard' === get_current_screen()->id ) {
$script_path = defined( 'YIT_CORE_PLUGIN_URL' ) ? YIT_CORE_PLUGIN_URL : get_template_directory_uri() . '/core/plugin-fw';
$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
wp_enqueue_script( 'yith-dashboard', $script_path . '/assets/js/yith-dashboard' . $suffix . '.js', array( 'jquery-ui-dialog' ), yith_plugin_fw_get_version(), true );
wp_enqueue_style( 'wp-jquery-ui-dialog' );
$l10n = array(
'buttons' => array(
'close' => _x( 'Close', 'Button label', 'yith-plugin-fw' ),
),
);
wp_localize_script( 'yith-dashboard', 'yith_dashboard', $l10n );
}
}
}
if ( apply_filters( 'yith_plugin_fw_show_dashboard_widgets', true ) ) {
add_action( 'wp_dashboard_setup', 'YITH_Dashboard::dashboard_widget_setup' );
add_action( 'admin_enqueue_scripts', 'YITH_Dashboard::enqueue_scripts', 20 );
}
}