Changeset 163529
- Timestamp:
- 10/15/2009 02:11:29 AM (16 years ago)
- Location:
- what-did-they-say/trunk
- Files:
-
- 11 edited
-
classes/WDTSTranscript.inc (modified) (1 diff)
-
classes/WhatDidTheySayAdmin.inc (modified) (6 diffs)
-
classes/partials/_capabilities.inc (modified) (1 diff)
-
classes/partials/_manage-queued-transcripts.inc (modified) (1 diff)
-
classes/partials/_queued-transcript-contents.inc (modified) (1 diff)
-
classes/partials/admin.inc (modified) (1 diff)
-
readme.txt (modified) (4 diffs)
-
test/WhatDidTheySayAdminTest.php (modified) (1 diff)
-
test/selenium/TestDeletePost.html (modified) (1 diff)
-
what-did-they-say.php (modified) (2 diffs)
-
what-did-they-say.pot (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
what-did-they-say/trunk/classes/WDTSTranscript.inc
r161898 r163529 173 173 return array_keys($languages); 174 174 } 175 176 function count() { 177 return count($this->get_transcripts()); 178 } 175 179 } 176 180 -
what-did-they-say/trunk/classes/WhatDidTheySayAdmin.inc
r163323 r163529 336 336 337 337 if (current_user_can('approve_transcriptions')) { 338 // edit posts notification 339 add_filter('manage_posts_columns', array(&$this, 'manage_posts_columns')); 340 add_action('manage_posts_custom_column', array(&$this, 'manage_posts_custom_column'), 10, 2); 341 342 // dashboard widget 343 //wp_add_dashboard_widget('dashboard_transcripts', __('Recent Queued Transcripts', 'what-did-they-say'), array(&$this, 'dashboard_transcripts')); 344 //add_action('wp_dashboard_setup', array(&$this, 'add_dashboard_transcripts')); 345 338 346 if (strpos($pagenow, "post") === 0) { 339 347 add_meta_box( … … 372 380 } 373 381 382 /** 383 * The edit posts column header. 384 */ 385 function manage_posts_columns($columns) { 386 $keys = array_keys($columns); 387 $values = array_values($columns); 388 389 $index = array_search('comments', $keys); 390 if ($index === false) { $index = count($keys); } 391 392 array_splice($keys, $index, 0, array('transcripts')); 393 array_splice($values, $index, 0, __('Trans')); 394 395 return array_combine($keys, $values); 396 } 397 398 /** 399 * The edit posts column. Needs a pretty icon. 400 */ 401 function manage_posts_custom_column($name, $post_id) { 402 if ($name === "transcripts") { 403 $queued_transcript_object = new WDTSQueuedTranscript($post_id); 404 405 if (($queued_count = $queued_transcript_object->count()) > 0) { 406 printf(__('%s queued', 'what-did-they-say'), $queued_count); 407 } 408 } 409 } 374 410 375 411 /** Transcript Search Filters **/ … … 453 489 * @return array The list of capabilities this user now has. 454 490 */ 455 function user_has_cap($capabilities, $requested_capabilities, $capability_name) { 491 function user_has_cap($capabilities, $requested_capabilities, $args) { 492 list($capability_name, $user_id) = $args; 493 456 494 $options = get_option('what-did-they-say-options'); 457 495 if (is_array($options)) { … … 467 505 foreach ($requested_capabilities as $requested_capability) { 468 506 if (in_array($options['capabilities'][$requested_capability], $allowed_roles)) { 507 $capabilities[$requested_capability] = true; 508 } 509 } 510 } 511 512 $user_capabilities = get_usermeta($user_id, 'transcript_capabilities'); 513 514 if (is_array($user_capabilities)) { 515 foreach ($requested_capabilities as $requested_capability) { 516 if (isset($user_capabilities[$requested_capability])) { 469 517 $capabilities[$requested_capability] = true; 470 518 } … … 790 838 791 839 /** 840 * Update per-user capabilities. 841 */ 842 function handle_update_user_capabilities($info) { 843 global $wpdb; 844 845 $updated = false; 846 if (current_user_can('edit_users')) { 847 $users = $wpdb->get_results("SELECT ID, user_login from $wpdb->users ORDER BY user_login"); 848 849 foreach ((array)$users as $user) { 850 $user_capabilities = array(); 851 852 foreach (array_keys($this->capabilities) as $key) { 853 if (isset($info['user_capabilities'][$user->ID])) { 854 if (isset($info['user_capabilities'][$user->ID][$key])) { 855 $user_capabilities[$key] = true; 856 } 857 } 858 } 859 860 if (!empty($user_capabilities)) { 861 update_usermeta($user->ID, 'transcript_capabilities', $user_capabilities); 862 } else { 863 delete_usermeta($user->ID, 'transcript_capabilities'); 864 } 865 } 866 867 $updated = __('Per-user permissions updated.', 'what-did-they-say'); 868 } 869 return $updated; 870 } 871 872 /** 792 873 * Handle resettings what-did-they-say-options. 793 874 * @param array $info The part of the $_POST array for What Did They Say?!? … … 909 990 $suggested_amount = 20 + ($this->transcript_count * 0.1); 910 991 992 $users = $wpdb->get_results("SELECT ID, user_login from $wpdb->users ORDER BY user_login"); 993 911 994 include('partials/admin.inc'); 912 995 } -
what-did-they-say/trunk/classes/partials/_capabilities.inc
r161898 r163529 30 30 </table> 31 31 </form> 32 33 <h3><?php _e('Per-user Permissions', 'what-did-they-say') ?></h3> 34 35 <p><?php _e('Give specified users permissions above and beyond their role permissions.', 'what-did-they-say') ?></p> 36 37 <form method="post"> 38 <input type="hidden" name="wdts[_nonce]" value="<?php echo $nonce ?>" /> 39 <input type="hidden" name="wdts[module]" value="user-capabilities" /> 40 <table class="widefat fixed"> 41 <tr> 42 <th width="15%">Login</th> 43 <th colspan="3">Capabilities</th> 44 </tr> 45 <?php foreach ((array)$users as $user) { 46 $user_capabilities = get_usermeta($user->ID, 'transcript_capabilities'); 47 if (!is_array($user_capabilities)) { $user_capabilities = array(); } 48 ?> 49 <tr> 50 <th scope="row"> 51 <?php echo get_avatar($user->ID, 20) ?> 52 <?php echo $user->user_login ?> 53 </th> 54 <?php foreach ($this->capabilities as $key => $label) { ?> 55 <td> 56 <label style="white-space: nowrap"> 57 <input type="checkbox" 58 name="wdts[user_capabilities][<?php echo $user->ID ?>][<?php echo $key ?>]" 59 value="yes" 60 <?php echo (isset($user_capabilities[$key])) ? 'checked="checked"' : '' ?> 61 /> 62 <?php echo $label ?> 63 </label> 64 </td> 65 <?php } ?> 66 </tr> 67 <?php } ?> 68 <tr> 69 <td> </td> 70 <td colspan="3"> 71 <input class="button" type="submit" value="<?php _e('Update per-user permissions', 'what-did-they-say') ?>" /> 72 </td> 73 </tr> 74 </table> 75 </form> 32 76 <?php } ?> 33 77 -
what-did-they-say/trunk/classes/partials/_manage-queued-transcripts.inc
r163323 r163529 20 20 <h3 style="margin-top: 0.5em"><?php echo $title ?></h3> 21 21 <?php 22 foreach ($transcripts_to_show as $transcript) { 23 include('_display-queued-transcript.inc'); 24 } 22 foreach ($transcripts_to_show as $transcript) { include('_display-queued-transcript.inc'); } 25 23 ?> 26 24 <?php } ?> -
what-did-they-say/trunk/classes/partials/_queued-transcript-contents.inc
r161898 r163529 3 3 <input type="hidden" name="wdts[post_id]" value="<?php echo $post->ID ?>" /> 4 4 <input type="hidden" name="wdts[key]" value="<?php echo $transcript['key'] ?>" /> 5 <p><?php 5 <p> 6 <?php 7 echo get_avatar($transcript['user_id'], 20); 6 8 printf( 7 __(' From<strong>%s</strong> in <strong>%s</strong>:', 'what-did-they-say'),9 __('<strong>%s</strong> in <strong>%s</strong>:', 'what-did-they-say'), 8 10 $transcript_user->display_name, 9 11 $language_options->get_language_name($transcript['language']) -
what-did-they-say/trunk/classes/partials/admin.inc
r163323 r163529 107 107 }; 108 108 109 $('wdts-filters-to-use').observe('change', load_sample_transcript); 110 $('refresh-filter-preview').observe('click', function(e) { 111 Event.stop(e); 112 load_sample_transcript(); 113 }); 109 if ($('wdts-filters-to-user')) { 110 $('wdts-filters-to-use').observe('change', load_sample_transcript); 111 $('refresh-filter-preview').observe('click', function(e) { 112 Event.stop(e); 113 load_sample_transcript(); 114 }); 114 115 115 Event.observe(window, 'load', load_sample_transcript); 116 Event.observe(window, 'load', load_sample_transcript); 117 } 116 118 117 119 <?php if (isset($_POST['wdts']['return_page'])) { ?> -
what-did-they-say/trunk/readme.txt
r163323 r163529 4 4 Tags: admin, comics, webcomics, transcript, video, audio 5 5 Requires at least: 2.8 6 Tested up to: 2. 8.47 Stable tag: 0.9. 16 Tested up to: 2.9 7 Stable tag: 0.9.2 8 8 9 9 What Did They Say?!? lets your users provide multilingual transcriptions to your media, in their language, quickly and securely. … … 24 24 filters, create the directory `wp-content/transcript-filters`. 25 25 26 **What Did They Say?!?** puts a menu item under Options. It also adds a meta box to post editing. 26 **What Did They Say?!?** puts a menu item under Options. It also adds a meta box to post editing and a new column in the Edit Posts lists which 27 indicates how many transcripts are awaiting approval. 27 28 28 29 == Frequently Asked Questions == … … 66 67 * If a user submits a transcript to the queue, they can delete it before it's approved. 67 68 68 Permissions are handed out based on role and is set under the *Capabilities* tab. 69 Permissions are handed out in two ways and are set under the *Capabilities* tab. 70 71 * Based on role (Subscriber, Administrator, etc.) 72 * Per user 69 73 70 74 = How do short codes work? = … … 89 93 == Changelog == 90 94 95 = 0.9.2 = 96 * JavaScript bugfixes. 97 * Per-user permissions. 98 * Visual feedback for number of queued transcripts per post. 91 99 = 0.9.1 = 92 100 * Bugfixes for transcript submission and theme editor global variable name collision. -
what-did-they-say/trunk/test/WhatDidTheySayAdminTest.php
r163323 r163529 62 62 ), $result['capabilities']); 63 63 } 64 65 function testHandleUpdateLanguages() {66 $this->markTestIncomplete();67 }68 64 } 69 65 -
what-did-they-say/trunk/test/selenium/TestDeletePost.html
r161898 r163529 19 19 <tr> 20 20 <td>click</td> 21 <td> link=Delete</td>21 <td>//a[contains(@class, "submitdelete")]</td> 22 22 <td></td> 23 23 </tr> -
what-did-they-say/trunk/what-did-they-say.php
r163323 r163529 4 4 Plugin URI: http://www.coswellproductions.com/wordpress/wordpress-plugins/ 5 5 Description: Manage and display text transcriptions of comics, videos, or other media. 6 Version: 0.9. 16 Version: 0.9.2 7 7 Author: John Bintz 8 8 Author URI: http://www.coswellproductions.com/wordpress/ … … 215 215 ?> 216 216 <div style="display:none"> 217 <span id="wdts-opener-<?php echo $id = md5(rand()) ?>">[ <a href="#"><?php _e('Edit/Add Transcripts', 'what-did-they-say') ?></a> ]</span> 217 <span id="wdts-opener-<?php echo $id = md5(rand()) ?>">[ 218 <a href="#"><?php _e('Edit/Add Transcripts', 'what-did-they-say') ?></a> 219 <?php if (current_user_can('approve_transcriptions')) { 220 if (($queued_count = $queued_transcript_object->count()) > 0) { ?> 221 (<strong><?php printf(__('%d queued', 'what-did-they-say'), $queued_count) ?></strong>) 222 <?php } 223 } ?> 224 ]</span> 218 225 </div> 219 226 <noscript> -
what-did-they-say/trunk/what-did-they-say.pot
r163323 r163529 7 7 msgid "" 8 8 msgstr "" 9 "Project-Id-Version: what-did-they-say 0.9. 1\n"9 "Project-Id-Version: what-did-they-say 0.9.2\n" 10 10 "Report-Msgid-Bugs-To: \n" 11 "POT-Creation-Date: 2009-10-14 07:54-0400\n"11 "POT-Creation-Date: 2009-10-14 21:53-0400\n" 12 12 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 13 13 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 17 17 "Content-Transfer-Encoding: 8bit\n" 18 18 19 #: what-did-they-say.php:2 0719 #: what-did-they-say.php:218 20 20 msgid "Edit/Add Transcripts" 21 msgstr "" 22 23 #: what-did-they-say.php:221 24 #, php-format 25 msgid "%d queued" 21 26 msgstr "" 22 27 … … 78 83 79 84 #: classes/partials/meta-box.inc:37 80 #: classes/partials/_manage-queued-transcripts.inc:3 785 #: classes/partials/_manage-queued-transcripts.inc:35 81 86 msgid "Language:" 82 87 msgstr "" … … 93 98 msgstr "" 94 99 95 #: classes/partials/_queued-transcript-contents.inc: 796 #, php-format 97 msgid " From<strong>%s</strong> in <strong>%s</strong>:"100 #: classes/partials/_queued-transcript-contents.inc:9 101 #, php-format 102 msgid "<strong>%s</strong> in <strong>%s</strong>:" 98 103 msgstr "" 99 104 … … 625 630 msgstr "" 626 631 627 #: classes/partials/_manage-queued-transcripts.inc:2 9632 #: classes/partials/_manage-queued-transcripts.inc:27 628 633 msgid "Submit a New Transcript:" 629 634 msgstr "" 630 635 631 #: classes/partials/_manage-queued-transcripts.inc:4 8636 #: classes/partials/_manage-queued-transcripts.inc:46 632 637 msgid "Submit For Approval" 633 638 msgstr "" … … 649 654 #: classes/partials/_capabilities.inc:27 650 655 msgid "Change capabilities" 656 msgstr "" 657 658 #: classes/partials/_capabilities.inc:33 659 msgid "Per-user Permissions" 660 msgstr "" 661 662 #: classes/partials/_capabilities.inc:35 663 msgid "" 664 "Give specified users permissions above and beyond their role permissions." 665 msgstr "" 666 667 #: classes/partials/_capabilities.inc:71 668 msgid "Update per-user permissions" 651 669 msgstr "" 652 670 … … 802 820 msgstr "" 803 821 804 #: classes/WhatDidTheySayAdmin.inc:34 1822 #: classes/WhatDidTheySayAdmin.inc:349 805 823 msgid "Manage Transcripts" 806 824 msgstr "" 807 825 808 #: classes/WhatDidTheySayAdmin.inc:551 826 #: classes/WhatDidTheySayAdmin.inc:393 827 msgid "Trans" 828 msgstr "" 829 830 #: classes/WhatDidTheySayAdmin.inc:406 831 #, php-format 832 msgid "%s queued" 833 msgstr "" 834 835 #: classes/WhatDidTheySayAdmin.inc:599 809 836 msgid "Transcript added to queue." 810 837 msgstr "" 811 838 812 #: classes/WhatDidTheySayAdmin.inc: 553839 #: classes/WhatDidTheySayAdmin.inc:601 813 840 msgid "Transcript not added to queue." 814 841 msgstr "" 815 842 816 #: classes/WhatDidTheySayAdmin.inc:6 29843 #: classes/WhatDidTheySayAdmin.inc:677 817 844 msgid "Transcripts updated." 818 845 msgstr "" 819 846 820 #: classes/WhatDidTheySayAdmin.inc: 698847 #: classes/WhatDidTheySayAdmin.inc:746 821 848 msgid "Default styles option updated." 822 849 msgstr "" 823 850 824 #: classes/WhatDidTheySayAdmin.inc:7 14851 #: classes/WhatDidTheySayAdmin.inc:762 825 852 msgid "Insertion level updated." 826 853 msgstr "" 827 854 828 #: classes/WhatDidTheySayAdmin.inc:7 32855 #: classes/WhatDidTheySayAdmin.inc:780 829 856 #, php-format 830 857 msgid "%s deleted." 831 858 msgstr "" 832 859 833 #: classes/WhatDidTheySayAdmin.inc:7 34860 #: classes/WhatDidTheySayAdmin.inc:782 834 861 msgid "Language not deleted!" 835 862 msgstr "" 836 863 837 #: classes/WhatDidTheySayAdmin.inc:7 41864 #: classes/WhatDidTheySayAdmin.inc:789 838 865 #, php-format 839 866 msgid "%s added." 840 867 msgstr "" 841 868 842 #: classes/WhatDidTheySayAdmin.inc:7 43869 #: classes/WhatDidTheySayAdmin.inc:791 843 870 msgid "Language not added!" 844 871 msgstr "" 845 872 846 #: classes/WhatDidTheySayAdmin.inc:7 49873 #: classes/WhatDidTheySayAdmin.inc:797 847 874 #, php-format 848 875 msgid "%s set as default." 849 876 msgstr "" 850 877 851 #: classes/WhatDidTheySayAdmin.inc:7 51878 #: classes/WhatDidTheySayAdmin.inc:799 852 879 msgid "Language not set as default!" 853 880 msgstr "" 854 881 855 #: classes/WhatDidTheySayAdmin.inc: 757882 #: classes/WhatDidTheySayAdmin.inc:805 856 883 #, php-format 857 884 msgid "%1$s renamed to %2$s." 858 885 msgstr "" 859 886 860 #: classes/WhatDidTheySayAdmin.inc: 759887 #: classes/WhatDidTheySayAdmin.inc:807 861 888 msgid "Language not renamed!" 862 889 msgstr "" 863 890 864 #: classes/WhatDidTheySayAdmin.inc: 782891 #: classes/WhatDidTheySayAdmin.inc:830 865 892 msgid "User capabilities updated." 866 893 msgstr "" 867 894 868 #: classes/WhatDidTheySayAdmin.inc:801 895 #: classes/WhatDidTheySayAdmin.inc:867 896 msgid "Per-user permissions updated." 897 msgstr "" 898 899 #: classes/WhatDidTheySayAdmin.inc:882 869 900 msgid "<strong>What Did They Say?!?</strong> options reset." 870 901 msgstr "" 871 902 872 #: classes/WhatDidTheySayAdmin.inc: 820903 #: classes/WhatDidTheySayAdmin.inc:901 873 904 msgid "<strong>What Did They Say?!?</strong> core options changed." 874 905 msgstr ""
Note: See TracChangeset
for help on using the changeset viewer.