Changeset 1664
- Timestamp:
- 08/26/08 22:49:30 (3 months ago)
- Files:
-
- trunk/bb-admin/admin-ajax.php (modified) (1 diff)
- trunk/bb-admin/admin-functions.php (modified) (2 diffs)
- trunk/bb-admin/content-forums.php (modified) (1 diff)
- trunk/bb-admin/js/content-forums.js (modified) (5 diffs)
- trunk/bb-admin/style.css (modified) (1 diff)
- trunk/bb-includes/js/wp-lists.js (modified) (1 diff)
- trunk/bb-includes/script-loader.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/bb-admin/admin-ajax.php
r1618 r1664 174 174 $forums_count = 2; // Hack 175 175 176 $data = bb_forum_row( $forum_id, false, true ); 177 178 $forum = get_forum( $forum_id ); 179 if ( $forum->forum_parent ) { 180 $siblings = get_forums( $forum->forum_parent ); 181 $last_sibling = array_pop( $siblings ); 182 if ( $last_sibling->forum_id == $forum_id ) 183 $last_sibling = array_pop( $siblings ); 184 if ( $last_sibling ) { 185 $position = "forum-$last_sibling->forum_id"; 186 } else { 187 $position = "+forum-$forum->forum_parent"; 188 $data = "<ul id='forum-root-$forum->forum_parent' class='list-block holder'>$data</ul>"; 189 } 190 } else { 191 $position = 1; 192 } 193 176 194 $x = new WP_Ajax_Response( array( 177 195 'what' => 'forum', 178 196 'id' => $forum_id, 179 'data' => bb_forum_row( $forum_id, false, true ) 197 'data' => $data, 198 'position' => $position 180 199 ) ); 181 200 $x->send(); trunk/bb-admin/admin-functions.php
r1649 r1664 683 683 $action = $forum_id ? 'update' : 'add'; 684 684 ?> 685 <form method="post" id="<?php echo $action; ?>-forum" action="<?php bb_uri('bb-admin/bb-forum.php', null, BB_URI_CONTEXT_FORM_ACTION + BB_URI_CONTEXT_BB_ADMIN); ?>" >685 <form method="post" id="<?php echo $action; ?>-forum" action="<?php bb_uri('bb-admin/bb-forum.php', null, BB_URI_CONTEXT_FORM_ACTION + BB_URI_CONTEXT_BB_ADMIN); ?>" class="add:forum-list:"> 686 686 <fieldset> 687 687 <table><col /><col style="width: 80%" /> … … 698 698 </tr> 699 699 <tr id="forum-parent-row"><th scope="row"><label for="forum_parent"><?php _e('Forum Parent:'); ?></label></th> 700 <td><?php bb_forum_dropdown( array('cut_branch' => $forum_id, 'id' => 'forum_parent', 'none' => true, 'selected' => $forum_id ? get_forum_parent( $forum_id ) : 0, 'disable_categories' => 0) ); ?></td> 700 <td><?php bb_forum_dropdown( array( 701 'cut_branch' => $forum_id, 702 'id' => 'forum_parent', 703 'none' => true, 704 'selected' => $forum_id ? get_forum_parent( $forum_id ) : 0, 705 'disable_categories' => 0 706 ) ); ?></td> 701 707 </tr> 702 708 <tr id="forum-position-row"><th scope="row"><label for="forum-order"><?php _e('Position:'); ?></label></th> trunk/bb-admin/content-forums.php
r1616 r1664 71 71 72 72 <?php if ( bb_forums( 'type=list&walker=BB_Walker_ForumAdminlistitems' ) ) : ?> 73 <ul id=" the-list" class="list-block holder widefat">73 <ul id="forum-list" class="list:forum list-block holder widefat"> 74 74 <li class="thead list-block"><div class="list-block"><?php _e('Name — Description'); ?></div></li> 75 75 <?php while ( bb_forum() ) : ?> trunk/bb-admin/js/content-forums.js
r1616 r1664 21 21 22 22 recolor: function() { 23 $('# the-list li:gt(0)').css( 'background-color', '' ).filter(':even').removeClass('alt').end().filter(':odd').addClass('alt');23 $('#forum-list li:gt(0)').css( 'background-color', '' ).filter(':even').removeClass('alt').end().filter(':odd').addClass('alt'); 24 24 }, 25 25 … … 44 44 serialize: function () { 45 45 h = ''; 46 $('# the-list, #the-list ul').each( function() {46 $('#forum-list, #forum-list ul').each( function() { 47 47 var i = this.id; 48 48 $('#' + i + '> .forum').each( function () { 49 49 if (h.length > 0) 50 50 h += '&'; 51 var root = ' the-list' == i ? 0 : i.split('-')[2];51 var root = 'forum-list' == i ? 0 : i.split('-')[2]; 52 52 h += 'root[' + root + '][]=' + this.id.split('-')[1]; 53 53 } ); … … 64 64 this.editText = div.childNodes[0].nodeValue; 65 65 div = null; 66 $('# the-list').after("<p class='submit'><input type='button' id='forum-order-edit' value='" + this.editText + "' /></p>");66 $('#forum-list').after("<p class='submit'><input type='button' id='forum-order-edit' value='" + this.editText + "' /></p>"); 67 67 68 $('#forum-parent-row, #forum-position-row').remove(); 69 70 $('#add-forum').submit( function() { 71 theList.alt = 'alt'; 72 theList.showLink = 0; 73 theList.addComplete = function() { 74 if ( bbSortForums.saveText == $('#forum-order-edit').val() ) { 75 var last = $('#the-list li:last').find('div.alignright').after(bbSortForums.handle).end()[0]; 76 $('#the-list').SortableAddItem(last); 77 } 78 } 79 theList.ajaxAdder( 'forum', 'add-forum' ); 80 return false; 81 } ); 68 $('#forum-position-row').remove(); 82 69 83 70 $('#forum-order-edit').toggle( function() { 84 71 $(this).val(bbSortForums.saveText); 85 $('# the-list li:gt(0) div.alignright').after(bbSortForums.handle);86 $('# the-list').Sortable( bbSortForums.sortCfg );72 $('#forum-list li:gt(0) div.alignright').after(bbSortForums.handle); 73 $('#forum-list').Sortable( bbSortForums.sortCfg ); 87 74 }, function() { 88 75 $(this).val(bbSortForums.editText); … … 90 77 91 78 var hash = bbSortForums.serialize(); 92 hash += '&' + $.SortSerialize(' the-list').hash.replace(/the-list/g, 'order').replace(/forum-/g, '')93 $('# the-list').SortableDestroy();79 hash += '&' + $.SortSerialize('forum-list').hash.replace(/forum-list/g, 'order').replace(/forum-/g, '') 80 $('#forum-list').SortableDestroy(); 94 81 95 82 $.post( … … 142 129 bbSortForums.init(); 143 130 131 $('#forum-list').wpList(); 132 144 133 } ); trunk/bb-admin/style.css
r1651 r1664 754 754 } 755 755 756 ul#the-list.list-block {756 ul#the-list.list-block, ul#forum-list.list-block { 757 757 padding: 0; 758 758 } trunk/bb-includes/js/wp-lists.js
r1511 r1664 270 270 s.pos = s.pos.substr(1); 271 271 ba = 'before'; 272 } else if ( '+' == s.pos.substr(0,1) ) { 273 s.pos = s.pos.substr(1); 274 ba = 'append'; 272 275 } 273 276 var ref = list.find( '#' + s.pos ); trunk/bb-includes/script-loader.php
r1616 r1664 15 15 'broken' => __('An unidentified error has occurred.') 16 16 ) ); 17 $scripts->add( 'wp-lists', $scripts->base_url . 'js/wp-lists.js', array('wp-ajax-response','jquery-color'), '20080 411' );17 $scripts->add( 'wp-lists', $scripts->base_url . 'js/wp-lists.js', array('wp-ajax-response','jquery-color'), '20080826' ); 18 18 $scripts->localize( 'wp-lists', 'wpListL10n', array( 19 19 'url' => $scripts->base_url_admin . 'admin-ajax.php' … … 32 32 )); 33 33 $scripts->add( 'profile-edit', $scripts->base_url . 'js/profile-edit.js', array('password-strength-meter'), '20080721' ); 34 $scripts->add( 'content-forums', $scripts->base_url_admin . 'js/content-forums.js', array(' listman', 'interface'), '20080801' );34 $scripts->add( 'content-forums', $scripts->base_url_admin . 'js/content-forums.js', array('wp-lists', 'interface'), '20080826' ); 35 35 $scripts->localize( 'content-forums', 'bbSortForumsL10n', array( 36 36 'handleText' => __('drag'),