PluginProbe
FeedWordPress / trunk
FeedWordPress vtrunk
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
feedwordpress / updatedpostscontrol.class.php

updatedpostscontrol.class.php in FeedWordPress trunk, at updatedpostscontrol.class.php

67 lines 1.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 class UpdatedPostsControl {
3 var $page;
4 function __construct( &$page ) {
5 $this->page =& $page;
6 } /* UpdatedPostsControl constructor */
7
8 function UpdatedPostsControl( &$page ) {
9 self::__construct( $page );
10 }
11
12 function display () {
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'),
21 );
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
29 if ($this->page->for_feed_settings()) :
30 $aFeed = 'this feed';
31 else :
32 $aFeed = 'a syndicated feed';
33 endif;
34 ?>
35 <tr>
36 <th scope="row"><?php esc_html_e('Updated posts:') ?></th>
37 <td><p>When <?php print esc_html( $aFeed ); ?> includes updated content for
38 a post that was already syndicated, should the syndicated copy
39 of the post be updated to match the revised version?</p>
40
41 <?php
42 $this->page->setting_radio_control(
43 'freeze updates', 'freeze_updates',
44 $settings, $params
45 );
46 ?>
47
48 </td></tr>
49 <?php
50 } /* UpdatedPostsControl::display() */
51
52 function accept_POST () {
53 if ($this->page->for_feed_settings()) :
54 if ( ! is_null( FeedWordPress::post( 'freeze_updates' ) ) ) :
55 $this->page->link->settings['freeze updates'] = FeedWordPress::post( 'freeze_updates' );
56 endif;
57 else :
58 // Updated posts
59 if ( ! is_null( FeedWordPress::post( 'freeze_updates' ) ) ) :
60 update_option('feedwordpress_freeze_updates', FeedWordPress::post( 'freeze_updates' ));
61 endif;
62 endif;
63 } /* UpdatedPostsControl::accept_POST() */
64 } /* class UpdatedPostsControl */
65
66
67