Plugin Directory

Changeset 3070461


Ignore:
Timestamp:
04/15/2024 06:22:33 AM (2 years ago)
Author:
xserverjp
Message:

軽微な修正

Location:
xserver-typesquare-webfonts/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • xserver-typesquare-webfonts/trunk/inc/admin-root.php

    r2943299 r3070461  
    3434    {
    3535        ?>
    36         <p>この記事に適用するフォントを選択してください</p>
    37         <?php $this->_get_post_font_theme_selector(); ?>
    38         <input type="hidden" name="typesquare_nonce_postmeta" id="typesquare_nonce_postmeta" value="<?php echo esc_html(__(wp_create_nonce(plugin_basename(__FILE__)))); ?>" />
    39         <?php
     36<p>この記事に適用するフォントを選択してください</p>
     37<?php $this->_get_post_font_theme_selector(); ?>
     38<input type="hidden" name="typesquare_nonce_postmeta" id="typesquare_nonce_postmeta"
     39    value="<?php echo esc_html(__(wp_create_nonce(plugin_basename(__FILE__)))); ?>" />
     40<?php
    4041    }
    4142
     
    4546        $all_font_theme = $fonts->load_all_font_data();
    4647        $selected_theme = $fonts->get_selected_post_fonttheme(get_the_ID()); ?>
    47         <h3>フォントテーマから選ぶ</h3>
    48         <script>
    49         jQuery( document ).ready(function() {
    50             window.onload = function () {
    51                 theme_preview_new();
    52             };
    53 
    54             jQuery('#choiceThemeNew').change(function() {
    55                 theme_preview_new();
    56             });
    57 
    58             function theme_preview_new() {
    59                 var select_val = jQuery('.font_theme_select_pre_new option:selected').val();
    60                 if( select_val === "false") {
    61                     jQuery('.pre_title').text("");
    62                     jQuery('.pre_lead').text("");
    63                     jQuery('.pre_body').text("");
    64                     jQuery('.pre_bold').text("");
    65                 } else {
    66                     var val = document.getElementById("selected-get-" + select_val);
    67                     var theme_data = JSON.parse(val.value);
    68 
    69                     jQuery('#theme_preview').val(val);
    70 
    71                     jQuery('.pre_title').text(theme_data.fonts.title);
    72                     jQuery('.pre_title').css("font-family", `'${theme_data.fonts.title}'`);
    73 
    74                     jQuery('.pre_lead').text(theme_data.fonts.lead);
    75                     jQuery('.pre_lead').css("font-family", `'${theme_data.fonts.lead}'`);
    76 
    77                     if (theme_data.fonts.content) {
    78                         jQuery('.pre_body').text(theme_data.fonts.content);
    79                         jQuery('.pre_body').css("font-family", `'${theme_data.fonts.content}'`);
    80                     } else {
    81                         jQuery('.pre_body').text(theme_data.fonts.text);
    82                         jQuery('.pre_body').css("font-family", `'${theme_data.fonts.text}'`);
    83                     }
    84 
    85                     jQuery('.pre_bold').text(theme_data.fonts.bold);
    86                     jQuery('.pre_bold').css("font-family", `'${theme_data.fonts.bold}'`);
    87                 }
    88             }
    89         });
    90         </script>
    91         <div id="choiceThemeNew">
    92             <select name='typesquare_fonttheme[theme]' class='font_theme_select_pre_new'>
    93                 <option value='false'>テーマを設定しない</option>
    94                 <?php
     48<h3>フォントテーマから選ぶ</h3>
     49<script>
     50jQuery(document).ready(function() {
     51    window.onload = function() {
     52        theme_preview_new();
     53    };
     54
     55    jQuery('#choiceThemeNew').change(function() {
     56        theme_preview_new();
     57    });
     58
     59    function theme_preview_new() {
     60        var select_val = jQuery('.font_theme_select_pre_new option:selected').val();
     61        if (select_val === "false") {
     62            jQuery('.pre_title').text("");
     63            jQuery('.pre_lead').text("");
     64            jQuery('.pre_body').text("");
     65            jQuery('.pre_bold').text("");
     66        } else {
     67            var val = document.getElementById("selected-get-" + select_val);
     68            var theme_data = JSON.parse(val.value);
     69
     70            jQuery('#theme_preview').val(val);
     71
     72            jQuery('.pre_title').text(theme_data.fonts.title);
     73            jQuery('.pre_title').css("font-family", `'${theme_data.fonts.title}'`);
     74
     75            jQuery('.pre_lead').text(theme_data.fonts.lead);
     76            jQuery('.pre_lead').css("font-family", `'${theme_data.fonts.lead}'`);
     77
     78            if (theme_data.fonts.content) {
     79                jQuery('.pre_body').text(theme_data.fonts.content);
     80                jQuery('.pre_body').css("font-family", `'${theme_data.fonts.content}'`);
     81            } else {
     82                jQuery('.pre_body').text(theme_data.fonts.text);
     83                jQuery('.pre_body').css("font-family", `'${theme_data.fonts.text}'`);
     84            }
     85
     86            jQuery('.pre_bold').text(theme_data.fonts.bold);
     87            jQuery('.pre_bold').css("font-family", `'${theme_data.fonts.bold}'`);
     88        }
     89    }
     90});
     91</script>
     92<div id="choiceThemeNew">
     93    <select name='typesquare_fonttheme[theme]' class='font_theme_select_pre_new'>
     94        <option value='false'>テーマを設定しない</option>
     95        <?php
    9596                    foreach ($all_font_theme as $key => $fonttheme) {
    9697                        $fonttheme_name = $this->get_fonts_text($fonttheme['name']);
     
    100101                            $selected = 'selected';
    101102                        } ?>
    102                 <option value='<?php echo esc_html(__($key)); ?>' <?php echo esc_html(__($selected)); ?>>
    103                     <?php echo esc_html(__("{$fonttheme_name} ( {$font_text} )")); ?>
    104                 </option>
    105                 <?php
     103        <option value='<?php echo esc_html(__($key)); ?>' <?php echo esc_html(__($selected)); ?>>
     104            <?php echo esc_html(__("{$fonttheme_name} ( {$font_text} )")); ?>
     105        </option>
     106        <?php
    106107                    } ?>
    107             </select>
    108             <h3>プレビュー</h3>
    109             <div><p class="title">見出し:<p class="pre_title"></p></p></div>
    110             <div><p class="title">リード:<p class="pre_lead"></p></p></div>
    111             <div><p class="title">本文:<p class="pre_body"></p></p></div>
    112             <div><p class="title">太字:<p class="pre_bold"></p></p></div>
    113             <input type="hidden" id="theme_preview" />
    114         <?php
     108    </select>
     109    <h3>プレビュー</h3>
     110    <div>
     111        <p class="title">見出し:
     112        <p class="pre_title"></p>
     113        </p>
     114    </div>
     115    <div>
     116        <p class="title">リード:
     117        <p class="pre_lead"></p>
     118        </p>
     119    </div>
     120    <div>
     121        <p class="title">本文:
     122        <p class="pre_body"></p>
     123        </p>
     124    </div>
     125    <div>
     126        <p class="title">太字:
     127        <p class="pre_bold"></p>
     128        </p>
     129    </div>
     130    <input type="hidden" id="theme_preview" />
     131    <?php
    115132        foreach ($all_font_theme as $fonttheme_key => $fonttheme) {
    116133            ?>
    117                 <input type='hidden' id='selected-get-<?php echo esc_html(__($fonttheme_key)); ?>' value='<?php echo wp_strip_all_tags(__(wp_json_encode($fonttheme))); ?>'>
    118             <?php
    119         } ?>
    120         </div>
    121         <?php
     134    <input type='hidden' id='selected-get-<?php echo esc_html(__($fonttheme_key)); ?>'
     135        value='<?php echo wp_strip_all_tags(__(wp_json_encode($fonttheme))); ?>'>
     136    <?php
     137        } ?>
     138</div>
     139<?php
    122140    }
    123141
     
    183201        $nonce_key = TypeSquare_ST::OPTION_NAME;
    184202        $auth_param = $this->get_auth_params(); ?>
    185         <style type='text/css' rel='stylesheet'></style>
    186         <div class='wrap'>
    187             <h2>TypeSquare Webfonts Plugin for XSERVER</h2>
    188             <?php
     203<style type='text/css' rel='stylesheet'></style>
     204<div class='wrap'>
     205    <h2>TypeSquare Webfonts Plugin for XSERVER</h2>
     206    <?php
    189207                do_action('typesquare_add_setting_before'); ?>
    190                     <hr />
    191                     <span>
    192                         <h3 class="toggleText toggleAdvanced_font mTop20">投稿記事フォント設定
    193                             <span class="advancedTriangle advancedTriangle_font">▼</span>
    194                         </h3>
    195                     </span>
    196                     <div class='ts-custome_form_font hidden'>
    197                         <?php $this->_get_post_font_form($auth_param); ?>
    198                     </div>
    199                 </div>
    200                 <hr/>
    201                 <span>
    202                     <h3 class="toggleText toggleAdvanced_site mTop20">サイトフォント設定
    203                         <span class="advancedTriangle advancedTriangle_site">▼</span>
    204                     </h3>
    205                 </span>
    206                 <div class='ts-custome_form_site hidden'>
    207                     <?php $this->_get_site_font_form(); ?>
    208                 </div>
    209                 <hr/>
    210                 <span>
    211                     <h3 class="toggleText toggleAdvanced_article mTop20">カスタムテーマ編集
    212                         <span class="advancedTriangle advancedTriangle_article">▼</span>
    213                     </h3>
    214                 </span>
    215                 <div class='ts-custome_form_article hidden'>
    216                     <div class="ts-custum_block">
    217                         <?php $this->_get_font_theme_custom_form(); ?>
    218                     </div>
    219                 </div>
    220                 <?php do_action('typesquare_add_setting_after'); ?>
    221             <?php
     208    <hr />
     209    <span>
     210        <h3 class="toggleText toggleAdvanced_font mTop20">投稿記事フォント設定
     211            <span class="advancedTriangle advancedTriangle_font">▼</span>
     212        </h3>
     213    </span>
     214    <div class='ts-custome_form_font hidden'>
     215        <?php $this->_get_post_font_form($auth_param); ?>
     216    </div>
     217</div>
     218<hr />
     219<span>
     220    <h3 class="toggleText toggleAdvanced_site mTop20">サイトフォント設定
     221        <span class="advancedTriangle advancedTriangle_site">▼</span>
     222    </h3>
     223</span>
     224<div class='ts-custome_form_site hidden'>
     225    <?php $this->_get_site_font_form(); ?>
     226</div>
     227<hr />
     228<span>
     229    <h3 class="toggleText toggleAdvanced_article mTop20">カスタムテーマ編集
     230        <span class="advancedTriangle advancedTriangle_article">▼</span>
     231    </h3>
     232</span>
     233<div class='ts-custome_form_article hidden'>
     234    <div class="ts-custum_block">
     235        <?php $this->_get_font_theme_custom_form(); ?>
     236    </div>
     237</div>
     238<?php do_action('typesquare_add_setting_after'); ?>
     239<?php
    222240    }
    223241
    224242    private function _get_post_font_form($auth_param)
    225243    {?>
    226         <form method='post' action=''>
    227             <p>投稿記事に対するWebフォント適用方法を設定します。</p>
    228             <div class="block_wrap">
    229                 <p class="block_title">投稿記事に適用するフォント設定</p>
    230                 <div class="label_wrapper">
    231                     <label class="custum_form_ladio"><input name="fontThemeUseType" type="radio" value="1">指定しない
    232                         <p class="setting_read">フォントテーマを適用しません。</p>
    233                     </label>
    234                     <label class="custum_form_ladio"><input name="fontThemeUseType" type="radio" value="2" class="radio_custum_font_theme">共通テーマ指定
    235                         <p class="setting_read">全ての投稿に設定したフォントテーマが適用されます。</p>
    236                     </label>
    237                     <?php $this->_get_font_theme_form() ?>
    238                     <label class="custum_form_ladio"><input name="fontThemeUseType" type="radio" value="3">個別テーマ指定
    239                         <p class="setting_read">投稿ごとに設定したフォントテーマが適用されます。</p>
    240                     </label>
    241                     <label class="custum_form_ladio"><input name="fontThemeUseType" type="radio" value="4">直接指定(上級者向け)
    242                         <p class="setting_read">CSSセレクターを指定して適用するウェブフォントを選べます。</p>
    243                     </label>
    244                     <?php $this->_get_font_target_form() ?>
    245         <?php
     244<form method='post' action=''>
     245    <p>投稿記事に対するWebフォント適用方法を設定します。</p>
     246    <div class="block_wrap">
     247        <p class="block_title">投稿記事に適用するフォント設定</p>
     248        <div class="label_wrapper">
     249            <label class="custum_form_ladio"><input name="fontThemeUseType" type="radio" value="1">指定しない
     250                <p class="setting_read">フォントテーマを適用しません。</p>
     251            </label>
     252            <label class="custum_form_ladio"><input name="fontThemeUseType" type="radio" value="2"
     253                    class="radio_custum_font_theme">共通テーマ指定
     254                <p class="setting_read">全ての投稿に設定したフォントテーマが適用されます。</p>
     255            </label>
     256            <?php $this->_get_font_theme_form() ?>
     257            <label class="custum_form_ladio"><input name="fontThemeUseType" type="radio" value="3">個別テーマ指定
     258                <p class="setting_read">投稿ごとに設定したフォントテーマが適用されます。</p>
     259            </label>
     260            <label class="custum_form_ladio"><input name="fontThemeUseType" type="radio" value="4">直接指定(上級者向け)
     261                <p class="setting_read">CSSセレクターを指定して適用するウェブフォントを選べます。</p>
     262            </label>
     263            <?php $this->_get_font_target_form() ?>
     264            <?php
    246265
    247266        $fonts = TypeSquare_ST_Fonts::get_instance();
     
    258277                ?><input type="hidden" id="activeAdvanced_theme" value="2"><?php
    259278            } else {
    260                 ?><input type="hidden" id="activeAdvanced_theme" value="<?php echo esc_html(__($auth_param['typesquare_auth']['fontThemeUseType'])); ?>"><?php
     279                ?><input type="hidden" id="activeAdvanced_theme"
     280                value="<?php echo esc_html(__($auth_param['typesquare_auth']['fontThemeUseType'])); ?>"><?php
    261281            }
    262282        }
    263283        ?>
    264             </div>
    265             </div>
    266             <?php echo get_submit_button(__('投稿フォント設定を保存する', self::$text_domain)); ?>
    267             </form>
    268         <?php
     284        </div>
     285    </div>
     286    <?php echo get_submit_button(__('投稿フォント設定を保存する', self::$text_domain)); ?>
     287</form>
     288<?php
    269289    }
    270290
     
    274294        $fonts = TypeSquare_ST_Fonts::get_instance();
    275295        $param = $fonts->get_fonttheme_params(); ?>
    276             <?php echo wp_nonce_field('ts_update_font_settings', 'ts_update_font_settings', true, false); ?>
    277             <div id="choiceTheme" class="font_custum_select">
    278             <select name='<?php echo esc_html(__($option_name)); ?>[font_theme]' class='font_theme_select_pre'>
     296<?php echo wp_nonce_field('ts_update_font_settings', 'ts_update_font_settings', true, false); ?>
     297<div id="choiceTheme" class="font_custum_select">
     298    <select name='<?php echo esc_html(__($option_name)); ?>[font_theme]' class='font_theme_select_pre'>
    279299        <?php
    280300        $all_font_theme = $fonts->load_all_font_data();
     
    286306                $selected = 'selected';
    287307            } ?>
    288                 <option value='<?php echo esc_html(__($fonttheme_key)); ?>' <?php echo esc_html(__($selected)); ?>>
    289                 <?php echo esc_html(__($fonttheme_name)); ?> ( <?php echo esc_html(__($font_text)); ?> )
    290                 </option>
    291             <?php
    292         } ?>
    293             </select>
    294             <h3>プレビュー</h3>
    295             <div><p class="title">見出し:<p class="pre_title"></p></p></div>
    296             <div><p class="title">リード:<p class="pre_lead"></p></p></div>
    297             <div><p class="title">本文:<p class="pre_body"></p></p></div>
    298             <div><p class="title">太字:<p class="pre_bold"></p></p></div>
    299             <input type="hidden" id="theme_preview" />
     308        <option value='<?php echo esc_html(__($fonttheme_key)); ?>' <?php echo esc_html(__($selected)); ?>>
     309            <?php echo esc_html(__($fonttheme_name)); ?> ( <?php echo esc_html(__($font_text)); ?> )
     310        </option>
    300311        <?php
     312        } ?>
     313    </select>
     314    <h3>プレビュー</h3>
     315    <div>
     316        <p class="title">見出し:
     317        <p class="pre_title"></p>
     318        </p>
     319    </div>
     320    <div>
     321        <p class="title">リード:
     322        <p class="pre_lead"></p>
     323        </p>
     324    </div>
     325    <div>
     326        <p class="title">本文:
     327        <p class="pre_body"></p>
     328        </p>
     329    </div>
     330    <div>
     331        <p class="title">太字:
     332        <p class="pre_bold"></p>
     333        </p>
     334    </div>
     335    <input type="hidden" id="theme_preview" />
     336    <?php
    301337        foreach ($all_font_theme as $fonttheme_key => $fonttheme) {
    302338            ?>
    303                 <input type='hidden' id='selected-get-<?php echo esc_html(__($fonttheme_key)); ?>' value='<?php echo wp_strip_all_tags(__(wp_json_encode($fonttheme))); ?>'>
    304             <?php
    305         } ?>
    306             <?php echo wp_nonce_field('ts_update_font_settings', 'ts_update_font_settings', true, false); ?>
    307         <?php
     339    <input type='hidden' id='selected-get-<?php echo esc_html(__($fonttheme_key)); ?>'
     340        value='<?php echo wp_strip_all_tags(__(wp_json_encode($fonttheme))); ?>'>
     341    <?php
     342        } ?>
     343    <?php echo wp_nonce_field('ts_update_font_settings', 'ts_update_font_settings', true, false); ?>
     344    <?php
    308345
    309346        $value = esc_attr($param['typesquare_themes']['show_post_form']) == "true" ? true : false; ?>
    310             </div>
    311             <input type="hidden" name="typesquare_nonce_postmeta" id="typesquare_nonce_postmeta" value="<?php echo esc_html(__(wp_create_nonce(plugin_basename(__FILE__)))); ?>" />
    312         <?php
     347</div>
     348<input type="hidden" name="typesquare_nonce_postmeta" id="typesquare_nonce_postmeta"
     349    value="<?php echo esc_html(__(wp_create_nonce(plugin_basename(__FILE__)))); ?>" />
     350<?php
    313351    }
    314352
     
    321359            $param['typesquare_themes']['font_theme'] = sanitize_post($_POST['typesquare_fonttheme']['font_theme']);
    322360        } ?>
    323             <form method='post' action='' id='custmeFontForm' class='b__font_theme_form'>
    324             <p>お好きなフォントを組み合わせてテーマを作成できます。また、作成したテーマの編集ができます。</p>
    325             <?php echo wp_nonce_field('ts_update_font_settings', 'ts_update_font_settings', true, false); ?>
    326             <div class="font_custum_select">
    327             <select id='fontThemeSelect' name='<?php echo esc_html(__($option_name)); ?>[font_theme]'>
     361<form method='post' action='' id='custmeFontForm' class='b__font_theme_form'>
     362    <p>お好きなフォントを組み合わせてテーマを作成できます。また、作成したテーマの編集ができます。</p>
     363    <?php echo wp_nonce_field('ts_update_font_settings', 'ts_update_font_settings', true, false); ?>
     364    <div class="font_custum_select">
     365        <select id='fontThemeSelect' name='<?php echo esc_html(__($option_name)); ?>[font_theme]'>
    328366            <option value='new' selected>新しくテーマを作成する</option>
    329         <?php
     367            <?php
    330368        $coustam_font_theme = $fonts->load_coustam_font_data();
    331369        if (!empty($coustam_font_theme)) {
     
    334372                $font_text = $this->_get_fonttheme_text($fonttheme);
    335373                $selected   = ''; ?>
    336                     <option value='<?php echo esc_html(__($fonttheme_key)); ?>' <?php echo esc_html(__($selected)); ?>>
    337                         <?php echo esc_html(__($fonttheme_name)); ?> ( <?php echo esc_html(__($font_text)); ?> )
    338                     </option>
    339                 <?php
     374            <option value='<?php echo esc_html(__($fonttheme_key)); ?>' <?php echo esc_html(__($selected)); ?>>
     375                <?php echo esc_html(__($fonttheme_name)); ?> ( <?php echo esc_html(__($font_text)); ?> )
     376            </option>
     377            <?php
    340378            }
    341379        } ?>
     
    345383            foreach ($coustam_font_theme as $fonttheme_key => $fonttheme) {
    346384                ?>
    347                     <input type='hidden' id='<?php echo esc_html(__($fonttheme_key)); ?>' value='<?php echo wp_strip_all_tags(__(wp_json_encode($fonttheme))); ?>'>
    348                 <?php
    349             }
    350         } ?>
    351             </div>
    352             <?php $this->_get_custome_font_theme_list_form(); ?>
    353             <table>
    354                 <th>
    355                     <?php echo get_submit_button(__('テーマを保存する', self::$text_domain), 'primary', 'fontThemeUpdateButton'); ?>
    356                 </th>
    357 
    358                 <th>
     385        <input type='hidden' id='<?php echo esc_html(__($fonttheme_key)); ?>'
     386            value='<?php echo wp_strip_all_tags(__(wp_json_encode($fonttheme))); ?>'>
    359387        <?php
     388            }
     389        } ?>
     390    </div>
     391    <?php $this->_get_custome_font_theme_list_form(); ?>
     392    <table>
     393        <th>
     394            <?php echo get_submit_button(__('テーマを保存する', self::$text_domain), 'primary', 'fontThemeUpdateButton'); ?>
     395        </th>
     396
     397        <th>
     398            <?php
    360399            $style = array("style"=>"margin-top:15px; display:none;"); ?>
    361                 <?php echo get_submit_button(__('テーマを削除する', self::$text_domain), 'delete', 'fontThemeDeleteButton', null, $style); ?>
    362                 </th>
    363             </table>
    364             <input type="hidden" name="typesquare_nonce_postmeta" id="typesquare_nonce_postmeta" value="<?php echo esc_html(__(wp_create_nonce(plugin_basename(__FILE__)))); ?>" />
    365             </form>
    366         <?php
     400            <?php echo get_submit_button(__('テーマを削除する', self::$text_domain), 'delete', 'fontThemeDeleteButton', null, $style); ?>
     401        </th>
     402    </table>
     403    <input type="hidden" name="typesquare_nonce_postmeta" id="typesquare_nonce_postmeta"
     404        value="<?php echo esc_html(__(wp_create_nonce(plugin_basename(__FILE__)))); ?>" />
     405</form>
     406<?php
    367407    }
    368408
     
    370410    {
    371411        ?>
    372             <input type='hidden' name='ts_edit_mode' value='new' />
    373             <input type="hidden" id="ts_custome_theme_id" name="typesquare_custom_theme[id]" value="<?php echo esc_html(__(uniqid())); ?>" />
    374             <div id='customeFontThemeForm'>
    375             <?php echo wp_nonce_field('ts_update_font_name_setting', 'ts_update_font_name_setting', true, false); ?>
    376             <table class='widefat' style='border: 0px'>
    377                 <tbody>
    378                     <tr><th width='240px' style='padding-left:0;'>テーマタイトル</th><td>
    379                     <input type='hidden' id='current_custome_font_name' name='typesquare_custom_theme[name]' value=''/>
    380                     <input type='text' id='custome_font_name' name='typesquare_custom_theme[name]' value='' maxlength='16' style='width:50%;' required/>
    381                     </td></tr>
    382                     <?php echo esc_html(__($this->_get_site_font_form_tr("見出し", "", "typesquare_custom_theme[fonts][title][type]"))); ?>
    383                     <?php echo esc_html(__($this->_get_site_font_form_tr("リード", "", "typesquare_custom_theme[fonts][lead][type]"))); ?>
    384                     <?php echo esc_html(__($this->_get_site_font_form_tr("本文", "", "typesquare_custom_theme[fonts][text][type]"))); ?>
    385                     <?php echo esc_html(__($this->_get_site_font_form_tr("太字", "", "typesquare_custom_theme[fonts][bold][type]"))); ?>
    386                 </tbody>
    387             </table>
    388             <div id='ts-react-search-font'></div>
    389             </div>
    390         <?php
     412<input type='hidden' name='ts_edit_mode' value='new' />
     413<input type="hidden" id="ts_custome_theme_id" name="typesquare_custom_theme[id]"
     414    value="<?php echo esc_html(__(uniqid())); ?>" />
     415<div id='customeFontThemeForm'>
     416    <?php echo wp_nonce_field('ts_update_font_name_setting', 'ts_update_font_name_setting', true, false); ?>
     417    <table class='widefat' style='border: 0px'>
     418        <tbody>
     419            <tr>
     420                <th width='240px' style='padding-left:0;'>テーマタイトル</th>
     421                <td>
     422                    <input type='hidden' id='current_custome_font_name' name='typesquare_custom_theme[name]' value='' />
     423                    <input type='text' id='custome_font_name' name='typesquare_custom_theme[name]' value=''
     424                        maxlength='16' style='width:50%;' required />
     425                </td>
     426            </tr>
     427            <?php echo esc_html(__($this->_get_site_font_form_tr("見出し", "", "typesquare_custom_theme[fonts][title][type]"))); ?>
     428            <?php echo esc_html(__($this->_get_site_font_form_tr("リード", "", "typesquare_custom_theme[fonts][lead][type]"))); ?>
     429            <?php echo esc_html(__($this->_get_site_font_form_tr("本文", "", "typesquare_custom_theme[fonts][text][type]"))); ?>
     430            <?php echo esc_html(__($this->_get_site_font_form_tr("太字", "", "typesquare_custom_theme[fonts][bold][type]"))); ?>
     431        </tbody>
     432    </table>
     433    <div id='ts-react-search-font'></div>
     434</div>
     435<?php
    391436        $font_list = array(); ?>
    392             <?php echo esc_html(__($this->_get_script($font_list))); ?>
    393         <?php
     437<?php echo esc_html(__($this->_get_script($font_list))); ?>
     438<?php
    394439    }
    395440
     
    398443        $fonts = TypeSquare_ST_Fonts::get_instance();
    399444        $value = $fonts->get_site_font_setting(); ?>
    400             <form method='post' action='' id='siteFontForm'>
    401             <p>タイトルなど、ウェブサイト共通部分のフォント設定です</p>
    402             <table class="widefat form-table">
    403                 <tbody>
    404         <?php
     445<form method='post' action='' id='siteFontForm'>
     446    <p>タイトルなど、ウェブサイト共通部分のフォント設定です</p>
     447    <table class="widefat form-table">
     448        <tbody>
     449            <?php
    405450        if (is_array($value)) {
    406451            ?>
    407                 <?php echo esc_html(__($this->_get_site_font_form_tr("サイトタイトル", $value['title_fontname'], "title_fontname"))); ?>
    408                 <?php echo esc_html(__($this->_get_site_font_form_tr("サイトキャッチコピー", $value['catchcopy_fontname'], "catchcopy_fontname"))); ?>
    409                 <?php echo esc_html(__($this->_get_site_font_form_tr("ウィジェットタイトル", $value['widget_title_fontname'], "widget_title_fontname"))); ?>
    410                 <?php echo esc_html(__($this->_get_site_font_form_tr("ウィジェット", $value['widget_fontname'], "widget_fontname"))); ?>
     452            <?php echo esc_html(__($this->_get_site_font_form_tr("サイトタイトル", $value['title_fontname'], "title_fontname"))); ?>
     453            <?php echo esc_html(__($this->_get_site_font_form_tr("サイトキャッチコピー", $value['catchcopy_fontname'], "catchcopy_fontname"))); ?>
     454            <?php echo esc_html(__($this->_get_site_font_form_tr("ウィジェットタイトル", $value['widget_title_fontname'], "widget_title_fontname"))); ?>
     455            <?php echo esc_html(__($this->_get_site_font_form_tr("ウィジェット", $value['widget_fontname'], "widget_fontname"))); ?>
    411456            <?php
    412457        } else {
    413458            ?>
    414                 <?php echo esc_html(__($this->_get_site_font_form_tr("サイトタイトル", "", "title_fontname"))); ?>
    415                 <?php echo esc_html(__($this->_get_site_font_form_tr("サイトキャッチコピー", "", "catchcopy_fontname"))); ?>
    416                 <?php echo esc_html(__($this->_get_site_font_form_tr("ウィジェットタイトル", "", "widget_title_fontname"))); ?>
    417                 <?php echo esc_html(__($this->_get_site_font_form_tr("ウィジェット", "", "widget_fontname"))); ?>
    418             <?php
    419         } ?>
    420             </tbody>
    421             </table>
    422             <?php echo get_submit_button(__('サイトフォント設定を保存する', self::$text_domain)); ?>
    423             <?php echo wp_nonce_field('ts_update_site_font_settings', 'ts_update_site_font_settings', true, false); ?>
    424             </form>
    425         <?php
     459            <?php echo esc_html(__($this->_get_site_font_form_tr("サイトタイトル", "", "title_fontname"))); ?>
     460            <?php echo esc_html(__($this->_get_site_font_form_tr("サイトキャッチコピー", "", "catchcopy_fontname"))); ?>
     461            <?php echo esc_html(__($this->_get_site_font_form_tr("ウィジェットタイトル", "", "widget_title_fontname"))); ?>
     462            <?php echo esc_html(__($this->_get_site_font_form_tr("ウィジェット", "", "widget_fontname"))); ?>
     463            <?php
     464        } ?>
     465        </tbody>
     466    </table>
     467    <?php echo get_submit_button(__('サイトフォント設定を保存する', self::$text_domain)); ?>
     468    <?php echo wp_nonce_field('ts_update_site_font_settings', 'ts_update_site_font_settings', true, false); ?>
     469</form>
     470<?php
    426471    }
    427472
     
    429474    {
    430475        ?>
    431             <tr><th style='padding-left:0;'><span><?php echo esc_html(__($title)); ?></span></th>
    432             <td class="font_table_td">
    433             <div class="w_font_select">
    434         <?php
     476<tr>
     477    <th style='padding-left:0;'><span><?php echo esc_html(__($title)); ?></span></th>
     478    <td class="font_table_td">
     479        <div class="w_font_select">
     480            <?php
    435481        $value_font = '"' . $value . '"'; ?>
    436             <input class='fontlist_input' autocomplete='off' value='<?php echo esc_html(__($value)); ?>' style='font-family: <?php echo esc_html(__($value_font)); ?>' placeholder='未設定'/>
     482            <input class='fontlist_input' autocomplete='off' value='<?php echo esc_html(__($value)); ?>'
     483                style='font-family: <?php echo esc_html(__($value_font)); ?>' placeholder='未設定' />
    437484            <div class='w_fontlist b_def_fontlist'></div>
    438             </div>
    439             </td><input value='<?php echo esc_html(__($value)); ?>' type='hidden' name='<?php echo esc_html(__($input_name)); ?>' id='fontlist_select' class='fontlist_select'/></tr>
    440         <?php
     485        </div>
     486    </td><input value='<?php echo esc_html(__($value)); ?>' type='hidden'
     487        name='<?php echo esc_html(__($input_name)); ?>' id='fontlist_select' class='fontlist_select' />
     488</tr>
     489<?php
    441490    }
    442491
     
    447496        $all_font_theme = $fonts->load_all_font_data();
    448497        ?>
    449             <script>
    450         <?php
     498<script>
     499<?php
    451500        $endpoint = path_join(TYPESQUARE_PLUGIN_URL, 'inc/font.json'); ?>
    452             var json_endpoint = '<?php echo esc_html(__($endpoint)); ?>';
    453         <?php
     501var json_endpoint = '<?php echo esc_html(__($endpoint)); ?>';
     502<?php
    454503        if ($font_list) {
    455504            ?>
    456                 var current_font = <?php echo wp_strip_all_tags(__(wp_json_encode($font_list))); ?>;
    457             <?php
     505var current_font = <?php echo wp_strip_all_tags(__(wp_json_encode($font_list))); ?>;
     506<?php
    458507        } else {
    459508            ?>
    460                 var current_font = false;
    461             <?php
    462         } ?>
    463             var form_id = '#<?php echo esc_html(__(self::MENU_FONTTHEME)); ?>';
    464             var notify_text = 'フォントを1種類以上選択してください。';
    465             var unique_id ='<?php echo  esc_html(__(uniqid())); ?>';
    466             var option_font_list = <?php echo wp_strip_all_tags(__(wp_json_encode($options))); ?>;
    467             var plugin_base = '<?php echo wp_create_nonce(plugin_basename(__FILE__)); ?>';
    468             var all_font_list = <?php echo wp_strip_all_tags(__(wp_json_encode($all_font_theme))); ?>;
    469             jQuery( document ).ready(function() {
    470     jQuery( form_id ).submit(function() {
    471         var title = jQuery( 'select[name="typesquare_custom_theme[fonts][title][font]"]' ).val();
    472         var lead = jQuery( 'select[name="typesquare_custom_theme[fonts][lead][font]"]' ).val();
    473         var text = jQuery( 'select[name="typesquare_custom_theme[fonts][text][font]"]' ).val();
    474         var bold = jQuery( 'select[name="typesquare_custom_theme[fonts][bold][font]"]' ).val();
    475         if (
    476             title === 'false' &&
    477             lead === 'false' &&
    478             text === 'false' &&
    479             bold === 'false'
    480         ) {
    481             alert( notify_text );
    482             return false;
    483         }
    484     });
     509var current_font = false;
     510<?php
     511        } ?>
     512var form_id = '#<?php echo esc_html(__(self::MENU_FONTTHEME)); ?>';
     513var notify_text = 'フォントを1種類以上選択してください。';
     514var unique_id = '<?php echo  esc_html(__(uniqid())); ?>';
     515var option_font_list = <?php echo wp_strip_all_tags(__(wp_json_encode($options))); ?>;
     516var plugin_base = '<?php echo wp_create_nonce(plugin_basename(__FILE__)); ?>';
     517var all_font_list = <?php echo wp_strip_all_tags(__(wp_json_encode($all_font_theme))); ?>;
     518jQuery(document).ready(function() {
     519    jQuery(form_id).submit(function() {
     520        var title = jQuery('select[name="typesquare_custom_theme[fonts][title][font]"]').val();
     521        var lead = jQuery('select[name="typesquare_custom_theme[fonts][lead][font]"]').val();
     522        var text = jQuery('select[name="typesquare_custom_theme[fonts][text][font]"]').val();
     523        var bold = jQuery('select[name="typesquare_custom_theme[fonts][bold][font]"]').val();
     524        if (
     525            title === 'false' &&
     526            lead === 'false' &&
     527            text === 'false' &&
     528            bold === 'false'
     529        ) {
     530            alert(notify_text);
     531            return false;
     532        }
     533    });
    485534});
    486             </script>
    487         <?php
     535</script>
     536<?php
    488537    }
    489538
     
    524573        $fonts = TypeSquare_ST_Fonts::get_instance();
    525574        $array_input = $fonts->get_font_pro_setting(); ?>
    526             <div class='b__font_target_form'>
    527                 <table class='widefat form-table'>
    528                     <thead>
    529                         <tr><th style='width: 25%; padding-left: 45px;'>フォント選択</th><th style='width: 75%; padding-left: 14px;'>適用箇所(CSSセレクターで指定)</th></tr>
    530                     </thead>
    531                 <tbody class='cls_tb'>
    532         <?php
     575<div class='b__font_target_form'>
     576    <table class='widefat form-table'>
     577        <thead>
     578            <tr>
     579                <th style='width: 25%; padding-left: 45px;'>フォント選択</th>
     580                <th style='width: 75%; padding-left: 14px;'>適用箇所(CSSセレクターで指定)</th>
     581            </tr>
     582        </thead>
     583        <tbody class='cls_tb'>
     584            <?php
    533585        if (!empty($array_input)) {
    534586            $i = 0;
    535587            foreach ($array_input as $key => $value) {
    536588                $i++; ?>
    537                     <tr id='font_setting'><td>
     589            <tr id='font_setting'>
     590                <td>
    538591                    <div class='cls_delete_btn cls_delete_btn_selected'>×</div>
    539                     <input id='fontlist_input' class='fontlist_input' autocomplete='off' value='<?php echo esc_html(__($value['fontlist_fontname'])); ?>' style='font-family: <?php echo esc_html(__($value['fontlist_fontname'])); ?>'/>
     592                    <input id='fontlist_input' class='fontlist_input' autocomplete='off'
     593                        value='<?php echo esc_html(__($value['fontlist_fontname'])); ?>'
     594                        style='font-family: <?php echo esc_html(__($value['fontlist_fontname'])); ?>' />
    540595                    <div class='w_fontlist b_def_fontlist'></div>
    541                     </td>
    542                     <td class='add_class_td'><input type='text' class='class_input' value=''/><button type='button' id='add_box' class='add_box'>追加</button>
    543                 <?php
     596                </td>
     597                <td class='add_class_td'><input type='text' class='class_input' value='' /><button type='button'
     598                        id='add_box' class='add_box'>追加</button>
     599                    <?php
    544600                $cls_name = $value['fontlist_cls'];
    545601                foreach ($cls_name as $cls_value) {
    546602                    ?>
    547                         <p class='add_class_label'><?php echo esc_html(__($cls_value)); ?> ×
    548                             <input name='fontlist_cls<?php echo esc_html(__($i)); ?>[]' type='hidden' value='<?php echo esc_html(__($cls_value)); ?>' />
    549                         </p>
     603                    <p class='add_class_label'><?php echo esc_html(__($cls_value)); ?> ×
     604                        <input name='fontlist_cls<?php echo esc_html(__($i)); ?>[]' type='hidden'
     605                            value='<?php echo esc_html(__($cls_value)); ?>' />
     606                    </p>
    550607                    <?php
    551608                }; ?>
    552                     </td>
    553                     <input value='<?php echo esc_html(__($value['fontlist_fontname'])); ?>' type='hidden' name='fontlist_fontname<?php echo esc_html(__($i)); ?>' id='fontlist_select' class='fontlist_select'/>
    554                     </tr>
    555                 <?php
     609                </td>
     610                <input value='<?php echo esc_html(__($value['fontlist_fontname'])); ?>' type='hidden'
     611                    name='fontlist_fontname<?php echo esc_html(__($i)); ?>' id='fontlist_select'
     612                    class='fontlist_select' />
     613            </tr>
     614            <?php
    556615            };
    557616        } else {
    558617            ?>
    559                 <tr id='font_setting'><td>
    560                 <div class='cls_delete_btn cls_delete_btn_selected'>×</div>
    561                 <input id='fontlist_input' class='fontlist_input' autocomplete='off' placeholder='未設定'>
    562                 <div class='w_fontlist'><ul class='font_select_menu'></ul></div>
     618            <tr id='font_setting'>
     619                <td>
     620                    <div class='cls_delete_btn cls_delete_btn_selected'>×</div>
     621                    <input id='fontlist_input' class='fontlist_input' autocomplete='off' placeholder='未設定'>
     622                    <div class='w_fontlist'>
     623                        <ul class='font_select_menu'></ul>
     624                    </div>
    563625                </td>
    564                 <td class='add_class_td'><input type='text' class='class_input' value=''/><button type='button' id='add_box' class='add_box'>追加</button></td>
    565                 <input value='' type='hidden' name='fontlist_fontname1' id='fontlist_select' class='fontlist_select'/>
    566                 </tr>
     626                <td class='add_class_td'><input type='text' class='class_input' value='' /><button type='button'
     627                        id='add_box' class='add_box'>追加</button></td>
     628                <input value='' type='hidden' name='fontlist_fontname1' id='fontlist_select' class='fontlist_select' />
     629            </tr>
    567630            <?php
    568631        }; ?>
    569             <tr id='addbtn_tr'><td>
    570             <button type='button' id='input_add_btn'>+</button>
    571             </td></tr>
    572             </tbody>
    573             </table>
    574             </div>
    575             <?php echo wp_nonce_field('ts_update_font_pro_settings', 'ts_update_font_pro_settings', true, false); ?>
    576         <?php
     632            <tr id='addbtn_tr'>
     633                <td>
     634                    <button type='button' id='input_add_btn'>+</button>
     635                </td>
     636            </tr>
     637        </tbody>
     638    </table>
     639</div>
     640<?php echo wp_nonce_field('ts_update_font_pro_settings', 'ts_update_font_pro_settings', true, false); ?>
     641<?php
    577642    }
    578643}
  • xserver-typesquare-webfonts/trunk/inc/class/class.font.data.php

    r2943299 r3070461  
    182182            unset($param['fonts']);
    183183        }
    184         if (! isset($param['show_post_form'])) {
     184        if (is_array($param) && ! isset($param['show_post_form'])) {
    185185            $param['show_post_form'] = false;
    186186        }
     
    241241    {
    242242        ?>
    243             <div class='notice updated'><ul>
    244             <li><?php echo esc_html(__($result)); ?></li>
    245             </ul></div>
    246         <?php
     243<div class='notice updated'>
     244    <ul>
     245        <li><?php echo esc_html(__($result)); ?></li>
     246    </ul>
     247</div>
     248<?php
    247249    }
    248250
     
    353355        $options = array();
    354356        for ($i=1; $i < 20; $i++) {
    355             if (isset($_POST["fontlist_fontname${i}"]) && !empty($_POST["fontlist_fontname${i}"] && !empty($_POST["fontlist_cls${i}"]))) {
     357            if (isset($_POST["fontlist_fontname{$i}"]) && !empty($_POST["fontlist_fontname{$i}"] && !empty($_POST["fontlist_cls{$i}"]))) {
    356358
    357359                $post_cls = array();
    358                 for ($j=0; $j < count($_POST["fontlist_cls${i}"]); $j++) {
    359                     array_push($post_cls, sanitize_post($_POST["fontlist_cls${i}"][$j]));
     360                for ($j=0; $j < count($_POST["fontlist_cls{$i}"]); $j++) {
     361                    array_push($post_cls, sanitize_post($_POST["fontlist_cls{$i}"][$j]));
    360362                }
    361363
    362364                array_push($options, array(
    363                     "fontlist_fontname" => sanitize_post($_POST["fontlist_fontname${i}"]),
     365                    "fontlist_fontname" => sanitize_post($_POST["fontlist_fontname{$i}"]),
    364366                    "fontlist_cls" => $post_cls,
    365367                ));
  • xserver-typesquare-webfonts/trunk/readme.txt

    r2984106 r3070461  
    33Tags: fonts,Webfonts
    44Requires at least: 5.2
    5 Tested up to: 6.3.2
    6 Stable tag: 2.0.5
     5Tested up to: 6.5.2
     6Stable tag: 2.0.7
    77License: GPLv3 or later
    88License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    126126
    127127== Changelog ==
     128= 2.0.7 =
     129* 軽微な修正
     130
     131= 2.0.6 =
     132* 軽微な修正
     133
    128134= 2.0.5 =
    129135* 軽微な修正
  • xserver-typesquare-webfonts/trunk/ts-webfonts-for-xserver.php

    r2984106 r3070461  
    22/*
    33Plugin Name: TypeSquare Webfonts for エックスサーバー
    4 Version: 2.0.5
     4Version: 2.0.7
    55Description: エックスサーバー株式会社が提供する各レンタルサーバーサービスでWebフォントを利用できるプラグインです。
    66Author: XSERVER Inc.
Note: See TracChangeset for help on using the changeset viewer.