Custom Field Template - Version 0.3.1

Version Description

Download this release

Release Info

Developer Hiroaki Miyashita
Plugin Icon 128x128 Custom Field Template
Version 0.3.1
Comparing to
See all releases

Code changes from version 0.2 to 0.3.1

custom-field-template-ja.mo CHANGED
Binary file
custom-field-template-ja.po CHANGED
@@ -1,23 +1,9 @@
1
- # WordPress 用日本語リソース (UTF-8)
2
- # Japanese (UTF-8) translation for WordPress
3
- #
4
- # Copyright (c) 2005-2008
5
- # このファイルは WordPress 本体と同じライセンスのもと配布されています。
6
- # This file is distributed under the same license as the WordPress package.
7
- #
8
- # WordPress 日本語版作成チーム / WP ja translation team
9
- # <http://groups.google.com/group/wp-ja-pkg/web/members>
10
- #
11
- # 誤字脱字誤訳、あるいはよりよい訳などありましたら以下までぜひお知らせください。
12
- # また、翻訳、校正、コミットをお手伝いしていただける方も随時募集中です。
13
- # 連絡先 / Contact: wpja.team@gmail.com (件名か内容に「日本語リソース」と入れてください)
14
- #
15
  msgid ""
16
  msgstr ""
17
  "Project-Id-Version: Custom Field Template\n"
18
  "Report-Msgid-Bugs-To: \n"
19
- "POT-Creation-Date: 2008-08-29 18:20+0900\n"
20
- "PO-Revision-Date: 2008-08-29 18:20+0900\n"
21
  "Last-Translator: \n"
22
  "Language-Team: \n"
23
  "MIME-Version: 1.0\n"
@@ -30,71 +16,107 @@ msgstr ""
30
  "X-Poedit-Basepath: ../\n"
31
  "X-Poedit-SearchPath-0: custom-field-template\n"
32
 
33
- #: custom-field-template/custom-field-template.php:48
34
  msgid "Default Template"
35
  msgstr "デフォルトテンプレート"
36
 
37
- #: custom-field-template/custom-field-template.php:81
38
- #: custom-field-template/custom-field-template.php:112
39
- #: custom-field-template/custom-field-template.php:349
40
- #: custom-field-template/custom-field-template.php:357
41
  msgid "Custom Field Template"
42
  msgstr "カスタムフィールドテンプレート"
43
 
44
- #: custom-field-template/custom-field-template.php:97
45
  msgid "Options updated."
46
  msgstr "オプションは更新されました。"
47
 
48
- #: custom-field-template/custom-field-template.php:101
49
  msgid "Options resetted."
50
  msgstr "オプションはリセットされました。"
51
 
52
- #: custom-field-template/custom-field-template.php:105
53
  msgid "Options deleted."
54
  msgstr "オプションは削除されました。"
55
 
56
- #: custom-field-template/custom-field-template.php:114
57
  msgid "Custom Field Template Options"
58
  msgstr "カスタムフィールドテンプレートオプション"
59
 
60
- #: custom-field-template/custom-field-template.php:122
61
  #, php-format
62
  msgid "Template Title %d"
63
  msgstr "テンプレートタイトル %d"
64
 
65
- #: custom-field-template/custom-field-template.php:124
66
  #, php-format
67
  msgid "Template Content %d"
68
  msgstr "テンプレートコンテンツ %d"
69
 
70
- #: custom-field-template/custom-field-template.php:131
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  msgid "Update Options &raquo;"
72
  msgstr "オプションを更新する &raquo;"
73
 
74
- #: custom-field-template/custom-field-template.php:137
75
  msgid "Reset Options"
76
  msgstr "オプションをリセットする"
77
 
78
- #: custom-field-template/custom-field-template.php:138
79
  msgid "Are you sure to reset options? Options you set will be reset to the default settings."
80
  msgstr "本当にオプションをリセットしてもよろしいですか?設定したオプションはデフォルトの状態に戻ります。"
81
 
82
- #: custom-field-template/custom-field-template.php:142
83
  msgid "Unset Options &raquo;"
84
  msgstr "オプションをリセットする &raquo;"
85
 
86
- #: custom-field-template/custom-field-template.php:148
87
  msgid "Delete Options"
88
  msgstr "オプションを削除する"
89
 
90
- #: custom-field-template/custom-field-template.php:149
91
  msgid "Are you sure to delete options? Options you set will be deleted."
92
  msgstr "本当にオプションを削除してもよろしいですか?設定したオプションは削除されます。"
93
 
94
- #: custom-field-template/custom-field-template.php:153
95
  msgid "Delete Options &raquo;"
96
  msgstr "オプションを削除する &raquo;"
97
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  #~ msgid "Recent Posts Ext"
99
  #~ msgstr "最近の投稿 Ext"
100
  #~ msgid "camera"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Custom Field Template\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2008-10-01 02:34+0900\n"
6
+ "PO-Revision-Date: 2008-10-01 02:34+0900\n"
7
  "Last-Translator: \n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
16
  "X-Poedit-Basepath: ../\n"
17
  "X-Poedit-SearchPath-0: custom-field-template\n"
18
 
19
+ #: custom-field-template/custom-field-template.php:81
20
  msgid "Default Template"
21
  msgstr "デフォルトテンプレート"
22
 
23
+ #: custom-field-template/custom-field-template.php:120
24
+ #: custom-field-template/custom-field-template.php:152
25
+ #: custom-field-template/custom-field-template.php:431
26
+ #: custom-field-template/custom-field-template.php:439
27
  msgid "Custom Field Template"
28
  msgstr "カスタムフィールドテンプレート"
29
 
30
+ #: custom-field-template/custom-field-template.php:137
31
  msgid "Options updated."
32
  msgstr "オプションは更新されました。"
33
 
34
+ #: custom-field-template/custom-field-template.php:141
35
  msgid "Options resetted."
36
  msgstr "オプションはリセットされました。"
37
 
38
+ #: custom-field-template/custom-field-template.php:145
39
  msgid "Options deleted."
40
  msgstr "オプションは削除されました。"
41
 
42
+ #: custom-field-template/custom-field-template.php:154
43
  msgid "Custom Field Template Options"
44
  msgstr "カスタムフィールドテンプレートオプション"
45
 
46
+ #: custom-field-template/custom-field-template.php:162
47
  #, php-format
48
  msgid "Template Title %d"
49
  msgstr "テンプレートタイトル %d"
50
 
51
+ #: custom-field-template/custom-field-template.php:164
52
  #, php-format
53
  msgid "Template Content %d"
54
  msgstr "テンプレートコンテンツ %d"
55
 
56
+ #: custom-field-template/custom-field-template.php:171
57
+ msgid "In case that you would like to insert multiple images at once in use of the custom field media buttons"
58
+ msgstr "カスタムフィールへの画像挿入を一度に複数枚実行する場合"
59
+
60
+ #: custom-field-template/custom-field-template.php:172
61
+ msgid "Use multiple image inset"
62
+ msgstr "複数画像挿入を利用する"
63
+
64
+ #: custom-field-template/custom-field-template.php:172
65
+ msgid "Caution:"
66
+ msgstr "ご注意:"
67
+
68
+ #: custom-field-template/custom-field-template.php:172
69
+ msgid "You need to edit `wp-admin/includes/media.php`. Delete or comment out the code in the function media_send_to_editor at around line 88-96."
70
+ msgstr "`wp-admin/includes/media.php`を編集する必要があります。88-96行目の media_send_to_editor関数の中身を削除するかコメントアウトしてください。"
71
+
72
+ #: custom-field-template/custom-field-template.php:176
73
  msgid "Update Options &raquo;"
74
  msgstr "オプションを更新する &raquo;"
75
 
76
+ #: custom-field-template/custom-field-template.php:182
77
  msgid "Reset Options"
78
  msgstr "オプションをリセットする"
79
 
80
+ #: custom-field-template/custom-field-template.php:183
81
  msgid "Are you sure to reset options? Options you set will be reset to the default settings."
82
  msgstr "本当にオプションをリセットしてもよろしいですか?設定したオプションはデフォルトの状態に戻ります。"
83
 
84
+ #: custom-field-template/custom-field-template.php:187
85
  msgid "Unset Options &raquo;"
86
  msgstr "オプションをリセットする &raquo;"
87
 
88
+ #: custom-field-template/custom-field-template.php:193
89
  msgid "Delete Options"
90
  msgstr "オプションを削除する"
91
 
92
+ #: custom-field-template/custom-field-template.php:194
93
  msgid "Are you sure to delete options? Options you set will be deleted."
94
  msgstr "本当にオプションを削除してもよろしいですか?設定したオプションは削除されます。"
95
 
96
+ #: custom-field-template/custom-field-template.php:198
97
  msgid "Delete Options &raquo;"
98
  msgstr "オプションを削除する &raquo;"
99
 
100
+ #: custom-field-template/custom-field-template.php:353
101
+ msgid "Add Media"
102
+ msgstr ""
103
+
104
+ #: custom-field-template/custom-field-template.php:355
105
+ msgid "Add an Image"
106
+ msgstr ""
107
+
108
+ #: custom-field-template/custom-field-template.php:357
109
+ msgid "Add Video"
110
+ msgstr ""
111
+
112
+ #: custom-field-template/custom-field-template.php:359
113
+ msgid "Add Audio"
114
+ msgstr ""
115
+
116
+ #: custom-field-template/custom-field-template.php:369
117
+ msgid "Toggle"
118
+ msgstr "切り替え"
119
+
120
  #~ msgid "Recent Posts Ext"
121
  #~ msgstr "最近の投稿 Ext"
122
  #~ msgid "camera"
custom-field-template.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Custom Field Template
4
  Plugin URI: http://wordpressgogo.com/development/custom-field-template.html
5
  Description: This plugin adds the default custom fields on the Write Post/Page.
6
  Author: Hiroaki Miyashita
7
- Version: 0.2
8
  Author URI: http://wordpressgogo.com/
9
  */
10
 
@@ -28,6 +28,27 @@ class custom_field_template {
28
  add_action( 'edit_post', array(&$this, 'edit_meta_value') );
29
  add_action( 'save_post', array(&$this, 'edit_meta_value') );
30
  add_action( 'publish_post', array(&$this, 'edit_meta_value') );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  }
32
 
33
  function custom_field_template_init() {
@@ -100,6 +121,7 @@ tinyMCE = true';
100
  if($_POST["custom_field_template_set_options_submit"]) :
101
  unset($options['custom_fields']);
102
  $j = 0;
 
103
  for($i=0;$i<count($_POST["custom_field_template_content"]);$i++) {
104
  if( $_POST["custom_field_template_content"][$i] ) {
105
  $options['custom_fields'][$j]['title'] = $_POST["custom_field_template_title"][$i];
@@ -134,7 +156,7 @@ tinyMCE = true';
134
  ?>
135
  <tr><td>
136
  <p><label for="custom_field_template_title[<?= $i ?>]"><?php echo sprintf(__('Template Title %d', 'custom-field-template'), $i+1); ?></label>:<br />
137
- <input name="custom_field_template_title[<?= $i ?>]" id="custom_field_template_title[<?= $i ?>]" class="input" value="<?= stripcslashes($options['custom_fields'][$i]['title']) ?>" size="60" /></p>
138
  <p><label for="custom_field_template_content[<?= $i ?>]"><?php echo sprintf(__('Template Content %d', 'custom-field-template'), $i+1); ?></label>:<br />
139
  <textarea name="custom_field_template_content[<?= $i ?>]" id="custom_field_template_content[<?= $i ?>]" class="textarea" rows="10" cols="60"><?= stripcslashes($options['custom_fields'][$i]['content']) ?></textarea></p>
140
  </td></tr>
@@ -142,6 +164,11 @@ tinyMCE = true';
142
  }
143
  ?>
144
  <tr><td>
 
 
 
 
 
145
  <p><input type="submit" name="custom_field_template_set_options_submit" value="<?php _e('Update Options &raquo;', 'custom-field-template'); ?>" /></p>
146
  </td></tr>
147
  </tbody>
@@ -295,6 +322,8 @@ tinyMCE = true';
295
  }
296
 
297
  function make_textarea( $name, $rows, $cols, $tinyMCE ) {
 
 
298
  $title = $name;
299
  $name = $this->sanitize_name( $name );
300
 
@@ -309,15 +338,40 @@ tinyMCE = true';
309
  $out = '<script type="text/javascript">' . "\n" .
310
  '// <![CDATA[' . "\n" .
311
  'if ( typeof tinyMCE != "undefined" )' . "\n" .
312
- 'jQuery(document).ready(function() {tinyMCE.execCommand("mceAddControl", false, "'. $name . $rand . '");});' . "\n" .
313
  '// ]]>' . "\n" .
314
  '</script>';
315
  }
316
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
317
  $out .=
318
  '<tr>' .
319
- '<th scope="row" valign="top">' . $title . ' </th>' .
320
- '<td><textarea id="' . $name . $rand . '" name="' . $name . '" type="textfield" rows="' .$rows. '" cols="' . $cols . '">' . attribute_escape($value) . '</textarea></td>' .
321
  '</tr>';
322
  return $out;
323
  }
@@ -330,7 +384,7 @@ tinyMCE = true';
330
  return;
331
 
332
  $out .= '<input type="hidden" name="custom-field-template-id" id="custom-field-template-id" value="' . $id . '" />';
333
- $out .= '<table class="editform">';
334
  foreach( $fields as $title => $data ) {
335
  if( $data[ 'type' ] == 'textfield' ) {
336
  $out .= $this->make_textfield( $title, $data[ 'size' ] );
@@ -384,8 +438,76 @@ tinyMCE = true';
384
  <div class="dbx-content">';
385
  }
386
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
387
  $body = $this->load_custom_field();
388
- $out .= '<select id="custom_field_template_select" onchange="jQuery.ajax({type: \'GET\', url: \'?page=custom-field-template/custom-field-template.php&id=\'+jQuery(this).val()+\'&post=' . $_REQUEST['post'] . '\', success: function(html) {jQuery(\'#custom-field-template-box\').html(html);}});">';
389
  for ( $i=0; $i < count($options['custom_fields']); $i++ ) {
390
  if ( $i == $options['posts'][$_REQUEST['post']] ) {
391
  $out .= '<option value="' . $i . '" selected="selected">' . stripcslashes($options['custom_fields'][$i]['title']) . '</option>';
4
  Plugin URI: http://wordpressgogo.com/development/custom-field-template.html
5
  Description: This plugin adds the default custom fields on the Write Post/Page.
6
  Author: Hiroaki Miyashita
7
+ Version: 0.3.1
8
  Author URI: http://wordpressgogo.com/
9
  */
10
 
28
  add_action( 'edit_post', array(&$this, 'edit_meta_value') );
29
  add_action( 'save_post', array(&$this, 'edit_meta_value') );
30
  add_action( 'publish_post', array(&$this, 'edit_meta_value') );
31
+
32
+ add_filter( 'media_send_to_editor', array(&$this, 'media_send_to_custom_field'), 15 );
33
+ }
34
+
35
+ function media_send_to_custom_field($html) {
36
+ $options = $this->get_custom_field_template_data();
37
+
38
+ $out = '<script type="text/javascript">' . "\n" .
39
+ ' /* <![CDATA[ */' . "\n" .
40
+ ' var win = window.dialogArguments || opener || parent || top;' . "\n" .
41
+ ' win.send_to_custom_field("' . addslashes($html) . '");' . "\n" .
42
+ '/* ]]> */' . "\n" .
43
+ '</script>' . "\n";
44
+
45
+ echo $out;
46
+
47
+ if ($options['custom_field_template_use_multiple_insert']) {
48
+ return;
49
+ } else {
50
+ exit();
51
+ }
52
  }
53
 
54
  function custom_field_template_init() {
121
  if($_POST["custom_field_template_set_options_submit"]) :
122
  unset($options['custom_fields']);
123
  $j = 0;
124
+ $options['custom_field_template_use_multiple_insert'] = $_POST['custom_field_template_use_multiple_insert'];
125
  for($i=0;$i<count($_POST["custom_field_template_content"]);$i++) {
126
  if( $_POST["custom_field_template_content"][$i] ) {
127
  $options['custom_fields'][$j]['title'] = $_POST["custom_field_template_title"][$i];
156
  ?>
157
  <tr><td>
158
  <p><label for="custom_field_template_title[<?= $i ?>]"><?php echo sprintf(__('Template Title %d', 'custom-field-template'), $i+1); ?></label>:<br />
159
+ <input type="text" name="custom_field_template_title[<?= $i ?>]" id="custom_field_template_title[<?= $i ?>]" class="input" value="<?= stripcslashes($options['custom_fields'][$i]['title']) ?>" size="60" /></p>
160
  <p><label for="custom_field_template_content[<?= $i ?>]"><?php echo sprintf(__('Template Content %d', 'custom-field-template'), $i+1); ?></label>:<br />
161
  <textarea name="custom_field_template_content[<?= $i ?>]" id="custom_field_template_content[<?= $i ?>]" class="textarea" rows="10" cols="60"><?= stripcslashes($options['custom_fields'][$i]['content']) ?></textarea></p>
162
  </td></tr>
164
  }
165
  ?>
166
  <tr><td>
167
+ <p><label for="custom_field_template_use_multiple_insert"><?php _e('In case that you would like to insert multiple images at once in use of the custom field media buttons', 'custom-field-template'); ?></label>:<br />
168
+ <input type="checkbox" name="custom_field_template_use_multiple_insert" id="custom_field_template_use_multiple_insert" value="1" <?php if ($options['custom_field_template_use_multiple_insert']) { echo 'checked="checked"'; } ?> /> <?php _e('Use multiple image inset', 'custom-field-template'); ?><br /><span style="color:#FF0000; font-weight:bold;"><?php _e('Caution:', 'custom-field-teplate'); ?> <?php _e('You need to edit `wp-admin/includes/media.php`. Delete or comment out the code in the function media_send_to_editor at around line 88-96.', 'custom-field-template'); ?></span></p>
169
+ </td>
170
+ </tr>
171
+ <tr><td>
172
  <p><input type="submit" name="custom_field_template_set_options_submit" value="<?php _e('Update Options &raquo;', 'custom-field-template'); ?>" /></p>
173
  </td></tr>
174
  </tbody>
322
  }
323
 
324
  function make_textarea( $name, $rows, $cols, $tinyMCE ) {
325
+ global $wp_version;
326
+
327
  $title = $name;
328
  $name = $this->sanitize_name( $name );
329
 
338
  $out = '<script type="text/javascript">' . "\n" .
339
  '// <![CDATA[' . "\n" .
340
  'if ( typeof tinyMCE != "undefined" )' . "\n" .
341
+ 'jQuery(document).ready(function() {tinyMCE.execCommand("mceAddControl", false, "'. $name . $rand . '");});' . "\n" .
342
  '// ]]>' . "\n" .
343
  '</script>';
344
  }
345
 
346
+ if ( substr($wp_version, 0, 3) >= '2.5' ) {
347
+
348
+ $media_upload_iframe_src = "media-upload.php";
349
+ $media_title = __('Add Media');
350
+ $image_upload_iframe_src = apply_filters('image_upload_iframe_src', "$media_upload_iframe_src?type=image");
351
+ $image_title = __('Add an Image');
352
+ $video_upload_iframe_src = apply_filters('video_upload_iframe_src', "$media_upload_iframe_src?type=video");
353
+ $video_title = __('Add Video');
354
+ $audio_upload_iframe_src = apply_filters('audio_upload_iframe_src', "$media_upload_iframe_src?type=audio");
355
+ $audio_title = __('Add Audio');
356
+ $media = <<<EOF
357
+ <a href="{$image_upload_iframe_src}&TB_iframe=true" id="add_image{$rand}" title='$image_title' onclick="focusTextArea('{$name}{$rand}'); jQuery(this).attr('href',jQuery(this).attr('href').replace('\?','?post_id='+jQuery('#post_ID').val())); return thickbox(this);"><img src='images/media-button-image.gif' alt='$image_title' /></a>
358
+ <a href="{$video_upload_iframe_src}&amp;TB_iframe=true" id="add_video{$rand}" title='$video_title' onclick="focusTextArea('{$name}{$rand}'); jQuery(this).attr('href',jQuery(this).attr('href').replace('\?','?post_id='+jQuery('#post_ID').val())); return thickbox(this);"><img src='images/media-button-video.gif' alt='$video_title' /></a>
359
+ <a href="{$audio_upload_iframe_src}&amp;TB_iframe=true" id="add_audio{$rand}" title='$audio_title' onclick="focusTextArea('{$name}{$rand}'); jQuery(this).attr('href',jQuery(this).attr('href').replace('\?','?post_id='+jQuery('#post_ID').val())); return thickbox(this);"><img src='images/media-button-music.gif' alt='$audio_title' /></a>
360
+ <a href="{$media_upload_iframe_src}?TB_iframe=true" id="add_media{$rand}" title='$media_title' onclick="focusTextArea('{$name}{$rand}'); jQuery(this).attr('href',jQuery(this).attr('href').replace('\?','?post_id='+jQuery('#post_ID').val())); return thickbox(this);"><img src='images/media-button-other.gif' alt='$media_title' /></a>
361
+ EOF;
362
+
363
+ $switch = '<div>';
364
+ if( $tinyMCE == true ) {
365
+ $switch .= '<a href="#toggle" onclick="switchMode(\''.$name.$rand.'\'); return false;">' . __('Toggle', 'custom-field-template') . '</a>';
366
+ }
367
+ $swicth .= '</div>';
368
+
369
+ }
370
+
371
  $out .=
372
  '<tr>' .
373
+ '<th scope="row" valign="top">' . $title . '<br />' . $media . $switch . '</th>' .
374
+ '<td><textarea id="' . $name . $rand . '" name="' . $name . '" type="textfield" rows="' .$rows. '" cols="' . $cols . '" style="color:#000000">' . attribute_escape($value) . '</textarea></td>' .
375
  '</tr>';
376
  return $out;
377
  }
384
  return;
385
 
386
  $out .= '<input type="hidden" name="custom-field-template-id" id="custom-field-template-id" value="' . $id . '" />';
387
+ $out .= '<table class="editform" style="width:100%;">';
388
  foreach( $fields as $title => $data ) {
389
  if( $data[ 'type' ] == 'textfield' ) {
390
  $out .= $this->make_textfield( $title, $data[ 'size' ] );
438
  <div class="dbx-content">';
439
  }
440
 
441
+ $out .= '<script type="text/javascript">' . "\n" .
442
+ '// <![CDATA[' . "\n" .
443
+ 'function send_to_custom_field(h) {' . "\n" .
444
+ ' if ( tmpFocus ) ed = tmpFocus;' . "\n" .
445
+ ' else {ed = tinyMCE.get("content"); if(ed) {if(!ed.isHidden()) isTinyMCE = true;}}' . "\n" .
446
+ ' if ( typeof tinyMCE != "undefined" && isTinyMCE && !ed.isHidden() ) {' . "\n" .
447
+ ' ed.focus();' . "\n" .
448
+ ' //if (tinymce.isIE)' . "\n" .
449
+ ' //ed.selection.moveToBookmark(tinymce.EditorManager.activeEditor.windowManager.bookmark);' . "\n" .
450
+ ' if ( h.indexOf("[caption") != -1 )' . "\n" .
451
+ ' h = ed.plugins.wpeditimage._do_shcode(h);' . "\n" .
452
+ ' ed.execCommand("mceInsertContent", false, h);' . "\n" .
453
+ ' } else {' . "\n" .
454
+ ' if ( tmpFocus ) edInsertContent(tmpFocus, h);' . "\n" .
455
+ ' else edInsertContent(edCanvas, h);' . "\n" .
456
+ ' }' . "\n";
457
+
458
+ if (!$options['custom_field_template_use_multiple_insert']) {
459
+ $out .= ' tb_remove();' . "\n" .
460
+ ' tmpFocus = undefined;' . "\n" .
461
+ ' isTinyMCE = false;' . "\n";
462
+ }
463
+
464
+ $out .= '}' . "\n" .
465
+ 'jQuery(".thickbox").bind("click", function (e) {' . "\n" .
466
+ ' tmpFocus = undefined;' . "\n" .
467
+ ' isTinyMCE = false;' . "\n" .
468
+ '});' . "\n" .
469
+ 'var isTinyMCE;' . "\n" .
470
+ 'var tmpFocus;' . "\n" .
471
+ 'function focusTextArea(id) {' . "\n" .
472
+ ' jQuery(document).ready(function() {' . "\n" .
473
+ ' var elm = tinyMCE.get(id);' . "\n" .
474
+ ' if ( ! elm || elm.isHidden() ) {' . "\n" .
475
+ ' elm = document.getElementById(id);' . "\n" .
476
+ ' isTinyMCE = false;' . "\n" .
477
+ ' }else isTinyMCE = true;' . "\n" .
478
+ ' tmpFocus = elm' . "\n" .
479
+ ' elm.focus();' . "\n" .
480
+ ' if (elm.createTextRange) {' . "\n" .
481
+ ' var range = elm.createTextRange();' . "\n" .
482
+ ' range.move("character", elm.value.length);' . "\n" .
483
+ ' range.select();' . "\n" .
484
+ ' } else if (elm.setSelectionRange) {' . "\n" .
485
+ ' elm.setSelectionRange(elm.value.length, elm.value.length);' . "\n" .
486
+ ' }' . "\n" .
487
+ ' });' . "\n" .
488
+ '}' . "\n" .
489
+ 'function thickbox(link) {' . "\n" .
490
+ ' var t = link.title || link.name || null;' . "\n" .
491
+ ' var a = link.href || link.alt;' . "\n" .
492
+ ' var g = link.rel || false;' . "\n" .
493
+ ' tb_show(t,a,g);' . "\n" .
494
+ ' link.blur();' . "\n" .
495
+ ' return false;' . "\n" .
496
+ '}' . "\n" .
497
+ 'function switchMode(id) {' . "\n" .
498
+ ' var ed = tinyMCE.get(id);' . "\n" .
499
+ ' if ( ! ed || ed.isHidden() ) {' . "\n" .
500
+ ' if ( ed ) ed.show();' . "\n" .
501
+ ' else tinyMCE.execCommand("mceAddControl", false, id);' . "\n" .
502
+ ' } else {' . "\n" .
503
+ ' ed.hide();document.getElementById(id).style.color="#000000";' . "\n" .
504
+ ' }' . "\n" .
505
+ '}' . "\n" .
506
+ '// ]]>' . "\n" .
507
+ '</script>';
508
+
509
  $body = $this->load_custom_field();
510
+ $out .= '<select id="custom_field_template_select" onchange="jQuery.ajax({type: \'GET\', url: \'?page=custom-field-template/custom-field-template.php&id=\'+jQuery(this).val()+\'&post=\'+jQuery(\'#post_ID\').val(), success: function(html) {jQuery(\'#custom-field-template-box\').html(html);}});">';
511
  for ( $i=0; $i < count($options['custom_fields']); $i++ ) {
512
  if ( $i == $options['posts'][$_REQUEST['post']] ) {
513
  $out .= '<option value="' . $i . '" selected="selected">' . stripcslashes($options['custom_fields'][$i]['title']) . '</option>';
custom-field-template.pot CHANGED
@@ -1,23 +1,9 @@
1
- # WordPress 用日本語リソース (UTF-8)
2
- # Japanese (UTF-8) translation for WordPress
3
- #
4
- # Copyright (c) 2005-2008
5
- # このファイルは WordPress 本体と同じライセンスのもと配布されています。
6
- # This file is distributed under the same license as the WordPress package.
7
- #
8
- # WordPress 日本語版作成チーム / WP ja translation team
9
- # <http://groups.google.com/group/wp-ja-pkg/web/members>
10
- #
11
- # 誤字脱字誤訳、あるいはよりよい訳などありましたら以下までぜひお知らせください。
12
- # また、翻訳、校正、コミットをお手伝いしていただける方も随時募集中です。
13
- # 連絡先 / Contact: wpja.team@gmail.com (件名か内容に「日本語リソース」と入れてください)
14
- #
15
  msgid ""
16
  msgstr ""
17
  "Project-Id-Version: Custom Field Template\n"
18
  "Report-Msgid-Bugs-To: \n"
19
- "POT-Creation-Date: 2008-08-29 18:28+0900\n"
20
- "PO-Revision-Date: 2008-08-29 18:28+0900\n"
21
  "Last-Translator: \n"
22
  "Language-Team: \n"
23
  "MIME-Version: 1.0\n"
@@ -27,68 +13,104 @@ msgstr ""
27
  "X-Poedit-Basepath: ../\n"
28
  "X-Poedit-SearchPath-0: custom-field-template\n"
29
 
30
- #: custom-field-template/custom-field-template.php:48
31
  msgid "Default Template"
32
  msgstr ""
33
 
34
- #: custom-field-template/custom-field-template.php:81
35
- #: custom-field-template/custom-field-template.php:112
36
- #: custom-field-template/custom-field-template.php:349
37
- #: custom-field-template/custom-field-template.php:357
38
  msgid "Custom Field Template"
39
  msgstr ""
40
 
41
- #: custom-field-template/custom-field-template.php:97
42
  msgid "Options updated."
43
  msgstr ""
44
 
45
- #: custom-field-template/custom-field-template.php:101
46
  msgid "Options resetted."
47
  msgstr ""
48
 
49
- #: custom-field-template/custom-field-template.php:105
50
  msgid "Options deleted."
51
  msgstr ""
52
 
53
- #: custom-field-template/custom-field-template.php:114
54
  msgid "Custom Field Template Options"
55
  msgstr ""
56
 
57
- #: custom-field-template/custom-field-template.php:122
58
  #, php-format
59
  msgid "Template Title %d"
60
  msgstr ""
61
 
62
- #: custom-field-template/custom-field-template.php:124
63
  #, php-format
64
  msgid "Template Content %d"
65
  msgstr ""
66
 
67
- #: custom-field-template/custom-field-template.php:131
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
68
  msgid "Update Options &raquo;"
69
  msgstr ""
70
 
71
- #: custom-field-template/custom-field-template.php:137
72
  msgid "Reset Options"
73
  msgstr ""
74
 
75
- #: custom-field-template/custom-field-template.php:138
76
  msgid "Are you sure to reset options? Options you set will be reset to the default settings."
77
  msgstr ""
78
 
79
- #: custom-field-template/custom-field-template.php:142
80
  msgid "Unset Options &raquo;"
81
  msgstr ""
82
 
83
- #: custom-field-template/custom-field-template.php:148
84
  msgid "Delete Options"
85
  msgstr ""
86
 
87
- #: custom-field-template/custom-field-template.php:149
88
  msgid "Are you sure to delete options? Options you set will be deleted."
89
  msgstr ""
90
 
91
- #: custom-field-template/custom-field-template.php:153
92
  msgid "Delete Options &raquo;"
93
  msgstr ""
94
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Custom Field Template\n"
4
  "Report-Msgid-Bugs-To: \n"
5
+ "POT-Creation-Date: 2008-10-01 02:34+0900\n"
6
+ "PO-Revision-Date: 2008-10-01 02:34+0900\n"
7
  "Last-Translator: \n"
8
  "Language-Team: \n"
9
  "MIME-Version: 1.0\n"
13
  "X-Poedit-Basepath: ../\n"
14
  "X-Poedit-SearchPath-0: custom-field-template\n"
15
 
16
+ #: custom-field-template/custom-field-template.php:81
17
  msgid "Default Template"
18
  msgstr ""
19
 
20
+ #: custom-field-template/custom-field-template.php:120
21
+ #: custom-field-template/custom-field-template.php:152
22
+ #: custom-field-template/custom-field-template.php:431
23
+ #: custom-field-template/custom-field-template.php:439
24
  msgid "Custom Field Template"
25
  msgstr ""
26
 
27
+ #: custom-field-template/custom-field-template.php:137
28
  msgid "Options updated."
29
  msgstr ""
30
 
31
+ #: custom-field-template/custom-field-template.php:141
32
  msgid "Options resetted."
33
  msgstr ""
34
 
35
+ #: custom-field-template/custom-field-template.php:145
36
  msgid "Options deleted."
37
  msgstr ""
38
 
39
+ #: custom-field-template/custom-field-template.php:154
40
  msgid "Custom Field Template Options"
41
  msgstr ""
42
 
43
+ #: custom-field-template/custom-field-template.php:162
44
  #, php-format
45
  msgid "Template Title %d"
46
  msgstr ""
47
 
48
+ #: custom-field-template/custom-field-template.php:164
49
  #, php-format
50
  msgid "Template Content %d"
51
  msgstr ""
52
 
53
+ #: custom-field-template/custom-field-template.php:171
54
+ msgid "In case that you would like to insert multiple images at once in use of the custom field media buttons"
55
+ msgstr ""
56
+
57
+ #: custom-field-template/custom-field-template.php:172
58
+ msgid "Use multiple image inset"
59
+ msgstr ""
60
+
61
+ #: custom-field-template/custom-field-template.php:172
62
+ msgid "Caution:"
63
+ msgstr ""
64
+
65
+ #: custom-field-template/custom-field-template.php:172
66
+ msgid "You need to edit `wp-admin/includes/media.php`. Delete or comment out the code in the function media_send_to_editor at around line 88-96."
67
+ msgstr ""
68
+
69
+ #: custom-field-template/custom-field-template.php:176
70
  msgid "Update Options &raquo;"
71
  msgstr ""
72
 
73
+ #: custom-field-template/custom-field-template.php:182
74
  msgid "Reset Options"
75
  msgstr ""
76
 
77
+ #: custom-field-template/custom-field-template.php:183
78
  msgid "Are you sure to reset options? Options you set will be reset to the default settings."
79
  msgstr ""
80
 
81
+ #: custom-field-template/custom-field-template.php:187
82
  msgid "Unset Options &raquo;"
83
  msgstr ""
84
 
85
+ #: custom-field-template/custom-field-template.php:193
86
  msgid "Delete Options"
87
  msgstr ""
88
 
89
+ #: custom-field-template/custom-field-template.php:194
90
  msgid "Are you sure to delete options? Options you set will be deleted."
91
  msgstr ""
92
 
93
+ #: custom-field-template/custom-field-template.php:198
94
  msgid "Delete Options &raquo;"
95
  msgstr ""
96
 
97
+ #: custom-field-template/custom-field-template.php:353
98
+ msgid "Add Media"
99
+ msgstr ""
100
+
101
+ #: custom-field-template/custom-field-template.php:355
102
+ msgid "Add an Image"
103
+ msgstr ""
104
+
105
+ #: custom-field-template/custom-field-template.php:357
106
+ msgid "Add Video"
107
+ msgstr ""
108
+
109
+ #: custom-field-template/custom-field-template.php:359
110
+ msgid "Add Audio"
111
+ msgstr ""
112
+
113
+ #: custom-field-template/custom-field-template.php:369
114
+ msgid "Toggle"
115
+ msgstr ""
116
+
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: Hiroaki Miyashita
3
  Donate link: http://wordpressgogo.com/development/custom-field-template.html
4
  Tags: custom, fields, field, template
5
  Requires at least: 2.1
6
- Tested up to: 2.6.1
7
- Stable tag: 0.2
8
 
9
  This plugin adds the default custom fields on the Write Post/Page.
10
 
@@ -15,6 +15,7 @@ The Custom Field Template plugin adds the default custom fields on the Write Pos
15
  * You can set any number of the custom field templates and switch the templates when you write/edit the post/page.
16
  * This plugin does not use the ini file for the template but set it in the option page of the plugin.
17
  * Support for TinyMCE in the textarea.
 
18
 
19
  == Installation ==
20
 
3
  Donate link: http://wordpressgogo.com/development/custom-field-template.html
4
  Tags: custom, fields, field, template
5
  Requires at least: 2.1
6
+ Tested up to: 2.6.2
7
+ Stable tag: 0.3.1
8
 
9
  This plugin adds the default custom fields on the Write Post/Page.
10
 
15
  * You can set any number of the custom field templates and switch the templates when you write/edit the post/page.
16
  * This plugin does not use the ini file for the template but set it in the option page of the plugin.
17
  * Support for TinyMCE in the textarea.
18
+ * Support for media buttons in the textarea. - requires at least 2.5.
19
 
20
  == Installation ==
21
 
screenshot-2.png CHANGED
Binary file