Changeset 148263
- Timestamp:
- 08/23/2009 12:58:41 AM (17 years ago)
- Location:
- comment-form-quicktags/trunk
- Files:
-
- 5 edited
-
admin.js (modified) (1 diff)
-
comment-form-quicktags.php (modified) (9 diffs)
-
languages/comment-form-quicktags-ja.mo (modified) (previous)
-
languages/comment-form-quicktags-ja.po (modified) (2 diffs)
-
languages/comment-form-quicktags.pot (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
comment-form-quicktags/trunk/admin.js
r97876 r148263 85 85 }); 86 86 87 $('cap_check').observe('change', function(){ 88 $$('#roles input[type=checkbox]').invoke(this.checked ? 'enable' : 'disable'); 89 }); 90 87 91 $('rform').observe('submit', function(event){ 88 92 if (!confirm(cfqadminL10n['removeConfirm'])) { -
comment-form-quicktags/trunk/comment-form-quicktags.php
r121920 r148263 65 65 66 66 /** 67 * Capability name. 68 * @var string 69 */ 70 var $cap; 71 72 /** 67 73 * Initialize CommentFormQuicktags. 68 74 */ … … 73 79 $this->option_name = $this->plugin_name . '-option'; 74 80 $this->option_hook = 'cfq_option_page'; 81 $this->cap = 'comment_form_quicktags'; 75 82 if (defined('WP_PLUGIN_URL')) { 76 83 $this->plugin_url = WP_PLUGIN_URL . '/' . $this->plugin_name; … … 136 143 ) 137 144 ), 138 'modified' => filemtime(__FILE__) 145 'modified' => filemtime(__FILE__), 146 'cap_check' => false 139 147 ); 140 148 if (!isset($this->options['sort'])) $this->options['sort'] = array_keys($this->options['tags']); … … 162 170 function set_hooks() { 163 171 add_action('wp_head', array(&$this, 'add_head')); 172 add_action('admin_menu', array(&$this, 'set_admin_hooks')); 164 173 add_filter('comments_template', array(&$this, 'detect_start')); 165 add_action('admin_menu', array(&$this, 'set_admin_hooks'));166 174 } 167 175 … … 245 253 */ 246 254 function detect_start($file) { 247 ob_start(array(&$this, 'add_tags')); 248 $this->ended = false; 249 add_action('comment_form', array(&$this, 'detect_end')); 250 add_action('wp_footer', array(&$this, 'detect_end')); 255 if (!$this->options['cap_check'] || ($this->options['cap_check'] && current_user_can($this->cap))) { 256 ob_start(array(&$this, 'add_tags')); 257 $this->ended = false; 258 add_action('comment_form', array(&$this, 'detect_end')); 259 add_action('wp_footer', array(&$this, 'detect_end')); 260 } 251 261 252 262 return $file; … … 301 311 */ 302 312 function options_page() { 313 global $wp_roles; 303 314 include 'json.php'; 315 304 316 if (isset($_POST['action'])) { 305 317 switch ($_POST['action']) { … … 312 324 echo '<div class="updated fade"><p><strong>' . __('Options saved.', $this->domain) . '</strong></p></div>'; 313 325 break; 326 case 'rolelimit': 327 $this->options['cap_check'] = isset($_POST['cap_check']); 328 $this->update_option(); 329 if ($this->options['cap_check']) { 330 foreach ($wp_roles->get_names() as $role => $name) { 331 $wp_roles->add_cap($role, $this->cap, in_array($role, $_POST['role'])); 332 } 333 } 334 echo '<div class="updated fade"><p><strong>' . __('Options saved.', $this->domain) . '</strong></p></div>'; 335 break; 314 336 case 'remove': 315 337 $this->delete_option(); 316 338 $this->get_option(); 339 foreach ($wp_roles->get_names() as $role => $name) { 340 $wp_roles->remove_cap($role, $this->cap); 341 } 317 342 echo '<div class="updated fade"><p><strong>' . __('Options removed.', $this->domain) . '</strong></p></div>'; 318 343 break; … … 380 405 <input type="hidden" name="sort" id="sort" value="" /> 381 406 <input type="hidden" name="tags" id="tags" value="" /> 382 <input type="submit" class="button-primary" value="<?php _e('Update Tags', $this->domain) ?>" name="submit"/>407 <input type="submit" class="button-primary" value="<?php _e('Update Tags', $this->domain) ?>" /> 383 408 </p> 384 409 </form> 385 410 411 <h3><?php _e('Role limitation', $this->domain) ?></h3> 412 <form id="rolelimit" method="post" action="?page=<?php echo $this->option_hook ?>"> 413 <p> 414 <label><input type="checkbox" id="cap_check" name="cap_check" <?php echo $this->options['cap_check'] ? 'checked="checked"' : '' ?> /> <?php _e('Use role limitation', $this->domain) ?></label> 415 </p> 416 <p id="roles"> 417 <?php _e('Select the roles that can use quicktags.', $this->domain) ?><br /> 418 <?php 419 foreach ($wp_roles->roles as $role => $data) { 420 $checked = isset($data['capabilities'][$this->cap]) && $data['capabilities'][$this->cap] ? 'checked="checked"' : ''; 421 $disabled = $this->options['cap_check'] ? '' : 'disabled="disabled"'; 422 printf('<label><input type="checkbox" name="role[]" value="%s" %s %s /> %s</label><br />', $role, $checked, $disabled, _c($data['name'])); 423 } 424 ?> 425 </p> 426 427 <p class="submit"> 428 <input type="hidden" name="action" value="rolelimit" /> 429 <input type="submit" class="button-primary" value="<?php _e('Update roles', $this->domain) ?>" /> 430 </p> 431 </form> 386 432 387 433 <h3><?php _e('Remove options', $this->domain) ?></h3> … … 390 436 <p> 391 437 <input type="hidden" name="action" value="remove" /> 392 <input type="submit" class="button" value="<?php _e('Remove options', $this->domain) ?>" name="submit"/>438 <input type="submit" class="button" value="<?php _e('Remove options', $this->domain) ?>" /> 393 439 </p> 394 440 </form> -
comment-form-quicktags/trunk/languages/comment-form-quicktags-ja.po
r85872 r148263 3 3 "Project-Id-Version: Comment Form Quicktags\n" 4 4 "Report-Msgid-Bugs-To: \n" 5 "POT-Creation-Date: 2009-0 1-11 23:49+0900\n"5 "POT-Creation-Date: 2009-08-23 01:57+0100\n" 6 6 "PO-Revision-Date: \n" 7 7 "Last-Translator: Regen <g(DOT)regen100(AT)gmail(DOT)com>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "Plural-Forms: nplurals=1; plural=0;\n" 12 13 "X-Poedit-Language: Japanese\n" 13 "X-Poedit-KeywordsList: __;_e\n"14 "X-Poedit-Basepath: .\n"15 "X-Poedit-SearchPath-0: C:\\repository\\comment-form-quicktags\n"16 14 17 #: C:\repository\comment-form-quicktags/comment-form-quicktags.php:10918 #: C:\repository\comment-form-quicktags/comment-form-quicktags.php:22415 #: comment-form-quicktags.php:180 16 #: comment-form-quicktags.php:349 19 17 msgid "Comment Form Quicktags Options" 20 18 msgstr "Comment Form Quicktags オプション" 21 19 22 #: C:\repository\comment-form-quicktags/comment-form-quicktags.php:10920 #: comment-form-quicktags.php:180 23 21 msgid "Comment Form Quicktags" 24 22 msgstr "Comment Form Quicktags" 25 23 26 #: C:\repository\comment-form-quicktags/comment-form-quicktags.php:12024 #: comment-form-quicktags.php:193 27 25 msgid "Are you sure?" 28 26 msgstr "よろしいですか?" 29 27 30 #: C:\repository\comment-form-quicktags/comment-form-quicktags.php:15528 #: comment-form-quicktags.php:237 31 29 msgid "Settings" 32 30 msgstr "設定" 33 31 34 #: C:\repository\comment-form-quicktags/comment-form-quicktags.php:212 32 #: comment-form-quicktags.php:324 33 #: comment-form-quicktags.php:334 35 34 msgid "Options saved." 36 35 msgstr "設定が保存されました。" 37 36 38 #: C:\repository\comment-form-quicktags/comment-form-quicktags.php:21737 #: comment-form-quicktags.php:342 39 38 msgid "Options removed." 40 39 msgstr "設定が削除されました。" 41 40 42 #: C:\repository\comment-form-quicktags/comment-form-quicktags.php:22541 #: comment-form-quicktags.php:350 43 42 msgid "Javascript is needed! " 44 43 msgstr "Javascriptが必要です" 45 44 46 #: C:\repository\comment-form-quicktags/comment-form-quicktags.php:22745 #: comment-form-quicktags.php:352 47 46 msgid "Tag Options" 48 47 msgstr "タグ設定" 49 48 50 #: C:\repository\comment-form-quicktags/comment-form-quicktags.php:22949 #: comment-form-quicktags.php:354 51 50 msgid "Click a tag which you want to edit or input ID which you want to add." 52 51 msgstr "編集したいタグをクリックするか追加したいIDを入力してください。" 53 52 54 #: C:\repository\comment-form-quicktags/comment-form-quicktags.php:23053 #: comment-form-quicktags.php:355 55 54 msgid "Edit other field." 56 55 msgstr "他の項目を編集してください。" 57 56 58 #: C:\repository\comment-form-quicktags/comment-form-quicktags.php:23157 #: comment-form-quicktags.php:356 59 58 msgid "Click Edit/Add button." 60 59 msgstr "編集/追加ボタンをクリックしてください。" 61 60 62 #: C:\repository\comment-form-quicktags/comment-form-quicktags.php:23261 #: comment-form-quicktags.php:357 63 62 msgid "Sort tags by dragging." 64 63 msgstr "タグをドラッグして順序を変えてください。" 65 64 66 #: C:\repository\comment-form-quicktags/comment-form-quicktags.php:23365 #: comment-form-quicktags.php:358 67 66 msgid "After that, click Update Tags button to save." 68 67 msgstr "そのあと、タグを更新ボタンを押して保存してください。" 69 68 70 #: C:\repository\comment-form-quicktags/comment-form-quicktags.php:23569 #: comment-form-quicktags.php:360 71 70 #, php-format 72 71 msgid "<strong>[Info]</strong> Allowed tags in comments: <code class=\"tags\">%s</code>." 73 72 msgstr "<strong>[Info]</strong> コメントで使えるタグ: <code class=\"tags\">%s</code>" 74 73 75 #: C:\repository\comment-form-quicktags/comment-form-quicktags.php:23674 #: comment-form-quicktags.php:361 76 75 msgid "<strong>[Note]</strong> There are special IDs: ed_link, ed_img and ed_close." 77 76 msgstr "<strong>[Note]</strong> 特別なIDがあります: ed_link, ed_img, ed_close" 78 77 79 #: C:\repository\comment-form-quicktags/comment-form-quicktags.php:25278 #: comment-form-quicktags.php:379 80 79 msgid "ID<span>*</span>" 81 80 msgstr "ID<span>*</span>" 82 81 83 #: C:\repository\comment-form-quicktags/comment-form-quicktags.php:25582 #: comment-form-quicktags.php:382 84 83 msgid "Display<span>*</span>" 85 84 msgstr "表示名<span>*</span>" 86 85 87 #: C:\repository\comment-form-quicktags/comment-form-quicktags.php:25886 #: comment-form-quicktags.php:385 88 87 msgid "Start tag" 89 88 msgstr "開始タグ" 90 89 91 #: C:\repository\comment-form-quicktags/comment-form-quicktags.php:26190 #: comment-form-quicktags.php:388 92 91 msgid "End tag" 93 92 msgstr "終了タグ" 94 93 95 #: C:\repository\comment-form-quicktags/comment-form-quicktags.php:26494 #: comment-form-quicktags.php:391 96 95 msgid "Access key" 97 96 msgstr "アクセスキー" 98 97 99 #: C:\repository\comment-form-quicktags/comment-form-quicktags.php:26998 #: comment-form-quicktags.php:396 100 99 msgid "Edit/Add" 101 100 msgstr "編集/追加" 102 101 103 #: C:\repository\comment-form-quicktags/comment-form-quicktags.php:270102 #: comment-form-quicktags.php:397 104 103 msgid "Delete" 105 104 msgstr "削除" 106 105 107 #: C:\repository\comment-form-quicktags/comment-form-quicktags.php:271106 #: comment-form-quicktags.php:398 108 107 msgid "Clear fields" 109 108 msgstr "項目をクリア" 110 109 111 #: C:\repository\comment-form-quicktags/comment-form-quicktags.php:280110 #: comment-form-quicktags.php:407 112 111 msgid "Update Tags" 113 112 msgstr "タグを更新" 114 113 115 #: C:\repository\comment-form-quicktags/comment-form-quicktags.php:285 116 #: C:\repository\comment-form-quicktags/comment-form-quicktags.php:290 114 #: comment-form-quicktags.php:411 115 msgid "Role limitation" 116 msgstr "権限での制限" 117 118 #: comment-form-quicktags.php:414 119 msgid "Use role limitation" 120 msgstr "権限でクイックタグの使用を制限する" 121 122 #: comment-form-quicktags.php:417 123 msgid "Select the roles that can use quicktags." 124 msgstr "クイックタグを使用できる権限を選んでください。" 125 126 #: comment-form-quicktags.php:429 127 msgid "Update roles" 128 msgstr "権限を更新" 129 130 #: comment-form-quicktags.php:433 131 #: comment-form-quicktags.php:438 117 132 msgid "Remove options" 118 133 msgstr "オプションを削除" 119 134 120 #: C:\repository\comment-form-quicktags/comment-form-quicktags.php:286135 #: comment-form-quicktags.php:434 121 136 msgid "You can remove the above options from the database. All the settings return to default." 122 137 msgstr "上のオプションをデータベースから削除できます。全ての設定はデフォルトに戻ります。" -
comment-form-quicktags/trunk/languages/comment-form-quicktags.pot
r85872 r148263 1 # SOME DESCRIPTIVE TITLE. 2 # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER 3 # This file is distributed under the same license as the PACKAGE package. 4 # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. 5 # 6 #, fuzzy 1 7 msgid "" 2 8 msgstr "" 3 "Project-Id-Version: Comment Form Quicktags\n"9 "Project-Id-Version: PACKAGE VERSION\n" 4 10 "Report-Msgid-Bugs-To: \n" 5 "POT-Creation-Date: 2009-0 1-11 23:49+0900\n"6 "PO-Revision-Date: \n"7 "Last-Translator: \n"8 "Language-Team: \n"11 "POT-Creation-Date: 2009-08-23 01:57+0100\n" 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" 14 "Language-Team: LANGUAGE <LL@li.org>\n" 9 15 "MIME-Version: 1.0\n" 10 "Content-Type: text/plain; charset= UTF-8\n"16 "Content-Type: text/plain; charset=CHARSET\n" 11 17 "Content-Transfer-Encoding: 8bit\n" 12 "X-Poedit-Language: \n"13 "X-Poedit-KeywordsList: __;_e\n"14 "X-Poedit-Basepath: .\n"15 "X-Poedit-SearchPath-0: \n"16 18 17 #: /comment-form-quicktags.php:109 18 #: /comment-form-quicktags.php:224 19 #: comment-form-quicktags.php:180 comment-form-quicktags.php:349 19 20 msgid "Comment Form Quicktags Options" 20 21 msgstr "" 21 22 22 #: /comment-form-quicktags.php:10923 #: comment-form-quicktags.php:180 23 24 msgid "Comment Form Quicktags" 24 25 msgstr "" 25 26 26 #: /comment-form-quicktags.php:12027 #: comment-form-quicktags.php:193 27 28 msgid "Are you sure?" 28 29 msgstr "" 29 30 30 #: /comment-form-quicktags.php:15531 #: comment-form-quicktags.php:237 31 32 msgid "Settings" 32 33 msgstr "" 33 34 34 #: /comment-form-quicktags.php:21235 #: comment-form-quicktags.php:324 comment-form-quicktags.php:334 35 36 msgid "Options saved." 36 37 msgstr "" 37 38 38 #: /comment-form-quicktags.php:21739 #: comment-form-quicktags.php:342 39 40 msgid "Options removed." 40 41 msgstr "" 41 42 42 #: /comment-form-quicktags.php:22543 #: comment-form-quicktags.php:350 43 44 msgid "Javascript is needed! " 44 45 msgstr "" 45 46 46 #: /comment-form-quicktags.php:22747 #: comment-form-quicktags.php:352 47 48 msgid "Tag Options" 48 49 msgstr "" 49 50 50 #: /comment-form-quicktags.php:22951 #: comment-form-quicktags.php:354 51 52 msgid "Click a tag which you want to edit or input ID which you want to add." 52 53 msgstr "" 53 54 54 #: /comment-form-quicktags.php:23055 #: comment-form-quicktags.php:355 55 56 msgid "Edit other field." 56 57 msgstr "" 57 58 58 #: /comment-form-quicktags.php:23159 #: comment-form-quicktags.php:356 59 60 msgid "Click Edit/Add button." 60 61 msgstr "" 61 62 62 #: /comment-form-quicktags.php:23263 #: comment-form-quicktags.php:357 63 64 msgid "Sort tags by dragging." 64 65 msgstr "" 65 66 66 #: /comment-form-quicktags.php:23367 #: comment-form-quicktags.php:358 67 68 msgid "After that, click Update Tags button to save." 68 69 msgstr "" 69 70 70 #: /comment-form-quicktags.php:235 71 #, php-format 72 msgid "<strong>[Info]</strong> Allowed tags in comments: <code class=\"tags\">%s</code>." 71 #: comment-form-quicktags.php:360 72 #, possible-php-format 73 msgid "" 74 "<strong>[Info]</strong> Allowed tags in comments: <code class=\"tags\">%s</" 75 "code>." 73 76 msgstr "" 74 77 75 #: /comment-form-quicktags.php:236 76 msgid "<strong>[Note]</strong> There are special IDs: ed_link, ed_img and ed_close." 78 #: comment-form-quicktags.php:361 79 msgid "" 80 "<strong>[Note]</strong> There are special IDs: ed_link, ed_img and ed_close." 77 81 msgstr "" 78 82 79 #: /comment-form-quicktags.php:25283 #: comment-form-quicktags.php:379 80 84 msgid "ID<span>*</span>" 81 85 msgstr "" 82 86 83 #: /comment-form-quicktags.php:25587 #: comment-form-quicktags.php:382 84 88 msgid "Display<span>*</span>" 85 89 msgstr "" 86 90 87 #: /comment-form-quicktags.php:25891 #: comment-form-quicktags.php:385 88 92 msgid "Start tag" 89 93 msgstr "" 90 94 91 #: /comment-form-quicktags.php:26195 #: comment-form-quicktags.php:388 92 96 msgid "End tag" 93 97 msgstr "" 94 98 95 #: /comment-form-quicktags.php:26499 #: comment-form-quicktags.php:391 96 100 msgid "Access key" 97 101 msgstr "" 98 102 99 #: /comment-form-quicktags.php:269103 #: comment-form-quicktags.php:396 100 104 msgid "Edit/Add" 101 105 msgstr "" 102 106 103 #: /comment-form-quicktags.php:270107 #: comment-form-quicktags.php:397 104 108 msgid "Delete" 105 109 msgstr "" 106 110 107 #: /comment-form-quicktags.php:271111 #: comment-form-quicktags.php:398 108 112 msgid "Clear fields" 109 113 msgstr "" 110 114 111 #: /comment-form-quicktags.php:280115 #: comment-form-quicktags.php:407 112 116 msgid "Update Tags" 113 117 msgstr "" 114 118 115 #: /comment-form-quicktags.php:285 116 #: /comment-form-quicktags.php:290 119 #: comment-form-quicktags.php:411 120 msgid "Role limitation" 121 msgstr "" 122 123 #: comment-form-quicktags.php:414 124 msgid "Use role limitation" 125 msgstr "" 126 127 #: comment-form-quicktags.php:417 128 msgid "Select the roles that can use quicktags." 129 msgstr "" 130 131 #: comment-form-quicktags.php:429 132 msgid "Update roles" 133 msgstr "" 134 135 #: comment-form-quicktags.php:433 comment-form-quicktags.php:438 117 136 msgid "Remove options" 118 137 msgstr "" 119 138 120 #: /comment-form-quicktags.php:286 121 msgid "You can remove the above options from the database. All the settings return to default." 139 #: comment-form-quicktags.php:434 140 msgid "" 141 "You can remove the above options from the database. All the settings return " 142 "to default." 122 143 msgstr "" 123
Note: See TracChangeset
for help on using the changeset viewer.