Commit c05fff99 authored by root's avatar root Committed by lechuck
Browse files

Import feedwordpress 2011.0211.2

parent eb9832d2
......@@ -61,7 +61,8 @@ class FeedWordPressAdminPage {
print '<div class="updated">';
print "<ul>";
$delta = $feedwordpress->update($this->link->uri());
$uri = $this->link->uri();
$delta = $feedwordpress->update($uri);
print "</ul>";
if (!is_null($delta)) :
......@@ -71,6 +72,7 @@ class FeedWordPressAdminPage {
echo "<p><strong>Update complete.</strong>".implode(' and', $mesg)."</p>";
echo "\n"; flush();
else :
$uri = esc_html($uri);
echo "<p><strong>Error:</strong> There was a problem updating <a href=\"$uri\">$uri</a></p>\n";
endif;
print "</div>\n";
......@@ -98,7 +100,15 @@ class FeedWordPressAdminPage {
function for_feed_settings () { return (is_object($this->link) and method_exists($this->link, 'found') and $this->link->found()); }
function for_default_settings () { return !$this->for_feed_settings(); }
function setting ($names, $fallback_value = NULL, $default = 'default') {
function setting ($names, $fallback_value = NULL, $params = array()) {
if (!is_array($params)) :
$params = array('default' => $params);
endif;
$params = shortcode_atts(array(
'default' => 'default',
'fallback' => true,
), $params);
if (is_string($names)) :
$feed_name = $names;
$global_name = 'feedwordpress_'.preg_replace('![\s/]+!', '_', $names);
......@@ -108,7 +118,8 @@ class FeedWordPressAdminPage {
endif;
if ($this->for_feed_settings()) : // Check feed-specific setting first; fall back to global
$ret = $this->link->setting($feed_name, $global_name, $fallback_value);
if (!$params['fallback']) : $global_name = NULL; endif;
$ret = $this->link->setting($feed_name, $global_name, $fallback_value, $params['default']);
else : // Check global setting
$ret = get_option($global_name, $fallback_value);
endif;
......@@ -553,6 +564,7 @@ class FeedWordPressAdminPage {
// This allows us to provide an alternative set of human-readable
// labels for each potential value. For use in Currently: line.
if (isset($params['labels'])) : $labels = $params['labels'];
elseif (is_callable($options)) : $labels = NULL;
else : $labels = $options;
endif;
......@@ -632,6 +644,8 @@ class FeedWordPressAdminPage {
<span class="current-setting">Currently:
<strong><?php if (is_callable($labels)) :
print call_user_func($labels, $globalSetting, $defaulted, $params);
elseif (is_null($labels)) :
print $globalSetting;
else :
print $labels[$globalSetting];
endif; ?></strong> (<a href="<?php print $href; ?>">change</a>)</span></li>
......@@ -736,6 +750,11 @@ function fwp_tags_box ($tags, $object, $params = array()) {
$tax_name = (isset($params['taxonomy']) ? $params['taxonomy'] : 'post_tag');
$desc = "<p style=\"font-size:smaller;font-style:bold;margin:0\">Tag $object as...</p>";
if (isset($params['textarea_name'])) :
$textAreaName = $params['textarea_name'];
else :
$textAreaName = "tax_input[$tax_name]";
endif;
print $desc;
$helps = __('Separate tags with commas.');
$box['title'] = __('Tags');
......@@ -744,7 +763,7 @@ function fwp_tags_box ($tags, $object, $params = array()) {
<div class="jaxtag">
<div class="nojs-tags hide-if-js">
<p><?php _e('Add or remove tags'); ?></p>
<textarea name="<?php echo "tax_input[$tax_name]"; ?>" class="the-tags" id="tax-input[<?php echo $tax_name; ?>]"><?php echo esc_attr(implode(",", $tags)); ?></textarea></div>
<textarea name="<?php echo esc_html($textAreaName); ?>" class="the-tags" id="tax-input[<?php echo $tax_name; ?>]"><?php echo esc_attr(implode(",", $tags)); ?></textarea></div>
<div class="ajaxtag hide-if-no-js">
<label class="screen-reader-text" for="new-tag-<?php echo $tax_name; ?>"><?php echo $box['title']; ?></label>
......@@ -865,7 +884,7 @@ function fwp_author_list () {
global $wpdb;
$ret = array();
$users = $wpdb->get_results("SELECT * FROM $wpdb->users ORDER BY display_name");
$users = get_users_of_blog();
if (is_array($users)) :
foreach ($users as $user) :
$id = (int) $user->ID;
......@@ -908,6 +927,14 @@ class FeedWordPressSettingsUI {
function admin_styles () {
?>
<style type="text/css">
#feedwordpress-admin-feeds .link-rss-params-remove .x, .feedwordpress-admin .remove-it .x {
background: url(<?php print admin_url('images/xit.gif') ?>) no-repeat scroll 0 0 transparent;
}
#feedwordpress-admin-feeds .link-rss-params-remove:hover .x, .feedwordpress-admin .remove-it:hover .x {
background: url(<?php print admin_url('images/xit.gif') ?>) no-repeat scroll -10px 0 transparent;
}
.fwpfs {
background-image: url(<?php print admin_url('images/fav.png'); ?>);
background-repeat: repeat-x;
......@@ -950,10 +977,13 @@ class FeedWordPressSettingsUI {
} /* FeedWordPressSettingsUI::fix_toggles_js () */
function magic_input_tip_js ($id) {
if (!preg_match('/^[.#]/', $id)) :
$id = '#'.$id;
endif;
?>
<script type="text/javascript">
jQuery(document).ready( function () {
var inputBox = jQuery("#<?php print $id; ?>");
var inputBox = jQuery("<?php print $id; ?>");
var boxEl = inputBox.get(0);
if (boxEl.value==boxEl.defaultValue) { inputBox.addClass('form-input-tip'); }
inputBox.focus(function() {
......
......@@ -457,17 +457,15 @@ blank.</p></td>
<td class="secondary">
<h4>Site-wide <?php print $taxonomy->labels->name; ?></h4>
<?php if (count($globalCats) > 0) : ?>
<ul class="current-setting">
<?php
foreach ($globalDogs as $dog) :
?>
<li><?php $cat = get_term($dog, $tax); print $cat->name; ?></li>
<?php endforeach; ?>
</ul>
</div>
<p>
<ul class="current-setting">
<?php foreach ($globalDogs as $dog) : ?>
<li><?php $cat = get_term($dog, $tax); print $cat->name; ?></li>
<?php endforeach; ?>
</ul>
</div>
<p>
<?php else : ?>
<p>Site-wide settings may also assign categories to syndicated
<p>Site-wide settings may also assign categories to syndicated
posts.
<?php endif; ?>
Should <?php print $page->these_posts_phrase(); ?> be assigned
......@@ -476,7 +474,7 @@ blank.</p></td>
<ul class="settings">
<li><p><label><input type="radio" name="add_global[<?php print $tax; ?>]" value="yes" <?php print $checked['yes']; ?> /> Yes. Place <?php print $page->these_posts_phrase(); ?> under all these categories.</label></p></li>
<li><p><label><input type="radio" name="add_global[<?php print $tax; ?>]" value="no" <?php print $checked['no']; ?> /> No. Only use the categories I set up on the left. Do not ise the global defaults for <?php print $page->these_posts_phrase(); ?></label></p></li>
<li><p><label><input type="radio" name="add_global[<?php print $tax; ?>]" value="no" <?php print $checked['no']; ?> /> No. Only use the categories I set up on the left. Do not use the global defaults for <?php print $page->these_posts_phrase(); ?></label></p></li>
</ul>
</td>
</tr>
......
......@@ -4,7 +4,17 @@
################################################################################
class FeedWordPressCompatibility {
// version testing based on database schema version
/**
* FeedWordPressCompatibility::test_version: test version of WordPress
* based on the database schema version.
*
* @param int $floor The minimum version necessary
* @param mixed $ceiling The first version that is too high. If omitted
* or NULL, no version is too high.
* @return bool TRUE if within the range of versions, FALSE if too low
* or too high.
*/
/*static*/ function test_version ($floor, $ceiling = null) {
global $wp_db_version;
......@@ -19,12 +29,23 @@ class FeedWordPressCompatibility {
/*static*/ function insert_link_category ($name) {
global $wpdb;
$name = $wpdb->escape($name);
// WordPress 2.3+ term/taxonomy API
$term = wp_insert_term($name, 'link_category');
$cat_id = $term['term_id'];
// OK: returned array('term_id' => $term_id, 'term_taxonomy_id' => $tt_id)
if (!is_wp_error($term)) :
$cat_id = $term['term_id'];
// Error: term with this name already exists. Well, let's use that then.
elseif ($term->get_error_code() == 'term_exists') :
// Already-existing term ID is returned in data field
$cat_id = $term->get_error_data('term_exists');
// Error: another kind of error, harder to recover from. Return WP_Error.
else :
$cat_id = $term;
endif;
// Return newly-created category ID
return $cat_id;
} /* FeedWordPressCompatibility::insert_link_category () */
......@@ -122,6 +143,38 @@ if (!function_exists('disabled')) {
}
} /* if */
// Compat
if (!function_exists('set_post_field')) {
/**
* Update data from a post field based on Post ID
*
* Examples of the post field will be, 'post_type', 'post_status', 'post_content', etc.
*
* The context values are based off of the taxonomy filter functions and
* supported values are found within those functions.
*
* @uses sanitize_post_field()
*
* @param string $field Post field name
* @param mixed $value New value for post field
* @param id $post Post ID
* @return bool Result of UPDATE query
*
* Included under terms of GPL from WordPress Ticket #10946 <http://core.trac.wordpress.org/attachment/ticket/10946/post.php.diff>
*/
function set_post_field ($field, $value, $post_id) {
global $wpdb;
$post_id = absint($post_id);
// sigh ... when FWP is active, I need to avoid avoid_kses_munge
// $value = sanitize_post_field($field, $value, $post_id, 'db');
return $wpdb->update($wpdb->posts, array($field => $value), array('ID' => $post_id));
} /* function set_post_field () */
} /* if */
if (!function_exists('term_exists')) {
// Fucking WordPress 3.0 wordsmithing.
function term_exists ( $term, $taxonomy = '', $parent = 0 ) {
......@@ -140,7 +193,7 @@ function fwp_category_checklist ($post_id = 0, $descendents_and_self = 0, $selec
$taxonomy = (isset($params['taxonomy']) ? $params['taxonomy'] : 'category');
endif;
$walker = new FeedWordPress_Walker_Category_Checklist;
$walker = new FeedWordPress_Walker_Category_Checklist($params);
$walker->set_prefix($prefix);
$walker->set_taxonomy($taxonomy);
wp_terms_checklist(/*post_id=*/ $post_id, array(
......
......@@ -39,7 +39,8 @@ class FeedWordPressDiagnosticsPage extends FeedWordPressAdminPage {
<div id="post-body">
<?php
$boxes_by_methods = array(
'diagnostics_box' => __('Diagnostics'),
'info_box' => __('Diagnostic Information'),
'diagnostics_box' => __('Display Diagnostics'),
'updates_box' => __('Updates'),
);
......@@ -104,7 +105,53 @@ class FeedWordPressDiagnosticsPage extends FeedWordPressAdminPage {
endif;
} /* FeedWordPressDiagnosticsPage::accept_POST () */
/*static*/ function diagnostics_box ($page, $box = NULL) {
function info_box ($page, $box = NULL) {
$link_category_id = FeedWordPress::link_category_id();
?>
<table class="edit-form narrow">
<thead style="display: none">
<th scope="col">Topic</th>
<th scope="col">Information</th>
</thead>
<tbody>
<tr>
<th scope="row">Version:</th>
<td>You are using FeedWordPress version <strong><?php print FEEDWORDPRESS_VERSION; ?></strong>.</td>
</tr>
<tr>
<th scope="row">Link Category:</th>
<td><?php if (!is_wp_error($link_category_id)) :
$term = get_term($link_category_id, 'link_category');
?><p>Syndicated feeds are
kept in link category #<?php print $term->term_id; ?>, <strong><?php print $term->name; ?></strong>.</p>
<?php else : ?>
<p><strong>FeedWordPress has been unable to set up a valid Link Category
for syndicated feeds.</strong> Attempting to set one up returned an
<code><?php $link_category_id->get_error_code(); ?></code> error with this
additional data:</p>
<table>
<tbody>
<tr>
<th scope="row">Message:</th>
<td><?php print $link_category_id->get_error_message(); ?></td>
</tr>
<?php $data = $link_category_id->get_error_data(); if (!empty($data)) : ?>
<tr>
<th scope="row">Auxiliary Data:</th>
<td><pre><?php print esc_html(FeedWordPress::val($link_category_id->get_error_data())); ?></pre></td>
</tr>
<?php endif; ?>
</table>
<?php endif; ?></td>
</tr>
</table>
<?php
} /* FeedWordPressDiagnosticsPage::info_box () */
function diagnostics_box ($page, $box = NULL) {
$settings = array();
$settings['debug'] = (get_option('feedwordpress_debug')=='yes');
......@@ -178,43 +225,50 @@ testing but absolutely inappropriate for a production server.</p>
} /* FeedWordPressDiagnosticsPage::diagnostics_box () */
/*static*/ function updates_box ($page, $box = NULL) {
$checked = array(
'updated_feeds' => '', 'updated_feeds:errors' => '',
'updated_feeds:errors:persistent' => '',
"syndicated_posts" => '', 'syndicated_posts:meta_data' => '',
'feed_items' => '',
'memory_usage' => '',
);
$hours = get_option('feedwordpress_diagnostics_persistent_errors_hours', 2);
$fields = apply_filters('feedwordpress_diagnostics', array(
'Update Diagnostics' => array(
'updated_feeds' => 'as each feed checked for updates',
'updated_feeds:errors:persistent' => 'when attempts to update a feed have resulted in errors</label> <label>for at least <input type="number" min="1" max="360" step="1" name="diagnostics_persistent_error_hours" value="'.$hours.'" /> hours',
'updated_feeds:errors' => 'any time FeedWordPress encounters any errors while checking a feed for updates',
'syndicated_posts' => 'as each syndicated post is added to the database',
'feed_items' => 'as each syndicated item is considered on the feed',
'memory_usage' => 'indicating how much memory was used',
),
'Syndicated Post Details' => array(
'syndicated_posts:meta_data' => 'as syndication meta-data is added on the post',
),
), $page);
foreach ($fields as $section => $items) :
foreach ($items as $key => $label) :
$checked[$key] = '';
endforeach;
endforeach;
$diagnostics_show = get_option('feedwordpress_diagnostics_show', array());
if (is_array($diagnostics_show)) : foreach ($diagnostics_show as $thingy) :
$checked[$thingy] = ' checked="checked"';
endforeach; endif;
$hours = get_option('feedwordpress_diagnostics_persistent_errors_hours', 2);
// Hey ho, let's go...
?>
<table class="edit-form">
<tr>
<th scope="row">Update diagnostics:</th>
<td><p>Show a diagnostic message...</p>
<ul class="options">
<li><label><input type="checkbox" name="diagnostics_show[]" value="updated_feeds" <?php print $checked['updated_feeds']; ?> /> as each feed checked for updates</label></li>
<li><label><input type="checkbox" name="diagnostics_show[]" value="updated_feeds:errors:persistent" <?php print $checked['updated_feeds:errors:persistent'] ?> /> when attempts to update a feed have resulted in errors</label> <label>for at least <input type="number" min="1" max="360" step="1" name="diagnostics_persistent_error_hours" value="<?php print $hours; ?>" /> hours</label></li>
<li><label><input type="checkbox" name="diagnostics_show[]" value="updated_feeds:errors" <?php print $checked['updated_feeds:errors']; ?> /> any time FeedWordPress encounters any errors while checking a feed for updates</label></li>
<li><label><input type="checkbox" name="diagnostics_show[]" value="syndicated_posts" <?php print $checked['syndicated_posts']; ?> /> as each syndicated post is added to the database</label></li>
<li><label><input type="checkbox" name="diagnostics_show[]" value="feed_items" <?php print $checked['feed_items']; ?> /> as each syndicated item is considered on the feed</label></li>
<li><label><input type="checkbox" name="diagnostics_show[]" value="memory_usage" <?php print $checked['memory_usage']; ?> /> indicating how much memory was used</label></li>
</ul></td>
</tr>
<tr>
<th>Syndicated post details:</th>
<td><p>Show a diagnostic message...</p>
<ul class="options">
<li><label><input type="checkbox" name="diagnostics_show[]" value="syndicated_posts:meta_data" <?php print $checked['syndicated_posts:meta_data']; ?> /> as syndication meta-data is added on the post</label></li>
</ul></td>
</tr>
<?php foreach ($fields as $section => $ul) : ?>
<tr>
<th scope="row"><?php print esc_html($section); ?>:</th>
<td><p>Show a diagnostic message...</p>
<ul class="options">
<?php foreach ($ul as $key => $label) : ?>
<li><label><input
type="checkbox" name="diagnostics_show[]"
value="<?php print esc_html($key); ?>"
<?php print $checked[$key]; ?> />
<?php print $label; ?></label></li>
<?php endforeach; ?>
</ul></td>
</tr>
<?php endforeach; ?>
</table>
<?php
} /* FeedWordPressDiagnosticsPage::updates_box () */
......
......@@ -165,7 +165,7 @@ class FeedFinder {
// Use WordPress API function
$client = wp_remote_request($this->uri, array(
'headers' => $headers,
'timeout' => FEEDWORDPRESS_FETCH_TIME_OUT,
'timeout' => FeedWordPress::fetch_timeout(),
));
$this->_response = $client;
......
......@@ -47,31 +47,10 @@ class FeedWordPressFeedsPage extends FeedWordPressAdminPage {
);
var $updatedPosts = NULL;
/**
* Constructs the Feeds page object
*
* @param mixed $link An object of class {@link SyndicatedLink} if created for one feed's settings, NULL if created for global default settings
*/
function FeedWordPressFeedsPage ($link = -1) {
if (is_numeric($link) and -1 == $link) :
$link = FeedWordPressAdminPage::submitted_link();
endif;
FeedWordPressAdminPage::FeedWordPressAdminPage('feedwordpressfeeds', $link);
$this->dispatch = 'feedwordpress_admin_page_feeds';
$this->pagenames = array(
'default' => 'Feeds',
'settings-update' => 'Syndicated feed',
'open-sheet' => 'Feed and Update',
);
$this->filename = __FILE__;
$this->updatedPosts = new UpdatedPostsControl($this);
} /* FeedWordPressFeedsPage constructor */
var $special_settings = array ( /* Regular expression syntax is OK here */
'cats',
'cat_split',
'fetch timeout',
'freeze updates',
'hardcode name',
'hardcode url',
......@@ -84,6 +63,7 @@ class FeedWordPressFeedsPage extends FeedWordPressAdminPage {
'ping status',
'post status',
'postmeta',
'query parameters',
'resolve relative',
'syndicated post type',
'tags',
......@@ -91,12 +71,37 @@ class FeedWordPressFeedsPage extends FeedWordPressAdminPage {
'unfamliar categories', /* Deprecated */
'unfamiliar category',
'unfamiliar post_tag',
'add/.*',
'update/.*',
'feed/.*',
'link/.*',
'match/.*',
);
/**
* Constructs the Feeds page object
*
* @param mixed $link An object of class {@link SyndicatedLink} if created for one feed's settings, NULL if created for global default settings
*/
function FeedWordPressFeedsPage ($link = -1) {
if (is_numeric($link) and -1 == $link) :
$link = FeedWordPressAdminPage::submitted_link();
endif;
FeedWordPressAdminPage::FeedWordPressAdminPage('feedwordpressfeeds', $link);
$this->dispatch = 'feedwordpress_admin_page_feeds';
$this->pagenames = array(
'default' => 'Feeds',
'settings-update' => 'Syndicated feed',
'open-sheet' => 'Feed and Update',
);
$this->filename = __FILE__;
$this->updatedPosts = new UpdatedPostsControl($this);
$this->special_settings = apply_filters('syndicated_feed_special_settings', $this->special_settings, $this);
} /* FeedWordPressFeedsPage constructor */
function display () {
global $fwp_post;
global $post_source;
......@@ -106,6 +111,7 @@ class FeedWordPressFeedsPage extends FeedWordPressAdminPage {
'global_feeds_box' => __('Update Scheduling'),
'updated_posts_box' => __('Updated Posts'),
'custom_settings_box' => __('Custom Feed Settings (for use in templates)'),
'fetch_settings_box' => __('Settings for Fetching Feeds (Advanced)'),
);
if ($this->for_default_settings()) :
unset($this->boxes_by_methods['custom_settings_box']);
......@@ -298,8 +304,47 @@ class FeedWordPressFeedsPage extends FeedWordPressAdminPage {
return sprintf(__($caption), $updateWindow);
} /* FeedWordPressFeedsPage::update_window_currently () */
function fetch_timeout_setting ($setting, $defaulted, $params) {
$timeout = intval($this->setting('fetch timeout', FEEDWORDPRESS_FETCH_TIMEOUT_DEFAULT));
if ($this->for_feed_settings()) :
$article = 'this';
else :
$article = 'a';
endif;
?>
<p>Wait no more than
than <input name="fetch_timeout" type="number" min="0" size="3" value="<?php print $timeout; ?>" />
second(s) when trying to fetch <?php print $article; ?> feed to check for updates.</p>
<p>If <?php print $article; ?> source's web server does not respond before time runs
out, FeedWordPress will skip over the source and try again during
the next update cycle.</p>
<?php
}
function fetch_timeout_setting_value ($setting, $defaulted, $params) {
print number_format(intval($setting)) . " " . (($setting==1) ? "second" : "seconds");
}
function fetch_settings_box ($page, $box = NULL) {
$this->setting_radio_control(
'fetch timeout', 'fetch_timeout',
array(&$this, 'fetch_timeout_setting'),
array(
'global-setting-default' => FEEDWORDPRESS_FETCH_TIMEOUT_DEFAULT,
'input-name' => 'fetch_timeout',
'default-input-name' => 'fetch_timeout_default',
'labels' => array(&$this, 'fetch_timeout_setting_value'),
)
);
} /* FeedWordPressFeedsPage::fetch_settings_box () */
function feed_information_box ($page, $box = NULL) {
global $wpdb;
$link_rss_params = maybe_unserialize($page->setting('query parameters', ''));
if (!is_array($link_rss_params)) :
$link_rss_params = array();
endif;
if ($page->for_feed_settings()) :
$info['name'] = esc_html($page->link->link->link_name);
$info['description'] = esc_html($page->link->link->link_description);
......@@ -353,7 +398,69 @@ class FeedWordPressFeedsPage extends FeedWordPressAdminPage {
<td><a href="<?php echo esc_html($rss_url); ?>"><?php echo esc_html($rss_url); ?></a>
(<a href="<?php echo FEEDVALIDATOR_URI; ?>?url=<?php echo urlencode($rss_url); ?>"
title="Check feed &lt;<?php echo esc_html($rss_url); ?>&gt; for validity">validate</a>)
<input type="submit" name="feedfinder" value="switch &rarr;" style="font-size:smaller" /></td>
<input type="submit" name="feedfinder" value="switch &rarr;" style="font-size:smaller" />
<table id="link-rss-params">
<tbody>
<?php
$link_rss_params['new'] = array('', '');
$i = 0;
foreach ($link_rss_params as $index => $pair) :
?>
<tr class="link-rss-params-row" id="link-rss-params-<?php print $index; ?>">
<td><label>Parameter: <input type="text" class="link_params_key"
name="link_rss_params_key[<?php print $index; ?>]" value="<?php print esc_html($pair[0]); ?>"
size="5" style="width: 5em" placeholder="name" /></label></td>
<td class="link-rss-params-value-cell"><label class="link_params_value_label">= <input type="text" class="link_params_value"
name="link_rss_params_value[<?php print $index; ?>]" value="<?php print esc_html($pair[1]); ?>"
size="8" placeholder="value" /></label></td>
</tr>
<?php
$i++;
endforeach;
?>
</tbody>
</table>
<div><input type="hidden" id="link-rss-params-num" name="link_rss_params_num" value="<?php print $i; ?>" /></div>
<script type="text/javascript">
function linkParamsRowRemove (element) {
jQuery(element).closest('tr').fadeOut('slow', function () {
jQuery(this).remove();
} );
}
jQuery('<td><a href="#" class="add-remove link-rss-params-remove"><span class="x">(X)</span> Remove</a></td>').insertAfter('.link-rss-params-value-cell');
jQuery('#link-rss-params-new').hide();
jQuery('<a class="add-remove" id="link-rss-params-add" href="#">+ Add a query parameter</a>').insertAfter('#link-rss-params');
jQuery('#link-rss-params-add').click( function () {
var next = jQuery('#link-rss-params-num').val();
var newRow = jQuery('#link-rss-params-new').clone().attr('id', 'link-rss-params-'+next);
newRow.find('.link_params_key').attr('name', 'link_rss_params_key['+next+']');
newRow.find('.link_params_value').attr('name', 'link_rss_params_value['+next+']');
newRow.find('.link-rss-params-remove').click( function () {
linkParamsRowRemove(this);
return false;
} );
newRow.appendTo('#link-rss-params');
newRow.show();
// Update counter for next row.
next++;
jQuery('#link-rss-params-num').val(next);
return false;