PluginProbe
FeedWordPress / 2022.0204
FeedWordPress v2022.0204
trunk 0.8 0.9 0.91 0.95 0.96 0.97 0.98 0.981 0.99 0.991 0.992 0.993 2008.1030 2008.1101 2008.1105 2008.1214 2009.0612 2009.0613 2009.0618 2009.0707 2009.1111 2009.1112 2010.0127 2010.0528 All 65 releases
← All changes | updatedpostscontrol.class.php +30 -17 2010.05282022.0204 View file →
@@ -1,39 +1,52 @@
1 1 <?php
2 2 class UpdatedPostsControl {
3 3 var $page;
4 - function UpdatedPostsControl ($page) {
4 + function __construct( &$page ) {
5 5 $this->page =& $page;
6 6 } /* UpdatedPostsControl constructor */
7 7
8 + function UpdatedPostsControl( &$page ) {
9 + self::__construct( $page );
10 + }
11 +
8 12 function display () {
9 - $setting = array(
10 - 'yes' => 'leave unmodified',
11 - 'no' => 'update to match',
13 + $settings = array(
14 + // This is all bass-ackwards because the actual yes/no
15 + // setting is whether to *freeze* posts out of being
16 + // updated, not whether to *expose* it to being updated,
17 + // but in the UI we ask whether the user wants to
18 + // *expose* it. I have my reasons. Stop judging me!
19 + 'no' => __('Yes, update the syndicated copy to match'),
20 + 'yes' => __('No, leave the syndicated copy unmodified'),
12 21 );
13 -
14 - $global_freeze_updates = get_option('feedwordpress_freeze_updates', 'no');
22 + $params = array(
23 + 'setting-default' => 'default',
24 + 'global-setting-default' => 'no',
25 + 'labels' => array('yes' => 'leave unmodified', 'no' => 'update to match'),
26 + 'default-input-value' => 'default',
27 + );
28 +
15 29 if ($this->page->for_feed_settings()) :
16 30 $aFeed = 'this feed';
17 - $freeze_updates = $this->page->link->setting('freeze updates', NULL, 'default');
18 31 else :
19 32 $aFeed = 'a syndicated feed';
20 - $freeze_updates = $global_freeze_updates;
21 33 endif;
22 34 ?>
23 35 <tr>
24 36 <th scope="row"><?php _e('Updated posts:') ?></th>
25 - <td><p>When <?php print $aFeed; ?> includes updated content for
37 + <td><p>When <?php print esc_html( $aFeed ); ?> includes updated content for
26 38 a post that was already syndicated, should the syndicated copy
27 39 of the post be updated to match the revised version?</p>
28 - <ul>
29 - <?php if ($this->page->for_feed_settings()) : ?>
30 - <li><label><input type="radio" name="freeze_updates" value="default" <?php print ($freeze_updates=='default') ? 'checked="checked"':'' ?> /> Use the <a href="admin.php?page=<?php print $GLOBALS['fwp_path'] ?>/<?php print basename(__FILE__); ?>">site-wide setting</a> (currently: <strong><?php print $setting[$global_freeze_updates]; ?></strong>)</label></li>
31 - <?php endif; ?>
32 - <li><label><input type="radio" name="freeze_updates" value="no" <?php print ($freeze_updates!='yes' and $freeze_updates!='default') ? 'checked="checked"':'' ?> /> Yes, update the syndicated copy to match</label></li>
33 - <li><label><input type="radio" name="freeze_updates" value="yes" <?php print ($freeze_updates=='yes') ? 'checked="checked"':'' ?> /> No, leave the syndicated copy unmodified</label></li>
34 - </ul></td>
35 - </tr>
40 +
41 + <?php
42 + $this->page->setting_radio_control(
43 + 'freeze updates', 'freeze_updates',
44 + $settings, $params
45 + );
46 + ?>
47 +
48 + </td></tr>
36 49 <?php
37 50 } /* UpdatedPostsControl::display() */
38 51
39 52 function accept_POST ($post) {