| @@ -122,59 +122,8 @@ | ||
| 122 | 122 | } /* FeedWordPressAdminPage::ajax_interface_js () */ |
| 123 | 123 | |
| 124 | 124 | function display_feed_select_dropdown() { |
| 125 | 125 | $links = FeedWordPress::syndicated_links(); |
| 126 | - if (fwp_test_wp_version(FWP_SCHEMA_27)) : | |
| 127 | - ?> | |
| 128 | - <style type="text/css"> | |
| 129 | - #post-search { | |
| 130 | - float: right; | |
| 131 | - margin:11px 12px 0; | |
| 132 | - min-width: 130px; | |
| 133 | - position:relative; | |
| 134 | - } | |
| 135 | - .fwpfs { | |
| 136 | - color: #dddddd !important; background-color: #333 !important; | |
| 137 | - background:#797979 url(<?php bloginfo('home') ?>/wp-admin/images/fav.png) repeat-x scroll left center; | |
| 138 | - border-color:#777777 #777777 #666666 !important; -moz-border-radius-bottomleft:12px; | |
| 139 | - -moz-border-radius-bottomright:12px; | |
| 140 | - -moz-border-radius-topleft:12px; | |
| 141 | - -moz-border-radius-topright:12px; | |
| 142 | - border-style:solid; | |
| 143 | - border-width:1px; | |
| 144 | - line-height:15px; | |
| 145 | - padding:3px 30px 4px 12px; | |
| 146 | - } | |
| 147 | - .fwpfs.slide-down { | |
| 148 | - border-bottom-color: #626262; | |
| 149 | - -moz-border-radius-bottomleft:0; | |
| 150 | - -moz-border-radius-bottomright:0; | |
| 151 | - -moz-border-radius-topleft:12px; | |
| 152 | - -moz-border-radius-topright:12px; | |
| 153 | - background-image:url(<?php bloginfo('home') ?>/wp-admin/images/fav-top.png); | |
| 154 | - background-position:0 top; | |
| 155 | - background-repeat:repeat-x; | |
| 156 | - border-bottom-style:solid; | |
| 157 | - border-bottom-width:1px; | |
| 158 | - } | |
| 159 | - </style> | |
| 160 | - | |
| 161 | - <script type="text/javascript"> | |
| 162 | - jQuery(document).ready(function($){ | |
| 163 | - $('.fwpfs').toggle( | |
| 164 | - function(){$('.fwpfs').removeClass('slideUp').addClass('slideDown'); setTimeout(function(){if ( $('.fwpfs').hasClass('slideDown') ) { $('.fwpfs').addClass('slide-down'); }}, 10) }, | |
| 165 | - function(){$('.fwpfs').removeClass('slideDown').addClass('slideUp'); setTimeout(function(){if ( $('.fwpfs').hasClass('slideUp') ) { $('.fwpfs').removeClass('slide-down'); }}, 10) } | |
| 166 | - ); | |
| 167 | - $('.fwpfs').bind( | |
| 168 | - 'change', | |
| 169 | - function () { this.form.submit(); } | |
| 170 | - ); | |
| 171 | - $('#post-search .button').css( 'display', 'none' ); | |
| 172 | - }); | |
| 173 | - </script> | |
| 174 | - <?php | |
| 175 | - endif; | |
| 176 | - | |
| 177 | 126 | ?> |
| 178 | 127 | <p id="post-search"> |
| 179 | 128 | <select name="link_id" class="fwpfs" style="max-width: 20.0em;"> |
| 180 | 129 | <option value="*"<?php if ($this->for_default_settings()) : ?> selected="selected"<?php endif; ?>>- defaults for all feeds -</option> |
| @@ -445,62 +394,68 @@ | ||
| 445 | 394 | <?php |
| 446 | 395 | endif; |
| 447 | 396 | } |
| 448 | 397 | |
| 449 | -function fwp_category_box ($checked, $object, $tags = array()) { | |
| 398 | +function fwp_category_box ($checked, $object, $tags = array(), $prefix = '') { | |
| 450 | 399 | global $wp_db_version; |
| 451 | 400 | |
| 452 | - if (fwp_test_wp_version(FWP_SCHEMA_25)) : // WordPress 2.5.x | |
| 401 | + if (strlen($prefix) > 0) : | |
| 402 | + $idPrefix = $prefix.'-'; | |
| 403 | + $idSuffix = "-".$prefix; | |
| 404 | + $namePrefix = $prefix . '_'; | |
| 405 | + else : | |
| 406 | + $idPrefix = 'feedwordpress-'; | |
| 407 | + $idSuffix = "-feedwordpress"; | |
| 408 | + $namePrefix = 'feedwordpress_'; | |
| 409 | + endif; | |
| 410 | + | |
| 453 | 411 | ?> |
| 454 | -<div id="category-adder" class="wp-hidden-children"> | |
| 455 | - <h4><a id="category-add-toggle" href="#category-add" class="hide-if-no-js" tabindex="3"><?php _e( '+ Add New Category' ); ?></a></h4> | |
| 456 | - <p id="category-add" class="wp-hidden-child"> | |
| 457 | - <input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php _e( 'New category name' ); ?>" tabindex="3" /> | |
| 458 | - <?php wp_dropdown_categories( array( 'hide_empty' => 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category'), 'tab_index' => 3 ) ); ?> | |
| 459 | - <input type="button" id="category-add-sumbit" class="add:categorychecklist:category-add button" value="<?php _e( 'Add' ); ?>" tabindex="3" /> | |
| 460 | - <?php wp_nonce_field( 'add-category', '_ajax_nonce', false ); ?> | |
| 461 | - <span id="category-ajax-response"></span> | |
| 412 | +<div id="<?php print $idPrefix; ?>taxonomy-category" class="feedwordpress-category-div"> | |
| 413 | + <ul id="<?php print $idPrefix; ?>category-tabs" class="category-tabs"> | |
| 414 | + <li class="ui-tabs-selected tabs"><a href="#<?php print $idPrefix; ?>categories-all" tabindex="3"><?php _e( 'All posts' ); ?></a> | |
| 415 | + <p style="font-size:smaller;font-style:bold;margin:0">Give <?php print $object; ?> these categories</p> | |
| 416 | + </li> | |
| 417 | + </ul> | |
| 418 | + | |
| 419 | +<div id="<?php print $idPrefix; ?>categories-all" class="tabs-panel"> | |
| 420 | + <ul id="<?php print $idPrefix; ?>categorychecklist" class="list:category categorychecklist form-no-clear"> | |
| 421 | + <?php fwp_category_checklist(NULL, false, $checked, $prefix) ?> | |
| 422 | + </ul> | |
| 423 | +</div> | |
| 424 | + | |
| 425 | +<div id="<?php print $idPrefix; ?>category-adder" class="category-adder wp-hidden-children"> | |
| 426 | + <h4><a id="<?php print $idPrefix; ?>category-add-toggle" class="category-add-toggle" href="#<?php print $idPrefix; ?>category-add" class="hide-if-no-js" tabindex="3"><?php _e( '+ Add New Category' ); ?></a></h4> | |
| 427 | + <p id="<?php print $idPrefix; ?>category-add" class="wp-hidden-child"> | |
| 428 | + <?php | |
| 429 | + if (FeedWordPressCompatibility::test_version(FWP_SCHEMA_30)) : | |
| 430 | + $newcat = 'newcategory'; // Well, thank God they added "egory" before WP 3.0 came out. | |
| 431 | + else : | |
| 432 | + $newcat = 'newcat'; | |
| 433 | + endif; | |
| 434 | + ?> | |
| 435 | + | |
| 436 | + <input type="text" name="<?php print $newcat; ?>" id="<?php print $idPrefix; ?>newcategory" class="newcategory form-required form-input-tip" value="<?php _e( 'New category name' ); ?>" tabindex="3" /> | |
| 437 | + <label class="screen-reader-text" for="<?php print $idPrefix; ?>newcategory-parent"><?php _e('Parent Category:'); ?></label> | |
| 438 | + <?php wp_dropdown_categories( array( | |
| 439 | + 'hide_empty' => 0, | |
| 440 | + 'id' => $idPrefix.'newcategory-parent', | |
| 441 | + 'class' => 'newcategory-parent', | |
| 442 | + 'name' => $newcat.'_parent', | |
| 443 | + 'orderby' => 'name', | |
| 444 | + 'hierarchical' => 1, | |
| 445 | + 'show_option_none' => __('Parent category'), | |
| 446 | + 'tab_index' => 3, | |
| 447 | + ) ); ?> | |
| 448 | + <input type="button" id="<?php print $idPrefix; ?>category-add-sumbit" class="add:<?php print $idPrefix; ?>categorychecklist:category-add add-categorychecklist-category-add button" value="<?php _e( 'Add' ); ?>" tabindex="3" /> | |
| 449 | + <?php /* wp_nonce_field currently doesn't let us set an id different from name, but we need a non-unique name and a unique id */ ?> | |
| 450 | + <input type="hidden" id="_ajax_nonce<?php print esc_html($idSuffix); ?>" name="_ajax_nonce" value="<?php print wp_create_nonce('add-category'); ?>" /> | |
| 451 | + <input type="hidden" id="_ajax_nonce-add-category<?php print esc_html($idSuffix); ?>" name="_ajax_nonce-add-category" value="<?php print wp_create_nonce('add-category'); ?>" /> | |
| 452 | + <span id="<?php print $idPrefix; ?>category-ajax-response" class="category-ajax-response"></span> | |
| 462 | 453 | </p> |
| 463 | 454 | </div> |
| 464 | 455 | |
| 465 | -<ul id="category-tabs"> | |
| 466 | - <?php /* ui-tabs-selected in WP 2.7 CSS = tabs in WP 2.8 CSS. Thank you, o brilliant wordsmiths of the WordPress 2.8 stylesheet... */ ?> | |
| 467 | - <li class="ui-tabs-selected tabs"><a href="#categories-all" tabindex="3"><?php _e( 'All posts' ); ?></a> | |
| 468 | - <p style="font-size:smaller;font-style:bold;margin:0">Give <?php print $object; ?> these categories</p> | |
| 469 | -</li> | |
| 470 | -</ul> | |
| 471 | - | |
| 472 | -<?php /* ui-tabs-panel in WP 2.7 CSS = tabs-panel in WP 2.8 CSS. Thank you, o brilliant wordsmiths of the WordPress 2.8 stylesheet... */ ?> | |
| 473 | -<div id="categories-all" class="ui-tabs-panel tabs-panel"> | |
| 474 | - <ul id="categorychecklist" class="list:category categorychecklist form-no-clear"> | |
| 475 | - <?php fwp_category_checklist(NULL, false, $checked) ?> | |
| 476 | - </ul> | |
| 477 | 456 | </div> |
| 478 | 457 | <?php |
| 479 | - elseif (fwp_test_wp_version(FWP_SCHEMA_20)) : // WordPress 2.x | |
| 480 | -?> | |
| 481 | - <div id="moremeta" style="position: relative; right: auto"> | |
| 482 | - <div id="grabit" class="dbx-group"> | |
| 483 | - <fieldset id="categorydiv" class="dbx-box"> | |
| 484 | - <h3 class="dbx-handle"><?php _e('Categories') ?></h3> | |
| 485 | - <div class="dbx-content"> | |
| 486 | - <p style="font-size:smaller;font-style:bold;margin:0">Place <?php print $object; ?> under...</p> | |
| 487 | - <p id="jaxcat"></p> | |
| 488 | - <div id="categorychecklist"><?php fwp_category_checklist(NULL, false, $checked); ?></div> | |
| 489 | - </div> | |
| 490 | - </fieldset> | |
| 491 | - </div> | |
| 492 | - </div> | |
| 493 | -<?php | |
| 494 | - else : // WordPress 1.5 | |
| 495 | -?> | |
| 496 | - <fieldset style="width: 60%;"> | |
| 497 | - <legend><?php _e('Categories') ?></legend> | |
| 498 | - <p style="font-size:smaller;font-style:bold;margin:0">Place <?php print $object; ?> under...</p> | |
| 499 | - <div style="height: 10em; overflow: scroll;"><?php fwp_category_checklist(NULL, false, $checked); ?></div> | |
| 500 | - </fieldset> | |
| 501 | -<?php | |
| 502 | - endif; | |
| 503 | 458 | } |
| 504 | 459 | |
| 505 | 460 | function update_feeds_mention ($feed) { |
| 506 | 461 | echo "<li>Updating <cite>".$feed['link/name']."</cite> from <<a href=\"" |