Skip to content

Commit

Permalink
Update from vk-blocks-pro
Browse files Browse the repository at this point in the history
  • Loading branch information
vektorinc committed Aug 9, 2022
1 parent d48ac17 commit 0812b9b
Show file tree
Hide file tree
Showing 30 changed files with 988 additions and 1,162 deletions.
2 changes: 1 addition & 1 deletion build/balloon/style.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/block-build.css

Large diffs are not rendered by default.

186 changes: 139 additions & 47 deletions inc/vk-admin/package/_scss/vk_admin.scss

Large diffs are not rendered by default.

36 changes: 26 additions & 10 deletions inc/vk-admin/package/class-vk-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/
class Vk_Admin {

public static $version = '2.1.0';
public static $version = '2.2.0';

static function init() {
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'admin_common_css' ) );
Expand Down Expand Up @@ -55,7 +55,7 @@ public static function plugin_exists( $plugin ) {

/**
* Theme Exists
*
*
* @param string $theme '${theme_dir}/style.css'.
*/
public static function theme_exists( $theme ) {
Expand All @@ -76,8 +76,6 @@ public static function theme_exists( $theme ) {
/*--------------------------------------------------*/
public static function get_admin_banner() {



$banner_html = '';
$dir_url = plugin_dir_url( __FILE__ );
$lang = ( get_locale() == 'ja' ) ? 'ja' : 'en';
Expand All @@ -86,7 +84,7 @@ public static function get_admin_banner() {
$img_base_url = 'https://raw.githubusercontent.com/vektor-inc/vk-admin-banners/main/images/';

// 変数の初期化
$product_array = array();
$product_array = array();

// WP File System で JSON ファイルを読み込み
require_once ABSPATH . 'wp-admin/includes/file.php';
Expand All @@ -97,7 +95,7 @@ public static function get_admin_banner() {
$product_json_url = 'https://raw.githubusercontent.com/vektor-inc/vk-admin-banners/main/vk-admin-banners.json';
$product_json = $wp_filesystem->get_contents( $product_json_url );
$product_json = mb_convert_encoding( $product_json, 'UTF8', 'ASCII,JIS,UTF-8,EUC-JP,SJIS-WIN' );
$product_array = json_decode( $product_json,true );
$product_array = json_decode( $product_json, true );

}

Expand All @@ -113,10 +111,29 @@ public static function get_admin_banner() {

$banner_html .= '<div class="vk-admin-banner-grid">';

if( ! empty( $product_array ) ) {
if ( ! empty( $product_array ) ) {

// テーマのバナーを設置
foreach( $product_array as $product ) {
foreach ( $product_array as $product ) {
// include パラメーターが存在する場合
if ( ! empty( $product['include'] ) ) {
// include パラメーターをカンマで区切って配列化
$includes = explode( ',', $product['include'] );
// include パラメーター が配列の場合
if ( is_array( $includes ) ) {
// 該当するものがあった時点で continue を2回発動
foreach ( $includes as $include ) {
if ( self::theme_exists( $include ) || self::plugin_exists( $include ) ) {
continue 2;
}
}
} else {
// 該当するものがあった時点で continue を発動
if ( self::theme_exists( $includes ) || self::plugin_exists( $includes ) ) {
continue;
}
}
}

if ( 'theme' === $product['type'] ) {
if ( ! self::theme_exists( $product['slug'] ) ) {
Expand Down Expand Up @@ -180,7 +197,7 @@ public static function get_news_body() {

public static function get_news_from_rest_api() {

$html = '<h4 class="vk-metabox-sub-title">';
$html = '<h4 class="vk-metabox-sub-title">';
$html .= 'Vektor製品更新情報';
$html .= '<a href="https://www.vektor-inc.co.jp/product-update/?rel=vkadmin" target="_blank" class="vk-metabox-more-link">記事一覧<span aria-hidden="true" class="dashicons dashicons-external"></span></a>';
$html .= '</h4>';
Expand Down Expand Up @@ -448,4 +465,3 @@ public function __construct() {
} // if ( ! class_exists( 'Vk_Admin' ) )

Vk_Admin::init();
$Vk_Admin = new Vk_Admin();
2 changes: 1 addition & 1 deletion inc/vk-admin/package/css/vk_admin.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inc/vk-blocks/build/block-build.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('lodash', 'react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-notices', 'wp-primitives', 'wp-rich-text', 'wp-server-side-render'), 'version' => '471091cc7faeedc0c2ee04c6a72aa06f');
<?php return array('dependencies' => array('lodash', 'react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-notices', 'wp-primitives', 'wp-rich-text', 'wp-server-side-render'), 'version' => '72d0dc9a3a9d254b9a71c5daa97752e5');
4 changes: 2 additions & 2 deletions inc/vk-blocks/build/block-build.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions inc/vk-blocks/build/blocks/balloon/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
"type": "string",
"default": "type-speech"
},
"balloonFullWidth": {
"type": "boolean",
"default": false
},
"balloonBorder": {
"type": "boolean",
"default": false
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Binary file modified inc/vk-blocks/languages/vk-blocks-ja.mo
Binary file not shown.
Loading

0 comments on commit 0812b9b

Please sign in to comment.